/* ═══════════════════════════════════════════════════════════════
   TravelOS — Concept Design CSS
   Visual-first, dark luxury, glassmorphism
   ═══════════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;
  /* ── M3 color roles, TravelOS brand (docs/MOBILE_FIRST_UI_DESIGN.md §3) ── */
  --primary: #00d4ff;
  --on-primary: #00363f;
  --primary-container: #004e5c;
  --on-primary-container: #a8eeff;
  --secondary: #6366f1;
  --surface: #0a0e27;
  --surface-container: #11163a;
  --surface-container-high: #181e47;
  --on-surface: #ffffff;
  --on-surface-variant: rgba(255,255,255,0.62);
  --on-surface-muted: rgba(255,255,255,0.55);
  --outline-variant: rgba(255,255,255,0.12);
  --ink-overlay: rgba(255,255,255,0.07);
  --nav-bg: rgba(17,22,58,0.96);

  /* ── Legacy aliases (existing component rules reference these) ── */
  --bg-primary: var(--surface);
  --bg-secondary: var(--surface-container-high);
  --bg-card: var(--surface-container);
  --bg-card-hover: var(--surface-container-high);
  --glass: var(--surface-container);
  --glass-border: var(--outline-variant);
  --glass-blur: 20px;
  --accent: var(--primary);
  --accent-glow: rgba(0,212,255,0.25);
  --accent-dim: rgba(0,212,255,0.15);
  --purple: var(--secondary);
  --purple-glow: rgba(99,102,241,0.3);
  --text-primary: var(--on-surface);
  --text-secondary: var(--on-surface-variant);
  --text-muted: var(--on-surface-muted);
  --status-green: #22c55e;
  --status-blue: #3b82f6;
  --status-orange: #f59e0b;
  --status-red: #ef4444;
  --airline-emirates: #c4161c;
  --airline-qatar: #5c0632;
  --airline-etihad: #c5a14e;
  --airline-lufthansa: #05164d;
  --airline-british: #075aaa;
  --airline-turkish: #c4161c;
  --airline-singapore: #003b6f;
  --airline-delta: #003366;
  --airline-united: #002244;
  --airline-default: #1e40af;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 50%;
  --shadow-card: 0 8px 32px rgba(0,0,0,0.3);
  --shadow-glow: 0 0 20px var(--accent-glow);
  --nav-height: 84px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Light scheme from the same roles; brand default stays dark ── */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --primary: #006879;
    --on-primary: #ffffff;
    --primary-container: #a8eeff;
    --on-primary-container: #001f26;
    --secondary: #4548c8;
    --surface: #f8f9ff;
    --surface-container: #eceef7;
    --surface-container-high: #e4e7f1;
    --on-surface: #191c25;
    --on-surface-variant: #44474f;
    --on-surface-muted: #5d6068;
    --outline-variant: #c4c6d0;
    --ink-overlay: rgba(25,28,37,0.06);
    --nav-bg: rgba(236,238,247,0.96);
    --accent-glow: rgba(0,104,121,0.22);
    --accent-dim: rgba(0,104,121,0.10);
    --shadow-card: 0 4px 18px rgba(23,30,60,0.10);
  }
}

/* ── SVG icons (sprite in index.html) ── */
.ic { width: 22px; height: 22px; fill: currentColor; flex: none; vertical-align: middle; }
.ic-s { width: 17px; height: 17px; fill: currentColor; flex: none; vertical-align: -3px; }
.ic-xs { width: 13px; height: 13px; fill: currentColor; flex: none; vertical-align: -2px; }
.ic-fab { width: 26px; height: 26px; }
.ic-empty { width: 44px; height: 44px; color: var(--text-muted); }
button.spinning .ic, button.spinning .ic-s { animation: spin 0.8s linear infinite; }

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; font-family: var(--font); }
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* ─── App Shell ─── */
#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}
@media (min-width: 481px) {
  #app { border-left: 1px solid var(--glass-border); border-right: 1px solid var(--glass-border); }
}

/* ─── Bottom Navigation (M3 NavigationBar: labeled items, pill indicator) ─── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  padding: 8px 6px calc(8px + var(--safe-bottom));
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--outline-variant);
  z-index: 100;
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
  min-height: 48px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  transition: color 0.25s ease;
}
.nav-indicator {
  width: 56px;
  height: 30px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease;
}
.nav-btn .ic { width: 23px; height: 23px; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: 0.2px; }
.nav-btn.active { color: var(--text-primary); }
.nav-btn.active .nav-indicator {
  background: var(--primary-container);
  color: var(--on-primary-container);
}

/* ─── Scan FAB (docked above the nav bar on top-level screens) ─── */
.fab {
  position: fixed;
  left: 50%;
  margin-left: 166px;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 14px);
  width: 58px;
  height: 58px;
  border-radius: 18px;
  border: none;
  background: var(--primary);
  color: var(--on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px var(--accent-glow);
  z-index: 99;
  transition: transform 0.15s ease;
}
.fab:active { transform: scale(0.94); }
@media (max-width: 480px) {
  .fab { left: auto; margin-left: 0; right: 16px; }
}

