/* ============================================================
   Airspace Academy — styles.css
   Midnight Sky. Full-viewport no-scroll layout. Persistent 3D
   canvas with overlay views above it.
   ============================================================ */

/* ---- Tokens ---- */
:root {
  /* Dark neutral slate — much less saturated than the previous deep navy.
     Still cool, but reads as "muted dark" rather than "AI product blue." */
  --bg-0: #12151a;
  --bg-1: #181b21;
  --bg-2: #1e2229;
  --bg-3: #272c35;
  --surface: rgba(237, 228, 207, 0.05);
  --surface-strong: rgba(237, 228, 207, 0.09);
  --border: rgba(237, 228, 207, 0.14);
  --border-strong: rgba(237, 228, 207, 0.30);

  --text: #ede4cf;
  --text-dim: #b6ad99;
  --text-mute: #7e7866;

  --accent: #ffb347;
  --accent-strong: #ff9a1f;
  --accent-soft: rgba(255, 179, 71, 0.16);

  --success: #7cc89a;
  --proposed: #c5a0e0;
  --warning: #ff6b53;
  --info: #8db4ff;

  --c-class-a: #4a7eff;
  --c-class-b: #6a9bff;
  --c-class-c: #d97cb5;
  --c-class-d: #9cc6ff;
  --c-class-e: #f5a3d9;
  --c-class-g: #7cc89a;
  --c-ceiling: #ffb347;
  --c-vlos:    #a9d0ff;

  /* Type system — techy / aeronautical, but readable:
     --font-display  Orbitron, the wide geometric "space-program" face. Used
                     ONLY for the brand + short eyebrow labels (too wide for
                     running text).
     --font-sans     Saira, a clean technical sans for all body + UI. Reads
                     like instrument labelling yet stays highly legible.
     --font-head     Saira (heavier weights) for headings — replaces the old
                     serif so nothing reads "editorial" anymore.
     --font-mono     JetBrains Mono for the flight readouts / instrument
                     numbers — the cockpit-gauge feel.
     All web fonts fall back to system stacks so the app still works offline. */
  --font-display: "Orbitron", "Saira", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Saira", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Saira", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;

  --r-1: 6px;
  --r-2: 12px;
  --r-3: 18px;
  --r-4: 28px;
  --shadow-2: 0 8px 28px rgba(0, 0, 0, 0.5);
  --shadow-3: 0 24px 72px rgba(0, 0, 0, 0.6);
  --glow-accent: 0 0 0 1px rgba(255, 179, 71, 0.4), 0 12px 40px rgba(255, 154, 31, 0.18);

  --t-fast: 120ms;
  --t-med:  240ms;
  --t-slow: 480ms;
  --ease:   cubic-bezier(0.22, 0.61, 0.36, 1);

  --header-h: 60px;
}

:root[data-contrast="high"] {
  --bg-0: #000; --bg-1: #000; --bg-2: #0c0c14; --bg-3: #161628;
  --text: #fff; --text-dim: #f5f0e0; --text-mute: #d0c8b0;
  --border: rgba(237, 228, 207, 0.55);
  --border-strong: rgba(237, 228, 207, 0.9);
  --accent: #ffc870; --accent-strong: #ffaf3a;
}

:root[data-motion="reduced"] *,
:root[data-motion="reduced"] *::before,
:root[data-motion="reduced"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  :root[data-motion="auto"] *,
  :root[data-motion="auto"] *::before,
  :root[data-motion="auto"] *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---- Reset + lock viewport ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  height: 100%;
  overflow: hidden;
  /* Lock the page itself — internal panels handle their own scrolling. */
  overscroll-behavior: none;
}
body {
  margin: 0;
  background:
    radial-gradient(1200px 800px at 88% -10%, rgba(255, 179, 71, 0.05), transparent 60%),
    radial-gradient(900px 700px at -10% 110%, rgba(180, 175, 160, 0.03), transparent 60%),
    var(--bg-0);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s-3);
}
h1 { font-size: clamp(1.6rem, 1.6vw + 1rem, 2.4rem); }
h2 { font-size: clamp(1.3rem, 1.2vw + 1rem, 1.7rem); }
h3 { font-size: 1.1rem; font-family: var(--font-sans); font-weight: 600; }
h4 { font-size: 0.92rem; font-family: var(--font-sans); font-weight: 600; }
p  { margin: 0 0 var(--s-3); }
a  { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
ul { padding-left: 1.2rem; }
.lede { font-size: 1.05rem; color: var(--text-dim); max-width: 50ch; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-1);
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--bg-0);
  padding: var(--s-2) var(--s-4);
  border-radius: 0 0 var(--r-2) 0;
  font-weight: 600;
  z-index: 100;
}
.skip-link:focus { left: 0; }

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

/* ---- Header (fixed, full width, glass) ---- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  height: var(--header-h);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  background: linear-gradient(180deg, rgba(18, 21, 26, 0.78), rgba(18, 21, 26, 0.45));
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  height: 100%;
  padding: 0 var(--s-5);
  display: flex;
  align-items: center;
  gap: var(--s-4);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--text);
  font-weight: 700;
  font-family: var(--font-display);
}
.brand:hover { text-decoration: none; }
.brand__mark { width: 28px; height: 28px; color: var(--accent); }
/* Orbitron runs wide — trim the size + tighten tracking so "Airspace Academy"
   still fits beside the hamburger on a 360px phone. */
.brand__name { font-size: 0.92rem; letter-spacing: 0.01em; text-transform: uppercase; }

.site-nav { margin-left: auto; }
.site-nav ul {
  display: flex;
  gap: var(--s-1);
  list-style: none;
  margin: 0; padding: 0;
}
.site-nav a {
  display: inline-block;
  padding: var(--s-2) var(--s-4);
  color: var(--text-dim);
  border-radius: var(--r-2);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.site-nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.site-nav a.is-active { color: var(--accent); background: var(--accent-soft); }

#menu-toggle { display: none; }
.icon-button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 44px; height: 44px;
  border-radius: var(--r-2);
  font-size: 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-button:hover { background: var(--surface-strong); }

.site-nav--mobile { display: none; }
.site-nav--mobile {
  position: fixed;
  top: var(--header-h); left: 0; right: 0;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  z-index: 39;
}
.site-nav--mobile ul {
  flex-direction: column;
  padding: var(--s-3);
  gap: var(--s-1);
}
.site-nav--mobile a {
  display: block;
  padding: var(--s-3) var(--s-4);
  font-size: 1rem;
}
@media (max-width: 800px) {
  .site-nav:not(.site-nav--mobile) { display: none; }
  /* Hamburger sits at the far left, before the logo + title (flex order). */
  #menu-toggle { display: inline-flex; order: -1; }
  .brand       { order: 0; margin-right: auto; }
  .site-nav--mobile { display: block; }
  .site-nav--mobile[hidden] { display: none; }
}

/* ---- Main + persistent canvas ---- */
#main {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  overflow: hidden;
}

#bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: linear-gradient(180deg, #0c0f14, #12151a);
  transition: opacity var(--t-med) var(--ease), filter var(--t-med) var(--ease);
  z-index: 0;
  cursor: default;
  /* A drag to orbit must NOT sweep-select text in the overlays it passes over
     (that blue selection looked like "labels highlighting on click"). */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
/* No text selection anywhere on the interactive Explore view, and on the scene
   chrome overlays (which sit over the canvas) on any view. Reading views
   (lessons / practice / more) keep normal selection. */
body[data-view="map"],
.scene-readout, .explore-head, .hover-tip, .scene-warning,
.floating-views, .floating-pad-wrap, .pad-mode, .panel-toggle, .tour-card {
  -webkit-user-select: none;
  user-select: none;
}
/* When the scene is interactive, hint with grab/pointer cursors. JS swaps to
   "pointer" on hover-over-pickable and back to "grab" otherwise. */
body[data-view="map"] #bg-canvas,
body[data-view="lesson"][data-step-mode="3d"] #bg-canvas { cursor: grab; }
body[data-view="map"] #bg-canvas.is-hover-pick,
body[data-view="lesson"][data-step-mode="3d"] #bg-canvas.is-hover-pick { cursor: pointer; }

