/* ====================================================
   SkyFam - UX-first stylesheet
   Design principles:
   1. Mobile-first (base styles work on phones)
   2. 10-second scanability (high contrast, big targets)
   3. Calm warmth (not tech-bro dark; family-friendly)
   ==================================================== */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Noto Sans TC", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1a1a2e;
  background: #fefbf6;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}
html { overflow-x: hidden; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ============ TOKENS ============ */
:root {
  --bg: #fefbf6;
  --bg-soft: #f5f0e8;
  --bg-warm: #fff8ec;
  --surface: #ffffff;
  --ink: #1a1a2e;
  --ink-soft: #56566d;
  --ink-mute: #9090a0;
  --line: #e8e3dc;
  --line-soft: #efebe4;
  --brand-accent: #ffd166;

  --c-redeye: #e11d48;
  --c-redeye-bg: #fee2e2;
  --c-redeye-border: #fca5a5;
  --c-redeye-ink: #991b1b;

  --c-dawn: #f97316;
  --c-dawn-bg: #ffedd5;
  --c-dawn-border: #fdba74;
  --c-dawn-ink: #9a3412;

  --c-day: #0ea5e9;
  --c-day-bg: #e0f2fe;
  --c-day-border: #7dd3fc;
  --c-day-ink: #075985;

  --c-evening: #7c3aed;
  --c-evening-bg: #ede9fe;
  --c-evening-border: #c4b5fd;
  --c-evening-ink: #5b21b6;

  --c-layover: #0d9488;
  --c-layover-bg: #ccfbf1;
  --c-layover-border: #5eead4;
  --c-layover-ink: #115e59;

  --c-standby: #a855f7;
  --c-standby-bg: #f5f3ff;
  --c-standby-border: #ddd6fe;
  --c-standby-ink: #6d28d9;

  --c-buffer: #d97706;
  --c-buffer-bg: #fef9c3;
  --c-buffer-border: #fde68a;
  --c-buffer-ink: #854d0e;

  --c-off: #10b981;
  --c-off-bg: #dcfce7;
  --c-off-border: #86efac;
  --c-off-ink: #166534;

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;

  --shadow-sm: 0 1px 2px rgba(30,30,50,0.06);
  --shadow: 0 10px 30px -8px rgba(30,30,50,0.12), 0 2px 6px rgba(30,30,50,0.04);
  --shadow-lg: 0 30px 80px -20px rgba(30,30,50,0.25);
  --shadow-card: 0 2px 8px rgba(30,30,50,0.05), 0 1px 2px rgba(30,30,50,0.03);

  --t-fast: 0.15s ease;
  --t: 0.25s ease;
}

/* ============ BUTTONS (touch-friendly 44px+) ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  min-height: 48px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  transition: transform var(--t-fast), box-shadow var(--t), background var(--t), color var(--t);
  white-space: nowrap;
  cursor: pointer;
  text-align: center;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 25px -8px rgba(0,0,0,0.4); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--bg); }
.btn-sm { padding: 10px 18px; min-height: 38px; font-size: 14px; }

/* Clerk login modal */
.clerk-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,15,30,0.6);
  backdrop-filter: blur(8px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.clerk-modal-inner {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  max-width: 440px;
  width: 100%;
  min-height: 300px;
  overflow: hidden;
}

/* Nav user / auth */
.nav-user { display: flex; align-items: center; gap: 6px; }
.nav-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--brand-accent);
  cursor: pointer;
  padding: 0;
  background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
}
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }
.nav-avatar span { font-size: 14px; font-weight: 800; color: var(--ink); }
.nav-login { white-space: nowrap; }