/* ─── Scrollable Main ─── */
.main-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 20px);
  -webkit-overflow-scrolling: touch;
}
.main-scroll::-webkit-scrollbar { display: none; }

/* ─── Dashboard Header ─── */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 16px) 20px 16px;
}
.dash-logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.dash-logo em { font-style: normal; color: var(--accent); }
.dash-avatar {
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  border: 2px solid var(--glass-border);
  background: var(--glass);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  overflow: hidden;
}

/* ─── Hero Trip Card ─── */
.hero-card {
  margin: 0 20px 20px;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  position: relative;
  height: 240px;
  box-shadow: var(--shadow-card);
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-color: #1b2150;
  background-image: linear-gradient(150deg, #4338ca, #0e7490);
  background-size: cover;
  background-position: center;
}
/* Hero sits on a photo: its text stays light in both themes */
.hero-overlay {
  position: absolute;
  top: 20px; left: 20px;
  padding: 18px 20px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-lg);
  color: #fff;
}
.hero-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #7de3ff;
  margin-bottom: 2px;
}
.hero-dest {
  font-size: 28px;
  font-weight: 600;
}
.hero-count {
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  margin-top: 4px;
}
.hero-count-label {
  font-size: 18px;
  font-weight: 300;
  color: rgba(255,255,255,0.7);
}
.hero-weather {
  position: absolute;
  bottom: 16px; right: 16px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  font-size: 14px;
  color: #fff;
  display: flex; align-items: center; gap: 6px;
}

/* ─── Destination Time Widget ─── */
.time-widget {
  margin: 0 20px 20px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(0,212,255,0.08), rgba(99,102,241,0.08));
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 14px;
}
.time-widget-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-full);
  background: var(--accent-dim);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.time-widget-city { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); }
.time-widget-value { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.time-widget-date { font-size: 11px; color: var(--text-muted); }

/* ─── Section Headers ─── */
.sec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  margin-bottom: 14px;
}
.sec-title { font-size: 18px; font-weight: 600; }
.sec-link {
  font-size: 12px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
}

/* ─── Flight Cards (Boarding Pass) ─── */
.flight-card {
  margin: 0 20px 16px;
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all 0.2s;
  position: relative;
}
.flight-card:hover { border-color: var(--outline-variant); }
.fc-main { display: flex; }
.fc-strip {
  width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 4px;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.fc-strip.emirates { background: var(--airline-emirates); }
.fc-strip.qatar { background: var(--airline-qatar); }
.fc-strip.etihad { background: var(--airline-etihad); }
.fc-strip.lufthansa { background: var(--airline-lufthansa); }
.fc-strip.british { background: var(--airline-british); }
.fc-strip.turkish { background: var(--airline-turkish); }
.fc-strip.singapore { background: var(--airline-singapore); }
.fc-strip.delta { background: var(--airline-delta); }
.fc-strip.united { background: var(--airline-united); }
.fc-strip.default { background: var(--airline-default); }
.fc-strip-img { width: 40px; height: 40px; object-fit: contain; border-radius: 6px; background: rgba(255,255,255,0.9); padding: 3px; }
.fc-strip-text { font-size: 10px; font-weight: 700; line-height: 1.2; text-align: center; }
.fc-body { flex: 1; padding: 12px 14px; position: relative; }
.fc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.fc-meta-left {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex; gap: 8px; align-items: center;
}
.fc-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.fc-badge::before { content: ''; width: 5px; height: 5px; border-radius: var(--radius-full); background: currentColor; }
.fc-badge.on-time { background: rgba(34,197,94,0.15); color: var(--status-green); }
.fc-badge.landed { background: rgba(34,197,94,0.15); color: var(--status-green); }
.fc-badge.in-flight { background: rgba(59,130,246,0.15); color: var(--status-blue); }
.fc-badge.delayed { background: rgba(245,158,11,0.15); color: var(--status-orange); }
.fc-badge.diverted { background: rgba(239,68,68,0.15); color: var(--status-red); }
.fc-badge.scheduled { background: var(--ink-overlay); color: var(--text-secondary); }
.fc-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}
.fc-airport {}
.fc-airport.right { text-align: right; }
.fc-iata { font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: -1px; }
.fc-city { font-size: 10px; color: var(--text-muted); }
.fc-time { font-size: 13px; font-weight: 600; color: var(--accent); margin-top: 2px; }
.fc-terminal { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.fc-arc {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  position: relative;
}
.fc-arc-line {
  width: 100%;
  height: 0;
  border-top: 2px dashed var(--outline-variant);
  position: relative;
}
.fc-arc-plane {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
}
.fc-duration { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

/* Route Map */
.fc-route-map {
  margin: 6px 0;
  padding: 8px;
  background: var(--ink-overlay);
  border-radius: var(--radius-md);
  border: 1px solid var(--ink-overlay);
  position: relative;
  overflow: hidden;
}
.fc-route-map::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(0,212,255,0.04) 0%, transparent 70%);
  pointer-events: none;
}
.fc-map-svg {
  width: 100%;
  height: 60px;
  display: block;
}
.fc-arc-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}
.fc-expand {
  position: absolute;
  top: 12px; right: 12px;
  background: none; border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.3s;
}
.fc-expand.open { transform: rotate(180deg); }