/* ---- Hover tooltip near cursor for pickable layers ---- */
.hover-tip {
  position: fixed;
  z-index: 22;
  pointer-events: none;
  background: rgba(20, 24, 32, 0.95);
  border: 1px solid var(--border-strong);
  padding: 6px 12px;
  border-radius: var(--r-2);
  font-size: 0.85rem;
  color: var(--text);
  font-family: var(--font-sans);
  white-space: nowrap;
  box-shadow: var(--shadow-2);
  /* JS sets left/top to viewport coords. */
}
.hover-tip strong { color: var(--accent); font-weight: 600; }
.hover-tip__hint  { color: var(--text-mute); margin-left: var(--s-2); font-size: 0.78rem; }

/* Dim the scene when overlay content needs focus. */
body[data-view="practice"] #bg-canvas,
body[data-view="more"]     #bg-canvas { opacity: 0.18; filter: blur(2px); }
body[data-view="lessons"]  #bg-canvas { opacity: 0.45; }
body[data-view="home"]     #bg-canvas { opacity: 0.6; }
body[data-view="lesson"]   #bg-canvas { opacity: 0.55; }
body[data-view="map"]      #bg-canvas { opacity: 1; filter: none; }
/* On lesson steps that need 3D focus, JS adds data-step-mode="3d". */
body[data-view="lesson"][data-step-mode="3d"] #bg-canvas { opacity: 1; filter: none; }

.scene-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  background: rgba(12, 15, 20, 0.85);
  z-index: 5;
  pointer-events: none;
  opacity: 1;
  transition: opacity var(--t-med) var(--ease);
}
body[data-scene-state="ready"] .scene-loading,
body[data-scene-state="failed"] .scene-loading { opacity: 0; pointer-events: none; }
body[data-scene-state="failed"] .scene-loading {
  background: transparent;
  /* Failure text injected by JS into the same node. */
}

/* ---- Overlay system (one per route) ----
   IMPORTANT: never set `display` directly on an .overlay--xxx rule outside
   of the body[data-view=xxx] selectors below. If you do, that overlay will
   render across every route (because the unscoped rule wins on specificity
   when the body's data-view doesn't match). */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
  pointer-events: none; /* children re-enable */
}
.overlay > * { pointer-events: auto; }

body[data-view="home"]     .overlay--home     { display: grid; place-items: center; }
body[data-view="lessons"]  .overlay--lessons  { display: block; }
body[data-view="lesson"]   .overlay--lesson   { display: block; }
body[data-view="practice"] .overlay--practice { display: block; }
body[data-view="map"]      .overlay--map      { display: block; }
body[data-view="more"]     .overlay--more     { display: block; }

/* ---- Buttons / tags / chips ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 0.7rem 1.1rem;
  border-radius: var(--r-2);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  min-height: 44px;
  text-decoration: none;
  white-space: nowrap;
}
/* `.btn { display: inline-flex }` otherwise overrides the UA [hidden] rule, so
   buttons toggled via the `hidden` attribute (e.g. the popover Back/Open
   buttons) would stay visible. This restores hide-on-[hidden]. */
.btn[hidden] { display: none; }
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn--primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: #2a1a05;
  border-color: rgba(0, 0, 0, 0.2);
  box-shadow: 0 6px 20px rgba(255, 154, 31, 0.25);
}
.btn--primary:hover { background: linear-gradient(180deg, #ffc46a, var(--accent)); }
.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover { background: var(--surface-strong); border-color: var(--border-strong); }
.btn--sm { padding: 0.5rem 0.85rem; min-height: 38px; font-size: 0.88rem; }
.btn--lg { padding: 0.95rem 1.5rem; min-height: 52px; font-size: 1.05rem; }
.link {
  background: none; border: none; color: var(--accent);
  cursor: pointer; font: inherit; padding: 0;
}
.link:hover { text-decoration: underline; }
.link-strong {
  display: inline-block;
  padding: var(--s-2) 0;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.link-strong:hover { color: var(--accent); text-decoration: none; border-color: var(--accent); }

.tag {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 3px 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-mute);
}
.tag--proposed     { background: rgba(197, 160, 224, 0.12); border-color: rgba(197, 160, 224, 0.45); color: var(--proposed); }
.tag--needs-review { background: rgba(255, 179, 71, 0.12);  border-color: rgba(255, 179, 71, 0.45);  color: var(--accent); }
.tag--verified     { background: rgba(124, 200, 154, 0.12); border-color: rgba(124, 200, 154, 0.45); color: var(--success); }

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border-radius: 999px;
  font-size: 0.9rem; flex-shrink: 0;
}
.badge--warn { background: rgba(255, 179, 71, 0.16); color: var(--accent); }

.chips { display: flex; gap: var(--s-2); flex-wrap: wrap; margin: var(--s-3) 0; }
.chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  min-height: 36px;
}
.chip:hover { background: var(--surface-strong); color: var(--text); }
.chip[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.select {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.6rem 0.8rem;
  border-radius: var(--r-2);
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  min-height: 44px;
}

.eyebrow {
  color: var(--accent);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 600;
  margin: 0 0 var(--s-3);
}

.back-link { color: var(--text-dim); font-size: 0.92rem; }
.back-link:hover { color: var(--accent); }

/* ---- Popover backdrop (blur + dim everything else) ---- */
.popover-backdrop {
  position: absolute;
  inset: 0;
  z-index: 24;
  background: rgba(12, 15, 20, 0.62);
  backdrop-filter: blur(4px) saturate(120%);
  -webkit-backdrop-filter: blur(4px) saturate(120%);
  animation: backdrop-fade var(--t-fast) var(--ease);
}
@keyframes backdrop-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---- Pick popover (explicit info card on tap) ----
   `position: fixed` so JS can assign viewport coordinates from the click
   directly — no need to compensate for the header offset. */
.pick-popover {
  position: fixed;
  z-index: 25;
  max-width: 400px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
  padding: var(--s-4) var(--s-5);
  box-shadow: var(--shadow-3), 0 0 0 1px rgba(255, 179, 71, 0.25);
  pointer-events: auto;
  animation: pop-in var(--t-med) var(--ease);
  /* JS sets left/top. */
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.96) translateY(4px); }
  to   { opacity: 1; transform: none; }
}
.pick-popover h3 { margin: 0 0 var(--s-2); font-size: 1.05rem; color: var(--accent); }
.pick-popover p  { margin: 0 0 var(--s-3); color: var(--text-dim); font-size: 0.92rem; }
.pick-popover__actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* Inline airspace "read more" trigger. Inherits its parent's color so existing
   ok/bad coding is preserved; the underline (not color alone) signals it's
   interactive, per the accessibility rules. */
.airspace-link {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  cursor: pointer;
}
.airspace-link:hover { text-decoration-style: solid; }
.airspace-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
/* In-place airspace detail view (swapped into the same popover). */
.airspace-detail p { margin: 0 0 var(--s-2); color: var(--text-dim); font-size: 0.9rem; }
.airspace-detail__more { color: var(--text-mute); font-size: 0.84rem; }

/* Rich drone/pilot info card layout inside the popover. */
.drone-info { display: flex; flex-direction: column; gap: 8px; }
.drone-info__id {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.drone-info__label {
  text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 0.7rem; color: var(--text-mute);
}
.drone-info__example {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  background: rgba(255, 179, 71, 0.18);
  border-radius: 3px;
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: 0.62rem;
  color: var(--accent);
}
.drone-info__reg {
  font-family: var(--font-mono);
  font-weight: 700; font-size: 0.95rem; color: var(--accent);
}
.drone-info__sub { color: var(--text-mute); font-size: 0.82rem; margin: -2px 0 4px; }
.drone-info__h {
  margin: 6px 0 4px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-mute);
  font-weight: 600;
}
.drone-info__h--alert { color: var(--warning); }
.drone-info__grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.drone-info__grid span    { color: var(--text-mute); }
.drone-info__grid strong  { color: var(--text); font-weight: 600; text-align: right; }
.drone-info__grid strong.is-ok  { color: var(--success); }
.drone-info__grid strong.is-bad { color: var(--warning); }
.drone-info__limits,
.drone-info__alerts {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 0.86rem;
}
.drone-info__limits li { color: var(--text-dim); }
.drone-info__limits li strong { color: var(--text); font-weight: 600; }
.drone-info__alerts {
  background: rgba(255, 107, 83, 0.10);
  border: 1px solid rgba(255, 107, 83, 0.45);
  border-radius: var(--r-2);
  padding: 8px 10px;
  color: var(--text);
}
.drone-info__alerts li { padding: 2px 0; }
.drone-info__alerts li strong { color: var(--warning); }
.drone-info__ok {
  background: rgba(124, 200, 154, 0.10);
  border: 1px solid rgba(124, 200, 154, 0.45);
  border-radius: var(--r-2);
  padding: 8px 10px;
  color: var(--success);
  font-size: 0.86rem;
  margin: 0;
}