/* ============ NAV ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(254,251,246,0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  max-width: 1180px;
  margin: 0 auto;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 19px; }
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--brand-accent);
  font-size: 16px;
}
.nav-links {
  display: flex;
  gap: 28px;
  font-weight: 500;
  font-size: 15px;
  color: var(--ink-soft);
}
.nav-links a { transition: color var(--t-fast); }
.nav-links a:hover { color: var(--ink); }
.nav-tutorial { display: inline-flex; }

@media (max-width: 820px) {
  .nav-links, .nav-tutorial { display: none; }
  .nav-inner { gap: 8px; padding: 10px 12px; }
  .nav-user { gap: 4px; }
  .nav-user .btn-sm { padding: 6px 10px; font-size: 12px; }
  .nav-avatar { width: 28px; height: 28px; }
  .logo { font-size: 16px; }
  .logo-mark { width: 26px; height: 26px; font-size: 14px; }
}

/* ============ HERO ============ */
.hero {
  padding: 56px 0 72px;
  background:
    radial-gradient(ellipse at 15% 10%, #ffe7c7 0%, transparent 55%),
    radial-gradient(ellipse at 85% 40%, #ffd9e4 0%, transparent 50%),
    var(--bg);
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.75);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 20px;
  letter-spacing: 0.04em;
}
.eyebrow-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-redeye);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}
.hero h1 {
  font-size: clamp(34px, 6vw, 60px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.hero h1 .hl {
  background: linear-gradient(110deg, #ffd166 0%, #ef476f 60%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: clamp(15px, 1.8vw, 18px);
  color: var(--ink-soft);
  margin: 20px 0 28px;
  line-height: 1.6;
}
.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

/* Trust badges replace fake stats */
.trust-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.trust-badge {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.trust-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.trust-badge small {
  display: block;
  font-weight: 400;
  color: var(--ink-mute);
  font-size: 12px;
  margin-top: 2px;
}

/* Phone preview */
.hero-preview {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.preview-phone {
  width: 300px;
  aspect-ratio: 320 / 640;
  background: #0f172a;
  border-radius: 42px;
  padding: 14px 12px;
  box-shadow: var(--shadow-lg), inset 0 0 0 2px rgba(255,255,255,0.08);
  position: relative;
  transform: rotate(-3deg);
  transition: transform 0.6s cubic-bezier(.2,.9,.3,1);
}
.preview-phone:hover { transform: rotate(0deg) scale(1.02); }
.preview-notch {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 24px;
  background: #000;
  border-radius: 14px;
  z-index: 3;
}
.preview-screen {
  width: 100%;
  height: 100%;
  background: var(--bg);
  border-radius: 30px;
  padding: 48px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
.pv-day-label { font-size: 11px; color: var(--ink-mute); font-weight: 600; letter-spacing: 0.1em; }
.pv-date { font-size: 22px; font-weight: 900; margin: -2px 0 4px; }
.pv-headline {
  padding: 10px 12px;
  background: var(--c-redeye-bg);
  border-radius: 12px;
  border-left: 4px solid var(--c-redeye);
  font-size: 15px;
  font-weight: 700;
  color: var(--c-redeye-ink);
  line-height: 1.3;
}
.pv-route {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 12px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
}
.pv-route .arrow { color: var(--ink-soft); font-size: 13px; }
.pv-flight { font-size: 11px; color: var(--ink-mute); text-align: center; font-weight: 500; }
.pv-times { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pv-time-card {
  padding: 9px 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.pv-time-label { font-size: 10px; color: var(--ink-mute); font-weight: 600; }
.pv-time-val { font-size: 18px; font-weight: 800; margin-top: 2px; }
.pv-time-val.urgent { color: var(--c-redeye); }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-cta { justify-content: center; }
  .trust-row { text-align: left; }
  .hero-preview { order: -1; margin-bottom: 12px; }
  .preview-phone { width: 260px; transform: rotate(-2deg); }
}
@media (max-width: 480px) {
  .trust-row { grid-template-columns: 1fr; }
  .preview-phone { width: 240px; }
}

/* ============ SECTION SCAFFOLD ============ */
.section-head { text-align: center; margin-bottom: 44px; padding: 0 4px; }
.section-head h2 { font-size: clamp(26px, 4vw, 40px); }
.section-head p { color: var(--ink-soft); font-size: 16px; margin-top: 10px; }
.eyebrow-dark {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--brand-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--line);
}

/* ============ HOW IT WORKS ============ */
.how { padding: 80px 0; }
.steps {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 16px;
  align-items: stretch;
  max-width: 1000px;
  margin: 0 auto;
}
.step {
  padding: 28px 20px 24px;
  text-align: center;
  position: relative;
  transition: transform var(--t);
}
.step:hover { transform: translateY(-3px); }
.step-num {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  background: var(--ink);
  color: var(--brand-accent);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 15px;
}
.step-icon { font-size: 42px; margin: 8px 0 12px; }
.step h3 { font-size: 19px; margin-bottom: 8px; }
.step p { color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.step-hint {
  margin-top: 14px;
  font-size: 12px;
  color: var(--ink-mute);
  padding: 6px 10px;
  background: var(--bg-soft);
  border-radius: 8px;
  display: inline-block;
}
.step-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--ink-mute);
}
.how-cta { text-align: center; margin-top: 36px; }

@media (max-width: 820px) {
  .steps {
    grid-template-columns: 1fr;
  }
  .step-arrow { transform: rotate(90deg); padding: 4px 0; }
}

/* ============ DEMO ============ */
.demo { padding: 80px 0; background: var(--bg-soft); }
.demo-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) {
  .demo-grid { grid-template-columns: 1fr; }
}

/* Calendar */
.calendar { padding: 22px; }
.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cal-nav {
  width: 40px; height: 40px;
  border-radius: 12px;
  font-size: 22px;
  color: var(--ink-soft);
  transition: background var(--t-fast);
}
.cal-nav:hover { background: var(--bg-soft); }
.cal-title { text-align: center; }
.cal-year { display: block; font-size: 12px; color: var(--ink-mute); letter-spacing: 0.1em; }
.cal-month { display: block; font-size: 22px; font-weight: 800; }
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 0 4px 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.wd { text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-mute); letter-spacing: 0.1em; }
.wd-sun { color: #ef476f; }
.wd-sat { color: #118ab2; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.day {
  aspect-ratio: 1 / 1.15;
  min-height: 58px;
  border-radius: 12px;
  padding: 6px 4px 5px;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  transition: transform var(--t-fast), box-shadow var(--t), border-color var(--t);
  border: 1.5px solid transparent;
  position: relative;
  text-align: left;
  overflow: hidden;
}
.day:hover:not(.empty) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.day:active:not(.empty) {
  transform: translateY(0);
}
.day.empty { cursor: default; pointer-events: none; }
.day .day-num { font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1; }
.day .day-emoji,
.day .day-icon {
  font-size: 20px;
  line-height: 1;
  margin-top: 4px;
  text-align: center;
  display: flex;
  justify-content: center;
}
.day .day-icon svg { width: 18px; height: 18px; stroke-width: 2; }
.day .day-code {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-mute);
  margin-top: auto;
  letter-spacing: 0.02em;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.day.is-sun .day-num { color: #ef476f; }
.day.is-sat .day-num { color: #118ab2; }

/* 3-group calendar: fly / away / free */
.day.grp-fly {
  background: #fff8ed;
  border-color: #f0c878;
}
.day.grp-fly .day-num { color: #92600a; }
.day.grp-fly .day-badge { color: #92600a; }
.day.grp-fly .day-label { color: #b07018; }

.day.grp-fly.urgent {
  background: #fff0f0;
  border-color: #f0a0a0;
}
.day.grp-fly.urgent .day-num { color: var(--c-redeye-ink); }
.day.grp-fly.urgent .day-badge { color: var(--c-redeye-ink); }
.day.grp-fly.urgent .day-label {
  color: var(--c-redeye);
  font-weight: 900;
}

.day.grp-away {
  background: #eef0ff;
  border-color: #8890d8;
}
.day.grp-away .day-num { color: #3b3f8a; }
.day.grp-away .day-badge { color: #3b3f8a; }

.day.grp-free {
  background: #f0faf0;
  border-color: #a0d8a0;
}
.day.grp-free .day-num { color: var(--c-off-ink); }
.day.grp-free .day-badge { color: var(--c-off-ink); }

/* Badge: icon + text label inside cell */
.day-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  margin-top: 2px;
}
.day-badge svg { width: 14px; height: 14px; stroke-width: 2.2; }
.day-label {
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}

.day.selected {
  border: 2.5px solid var(--ink);
  box-shadow: 0 0 0 4px rgba(15,23,42,0.12), var(--shadow-sm);
  transform: translateY(-2px);
  z-index: 1;
}
.day.today::after {
  content: '';
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  background: var(--c-redeye);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--surface);
}

/* Legend */
.legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}
.legend-item small { color: var(--ink-mute); font-size: 11px; margin-left: 2px; }
.lgd { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; }
.lgd-fly   { background: #fff8ed; border: 1.5px solid #f0c878; }
.lgd-fly.urgent { background: #fff0f0; border-color: #f0a0a0; }
.lgd-away  { background: #eef0ff; border: 1.5px solid #8890d8; }
.lgd-free  { background: #f0faf0; border: 1.5px solid #a0d8a0; }

/* Detail Panel */
.detail {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 520px;
  animation: detailIn 0.3s ease;
}
@media (max-width: 900px) {
  .detail { min-height: auto; }
}
@keyframes detailIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.dt-date-bar {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.dt-date { font-size: 34px; font-weight: 900; letter-spacing: -0.02em; }
.dt-weekday { font-size: 14px; color: var(--ink-mute); font-weight: 600; }
.dt-today-tag {
  margin-left: auto;
  padding: 4px 10px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.dt-headline {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 14px;
  background: var(--bg-soft);
  border-left: 5px solid var(--c-day);
}
.dt-headline.redeye  { border-color: var(--c-redeye);  background: var(--c-redeye-bg);  }
.dt-headline.dawn    { border-color: var(--c-dawn);    background: var(--c-dawn-bg);    }
.dt-headline.day     { border-color: var(--c-day);     background: var(--c-day-bg);     }
.dt-headline.evening { border-color: var(--c-evening); background: var(--c-evening-bg); }
.dt-headline.layover { border-color: var(--c-layover); background: var(--c-layover-bg); }
.dt-headline.standby { border-color: var(--c-standby); background: var(--c-standby-bg); }
.dt-headline.buffer  { border-color: var(--c-buffer);  background: var(--c-buffer-bg);  }
.dt-headline.off     { border-color: var(--c-off);     background: var(--c-off-bg);     }
.dt-headline.rest    { border-color: var(--c-off);     background: var(--c-off-bg);     }
.dt-headline .hd-emoji { font-size: 38px; line-height: 1; flex-shrink: 0; display: flex; align-items: center; }
.dt-headline .hd-emoji svg { width: 36px; height: 36px; stroke-width: 1.8; color: var(--ink); }
.dt-leave-label svg,
.pv-time-label svg,
.pv-headline svg,
.dt-note svg { width: 1em; height: 1em; display: inline-block; vertical-align: -2px; margin-right: 4px; stroke-width: 2; }
.dt-leave-label svg { color: var(--brand-accent); }
.pv-headline svg { width: 18px; height: 18px; color: var(--c-redeye-ink); }
.dt-headline .hd-text { flex: 1; min-width: 0; }
.dt-headline .hd-title { font-size: 19px; font-weight: 800; color: var(--ink); line-height: 1.3; }
.dt-headline .hd-sub { font-size: 14px; color: var(--ink-soft); margin-top: 4px; }

.dt-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--c-redeye-bg);
  border: 1.5px solid var(--c-redeye-border);
  border-radius: 12px;
  color: var(--c-redeye-ink);
  font-weight: 700;
  font-size: 14px;
}
.dt-alert .alert-icon { font-size: 20px; }
.dt-alert strong { font-weight: 800; }

.dt-times-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.dt-time-card {
  padding: 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.dt-time-card.highlight {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.dt-time-card.highlight .tc-label { color: var(--brand-accent); }
.dt-time-card .tc-label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; color: var(--ink-mute); text-transform: uppercase; }
.dt-time-card .tc-time { font-size: 28px; font-weight: 800; margin-top: 4px; letter-spacing: -0.01em; }
.dt-time-card .tc-date { font-size: 12px; color: var(--ink-mute); margin-top: 2px; }
.dt-time-card.highlight .tc-date { color: #c3c3d4; }

.dt-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #fef3c7, #fed7aa);
  border-radius: 14px;
}
.dt-route .rt-city { text-align: center; flex: 1; }
.dt-route .rt-city strong { display: block; font-size: 22px; font-weight: 800; }
.dt-route .rt-city small { font-size: 11px; color: var(--ink-soft); font-weight: 500; }
.dt-route .rt-plane { font-size: 24px; flex-shrink: 0; margin: 0 8px; }
.dt-route-flight {
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 8px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.dt-explain {
  padding: 14px;
  border-radius: 12px;
  background: var(--bg-soft);
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.65;
}
.dt-explain strong { color: var(--ink); font-weight: 700; }

/* 精簡版詳情:一張大卡講「幾點出門」+ 一行備註 */
.dt-leave {
  padding: 20px 18px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--bg);
  text-align: center;
}
.dt-leave-label { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; color: var(--brand-accent); }
.dt-leave-time { font-size: 44px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.1; margin-top: 6px; }
.dt-leave-date { font-size: 13px; color: #c3c3d4; margin-top: 4px; }

.dt-note {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-soft);
  font-size: 13px;
  color: var(--ink-soft);
}
.dt-note span { white-space: nowrap; }
@media (max-width: 900px) {
  .dt-leave-time { font-size: 36px; }
}

/* ============ PRIVACY ============ */
.privacy { padding: 80px 0; background: var(--ink); color: var(--bg); }
.privacy-inner {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 56px;
  align-items: center;
}
.privacy h2 { color: var(--bg); font-size: clamp(28px, 4vw, 42px); }
.privacy > .container > .privacy-inner > .privacy-text > .eyebrow-dark {
  background: var(--brand-accent);
  color: var(--ink);
}
.privacy-text .eyebrow-dark {
  background: var(--brand-accent);
  color: var(--ink);
}
.privacy-text > p {
  color: #c3c3d4;
  margin: 20px 0 28px;
  font-size: 16px;
  line-height: 1.6;
}
.privacy-list { display: flex; flex-direction: column; gap: 16px; }
.privacy-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.privacy-list li strong {
  display: block;
  color: var(--bg);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}
.privacy-list li span {
  display: block;
  color: #c3c3d4;
  font-size: 14px;
  line-height: 1.55;
}
.pv-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  background: var(--brand-accent);
  color: var(--ink);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  margin-top: 2px;
}

.privacy-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.privacy-shield {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shield-inner {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-accent), #fb923c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  z-index: 3;
  box-shadow: 0 0 80px rgba(255, 209, 102, 0.3);
}
.shield-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,209,102,0.3);
}
.shield-ring-1 { width: 180px; height: 180px; animation: ringPulse 3s ease-in-out infinite; }
.shield-ring-2 { width: 220px; height: 220px; animation: ringPulse 3s ease-in-out infinite 0.5s; }
@keyframes ringPulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.04); }
}
.privacy-caption {
  font-size: 12px;
  letter-spacing: 0.2em;
  font-weight: 700;
  color: var(--brand-accent);
  text-transform: uppercase;
}

@media (max-width: 820px) {
  .privacy-inner { grid-template-columns: 1fr; gap: 32px; }
  .privacy-visual { order: -1; }
  .privacy-shield { width: 180px; height: 180px; }
  .shield-inner { width: 110px; height: 110px; font-size: 48px; }
  .shield-ring-1 { width: 140px; height: 140px; }
  .shield-ring-2 { width: 170px; height: 170px; }
}

/* ============ FEATURES ============ */
.features { padding: 80px 0; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 18px;
}
.feature { padding: 28px; transition: transform var(--t); }
.feature:hover { transform: translateY(-3px); }
.feature-icon { font-size: 34px; margin-bottom: 10px; }
.feature h3 { font-size: 18px; margin-bottom: 8px; }
.feature p { color: var(--ink-soft); font-size: 14.5px; line-height: 1.55; }

/* ============ FOUNDER NOTE ============ */
.founder { padding: 72px 0; background: var(--bg-warm); }
.founder-inner { max-width: 720px; margin: 0 auto; text-align: center; }
.founder-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.1em;
  margin-bottom: 24px;
}
.founder blockquote { margin: 0; }
.founder blockquote p {
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 700;
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 14px;
}
.founder blockquote p.muted {
  font-size: 15px;
  font-weight: 400;
  color: var(--ink-mute);
  font-style: italic;
  line-height: 1.6;
}
.founder blockquote footer {
  margin-top: 20px;
  font-size: 13px;
  color: var(--ink-mute);
  letter-spacing: 0.08em;
}

/* ============ PRICING / WAITLIST ============ */
.pricing { padding: 80px 0; background: var(--bg-soft); }
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
}
@media (max-width: 768px) {
  .plan-grid { grid-template-columns: 1fr; max-width: 400px; }
}
.plan {
  padding: 32px 28px;
  text-align: center;
  position: relative;
  transition: transform var(--t);
}
.plan:hover { transform: translateY(-3px); }
.plan-featured {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.plan-featured .plan-name,
.plan-featured .plan-save,
.plan-featured .plan-features li { color: var(--bg); }
.plan-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-accent);
  color: var(--ink);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.plan-name { font-size: 14px; font-weight: 700; letter-spacing: 0.12em; color: var(--ink-mute); text-transform: uppercase; }
.plan-price { margin: 14px 0 2px; display: flex; align-items: baseline; justify-content: center; gap: 4px; flex-wrap: wrap; }
.plan-price .currency { font-size: 15px; font-weight: 600; }
.plan-price .amount { font-size: 52px; font-weight: 900; line-height: 1; letter-spacing: -0.03em; }
.plan-price .per { font-size: 14px; color: var(--ink-mute); }
.plan-featured .plan-price .per { color: #c3c3d4; }
.plan-old {
  font-size: 14px;
  color: var(--ink-mute);
  text-decoration: line-through;
  margin-bottom: 2px;
}
.plan-featured .plan-old { color: #9090a0; }
.plan-save { font-size: 13px; color: var(--c-off); font-weight: 700; margin-bottom: 16px; }
.plan-features { margin: 20px 0 24px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.plan-features li {
  padding-left: 26px;
  font-size: 14.5px;
  position: relative;
  color: var(--ink-soft);
  line-height: 1.5;
}
.plan-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  font-weight: 900;
  color: var(--c-off);
}
.plan-limit { color: var(--ink-mute) !important; }
.plan-limit::before { content: '—' !important; color: var(--ink-mute) !important; }
.plan .btn { width: 100%; }
.pricing-honest {
  max-width: 600px;
  margin: 28px auto 0;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 14px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.pricing-honest strong { color: var(--ink); }

/* ============ FOOTER ============ */
.footer { padding: 44px 0 32px; background: var(--ink); color: #c3c3d4; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand p { font-size: 13px; margin-top: 6px; color: #9090a0; }
.footer-brand .logo { color: var(--bg); }
.footer-links { display: flex; gap: 22px; font-size: 14px; }
.footer-links a { color: #c3c3d4; transition: color var(--t-fast); }
.footer-links a:hover { color: var(--bg); }
.footer-meta { display: flex; gap: 20px; font-size: 12px; color: #7a7a8c; }

@media (max-width: 640px) {
  .footer-inner { flex-direction: column; align-items: flex-start; text-align: left; }
  .footer-links { flex-wrap: wrap; }
}

/* ============ MODAL ============ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15,15,30,0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--surface);
  padding: 36px 28px;
  border-radius: 22px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { transform: scale(0.92) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-emoji { font-size: 52px; margin-bottom: 10px; }
.modal-card h3 { font-size: 22px; margin-bottom: 10px; }
.modal-card p { color: var(--ink-soft); margin-bottom: 22px; line-height: 1.6; }
.modal-card .btn { width: 100%; }

/* ============ UPLOAD MODAL ============ */
.upload-modal { align-items: flex-start; padding: 24px 12px; overflow-y: auto; }
.upload-modal .upload-card {
  max-width: 640px;
  width: 100%;
  text-align: left;
  padding: 24px 22px 22px;
  position: relative;
  margin: 0 auto;
}
.upload-x {
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink-soft);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast);
}
.upload-x:hover { background: var(--line); color: var(--ink); }

.upload-head { margin-bottom: 18px; padding-right: 40px; }
.upload-head h3 { font-size: 22px; margin-bottom: 6px; }
.upload-sub { color: var(--ink-soft); font-size: 13px; line-height: 1.55; margin: 0; }
.upload-sub strong { color: var(--c-off-ink); }

.upload-section {
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
}
.upload-section:first-of-type { border-top: none; padding-top: 4px; }

.upload-label {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 14px;
  margin-bottom: 10px;
  color: var(--ink);
}
.upload-label-row { justify-content: space-between; }
.upload-step {
  display: inline-flex;
  width: 22px; height: 22px;
  background: var(--ink); color: var(--brand-accent);
  border-radius: 50%;
  align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900;
}

.upload-month-picker {
  display: flex;
  gap: 8px;
}
.month-pick-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all var(--t-fast);
}
.month-pick-btn:hover { border-color: var(--ink); color: var(--ink); }
.month-pick-btn.active {
  background: var(--ink);
  color: var(--brand-accent);
  border-color: var(--ink);
}

.upload-row { display: flex; gap: 10px; }
.upload-select {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.upload-select:focus { outline: none; border-color: var(--ink); }

/* Dropzone */
.upload-dropzone {
  display: block;
  position: relative;
  min-height: 140px;
  border: 2px dashed var(--line);
  border-radius: 14px;
  background: var(--bg-warm);
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.upload-dropzone:hover { border-color: var(--ink); background: var(--bg-soft); }
.upload-dz-inner {
  padding: 28px 20px;
  text-align: center;
}
.upload-dz-icon { font-size: 36px; margin-bottom: 8px; }
.upload-dz-text { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.upload-dz-hint { font-size: 12px; color: var(--ink-mute); }
#upload-preview {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  background: #000;
  display: block;
}

/* OCR button + progress */
.upload-ocr-row {
  margin-top: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.upload-ocr-btn { width: 100%; }
.upload-ocr-btn:disabled { opacity: 0.7; cursor: progress; }
.upload-ocr-note {
  font-size: 12px;
  color: var(--ink-mute);
  text-align: center;
  line-height: 1.5;
}

.upload-ocr-progress {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--bg-warm);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.ocr-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.ocr-bar-track {
  height: 6px;
  background: var(--line-soft);
  border-radius: 999px;
  overflow: hidden;
}
.ocr-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--c-day), var(--c-off));
  border-radius: 999px;
  transition: width 0.2s ease;
}
.ocr-hint {
  margin-top: 8px;
  font-size: 11px;
  color: var(--ink-mute);
  line-height: 1.5;
}

/* Parse summary */
.upload-parse-summary {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: transparent;
}
.upload-parse-summary.ok {
  background: var(--c-off-bg);
  color: var(--c-off-ink);
}
.upload-parse-summary.warn {
  background: var(--c-redeye-bg);
  color: var(--c-redeye-ink);
}

/* Upload mini calendar */
/* Reference image panel */
.upload-ref {
  margin-bottom: 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}
.upload-ref-label {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-mute);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
.upload-ref-img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  display: block;
}

.upload-grid-hint {
  font-size: 12px;
  color: var(--ink-mute);
  line-height: 1.6;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: var(--bg-soft);
  border-radius: 8px;
}
.upload-grid-hint code {
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 11.5px;
  color: var(--ink);
  border: 1px solid var(--line);
}

.upload-grid-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-mute);
}
.upload-grid-weekdays .uw-sun { color: var(--c-redeye); }
.upload-grid-weekdays .uw-sat { color: var(--c-day); }

.upload-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.upload-cell {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  min-height: 64px;
  position: relative;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.upload-cell.empty { background: transparent; border: none; min-height: 0; }
.upload-cell-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-soft);
  padding: 3px 5px 1px;
  line-height: 1;
  flex-shrink: 0;
}
.upload-cell input {
  flex: 1;
  border: none;
  background: var(--bg-warm);
  width: 100%;
  padding: 4px 4px 5px;
  font-family: "SF Mono", Menlo, "Noto Sans TC", monospace;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  color: var(--ink);
  outline: none;
  min-width: 0;
  border-top: 1px solid var(--line-soft);
  letter-spacing: 0.02em;
}
.upload-cell input::placeholder { color: var(--ink-mute); font-weight: 400; font-family: "Noto Sans TC", sans-serif; }
.upload-cell:focus-within { border-color: var(--ink); z-index: 2; box-shadow: 0 0 0 3px rgba(15,23,42,0.15); }

/* Cell with image background (inverted: light bg, dark text) */
.upload-cell.has-bg {
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  border-color: #b0a8a0;
  overflow: hidden;
}
.upload-cell.has-bg .upload-cell-num {
  background: rgba(255,255,255,0.8);
  color: var(--ink);
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 900;
  z-index: 1;
}
.upload-cell.has-bg input {
  background: #fff;
  border-top: 1.5px solid var(--ink-mute);
  padding: 5px 3px;
  font-size: 12px;
  z-index: 1;
}

/* Inferred cell: yellow left accent + softer background */
.upload-cell.inferred {
  border-left: 3px solid #e8a820;
  background: #fffbf0;
}
.upload-cell.inferred .upload-cell-num::after {
  content: ' ?';
  font-size: 9px;
  color: #d49000;
  font-weight: 600;
}
.upload-cell.inferred input {
  background: #fffbf0;
}

/* Upload cell: 3 groups matching the main calendar */
.upload-cell.cat-redeye, .upload-cell.cat-dawn,
.upload-cell.cat-day, .upload-cell.cat-evening {
  border-left: 3px solid #f0c878;
  background: #fff8ed;
}
.upload-cell.cat-layover { border-left: 3px solid #80d0c0; background: #f0faf8; }
.upload-cell.cat-standby { border-left: 3px solid #a0d8a0; background: #f0faf0; }
.upload-cell.cat-rest    { border-left: 3px solid #a0d8a0; background: #f0faf0; }

.upload-cell.cat-redeye  { background: var(--c-redeye-bg);  border-color: var(--c-redeye-border);  color: var(--c-redeye-ink); }
.upload-cell.cat-dawn    { background: var(--c-dawn-bg);    border-color: var(--c-dawn-border);    color: var(--c-dawn-ink); }
.upload-cell.cat-day     { background: var(--c-day-bg);     border-color: var(--c-day-border);     color: var(--c-day-ink); }
.upload-cell.cat-evening { background: var(--c-evening-bg); border-color: var(--c-evening-border); color: var(--c-evening-ink); }
.upload-cell.cat-layover { background: var(--c-layover-bg); border-color: var(--c-layover-border); color: var(--c-layover-ink); }
.upload-cell.cat-standby { background: var(--c-standby-bg); border-color: var(--c-standby-border); color: var(--c-standby-ink); }
.upload-cell.cat-rest    { background: var(--c-off-bg);     border-color: var(--c-off-border);     color: var(--c-off-ink); }

.upload-legend {
  display: flex; flex-wrap: wrap; gap: 6px 12px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--ink-soft);
}
.u-lg { display: inline-flex; align-items: center; gap: 4px; }
.u-dot {
  width: 10px; height: 10px; border-radius: 3px;
  display: inline-block;
  border: 1px solid transparent;
}
.u-dot-fly   { background: #fff8ed; border-color: #f0c878; }
.u-dot-away  { background: #f0faf8; border-color: #80d0c0; }
.u-dot-free  { background: #f0faf0; border-color: #a0d8a0; }

/* OCR debug raw text */
.upload-ocr-debug {
  margin-top: 10px;
  font-size: 12px;
}
.upload-ocr-debug summary {
  cursor: pointer;
  color: var(--ink-mute);
  font-weight: 600;
  padding: 4px 0;
  list-style: none;
}
.upload-ocr-debug summary::-webkit-details-marker { display: none; }
.upload-ocr-debug summary::before { content: '▸ '; }
.upload-ocr-debug[open] summary::before { content: '▾ '; }
.upload-ocr-raw {
  margin: 6px 0 0;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-soft);
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Quick fill bar */
.upload-quick {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg-warm);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.upload-quick-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}
.upload-quick-title span { color: var(--c-day); }
.upload-quick-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.upload-quick-tip {
  font-size: 11px;
  color: var(--ink-mute);
  margin-top: 6px;
}
.qk {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 14px;
  font-weight: 800;
  background: var(--surface);
  border: 1.5px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
  min-width: 52px;
}
.qk small {
  font-family: "Noto Sans TC", sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-mute);
  letter-spacing: 0;
}
.qk:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.qk:hover small { color: var(--bg-soft); }
.qk:active { transform: scale(0.95); }
.qk-clear { color: var(--ink-mute); border-style: dashed; font-family: inherit; }

.upload-help {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-soft);
}
.upload-help summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  padding: 6px 0;
  list-style: none;
}
.upload-help summary::-webkit-details-marker { display: none; }
.upload-help summary::before { content: '▸ '; transition: transform var(--t-fast); display: inline-block; }
.upload-help[open] summary::before { content: '▾ '; }
.upload-help ul { padding: 4px 0 0 18px; margin: 0; list-style: disc; }
.upload-help li { line-height: 1.7; }
.upload-help code {
  background: var(--bg-soft);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11.5px;
  font-family: "SF Mono", Menlo, monospace;
  color: var(--ink);
  margin-right: 4px;
}

/* Actions row */
.upload-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.upload-actions .btn { flex: 1; min-width: 100px; width: auto; }

.upload-share-row {
  margin-top: 10px;
}
.upload-share-status {
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--c-off-bg);
  color: var(--c-off-ink);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
.upload-share-url {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 11px;
  word-break: break-all;
  color: var(--ink-soft);
  user-select: all;
  cursor: text;
}

/* Consent checkbox */
.upload-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--bg-warm);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}
.upload-consent input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  width: 16px; height: 16px;
  accent-color: var(--c-off);
}
.upload-consent strong { color: var(--c-day); }
.upload-consent-hint {
  font-size: 11px;
  color: var(--ink-mute);
  margin: 4px 0 0 36px;
  line-height: 1.5;
}

.upload-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  text-align: center;
}
.upload-text-link {
  color: var(--ink-mute);
  font-size: 12px;
  text-decoration: underline;
  background: transparent;
  padding: 4px 8px;
}
.upload-text-link:hover { color: var(--c-redeye); }

/* State banner on demo */
.state-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto 20px;
  padding: 10px 14px;
  background: var(--c-layover-bg);
  border: 1px solid var(--c-layover-border);
  border-radius: 999px;
  color: var(--c-layover-ink);
  font-size: 13px;
  font-weight: 600;
}
.state-banner .sb-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c-layover);
  box-shadow: 0 0 0 4px rgba(13,148,136,0.18);
  flex-shrink: 0;
}
.state-banner .sb-label { flex: 1; }
.state-banner .sb-action {
  font-weight: 700; font-size: 13px;
  color: var(--c-layover-ink);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--c-layover-border);
}
.state-banner .sb-action:hover { background: var(--c-layover); color: var(--bg); }