/* Live Tracking Panel */
.fc-live {
  padding: 14px;
  border-top: 1px solid var(--glass-border);
  background: rgba(0,212,255,0.03);
}
.fc-live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.fc-live-title { font-size: 12px; font-weight: 600; color: var(--accent); display: flex; align-items: center; gap: 6px; }
.fc-live-updated { font-size: 10px; color: var(--text-muted); }
.fc-live-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.fc-live-stat {
  text-align: center;
  padding: 10px 6px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}
.fc-live-stat-val { font-size: 15px; font-weight: 700; }
.fc-live-stat-lbl { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.fc-live-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.fc-live-bar { flex: 1; height: 3px; background: var(--ink-overlay); border-radius: 2px; overflow: hidden; }
.fc-live-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; }
.fc-live-pct { font-size: 10px; color: var(--accent); font-weight: 600; }
.fc-live-details {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.fc-live-detail {
  text-align: center;
  padding: 6px 2px;
  background: var(--glass);
  border-radius: var(--radius-sm);
}
.fc-live-detail-lbl { font-size: 8px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 2px; }
.fc-live-detail-val { font-size: 11px; font-weight: 600; }
.fc-diverted {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 10px;
  background: rgba(239,68,68,0.15);
  color: var(--status-red);
  font-size: 10px;
  font-weight: 600;
}

/* Add Flight Button */
.add-flight-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 20px 0;
  padding: 16px;
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 0 16px rgba(0,212,255,0.08);
}
.add-flight-btn:hover { background: rgba(0,212,255,0.08); box-shadow: var(--shadow-glow); }

/* ─── Trip Cards ─── */
.trip-card {
  margin: 0 20px 16px;
  border-radius: var(--radius-2xl);
  overflow: visible;
  position: relative;
  height: 220px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.2s;
}
.trip-card:active { transform: scale(0.98); }
.trip-bg {
  border-radius: var(--radius-2xl); overflow: hidden;
  position: absolute; inset: 0;
  background-color: #1b2150;
  background-image: linear-gradient(150deg, #4338ca, #0e7490);
  background-size: cover;
  background-position: center;
  pointer-events: none;
}
.trip-grad {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 40%, transparent 70%);
  pointer-events: none;
}
.trip-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 20px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  color: #fff; /* over photo gradient in both themes */
}
.trip-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.trip-dates { font-size: 12px; color: rgba(255,255,255,0.8); }
.trip-ring {
  width: 50px; height: 50px;
  position: relative;
  flex-shrink: 0;
}
.trip-ring svg { width: 50px; height: 50px; transform: rotate(-90deg); }
.trip-ring circle { fill: none; stroke-width: 3; }
.trip-ring .bg { stroke: rgba(255,255,255,0.25); }
.trip-ring .fill { stroke: #00d4ff; stroke-linecap: round; }
.trip-ring-pct {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}

/* ─── AI Planner ─── */
.ai-view { padding-top: 0; }
.ai-aurora {
  position: relative;
  padding: calc(var(--safe-top) + 20px) 20px 30px;
  text-align: center;
  overflow: hidden;
}
.ai-aurora-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(99,102,241,0.25) 0%, rgba(0,212,255,0.15) 50%, rgba(139,92,246,0.25) 100%);
  filter: blur(40px);
}
.ai-orb {
  width: 100px; height: 100px;
  margin: 0 auto 16px;
  border-radius: var(--radius-full);
  background: radial-gradient(circle at 30% 30%, rgba(0,212,255,0.8), rgba(99,102,241,0.6), rgba(139,92,246,0.4));
  box-shadow: 0 0 50px rgba(0,212,255,0.4), 0 0 100px rgba(99,102,241,0.2);
  animation: orbPulse 3s ease-in-out infinite;
  position: relative;
}
@keyframes orbPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); box-shadow: 0 0 70px rgba(0,212,255,0.5), 0 0 120px rgba(99,102,241,0.3); }
}
.ai-greeting { font-size: 22px; font-weight: 700; position: relative; }
.ai-subtitle { font-size: 13px; color: var(--text-secondary); position: relative; margin-top: 4px; }

/* AI Input Bar */
.ai-bar {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 440px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: rgba(10,14,39,0.92);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  z-index: 90;
}
.ai-bar-mic {
  width: 38px; height: 38px;
  border-radius: var(--radius-full);
  background: var(--accent);
  border: none;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.ai-bar-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}
.ai-bar-input::placeholder { color: var(--text-muted); }
.ai-bar-send {
  width: 38px; height: 38px;
  border-radius: var(--radius-full);
  background: var(--accent);
  border: none;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  transition: box-shadow 0.2s;
}
.ai-bar-send:hover { box-shadow: var(--shadow-glow); }

