/* Traveler dashboard — deliberately NOT the login/register shell */

.me-page {
  margin: 0;
  min-height: 100dvh;
  color: #1a2b4a;
  font-family: "Noto Sans TC", sans-serif;
  background: #132238;
}

.me-shell {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.me-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.me-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
}
.me-bg-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(247, 244, 239, 0.88) 0%, rgba(247, 244, 239, 0.78) 42%, rgba(232, 236, 240, 0.9) 100%);
}

.me-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding:
    max(14px, env(safe-area-inset-top, 0px))
    max(18px, env(safe-area-inset-right, 0px))
    12px
    max(18px, env(safe-area-inset-left, 0px));
  background: rgba(247, 244, 239, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(26, 43, 74, 0.08);
}

.auth-nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.me-main {
  position: relative;
  z-index: 1;
  width: min(44rem, 100%);
  margin: 0 auto;
  padding: 18px max(16px, env(safe-area-inset-left, 0px)) 24px max(16px, env(safe-area-inset-right, 0px));
  flex: 1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.me-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 14px 36px rgba(18, 28, 40, 0.12);
  margin-bottom: 14px;
}

.me-profile-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.me-card h1 {
  margin: 0 0 6px;
  font-family: "Noto Serif TC", serif;
  font-size: clamp(1.45rem, 3.5vw, 1.85rem);
  color: #1a2b4a;
}

.me-email,
.me-quota,
.me-hint,
.me-list-meta {
  margin: 0;
  color: #243656;
  line-height: 1.5;
}

.me-quota,
.me-hint,
.me-list-meta {
  margin-top: 8px;
  font-size: 0.88rem;
  color: #5c6b7a;
}

.me-toolbar {
  display: grid;
  grid-template-columns: 1fr minmax(8rem, 10rem);
  gap: 8px;
  margin-top: 12px;
}

.me-toolbar input,
.me-toolbar select {
  width: 100%;
  border: 1px solid rgba(26, 43, 74, 0.16);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  color: #1a2b4a;
}

.me-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.me-page-btn {
  border: 1px solid rgba(26, 43, 74, 0.16);
  background: #fff;
  color: #1a2b4a;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}

.me-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.me-page-info {
  font-size: 13px;
  font-weight: 700;
  color: #5c6b7a;
  font-variant-numeric: tabular-nums;
}

.me-tabs {
  display: flex;
  gap: 4px;
  margin: 16px 0 12px;
  border-bottom: 1px solid rgba(26, 43, 74, 0.1);
  overflow-x: auto;
}

.me-tab {
  border: 0;
  background: transparent;
  color: #5c6b7a;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.me-tab.is-active {
  color: #1a2b4a;
  border-bottom-color: #1a2b4a;
}

.me-panel {
  padding-top: 4px;
}

@media (max-width: 560px) {
  .me-toolbar {
    grid-template-columns: 1fr;
  }
}

.me-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.me-card-head h2 {
  margin: 0;
  font-size: 1.15rem;
  color: #1a2b4a;
}

.me-journey-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.me-empty {
  margin: 0;
  color: #5c6b7a;
  font-size: 0.95rem;
}

.me-journey-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(26, 43, 74, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.me-journey-item:hover,
.me-journey-item:focus-visible {
  background: #fff;
  border-color: rgba(26, 43, 74, 0.28);
  outline: none;
}

.me-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  background: #d9e2ea;
}

.me-thumb-empty {
  background: linear-gradient(135deg, rgba(26, 43, 74, 0.08), rgba(26, 43, 74, 0.18));
}

.me-journey-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.me-journey-body strong {
  display: block;
  font-size: 0.98rem;
  color: #1a2b4a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #1a2b4a;
  background: rgba(26, 43, 74, 0.08);
  border-radius: 999px;
  padding: 3px 8px;
}

.me-journey-body .meta {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #5c6b7a;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.me-chevron {
  color: #8a97a8;
  font-size: 1.35rem;
  line-height: 1;
}

.me-detail.hidden,
.hidden {
  display: none !important;
}

.me-back {
  border: 0;
  background: transparent;
  color: #1a2b4a;
  font: inherit;
  font-weight: 700;
  padding: 0;
  margin: 0 0 12px;
  cursor: pointer;
}

.me-cover-wrap {
  border-radius: 14px;
  overflow: hidden;
  background: rgba(26, 43, 74, 0.08);
  margin-bottom: 14px;
  min-height: 140px;
}

.me-cover {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

.me-cover-empty {
  padding: 48px 16px;
  text-align: center;
  color: #5c6b7a;
  font-size: 0.92rem;
}

.me-field {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 6px;
  color: #1a2b4a;
}

.me-title-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.me-title-row input {
  flex: 1;
  border: 1px solid rgba(26, 43, 74, 0.16);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
}

.me-meta-line {
  margin: 0 0 12px;
  color: #5c6b7a;
  font-size: 0.9rem;
}

.me-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.me-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  color: #1a2b4a;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(26, 43, 74, 0.14);
  cursor: pointer;
}

.me-btn.primary {
  background: #1a2b4a;
  color: #fff;
  border-color: #1a2b4a;
}

.me-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(26, 43, 74, 0.1);
}

.me-block h3 {
  margin: 0 0 10px;
  font-size: 0.98rem;
  color: #1a2b4a;
}

.me-audio-row {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.me-audio-row span {
  font-size: 12px;
  font-weight: 700;
  color: #5c6b7a;
}

.me-audio-row audio { width: 100%; }

.me-lyric-title {
  margin: 0 0 8px;
  font-family: "Noto Serif TC", serif;
  font-weight: 700;
}

.me-lyric-label {
  margin: 10px 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: #5c6b7a;
}

.me-block pre {
  margin: 0;
  white-space: pre-wrap;
  font: inherit;
  line-height: 1.55;
  color: #243656;
}

#meCoverFile {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  font: inherit;
}

.me-footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 20px 16px max(24px, env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 12px;
  color: #5c6b7a;
  background: rgba(247, 244, 239, 0.7);
}

.me-footer .footer-copy { margin: 0 0 8px; }
.me-footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 14px;
}
.me-footer a {
  color: #1a2b4a;
  font-weight: 700;
  text-decoration: none;
}

.status {
  margin-top: 10px;
  min-height: 1.2em;
  font-size: 14px;
  color: #5c6b7a;
}
.status.error { color: #a12622; font-weight: 600; }
.status.ok { color: #1f565c; font-weight: 600; }