/* Demo share button */
.demo-share {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 16px;
}
.demo-share-status {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-off-ink);
}

/* Share login hint */
.share-login-hint {
  margin-top: 24px;
  text-align: center;
}
.share-login-hint p {
  font-size: 16px;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

/* Leave time: bedtime tip */
.dt-leave-tip {
  margin-top: 8px;
  padding: 8px 10px;
  background: #eef0ff;
  border-radius: 8px;
  font-size: 13px;
  color: #3b3f8a;
  line-height: 1.5;
}

/* Calendar settings link */
.calendar-settings {
  margin-top: 10px;
  text-align: right;
}
.settings-link {
  font-size: 12px;
  color: var(--ink-mute);
  text-decoration: none;
}
.settings-link:hover { color: var(--ink); }

/* Free tier: blur leave time */
.dt-leave-blur {
  filter: blur(6px);
  user-select: none;
  pointer-events: none;
  color: var(--ink-mute);
}

/* ============ SWAP PREVIEW ============ */
.swap-preview { padding: 80px 0; background: var(--bg-soft); }

.swap-steps {
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-width: 600px;
  margin: 0 auto 48px;
}
.swap-step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.swap-step-num {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--brand-accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 18px;
  flex-shrink: 0;
}
.swap-step-content { flex: 1; }
.swap-step-icon { font-size: 28px; margin-bottom: 6px; }
.swap-step-content h3 { font-size: 18px; margin-bottom: 6px; }
.swap-step-content p { font-size: 14px; color: var(--ink-soft); margin-bottom: 14px; line-height: 1.6; }

/* Mock UI elements */
.swap-mock {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.swap-mock-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 20px;
  border-radius: 10px;
  background: #fff0f0;
  border: 2px solid var(--c-redeye);
}
.swap-mock-day { font-size: 20px; font-weight: 900; }
.swap-mock-code { font-family: "SF Mono", Menlo, monospace; font-size: 13px; font-weight: 700; color: var(--c-redeye-ink); }
.swap-mock-tag {
  font-size: 11px; font-weight: 700; color: #fff;
  background: var(--c-redeye);
  padding: 2px 10px; border-radius: 999px;
}

.swap-mock-results { display: flex; flex-direction: column; gap: 10px; }
.swap-result {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-warm);
}
.swap-result-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--c-day); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 15px;
}
.swap-result-info { flex: 1; }
.swap-result-info strong { display: block; font-size: 14px; }
.swap-result-info span { font-size: 12px; color: var(--ink-soft); }
.swap-result-btn {
  padding: 6px 14px; border-radius: 8px;
  background: var(--ink); color: var(--bg);
  font-size: 12px; font-weight: 700;
  border: none; cursor: default;
}
.swap-result-more { justify-content: center; color: var(--ink-mute); font-size: 13px; }