/* AI Results */
.ai-results { padding: 20px 20px 80px; }
.ai-result-card {
  padding: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
}
.ai-result-q { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.ai-result-a { font-size: 13px; color: var(--text-secondary); line-height: 1.6; white-space: pre-wrap; }

/* ─── More Menu ─── */
.more-list { padding: 0 20px; }
.more-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.more-item:hover { background: var(--bg-card-hover); }
.more-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.more-label { font-size: 15px; font-weight: 500; }

/* ─── View Header ─── */
.view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 16px) 20px 16px;
}
.view-title { font-size: 26px; font-weight: 700; letter-spacing: -0.4px; }
.view-actions { display: flex; gap: 10px; }
.view-action {
  width: 44px; height: 44px;
  border-radius: var(--radius-full);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 15px;
}

/* ─── Timeline ─── */
.timeline { padding: 0 20px; margin-top: 20px; }
.tl-item {
  display: flex;
  gap: 12px;
  padding-bottom: 18px;
  position: relative;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: 15px; top: 30px; bottom: 0;
  width: 1px;
  background: var(--glass-border);
}
.tl-item:last-child::before { display: none; }
.tl-dot {
  width: 30px; height: 30px;
  border-radius: var(--radius-full);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  z-index: 1;
}
.tl-dot .ic { width: 14px; height: 14px; }
.tl-content { flex: 1; }
.tl-time { font-size: 10px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }
.tl-title { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.tl-desc { font-size: 11px; color: var(--text-muted); }

/* ─── Dialogs ─── */
.sheet-dialog { position: fixed; inset: 0; z-index: 200; border: none; background: transparent; max-width: 100%; max-height: 100%; width: 100%; height: 100%; padding: 0; }
.sheet-dialog::backdrop { background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.sheet-dialog form { position: absolute; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto; max-height: 90dvh; background: var(--bg-secondary); border-radius: var(--radius-2xl) var(--radius-2xl) 0 0; border: 1px solid var(--glass-border); border-bottom: none; display: flex; flex-direction: column; overflow: hidden; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--glass-border); }
.sheet-header h2 { font-size: 18px; font-weight: 600; }
.close-btn { width: 32px; height: 32px; border-radius: var(--radius-full); border: none; background: var(--glass); color: var(--text-primary); font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sheet-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.sheet-subtitle { font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; }
.sheet-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--glass-border); }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field span { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 500; }
.field input, .field textarea, .field select {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  min-height: 48px; /* mobile touch-target floor */
  padding: 11px 13px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field input::placeholder, .field textarea::placeholder { color: var(--text-muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn-ghost { padding: 10px 18px; border-radius: var(--radius-md); background: none; border: 1px solid var(--glass-border); color: var(--text-secondary); font-size: 13px; cursor: pointer; }
.btn-primary { padding: 10px 22px; border-radius: var(--radius-md); background: var(--accent); border: none; color: var(--on-primary); font-size: 14px; font-weight: 600; cursor: pointer; transition: box-shadow 0.2s; }
.btn-primary:hover { box-shadow: var(--shadow-glow); }

.file-upload { cursor: pointer; margin-top: 8px; }
.file-upload input[type="file"] { display: none; }
.file-upload-label { display: block; padding: 12px; text-align: center; border: 1px dashed var(--glass-border); border-radius: var(--radius-md); color: var(--text-secondary); font-size: 13px; }

/* ─── Toast ─── */
.toast { position: fixed; top: calc(var(--safe-top) + 12px); left: 50%; transform: translateX(-50%); max-width: 340px; padding: 11px 18px; background: var(--bg-secondary); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); font-size: 13px; z-index: 9999; opacity: 0; pointer-events: none; transition: opacity 0.3s; box-shadow: var(--shadow-card); }
.toast.show { opacity: 1; pointer-events: auto; }

/* ─── Settings ─── */
.settings-section { padding: 0 20px; margin-bottom: 20px; }
.settings-card { background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); overflow: hidden; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--glass-border); }
.settings-row:last-child { border-bottom: none; }
.settings-label { font-size: 14px; }
.settings-value { font-size: 12px; color: var(--text-muted); }

/* ─── Loading ─── */
.spinner-wrap { display: flex; align-items: center; justify-content: center; padding: 40px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--glass-border); border-top-color: var(--accent); border-radius: var(--radius-full); animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Utility ─── */
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   Trip Detail View
   ═══════════════════════════════════════════════════════════════ */