/* METAR teaching blocks in the weather-station popover. */
.metar-sample {
  margin: 4px 0 0;
  padding: 8px 10px;
  background: rgba(141, 180, 255, 0.10);
  border: 1px solid rgba(141, 180, 255, 0.45);
  border-radius: var(--r-2);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}
.metar-decode {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.86rem;
  color: var(--text-dim);
}
.metar-decode code {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--info);
  background: rgba(141, 180, 255, 0.12);
  padding: 1px 5px;
  border-radius: 5px;
  margin-right: 4px;
}
.metar-decode li strong { color: var(--text); font-weight: 600; }

/* Collapsible "if something goes wrong" block in the drone popover. */
.drone-info__more {
  margin-top: 10px;
  border: 1px solid rgba(255, 107, 83, 0.40);
  border-radius: var(--r-2);
  background: rgba(255, 107, 83, 0.07);
  padding: 0 10px;
}
.drone-info__more > summary {
  cursor: pointer;
  list-style: none;
  padding: 9px 2px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--warning);
}
.drone-info__more > summary::-webkit-details-marker { display: none; }
.drone-info__more > summary::after {
  content: "▸";
  float: right;
  color: var(--text-dim);
  transition: transform 0.15s ease;
}
.drone-info__more[open] > summary::after { content: "▾"; }
.drone-info__more > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-3, 8px);
}
.drone-info__more > *:last-child { margin-bottom: 10px; }
@media (prefers-reduced-motion: reduce) {
  .drone-info__more > summary::after { transition: none; }
}

/* "Announce / contact on THIS frequency" headline callout in the tower popover.
   Makes the one frequency a pilot talks on unmistakable when several are listed. */
.announce-callout {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 179, 71, 0.55);
  border-radius: var(--r-2);
}
.announce-callout__tag {
  flex: 1 0 100%;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
.announce-callout__freq {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.announce-callout__role {
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* ---- Floating overlay chrome ---- */
/* Every floating overlay (.scene-readout, .panel-toggle, .floating-views,
   .floating-pad, .explore-panel) shares the SAME chrome so the Explore view
   feels cohesive: same background, border, radius, blur, and the same
   --s-4 distance from the nearest viewport edge. Don't introduce ad-hoc
   variants — extend this contract instead. */

.scene-readout {
  position: absolute;
  z-index: 12;
  top: var(--s-4);
  left: var(--s-4);
  display: none;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  background: rgba(20, 24, 32, 0.88);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
  min-width: 220px;
}
.scene-readout > div:not(.readout-status) {
  display: flex;
  justify-content: space-between;
  align-items: baseline;     /* keep tiny labels on the value's baseline */
  gap: var(--s-3);
}
/* Labels read as small uppercase column headers — pure metadata.
   IMPORTANT: scope to DIRECT-child spans of non-status rows. Without `> div >`
   the rule also matches the inner numeric span inside <strong>, which would
   drag the value's color (and font size) back to the muted-label style. */
.scene-readout > div:not(.readout-status) > span {
  color: var(--text-mute);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}
/* Values are the focal point: bigger, bolder, color-coded. The inner number
   span (when present) gets a SIZE bump on top of the strong's weight, so
   numbers pop out from the unit text ("ft AGL", "ft from pilot"). */
.scene-readout strong {
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
  text-align: right;
  font-feature-settings: "tnum";   /* tabular numerals — easier to scan */
}
/* The numeric leaf: the inner <span> inside <strong>. Bolder + larger so
   the digits read as the value and the unit text reads as supporting. */
.scene-readout strong > span {
  display: inline-block;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-right: 2px;
}
.scene-readout strong.is-bad { color: var(--warning); }
.scene-readout strong.is-ok  { color: var(--success); }

.readout-status {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 6px 10px;
  margin: -2px -4px var(--s-1);
  background: rgba(124, 200, 154, 0.16);
  border: 1px solid rgba(124, 200, 154, 0.55);
  border-radius: var(--r-2);
  color: var(--success);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.readout-status.is-violation {
  background: rgba(255, 107, 83, 0.22);
  border-color: var(--warning);
  color: var(--warning);
}
.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(124, 200, 154, 0.2);
  animation: status-pulse 2s ease-in-out infinite;
}
.readout-status.is-violation .status-dot {
  box-shadow: 0 0 0 4px rgba(255, 107, 83, 0.25);
  animation-duration: 0.8s;
}
@keyframes status-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.85); }
}

body[data-view="map"] .scene-readout { display: flex; }
body[data-view="lesson"][data-step-mode="3d"] .scene-readout { display: flex; }


.scene-warning {
  position: absolute;
  left: 50%;
  top: calc(var(--s-4) + 60px); /* below the explore-head hint */
  transform: translateX(-50%);
  z-index: 16;
  padding: var(--s-2) var(--s-3);
  background: rgba(255, 107, 83, 0.92);
  border: 2px solid #ff4040;
  color: #ffeeea;
  border-radius: var(--r-2);
  font-size: 0.92rem;
  font-weight: 600;
  display: none;
  flex-direction: column;   /* stack multiple warnings */
  gap: 4px;
  max-width: 92%;
  pointer-events: none;
  box-shadow: 0 12px 40px rgba(255, 64, 64, 0.35), 0 0 0 4px rgba(255, 64, 64, 0.18);
  animation: warning-pulse 1.4s ease-in-out infinite;
}
.scene-warning__item {
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
  line-height: 1.35;
}
.scene-warning__item::before {
  content: "⚠";
  display: inline-block;
  flex-shrink: 0;
  font-size: 1rem;
  margin-top: 1px;
}
@keyframes warning-pulse {
  0%, 100% { box-shadow: 0 12px 40px rgba(255, 64, 64, 0.35), 0 0 0 4px rgba(255, 64, 64, 0.18); }
  50%      { box-shadow: 0 12px 50px rgba(255, 64, 64, 0.55), 0 0 0 10px rgba(255, 64, 64, 0.08); }
}
body[data-view="map"] .scene-warning,
body[data-view="lesson"][data-step-mode="3d"] .scene-warning {
  display: flex;
}
.scene-warning[hidden] { display: none !important; }

/* ---- HOME OVERLAY (display is set in the body[data-view] block above) ---- */
.overlay--home {
  padding: var(--s-4);
  overflow: auto;        /* extreme viewports can still scroll if needed */
}
/* Compact home card — designed to fit on a 13" MacBook Air (~745px vh
   minus the 60px header) without forcing a scroll. */
.home-card {
  max-width: 680px;
  width: 100%;
  background: rgba(20, 24, 32, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-3);
  padding: var(--s-4) var(--s-5);
  box-shadow: var(--shadow-3), var(--glow-accent);
}
.home-card .eyebrow  { margin-bottom: var(--s-2); }
.home-card h1        { font-size: clamp(1.4rem, 1.6vw + 1rem, 1.85rem); margin-bottom: var(--s-2); }
.home-card .lede     { font-size: 0.95rem; margin-bottom: var(--s-3); max-width: none; }

.today-strip {
  margin: var(--s-3) 0;
  padding: var(--s-4);
  background: linear-gradient(160deg, rgba(255, 179, 71, 0.10), rgba(141, 180, 255, 0.04)), var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
}
.today-strip__meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-mute);
  letter-spacing: 0.05em;
  margin-bottom: var(--s-2);
}
.today-strip__day { color: var(--accent); font-weight: 600; }
.today-strip__title { font-size: 1.15rem; margin: 0 0 var(--s-2); }
.today-strip__summary { color: var(--text-dim); margin-bottom: var(--s-3); font-size: 0.92rem; }
.today-strip .btn { width: 100%; }
.today-strip__progress {
  margin-top: var(--s-2);
  font-size: 0.78rem;
  color: var(--text-mute);
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  margin: var(--s-3) 0 var(--s-3);
}
.home-actions .link-strong { padding: var(--s-1) 0; font-size: 0.92rem; }

/* Secondary links to the standalone SEO content pages. */
.home-guides {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-3);
  margin-top: var(--s-2); padding-top: var(--s-3);
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
}
.home-guides__label { color: var(--text-mute); font-weight: 600; }
.home-guides a { color: var(--text-dim); text-decoration: none; }
.home-guides a:hover { color: var(--accent); text-decoration: underline; }

/* Single-line disclaimer. Long-form caveats live in the README and in the
   per-lesson disclaimer footer, not on the front door. */