.swap-mock-done {
  display: flex; align-items: center; gap: 14px;
  background: var(--c-off-bg); border-color: var(--c-off-border);
}
.swap-done-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--c-off); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 900;
}
.swap-done-text strong { display: block; font-size: 15px; color: var(--c-off-ink); }
.swap-done-text span { font-size: 13px; color: var(--ink-soft); }

.swap-coming {
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
  padding: 28px;
  background: var(--surface);
  border-radius: 16px;
  border: 1.5px solid var(--line);
}
.swap-coming-badge {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--brand-accent);
  font-size: 13px; font-weight: 800;
  margin-bottom: 14px;
}
.swap-coming p { font-size: 14px; color: var(--ink-soft); line-height: 1.7; margin-bottom: 20px; }
.swap-coming strong { color: var(--ink); }

@media (max-width: 600px) {
  .swap-step { flex-direction: column; gap: 8px; }
  .swap-step-num { width: 32px; height: 32px; font-size: 15px; }
}

/* Swap form in detail panel */
.dt-swap-cta {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.dt-swap-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.dt-swap-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dt-swap-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-mute);
  display: block;
  margin-bottom: 6px;
}
.dt-swap-money {
  display: flex;
  gap: 6px;
}
.dt-money-btn {
  flex: 1;
  padding: 8px 4px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all var(--t-fast);
}
.dt-money-btn:hover { border-color: var(--ink); color: var(--ink); }
.dt-money-btn.active {
  background: var(--ink);
  color: var(--brand-accent);
  border-color: var(--ink);
}
.dt-swap-hint {
  font-size: 11px;
  color: var(--ink-mute);
  margin-top: 4px;
}
.dt-swap-btn {
  width: 100%;
  font-size: 15px;
  font-weight: 700;
  padding: 14px;
  border-radius: 12px;
}
.dt-swap-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Swap board section */
.swap-board-section { padding: 32px 0; }
.swap-board-header { margin-bottom: 16px; }
.swap-board-header h2 { font-size: 22px; margin-bottom: 4px; }
.swap-board-header p { font-size: 14px; color: var(--ink-soft); }

