/* RHUMB — styles.css   v0.31.0 (Phase 1: email + password auth).
   Adds only .acct-switch-row / .acct-switch / .acct-email-line at the end;
   every pre-existing rule is untouched from v0.30.9. */
:root {
  --bg-dark: #0f172a;
  --bg-panel: #1e293b;
  --border: #334155;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --accent-orange: #f59e0b;
  --accent-cyan: #0ea5e9;
  --alert-red: #ef4444;
  --success-green: #10b981;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: #000;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh;      /* fallback */
  height: 100dvh;     /* mobile: excludes browser chrome */
  overflow: hidden;
}

.pwa-container {
  /* v0.30.2: pin to the visual viewport instead of trusting 100dvh. A standalone
     PWA can mis-measure 100dvh right after a programmatic location.reload() (the
     Delete-my-data / Clear-saved-data path), overshooting by the safe-area amount
     so the flex column's bottom — the footer nav row — falls below the fold and is
     clipped by overflow:hidden. position:fixed + inset:0 always fills exactly the
     visible area, immune to that mis-measurement. (fixed is still a positioning
     context, so absolutely-positioned descendants resolve against it as before.) */
  position: fixed;
  inset: 0;
  margin-inline: auto;
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
  overflow: hidden;
}

/* ===================== FIXED HUD HEADER ===================== */
/* Pinned by construction: the container is a non-scrolling full-height flex
   column, so the header (top) and footer (bottom) never move. */
.hud-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  color: var(--accent-cyan);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
  line-height: 1.05;
}

.wordmark {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--text-main);
}

/* Version badge — how you confirm which build is actually deployed. */
.version {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  line-height: 1;
}

.domain {
  display: block;
  margin-top: 1px;
  font-family: var(--mono);
  font-style: italic;
  font-size: 0.64rem;
  line-height: 1.05;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Live device-local clock in the header (pairs with the Zulu clock in footer). */
.local-clock {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent-cyan);
  white-space: nowrap;
}

