
/* Compact layout: sticky route bar with time/altitude; takeoff card, route profile, landing card, plan view. One column, phone first. */
:root {
  --bg: #ffffff; --panel: #ffffff; --panel-2: #f3f6f8; --ink: #14202b; --muted: #5a6a79; --line: #dde4ea;
  --accent: #c0177a; --sky: #f4f8fb; --terrain: #b89b74; --terrain-2: #d9c7ab; --glass: rgb(255 255 255 / .9);
  --go: #1d7a46; --caution: #b26a00; --nogo: #c62828; --vfr: #1d8a3c; --mvfr: #1d5fd1; --ifr: #d32222; --lifr: #b5179e; --fz: #2f6fd6;
  --font-display: "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0d151c; --panel: #0d151c; --panel-2: #16222d; --ink: #e4ebf1; --muted: #8fa1b2; --line: #22313f;
  --accent: #ff4fae; --sky: #101b24; --terrain: #6b5338; --terrain-2: #4a3a28; --glass: rgb(13 21 28 / .9);
  --go: #46c37b; --caution: #f0a43a; --nogo: #ff6b6b; --vfr: #4cc46d; --mvfr: #5b9bff; --ifr: #ff5a5a; --lifr: #ff5ee0; --fz: #6ea8ff; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0d151c; --panel: #0d151c; --panel-2: #16222d; --ink: #e4ebf1; --muted: #8fa1b2; --line: #22313f;
  --accent: #ff4fae; --sky: #101b24; --terrain: #6b5338; --terrain-2: #4a3a28; --glass: rgb(13 21 28 / .9);
  --go: #46c37b; --caution: #f0a43a; --nogo: #ff6b6b; --vfr: #4cc46d; --mvfr: #5b9bff; --ifr: #ff5a5a; --lifr: #ff5ee0; --fz: #6ea8ff; color-scheme: dark }
* { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font-body) }
.wrap { max-width: 850px; margin: 0 auto; padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px)); padding-bottom: 32px }
.label { font: 600 10.5px/1 var(--font-display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted) }
.muted { color: var(--muted) }
.small { font-size: 12px }
.arrow { color: var(--accent) }
.back { font: 600 13px/1 var(--font-body); color: var(--accent); text-decoration: none }
/* sticky route bar */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg) }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); margin-inline: calc(-1 * max(14px, env(safe-area-inset-left, 0px))); padding: 8px max(14px, env(safe-area-inset-left, 0px)) 8px; display: grid; gap: 6px }
.r1 { display: flex; align-items: center; justify-content: space-between; gap: 10px }
.route { font: 700 24px/1 var(--font-display); letter-spacing: .01em; white-space: nowrap }
.call { display: inline-flex; font: 700 12px/1 var(--font-display); letter-spacing: .06em; text-transform: uppercase; padding: 6px 8px; border-radius: 5px; color: var(--panel); white-space: nowrap }
.call.go { background: var(--go) } .call.caution { background: var(--caution) } .call.nogo { background: var(--nogo) } .call.pending { background: var(--muted) }
.ctl { display: flex; align-items: center; gap: 8px; min-width: 0 }
.ctl input[type=range] { flex: 1; min-width: 60px; accent-color: var(--accent) }
.ctl .val { font-weight: 600; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums }
.ctl .label { width: 26px; flex: none }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; flex: none }
.seg button { font: 500 12.5px/1 var(--font-body); color: var(--ink); background: none; border: 0; padding: 7px 9px; cursor: pointer; border-right: 1px solid var(--line) }
.seg button:last-child { border-right: 0 }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--panel) }
.meta { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
/* sections */
section { padding-block: 12px; border-bottom: 1px solid var(--line) }
.sec-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px }
.sec-h h2 { font: 700 18px/1.1 var(--font-display); margin: 0 }
/* airport cards */
.apt { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: center }
.apt svg { width: 150px; height: 150px; overflow: visible; display: block }
.info { display: grid; gap: 5px; min-width: 0 }
.cats { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12px; color: var(--muted) }
.cat { font: 700 11px/1 var(--font-display); letter-spacing: .06em; padding: 4px 6px; border-radius: 4px; color: #fff }
.cat.VFR { background: var(--vfr) } .cat.MVFR { background: var(--mvfr) } .cat.IFR { background: var(--ifr) } .cat.LIFR { background: var(--lifr) } .cat.NA { background: var(--muted) }
.kvg { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 12px; align-items: center; margin: 0 }
.kvg dt { font: 700 11px/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .07em; color: var(--ink) }
.kvg dd { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 14px; font-variant-numeric: tabular-nums; min-width: 0 }
.kvg .cat { align-self: center }
.srcx { font-size: 11.5px; color: var(--muted) }
.bigwind { font: 700 22px/1 var(--font-display) }
.rwy { font: 700 18px/1 var(--font-display); color: var(--accent) }
.comp { font-size: 13px }
.best { font-size: 13px } .best b { color: var(--accent) }
.elev { font-size: 12.5px; font-variant-numeric: tabular-nums }
.elev b { font-weight: 600 }
.note { font-size: 12.5px; margin: 8px 0 0; color: var(--muted) }
@media (max-width: 360px) { .apt { grid-template-columns: 120px minmax(0, 1fr) } .apt svg { width: 120px; height: 120px } }
/* profile */
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-bottom: 8px }
.tabs::-webkit-scrollbar { display: none }
.tabs button { flex: none; font: 500 12.5px/1 var(--font-body); color: var(--ink); background: var(--panel-2); border: 0; border-radius: 999px; padding: 8px 11px; cursor: pointer; white-space: nowrap }
.tabs button[aria-pressed="true"] { background: var(--ink); color: var(--panel) }
.view { position: relative; height: clamp(300px, 52vh, 520px); border-radius: 8px; overflow: hidden; background: var(--sky); border: 1px solid var(--line) }
#flat { display: block; width: 100%; height: 100%; touch-action: pan-y }
.zbtns { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 4px; z-index: 3 }
.zbtns button { min-width: 34px; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--glass); color: var(--ink); font: 600 16px/1 var(--font-body); cursor: pointer }
.zbtns button#z-reset { font-size: 12.5px }
.tip { position: absolute; pointer-events: none; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font: 12px/1.45 var(--font-body); box-shadow: 0 4px 18px rgb(0 0 0 / .2); max-width: 300px; z-index: 4 }
.tip .src { color: var(--muted); font-size: 11px; display: block; margin-bottom: 4px }
.tip .mono { font: 11.5px/1.45 var(--font-mono) }
/* point readout */
.tip { max-width: 270px; font: 12.5px/1.4 var(--font-body) }
.tip .hd { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; white-space: nowrap }
.tip .hd span { color: var(--muted) }
.tip .tg { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 10px; margin: 0; align-items: baseline }
.tip .tg dt { font: 600 10px/1.3 var(--font-display); text-transform: uppercase; letter-spacing: .07em; color: var(--muted) }
.tip .tg dd { margin: 0 }
.tip .tg dt.on { color: var(--ink) } .tip .tg dd.on { font-weight: 600 }
.tip .sub { color: var(--muted); font-size: 11.5px; font-weight: 400 }
.tip .ft { margin-top: 6px; padding-top: 5px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--muted) }
/* touch: the readout can be tapped to close; tapping the same spot, outside the graphic, or scrolling also closes it */
@media (pointer: coarse) { .tip { pointer-events: auto; padding-right: 30px } .tip::after { content: "×"; position: absolute; top: 5px; right: 9px; font: 600 18px/1 var(--font-body); color: var(--muted) } }
.tag { font: 600 10.5px/1 var(--font-display); letter-spacing: .06em; text-transform: uppercase; padding: 3px 5px; border-radius: 3px; white-space: nowrap }
.t-smooth { background: color-mix(in srgb, var(--go) 18%, transparent); color: var(--go) }
.t-lgt { background: #f2d24a; color: #3a2e00 } .t-mod { background: #f08a24; color: #2a1300 } .t-sev { background: #d63232; color: #fff } .t-none { background: var(--panel-2); color: var(--muted) }
.i-trace { background: #b9e3f3; color: #08303f } .i-light { background: #78b9ee; color: #06223d } .i-moderate { background: #2f6fd6; color: #fff } .i-severe { background: #3b2a9e; color: #fff }
.legendbox { display: grid; gap: 4px; margin-top: 8px; font-size: 11.5px }
.legendbox .bar { display: flex; height: 8px; border-radius: 3px; overflow: hidden }
.legendbox .bar span { flex: 1 }
.barlab { display: flex; justify-content: space-between; color: var(--muted); gap: 6px }
.keys { display: flex; flex-wrap: wrap; gap: 2px 10px; color: var(--muted) }
.keys i { display: inline-block; width: 12px; height: 3px; vertical-align: 3px; margin-right: 4px; border-radius: 2px }
.toggles { display: flex; gap: 2px 10px; flex-wrap: wrap; align-items: center; margin-top: 6px }
.chk { display: inline-flex; align-items: center; gap: 6px; font: 500 12.5px/1 var(--font-body); color: var(--ink); padding: 6px 2px; cursor: pointer; white-space: nowrap }
.chk input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent) }
.chk .sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block }
details.src summary { cursor: pointer; font-size: 12px; color: var(--muted); margin-top: 6px }
.prov { font-size: 12px; color: var(--muted); display: grid; gap: 3px; margin-top: 4px }
.prov b { color: var(--ink); font-weight: 600 }
/* map */
.mapbox { position: relative }
.mapbox canvas { display: block; width: 100%; border-radius: 8px }
.mapchips { display: flex; gap: 2px 10px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 6px }
.mapchips::-webkit-scrollbar { display: none }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--muted); margin-top: 6px }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin-right: 4px }
/* airport frequencies */
.freqs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px 12px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line) }
.fq { display: grid; gap: 1px; min-width: 0; align-content: start }
.fq .fl { font: 700 10.5px/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.fq b { font: 600 16px/1.2 var(--font-body); font-variant-numeric: tabular-nums }
.fq .fn { font-size: 11px; color: var(--muted) }
.fsrc { font-size: 11px; color: var(--muted); margin-top: 6px }
.foot { padding-top: 12px; font-size: 12px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap }
.foot a { color: var(--accent) }