.swap-board-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.swap-board-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  transition: border-color var(--t-fast);
}
.swap-board-item:hover { border-color: var(--ink-mute); }
.swap-board-item.swap-mine { border-color: var(--c-day-border); background: var(--c-day-bg); }

.swap-board-left {
  min-width: 70px;
  text-align: center;
}
.swap-board-date {
  font-size: 20px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
}
.swap-board-code {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-mute);
  font-family: "SF Mono", Menlo, monospace;
  margin-top: 2px;
}

.swap-board-center { flex: 1; }
.swap-board-name { font-size: 14px; font-weight: 700; }
.swap-board-money {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-redeye);
  margin-top: 2px;
}
.swap-no-money { color: var(--ink-mute); }

.swap-board-right { flex-shrink: 0; }
.swap-board-mine-tag {
  font-size: 12px;
  color: var(--c-day-ink);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--c-day-bg);
  border: 1px solid var(--c-day-border);
}

.swap-take-btn { min-width: 80px; }

/* Swap match success */
.swap-match-success { text-align: center; }
.swap-match-icon { font-size: 48px; margin-bottom: 8px; }
.swap-match-success h3 { font-size: 22px; margin-bottom: 6px; }
.swap-match-money { font-size: 16px; font-weight: 700; color: var(--c-redeye); margin: 8px 0; }
.swap-match-contact {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  justify-content: center;
}
.swap-contact-card {
  padding: 14px 18px;
  background: var(--bg-warm);
  border-radius: 12px;
  border: 1px solid var(--line);
  text-align: center;
  min-width: 140px;
}
.swap-contact-label { font-size: 11px; color: var(--ink-mute); font-weight: 600; margin-bottom: 4px; }
.swap-contact-name { font-size: 15px; font-weight: 800; }
.swap-contact-empid { font-size: 13px; color: var(--c-day); font-weight: 700; margin-top: 4px; font-family: "SF Mono", Menlo, monospace; }
.swap-contact-arrow { font-size: 20px; color: var(--ink-mute); }
.swap-match-next {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 16px;
  padding: 10px;
  background: var(--c-off-bg);
  border-radius: 8px;
}

