/* iteration 31: DARK is the default theme (night flight) — the no-attribute
   state is already dark, so there is no flash before the head script runs.
   Light lives under :root[data-theme="light"] via the header toggle. */
:root {
  --bg: #0d1218;
  --panel: #1a212a;
  --text: #e6edf4;
  --muted: #93a4b5;
  --accent: #5aa5e8;
  --accent-2: #3a7fc4;
  --accent-text: #0c1116;
  --border: #2c3644;
  --chip-bg: #223243;
  --warn-bg: #2e2410;
  --warn-border: #8a6d2a;
  --warn-text: #e8c877;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 4px 10px rgba(0, 0, 0, 0.5), 0 14px 34px rgba(0, 0, 0, 0.45);
  --grad-accent: linear-gradient(135deg, var(--accent), var(--accent-2));
  --header-bg: rgba(13, 18, 24, 0.72);
  --sky-top: #060b18;
  --sky-mid: #0d1c33;
  --sky-low: #1c2f4a;
  --horizon: #d88a3f;
  --hero-text: #eef4fa;
  --stars: 0.9;
  --cloud: rgba(148, 170, 196, 0.28);
  --runway-line: rgba(255, 214, 79, 0.55);
}
:root[data-theme="light"] {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #16202b;
  --muted: #5b6b7c;
  --accent: #0b5cab;
  --accent-2: #1673c2; /* white stays ≥4.5:1 across the whole gradient */
  --accent-text: #ffffff;
  --border: #d8dee6;
  --chip-bg: #e8f1fb;
  --warn-bg: #fff4e0;
  --warn-border: #e0b25c;
  --warn-text: #6b4b0e;
  --shadow-1: 0 1px 3px rgba(16, 32, 53, 0.08), 0 4px 14px rgba(16, 32, 53, 0.06);
  --shadow-2: 0 4px 10px rgba(16, 32, 53, 0.12), 0 14px 34px rgba(16, 32, 53, 0.12);
  --header-bg: rgba(255, 255, 255, 0.72);
  --sky-top: #2f7fd0;
  --sky-mid: #7db8e8;
  --sky-low: #cfe6f5;
  --horizon: #f6e3c5;
  --hero-text: #ffffff;
  --stars: 0;
  --cloud: rgba(255, 255, 255, 0.92);
  --runway-line: rgba(255, 255, 255, 0.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }

.site-header {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 1rem;
  padding: 0.9rem 1.2rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.brand { font-size: 1.25rem; font-weight: 700; text-decoration: none; color: var(--text); }
.tagline { color: var(--muted); font-size: 0.9rem; }

.disclaimer {
  background: var(--warn-bg);
  border-bottom: 1px solid var(--warn-border);
  color: var(--warn-text);
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
}
.disclaimer a { color: inherit; }

main { max-width: 960px; margin: 0 auto; padding: 1rem 1.2rem 3rem; }

/* ---- search view ---- */
.search-box {
  width: 100%;
  font-size: 1.2rem;
  padding: 0.7rem 1rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  outline: none;
}
.search-box:focus { border-color: var(--accent); }
.result-count { color: var(--muted); font-size: 0.85rem; margin: 0.5rem 0.2rem; }

.result-list { list-style: none; margin: 0; padding: 0; }
.result-list li { margin: 0; }
.result-row {
  display: flex; align-items: baseline; gap: 0.8rem;
  width: 100%;
  padding: 0.55rem 0.8rem;
  margin: 0.25rem 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
}
.result-row:hover, .result-row:focus { border-color: var(--accent); }
.result-icao { font-weight: 700; font-family: ui-monospace, Menlo, monospace; min-width: 4.6em; }
.result-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-freq { color: var(--muted); font-size: 0.85rem; font-family: ui-monospace, Menlo, monospace; }
.badge {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.1rem 0.45rem; border-radius: 99px;
  background: var(--chip-bg); color: var(--muted);
}
.no-results { color: var(--muted); padding: 2rem 0; text-align: center; }

/* ---- detail view ---- */
.back-link { display: inline-block; margin-bottom: 0.8rem; text-decoration: none; }
.detail-header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem; margin: 0.2rem 0 0.2rem; }
.detail-header h1 { margin: 0; font-size: 1.6rem; }
.detail-header .icao { font-family: ui-monospace, Menlo, monospace; color: var(--accent); }
.status-line { color: var(--muted); margin-bottom: 1rem; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin: 0.8rem 0;
}
.card h2 { margin: 0 0 0.6rem; font-size: 1.02rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

.freq-grid { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.freq-chip {
  background: var(--chip-bg);
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
}
.freq-chip .station { display: block; font-size: 0.78rem; color: var(--muted); }
.freq-chip .mhz { font-family: ui-monospace, Menlo, monospace; font-weight: 700; font-size: 1.15rem; }

.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.5rem 1.2rem; }
.fact .k { display: block; font-size: 0.78rem; color: var(--muted); }
.fact .v { font-weight: 600; }

.table-scroll { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
table.data th, table.data td { border: 1px solid var(--border); padding: 0.35rem 0.6rem; text-align: left; white-space: nowrap; }
table.data th { background: var(--chip-bg); }

.svc-list { margin: 0; }
.svc-list dt { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.5rem; }
.svc-list dd { margin: 0.1rem 0 0; }

.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.8rem; }
.chart-frame img { max-width: 100%; border: 1px solid var(--border); border-radius: 6px; }
.chart-frame figcaption { font-size: 0.8rem; color: var(--muted); }

.scraped-html { overflow-x: auto; }
.scraped-html img { max-width: 100%; }
.scraped-html .number { font-weight: 700; margin-right: 0.5em; }
.scraped-html p { margin: 0.4rem 0; }
.scraped-html .level1 { margin-left: 1.2rem; }
.scraped-html .level2 { margin-left: 2.4rem; }

.provenance { font-size: 0.8rem; color: var(--muted); margin-top: 1.2rem; }

.site-footer {
  max-width: 960px; margin: 0 auto; padding: 1rem 1.2rem 2rem;
  color: var(--muted); font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* ---- nav ---- */
.site-nav { margin-left: auto; display: flex; gap: 1rem; }
.site-nav a { text-decoration: none; font-weight: 600; font-size: 0.9rem; }

/* ---- map ---- */
.map-full { height: 72vh; min-height: 420px; border: 1px solid var(--border); border-radius: 10px; }
.map-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1rem; }
.map-head h1 { margin: 0.4rem 0; font-size: 1.3rem; }
.layer-toggles { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; padding: 0.6rem 0.2rem; font-size: 0.85rem; }
.layer-toggles label { display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; }
.swatch { display: inline-block; width: 0.9em; height: 0.9em; border-radius: 3px; }
.aup-note { width: 100%; color: var(--warn-text); background: var(--warn-bg); border-radius: 6px; padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.map-mini { height: 340px; border: 1px solid var(--border); border-radius: 8px; margin: 0.8rem 0; }
.leaflet-container { background: #d0dae3; }

/* ---- plan ---- */
.plan-form { display: grid; gap: 0.9rem; max-width: 460px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 1.1rem; }
.plan-form label { display: grid; gap: 0.3rem; font-size: 0.85rem; color: var(--muted); }
.plan-form input { font-size: 1.05rem; padding: 0.5rem 0.7rem; border: 2px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
.plan-form input:focus { border-color: var(--accent); outline: none; }
.primary-btn { font-size: 1rem; font-weight: 700; padding: 0.6rem 1rem; background: var(--accent); color: var(--accent-text); border: none; border-radius: 8px; cursor: pointer; }
.plan-err { color: #d32f2f; min-height: 1.2em; margin: 0; }

/* ---- briefing ---- */
.briefing-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.briefing-doc { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 1.6rem 2rem; max-width: 860px; margin: 0 auto; }
.briefing-head { border-bottom: 2px solid var(--text); margin-bottom: 1rem; padding-bottom: 0.6rem; }
.briefing-head h1 { margin: 0; font-size: 1.5rem; letter-spacing: 0.02em; }
.route-line { font-size: 1.15rem; margin: 0.4rem 0 0.2rem; }
.gen-line { color: var(--muted); font-size: 0.82rem; margin: 0; }
.briefing-doc section { margin: 1.3rem 0; }
.briefing-doc h2 { font-size: 1.05rem; border-bottom: 1px solid var(--border); padding-bottom: 0.25rem; }
.sec-note { font-size: 0.8rem; color: var(--muted); }
.cls-badge { color: #fff; font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.45rem; border-radius: 4px; }
.crossing-table td, .crossing-table th { white-space: normal; }
.met-block { margin: 0.7rem 0; }
.met-block h4 { margin: 0 0 0.3rem; }
.met-upd { font-weight: 400; font-size: 0.78rem; color: var(--muted); }
.met-raw { background: var(--chip-bg); border-radius: 6px; padding: 0.5rem 0.7rem; white-space: pre-wrap; word-break: break-word; font-size: 0.85rem; margin: 0.3rem 0; }
.ad-card h3 { margin: 0 0 0.5rem; }
.briefing-foot { border-top: 2px solid var(--text); margin-top: 1.2rem; padding-top: 0.5rem; font-size: 0.78rem; color: var(--muted); }

/* ---- print (A4 briefing) ---- */
@media print {
  .leaflet-control-zoom { display: none !important; } /* interactive controls have no place on paper */
  @page { size: A4; margin: 12mm; }
  .site-header, .disclaimer, .site-footer, .no-print, .briefing-bar { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  main { max-width: none; padding: 0; }
  .briefing-doc { border: none; padding: 0; max-width: none; }
  .briefing-doc section { break-inside: avoid; }
  .map-mini { height: 300px; }
  .met-raw { background: #f2f2f2; }
  a { color: #000; text-decoration: none; }
}

/* ---- 3D flight view ---- */
.fly3d { height: 520px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; position: relative; }
.fly3d .cesium-viewer { position: absolute; inset: 0; }
.fly-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin: 0.5rem 0; font-size: 0.9rem; }
.fly-controls label { display: inline-flex; align-items: center; gap: 0.4rem; }
.fly-controls select { padding: 0.25rem 0.4rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.cesium-credit-textContainer, .cesium-credit-logoContainer { font-size: 10px !important; }
@media (max-width: 480px) { .fly3d { height: 340px; } }

/* ---- iteration 4: legend, VFR hints, maplibre popups ---- */
.legend-row { display: inline-flex; align-items: center; gap: 0.4rem; margin-right: 0.6rem; }
.legend-name { font-size: 0.84rem; }
.legend-vfr { font-size: 0.72rem; font-weight: 700; padding: 0.05rem 0.4rem; border-radius: 99px; }
.vfr-yes { color: #4caf7d; }
.vfr-conditional { color: #e0a458; }
.vfr-no { color: #ef6f6f; font-weight: 700; }
.legend-vfr.vfr-yes { background: #1d3327; }
.legend-vfr.vfr-conditional { background: #37290f; }
.legend-vfr.vfr-no { background: #3a1a1a; color: #ef6f6f; }
.asp-popup { color: #16202b; font-size: 0.86rem; line-height: 1.45; } /* popups stay light in both themes */
.asp-popup .asp-limits { font-family: ui-monospace, Menlo, monospace; font-weight: 700; }
.asp-popup .cls-badge { margin-left: 0.4rem; }
.maplibregl-popup-content { color: #16202b; }
:root[data-theme="light"] .vfr-yes { color: #1b7d3a; }
:root[data-theme="light"] .vfr-conditional { color: #b26a00; }
:root[data-theme="light"] .vfr-no { color: #c62828; }
:root[data-theme="light"] .legend-vfr.vfr-yes { background: #e2f3e8; }
:root[data-theme="light"] .legend-vfr.vfr-conditional { background: #fdf0dc; }
:root[data-theme="light"] .legend-vfr.vfr-no { background: #fbe4e4; color: #c62828; }

/* ---- iteration 5: overlap stack popup ---- */
.asp-popup { max-height: 340px; overflow-y: auto; }
.stack-note { margin: 0 0 0.4rem; font-weight: 700; font-size: 0.8rem; color: #5b6b7c; }
.stack-sep { border: none; border-top: 1px solid #d8dee6; margin: 0.45rem 0; }
.stack-entry small { color: #5b6b7c; }

/* ---- iteration 6: conflict HUD, timeline, presets ---- */
.fly3d-wrap { position: relative; }
.fly-hud {
  position: absolute; bottom: 34px; left: 10px; z-index: 5;
  background: rgba(10, 14, 20, 0.78); color: #eef4fa;
  border: 1px solid rgba(255,255,255,0.18); border-radius: 8px;
  padding: 0.45rem 0.7rem; font-size: 0.78rem; line-height: 1.5;
  max-width: 320px; pointer-events: none; backdrop-filter: blur(3px);
}
.hud-top { font-family: ui-monospace, Menlo, monospace; opacity: 0.9; }
.hud-in { color: #ff8a80; font-weight: 700; }
.hud-clear { color: #9fd8a8; }
.hud-next { color: #ffd54f; }
.cam-presets { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; }
.cam-presets button {
  padding: 0.25rem 0.6rem; border-radius: 6px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); cursor: pointer; font-size: 0.8rem;
}
.cam-presets button:hover { border-color: var(--accent); }
.fly-timeline {
  position: relative; margin: 0.5rem 0 0.2rem; border: 1px solid var(--border);
  border-radius: 6px; background: var(--chip-bg); overflow: hidden;
}
.tl-block {
  position: absolute; height: 13px; border-radius: 3px; opacity: 0.75; cursor: pointer;
  min-width: 5px;
}
.tl-block:hover { opacity: 1; }
.tl-conflict { outline: 2px solid #ff5252; outline-offset: 1px; opacity: 0.95; }
.tl-cursor {
  position: absolute; top: 0; bottom: 0; width: 2px; background: #ffd54f; left: 0;
  box-shadow: 0 0 4px #ffd54f;
}
.tl-lab { position: absolute; bottom: 2px; font-size: 0.78rem; font-weight: 700; color: var(--text); }
.tl-tick { position: absolute; top: 0; bottom: 14px; width: 1px; background: var(--border); }
.tl-ticklab { position: absolute; bottom: 2px; font-size: 0.7rem; color: var(--muted); transform: translateX(-50%); }
.tl-timechip { position: absolute; top: -1.4rem; transform: translateX(-50%); background: #ffd54f; color: #16202b; font-weight: 800; font-size: 0.72rem; border-radius: 6px; padding: 0 0.35rem; white-space: nowrap; }
.tl-lab-l { left: 4px; } .tl-lab-r { right: 4px; }
.key-in { color: #ff5252; font-weight: 700; }
.key-clear { color: var(--muted); }

/* ---- iteration 7: cockpit banner + frame glow ---- */
.fly-banner {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 6;
  padding: 0.45rem 1.1rem; border-radius: 999px; font-weight: 800; font-size: 0.95rem;
  letter-spacing: 0.02em; pointer-events: none; white-space: nowrap;
  backdrop-filter: blur(4px); border: 1px solid transparent;
}
.banner-inside {
  background: rgba(120, 12, 12, 0.85); color: #ffd7d2; border-color: #ff5252;
  box-shadow: 0 0 18px rgba(255, 82, 82, 0.55); animation: bannerPulse 1.6s ease-in-out infinite;
}
.banner-clear { background: rgba(10, 60, 30, 0.8); color: #b7f0c6; border-color: #2f9e5f; }
@keyframes bannerPulse { 50% { box-shadow: 0 0 30px rgba(255, 82, 82, 0.85); } }
.fly3d-wrap.state-inside::after {
  content: ""; position: absolute; inset: 0; border-radius: 8px; z-index: 4;
  pointer-events: none;
  box-shadow: inset 0 0 0 3px rgba(255, 82, 82, 0.9), inset 0 0 46px rgba(255, 40, 40, 0.4);
}
@media (max-width: 640px) { .fly-banner { font-size: 0.78rem; max-width: 92%; overflow: hidden; text-overflow: ellipsis; } }

/* ---- iteration 8: crossing events ---- */
.fly-banner { display: flex; flex-direction: column; gap: 2px; align-items: center; white-space: normal; max-width: 92%; border-radius: 14px; }
.banner-row { line-height: 1.35; }
.fly-flash { position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: 0; border-radius: 8px;
  background: radial-gradient(ellipse at center, rgba(255,82,82,0.0) 40%, rgba(255,82,82,0.55) 100%); }
.fly-flash.flash-on { animation: crossFlash 0.7s ease-out; }
@keyframes crossFlash { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0; } }
.fly-toasts { position: absolute; left: 10px; bottom: 34px; z-index: 6; display: flex; flex-direction: column-reverse; gap: 4px; pointer-events: none; max-width: 78%; }
.fly-toast { font-size: 0.78rem; font-weight: 700; padding: 0.3rem 0.7rem; border-radius: 8px;
  backdrop-filter: blur(3px); animation: toastIn 0.35s ease-out; }
.toast-enter { background: rgba(120,12,12,0.85); color: #ffd7d2; border-left: 3px solid #ff5252; }
.toast-exit { background: rgba(10,60,30,0.82); color: #b7f0c6; border-left: 3px solid #2f9e5f; }
@keyframes toastIn { from { transform: translateX(-14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- iteration 9: hero card, pattern figure, chips ---- */
.hero-card { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: flex-start; border: 2px solid var(--accent); }
.hero-freqs { flex: 1 1 300px; }
.hero-side { display: flex; gap: 1rem; align-items: center; }
.hero-circuit { font-size: 1.15rem; }
.pattern-fig { margin: 0; text-align: center; }
.pattern-fig figcaption { font-size: 0.7rem; color: var(--muted); }
.badge-ulm { background: #33203f; color: #ce93d8; }
.badge-ifr { background: #1b2f45; color: #5aa5e8; font-weight: 700; }
:root[data-theme="light"] .badge-ulm { background: #efe3f7; color: #7b1fa2; }
:root[data-theme="light"] .badge-ifr { background: #dbe9f8; color: #0b5cab; }
.type-chips { display: flex; gap: 0.4rem; margin: 0.6rem 0 0.2rem; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--panel); color: var(--text); border-radius: 99px; padding: 0.2rem 0.8rem; cursor: pointer; font-size: 0.82rem; }
.chip-on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.exec-summary li { margin: 0.3rem 0; }
.fulltext-tab summary { cursor: pointer; font-weight: 700; color: var(--accent); padding: 0.4rem 0; }
.ad-card-cols { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
@media print { .fulltext-tab:not([open]) { display: block; } .pattern-fig svg { width: 110px; height: 110px; } }
.row-alert td { background: rgba(255,82,82,0.18); font-weight: 700; }

/* ---- iteration 11: notam cards, met plain, alerts ---- */
.notam-card { border-left: 3px solid var(--accent); padding: 0.4rem 0.8rem; margin: 0.6rem 0; background: var(--chip-bg); border-radius: 0 8px 8px 0; }
.notam-head { margin: 0; } .notam-validity { margin: 0.1rem 0; font-size: 0.8rem; color: var(--muted); }
.notam-details { margin: 0.2rem 0; font-size: 0.9rem; }
.met-plain { margin: 0.3rem 0; font-weight: 600; }
.vfr-alert { background: #3a1a1a; color: #ef6f6f; font-weight: 800; padding: 0.35rem 0.7rem; border-radius: 8px; border: 1px solid #c62828; }
:root[data-theme="light"] .vfr-alert { background: #fbe4e4; color: #c62828; }

/* ---- iteration 12: 2D position inset in the 3D view ---- */
.fly-minimap {
  position: absolute; right: 10px; bottom: 34px; width: 210px; height: 150px; z-index: 6;
  border: 2px solid rgba(255, 255, 255, 0.85); border-radius: 10px; overflow: hidden;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.5); background: #dde6ee;
}
.fly-minimap .leaflet-control-attribution { font-size: 9px; opacity: 0.85; }
.mini-plane-wrap { background: none; border: none; }
.mini-plane {
  width: 20px; height: 20px; font-size: 16px; line-height: 20px; text-align: center;
  color: #ffb300; text-shadow: 0 0 3px #000, 0 1px 2px #000; transform-origin: 50% 50%;
}
@media (max-width: 640px) { .fly-minimap { width: 140px; height: 105px; } }

/* ---- iteration 13: role chips on briefing aerodrome cards ---- */
.ad-role {
  display: inline-block; vertical-align: middle; margin-right: 0.15rem;
  padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.68rem; font-weight: 800;
  letter-spacing: 0.05em; text-transform: uppercase;
  background: var(--chip-bg); color: var(--muted); border: 1px solid var(--border);
}

/* ---- iteration 14: debrief logbook helper ---- */
.logbook-table .lb-n { width: 2rem; text-align: center; font-weight: 800; color: var(--muted); }
.logbook-table .lb-k { width: 40%; color: var(--muted); }
.logbook-table .lb-v strong { font-variant-numeric: tabular-nums; }
.lb-blank {
  display: inline-block; min-width: 5.5rem; text-align: center; padding: 0 0.4rem;
  border-bottom: 2px dashed var(--border); color: var(--muted);
  font-size: 0.75rem; font-style: italic;
}
.lb-note { font-size: 0.75rem; color: var(--muted); }

/* ---- iteration 15: crosswind alert on airfield pages ---- */
.xw-alert {
  margin: 0.4rem 0 0; padding: 0.35rem 0.7rem; border-radius: 8px; font-weight: 700; font-size: 0.85rem;
  background: rgba(255, 179, 0, 0.16); border: 1px solid #ffb300; color: #ffd54f;
}
.xw-strong { background: rgba(255, 82, 82, 0.14); border-color: #ff5252; color: #ff8a80; }
:root[data-theme="light"] .xw-alert { color: #b26a00; }
:root[data-theme="light"] .xw-strong { color: #c62828; }

/* ---- iteration 17: VOC chart thumbnail when hand unknown ---- */
.voc-thumb { display: inline-flex; flex-direction: column; gap: 0.2rem; max-width: 180px; text-decoration: none; }
.voc-thumb img { max-width: 180px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.voc-thumb span { font-size: 0.72rem; color: var(--muted); text-align: center; }

/* ---- iteration 19: per-waypoint inputs ---- */
.via-row { display: flex; gap: 0.4rem; margin-bottom: 0.35rem; align-items: center; }
.via-row .via-input { flex: 1; }
.via-del {
  border: 1px solid var(--border); background: var(--panel); color: var(--muted);
  border-radius: 6px; cursor: pointer; padding: 0.25rem 0.55rem; font-size: 0.85rem;
}
.via-del:hover { border-color: #c62828; color: #c62828; }
.via-add {
  border: 1px dashed var(--border); background: none; color: var(--accent);
  border-radius: 6px; cursor: pointer; padding: 0.3rem 0.7rem; font-size: 0.85rem; margin-top: 0.1rem;
}
.via-add:hover { border-style: solid; }

/* ---- iteration 22: FR24 flight picker ---- */
.fr24-flights { display: flex; flex-direction: column; gap: 0.4rem; }
.fr24-flight {
  text-align: left; padding: 0.5rem 0.8rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel); color: var(--text); cursor: pointer; font-size: 0.9rem;
}
.fr24-flight:hover { border-color: var(--accent); }

/* ---- iteration 22: wide briefing column ---- */
main.wide { max-width: 1400px; }
main.wide .briefing-doc { max-width: none; }
main.wide .map-mini { height: 500px; }
main.wide .fly3d { height: 680px; }
@media (max-width: 900px) { main.wide .map-mini { height: 380px; } main.wide .fly3d { height: 480px; } }

/* ---- iteration 22: 3D camera pad ---- */
.fly-campad {
  position: absolute; top: 10px; right: 10px; z-index: 6;
  display: grid; grid-template-columns: repeat(2, 34px); gap: 4px;
  background: rgba(10, 14, 20, 0.72); border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px; padding: 6px; backdrop-filter: blur(3px);
}
.fly-campad button {
  width: 34px; height: 30px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.08); color: #eef4fa; font-size: 0.95rem; cursor: pointer; line-height: 1;
}
.fly-campad button:hover { background: rgba(255,255,255,0.2); }
.fly-campad .cp-wide { grid-column: span 2; }
@media (max-width: 640px) { .fly-campad { top: 52px; } }

/* ---- iteration 23: altitude-profile timeline ---- */
.tl-block { overflow: hidden; }
.tl-name {
  display: block; font-size: 0.62rem; font-weight: 700; color: #fff;
  padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7); pointer-events: none;
}
.tl-altline {
  position: absolute; left: 0; right: 0; height: 0; z-index: 2; pointer-events: none;
  border-top: 2px dashed #ffd54f; opacity: 0.75;
}
.tl-plane {
  position: absolute; z-index: 3; font-size: 15px; line-height: 18px; color: #ffd21f;
  transform: translateX(-50%) rotate(45deg); text-shadow: 0 0 3px #000, 0 1px 2px #000;
  pointer-events: none;
}
.tl-alab {
  position: absolute; right: 4px; font-size: 0.62rem; color: var(--muted); pointer-events: none;
}

/* ---- iteration 24: pattern trainer ---- */
.pt-phase {
  margin: 0.5rem 0 0; padding: 0.5rem 0.9rem; border-radius: 10px; font-weight: 700; font-size: 0.95rem;
  background: rgba(20, 60, 20, 0.85); color: #d8ffcc; border: 1px solid #39ff14;
}

/* ================================================================
   iteration 30 — visual overhaul: glass header, aviation parallax
   hero, 3D scroll reveals, affordances, mobile. Transform/opacity
   motion only; zero images, zero new origins.
   ================================================================ */

/* -- glass sticky header + pill nav -- */
.site-header {
  position: sticky; top: 0; z-index: 1200;
  align-items: center;
  background: var(--header-bg);
  backdrop-filter: blur(14px) saturate(1.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-1);
}
.brand { display: inline-flex; align-items: center; gap: 0.45rem; }
.brand-mark { width: 22px; height: 22px; fill: var(--accent); transition: transform 0.35s ease; }
.brand:hover .brand-mark { transform: rotate(-8deg) translateY(-1px); }
.brand span { color: var(--accent); letter-spacing: 0.03em; }
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .brand span { background: var(--grad-accent); -webkit-background-clip: text; background-clip: text; color: transparent; }
}
.result-name { min-width: 0; } /* keep the chevron from tightening name truncation */
.site-nav { gap: 0.25rem; }
.site-nav a {
  padding: 0.35rem 0.85rem; border-radius: 999px; color: var(--text);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.site-nav a:hover { background: var(--chip-bg); }
.site-nav a.active { background: var(--grad-accent); color: var(--accent-text); box-shadow: var(--shadow-1); }

/* -- aviation parallax hero (home only) -- */
.hero {
  --sy: 0; /* unitless scroll offset, written by app.ts each frame */
  position: relative; overflow: hidden;
  height: clamp(300px, 36vh, 400px);
  border-radius: var(--radius-lg);
  margin: 0.9rem 0 1.1rem;
  box-shadow: var(--shadow-2);
  isolation: isolate;
  background: linear-gradient(to bottom, var(--sky-top) 0%, var(--sky-mid) 46%, var(--sky-low) 72%, var(--horizon) 100%);
}
.hero > * { position: absolute; }
.hero-stars {
  inset: 0; opacity: var(--stars); z-index: 1; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 31% 8%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 48% 26%, #dfe9ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 63% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 22%, #cdd9f0 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 7%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 22% 34%, #e8f0ff 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 40%, #fff 50%, transparent 51%);
}
.hero-clouds-far, .hero-clouds-near { left: -20%; width: 140%; pointer-events: none; fill: var(--cloud); }
.hero-clouds-far {
  top: 16%; height: 34%; opacity: 0.55; z-index: 2;
  transform: translate3d(0, calc(var(--sy) * 0.06px), 0) scale(0.8);
}
.hero-clouds-near {
  top: 34%; height: 46%; z-index: 4;
  transform: translate3d(0, calc(var(--sy) * 0.18px), 0);
}
.hero-craft {
  top: 20%; left: 0; width: 54px; height: 54px; z-index: 3;
  fill: rgba(255, 255, 255, 0.95);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
  animation: heroCraft 46s linear infinite;
}
.hero-craft svg, .hero-craft { transform-origin: center; }
@keyframes heroCraft {
  0%   { transform: translate3d(-70px, 26px, 0) rotate(56deg) scale(0.55); }
  50%  { transform: translate3d(48vw, -6px, 0) rotate(60deg) scale(0.8); }
  100% { transform: translate3d(102vw, -30px, 0) rotate(56deg) scale(0.6); }
}
.hero-runway {
  left: 0; right: 0; bottom: 0; height: 30%; z-index: 5; pointer-events: none;
  transform: translate3d(0, calc(var(--sy) * 0.28px), 0);
  background:
    linear-gradient(to bottom, transparent 0, transparent 42%, var(--runway-line) 42%, var(--runway-line) 46%, transparent 46%, transparent 58%, var(--runway-line) 58%, var(--runway-line) 61%, transparent 61%, transparent 76%, var(--runway-line) 76%, var(--runway-line) 78%, transparent 78%);
  background-size: 8px 100%;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%);
  mask-image: linear-gradient(to bottom, transparent, #000 30%);
  opacity: 0.5;
}
/* contrast scrim: white hero copy needs ≥4.5:1 over the day sky, not a text-shadow excuse */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background: radial-gradient(ellipse 72% 62% at 50% 44%, rgba(8, 20, 36, 0.52), transparent 72%);
}
.hero-copy {
  inset: 0; z-index: 6; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 1rem 1.2rem; gap: 0.35rem;
}
.hero-title {
  margin: 0; color: var(--hero-text); font-weight: 800;
  font-size: clamp(1.9rem, 4.5vw, 3rem); letter-spacing: 0.04em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}
.hero-sub {
  margin: 0 0 0.7rem; color: var(--hero-text); opacity: 0.92;
  font-size: clamp(0.9rem, 1.8vw, 1.05rem); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}
.hero-search { position: relative; width: min(560px, 100%); }
.hero-search .search-box {
  border: none; box-shadow: var(--shadow-2); backdrop-filter: blur(6px);
}

/* -- home action cards: the "where do I click" answer -- */
.home-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 0.8rem; margin: 0 0 1.2rem;
}
.action-card {
  position: relative; display: grid; grid-template-rows: auto auto 1fr; gap: 0.3rem;
  padding: 0.95rem 1.05rem 0.85rem;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  text-decoration: none; color: var(--text); box-shadow: var(--shadow-1);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.action-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--accent); }
.action-card svg { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.action-card h3 { margin: 0.15rem 0 0; font-size: 1.02rem; }
.action-card p { margin: 0; color: var(--muted); font-size: 0.83rem; line-height: 1.4; }
.action-card .go {
  position: absolute; top: 0.85rem; right: 0.95rem; color: var(--accent);
  font-weight: 800; font-size: 1.05rem; transition: transform 0.25s ease;
}
.action-card:hover .go { transform: translateX(4px); }
button.action-card { font: inherit; text-align: left; cursor: pointer; width: 100%; }

/* -- 3D scroll reveal (IntersectionObserver toggles .rv-in) -- */
.rv {
  opacity: 0;
  transform: perspective(900px) rotateX(7deg) translateY(26px);
  transition: opacity 0.55s ease, transform 0.65s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.rv.rv-in { opacity: 1; transform: none; }
.rv:focus-within { opacity: 1; transform: none; } /* keyboard focus must never land on an invisible block */
.home-cards .rv:nth-child(2) { transition-delay: 0.07s; }
.home-cards .rv:nth-child(3) { transition-delay: 0.14s; }
.home-cards .rv:nth-child(4) { transition-delay: 0.21s; }

/* -- affordance upgrades on shared primitives -- */
.card { border-radius: var(--radius-lg); box-shadow: var(--shadow-1); }
.primary-btn {
  min-height: 44px;
  background: var(--grad-accent);
  box-shadow: var(--shadow-1);
  transition: transform 0.15s ease, box-shadow 0.15s ease; /* brightness snaps — filter animation is paint-expensive */
}
.primary-btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: var(--shadow-2); }
.primary-btn:active { transform: translateY(0); filter: brightness(0.97); }
.result-row {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.result-row::after { content: "›"; color: var(--muted); font-weight: 800; font-size: 1.05rem; transition: transform 0.18s ease, color 0.18s ease; }
.result-row:hover, .result-row:focus-visible { transform: translateY(-1px); box-shadow: var(--shadow-1); }
.result-row:hover::after, .result-row:focus-visible::after { transform: translateX(3px); color: var(--accent); }
.search-box { border-radius: 12px; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.search-box:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
a:focus-visible, button:focus-visible, .chip:focus-visible, .result-row:focus-visible, .action-card:focus-visible, .site-nav a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; /* outline follows each element's own radius */
}
.chip { transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease; min-height: 34px; }
.chip:hover { border-color: var(--accent); }

/* -- mobile -- */
@media (max-width: 640px) {
  .site-header { padding: 0.55rem 0.8rem; gap: 0.3rem 0.6rem; }
  .tagline { display: none; }
  /* detail hero-card: pattern + VOC thumb wrap under the facts instead of
     squeezing them into one-word columns / overflowing the viewport */
  .hero-side { flex-wrap: wrap; width: 100%; justify-content: center; }
  .voc-thumb, .voc-thumb img { max-width: 140px; }
  .fact-grid { grid-template-columns: 1fr 1fr; }
  .ad-card-cols { flex-direction: column; }
  .site-nav {
    margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; padding: 0.45rem 0.9rem; }
  .site-header { backdrop-filter: blur(8px) saturate(1.2); -webkit-backdrop-filter: blur(8px) saturate(1.2); } /* cheaper composite on phones */
  main { padding: 0.8rem 0.8rem 2.4rem; }
  .hero { height: clamp(250px, 34vh, 320px); margin: 0.6rem 0 0.9rem; }
  .home-cards { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .action-card { padding: 0.75rem 0.8rem 0.7rem; }
  .action-card p { font-size: 0.78rem; }
  .chip { min-height: 40px; padding: 0.4rem 0.95rem; }
  .search-box { font-size: 1.05rem; }
  table.data { font-size: 0.82rem; }
}

/* -- reduced motion: parallax and reveals off, content fully visible -- */
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; will-change: auto; }
  .hero-craft { animation: none; transform: translate3d(20vw, 8px, 0) rotate(58deg) scale(0.7); }
  .hero-clouds-far, .hero-clouds-near, .hero-runway { transform: none; }
  .action-card, .result-row, .primary-btn, .brand-mark { transition: none; }
}

/* -- print: strip hero/motion chrome, force reveals visible (A4 briefing) -- */
@media print {
  .hero, .home-cards { display: none !important; }
  .rv { opacity: 1 !important; transform: none !important; }
  .site-header { position: static; backdrop-filter: none; }
}

/* ================================================================
   iteration 31 — boot splash + regional QNH, dark default + theme
   toggle, mobile 3D declutter, contacts cleanup
   ================================================================ */

/* -- boot splash: dark glass, real progress, big QNH -- */
#splash {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 28%, #0d1c33 0%, #060b18 72%);
  color: #eef4fa;
  transition: opacity 0.65s ease;
}
#splash.splash-out { opacity: 0; pointer-events: none; }
body.splash-lock { overflow: hidden; }
.splash-inner {
  display: flex; flex-direction: column; align-items: center; gap: 0.55rem;
  text-align: center; padding: 1.5rem; width: min(640px, 94%);
}
.splash-mark { width: 46px; height: 46px; fill: #5aa5e8; animation: splashBob 2.6s ease-in-out infinite; }
@keyframes splashBob { 50% { transform: translateY(-6px) rotate(4deg); } }
.splash-title { margin: 0; font-size: 2rem; font-weight: 800; letter-spacing: 0.06em; }
.splash-sub { margin: 0 0 0.5rem; color: #93a4b5; }
.qnh-grid { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; width: 100%; }
.qnh-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.1rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.qnh-main { padding: 1rem 2.4rem 1.1rem; }
.qnh-label { font-size: 0.72rem; letter-spacing: 0.09em; text-transform: uppercase; color: #93a4b5; }
.qnh-main .qnh-value {
  font-size: clamp(3.4rem, 13vw, 5.2rem); font-weight: 800; line-height: 1.05;
  font-variant-numeric: tabular-nums; color: #ffd54f;
  text-shadow: 0 0 34px rgba(255, 213, 79, 0.35);
}
.qnh-unit { font-size: 0.85rem; color: #93a4b5; letter-spacing: 0.14em; }
.qnh-side { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.qnh-mini { padding: 0.45rem 0.9rem; }
.qnh-mini .qnh-value { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.qnh-mini.qnh-low .qnh-value { color: #ffd54f; }
.splash-bar {
  width: min(420px, 86%); height: 6px; margin-top: 0.5rem;
  border-radius: 99px; background: rgba(255, 255, 255, 0.12); overflow: hidden;
}
.splash-fill {
  height: 100%; width: 2%;
  background: linear-gradient(90deg, #5aa5e8, #ffd54f);
  transition: width 0.45s ease;
}
.splash-step { margin: 0; font-size: 0.78rem; color: #93a4b5; min-height: 1.2em; }
.splash-skip {
  margin-top: 0.4rem; padding: 0.35rem 1rem; cursor: pointer;
  background: none; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 99px;
  color: #eef4fa; font-size: 0.85rem;
}
.splash-skip:hover { border-color: #5aa5e8; color: #5aa5e8; }

/* -- theme toggle -- */
.theme-toggle {
  width: 34px; height: 34px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid var(--border); border-radius: 99px;
  cursor: pointer; transition: border-color 0.2s ease;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; fill: var(--text); stroke: var(--text); }
.tt-sun { display: block; } /* shown in dark — click to go light */
.tt-moon { display: none; }
:root[data-theme="light"] .tt-sun { display: none; }
:root[data-theme="light"] .tt-moon { display: block; }
@media (max-width: 640px) { .theme-toggle { position: absolute; top: 0.5rem; right: 0.8rem; } .site-header { position: sticky; } }

/* -- mobile 3D: ONLY the next-conflict banner; no toggles, no pads -- */
@media (max-width: 640px) {
  .fly-hud, .fly-campad, .fly-minimap, .fly-toasts, .fly-flash { display: none !important; }
  #fly-controls label, #fly-controls .cam-presets { display: none; }
  .fly-banner { top: 8px; font-size: 0.8rem; }
}

/* -- iteration 32: lang toggle, official QNH validity, mobile h-scroll -- */
.lang-toggle { font: 700 0.72rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); letter-spacing: 0.04em; }
.qnh-valid { font-size: 0.74rem; color: #93a4b5; font-variant-numeric: tabular-nums; margin-top: 0.15rem; }
.qnh-valid.qnh-stale { color: #ff8a80; font-weight: 700; }
.qnh-note { margin: 0; font-size: 0.72rem; color: #93a4b5; max-width: 420px; }
@media (max-width: 640px) {
  /* anything wider than the card scrolls inside it — the page never overflows */
  .card, .briefing-doc > section { overflow-x: auto; }
}

/* -- iteration 33: collapsible cards, fee badge, detail trainer, print reflow -- */
details.card > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 0.5rem;
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before {
  content: "▸"; color: var(--accent); font-size: 0.85rem; transition: transform 0.2s ease;
}
details.card[open] > summary::before { transform: rotate(90deg); }
details.card > summary h2 { margin: 0; }
details.card[open] > summary { margin-bottom: 0.6rem; }
.badge-fee { background: #1d3327; color: #4caf7d; font-weight: 800; }
:root[data-theme="light"] .badge-fee { background: #e2f3e8; color: #1b7d3a; }
.trainer-card .fly3d { height: 440px; margin-top: 0.6rem; }
@media (max-width: 640px) { .trainer-card .fly3d { height: 320px; } }
#pt-launch { margin: 0.3rem 0 0.4rem; }
@media print {
  /* nothing may be cut on A4: wrap cells, free the scroll containers, shrink wide tables */
  table.data th, table.data td { white-space: normal !important; word-break: break-word; }
  .table-scroll, .card, .briefing-doc > section, .scraped-html { overflow: visible !important; }
  table.data { font-size: 8.5pt; table-layout: auto; width: 100%; }
  main.wide { max-width: none; }
  img, svg { max-width: 100% !important; }
  details.card > summary::before { display: none; }
  .trainer-card, #pt-standalone { display: none !important; } /* a 3D canvas has no place on paper */
}

/* -- contacts + important info: data, not AIM icon glyphs -- */
.contacts-card .scraped-html img, .info-card .scraped-html img { display: none; }
.contacts-card .scraped-html p { margin: 0.3rem 0; }
.contacts-card .scraped-html .number { color: var(--muted); font-weight: 700; }

/* -- print stays light regardless of theme; splash never prints.
   CRITICAL (Cato): tokens are not enough — the dark-base LITERAL component
   colors must also reset, or crosswind/VFR safety alerts print pale-on-white. -- */
@media print {
  :root, :root[data-theme="light"] {
    --bg: #ffffff; --panel: #ffffff; --text: #000000; --muted: #444444;
    --border: #bbbbbb; --chip-bg: #f2f2f2;
    --warn-bg: #fff4e0; --warn-border: #e0b25c; --warn-text: #6b4b0e;
    --accent: #0b5cab; --accent-2: #1673c2;
    --shadow-1: none; --shadow-2: none;
  }
  #splash, .theme-toggle { display: none !important; }
  .xw-alert { color: #b26a00 !important; }
  .xw-strong { color: #c62828 !important; }
  .vfr-alert { background: #fbe4e4 !important; color: #c62828 !important; }
  .vfr-yes { color: #1b7d3a !important; }
  .vfr-conditional { color: #b26a00 !important; }
  .vfr-no { color: #c62828 !important; }
  .legend-vfr.vfr-yes { background: #e2f3e8 !important; }
  .legend-vfr.vfr-conditional { background: #fdf0dc !important; }
  .legend-vfr.vfr-no { background: #fbe4e4 !important; color: #c62828 !important; }
  .badge-ulm { background: #efe3f7 !important; color: #7b1fa2 !important; }
  .badge-ifr { background: #dbe9f8 !important; color: #0b5cab !important; }
}

/* -- reduced motion additions for iteration 31 -- */
@media (prefers-reduced-motion: reduce) {
  .splash-mark { animation: none; }
  .splash-fill { transition: none; }
}

/* plan view: waypoint-types hint under the via list */
.via-hint { display: block; font-size: 0.78rem; color: var(--fg-dim, #8aa0b6); margin-top: 4px; }

/* custom waypoint autocomplete (replaces datalist — mobile + diacritics) */
.ac-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 60; margin-top: 2px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; max-height: 264px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.ac-item { padding: 10px 12px; font-size: 16px; min-height: 40px; box-sizing: border-box; cursor: pointer; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-item:hover, .ac-active { background: var(--chip-bg); color: var(--accent); }
.plan-form label { position: relative; }
@media print { .ac-list { display: none !important; } }
.ac-list { touch-action: pan-y; }
.pt-active { outline: 2px solid var(--accent); }