.install-btn {
  background: var(--accent-cyan);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

/* ===================== PHASE SELECTOR (dev harness) ===================== */
.phase-tabs {
  width: 100%;
  display: flex;
  gap: 8px;
  padding: 10px;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.phase-tabs.hidden { display: none; }

.phase-tabs button {
  flex: 1;
  background: #334155;
  border: none;
  border-radius: 6px;
  color: var(--text-main);
  padding: 10px 4px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.2s ease;
}

.phase-tabs button.active {
  background: var(--accent-cyan);
  color: #ffffff;
}

/* ---- persistent phase stepper (0.30.4 / Stage 2) -------------------------
   Sits in the same slot as the (hidden) dev tabs: a slim, always-present bar that
   lets you drive the phase by hand when the auto-detector stalls. Back is a quiet
   outline; Next is the cyan primary — it's the "get me moving" action. Shown only
   when a flight is loaded (toggled from render()). */
.phase-stepper {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.phase-stepper.hidden { display: none; }

.phase-step-label {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.phase-step-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 13px;
  cursor: pointer;
}
.phase-step-btn:active { background: var(--bg-panel); }
.phase-step-btn:disabled { opacity: 0.4; cursor: default; }

/* Next is the primary move — filled cyan so the way forward always reads clearly. */
.phase-step-btn--primary {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #fff;
}
.phase-step-btn--primary:active { background: #0c8fca; }
.phase-step-btn--primary:disabled { opacity: 0.4; }

/* ---- gate-closed onboard nudge (0.30.4 / Stage 2) ------------------------
   A calm banner at the top of Pre-Flight once the derived gate-close time passes.
   Orange left-edge to match the "closing/closed" gate language elsewhere; a filled
   primary to board and a quiet dismiss. Not a modal — it never blocks the screen. */
.onboard-prompt {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 12px 0;
  padding: 11px 13px;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-left: 3px solid var(--accent-orange);
  border-radius: 10px;
}
.onboard-prompt.hidden { display: none; }
.onboard-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}
.onboard-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.onboard-btn {
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
}
.onboard-btn:active { color: var(--text-main); }
.onboard-btn--primary {
  background: var(--accent-cyan);
  color: #fff;
  padding: 8px 15px;
}
.onboard-btn--primary:active { background: #0c8fca; }

/* ===================== PHASE VIEWS ===================== */
.phase-view {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.phase-view.active { display: flex; }

/* KPI section */
.kpi-section {
  display: grid;
  grid-template-rows: auto auto auto;
  border-bottom: 2px solid var(--border);
  background: var(--bg-dark);
  flex-shrink: 0;
}

.kpi-row {
  display: flex;
  border-bottom: 1px solid var(--border);
}

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

.kpi-card {
  flex: 1;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 12px 8px;
}

.kpi-card:last-child { border-right: none; }

.kpi-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
  min-height: 14px;
}

.kpi-value {
  font-size: 1.35rem;
  font-weight: bold;
  color: var(--accent-orange);
  text-align: center;
  min-height: 32px;
}

.kpi-value.cyan { color: var(--accent-cyan); }
.kpi-value.orange { color: var(--accent-orange); }
.kpi-value.status-delayed { color: var(--alert-red); }
.kpi-value.status-boarding { color: var(--success-green); }
.kpi-value.status-standby { color: var(--text-muted); }   /* DR seeded, GPS driving */
.kpi-value.status-noseed  { color: var(--accent-orange); } /* no fix yet, can't DR */

/* 0.30.6 (Stage 3b): honest caption under the Term/Gate row when a live flight's
   feed withholds them — muted and quiet so a legitimate blank never reads as a
   broken app (real-flight finding #6). Toggled via .hidden in render(). */
.preflight-note {
  margin: 6px 2px 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-muted);
  text-align: center;
}
.preflight-note.hidden { display: none; }

/* Situational awareness / illustration */
.map-section {
  flex-grow: 1;
  position: relative;
  background-color: #0b1121;
  background-image:
    radial-gradient(#1e293b 1px, transparent 1px),
    radial-gradient(#1e293b 1px, transparent 1px);
  background-position: 0 0, 20px 20px;
  background-size: 40px 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.illustration-container {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.illustration-container svg {
  width: 150px;
  height: 150px;
  opacity: 0.8;
  filter: drop-shadow(0 0 10px rgba(14, 165, 233, 0.4));
}

.illustration-container h2 {
  color: var(--text-main);
  font-size: 1.5rem;
  letter-spacing: 1px;
}

.illustration-container p {
  color: var(--text-muted);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* ===================== FIXED HUD FOOTER (two-tier) ===================== */
/* A slim status line (phase · online · SRC) above a full-width row of four large
   nav buttons (chunk 13a-2). Column layout so the buttons can be big without
   fighting the status text for horizontal space. */
.hud-footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 12px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
  background: var(--bg-dark);
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

.hud-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hud-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.hud-stat b {
  color: var(--text-main);
  font-weight: 700;
}

.hud-stat .accent { color: var(--accent-cyan); }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success-green);
  flex-shrink: 0;
}

.dot.offline { background: var(--alert-red); }

/* ===================== FOOTER SETTINGS BUTTON ===================== */
.hud-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  line-height: 0;
  flex-shrink: 0;
}

.hud-btn:hover,
.hud-btn:active { color: var(--accent-cyan); }

/* ===================== SETTINGS / ABOUT (bottom sheet) ===================== */
/* Absolutely positioned inside .pwa-container (which is position:relative), so
   it overlays the whole app without disturbing the phase render pipeline. */
.settings-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.settings-overlay[hidden] { display: none; }

.settings-panel {
  width: 100%;
  max-width: 560px;
  max-height: 88%;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  padding: 16px 18px calc(18px + env(safe-area-inset-bottom));
  animation: sheet-up 0.18s ease;
}

@keyframes sheet-up {
  from { transform: translateY(16px); opacity: 0.6; }
  to   { transform: translateY(0);    opacity: 1; }
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.settings-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.settings-title .logo { width: 22px; height: 22px; color: var(--accent-cyan); }

.settings-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
}

.settings-close:hover { color: var(--text-main); }

.settings-section {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.settings-section:last-child { border-bottom: none; }

.settings-section h3 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.settings-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.settings-row b {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text-main);
  text-align: right;
}

.settings-note {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
  margin-top: 6px;
}

.settings-note b { color: var(--text-main); }

.settings-danger {
  width: 100%;
  background: none;
  border: 1px solid var(--alert-red);
  border-radius: 8px;
  color: var(--alert-red);
  padding: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.settings-danger:active { background: rgba(239, 68, 68, 0.12); }

/* Neutral, muted-outline button — used for Sign out (0.27.1) so it reads as
   non-destructive and can't be confused with the red Delete / danger buttons. */
.settings-neutral {
  width: 100%;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  padding: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.settings-neutral:active { background: var(--bg-panel); }

/* ===================== FLIGHT SETUP (Settings sheet, chunk 8) ===================== */
.setup-field {
  position: relative;
  margin-bottom: 10px;
}

.setup-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.setup-input {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.95rem;
  padding: 10px 12px;
}

.setup-input::placeholder { color: var(--text-muted); opacity: 0.7; }

.setup-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.setup-grid {
  display: flex;
  gap: 10px;
}

.setup-grid .setup-field { flex: 1; }

/* Typeahead result dropdown — overlays the rows below it inside the sheet. */
.setup-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 5;
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-dark);
  border: 1px solid var(--accent-cyan);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.setup-results[hidden] { display: none; }

.setup-result {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  font-size: 0.9rem;
  padding: 9px 12px;
  cursor: pointer;
  line-height: 1.3;
}

.setup-result:last-child { border-bottom: none; }
.setup-result:hover,
.setup-result:active { background: var(--bg-panel); }

.setup-result b {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent-cyan);
  margin-right: 2px;
}

.setup-result span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.setup-result.none {
  color: var(--text-muted);
  cursor: default;
  text-align: center;
}

.setup-apply {
  width: 100%;
  margin-top: 4px;
  background: var(--accent-cyan);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px;
  cursor: pointer;
}

.setup-apply:active { background: #0c8fca; }

.setup-msg {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--success-green);
}

.setup-msg.err { color: var(--alert-red); }

/* ---- flight lookup button (chunk 9) -------------------------------------- */
.setup-lookup {
  width: 100%;
  margin-top: 8px;
  background: var(--accent-cyan);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px;
  cursor: pointer;
}
.setup-lookup:active { background: #0c8fca; }
.setup-lookup:disabled { opacity: 0.55; cursor: default; }

/* Manual apply becomes the secondary (outline) action next to Look up. */
.setup-apply.setup-apply--manual {
  margin-top: 8px;
  background: transparent;
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 600;
}
.setup-apply.setup-apply--manual:active { background: rgba(14, 165, 233, 0.12); }

/* ---- provenance + gate states (chunk 10) --------------------------------- */
:root { --accent-purple: #a78bfa; }

/* Purple = still placeholder, not yet fed by the flight API. Overrides the base
   cyan/orange/status colours so "what's still to go" is visible at a glance. */
.kpi-value.dummy { color: var(--accent-purple) !important; }

/* Gate-close countdown: orange flash inside the warning window, solid red once
   closed. Gate-status "Closing" uses the same orange. */
.kpi-value.status-warn  { color: var(--accent-orange); }
.kpi-value.gate-closed  { color: var(--alert-red); }
.kpi-value.flash-warn   { animation: flash-warn-anim 1s infinite; }
@keyframes flash-warn-anim {
  0%   { opacity: 1;   color: var(--accent-orange); }
  50%  { opacity: 0.45; color: #fff; }
  100% { opacity: 1;   color: var(--accent-orange); }
}

/* ---- flight lookup results (chunk 10) ------------------------------------ */
.lookup-results {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.lookup-results[hidden] { display: none; }
.lookup-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: var(--bg-dark);
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  padding: 11px 12px;
  font-size: 0.9rem;
  cursor: pointer;
}
.lookup-result:last-child { border-bottom: none; }
.lookup-result:hover,
.lookup-result:active { background: var(--bg-panel); }
.lookup-result b { color: var(--accent-cyan); font-weight: 700; }
.lookup-result span { color: var(--text-muted); }
/* R1: left group holds route + times; Select is the right-aligned amber cue. */
.lookup-main { flex: 1 1 auto; min-width: 0; }
.lookup-result .lookup-select {
  flex: 0 0 auto;
  color: var(--accent-orange);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  border: 1px solid var(--accent-orange);
  border-radius: 999px;
  padding: 3px 14px;
}

/* "or set manually" divider between the lookup and manual paths */
.setup-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 4px;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.setup-divider::before,
.setup-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Native date input: keep the picker dark to match the theme. */
#dateInput { color-scheme: dark; }

/* ---- vertical-profile charts + combined cells (chunk 12) ----------------- */
/* Altitude-vs-time canvas pinned to the bottom of Taxi & Climb and Approach. */
.profile-canvas {
  flex-shrink: 0;
  width: 100%;
  height: 132px;
  display: block;
  background: var(--bg-dark);
  border-top: 2px solid var(--border);
}

/* Combined Pre-Flight cells ("ORK → FAO", "05:45 → 08:20") carry more text than a
   single value, so drop the size a touch to keep them on one line on a phone. */
.kpi-value.combo { font-size: 1.05rem; }

/* ---- canvas / illustration pass (chunk 13b, v0.14.0) --------------------- */
/* Pre-Flight keeps its illustration but at a reduced size so the KPI grid stays
   the focus. The other three phases drop their static illustration: Taxi & Climb
   and Approach let the altitude profile fill the whole map area, and Cruise gets
   a route-progress canvas (#route3) in the same slot. */
.illustration-container--sm svg { width: 84px; height: 84px; }
.illustration-container--sm h2  { font-size: 1.15rem; }
.illustration-container--sm p   { font-size: 0.8rem; letter-spacing: 1.5px; }

/* A profile/route canvas that FILLS the vacated map area instead of sitting in a
   fixed 132px strip. flex:1 takes all the height left below the KPI grid;
   min-height:0 stops the canvas's intrinsic 150px from acting as a floor. */
.profile-canvas--fill {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

/* ---- footer nav + panel widths (chunk 13a) ------------------------------- */
/* Full-width row of four large, equal nav buttons (chunk 13a-2). Each flexes to a
   quarter of the width for a big tap target; icons scale up to 26px. */
.hud-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hud-nav .hud-btn {
  flex: 1;
  padding: 8px 0;
  border-radius: 8px;
}
.hud-nav .hud-btn:hover,
.hud-nav .hud-btn:active { background: var(--bg-panel); }
.hud-btn svg { display: block; width: 26px; height: 26px; }

/* Only one settings panel is shown at a time; the rest are [hidden]. */
.settings-section[hidden] { display: none; }

/* Pre-Flight KPI widths: Term/Gate/Seat are short, so narrow them and give Gate
   Status the extra room (plus a slightly smaller value) so its word stops
   wrapping to two lines, and let Route / Dep-Arr breathe. */
.kpi-card--narrow { flex: 0.58; }
.kpi-card--wide   { flex: 1.28; }
.kpi-card--wide .kpi-value { font-size: 1.12rem; }

/* ---- Settings subsections: divide cramped sub-blocks (0.26.0) ------------
   Give every subhead a top divider + breathing room so Update rate / Screen /
   Phase thresholds / Offline maps (and Flight setup's Find/Seat) read as
   separate blocks instead of running together. The FIRST subhead in a panel
   sits right under its <h3>, so it's reset (no divider). :first-of-type keys
   off the <h4> tag, so the hidden .active-flight div that precedes Flight
   setup's first subhead doesn't fool the reset. */
.settings-subhead {
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 20px 0 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.settings-subhead:first-of-type {
  margin-top: 4px;
  padding-top: 0;
  border-top: none;
}
/* Profile: separate the Account block from Flight history, but only while the
   account box is actually shown (it's [hidden] when sync is dormant/offline,
   in which case Flight history is the first thing and needs no divider). */
.acct-box:not([hidden]) + h3 {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
/* Profile: "Your data" (export / delete-my-data) — divider off the history list,
   and a gap so Delete sits clear of the Export button above it (0.27.0). */
.data-head {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
#deleteDataBtn { margin-top: 8px; }
.rate-grid { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.rate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.rate-row label { color: var(--text-muted); font-size: 0.9rem; }
.rate-select {
  color-scheme: dark;
  background: var(--bg-dark);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.95rem;
  min-width: 84px;
}
.rate-select:focus { outline: none; border-color: var(--accent-cyan); }

/* ---- App setup: keep-screen-awake toggle (0.24.8) ----------------------- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.toggle-label { color: var(--text-muted); font-size: 0.9rem; }
.toggle-switch {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.toggle-track {
  position: relative;
  display: block;
  width: 46px;
  height: 26px;
  border-radius: 13px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.2s ease, background 0.2s ease;
}
.toggle-switch input:checked + .toggle-track {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
}
.toggle-switch input:checked + .toggle-track .toggle-thumb {
  transform: translateX(20px);
  background: #fff;
}
.toggle-switch input:focus-visible + .toggle-track {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .toggle-track, .toggle-thumb { transition: none; }
}

/* ---- Pre-Flight identity title (chunk 14) -------------------------------- */
/* "Airline - Flight" centred above the KPI grid; text-only, identity colour. */
.phase-title {
  flex-shrink: 0;
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--text-main);
  padding: 8px 12px 2px;
}

/* ---- demo pill (chunk 15) ------------------------------------------------ */
/* Header toggle that plays a scripted demo flight. Outlined when idle, solid
   orange when running, so it reads as "simulation on" at a glance. */
.demo-pill {
  background: transparent;
  color: var(--accent-orange);
  border: 1px solid var(--accent-orange);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.demo-pill:hover,
.demo-pill:active { background: rgba(245, 158, 11, 0.14); }
.demo-pill.active {
  background: var(--accent-orange);
  color: #0f172a;
  border-color: var(--accent-orange);
}

/* ---- Pre-Flight title moved into the lower map area (chunk 15 refinement) --- */
/* "Airline - Flight" now lives in the illustration/map area (like the Cruise
   canvas title) instead of a strip above the KPI grid. */
.illustration-container--sm h2.illus-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-main);
}

/* ============ Boarding pass (chunk 18 / Drop 1) ============ */
/* Pre-Flight content is a ROW: the step/illustration section on the left, the
   boarding-pass card on the right (v0.22.2). Side-by-side keeps the block short
   so the step line ("Terminal Ops"…) is never clipped by the KPI grid above, and
   reads cleanly instead of stacking tall. .map-section is itself a row flexbox;
   this wrapper is its single centred child. */
.preflight-stack {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 8px 12px;                  /* 0.24.1: vertical breathing room — never glued to the canvas top */
}
.preflight-stack .illustration-container {
  flex: 1 1 auto;
  min-width: 0;                       /* let the step line wrap, not overflow */
}
.bp-area {
  flex: 0 0 auto;
  width: 128px;                       /* the pass column */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.bp-btn {
  width: 100%;
  padding: 10px 8px;
  background: var(--bg-panel);
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
}
.bp-btn:disabled {
  color: var(--text-muted);
  border-color: var(--border);
  cursor: default;
}
.bp-btn:active:not(:disabled) { background: var(--bg-dark); }

.bp-thumb-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.bp-thumb-wrap[hidden] { display: none; }
.bp-thumb {
  width: 92px;                        /* 0.24.1: smaller so pass + one button row clears the canvas */
  aspect-ratio: 10 / 16;              /* portrait pass-card preview; phones are ~9:16 */
  object-fit: cover;                  /* fill the card cleanly — tap enlarges the full pass */
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;                 /* passes read as light images — clean frame */
  cursor: zoom-in;
}
.bp-actions {
  display: flex;
  flex-wrap: nowrap;                  /* 0.24.1: keep Replace + Remove on ONE row */
  gap: 6px;
  width: 100%;
  justify-content: center;
}
.bp-action {
  flex: 1 1 0;                        /* 0.24.1: share the row equally instead of wrapping */
  min-width: 0;
  text-align: center;
  padding: 6px 4px;
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.72rem;
  cursor: pointer;
}
.bp-action:active { background: var(--bg-panel); }
.bp-action--danger { color: var(--accent-orange); border-color: var(--accent-orange); }
/* 0.27.1: icon-only Replace/Remove — center the glyph and give a comfortable tap
   target. Colour is inherited (text-main for Replace, amber for --danger). */
.bp-action--icon { display: flex; align-items: center; justify-content: center; padding: 9px 4px; }
.bp-action--icon svg { display: block; width: 18px; height: 18px; }

.bp-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(3, 7, 18, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.bp-overlay[hidden] { display: none; }
.bp-overlay-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}
.bp-overlay-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 44px;
  height: 44px;
  font-size: 1.8rem;
  line-height: 1;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
}

/* ============ Flight history + review (chunk 19 / Drop 2) ============ */
/* The list lives in the Profile panel; each row opens the full-screen review
   sheet (its own overlay, like the boarding pass). Rows echo the lookup-result
   look: cyan route, muted sub-line, an amber "Review" cue on the right. */
.hist-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.hist-list:empty { display: none; }
.hist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: var(--bg-dark);
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  padding: 11px 12px;
  cursor: pointer;
}
.hist-row:last-child { border-bottom: none; }
.hist-row:hover,
.hist-row:active { background: var(--bg-panel); }
.hist-row-main { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.hist-row-main b { color: var(--accent-cyan); font-weight: 700; font-size: 0.95rem; }
.hist-row-main span {
  color: var(--text-muted);
  font-size: 0.78rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hist-row-cue {
  flex: 0 0 auto;
  color: var(--accent-orange);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
  border: 1px solid var(--accent-orange);
  border-radius: 999px;
  padding: 3px 14px;
}
.hist-empty[hidden] { display: none; }

/* Review sheet — a full-screen overlay with its own scroll, matching the
   settings bottom-sheet language but taller for the canvases. Sits below the
   boarding-pass overlay (z 1000) so tapping the review pass enlarges over it. */
.hist-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(3, 7, 18, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.hist-overlay[hidden] { display: none; }
.hist-sheet {
  width: 100%;
  max-width: 560px;
  max-height: 94%;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  padding: 0 0 calc(16px + env(safe-area-inset-bottom));
  animation: sheet-up 0.18s ease;
}
.hist-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}
.hist-title { font-size: 1.05rem; font-weight: 700; color: var(--text-main); }
.hist-nav {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1;
  padding: 4px 10px;
  cursor: pointer;
}
.hist-nav:hover { color: var(--text-main); }
.hist-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 14px; }
.hist-summary { display: flex; flex-direction: column; gap: 2px; }
.hist-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-dark);
  padding: 10px 10px 8px;
}
.hist-card-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.hist-canvas { width: 100%; display: block; border-radius: 8px; }
.hist-profile { height: 184px; }

/* Drop A: dual-axis profile scrubber — play button + TIME/SPD/TRK/ALT readout. */
.hist-scrub { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.hist-play {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-dark); color: var(--text-main);
  font-size: 13px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.hist-play:active { background: var(--bg-panel); }
.hist-readout { flex: 1 1 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.hist-readout .ro { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; }
.hist-readout .ro-k { font-size: 9px; letter-spacing: 0.06em; color: var(--text-muted); }
.hist-readout .ro-v { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text-main); white-space: nowrap; }
.hist-map { height: 240px; background: var(--bg-dark); }
.hist-pass-card { display: flex; flex-direction: column; align-items: flex-start; }
.hist-pass-card[hidden] { display: none; }
.hist-pass {
  width: 128px;
  aspect-ratio: 10 / 16;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  cursor: zoom-in;
  display: block;
}

/* ===================== Advisor line + Arrived stage (chunk 20 / Drop 3) ===================== */
/* A slim "what's happening / what to do now" strip on phases 2–5, sitting between
   the KPI grid and the fill canvas (phase 1 keeps its own illustration line). The
   left accent bar ties it to the cyan HUD language; it never grows past one line. */
.advisor-line {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  border-left: 3px solid var(--accent-cyan);
}
.advisor-text {
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 0.24.1: icon + text share a shrinkable group so the phase-4 "Landed" button still
   sits hard-right (the .advisor-line stays justify-content: space-between). */
.advisor-body {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;                       /* let the text ellipsis inside the flex row */
}
/* State glyph before the text (▸ ground · ▲ climb · ✈ cruise · ▼ descent · ● arrived · ✓ done). */
.advisor-icon {
  flex-shrink: 0;
  font-size: 0.9rem;
  line-height: 1;
  color: var(--accent-cyan);
}
/* Soft fade when the advisor text changes (cruise rotation + state transitions),
   re-triggered from render() via a class toggle + reflow. */
@keyframes advisorFade { from { opacity: 0.2; } to { opacity: 1; } }
.advisor-line.advisor-changed .advisor-body { animation: advisorFade 220ms ease-out; }
@media (prefers-reduced-motion: reduce) {
  .advisor-line.advisor-changed .advisor-body { animation: none; }
}

/* 0.24.2: slim trip-progress bar (flown vs remaining) directly under the advisor
   line on the in-flight phases. Fixed height so it doesn't steal canvas space. */
.trip-progress {
  flex-shrink: 0;
  height: 3px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}
.trip-progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent-cyan);
  transition: width 0.6s ease;
}
@media (prefers-reduced-motion: reduce) {
  .trip-progress-fill { transition: none; }
}

/* Manual "Landed" fallback on the Approach advisor line. Outlined amber so it reads
   as a deliberate secondary action, not part of the primary flow. */
.advisor-action {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--accent-orange);
  border-radius: 7px;
  color: var(--accent-orange);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
}
.advisor-action:active { background: rgba(245, 158, 11, 0.14); }

/* Arrived screen body — advisor-only, no live canvas. Scrolls on short screens. */
.arrived-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 16px;
}
.arr-belt-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
/* 0.30.9 (Stage 4c): baggage-belt animation. The sign carries the belt number; the
   track + bags animate only when a number is set (.has-belt). Manual-driven; the
   feed doesn't carry belt, so with no number the card degrades to the input box. */
.belt-visual { display: none; margin: 6px 0 10px; }
.arr-belt-card.has-belt .belt-visual { display: block; }
.belt-sign {
  display: inline-block;
  min-width: 2.4em;
  padding: 4px 16px;
  margin: 0 0 10px;
  border-radius: 8px;
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-family: var(--mono);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.04em;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.22);
}
.arr-belt-input {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 1rem;
  padding: 11px 12px;
  text-align: center;
}
.arr-belt-input:focus { outline: none; border-color: var(--accent-cyan); }
.arr-belt-input::placeholder { color: var(--text-muted); opacity: 0.7; }
.arr-belt-note {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}
/* belt track + bags (Stage 4c) */
.belt-track {
  position: relative;
  height: 30px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: repeating-linear-gradient(-45deg, #263449 0 10px, #1c2738 10px 20px);
  background-size: 28.28px 28.28px;
}
.arr-belt-card.has-belt .belt-track { animation: beltscroll 1.1s linear infinite; }
@keyframes beltscroll { from { background-position: 0 0; } to { background-position: 28.28px 0; } }
.belt-bag {
  position: absolute;
  top: 8px;
  left: -12%;
  width: 22px;
  height: 15px;
  border-radius: 3px;
  background: var(--accent-orange);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.belt-bag::after {
  content: '';
  position: absolute;
  top: -4px;
  left: 6px;
  width: 10px;
  height: 5px;
  border: 2px solid var(--accent-orange);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
}
.arr-belt-card.has-belt .belt-bag { animation: bagride 3.4s linear infinite; }
.belt-bag:nth-child(2) { animation-delay: -1.15s; }
.belt-bag:nth-child(3) { animation-delay: -2.3s; }
@keyframes bagride { from { left: -12%; } to { left: 112%; } }
/* edit affordance + input collapse once a number is set */
.arr-belt-edit {
  display: none;
  margin-top: 2px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-decoration: underline;
  cursor: pointer;
}
.arr-belt-card.has-belt:not(.editing) .arr-belt-edit { display: inline-block; }
.arr-belt-card.has-belt:not(.editing) .arr-belt-input,
.arr-belt-card.has-belt:not(.editing) .arr-belt-note { display: none; }
@media (prefers-reduced-motion: reduce) {
  .arr-belt-card.has-belt .belt-track,
  .arr-belt-card.has-belt .belt-bag { animation: none; }
}

/* Trip-summary cue — reuses the Drop-2 review overlay for the current flight.
   Outlined by default; lights up (.is-ready) once GPS shows you've left the airport. */
.arr-summary {
  width: 100%;
  background: transparent;
  border: 1px solid var(--accent-cyan);
  border-radius: 8px;
  color: var(--accent-cyan);
  font-size: 0.98rem;
  font-weight: 700;
  padding: 13px;
  cursor: pointer;
}
.arr-summary:active { background: rgba(14, 165, 233, 0.12); }
.arr-summary.is-ready {
  background: var(--accent-cyan);
  color: #fff;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.45);
}

/* ---- 0.24.3 -------------------------------------------------------------- */

/* Secondary KPI row for derived flight-stats + sun countdown (Cruise). Muted
   and compact on purpose: these are ambient, not primary telemetry. The
   .kpi-section grid auto-places this 4th row (grid-auto-rows: auto). */
.kpi-row--stats .kpi-card  { padding: 8px 8px; }
.kpi-row--stats .kpi-label { margin-bottom: 2px; min-height: 12px; }
.kpi-row--stats .kpi-value {
  font-size: 1.05rem;
  color: var(--text-muted);
  min-height: 22px;
}

/* Approach: arrival-prep card — honest, no-data advisory (readiness + what's next).
   Fixed height so the descent chart below still fills the remaining space. */
.arrival-prep {
  flex-shrink: 0;
  margin: 6px 12px 10px;
  padding: 12px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 10px;
}
.arrival-prep-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.arrival-prep-line {
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.4;
}
.arrival-prep-next {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Arrived: closing flight-stats strip (reuses the Cruise stats fields). */
.arr-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.arr-stat {
  background: var(--bg-panel);
  padding: 12px 6px;
  text-align: center;
}
.arr-stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.arr-stat-value {
  font-family: var(--mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

/* ---- 0.24.4 -------------------------------------------------------------- */

/* Status-change flash: a 3-pulse cyan wash across a discrete status cell when its
   value steps to a new state (gate/flight status, terminal, gate, gate-close).
   Self-terminating (3 iterations, then nothing lingers). Never used on
   continuously-varying readouts — see the flashing policy. */
@keyframes statusChangeFlash {
  0%, 100% { box-shadow: inset 0 0 0 0 rgba(14, 165, 233, 0); }
  50%      { box-shadow: inset 0 0 0 999px rgba(14, 165, 233, 0.45); }
}
.status-flash { animation: statusChangeFlash 0.42s ease-out 3; }
@media (prefers-reduced-motion: reduce) {
  .status-flash { animation: none; }
}

/* Active-flight summary at the top of Flight setup. */
.active-flight {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.active-flight-route {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.5px;
}
.active-flight-sub {
  margin-top: 3px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Primary "save/commit" button (Save All and Close, Save thresholds). Green to
   read as a commit, distinct from the cyan "Look up flight" action. */
.setup-save {
  width: 100%;
  margin-top: 12px;
  background: var(--success-green);
  border: none;
  border-radius: 8px;
  color: #06231a;
  font-size: 0.98rem;
  font-weight: 700;
  padding: 13px;
  cursor: pointer;
}
.setup-save:active { filter: brightness(0.92); }

/* Phase-threshold tuning controls. */
.tune-grid { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.tune-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tune-row label { font-size: 0.9rem; color: var(--text-main); }
.tune-input-wrap { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.tune-input {
  width: 84px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 1rem;
  padding: 9px 10px;
  text-align: right;
}
.tune-input:focus { outline: none; border-color: var(--accent-cyan); }
.tune-unit { font-size: 0.78rem; color: var(--text-muted); width: 34px; }
.tune-actions { display: flex; gap: 10px; align-items: center; }
.tune-actions .setup-save { margin-top: 0; flex: 1; }
.tune-reset {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 13px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.tune-reset:active { background: rgba(148, 163, 184, 0.12); }

/* ---- 0.24.5/0.24.6: Pre-Flight trip controls ------------------------------
   A compact row under the airline/flight line in the left column. "Start" is an
   explicit, non-gating arm (auto-record still runs); it turns green once pressed.
   "Summary" appears after a monitored trip and reopens its review overlay. */
.preflight-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}
.preflight-action {
  padding: 8px 14px;
  background: var(--bg-panel);
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
}
.preflight-action:active { background: var(--bg-dark); }
.preflight-action.is-monitoring {
  color: var(--success-green);
  border-color: var(--success-green);
  background: rgba(16, 185, 129, 0.10);
}
.preflight-action--summary {
  color: var(--accent-orange);
  border-color: var(--accent-orange);
}
.preflight-action--summary:active { background: rgba(245, 158, 11, 0.12); }

/* ===================================================================
   0.24.9 additions
   =================================================================== */

/* Task 3 — 3-pulse the map-area advisor line when the message steps to a new STATE
   (takeoff, "begin descent now", final approach, landed). Self-terminating (3
   iterations); it never fires on the ambient 7 s cruise rotation, which keeps its
   quiet cross-fade. Amber wash + left border = "new, actionable info", per the
   flashing policy. Coexists with .advisor-changed (that fades .advisor-body). */
@keyframes advisorMsgFlash {
  0%, 100% { background: var(--bg-dark);           border-left-color: var(--accent-cyan); }
  50%      { background: rgba(245, 158, 11, 0.22); border-left-color: var(--accent-orange); }
}
.advisor-line.advisor-flash { animation: advisorMsgFlash 0.42s ease-out 3; }
@media (prefers-reduced-motion: reduce) {
  .advisor-line.advisor-flash { animation: none; }
}

/* Empty-state — the Pre-Flight prompt ("Select your flight") is tappable when no
   flight is chosen: it opens Flight setup. Cyan + underline signals the affordance;
   the class is toggled from render() only while empty-state is active. */
.illustration-container.is-selectable { cursor: pointer; }
.illustration-container.is-selectable .illus-title {
  color: var(--accent-cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.illustration-container.is-selectable p { color: var(--accent-cyan); opacity: 0.85; }

/* ---- account: password-auth sub-views (v0.31.0) --------------------------
   The account box now has four signed-out sub-views (login / register / forgot
   / set-new-password). These three classes are all the new chrome it needs:
   a row of text links to move between views, and a muted email line under the
   "Signed in as {name}" row. Everything else reuses the existing .setup-field,
   .setup-input, .setup-lookup, .setup-msg and .settings-row styles. */
.acct-switch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  justify-content: space-between;
  margin: 10px 0 0;
}
.acct-switch {
  font-size: 0.82rem;
  color: var(--accent-cyan);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding: 4px 0;            /* keeps the tap target comfortable on a phone */
  cursor: pointer;
}
.acct-switch:hover,
.acct-switch:focus-visible { border-bottom-color: var(--accent-cyan); }

.acct-email-line {
  margin: -2px 0 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;   /* long addresses must not blow out the panel */
}
.acct-email-line:empty { display: none; }
