/* 北京 · 福州 冬日跨年行 — 多主题（凛冬雪霁/极夜/冷玉/暮雪）+ 三视图（卡片/列表/地图）+ 图标极简设计 */

:root,
html[data-theme="frost"] {
  --bg: #F1F5F9;
  --bg-glow-1: rgba(56, 139, 206, 0.10);
  --bg-glow-2: rgba(148, 197, 232, 0.14);
  --surface: #FFFFFF;
  --surface-2: #F4F8FC;
  --surface-glass: rgba(241, 245, 249, 0.86);

  --hero-bg: linear-gradient(150deg, #0E2238 0%, #1C3F60 55%, #2B5C82 100%);
  --hero-fg: #F8FBFF;
  --hero-sub: rgba(226, 240, 255, 0.82);
  --hero-pill-bg: rgba(255, 255, 255, 0.14);
  --hero-pill-border: rgba(255, 255, 255, 0.22);
  --hero-pattern-opacity: 0.12;

  --accent: #1D5D8F;
  --accent-soft: #E8F2FA;
  --accent-fg: #FFFFFF;
  --accent-2: #5294C5;

  --ink: #111D2B;
  --ink-2: #4C6073;
  --ink-3: #8395A7;

  --border: #DCE6F0;
  --border-strong: #C4D5E5;

  --weather-bg: #EEF5FB;
  --weather-border: #D2E3F2;
  --weather-ink: #1B3E5E;

  --amap-bg: #EBF3FF;
  --amap-fg: #185AE0;
  --amap-border: #CFE0FF;

  --gmap-bg: #EAF7F0;
  --gmap-fg: #137842;
  --gmap-border: #C6E9D5;

  --shadow-xs: 0 1px 2px rgba(14, 34, 56, 0.04);
  --shadow-sm: 0 6px 18px rgba(14, 34, 56, 0.06);
  --shadow-md: 0 12px 30px rgba(14, 34, 56, 0.11);
}

/* 主题 2：极夜暗黑 (Obsidian Night) */
html[data-theme="dark"] {
  --bg: #0B1118;
  --bg-glow-1: rgba(56, 189, 248, 0.09);
  --bg-glow-2: rgba(99, 102, 241, 0.07);
  --surface: #131C27;
  --surface-2: #1A2534;
  --surface-glass: rgba(11, 17, 24, 0.86);

  --hero-bg: linear-gradient(150deg, #0D1724 0%, #15283E 60%, #1B3652 100%);
  --hero-fg: #F1F7FD;
  --hero-sub: rgba(186, 214, 240, 0.78);
  --hero-pill-bg: rgba(255, 255, 255, 0.09);
  --hero-pill-border: rgba(125, 200, 255, 0.22);
  --hero-pattern-opacity: 0.1;

  --accent: #56C2FF;
  --accent-soft: rgba(86, 194, 255, 0.13);
  --accent-fg: #081523;
  --accent-2: #3898D4;

  --ink: #ECF3FA;
  --ink-2: #9FB2C7;
  --ink-3: #6C8096;

  --border: #223142;
  --border-strong: #31465D;

  --weather-bg: #162333;
  --weather-border: #253A52;
  --weather-ink: #CFE7FC;

  --amap-bg: rgba(59, 130, 246, 0.15);
  --amap-fg: #7CB4FF;
  --amap-border: rgba(96, 165, 250, 0.28);

  --gmap-bg: rgba(34, 197, 94, 0.14);
  --gmap-fg: #6EE7A8;
  --gmap-border: rgba(74, 222, 128, 0.26);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.34);
  --shadow-md: 0 14px 36px rgba(0, 0, 0, 0.45);
}

/* 主题 3：冷玉极简 (Nordic Minimal) */
html[data-theme="minimal"] {
  --bg: #F8F9FA;
  --bg-glow-1: transparent;
  --bg-glow-2: transparent;
  --surface: #FFFFFF;
  --surface-2: #F3F4F6;
  --surface-glass: rgba(248, 249, 250, 0.9);

  --hero-bg: linear-gradient(180deg, #FFFFFF 0%, #F3F5F7 100%);
  --hero-fg: #111316;
  --hero-sub: #5B636E;
  --hero-pill-bg: #FFFFFF;
  --hero-pill-border: #E2E6EB;
  --hero-pattern-opacity: 0;

  --accent: #111316;
  --accent-soft: #EEF0F3;
  --accent-fg: #FFFFFF;
  --accent-2: #68707A;

  --ink: #111316;
  --ink-2: #4E5560;
  --ink-3: #8A929E;

  --border: #E6E9ED;
  --border-strong: #CFD5DC;

  --weather-bg: #F5F7F9;
  --weather-border: #E4E8ED;
  --weather-ink: #1F262E;

  --amap-bg: #F2F6FF;
  --amap-fg: #1D4ED8;
  --amap-border: #DCE6FF;

  --gmap-bg: #F0FAF4;
  --gmap-fg: #15803D;
  --gmap-border: #D2EEDD;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 3px 10px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.07);
}

/* 主题 4：暮雪金蓝 (Alpine Dusk) */
html[data-theme="dusk"] {
  --bg: #F4F3F8;
  --bg-glow-1: rgba(98, 92, 168, 0.08);
  --bg-glow-2: rgba(196, 168, 120, 0.09);
  --surface: #FFFFFF;
  --surface-2: #F5F4FA;
  --surface-glass: rgba(244, 243, 248, 0.88);

  --hero-bg: linear-gradient(148deg, #1C1C3A 0%, #343462 56%, #504A7A 100%);
  --hero-fg: #FBF9FF;
  --hero-sub: rgba(235, 229, 250, 0.82);
  --hero-pill-bg: rgba(255, 255, 255, 0.13);
  --hero-pill-border: rgba(236, 215, 178, 0.26);
  --hero-pattern-opacity: 0.11;

  --accent: #4C4985;
  --accent-soft: #EFEEF9;
  --accent-fg: #FFFFFF;
  --accent-2: #C29F67;

  --ink: #1B1A2B;
  --ink-2: #56546E;
  --ink-3: #8D8AA3;

  --border: #E5E2EE;
  --border-strong: #D0CBE0;

  --weather-bg: #F2F1FA;
  --weather-border: #DCD9EE;
  --weather-ink: #2C2954;

  --amap-bg: #EEF4FF;
  --amap-fg: #245CE2;
  --amap-border: #D5E2FF;

  --gmap-bg: #ECF8F1;
  --gmap-fg: #157B44;
  --gmap-border: #CBEBD8;

  --shadow-xs: 0 1px 2px rgba(28, 28, 58, 0.04);
  --shadow-sm: 0 6px 18px rgba(28, 28, 58, 0.06);
  --shadow-md: 0 12px 30px rgba(28, 28, 58, 0.11);
}

:root {
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "SF Pro Text", "Hiragino Sans GB", sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 10% 8%, var(--bg-glow-1) 0%, transparent 42%),
    radial-gradient(circle at 90% 22%, var(--bg-glow-2) 0%, transparent 45%);
  line-height: 1.5;
  padding-bottom: calc(56px + env(safe-area-inset-bottom));
  transition: background-color 0.25s ease, color 0.25s ease;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: none; background: none; color: inherit; cursor: pointer; padding: 0; outline: none; }

.app-shell {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}

@media (min-width: 640px) {
  body { padding-top: 18px; padding-bottom: 72px; }
  .app-shell { max-width: 600px; }
}

/* ==================== HERO ==================== */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--hero-bg);
  color: var(--hero-fg);
  padding: calc(16px + env(safe-area-inset-top)) 16px 18px;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 640px) {
  .hero {
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    padding: 22px 22px 20px;
  }
}