.disclaimer {
  margin-top: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: var(--accent-soft);
  border: 1px solid rgba(255, 179, 71, 0.4);
  border-radius: var(--r-2);
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.4;
  display: flex;
  gap: var(--s-2);
  align-items: center;
}
.disclaimer strong { color: var(--text); }

/* ---- DRAWER (left/right slide panel) — used for /lessons path ---- */
.drawer {
  position: absolute;
  top: 0; bottom: 0;
  width: min(440px, 92vw);
  background: rgba(20, 24, 32, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-2);
}
.drawer--left  { left: 0;  }
.drawer--right { right: 0; border-right: none; border-left: 1px solid var(--border-strong); }

.drawer__head {
  padding: var(--s-5);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer__body {
  padding: var(--s-4) var(--s-5);
  overflow-y: auto;
  flex: 1;
}

.progress {
  display: flex; align-items: center; gap: var(--s-3);
  margin-top: var(--s-3);
  color: var(--text-mute); font-size: 0.85rem;
}
.progress__bar {
  flex: 1;
  max-width: 280px;
  height: 8px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
}
.progress__fill {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  transition: width var(--t-med) var(--ease);
}

/* Path list inside the drawer */
.path-list { list-style: none; padding: 0; margin: 0; }
.module { margin-bottom: var(--s-5); }
.module__head {
  display: flex; align-items: baseline; gap: var(--s-3);
  margin-bottom: var(--s-3);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--border);
}
.module__title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  margin: 0;
}
.module__hint { color: var(--text-mute); font-size: 0.82rem; }
.path-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-3);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  margin-bottom: var(--s-2);
  color: var(--text);
  text-align: left;
  font: inherit;
  width: 100%;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.path-item:hover { transform: translateY(-1px); border-color: var(--border-strong); background: var(--bg-3); }
.path-item.is-current { border-color: var(--accent); box-shadow: var(--glow-accent); }
.path-item.is-locked { opacity: 0.55; }
.path-item__day {
  font-family: var(--font-mono);
  color: var(--text-mute);
  font-size: 0.75rem;
  text-align: center;
}
.path-item__day .num { display: block; font-size: 1.1rem; color: var(--accent); font-weight: 600; }
.path-item.is-done .path-item__day .num { color: var(--success); }
.path-item__title { font-weight: 600; margin: 0 0 var(--s-1); font-size: 0.95rem; }
.path-item__summary { color: var(--text-dim); font-size: 0.82rem; margin: 0; }
.path-item__check {
  width: 24px; height: 24px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  color: var(--text-mute);
}
.path-item.is-done .path-item__check {
  background: var(--success);
  border-color: var(--success);
  color: #0c2018;
}
@media (max-width: 540px) {
  .path-item__summary { display: none; }
}

/* ---- LESSON STEPPER ---- */
.overlay--lesson { padding: 0; }
.stepper {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  /* The stepper itself shouldn't block drags on the canvas behind it.
     Head, foot, and the step cards re-enable pointer events. */
  pointer-events: none;
}
.stepper__head, .stepper__foot, .step { pointer-events: auto; }
.stepper__stage { pointer-events: auto; }
/* On a 3D step the stage is pass-through so the user can rotate the canvas
   anywhere around the step card. */
body[data-step-mode="3d"] .stepper__stage { pointer-events: none; }
body[data-step-mode="3d"] .stepper__stage .step { pointer-events: auto; }
.stepper__head {
  padding: var(--s-3) var(--s-5);
  display: flex;
  align-items: center;
  gap: var(--s-4);
  background: rgba(18, 21, 26, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.stepper__crumb {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-mute);
  letter-spacing: 0.06em;
}
.stepper__crumb span:first-child { color: var(--accent); font-weight: 600; }
.stepper__sep { margin: 0 var(--s-2); }
.stepper__progress {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-mute);
}
.stepper__stage {
  position: relative;
  padding: var(--s-5);
  overflow-y: auto;
  display: grid;
  place-items: center;
}
.stepper__foot {
  padding: var(--s-3) var(--s-5);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  background: rgba(18, 21, 26, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
}
.stepper__dots {
  display: flex;
  gap: 6px;
  margin: 0 auto;
}
.stepper__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--surface-strong);
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.stepper__dot.is-active { background: var(--accent); transform: scale(1.4); }
.stepper__dot.is-done   { background: var(--success); }

/* Step variants */
.step {
  max-width: 640px;
  width: 100%;
  animation: step-in 280ms var(--ease);
}
@keyframes step-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.step--hero {
  text-align: center;
  background: rgba(20, 24, 32, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-3);
  padding: var(--s-6) var(--s-5);
  box-shadow: var(--shadow-2);
}
.step--hero h2 { font-size: clamp(1.6rem, 2vw + 1rem, 2.2rem); }
.step--hero .step__lede {
  font-family: var(--font-head);
  font-size: 1.15rem;
  color: var(--text-dim);
}
.step--reading,
.step--mistakes,
.step--field,
.step--sources {
  background: rgba(20, 24, 32, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-3);
  padding: var(--s-5);
  box-shadow: var(--shadow-2);
}
.step h2 { font-size: 1.4rem; }
.step__label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin: 0 0 var(--s-3);
}
.step__body { color: var(--text-dim); }
.step__body p { margin-bottom: var(--s-3); }
.step__body ul { margin: 0; padding-left: 1.2rem; }
.step__body li { margin-bottom: var(--s-2); }
.step__body .sources {
  display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-3);
}
.source-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--accent);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.source-pill:hover {
  background: var(--surface-strong);
  border-color: var(--accent);
  text-decoration: underline;
}

/* 3D step — caption pinned at top of stage, scene unblocked */
.step--scene {
  align-self: start;
  max-width: 520px;
  background: rgba(20, 24, 32, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-3);
  padding: var(--s-4) var(--s-5);
  box-shadow: var(--shadow-2);
}
.step--scene h2 { font-size: 1.2rem; margin: 0 0 var(--s-2); }
.step--scene p  { margin: 0; color: var(--text-dim); font-size: 0.92rem; }
.step--scene .panel__hint {
  margin-top: var(--s-3); color: var(--text-mute); font-size: 0.82rem;
}

/* Inline quick check */
.step--check {
  background: rgba(20, 24, 32, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-3);
  padding: var(--s-5);
  box-shadow: var(--shadow-2);
}
.qcheck__q { font-weight: 600; font-family: var(--font-head); font-size: 1.1rem; }
.qcheck__choices { list-style: none; padding: 0; margin: var(--s-3) 0; display: grid; gap: var(--s-2); }
.qcheck__choice {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-2);
  cursor: pointer;
  text-align: left;
  font: inherit;
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  min-height: 48px;
}
.qcheck__choice:hover { border-color: var(--border-strong); }
.qcheck__choice .letter { font-family: var(--font-mono); color: var(--text-mute); font-size: 0.85rem; width: 1.5rem; flex-shrink: 0; }
.qcheck__choice.is-correct { border-color: var(--success); background: rgba(124, 200, 154, 0.1); }
.qcheck__choice.is-wrong   { border-color: var(--warning); background: rgba(255, 107, 83, 0.08); }
.qcheck__feedback {
  margin-top: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--bg-3);
  border-radius: var(--r-2);
  border: 1px solid var(--border);
  font-size: 0.92rem;
}
.qcheck__feedback h5 {
  margin: 0 0 var(--s-2); font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-mute);
}

/* Final "mark complete" step */
.step--complete {
  text-align: center;
  background: rgba(20, 24, 32, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-3);
  padding: var(--s-6) var(--s-5);
  box-shadow: var(--shadow-2);
}
.step--complete h2 { font-size: 1.5rem; }
.step--complete .step__sources { margin-top: var(--s-4); display: flex; gap: var(--s-2); flex-wrap: wrap; justify-content: center; }

/* ---- PRACTICE OVERLAY ---- */
.overlay--practice,
.overlay--more {
  overflow-y: auto;
  padding: var(--s-5);
  /* Practice and More don't need the canvas to be drag-reachable — the bg is
     just a dimmed backdrop — so we let the overlay capture wheel/click. */
  pointer-events: auto;
}
.centered-card {
  max-width: 760px;
  margin: 0 auto;
  background: rgba(20, 24, 32, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-3);
  padding: var(--s-6);
  box-shadow: var(--shadow-2);
}
.centered-card__head { margin-bottom: var(--s-5); }
.centered-card__head p { color: var(--text-dim); max-width: 60ch; }