.trip-detail-hero {
  position: relative; height: 220px; margin: 0 0 16px; border-radius: 0 0 var(--radius-2xl) var(--radius-2xl); overflow: hidden;
}
.trip-detail-bg {
  position: absolute; inset: 0;
  background-color: #1b2150;
  background-image: linear-gradient(150deg, #4338ca, #0e7490);
  background-size: cover; background-position: center;
}
.trip-detail-overlay {
  position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,14,39,0.95) 0%, rgba(10,14,39,0.4) 60%, transparent 100%);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 20px;
}
.trip-detail-title { font-size: 28px; font-weight: 800; color: white; }
.trip-detail-dates { font-size: 14px; color: rgba(255,255,255,0.8); margin-top: 4px; }
.trip-detail-count { font-size: 12px; color: #7de3ff; margin-top: 4px; font-weight: 600; }
.back-btn {
  position: absolute; top: 16px; left: 16px;
  width: 42px; height: 42px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,14,39,0.45); border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(10px); color: white; border-radius: var(--radius-full);
  cursor: pointer; z-index: 2;
}
.back-btn:active { transform: scale(0.95); }
.back-btn-inline {
  position: static;
  background: var(--glass);
  border-color: var(--glass-border);
  color: var(--text-primary);
  margin-right: 12px;
}
.view-head .back-btn-inline + .view-title { flex: 1; }

/* Trip Detail Actions */
.trip-detail-actions {
  display: flex; gap: 8px; padding: 0 16px 16px; flex-wrap: wrap;
}
.btn-primary {
  background: var(--accent); color: var(--on-primary); border: none; padding: 10px 18px;
  border-radius: var(--radius-lg); font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-primary:active { transform: scale(0.95); opacity: 0.9; }
.btn-secondary {
  background: var(--glass); border: 1px solid var(--glass-border); color: white;
  padding: 10px 18px; border-radius: var(--radius-lg); font-size: 13px; font-weight: 500; cursor: pointer;
}
.btn-secondary:active { transform: scale(0.95); }
.btn-danger {
  background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #ef4444;
  padding: 10px 18px; border-radius: var(--radius-lg); font-size: 13px; font-weight: 500; cursor: pointer;
}
.btn-danger:active { transform: scale(0.95); }

/* Day-selector chips (jump points into the timeline) */
.day-chips {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 0 16px 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.day-chips::-webkit-scrollbar { display: none; }
.day-chip {
  flex: none;
  padding: 9px 14px;
  border-radius: 100px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s;
}
.day-chip.sel {
  background: var(--accent);
  color: var(--on-primary);
  border-color: transparent;
}

/* Day Groups */
.segments-list { padding: 0 16px 120px; }
.day-group { margin-bottom: 20px; scroll-margin-top: 12px; }
.day-header {
  font-size: 13px; font-weight: 700; color: var(--accent); text-transform: uppercase;
  letter-spacing: 0.5px; padding: 8px 0; border-bottom: 1px solid var(--glass-border); margin-bottom: 10px;
}

/* Segment Cards */
.seg-card {
  display: flex; gap: 12px; padding: 14px; margin-bottom: 10px;
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg); position: relative; transition: background 0.2s;
}
.seg-card:active { background: var(--bg-card-hover); }
.seg-icon {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  color: var(--accent); background: var(--accent-dim); border-radius: var(--radius-md); flex-shrink: 0;
}
.seg-icon .ic { width: 18px; height: 18px; }
.seg-body { flex: 1; min-width: 0; }
.seg-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.seg-time { font-size: 12px; color: var(--accent); font-weight: 500; }
.seg-location { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.seg-details {
  font-size: 11px; color: var(--text-muted); margin-top: 6px; line-height: 1.5;
  white-space: pre-line; max-height: 80px; overflow-y: auto;
}
.seg-conf { font-size: 11px; color: var(--purple); margin-top: 4px; font-weight: 500; }
.seg-status { font-size: 11px; color: var(--status-green); margin-top: 2px; font-weight: 500; }

/* Segment CRUD */

/* Trip card additions */
.trip-seg-count { font-size: 11px; color: var(--accent); margin-top: 3px; font-weight: 500; }

/* Flight card CRUD actions */
.fc-actions {
  display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap;
}
.fc-action-btn {
  padding: 5px 10px; font-size: 11px; border-radius: var(--radius-sm);
  background: var(--glass); border: 1px solid var(--glass-border); color: var(--text-secondary);
  cursor: pointer; transition: all 0.2s;
}
.fc-action-btn:hover { background: var(--bg-card-hover); color: white; }
.fc-action-btn:active { transform: scale(0.95); }

/* Flight expanded details */
.fc-expanded {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--glass-border);
}
.fc-detail-row {
  display: flex; justify-content: space-between; font-size: 12px; padding: 4px 0;
  color: var(--text-secondary);
}
.fc-detail-row span:last-child { color: var(--text-primary); font-weight: 500; }
.fc-live-panel {
  margin-top: 10px; padding: 10px; background: rgba(0,212,255,0.05);
  border: 1px solid rgba(0,212,255,0.15); border-radius: var(--radius-md);
}
.fc-live-title { font-size: 11px; font-weight: 700; color: var(--accent); margin-bottom: 6px; text-transform: uppercase; }
.fc-chip {
  display: inline-block; padding: 3px 8px; font-size: 11px; background: var(--glass);
  border: 1px solid var(--glass-border); border-radius: var(--radius-sm); color: white; margin-right: 6px; margin-bottom: 4px;
}
.fc-live-row { font-size: 12px; color: var(--text-secondary); padding: 2px 0; }

/* Empty state (icon + headline + CTA per screen) */
.empty-state {
  text-align: center;
  margin: 0 20px;
  padding: 40px 24px;
  background: var(--bg-card);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-2xl);
  color: var(--text-secondary);
  font-size: 14px;
}
.empty-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-top: 10px; }
.empty-sub { font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
.empty-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* Skeleton loading (shimmer; used while AI answers stream in) */
.ai-skeleton { display: flex; flex-direction: column; gap: 8px; min-width: 220px; }
.skel {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--ink-overlay) 25%, var(--outline-variant) 50%, var(--ink-overlay) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .skel, button.spinning .ic, button.spinning .ic-s, .ai-orb { animation: none; }
}