/* Delicate winter ice-crystal geometric watermark */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: var(--hero-pattern-opacity);
  background-image: url("data:image/svg+xml,%3Csvg width='72' height='72' viewBox='0 0 72 72' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23E3F2FF' stroke-width='0.9'%3E%3Cpath d='M36 6v60M6 36h60M15 15l42 42M57 15L15 57'/%3E%3Cpolygon points='36,20 50,28 50,44 36,52 22,44 22,28'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

/* 4-Theme Icon Switcher */
.theme-dock {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--hero-pill-bg);
  border: 1px solid var(--hero-pill-border);
  backdrop-filter: blur(10px);
}

.theme-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.68;
  transition: transform 0.16s ease, background 0.18s ease, opacity 0.18s ease;
}

.theme-btn.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.24);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
  transform: scale(1.04);
}

html[data-theme="minimal"] .theme-btn.active {
  background: #111316;
  color: #FFFFFF;
}

/* Quick Icon Actions (Flight / Booking / Weather) */
.hero-icon-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-icon-btn {
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--hero-pill-bg);
  border: 1px solid var(--hero-pill-border);
  color: var(--hero-fg);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(10px);
  transition: transform 0.14s ease, background 0.15s ease;
}

.hero-icon-btn:active {
  transform: scale(0.95);
}

.hero-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.hero-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.hero-sub {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--hero-sub);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.hero-kpi-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.kpi-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--hero-pill-bg);
  border: 1px solid var(--hero-pill-border);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ==================== STICKY CONTROL BAR ==================== */
.sticky-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  padding: 9px 0 8px;
}

.bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 14px 8px;
}