/* Practice & More are SCROLL containers. A backdrop-filter on the card forces
   the browser to re-sample + re-blur the canvas behind it on every scroll frame
   — that's a visible scroll jitter (most noticeable when a quiz makes the card
   taller than the viewport). The card bg is already 92% opaque, so the blur is
   invisible here anyway; drop it in the scrolling overlays to keep scroll smooth.
   (Home keeps the blur — it's centered and never scrolls.) */
.overlay--practice .centered-card,
.overlay--more .centered-card {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.practice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-3);
}
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.card--practice button { margin-top: auto; }
.card h2 { font-size: 1rem; margin: 0; font-family: var(--font-sans); }
.card p { color: var(--text-dim); font-size: 0.88rem; margin: 0; }

.quiz__runner {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: var(--s-5);
  margin-top: var(--s-5);
}
.quiz__progress {
  display: flex; justify-content: space-between;
  font-size: 0.85rem; color: var(--text-mute);
  margin-bottom: var(--s-3);
  font-family: var(--font-mono);
}
.quiz__question {
  font-size: 1.1rem; font-weight: 600;
  font-family: var(--font-head);
  margin-bottom: var(--s-4);
}
.quiz__choices { list-style: none; padding: 0; margin: 0 0 var(--s-4); display: grid; gap: var(--s-2); }
.quiz__choice {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--r-2);
  padding: var(--s-3) var(--s-4);
  cursor: pointer;
  font: inherit;
  text-align: left;
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  min-height: 52px;
}
.quiz__choice:hover { border-color: var(--border-strong); }
.quiz__choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.quiz__choice .letter { font-family: var(--font-mono); color: var(--text-mute); font-size: 0.85rem; width: 1.5rem; flex-shrink: 0; }
.quiz__choice.is-correct { border-color: var(--success); background: rgba(124, 200, 154, 0.1); }
.quiz__choice.is-wrong   { border-color: var(--warning); background: rgba(255, 107, 83, 0.08); }
.quiz__feedback {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-4);
}
.quiz__feedback h4 { margin: 0 0 var(--s-2); }
.quiz__feedback .sources { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-2); }
.quiz__actions { display: flex; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.quiz__result { text-align: center; padding: var(--s-5); }
.quiz__score {
  font-size: 2.4rem; font-weight: 600;
  font-family: var(--font-mono);
  color: var(--accent);
  margin: var(--s-3) 0;
}
.footnote {
  margin-top: var(--s-4);
  color: var(--text-mute);
  font-size: 0.82rem;
}

/* ---- EXPLORE (map) OVERLAY ---- */
.overlay--map { padding: 0; }
.explore-head {
  position: absolute;
  top: var(--s-4);
  left: 50%;
  transform: translateX(-50%);
  z-index: 14;
  text-align: center;
  background: rgba(18, 21, 26, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: var(--s-2) var(--s-4);
  pointer-events: none;
  max-width: calc(100% - 2 * var(--s-4));
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
/* Once the user picks something in the 3D scene, they know how to interact —
   fade the instructional header out so it stops taking visual space. */
.explore-head.is-dismissed {
  opacity: 0;
  transform: translate(-50%, -8px);
  pointer-events: none;
}
.explore-head h1 { font-size: 1rem; margin: 0; }
.explore-head p { margin: var(--s-1) 0 0; font-size: 0.82rem; color: var(--text-mute); }
.explore-head p strong { color: var(--accent); font-weight: 600; }
@media (max-width: 720px) {
  /* Mobile: keep the hint but compress it onto one line. */
  .explore-head { padding: 6px var(--s-3); }
  .explore-head h1 { display: none; }
  .explore-head p  { font-size: 0.75rem; }
}

.explore-panel {
  position: absolute;
  right: var(--s-4);
  top: var(--s-4);
  bottom: var(--s-4);
  z-index: 14;
  width: 280px;
  background: rgba(20, 24, 32, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  overflow-y: auto;
  pointer-events: auto;
  transition: transform var(--t-med) var(--ease), opacity var(--t-med) var(--ease);
}
/* Collapsed: slide off to the right and fade. */
body[data-panel="collapsed"] .explore-panel {
  transform: translateX(calc(100% + var(--s-5)));
  opacity: 0;
  pointer-events: none;
}

/* "Layers" toggle button — shares the floating-overlay chrome contract.
   Sits at the same top: var(--s-4) as the readout on the opposite corner. */
.panel-toggle {
  position: absolute;
  right: calc(280px + var(--s-4) + var(--s-2));
  top: var(--s-4);
  z-index: 15;
  display: none;            /* only shown on /map (see rule below) */
  height: 40px;
  min-width: 110px;
  padding: 0 14px;
  border-radius: var(--r-2);
  background: rgba(20, 24, 32, 0.88);
  border: 1px solid var(--border-strong);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: flex-start;
  gap: var(--s-2);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: right var(--t-med) var(--ease), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.panel-toggle:hover { background: rgba(30, 36, 48, 0.96); border-color: var(--accent); color: var(--accent); }
.panel-toggle__icon  { font-size: 1.05rem; line-height: 1; }
.panel-toggle__label { letter-spacing: 0.02em; }
body[data-panel="collapsed"] .panel-toggle { right: var(--s-4); }
body[data-view="map"] .panel-toggle { display: inline-flex; }

/* ---- Floating overlays on /map ---- */
/* Bottom-center: view-preset bar. Always-on shortcuts for camera presets. */
.floating-views {
  position: absolute;
  bottom: var(--s-4);
  left: 50%;
  transform: translateX(-50%);
  z-index: 14;
  display: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;   /* keep buttons centered if they ever wrap */
  gap: 2px;
  padding: 5px;
  background: rgba(20, 24, 32, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
  max-width: calc(100% - 2 * var(--s-4));
  pointer-events: auto;
}
body[data-view="map"] .floating-views { display: inline-flex; }
.floating-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  padding: 0.45rem 0.8rem;
  border-radius: var(--r-1);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.floating-btn:hover { background: var(--surface-strong); color: var(--accent); }
.floating-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
/* Subtle shortcut-key indicator. The <u> marks the letter the user can
   press as a hotkey; underline is drawn in muted accent so it reads as a
   hint, not a UI element. Brightens on hover so it's discoverable. */
.floating-btn u {
  text-decoration: underline;
  text-decoration-color: rgba(255, 179, 71, 0.55);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.floating-btn:hover u { text-decoration-color: var(--accent); }
.map-tour__status {
  display: inline-block; margin: 0 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem; color: var(--text-mute);
}
/* Keep the auto-tour step caption OUT of the views bar — as a block flex item
   it widened the bar and pushed the buttons off-center. The tour still animates
   the scene and highlights the active layer, so the caption isn't needed here.
   (ID selector beats the class rules above regardless of source order.) */
#map-tour-status { display: none; }

/* Bottom-left: pad mode toggle + drone/pilot pad + keyboard hint.
   Width matches the scene-readout panel above it so the column reads as
   one stack of equal-width chips. */
.floating-pad-wrap {
  position: absolute;
  bottom: var(--s-4);
  left: var(--s-4);
  z-index: 14;
  display: none;
  flex-direction: column;
  gap: 6px;
  width: 220px;           /* matches .scene-readout min-width */
  box-sizing: border-box;
}
body[data-view="map"] .floating-pad-wrap { display: flex; }

.pad-mode {
  display: flex;
  background: rgba(20, 24, 32, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
  padding: 4px;
  gap: 2px;
}
.pad-mode__btn {
  flex: 1;
  background: transparent;
  color: var(--text-mute);
  border: none;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.pad-mode__btn:hover:not(.is-active) { color: var(--text); }
.pad-mode__btn.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* When pad is in pilot mode, climb/descend buttons don't apply. */
.floating-pad[data-target="pilot"] .pad__btn--alt-up,
.floating-pad[data-target="pilot"] .pad__btn--alt-down {
  opacity: 0.32;
  pointer-events: none;
}
.floating-pad {
  display: grid;
  grid-template-columns: repeat(6, 1fr);   /* fills the 220px wrap evenly */
  gap: 4px;
  padding: var(--s-2);
  background: rgba(20, 24, 32, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
  box-sizing: border-box;
}
/* 6-column layout: directional buttons span 2 cols each, alt buttons span 3. */
.floating-pad .pad__btn          { min-height: 40px; font-size: 0.92rem; padding: 0; }
.floating-pad .pad__btn--up      { grid-column: 3 / span 2; grid-row: 1; }
.floating-pad .pad__btn--left    { grid-column: 1 / span 2; grid-row: 2; }
.floating-pad .pad__btn--center  { grid-column: 3 / span 2; grid-row: 2; }
.floating-pad .pad__btn--right   { grid-column: 5 / span 2; grid-row: 2; }
.floating-pad .pad__btn--down    { grid-column: 3 / span 2; grid-row: 3; }
.floating-pad .pad__btn--alt-up   { grid-column: 1 / span 3; grid-row: 4; font-size: 0.82rem; }
.floating-pad .pad__btn--alt-down { grid-column: 4 / span 3; grid-row: 4; font-size: 0.82rem; }
.floating-pad__hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(20, 24, 32, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-mute);
  text-align: center;
}
.floating-pad__hint span { white-space: nowrap; }
/* Climb + descend share the third line, separated by a gap (no dot needed). */
.floating-pad__hint-row { display: flex; gap: 12px; }

/* Turn keys live in the top row's empty corners, flanking the forward arrow —
   no separate row, so the pad keeps its original height. */
.floating-pad .pad__btn--rot-l { grid-column: 1 / span 2; grid-row: 1; font-size: 1.1rem; }
.floating-pad .pad__btn--rot-r { grid-column: 5 / span 2; grid-row: 1; font-size: 1.1rem; }
/* A pilot has no heading/altitude — blank the turn keys (keep the grid cells)
   and hide the turn + climb/descend hint lines in Pilot mode. */
.floating-pad[data-target="pilot"] .pad__btn--rot-l,
.floating-pad[data-target="pilot"] .pad__btn--rot-r { visibility: hidden; }
.floating-pad[data-target="pilot"] ~ .floating-pad__hint #pad-hint-rotate,
.floating-pad[data-target="pilot"] ~ .floating-pad__hint .floating-pad__hint-row { display: none; }

/* Collapsible FABs (Move / Views) — a single round button that stands in for
   the full pad / view bar on small screens. Hidden on desktop; the mobile
   media query in MOBILE FIXES reveals them and hides the expanded controls.
   They share the floating-overlay chrome contract (same bg/border/blur). */
.chrome-fab {
  display: none;            /* shown only on mobile (see MOBILE FIXES) */
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 48px;
  min-width: 48px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(20, 24, 32, 0.92);
  border: 1px solid var(--border-strong);
  color: var(--text);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.chrome-fab__icon  { flex-shrink: 0; }
/* When its menu is open, the trigger keeps its label and lights up in accent —
   the SAME active treatment used by the Layers toggle and the status pill, so
   open/close reads identically on all four Explore controls. Tapping the
   trigger again closes it (no separate ✕ affordance). */
body[data-pad-open="true"]   #pad-fab,
body[data-views-open="true"] #views-fab {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* Shared chevron indicator for every collapsible Explore trigger (status pill,
   Layers, Move, Views). It points toward where the panel opens and flips when
   open, so the open/close affordance is consistent across all of them. Mobile
   only — desktop shows the full controls and never collapses them. */
.chrome-chevron { display: none; }

/* ---- Guided-tour caption card ---- */
/* Shown only while a tour runs. During the tour the camera + picking are locked
   (in JS) and the rest of the Explore chrome is hidden (rules below) so the
   caption is the single focus. Bottom-center on desktop; full-width sheet on
   mobile. */
.tour-card {
  position: absolute;
  left: var(--s-4);
  bottom: var(--s-4);
  z-index: 20;
  width: min(380px, calc(100vw - 2 * var(--s-4)));
  box-sizing: border-box;
  padding: var(--s-3) var(--s-4) var(--s-4);
  background: rgba(20, 24, 32, 0.94);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}
.tour-card[hidden] { display: none; }
.tour-card__head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-2);
}
.tour-card__eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.64rem;
  color: var(--accent);
}
.tour-card__step {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-mute);
}
.tour-card__close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--text-mute);
  font-size: 1.05rem;
  line-height: 1;
  width: 32px; height: 32px;
  border-radius: var(--r-1);
  cursor: pointer;
}
.tour-card__close:hover { color: var(--text); background: var(--surface); }
.tour-card__title {
  font-family: var(--font-head);
  font-size: 1.12rem;
  margin: 0 0 var(--s-1);
  color: var(--text);
}
.tour-card__desc {
  margin: 0 0 var(--s-3);
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.5;
}
/* Progress bar = visible countdown to the next step (freezes when paused). */
.tour-card__bar {
  height: 4px;
  border-radius: 999px;
  background: var(--bg-3);
  overflow: hidden;
  margin-bottom: var(--s-3);
}
.tour-card__fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
}
.tour-card__actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.tour-card__actions #tour-next { margin-left: auto; }

/* ---- Voice narration (text-to-speech) controls ---- */
/* Speaker toggle in the tour-card header. Sits hard-right next to Close. */
.tour-card__voice {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-1);
  color: var(--text-mute);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.tour-card__voice:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface); }