/* ─── Three-Dot Menu ─── */
.dot-menu {
  position: relative;
  z-index: 10;
}
.dot-menu-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink-overlay);
  border: 1px solid var(--outline-variant);
  color: var(--text-muted);
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.dot-menu-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
/* Dot menus that sit on photo cards keep a dark glass pill in both themes */
.trip-card .dot-menu-btn {
  background: rgba(10,14,39,0.45);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
}
.dot-menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: var(--surface-container-high);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--outline-variant);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 100;
  animation: menuFadeIn 0.2s ease;
}
.dot-menu-dropdown.open {
  display: flex;
  flex-direction: column;
}
.dot-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  white-space: nowrap;
}
.dot-menu-item:hover {
  background: var(--ink-overlay);
  color: var(--text-primary);
}
.dot-menu-item:last-child:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
@keyframes menuFadeIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Position adjustments for different contexts */
.trip-card .dot-menu {
  position: absolute;
  top: 12px;
  right: 12px;
}
.seg-card .dot-menu {
  position: absolute;
  top: 10px;
  right: 10px;
}
.flight-card .dot-menu {
  position: absolute;
  top: 12px;
  right: 12px;
}
.trip-detail-actions .dot-menu {
  display: inline-block;
}
.trip-detail-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}


/* ─── Login Screen ─── */
.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  z-index: 9999;
}
.login-screen.hidden { display: none; }
.login-container {
  text-align: center;
  padding: 40px;
  max-width: 360px;
}
.login-logo {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 8px;
}
.login-logo em { font-style: normal; color: var(--accent); }
.login-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
}
.google-signin-btn {
  display: flex;
  justify-content: center;
  margin: 0 auto 16px;
}
.native-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 280px;
  min-height: 48px;
  margin: 0 auto 16px;
  padding: 12px 20px;
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: box-shadow .15s, background .15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(66,133,244,0.15);
  position: relative;
  z-index: 10000;
  user-select: none;
  -webkit-user-select: none;
}
.native-google-btn:hover { box-shadow: 0 2px 8px rgba(0,0,0,.25); background: #f8f8f8; }
.native-google-btn:disabled { opacity: .6; cursor: not-allowed; }
.login-note {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 16px;
}

/* ─── User avatar with photo ─── */
.dash-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-full);
}

/* ─── Flight card layout fix (fc-main wrapper) ─── */
.flight-card {
  display: flex;
  overflow: visible;
  position: relative;
}

/* ─── fc-status badge (matches fc-badge in concept) ─── */
.fc-status {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 10px;
  background: var(--glass);
}
.fc-status.scheduled { color: var(--text-secondary); }
.fc-status.landed { color: var(--status-green); background: rgba(34,197,94,0.15); }
.fc-status.in-air { color: var(--status-blue); background: rgba(59,130,246,0.15); }
.fc-status.delayed { color: var(--status-orange); background: rgba(245,158,11,0.15); }

/* ─── fc-airport-right alignment ─── */
.fc-airport-right { text-align: right; }