/* 3 Layout Mode Switcher (Cards / Compact / Map) */
.layout-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.layout-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  transition: all 0.18s ease;
}

.layout-btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-xs);
}

/* All vs Single-day compact toggle */
.scope-switch {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.scope-btn {
  height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  transition: all 0.18s ease;
}

.scope-btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-xs);
}

.day-pills-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 1px 14px 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.day-pills-scroll::-webkit-scrollbar { display: none; }

.day-pill {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 54px;
  padding: 5px 8px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.18s ease;
}

.day-pill-top {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.day-pill-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}

.day-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(29, 93, 143, 0.25);
  transform: translateY(-1px);
}

.day-pill.active .day-pill-top,
.day-pill.active .day-pill-date {
  color: var(--accent-fg);
}

/* ==================== MAIN CONTAINER ==================== */
.itinerary-main {
  padding: 12px 14px 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.day-section {
  scroll-margin-top: 104px;
}

.day-section.is-hidden {
  display: none;
}

/* Day Header Card */
.day-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 13px 14px 12px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 11px;
}

.day-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.day-id-group {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.day-badge {
  background: var(--accent);
  color: var(--accent-fg);
  padding: 2px 7px;
  border-radius: 7px;
  font-size: 11px;
}

.city-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2.5px 8px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
}

.day-title {
  margin: 7px 0 0;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==================== COLLAPSIBLE DAILY WEATHER CARD ==================== */
.weather-fold {
  margin-top: 10px;
  border-radius: 13px;
  background: var(--weather-bg);
  border: 1px solid var(--weather-border);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.weather-fold.is-open {
  box-shadow: var(--shadow-sm);
}

.weather-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  color: var(--weather-ink);
}

.weather-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.weather-temp {
  font-weight: 700;
}

.weather-mini-stat {
  font-size: 11.5px;
  opacity: 0.78;
}

.weather-chev {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(127, 155, 185, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.weather-fold.is-open .weather-chev {
  transform: rotate(180deg);
}

.weather-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.weather-fold.is-open .weather-panel {
  grid-template-rows: 1fr;
}

.weather-panel-inner {
  overflow: hidden;
}

.weather-detail {
  padding: 10px 11px 11px;
  border-top: 1px dashed var(--weather-border);
  background: var(--surface);
  color: var(--ink);
}

.weather-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 8px;
}

.w-src-dot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--accent);
}

.w-src-dot.live { color: #16A34A; }

.temp-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  margin-bottom: 9px;
}

.temp-track {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: var(--surface-2);
  position: relative;
  overflow: hidden;
}

.temp-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #38BDF8 0%, #60A5FA 55%, #F59E0B 100%);
}

.w-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 8px;
}

.w-cell {
  background: var(--weather-bg);
  border-radius: 9px;
  padding: 6px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--weather-ink);
}

.w-cell-ico {
  display: block;
  font-size: 12px;
  margin-bottom: 1px;
}

.w-outfit {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11.8px;
  line-height: 1.45;
  color: var(--ink-2);
  background: var(--surface-2);
  border-radius: 9px;
  padding: 7px 9px;
}

/* ==================== VIEW 1: TIMELINE CARDS ==================== */
.timeline-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 16px;
}

.timeline-list::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: var(--border-strong);
  border-radius: 2px;
}

.stop-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 13px 11px;
  box-shadow: var(--shadow-xs);
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.stop-card.is-visited {
  opacity: 0.62;
}

.stop-card.is-visited .stop-name {
  text-decoration: line-through;
}

.stop-node {
  position: absolute;
  left: -17px;
  top: 15px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--surface);
  border: 2.5px solid var(--accent);
  box-shadow: 0 0 0 3px var(--bg);
}