.tour-card__voice[hidden] { display: none; }
.tour-card__voice[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
/* With the speaker present it owns the right-push, so Close packs in beside it. */
.tour-card__head .tour-card__voice + .tour-card__close { margin-left: 0; }

/* "Listen" button inside scene popovers — icon-only so the action row stays on
   one line next to the (sometimes long) primary + Close buttons. */
.btn--listen {
  padding: 0;
  width: 38px;
  flex: 0 0 auto;
}
.btn--listen[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
/* Sticky popover header — holds the title + the Listen/play button so the play
   control is the first thing the user sees and stays pinned while the card
   auto-scrolls during read-aloud. Negative margins make it full-bleed and cancel
   the card's top padding so nothing peeks above it. */
.pick-popover__head {
  position: sticky;
  top: calc(-1 * var(--s-4));
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin: calc(-1 * var(--s-4)) calc(-1 * var(--s-5)) var(--s-3);
  padding: var(--s-2) var(--s-5);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  border-radius: var(--r-2) var(--r-2) 0 0;
}
.pick-popover__head h3 { margin: 0; flex: 1 1 auto; }
.pick-popover__head .btn--listen { flex: 0 0 auto; }

/* Line currently being read aloud — highlighted + scrolled into view by the TTS
   reader. The 4px box-shadow spread gives the tint a little breathing room
   beyond the text box without shifting layout. */
.tts-reading {
  background: var(--accent-soft);
  box-shadow: 0 0 0 4px var(--accent-soft);
  border-radius: 3px;
  scroll-margin: 28px;
  transition: background var(--t-fast) var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .tts-reading { transition: none; }
}

/* The sound-wave arcs in the speaker icon pulse while voice is active. */
.tts-wave { transform-origin: 7px 12px; }
.tts-wave--2 { opacity: 0.6; }
[aria-pressed="true"] > svg .tts-wave { animation: tts-pulse 1.1s var(--ease) infinite; }
[aria-pressed="true"] > svg .tts-wave--2 { animation-delay: 0.18s; }
@keyframes tts-pulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  [aria-pressed="true"] > svg .tts-wave { animation: none; }
}

/* While touring, hide the rest of the Explore chrome so nothing competes with
   the caption or invites a camera-moving interaction. */
body[data-tour="on"] .floating-views,
body[data-tour="on"] .floating-pad-wrap,
body[data-tour="on"] .panel-toggle,
body[data-tour="on"] .explore-panel,
body[data-tour="on"] .explore-head,
body[data-tour="on"] .scene-readout { display: none !important; }

@media (max-width: 720px) {
  .tour-card {
    left: var(--s-3);
    right: var(--s-3);
    bottom: calc(var(--s-3) + env(safe-area-inset-bottom, 0));
    transform: none;
    width: auto;
  }
}

/* Mobile rules for these elements live in the consolidated "MOBILE FIXES"
   block at the bottom of this file. */
.panel__group {
  background: var(--bg-1);
  border-radius: var(--r-2);
  padding: var(--s-3);
  border: 1px solid transparent;
}
.panel__group[open] { border-color: var(--border); }
.panel__title {
  list-style: none; cursor: pointer;
  font-size: 0.74rem; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--text-mute);
  font-weight: 600; margin: 0;
  padding: var(--s-1) 0;
  display: flex; align-items: center; justify-content: space-between;
}
.panel__title::-webkit-details-marker { display: none; }
.panel__title::after { content: "▾"; font-size: 0.7rem; }
.panel__group[open] > .panel__title::after { content: "▴"; }
.panel__group > *:not(summary) { margin-top: var(--s-3); }
.panel__hint { color: var(--text-mute); font-size: 0.82rem; margin: 0; }
.map-tour__status {
  display: block; margin-top: var(--s-2);
  font-family: var(--font-mono);
  font-size: 0.78rem; color: var(--text-mute);
}