@media (max-width: 600px) {
  .swap-match-contact { flex-direction: column; }
  .swap-contact-arrow { transform: rotate(90deg); }
  .swap-board-item { flex-wrap: wrap; }
}

/* Swap modal */
.swap-card { max-width: 500px; text-align: left; position: relative; }
.swap-card h3 { margin-bottom: 8px; }
.swap-my-info { font-size: 14px; color: var(--ink-soft); margin-bottom: 16px; }
.swap-results { display: flex; flex-direction: column; gap: 8px; }
.swap-loading, .swap-empty { text-align: center; padding: 20px; color: var(--ink-mute); font-size: 14px; line-height: 1.6; }
.swap-count { font-size: 13px; font-weight: 700; color: var(--c-off-ink); margin-bottom: 4px; }

/* Swap inbox */
.swap-inbox-item {
  padding: 12px;
  background: var(--bg-warm);
  border-radius: 10px;
  margin-bottom: 8px;
}
.swap-inbox-info strong { display: block; font-size: 14px; margin-bottom: 2px; }
.swap-inbox-info span { display: block; font-size: 12px; color: var(--ink-soft); }
.swap-status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; margin-top: 4px; }
.swap-status-pending { background: #fef9c3; color: #854d0e; }
.swap-status-accepted { background: #dcfce7; color: #166534; }
.swap-status-declined { background: #fee2e2; color: #991b1b; }
.swap-inbox-actions { display: flex; gap: 6px; margin-top: 8px; }
.swap-contact { margin-top: 8px; padding: 8px 10px; background: var(--c-off-bg); border-radius: 8px; font-size: 13px; color: var(--c-off-ink); }

/* Airline counts in swap preview */
.swap-airline-counts {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin: 16px 0;
}
.swap-ac {
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-soft);
}
.swap-ac strong { color: var(--ink); font-size: 15px; }

/* Referral card */
.referral { padding: 0 0 48px; }
.referral-card {
  padding: 28px;
  background: linear-gradient(135deg, #fff8ed 0%, #fef0f0 100%);
  border: 2px solid #f0c878;
}
.referral-header { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.referral-icon { font-size: 40px; }
.referral-header h3 { font-size: 20px; margin-bottom: 4px; }
.referral-header p { font-size: 14px; color: var(--ink-soft); margin: 0; }
.referral-header strong { color: var(--c-redeye); }

.referral-progress { margin-bottom: 20px; }
.referral-bar-track {
  height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 6px;
}
.referral-bar-fill {
  height: 100%; background: linear-gradient(90deg, #f0c878, #4ade80); border-radius: 999px;
  transition: width 0.5s ease;
}
.referral-count { font-size: 14px; font-weight: 700; color: var(--ink); text-align: center; }

.referral-share { margin-bottom: 16px; }
.referral-label { font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.referral-link-row { display: flex; gap: 8px; margin-bottom: 10px; }
.referral-link {
  flex: 1; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); font-size: 13px; color: var(--ink); font-family: "SF Mono", Menlo, monospace;
}
.referral-share-btns { display: flex; gap: 8px; }
.referral-status {
  font-size: 13px; color: var(--c-off-ink); font-weight: 600; text-align: center;
}

/* Section head CTA button under the demo heading */
.section-cta { margin-top: 18px; display: flex; justify-content: center; }

/* Upload modal on small screens */
@media (max-width: 600px) {
  .upload-modal { padding: 8px 6px; }
  .upload-modal .upload-card { padding: 18px 14px 14px; border-radius: 18px; }
  .upload-actions { flex-direction: column; }
  .upload-actions .btn { width: 100%; }
  .upload-cell { min-height: 48px; }
  .upload-cell-num { font-size: 10px; }
  .upload-cell input { font-size: 10px; }
}

/* ============ MOBILE POLISH ============ */
@media (max-width: 600px) {
  .hero { padding: 36px 0 48px; }
  .how, .demo, .privacy, .features, .founder, .pricing { padding: 56px 0; }
  .calendar, .detail, .feature, .plan, .step { padding: 18px; }
  .day { min-height: 52px; aspect-ratio: 1 / 1.1; padding: 4px 2px; }
  .day .day-num { font-size: 13px; }
  .day .day-emoji { font-size: 17px; margin-top: 3px; }
  .day-badge svg { width: 12px; height: 12px; }
  .day-label { font-size: 9px; }
  .day .day-code { font-size: 9px; }
  .calendar-grid { gap: 4px; }
  .calendar-weekdays { gap: 4px; }
  .section-head { margin-bottom: 32px; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }

  /* 防止任何元素造成水平溢出 */
  .container { padding: 0 12px; }
  .section-head h2 { font-size: clamp(22px, 5vw, 36px); }
  .swap-board-item { flex-wrap: wrap; gap: 8px; }
  .swap-board-left { min-width: auto; }
  .referral-card { padding: 18px; }
  .referral-link-row { flex-direction: column; }
  .referral-share-btns { flex-direction: column; }
  .swap-match-contact { flex-direction: column; gap: 8px; }
  .swap-contact-arrow { transform: rotate(90deg); }

  /* 月曆下方的設定/分享區 */
  .calendar-settings { text-align: center; }
  .demo-share { flex-direction: column; }
  .dt-date { font-size: 28px; }
  .dt-headline .hd-emoji { font-size: 32px; }
  .dt-headline .hd-title { font-size: 17px; }
  .dt-route .rt-city strong { font-size: 19px; }
  .dt-time-card .tc-time { font-size: 24px; }
}

/* ============ TUTORIAL PAGE STYLES ============ */
.tutorial-hero {
  padding: 64px 0 32px;
  text-align: center;
  background: var(--bg-warm);
}
.tutorial-hero h1 { font-size: clamp(30px, 5vw, 48px); margin-bottom: 12px; }
.tutorial-hero p { color: var(--ink-soft); font-size: 17px; max-width: 560px; margin: 0 auto; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--ink-soft); margin-bottom: 24px;
  font-weight: 600;
}
.back-link:hover { color: var(--ink); }

.tutorial-body { padding: 48px 0 80px; }
.tutorial-step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 24px;
  margin-bottom: 48px;
  align-items: start;
}
.tutorial-step .ts-num {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--brand-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 28px;
}
.tutorial-step h2 { font-size: 24px; margin-bottom: 10px; }
.tutorial-step p { color: var(--ink-soft); font-size: 16px; line-height: 1.65; margin-bottom: 14px; }
.tutorial-step .ts-tip {
  padding: 14px 18px;
  background: var(--bg-warm);
  border-left: 4px solid var(--brand-accent);
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.tutorial-step .ts-tip strong { color: var(--ink); }
.tutorial-mock {
  margin-top: 18px;
  padding: 20px;
  background: var(--bg-soft);
  border-radius: 14px;
  border: 1px dashed var(--line);
  font-size: 14px;
  color: var(--ink-soft);
  text-align: center;
}

.faq { padding: 64px 0; background: var(--bg-soft); }
.faq-item {
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 12px;
}
.faq-item summary {
  font-weight: 700;
  cursor: pointer;
  font-size: 16px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 24px;
  font-weight: 400;
  color: var(--ink-mute);
  transition: transform var(--t);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.65;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
@media (max-width: 600px) {
  .tutorial-step { grid-template-columns: 1fr; gap: 12px; }
  .tutorial-step .ts-num { width: 52px; height: 52px; font-size: 24px; }
}