/* ─── More grid ─── */
.more-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 20px;
}
.more-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s;
}
.more-card:hover { background: var(--bg-card-hover); }
.more-icon {
  width: 44px; height: 44px;
  margin: 0 auto 10px;
  border-radius: var(--radius-md);
  background: var(--accent-dim);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.more-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.more-desc { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ─── Settings list ─── */
.settings-list {
  padding: 0 20px;
}
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  font-size: 14px;
}
.setting-item span:last-child {
  color: var(--text-secondary);
}

/* ─── AI view styles ─── */
.ai-container {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.ai-orb-wrap {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}
.ai-orb {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), var(--purple));
  animation: orbPulse 3s ease-in-out infinite;
}
@keyframes orbPulse {
  0%, 100% { box-shadow: 0 0 20px var(--accent-glow); transform: scale(1); }
  50% { box-shadow: 0 0 40px var(--accent-glow), 0 0 60px var(--purple-glow); transform: scale(1.05); }
}
.ai-hint {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 20px;
}
.ai-history {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 12px;
}
.ai-msg { margin-bottom: 12px; }
.ai-msg.ai-user { text-align: right; }
.ai-msg.ai-bot { text-align: left; }
.ai-bubble {
  display: inline-block;
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-user .ai-bubble {
  background: var(--accent);
  color: var(--on-primary);
}
.ai-bot .ai-bubble {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}
.ai-input-bar {
  display: flex;
  gap: 8px;
  padding: 12px 0;
}
.ai-input {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}
.ai-input:focus { border-color: var(--accent); }
.ai-send {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--accent);
  border: none;
  color: var(--on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ai-send:disabled { opacity: 0.5; }

/* ─── Select option fix for dark theme ─── */
.field select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ─── Sign-out button ─── */
.signout-btn {
  background: none;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  cursor: pointer;
}
.signout-btn:hover { border-color: var(--status-red); color: var(--status-red); }

/* Flight card expanded details - label/value layout */
.fc-live-panel { padding: 12px 0; border-top: 1px solid var(--ink-overlay); margin-top: 8px; }
.fc-live-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); margin-bottom: 8px; }
.fc-chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.fc-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 12px; background: var(--ink-overlay); font-size: 11px; color: var(--text-secondary); border: 1px solid var(--outline-variant); }
.fc-live-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--ink-overlay); }
.fc-live-row:last-child { border-bottom: none; }
.fc-live-label { font-size: 12px; color: var(--text-secondary); }
.fc-live-value { font-size: 12px; color: var(--text-primary); font-weight: 500; }
.fc-live-row.fc-diverted { color: #ff6b6b; }
.fc-live-row.fc-diverted .fc-live-label,
.fc-live-row.fc-diverted .fc-live-value { color: #ff6b6b; }
.fc-live-row.fc-updated .fc-live-label,
.fc-live-row.fc-updated .fc-live-value { color: var(--text-tertiary, #666); font-size: 10px; }
.fc-status-landed { color: #4caf50; }
.fc-status-in-air { color: #2196f3; }
.fc-status-scheduled { color: var(--text-secondary); }
.fc-status-delayed { color: #ff9800; }
.fc-terminal { font-size: 10px; color: var(--text-secondary); margin-top: 2px; letter-spacing: 0.5px; }

/* ═══════════════════════════════════════════════════════════
   JourneyDNA™ Styles
   ═══════════════════════════════════════════════════════════ */

/* More card badge */
.more-card { position: relative; }
.more-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--accent);
  color: var(--on-primary);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}
.jd-entry-card { border: 1px solid var(--accent-dim) !important; }

/* ─── JourneyDNA Tab Bar ─── */
.jd-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 12px 16px 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.jd-tabs::-webkit-scrollbar { display: none; }
.jd-tab {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s;
}
.jd-tab.active {
  background: var(--accent);
  color: var(--on-primary);
  border-color: var(--accent);
  font-weight: 700;
}

/* ─── JourneyDNA Content Area ─── */
.jd-content {
  padding: 12px 16px 100px;
}

/* ─── Hero ─── */
.jd-hero {
  background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(99,102,241,0.15));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 16px;
  text-align: center;
}
.jd-hero-title {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.jd-hero-sub {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
}
.jd-sync-btn {
  margin-top: 12px;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

/* ─── Stats Grid ─── */
.jd-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.jd-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 16px 12px;
  text-align: center;
}
.jd-stat-card.jd-stat-accent {
  background: linear-gradient(135deg, rgba(0,212,255,0.12), rgba(99,102,241,0.12));
  border-color: var(--accent-dim);
}
.jd-stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.jd-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.jd-stat-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── Section Titles ─── */
.jd-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 16px 0 8px;
}
.jd-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 8px;
}
.jd-add-btn {
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

/* ─── Highlight Card ─── */
.jd-highlight-card {
  background: linear-gradient(135deg, rgba(34,197,94,0.15), rgba(0,212,255,0.1));
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--status-green);
  margin-bottom: 12px;
}

/* ─── Airline List ─── */
.jd-airline-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.jd-airline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}
.jd-airline-logo { width: 32px; height: 20px; object-fit: contain; border-radius: 4px; }
.jd-airline-info { flex: 1; }
.jd-airline-sub { font-size: 11px; color: var(--text-muted); }
.jd-airline-count { font-size: 12px; color: var(--accent); font-weight: 600; margin-left: auto; }

/* ─── Hotel Brand List ─── */
.jd-brand-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.jd-brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 13px;
}
.jd-brand-count { font-size: 12px; color: var(--accent); font-weight: 600; }

/* ─── Scratch Map / Country Chips ─── */
.jd-scratch-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.jd-country-chip {
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(0,212,255,0.1);
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

/* ─── Collection Grid ─── */
.jd-collection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.jd-collection-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 14px 12px;
  text-align: center;
}
.jd-cc-flag { font-size: 24px; margin-bottom: 6px; }
.jd-cc-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.jd-cc-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.jd-remove-btn {
  position: absolute;
  top: 6px; right: 6px;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(239,68,68,0.2);
  color: var(--status-red);
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}

/* ─── Quick Add Grid ─── */
.jd-quick-add-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.jd-quick-btn {
  padding: 6px 12px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  transition: all 0.2s;
}
.jd-quick-btn:active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── Airport List ─── */
.jd-airport-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.jd-airport-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}
.jd-airport-iata {
  width: 44px;
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
  text-align: center;
}
.jd-airport-info { flex: 1; }
.jd-airport-name { font-size: 13px; font-weight: 600; }
.jd-airport-country { font-size: 11px; color: var(--text-muted); }
.jd-airport-visits { font-size: 12px; color: var(--text-muted); }