.layer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); }
.layer-list label {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2); border-radius: var(--r-2);
  cursor: pointer; min-height: 40px;
}
.layer-list label:hover { background: var(--surface); }
.layer-list input { width: 18px; height: 18px; accent-color: var(--accent); }
/* Name + unit note stack vertically: the airspace name stays whole on its own
   line and the note sits directly beneath it, so a long note can never push
   text off the panel. min-width:0 lets the column shrink and wrap inside the
   fixed-width panel instead of overflowing. */
.layer-list__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.layer-list__name { white-space: nowrap; }
.layer-list__note {
  font-size: 0.7rem;
  line-height: 1.25;
  color: var(--text-mute);
  font-family: var(--font-mono);
}

/* Ambient-sound toggle row in the Explore layers panel. */
.sound-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.sound-row__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sound-row__title { font-weight: 600; font-size: 0.9rem; }
.sound-row__note { font-size: 0.74rem; color: var(--text-mute); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; }
.swatch--a       { background: var(--c-class-a); }
.swatch--b       { background: var(--c-class-b); }
.swatch--c       { background: var(--c-class-c); }
.swatch--d       { background: var(--c-class-d); }
.swatch--e       { background: var(--c-class-e); }
.swatch--g       { background: var(--c-class-g); }
.swatch--ceiling { background: var(--c-ceiling); }
.swatch--vlos    { background: var(--c-vlos); }
.swatch--clouds  { background: #e6e8ec; }

.pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-2);
}
.pad__btn {
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--border);
  padding: var(--s-3);
  border-radius: var(--r-2);
  font-size: 0.95rem;
  cursor: pointer;
  min-height: 44px;
  font-family: inherit;
}
.pad__btn:hover { background: var(--bg-2); border-color: var(--border-strong); }
.pad__btn--up     { grid-column: 2; grid-row: 1; }
.pad__btn--left   { grid-column: 1; grid-row: 2; }
.pad__btn--center { grid-column: 2; grid-row: 2; }
.pad__btn--right  { grid-column: 3; grid-row: 2; }
.pad__btn--down   { grid-column: 2; grid-row: 3; }
.pad__btn--alt-up   { grid-column: 1; grid-row: 4; }
.pad__btn--alt-down { grid-column: 3; grid-row: 4; }

.row { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.btn--xr { width: 100%; margin-top: var(--s-2); }

/* Bulk layer-toggle buttons sit at the top of the Layers panel. */
.layer-actions { margin-bottom: var(--s-2); }
.layer-actions .btn { flex: 1; }

/* 2x2 grid of view presets — each button gets equal width. */
.view-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-2);
}

@media (max-width: 720px) {
  /* Layers panel = a dropdown anchored directly under its top-right button,
     mirroring how the status pill expands in the opposite corner. It is NOT a
     bottom sheet: it drops down from the Layers toggle (top: button bottom),
     fades out when collapsed, and never reaches the bottom-corner FABs. The
     panel-toggle is repositioned to top-right in the MOBILE FIXES block. */
  .explore-panel {
    top: calc(var(--s-3) + 40px + var(--s-2));   /* just under the Layers button */
    right: var(--s-3);
    left: auto;
    bottom: auto;
    width: min(320px, calc(100vw - 2 * var(--s-3)));
    max-height: 70vh;                            /* matches the readout's cap */
    flex-direction: column;
    transform-origin: top right;
  }
  .panel__group { flex: 1; min-width: 0; }
  /* Collapsed: fade up and out, like a dismissed dropdown (not a slide-down). */
  body[data-panel="collapsed"] .explore-panel {
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
  }
}

/* ---- MORE OVERLAY (reveals) ---- */
.reveal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  margin-bottom: var(--s-3);
  overflow: hidden;
}
.reveal[open] { border-color: var(--border-strong); }
.reveal > summary {
  list-style: none;
  cursor: pointer;
  padding: var(--s-4) var(--s-5);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.reveal > summary::-webkit-details-marker { display: none; }
.reveal > summary::after {
  content: "+";
  margin-left: auto;
  color: var(--text-mute);
  font-size: 1.3rem;
  font-weight: 300;
}
.reveal[open] > summary::after { content: "–"; }
.reveal__body { padding: 0 var(--s-5) var(--s-5); color: var(--text-dim); }
.reveal__body p, .reveal__body ul { color: var(--text-dim); }

/* Scale & accuracy explainer ------------------------------------------------ */
.scale-key { display: grid; gap: var(--s-2); margin: var(--s-4) 0; }
.scale-key__row {
  display: grid;
  grid-template-columns: minmax(110px, 28%) 1fr;
  gap: var(--s-2) var(--s-4);
  align-items: start;
  padding: var(--s-3) var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
}
.scale-key dt { font-weight: 600; color: var(--text); }
.scale-key dd { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.scale-key dd strong { color: var(--accent); font-variant-numeric: tabular-nums; }
.scale-key dd span { color: var(--text-dim); font-size: 0.9rem; line-height: 1.4; }
.scale-note { font-size: 0.9rem; color: var(--text-mute); margin-top: var(--s-3); }
.scale-note--vr {
  border-left: 2px solid var(--accent);
  padding-left: var(--s-3);
  color: var(--text-dim);
}
@media (max-width: 460px) {
  .scale-key__row { grid-template-columns: 1fr; gap: 4px; }
}

.panel__foot-note { margin: var(--s-3) 0 0; padding: 0 var(--s-2); font-size: 0.85rem; }
.panel__foot-note a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); }
.panel__foot-note a:hover { color: var(--accent); }

.setting-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--s-4); padding: var(--s-3) 0;
  border-bottom: 1px solid var(--border);
}
.setting-row:last-child { border-bottom: none; }
.setting-row h3 { font-size: 1rem; margin: 0 0 var(--s-1); }
.setting-row p { color: var(--text-mute); font-size: 0.85rem; margin: 0; }