.stop-node.cat-food { border-color: #D97706; }
.stop-node.cat-flight { border-color: #0284C7; background: #0284C7; }
.stop-node.cat-nye { border-color: #8B5CF6; background: #8B5CF6; }

.stop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.stop-time-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stop-time {
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 7px;
  border-radius: 7px;
}

.stop-cat-ico {
  font-size: 14px;
  line-height: 1;
}

.stop-dur {
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.stop-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--border);
}

.stop-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.6px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: transparent;
  flex-shrink: 0;
  transition: all 0.16s ease;
}

.stop-check.checked {
  background: #16A34A;
  border-color: #16A34A;
  color: #FFFFFF;
}

.stop-name {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.32;
}

.stop-desc {
  margin: 5px 0 0;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
}

.tip-drawer {
  display: none;
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.48;
  color: var(--ink-2);
  background: var(--surface-2);
  border-left: 2.5px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 6px 9px;
}

.stop-card.tip-open .tip-drawer {
  display: block;
}

/* Compact Icon-First Action Bar */
.stop-actions {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-pill {
  flex: 1;
  height: 33px;
  padding: 0 8px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: transform 0.12s ease;
}

.map-pill:active { transform: scale(0.96); }

.map-pill.amap {
  background: var(--amap-bg);
  color: var(--amap-fg);
  border: 1px solid var(--amap-border);
}

.map-pill.gmap {
  background: var(--gmap-bg);
  color: var(--gmap-fg);
  border: 1px solid var(--gmap-border);
}

.icon-sq-btn {
  width: 33px;
  height: 33px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink-2);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.12s ease, background 0.15s;
}

.icon-sq-btn:active { transform: scale(0.93); }
.icon-sq-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ==================== VIEW 2: COMPACT SCHEDULE LIST ==================== */
.compact-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.compact-row {
  border-bottom: 1px solid var(--border);
}

.compact-row:last-child { border-bottom: none; }

.compact-row-main {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  cursor: pointer;
}

.compact-row.is-visited .compact-name {
  text-decoration: line-through;
  opacity: 0.55;
}

.compact-time {
  width: 44px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  flex-shrink: 0;
}

.compact-ico {
  font-size: 15px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.compact-info {
  flex: 1;
  min-width: 0;
}

.compact-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-quick-maps {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.mini-map-ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.mini-map-ico.amap {
  background: var(--amap-bg);
  color: var(--amap-fg);
  border: 1px solid var(--amap-border);
}

.mini-map-ico.gmap {
  background: var(--gmap-bg);
  color: var(--gmap-fg);
  border: 1px solid var(--gmap-border);
}

.compact-expand {
  display: none;
  padding: 0 12px 11px 44px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
}

.compact-row.is-open .compact-expand {
  display: block;
}

/* ==================== VIEW 3: INTERACTIVE MAP VIEW ==================== */
.map-view-wrap {
  padding: 12px 14px 20px;
  display: none;
  flex-direction: column;
  gap: 12px;
}

.map-view-wrap.is-active {
  display: flex;
}

.map-stage-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.map-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
}

#leaflet-map {
  width: 100%;
  height: 360px;
  background: var(--surface-2);
  z-index: 1;
}

.map-pin-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
  border: 2px solid #FFFFFF;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.map-stop-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-stop-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.map-stop-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ==================== BOTTOM SHEETS (FLIGHTS / BOOKINGS / WEATHER) ==================== */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(10, 18, 28, 0.52);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.sheet-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.bottom-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 100;
  width: 100%;
  max-width: 560px;
  max-height: 78%;
  background: var(--surface);
  color: var(--ink);
  border-radius: 22px 22px 0 0;
  border-top: 1px solid var(--border);
  box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.22);
  transform: translate(-50%, 104%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease, visibility 0.22s ease;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-sheet.is-open {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 99px;
  background: var(--border-strong);
  margin: 9px auto 5px;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 16px 11px;
  border-bottom: 1px solid var(--border);
}

.sheet-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.sheet-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sheet-body {
  padding: 13px 15px 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Boarding Pass inside Flight Sheet */
.bp-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 12px;
  margin-bottom: 10px;
}

.bp-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--ink-3);
  margin-bottom: 7px;
}

.bp-tag {
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 7px;
  border-radius: 99px;
}

.bp-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.bp-end { display: flex; flex-direction: column; }
.bp-end.right { text-align: right; }
.bp-time { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.1; }
.bp-apt { font-size: 11.5px; font-weight: 600; color: var(--ink-2); margin-top: 2px; }

.bp-mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10.5px;
  color: var(--ink-3);
}

.bp-dash {
  width: 100%;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--border-strong) 0 4px, transparent 4px 8px);
}

.bp-note {
  font-size: 11.5px;
  color: var(--ink-2);
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

/* Booking list in Sheet */
.bk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

.bk-row.is-done { opacity: 0.55; }
.bk-row.is-done .bk-name { text-decoration: line-through; }
.bk-name { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.bk-sub { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; }

/* Weather Overview rows in Sheet */
.tri-city-now {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 12px;
}

.city-now-card {
  background: var(--hero-bg);
  color: var(--hero-fg);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 9px 10px;
}

.wo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  border-radius: 12px;
  background: var(--weather-bg);
  border: 1px solid var(--weather-border);
  margin-bottom: 7px;
  cursor: pointer;
}

/* ==================== TOAST & BACK TO TOP ==================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 16px);
  background: rgba(15, 23, 35, 0.92);
  color: #FFFFFF;
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  z-index: 120;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.fab-top {
  position: fixed;
  right: 14px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 50;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  color: var(--accent);
  font-size: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.2s ease;
}

.fab-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.footer {
  text-align: center;
  padding: 14px 16px 26px;
  font-size: 11.5px;
  color: var(--ink-3);
}