/* ─── Memory Cards ─── */
.jd-memory-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
}
.jd-memory-header { display: flex; justify-content: space-between; align-items: flex-start; }
.jd-memory-title { font-size: 14px; font-weight: 700; }
.jd-memory-date, .jd-memory-location { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.jd-memory-content { font-size: 13px; color: var(--text-secondary); margin-top: 8px; line-height: 1.5; }

/* ─── Add Form ─── */
.jd-add-form {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.jd-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--ink-overlay);
  color: var(--text-primary);
  font-size: 14px;
}
.jd-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--ink-overlay);
  color: var(--text-primary);
  font-size: 14px;
  min-height: 80px;
  resize: vertical;
}

/* ─── Timeline ─── */
.jd-timeline-year { margin-bottom: 20px; }
.jd-timeline-year-label {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 12px;
}
.jd-timeline-events { display: flex; flex-direction: column; gap: 8px; padding-left: 12px; border-left: 2px solid var(--glass-border); }
.jd-timeline-event { display: flex; gap: 12px; align-items: flex-start; }
.jd-tl-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 4px;
  flex-shrink: 0;
  margin-left: -16px;
  box-shadow: 0 0 8px var(--accent-glow);
}
.jd-tl-content { flex: 1; }
.jd-tl-title { font-size: 13px; font-weight: 600; }
.jd-tl-loc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ─── Achievements / Badges ─── */
.jd-badges-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.jd-badge {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 16px 12px;
  text-align: center;
}
.jd-badge-earned {
  background: linear-gradient(135deg, rgba(0,212,255,0.1), rgba(99,102,241,0.1));
  border-color: var(--accent-dim);
}
.jd-badge-progress { opacity: 0.7; }
.jd-badge-icon { font-size: 28px; margin-bottom: 6px; }
.jd-badge-name { font-size: 12px; font-weight: 700; color: var(--text-primary); }
.jd-badge-desc { font-size: 10px; color: var(--text-muted); margin-top: 3px; }
.jd-progress-bar {
  height: 4px;
  background: var(--ink-overlay);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.jd-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s ease;
}
.jd-progress-label { font-size: 10px; color: var(--text-muted); margin-top: 3px; }

/* ─── AI Travel DNA ─── */
.jd-dna-header {
  text-align: center;
  padding: 20px 0 12px;
}
.jd-dna-icon { font-size: 40px; margin-bottom: 8px; }
.jd-dna-title { font-size: 20px; font-weight: 800; color: var(--accent); }
.jd-dna-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.jd-dna-card {
  background: linear-gradient(135deg, rgba(0,212,255,0.08), rgba(99,102,241,0.08));
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 16px;
}
.jd-dna-style {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}
.jd-dna-summary { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 12px; }
.jd-dna-traits { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.jd-trait-chip {
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  color: #a5b4fc;
  font-size: 12px;
}
.jd-insights { padding-left: 16px; margin-bottom: 12px; }
.jd-insights li { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; line-height: 1.5; }
.jd-recs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.jd-rec-chip {
  padding: 6px 12px;
  border-radius: 16px;
  background: rgba(0,212,255,0.1);
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  font-size: 12px;
}
.jd-dna-date { font-size: 11px; color: var(--text-muted); text-align: right; margin-top: 8px; }
.jd-generate-btn { width: 100%; margin-top: 8px; }

/* ─── Travel Wrapped ─── */
.jd-wrapped-header {
  text-align: center;
  padding: 20px 0 12px;
}
.jd-wrapped-year {
  font-size: 48px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.jd-wrapped-title { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-top: 4px; }
.jd-wrapped-sub { font-size: 13px; color: var(--text-muted); }
.jd-wrapped-card {
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(0,212,255,0.08));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 16px;
}
.jd-wrapped-headline {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.4;
}
.jd-wrapped-top, .jd-wrapped-personality {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.jd-wrapped-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}
.jd-ws {
  background: var(--ink-overlay);
  border-radius: var(--radius-md);
  padding: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}
.jd-ws b { color: var(--accent); display: block; font-size: 18px; }
.jd-wrapped-quote {
  font-size: 14px;
  font-style: italic;
  color: var(--text-muted);
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  margin: 12px 0;
  line-height: 1.6;
}
.jd-wrapped-goal {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  margin-top: 8px;
}

/* ─── Loading Spinner ─── */
.jd-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}
.jd-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Empty State ─── */
.jd-empty {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg-card);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
}