.toggle { background: none; border: none; cursor: pointer; padding: 0; }
.toggle__track {
  display: inline-block; width: 44px; height: 26px;
  background: var(--bg-3); border: 1px solid var(--border-strong);
  border-radius: 999px; position: relative;
  transition: background var(--t-fast) var(--ease);
}
.toggle__thumb {
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.toggle[aria-pressed="true"] .toggle__track { background: var(--accent-soft); border-color: var(--accent); }
.toggle[aria-pressed="true"] .toggle__thumb { transform: translateX(18px); background: var(--accent); }

.donate-row { display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* "Learn more" outside-resources list (More overlay). Cards match .source-item. */
.resource-group {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-mute);
  margin: var(--s-4) 0 var(--s-2);
}
.resource-group:first-of-type { margin-top: var(--s-3); }
.resource-list { list-style: none; padding: 0; margin: 0 0 var(--s-2); display: grid; gap: var(--s-2); }
.resource-list li {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: var(--s-3) var(--s-4);
}
.resource-list a { color: var(--text); font-weight: 600; }
.resource-list a:hover { color: var(--accent); }
.resource-list a::after { content: " ↗"; color: var(--text-mute); font-weight: 400; }
.resource-list .tag { margin-left: var(--s-1); vertical-align: middle; }
.resource-list__desc { display: block; margin-top: 4px; font-size: 0.85rem; color: var(--text-dim); line-height: 1.45; }

.source-list { list-style: none; padding: 0; margin: var(--s-3) 0 0; display: grid; gap: var(--s-2); }
.source-item {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: var(--s-3) var(--s-4);
}
.source-item__title { font-weight: 600; }
.source-item__title a { color: var(--text); }
.source-item__title a:hover { color: var(--accent); }
.source-item__meta {
  font-size: 0.82rem; color: var(--text-mute);
  display: flex; flex-wrap: wrap; gap: var(--s-2);
  margin-top: var(--s-1);
}
.source-item__type {
  text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 0.68rem; padding: 2px 8px; border-radius: 999px;
}
.source-item__type--official    { background: rgba(255, 179, 71, 0.15);  color: var(--accent); }
.source-item__type--regulation  { background: rgba(141, 180, 255, 0.15); color: var(--info); }
.source-item__type--secondary   { background: rgba(126, 120, 102, 0.18); color: var(--text-mute); }
.source-item__type--industry    { background: rgba(197, 160, 224, 0.15); color: var(--proposed); }

/* ============================================================
   MOBILE FIXES — additive layer that adjusts the floating Explore
   chrome, touch targets, and stepper/home/practice overflow at
   common phone widths (360, 375, 414). Don't add ad-hoc mobile
   rules elsewhere; consolidate them here so the next contributor
   can see all the mobile behavior in one place.
   ============================================================ */

/* Wrap hover transforms in (hover: hover) so iOS doesn't leave the
   button "lifted" after a tap. Devices with a real cursor still get
   the lift on hover. */
@media (hover: hover) {
  .btn:hover         { transform: translateY(-1px); }
  .path-item:hover   { transform: translateY(-1px); }
  .lesson-card:hover { transform: translateY(-2px); }
  .feature-tile:hover{ transform: translateY(-2px); }
  .shortcut:hover    { transform: translateY(-1px); }
}
/* Mirror :active so the press still feels responsive on touch. */
.btn:active, .path-item:active { transform: translateY(0); }

/* ---- Mobile tweaks (≤ 540px) ---- */
@media (max-width: 540px) {
  body { font-size: 16px; }
  .home-card, .centered-card { padding: var(--s-4); }
  .stepper__head, .stepper__foot { padding: var(--s-2) var(--s-3); }

  /* Home actions become full-width tap targets (≥44px) instead of inline links. */
  .home-actions {
    flex-direction: column;
    gap: var(--s-1);
  }
  .home-actions .link-strong {
    display: block;
    width: 100%;
    padding: var(--s-3) 0;
    border-bottom: 1px solid var(--border);
  }

  /* Practice/More overlays get tighter outer padding so the cards have room. */
  .overlay--practice, .overlay--more { padding: var(--s-3); }

  /* Stepper crumb truncates instead of overflowing on long lesson topics. */
  .stepper__head     { gap: var(--s-2); flex-wrap: wrap; }
  .stepper__crumb    { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; font-size: 0.78rem; }
  .stepper__progress { font-size: 0.78rem; }
  .stepper__stage    { padding: var(--s-3); }

  /* Pad dots collapse on very narrow screens — the prev/next buttons remain. */
  .stepper__dots { display: none; }
}

/* ---- Explore view: collapse every floating surface to a corner affordance
   so the 3D scene fills the screen and stays tappable / orbit-able (≤ 720px).
   Layout: status pill (top-left), Layers (top-right), Move FAB (bottom-left),
   Views FAB (bottom-right). The pad, view presets, and the full readout each
   open on demand and only one is open at a time (enforced in main.js). ---- */
@media (max-width: 720px) {
  /* --- Status pill = collapsed readout (top-left) --- */
  .scene-readout {
    top: var(--s-3);
    left: var(--s-3);
    min-width: 0;
    max-width: calc(100vw - 2 * var(--s-3));
    padding: 6px;
    gap: var(--s-1);
    pointer-events: auto;          /* the pill must be tappable */
  }
  .scene-readout strong         { font-size: 0.82rem; }
  .scene-readout strong > span  { font-size: 1rem; }

  /* The status row is the expand/collapse button. */
  .readout-status {
    cursor: pointer;
    margin: 0;
    -webkit-tap-highlight-color: transparent;
  }

  /* --- Shared chevron: every collapsible trigger gets the same affordance --- */
  .chrome-chevron {
    display: block;
    width: 8px; height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    opacity: 0.85;
    flex-shrink: 0;
    transition: transform var(--t-fast) var(--ease);
  }
  /* Top-edge triggers (status pill, Layers): chevron points DOWN when closed
     — the panel opens below — and flips UP when open. */
  .readout-status .chrome-chevron { margin-left: auto; }
  .readout-status .chrome-chevron,
  .panel-toggle  .chrome-chevron { transform: rotate(45deg); }
  body[data-readout="expanded"] .readout-status .chrome-chevron,
  body[data-panel="expanded"]   .panel-toggle  .chrome-chevron { transform: rotate(-135deg); }
  /* Bottom-edge triggers (Move, Views): chevron points UP when closed — the
     menu opens above — and flips DOWN when open. */
  #pad-fab   .chrome-chevron,
  #views-fab .chrome-chevron { transform: rotate(-135deg); }
  body[data-pad-open="true"]   #pad-fab   .chrome-chevron,
  body[data-views-open="true"] #views-fab .chrome-chevron { transform: rotate(45deg); }

  /* Layers toggle gets the same accent "active" treatment when its sheet is
     open, matching the Move/Views FABs and the status pill. */
  body[data-panel="expanded"] .panel-toggle {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
  }
  /* Collapsed (default): only the status pill; hide the metric rows. */
  body[data-readout="collapsed"] .scene-readout > div:not(.readout-status) {
    display: none;
  }
  /* Expanded: reveal the rows; cap height so a tall readout scrolls. */
  body[data-readout="expanded"] .scene-readout {
    padding-bottom: var(--s-2);
    max-height: 70vh;
    overflow-y: auto;
  }
  body[data-readout="expanded"] .scene-readout > div:not(.readout-status) {
    padding: 0 var(--s-2);
  }

  /* Panel toggle (Layers) — top-right, clear of the status pill. */
  .panel-toggle {
    right: var(--s-3) !important;
    top: var(--s-3) !important;
    bottom: auto !important;
    min-width: 0;
    padding: 0 12px;
    height: 40px;
  }

  /* Instructional hint sits centered, below the top chrome; it auto-dismisses
     on first interaction. The warning toast reuses the same top band (the hint
     is gone by the time a violation can occur). */
  .explore-head {
    top: calc(var(--s-3) + 52px);
    max-width: calc(100% - var(--s-4));
    padding: 4px var(--s-3);
  }
  .scene-warning {
    top: calc(var(--s-3) + 52px);
    font-size: 0.84rem;
    max-width: calc(100% - 2 * var(--s-3));
  }

  /* --- Move FAB + collapsible pad (bottom-left) --- */
  #pad-fab { display: inline-flex; }
  .floating-pad-wrap {
    left: var(--s-3);
    bottom: calc(var(--s-3) + env(safe-area-inset-bottom, 0));
    width: auto;
    max-width: calc(100vw - 2 * var(--s-3));
    align-items: flex-start;
    gap: var(--s-2);
  }
  /* Keyboard hints are meaningless on touch — never show them on mobile. */
  .floating-pad__hint { display: none !important; }
  /* Collapsed (default): only the FAB shows. */
  body[data-pad-open="false"] .pad-mode,
  body[data-pad-open="false"] .floating-pad { display: none; }
  /* Open: pad mode + directional pad sit above the FAB. */
  body[data-pad-open="true"] .pad-mode,
  body[data-pad-open="true"] .floating-pad { width: min(82vw, 300px); }

  /* --- Views FAB + collapsible preset menu (bottom-right) --- */
  #views-fab { display: inline-flex; }
  .floating-views {
    right: var(--s-3);
    left: auto;
    transform: none;
    bottom: calc(var(--s-3) + env(safe-area-inset-bottom, 0));
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 6px;
    max-width: 62vw;
    background: transparent;        /* container is invisible until opened */
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  /* Collapsed (default): only the FAB shows. */
  body[data-views-open="false"] #floating-views .floating-btn { display: none; }
  /* Open: presets stack vertically inside a panel above the FAB. */
  body[data-views-open="true"] .floating-views {
    background: rgba(20, 24, 32, 0.92);
    border: 1px solid var(--border-strong);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  body[data-views-open="true"] .floating-btn { width: 100%; text-align: center; }

  /* Touch targets ≥ 44px where it matters. */
  .floating-pad .pad__btn { min-height: 44px; }
  .pad-mode__btn          { min-height: 40px; padding: 8px 10px; }
  .floating-btn           { min-height: 44px; padding: 0.6rem 0.9rem; font-size: 0.9rem; }
}

/* ---- Tiny screens (≤ 380px) — header and toggles fit. ---- */
@media (max-width: 380px) {
  .site-header__inner { padding: 0 var(--s-3); gap: var(--s-2); }
  .brand__name        { font-size: 0.92rem; }
  .panel-toggle__label{ display: none; }   /* leave just the ≡ icon to save room */
  .panel-toggle       { min-width: 0; padding: 0 10px; }
  /* The collapsed pill / FABs are already compact; drop the label text on the
     FABs to save room while keeping the icon as the tap target. */
  .chrome-fab__label  { display: none; }
  .chrome-fab         { padding: 0 13px; }
}

/* ---- Native-feel momentum scroll on iOS overflow panels ---- */
.drawer__body,
.explore-panel,
.overlay--practice,
.overlay--more,
.modal__body,
.pick-popover {
  -webkit-overflow-scrolling: touch;
}
