/* New GUI theme — look "B3" (agreed 2 Nov 2026), loaded after styles.css.
 * A solid flight-deck tool: dark by default (light mode is a setting: html[data-theme=light]),
 * square 4 px corners, 1 px ruled rows like the school forms, no glass, gradients or shadows.
 * Colour only with glass-cockpit meanings (FAA AC 25-11B): magenta route · FlyBy lime current / primary (navy frame) · blue dashed alternate ·
 * green done · amber caution · red no-go. Everything else white and greys.
 * Type: B612 + B612 Mono (Airbus / Intactile / ENAC cockpit typeface), bundled in vendor/fonts (OFL).
 * Reference: docs/design/look-b3-route.html, rules: navlog-gui-rules skill. */

@font-face { font-family: "B612"; font-weight: 400; font-style: normal; font-display: swap; src: url("vendor/fonts/b612-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "B612"; font-weight: 700 900; font-style: normal; font-display: swap; src: url("vendor/fonts/b612-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "B612 Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("vendor/fonts/b612-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "B612 Mono"; font-weight: 700 900; font-style: normal; font-display: swap; src: url("vendor/fonts/b612-mono-latin-700-normal.woff2") format("woff2"); }

/* Dark (default) */
:root {
  color-scheme: dark;
  --font: "B612", -apple-system, system-ui, sans-serif;
  --mono: "B612 Mono", ui-monospace, Menlo, monospace;
  --bg: #0C0F13;        /* frame, page: darkest */
  --panel: #151A20;     /* the working surface */
  --ctl: #1C222A;       /* buttons, fields: clearly raised */
  --raised: #1A2028;    /* sheets one tap deeper (point details, More) */
  --label: #EEF1F5;
  --label2: #AEB6C1;    /* 9.0:1 on #14181D */
  --label3: #8C95A3;    /* 5.9:1: icons, disabled */
  --rule: #3E4652;      /* section rules, control borders */
  --rule2: #29303A;     /* rows inside a list */
  --sep: var(--rule2);
  --line: #525B68;      /* field and button borders (3:1+) */
  --fill: var(--ctl);
  --fill2: #252C36;
  --glass: var(--panel); --glass-heavy: var(--panel); --glass-edge: var(--rule);
  --cur: #222C10;       /* background of the current step: lime shade */
  --tint: #CCF003;      /* FlyBy lime: current step, primary button (navy text on it) */
  --on-tint: #00205D;
  --navy: #00205D;      /* FlyBy navy: the frame */
  --tint-soft: #1F2A14;
  --tint-ink: #CCF003;
  --route: #E255C2;     /* magenta: route and waypoints */
  --alt: #0A84FF;       /* the alternate: dashed blue, as on the chart */
  --ok: #3DB565;   --ok-soft: transparent;  --ok-ink: #3DB565;
  --warn: #FFB020; --warn-soft: transparent; --warn-ink: #FFB020; --warn-line: #FFB020;
  --bad: #FF5A4F;  --bad-soft: transparent;  --bad-ink: #FF5A4F;  --bad-line: #FF5A4F;
  --shadow: none; --shadow-sm: none;
  --r: 4px;
  --c-mission: var(--tint); --c-plan: var(--tint); --c-mb: var(--tint); --c-brief: var(--tint);
  --c-tab-navlog: var(--tint); --c-tab-fuel: var(--tint); --c-tab-profile: var(--tint);
  --accent: var(--tint);
  --sheet-solid: var(--panel);
}
/* Light (setting): same structure, darker versions of the same hues */
:root[data-theme=light] {
  color-scheme: light;
  --bg: #EEF0F3; --panel: #FFFFFF; --ctl: #F4F5F7;
  --label: #15181D; --label2: #4A5260; --label3: #6B7380;
  --rule: #8A93A0; --rule2: #D5D9E0; --line: #8A93A0; --fill2: #E7EAEE;
  --cur: #E6EAF2; --raised: #F7F8FA;
  --tint: #00205D; --on-tint: #FFFFFF; --tint-soft: #E6EAF2; --tint-ink: #00205D;
  --route: #B0127A; --alt: #0A5FC8;
  --ok: #1B7F3B; --ok-ink: #1B6B35;
  --warn: #9A5600; --warn-ink: #7A4400; --warn-line: #9A5600;
  --bad: #C0271C; --bad-ink: #A0201A; --bad-line: #C0271C;
}

html { background: var(--bg); color: var(--label); }
body { font: 400 var(--fs-2, 1rem)/1.45 var(--font); -webkit-font-smoothing: auto; background: var(--bg); color: var(--label); }
body { font-size: var(--fs-2); }
.mono, code, pre, .metar, .taf, .notam { font-family: var(--mono); }
.stat .v, .value, table, .num, td, th { font-variant-numeric: tabular-nums; }
h1, h2, h3, b, strong { font-weight: 700; }
a { color: var(--tint); }

/* ---- Frame: solid, edge to edge, ruled (no floating cards, no glass) ---- */
.glass, .glass-heavy, .sn-card, .popover, .leaflet-popup-content-wrapper, .leaflet-control-attribution {
  background: var(--bg) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  border: 1px solid var(--rule); border-radius: var(--r); box-shadow: none !important; color: var(--label);
}
.leaflet-popup-tip { background: var(--bg); }
.leaflet-container { background: #1C2129; font-family: var(--font); }
:root[data-theme=light] .leaflet-container { background: #E7EAEE; }
.startup-notice { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(8, 10, 13, 0.7); }
.sn-card { background: var(--panel) !important; border-radius: var(--r); }
.sn-btn { border-radius: var(--r); background: var(--tint); color: var(--on-tint); font-weight: 700; min-height: 52px; }
.sheet { background: var(--panel) !important; border-radius: 0; border: 0; border-top: 1px solid var(--rule); }
.sheet::before { display: none; }
@media (min-width: 900px) {
  :root { --panel-x: calc(var(--side-w) + 12px); }
  .sheet { left: 0; top: 0; bottom: 0; border: 0; border-right: 1px solid var(--rule); border-radius: 0;
    padding-top: var(--safe-t); }
  .panel-closed .sheet { transform: translateX(-100%); }
  .panel-toggle { left: calc(var(--panel-x) - 12px); border-radius: 0 var(--r) var(--r) 0; border-left: 0; width: 28px; }
  .profile-dock { border-radius: var(--r); border: 1px solid var(--rule); background: var(--bg) !important; }
  .profile-title { font-size: 14px; font-weight: 700; }
  .profile-info { font-size: 13px; }
}
.timecard { border-radius: var(--r); }
.time-main { font-weight: 700; font-variant-numeric: tabular-nums; }
.time-sub, .sun { color: var(--label2); font-size: 13px; }
.rightcol .brand { border-radius: var(--r); }
.brand-mark { background: none; border: 2px solid var(--route); border-radius: 50%; width: 14px; height: 14px; }
.round, .pill, .chip, .round.labelled { border-radius: var(--r); }
.round.labelled { width: 72px; height: 56px; background: var(--bg) !important; }
.round .cap, .round.labelled .cap { font-size: 13px; font-weight: 700; color: var(--label); }
.chip { height: 44px; font-size: 14px; }

/* Groups are ruled sections, not cards */
.group, .nl-wrap, .profile-panel { background: transparent; border: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); border-radius: 0; box-shadow: none; margin-left: -20px; margin-right: -20px; padding-left: 20px; padding-right: 20px; }
.group > * + *, .group .row + .row { border-top: 1px solid var(--rule2); }
.sheet .group, .sheet .group.pad { border-left: 0; border-right: 0; padding-left: 20px; padding-right: 20px; }
.group-title, .sheet .group-title { color: var(--label); font-size: 15px; font-weight: 700; letter-spacing: 0; text-transform: none; margin: 24px 0 8px; }
.sheet .group-title > span:first-child::before, .sheet .group-title::before { display: none; }
.label, .note, .k, .sub, .hint { color: var(--label2); }
.note { font-size: 14px; }
.howto, .step-card, .tip-card { background: var(--ctl); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: none; }
.type-card { background: var(--ctl); border: 1px solid var(--line); border-radius: var(--r); min-height: 44px; }
.type-card b, .type-card .t { font-weight: 700; }
.type-card.on { border: 2px solid var(--tint); background: var(--cur); box-shadow: inset 0 -3px 0 var(--tint); }
.leg-card.active, .wp.open { box-shadow: inset 3px 0 0 var(--route); background: var(--ctl); }

/* ---- Controls: ≥ 44 pt, 4 px corners, real borders ---- */
.btn { min-height: 44px; height: auto; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--ctl); color: var(--label); font: 700 15px/1.2 var(--font); transition: background 120ms; }
.btn.small { min-height: 44px; padding: 0 12px; font-size: 14px; }
.btn.primary, .sheet .btn.primary, .next-step { background: var(--tint) !important; border-color: var(--tint) !important; color: var(--on-tint) !important; }
.btn.danger { color: var(--bad); border-color: var(--bad); background: var(--ctl); }
.btn:active { transform: none; background: var(--fill2); }
.btn.primary:active { filter: brightness(0.9); }
.btn:disabled, .btn[disabled] { opacity: 1; color: var(--label3); border-color: var(--rule2); background: var(--ctl) !important; }
.btn.primary:disabled { color: var(--label3) !important; background: var(--ctl) !important; border-color: var(--rule2) !important; }
.icon-btn { width: 44px; height: 44px; border-radius: var(--r); border: 1px solid var(--line); background: var(--ctl); color: var(--label); }
.segmented { border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); padding: 0; gap: 0; overflow: hidden; }
.segmented button { min-height: 44px; height: auto; border-radius: 0; font: 700 15px var(--font); color: var(--label); background: transparent; }
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button.on, #tabs button.on, #routeSel button.on { background: var(--cur); color: var(--label); box-shadow: inset 0 -3px 0 var(--tint); font-weight: 700; }
.field { background: var(--ctl); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px 7px; }
.field span { font-size: 13px; font-weight: 700; color: var(--label2); text-transform: none; letter-spacing: 0; }
.field input, .field select, .field b { font: 700 16px var(--font); color: var(--label); font-variant-numeric: tabular-nums; }
.field:focus-within { border-color: var(--tint); box-shadow: inset 0 0 0 1px var(--tint); }
input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { min-height: 44px; border-radius: var(--r); font-family: var(--font); color: var(--label); }
.field input, .field select { min-height: 28px; }
input::placeholder, textarea::placeholder { color: var(--label3); font-weight: 400; font-style: normal; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; accent-color: var(--tint); }
input[type=range] { accent-color: var(--tint); }
label.check, label.radio { min-height: 44px; display: flex; align-items: center; gap: 10px; }
.switch span { border-radius: 4px; }
.switch span::after { border-radius: 2px; transition: transform 160ms ease-out; }
.popover { border-radius: var(--r); animation: none; }
.pop-title { font-weight: 700; }

/* Status: shape + colour + word (✓ done · ▲ check · ⛔ no-go), outlined, no pastel fills */
.badge { border-radius: var(--r); border: 1px solid currentColor; background: transparent; font-weight: 700; }
.badge.ok { color: var(--ok); } .badge.warn { color: var(--warn); } .badge.bad { color: var(--bad); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---- Step bar: one bordered strip, phase dividers 2|3 and 4|5; done = green tick, current = lime ---- */
.modebar { align-items: stretch; gap: 8px; padding: 12px 20px 12px; border-bottom: 1px solid var(--rule); }
.steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; background: none; padding: 0;
  border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.steps button { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; align-items: center; column-gap: 4px; row-gap: 2px;
  min-height: 56px; height: auto; padding: 4px 2px; border: 0; border-left: 1px solid var(--rule2); border-radius: 0; background: transparent;
  color: var(--label2); font: 700 13px/1.2 var(--font); box-shadow: none; }
.steps button:first-child { border-left: 0; }
.steps button:nth-child(3), .steps button:nth-child(5) { border-left: 2px solid var(--rule); }
.steps .num { width: 22px; height: 22px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line); background: none; color: var(--label2); font-size: 12px; font-weight: 700; }
.steps button.on { background: var(--cur); color: var(--label); box-shadow: inset 0 -3px 0 var(--tint); border-top: 0; }
.steps button.on .num { background: var(--tint); border-color: var(--tint); color: var(--on-tint); }
.steps button.done:not(.on) .num { background: var(--ok); border-color: var(--ok); color: var(--on-tint); font-size: 0; }
.steps button.done:not(.on) .num::after { content: "✓"; font-size: 13px; font-weight: 700; }
.steps button.done:not(.on) { color: var(--label); }
.steps .lbl { flex-basis: 100%; text-align: center; }
.steps .st:empty { display: none; }
.steps .st svg { width: 16px; height: 16px; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; display: block; }
.steps .prog { display: none; }
.icon-btn.gear { width: 52px; height: auto; min-height: 56px; border: 1px solid var(--rule); background: transparent; border-radius: var(--r); color: var(--label); }
.icon-btn.gear.on { background: var(--cur); border-color: var(--rule); box-shadow: inset 0 -3px 0 var(--tint); color: var(--label); }
.next-step { min-height: 52px; height: auto; font-size: 17px; }

/* ---- Step header (every step): kicker, heading, one-line task, ruled key-figures row ---- */
.step-head { margin: 0 -20px; padding: 16px 20px 14px; border-bottom: 1px solid var(--rule); }
.step-kicker { font-size: 14px; font-weight: 700; color: var(--tint); }
.step-head h2 { margin: 2px 0 4px; font-size: 21px; line-height: 1.2; font-weight: 700; }
.step-task { font-size: 15px; color: var(--label2); margin: 0; max-width: 70ch; }
.figs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin: 0 -20px; border-bottom: 1px solid var(--rule); }
.figs > div { padding: 12px 20px; min-width: 0; }
.figs > div + div { border-left: 1px solid var(--rule); }
.figs .k { font-size: 13px; font-weight: 700; color: var(--label2); display: block; }
.figs .v { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.figs .v.ok { color: var(--ok); } .figs .v.warn { color: var(--warn); } .figs .v.bad { color: var(--bad); }

/* Bottom of the panel: Back + one primary Next, in thumb reach */
.action-bar { border-top: 1px solid var(--rule); background: var(--panel); }
.action-bar:has(> .back-step) { grid-template-columns: 52px 1fr; }
.back-step { min-height: 52px; padding: 0; font-size: 18px; }

/* Ruled list rows (aerodromes, legs, items) */
.rlist { margin: 0 -20px; }
.rrow { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 20px; border-bottom: 1px solid var(--rule2); }
.rrow .grow { flex: 1; min-width: 0; }
.rrow .t { font-weight: 700; }
.rrow .sub { font-size: 14px; }
.sig { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.sig svg { width: 18px; height: 18px; flex: none; }
.sig.ok { color: var(--ok); } .sig.warn { color: var(--warn); } .sig.bad { color: var(--bad); } .sig.info { color: var(--label2); }

/* Step 3 shows the route (and the profile on narrow screens); step 4 the navlog and the fuel plan */
.sheet[data-step=route] #tabs [data-tab=navlog], .sheet[data-step=route] #tabs [data-tab=fuel] { display: none; }
.sheet[data-step=navlog] #tabs [data-tab=route], .sheet[data-step=navlog] #tabs [data-tab=profile] { display: none; }
@media (min-width: 900px) { .sheet[data-step=route] #tabs { display: none; } }

/* One primary per screen: on Weather and Briefing the other actions are outlined */
.panel[data-panel=weather] .btn.primary:not(.next-step),
.panel[data-panel=brief] .btn.primary:not([data-act=briefPdf]) { background: var(--ctl) !important; color: var(--label) !important; border-color: var(--line) !important; }

/* One sign per step: done = green tick disc, check / out of limits = that sign instead of the number,
   current = lime number (its status is in the aria-label and on the screen itself) */
.steps button .st { display: none; }
.steps button:not(.on)[data-st=warn] .st, .steps button:not(.on)[data-st=bad] .st { display: block; }
.steps button:not(.on)[data-st=warn] .num, .steps button:not(.on)[data-st=bad] .num { display: none; }
.steps .st svg { width: 22px; height: 22px; }
.steps .lbl { white-space: nowrap; overflow: visible; text-overflow: clip; }
@media (max-width: 520px) { .modebar { padding: 10px 12px; } .steps button { padding: 4px 0; } .steps .lbl { font-size: 13px; letter-spacing: -0.02em; } .icon-btn.gear { width: 44px; } }


/* ---- Wide screens: one frame across the top (FlyBy navy), step bar below it, panel left, chart right ---- */
.topbar { display: none; }
@media (min-width: 900px) {
  :root { --top-h: 124px; }
  .topbar { display: grid; grid-template-columns: auto auto 1fr auto auto; grid-template-rows: 56px auto; align-items: center; column-gap: 10px;
    position: fixed; z-index: 1002; top: 0; left: 0; right: 0; padding: var(--safe-t) 12px 0 20px; background: var(--navy); color: #FFFFFF; border-bottom: 1px solid var(--rule); }
  .tb-title { font-weight: 700; font-size: 16px; white-space: nowrap; }
  .tb-sub { font-size: 13px; color: #C5CEDD; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .tb-chips { display: flex; gap: 14px; padding-left: 10px; }
  .tb-chips .sig.ok { color: #7FE0A0; } .tb-chips .sig.info { color: #C5CEDD; } .tb-chips .sig.warn { color: #FFC34D; }
  .topbar .btn { background: transparent; border-color: rgba(255,255,255,.45); color: #fff; gap: 8px; display: inline-flex; align-items: center; }
  .topbar .btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .tb-steps { grid-column: 1 / -1; margin: 0 -12px 0 -20px; background: var(--bg); }
  .tb-steps .modebar { padding: 8px 20px; border-bottom: 0; display: block; }
  .tb-steps .steps { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tb-steps .steps button { min-height: 52px; flex-wrap: nowrap; column-gap: 8px; font-size: 15px; }
  .tb-steps .steps .lbl { flex-basis: auto; }
  .tb-steps .icon-btn.gear { display: none; }
  .sheet { top: var(--top-h) !important; }
  .timecard { top: calc(var(--top-h) + 10px) !important; }
  .rightcol { top: calc(var(--top-h) + 10px) !important; }
  .rightcol .brand { display: none; }
  .panel-toggle { top: calc(var(--top-h) + 84px) !important; }
}
:root[data-theme=light] .tb-steps { background: var(--panel); }

/* ---- Portrait: while the chart is in view the step bar folds to one slim row (signs only, current named) ---- */
body.steps-mini .modebar { padding-top: 6px; padding-bottom: 6px; }
body.steps-mini .steps button { min-height: 44px; flex-wrap: nowrap; }
body.steps-mini .steps button:not(.on) .lbl { display: none; }
body.steps-mini .steps button.on { grid-column: span 2; }
body.steps-mini .steps { grid-template-columns: repeat(7, minmax(0, 1fr)); }
body.steps-mini .steps .lbl { flex-basis: auto; }
body.steps-mini .icon-btn.gear { min-height: 44px; }

/* ---- Chart leg labels: the full SOP HAT box on screen too — Heading · Altitude · Time
   (SOP 2511 Phase 2, "HATs" pp. 12 & 37; user, 10 Nov). Wind stays its own chip. ---- */

/* ---- Plans button: in the top bar on wide screens, next to Settings in the step bar on phones ---- */
.plans-btn { min-height: 56px; padding: 0 12px; border-color: var(--rule); background: transparent; flex: none; }
.tb-steps .plans-btn { display: none; }
body.steps-mini .plans-btn { min-height: 44px; }

/* ---- Phones: Back + Next pinned to the bottom of what is visible of the panel (thumb reach) ---- */
@media (max-width: 899px) {
  .sheet-body > .panel:not([hidden]) > .action-bar {
    position: absolute; left: 0; right: 0; z-index: 6; margin: 0;
    bottom: calc(var(--det, 88vh) - var(--sheet-h, 200px)); padding: 10px 16px calc(10px + var(--safe-b));
    display: grid; grid-template-columns: 52px 1fr; gap: 8px; background: var(--panel);
  }
  .sheet-body > .panel:not([hidden]) > .action-bar:not(:has(> .back-step)) { grid-template-columns: 1fr; }
  .sheet-body:has(> .panel:not([hidden]) > .action-bar) { padding-bottom: calc(var(--det, 88vh) - var(--sheet-h, 200px) + var(--safe-b) + 96px); }
}
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Step 3 · Route ---- */
.sheet[data-step=route] .sheet-body::before, .sheet[data-step=navlog] .sheet-body::before { display: none !important; }
.rt-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0 10px; }
.rt-tabs { flex: 1 0 100%; display: flex; }
.rt-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 8px; }
.rt-tabs .short { display: none; }
.rt-dot { width: 10px; height: 10px; border-radius: 5px; background: var(--route); flex: none; }
.rt-dot.alt { background: var(--alt); }
.rt-st .sig { font-size: 14px; }
.rt-st .sig svg { width: 16px; height: 16px; }
.rt-tools { flex: 1 0 100%; display: flex; gap: 8px; }
.rt-tools .grow { flex: 1; }
.rt-tools .btn, .dlg-acts .btn { display: inline-flex; align-items: center; gap: 6px; }
.rt-tools svg, .dlg-acts svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.rt-checks { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; margin: 0 0 6px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--ctl); font: inherit; color: var(--label); text-align: left; cursor: pointer; }
.rt-checks.warn { border-color: color-mix(in srgb, var(--warn) 55%, var(--rule)); }
.rt-checks.bad { border-color: color-mix(in srgb, var(--bad) 55%, var(--rule)); }
.rt-checks .go, .ck-row .go { margin-left: auto; color: var(--label2); font-size: 20px; }
.rt-table { width: calc(100% + 40px); margin: 0 -20px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rt-table th { font-size: 13px; font-weight: 700; color: var(--label2); text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--rule); }
.rt-table th.p { text-align: left; }
.rt-table td { height: 52px; padding: 0 6px; border-bottom: 1px solid var(--rule2); text-align: right; font-size: 16px; white-space: nowrap; }
.rt-table th.n, .rt-table td.n { width: 46px; padding-left: 20px; text-align: left; }
.rt-table th.c, .rt-table td.c { width: 30px; padding-right: 16px; color: var(--label2); font-size: 20px; }
.rt-table td.p { text-align: left; font-weight: 700; white-space: normal; }
.rt-table td.p .nm { word-break: break-word; }
.rt-table tbody tr { cursor: pointer; }
.rt-table tbody tr:active { background: var(--fill2); }
.wpn { width: 26px; height: 26px; border-radius: 13px; border: 2px solid var(--route); color: var(--route); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.rt-table.alt .wpn, .dlg-pane.alt .wpn { border-color: var(--alt); color: var(--alt); }
.rt-flag { margin-left: 6px; vertical-align: -3px; }
.rt-flag .sig svg { width: 16px; height: 16px; }
.rt-sugg { margin: 10px -20px 0; border-top: 1px solid var(--rule2); }
.src-tag { display: inline; min-height: 0; padding: 0; border: 0; background: none; font: 400 13px var(--font); color: var(--label2); text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; white-space: nowrap; }
.ck { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; font-size: 15px; line-height: 1.4; border-top: 1px solid var(--rule2); }
.ck .sig { padding-top: 1px; }
.ck .grow { flex: 1; min-width: 0; }
.ck.warn .grow { color: var(--warn); } .ck.bad .grow { color: var(--bad); }
.ck.warn .src-tag, .ck.bad .src-tag { color: var(--label2); }
.ck-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.ck-row .ck { flex: 1; }
.nl-tools { display: flex; justify-content: flex-end; padding: 12px 0 0; }
.profile-title-p { align-self: center; font-weight: 700; }
.panel[data-panel=profile] > .action-bar { position: static !important; display: grid; grid-template-columns: 52px 1fr; margin: 0 -16px 8px; border-top: 0; border-bottom: 1px solid var(--rule); }

/* One tap deeper: a sheet over the panel (the chart stays in view on the iPad) */
#routeDlg { position: absolute; inset: 0; z-index: 30; }
#routeDlg[hidden] { display: none; }
.dlg-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }
.dlg-pane { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92%; overflow: auto; overscroll-behavior: contain; touch-action: pan-y;
  background: var(--panel); border-top: 1px solid var(--rule); padding: 0 20px calc(16px + var(--safe-b)); }
@media (max-width: 899px) { #routeDlg { inset: 0 0 auto 0; height: var(--sheet-h, var(--det, 88vh)); } .dlg-pane { padding-left: 16px; padding-right: 16px; } }
.dlg-head { display: flex; align-items: center; gap: 12px; min-height: 64px; margin: 0 -20px; padding: 0 20px; border-bottom: 1px solid var(--rule); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.dlg-head h3 { margin: 0; font-size: 19px; flex: 1; }
.dlg-head .wp-name { flex: 1; min-width: 0; font: 700 19px var(--font); background: transparent; border: 1px solid transparent; border-radius: var(--r); padding: 0 8px; }
.dlg-head .wp-name:focus { border-color: var(--tint); outline: none; }
.dlg-sub { font-size: 14px; color: var(--label2); padding: 8px 0 0; }
.dlg-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(66px, 1fr)); gap: 8px; padding: 14px 0; }
.dlg-fields .field { padding: 6px 8px 7px; }
.dlg-fields .field input { width: 100%; font-size: 17px; }
.dlg-fields .field.auto { border-color: color-mix(in srgb, var(--warn) 60%, var(--line)); }
.dlg-fields em { font-style: normal; font-weight: 700; color: var(--warn); }
.dlg-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 -20px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.dlg-grid > div { padding: 10px 20px; border-left: 1px solid var(--rule2); }
.dlg-grid > div:nth-child(3n+1) { border-left: 0; }
.dlg-grid > div:nth-child(n+4) { border-top: 1px solid var(--rule2); }
.dlg-grid .k { display: block; font-size: 13px; font-weight: 700; color: var(--label2); }
.dlg-grid .v { display: block; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dlg-live > .ck:first-of-type { border-top: 0; }
.dlg-note { font-size: 14px; color: var(--label2); padding: 10px 0; margin: 0; }
.dlg-acts { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0 0; }
.dlg-acts .grow { flex: 1; }
.dlg-menu { display: flex; flex-direction: column; margin: 0 -20px; }
.dlg-menu button { display: flex; align-items: center; min-height: 56px; padding: 0 20px; border: 0; border-bottom: 1px solid var(--rule2); background: none; color: var(--label); font: 700 16px var(--font); text-align: left; cursor: pointer; }
.dlg-menu button span { margin-left: auto; font-weight: 400; font-size: 14px; color: var(--label2); }
.dlg-menu button.danger { color: var(--bad); border-bottom: 0; }
.dlg-menu button:active { background: var(--fill2); }
.dlg-body .toggle-row { padding: 12px 0; border-top: 1px solid var(--rule2); }
.dlg-body .toggle-row:first-child { border-top: 0; }
@media (min-width: 900px) { .dlg-menu .narrow-only { display: none; } }

/* Phones: tabs, Undo, Redo and More on one row; status as sign only (the word is in the label) */
@media (max-width: 899px) {
  .rt-bar { flex-wrap: nowrap; padding-top: 12px; }
  .rt-tabs, .rt-tools { flex: 1 1 auto; }
  .rt-tools { flex: none; gap: 6px; }
  .rt-tools .grow { display: none; }
  .rt-tools .long, .rt-tabs .long, .rt-st .w { display: none; }
  .rt-tabs .short { display: inline; }
  .rt-tools .btn { padding: 0 12px; }
  .rt-table { width: calc(100% + 32px); margin: 0 -16px; }
  .rt-table th.n, .rt-table td.n { padding-left: 16px; width: 42px; }
  .rt-table th.c, .rt-table td.c { padding-right: 12px; width: 24px; }
  .rt-sugg { margin: 10px -16px 0; }
  .dlg-head, .dlg-grid, .dlg-menu { margin-left: -16px; margin-right: -16px; }
  .dlg-head, .dlg-menu button { padding-left: 16px; padding-right: 16px; }
  .dlg-grid > div { padding-left: 16px; padding-right: 12px; }
  .sheet[data-step=route] .step-head .step-task { display: none; }
}
.rt-phead { display: none; }
@media (max-width: 899px) {
  .sheet[data-step=route] .panel[data-panel=route] > .step-head, .sheet[data-step=route] .panel[data-panel=route] > .figs { display: none; }
  .rt-phead { display: flex; align-items: baseline; gap: 12px; margin: 0 -16px; padding: 10px 16px 10px; border-bottom: 1px solid var(--rule); }
  .rt-phead h2 { margin: 0; font-size: 20px; }
  .rt-phead span { margin-left: auto; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .rt-tabs { min-width: 0; }
  .rt-tabs button { padding: 0 4px; gap: 6px; min-width: 0; }
  .rt-tools .btn[data-act=undo], .rt-tools .btn[data-act=redo] { padding: 0; width: 44px; justify-content: center; }
}
@media (max-width: 899px) { .dlg-pt .dlg-fields { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; } .dlg-pt .dlg-fields .field { padding: 6px 6px 7px; } }
/* Phones: the step bar is always the slim row (signs, the current step named), with room for Plans and Settings */
@media (max-width: 520px) {
  .steps button { min-height: 44px; flex-wrap: nowrap; }
  .steps button:not(.on) .lbl { display: none; }
  .steps button.on { grid-column: span 2; }
  .steps { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .steps .lbl { flex-basis: auto; }
  .icon-btn.gear, .plans-btn { min-height: 44px; }
}

/* ---- Mac / Windows: mouse and keyboard ---- */
@media (hover: hover) and (pointer: fine) {
  .rt-table tbody tr:hover, .dlg-menu button:hover, .ck-row:hover, .rt-checks:hover { background: var(--fill2); }
  .btn:hover:not(:disabled) { border-color: var(--label3); }
  .btn.primary:hover:not(:disabled) { filter: brightness(1.05); }
}
.rt-table tbody tr:focus-visible, .dlg-menu button:focus-visible, .rt-checks:focus-visible, .ck-row:focus-visible, .src-tag:focus-visible { outline: 2px solid var(--tint); outline-offset: -2px; }

/* ---- Short wide windows (Windows laptops 1280×720, small browser windows): compact head so the table shows ---- */
@media (min-width: 900px) and (max-height: 780px) {
  .sheet[data-step=route] .panel[data-panel=route] > .step-head { padding: 10px 20px 8px; }
  .sheet[data-step=route] .step-head .step-task { display: none; }
  .sheet[data-step=route] .panel[data-panel=route] > .figs > div { padding: 6px 20px; }
  .sheet[data-step=route] .panel[data-panel=route] > .figs .v { font-size: 18px; }
  .rt-bar { flex-wrap: nowrap; padding: 10px 0 8px; }
  .rt-tabs { flex: 1 1 auto; min-width: 0; }
  .rt-tabs button { min-height: 44px; padding: 0 6px; }
  .rt-tabs .long, .rt-st .w, .rt-tools .long { display: none; }
  .rt-tabs .short { display: inline; }
  .rt-tools { flex: none; gap: 6px; }
  .rt-tools .grow { display: none; }
  .rt-tools .btn[data-act=undo], .rt-tools .btn[data-act=redo] { padding: 0; width: 44px; justify-content: center; }
  .rt-table td { height: 46px; }
  .rt-checks { min-height: 44px; }
}

/* ---- Phone held sideways (short screen): compact everything, the sheet opens higher ---- */
@media (max-width: 899px) and (max-height: 500px) {
  .sheet-body > .panel:not([hidden]) > .action-bar { padding-top: 6px; padding-bottom: calc(6px + var(--safe-b)); }
  .sheet-body > .panel:not([hidden]) > .action-bar .btn { min-height: 44px; }
  .sheet-body > .panel:not([hidden]) > .action-bar .next-step { font-size: 16px; }
  .sheet-body:has(> .panel:not([hidden]) > .action-bar) { padding-bottom: calc(var(--det, 88vh) - var(--sheet-h, 200px) + var(--safe-b) + 64px); }
  .rt-phead { padding: 6px 16px; }
  .rt-bar { padding: 8px 0 6px; }
  .rt-checks { min-height: 44px; margin-bottom: 4px; }
  .rt-table td { height: 44px; }
  .rt-table thead { display: none; }
  .modebar { padding-top: 4px !important; padding-bottom: 4px !important; }
}
/* sideways phone with the chart in view: the step bar hides (Back / Next stay; drag the sheet up for the step bar) */
@media (max-width: 899px) and (max-height: 500px) { body.steps-mini .sheet .modebar { display: none; } }

/* ---- Step 4 · Navlog & fuel ---- */
@media (min-width: 900px) {
  body.full-panel .sheet { width: auto !important; right: 0 !important; border-right: 0; }
  body.full-panel .timecard, body.full-panel .rightcol, body.full-panel #profileDock, body.full-panel #modeChip,
  body.full-panel .panel-toggle, body.full-panel .panel-resize { display: none !important; }
  body.full-panel .panel[data-panel=navlog] > .step-head { display: flex; flex-wrap: wrap; align-items: flex-end; column-gap: 24px; }
  .nl-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; margin: 0 -20px; min-height: 0; }
  .nl-main { padding: 0 20px; min-width: 0; }
  .nl-fuel { padding: 0 20px 12px; border-left: 1px solid var(--rule); }
  .nl-bar { padding-left: 20px; padding-right: 20px; margin: 0 -20px; }
  .nl-bar .rt-tabs { flex: 0 1 auto; }
  .nl-bar .rt-tabs button { padding: 0 18px; }
  .nl-bar .rt-tools { flex: 1 1 auto; justify-content: flex-end; }
  .nl-bar { flex-wrap: nowrap; }
}
.nl-bar .rt-tools .btn svg { width: 18px; height: 18px; }
.nl-ptools { display: flex; gap: 8px; padding: 0 0 6px; }
.nl-ptools .btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.nl-ptools svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.nlt-wrap { margin: 0 -20px; overflow-x: auto; }
.nlt { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.nlt th { font-size: 13px; font-weight: 700; line-height: 1.25; color: var(--label2); text-align: right; padding: 6px 6px; border-bottom: 1px solid var(--rule); white-space: nowrap; vertical-align: bottom; }
.nlt td { padding: 0 6px; text-align: right; font-size: 16px; white-space: nowrap; }
.nlt .w { text-align: left; padding-left: 20px; font-weight: 700; min-width: 110px; white-space: normal; }
.nlt th.c, .nlt td.c { width: 30px; padding-right: 16px; color: var(--label2); font-size: 20px; }
.nlt tr.a td { padding-top: 7px; height: 28px; }
.nlt tr.b td { padding-bottom: 7px; height: 28px; border-bottom: 1px solid var(--rule2); color: var(--label2); }
.nlt tr.b td.w, .nlt tr.b td.hi { color: var(--label); }
.nlt tr.b td.hi { font-weight: 700; }
.nlt tr.first td { height: 40px; padding: 6px 6px; border-bottom: 1px solid var(--rule2); }
.nlt tr.first td.w { padding-left: 20px; }
.nlt tr.sub td { font-size: 15px; }
.nlt tr[data-pt] { cursor: pointer; }
.nlt td.auto { color: var(--warn); }
.nlt td small { font-size: 12px; font-weight: 700; color: var(--warn); }
.nlt td.std, .nl-card .ete.std { color: #7FB8FF; }
:root[data-theme=light] .nlt td.std, :root[data-theme=light] .nl-card .ete.std { color: #0A5FC8; }
.nlt td.std { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.nlt tfoot td { height: 48px; font-weight: 700; border-top: 1px solid var(--rule); }
.nlt .alt-arrow { font-size: 13px; margin-left: 2px; color: var(--label2); }
.nlt.alt .w { color: var(--label); }
@media (hover: hover) and (pointer: fine) { .nlt tbody tr[data-pt]:hover td, .nl-card:hover { background: var(--fill2); } }
.fl-title { font-weight: 700; font-size: 15px; padding: 14px 0 6px; display: flex; gap: 8px; align-items: baseline; }
.fl-row { display: flex; align-items: center; gap: 8px; min-height: 48px; border-bottom: 1px solid var(--rule2); font-size: 15px; }
.fl-n { width: 18px; color: var(--label2); font-weight: 700; flex: none; }
.fl-l { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.fl-l small { flex-basis: 100%; font-size: 13px; color: var(--label2); }
.fl-v { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.fl-inp { width: 84px; min-height: 44px; text-align: right; font: 700 16px var(--font); background: var(--ctl); border: 1px solid var(--line); border-radius: var(--r); padding: 0 10px; color: var(--label); font-variant-numeric: tabular-nums; }
.fl-inp:focus { border-color: var(--tint); outline: none; box-shadow: inset 0 0 0 1px var(--tint); }
.fl-req { display: flex; justify-content: space-between; align-items: center; min-height: 52px; border-top: 2px solid var(--rule); border-bottom: 1px solid var(--rule2); font-weight: 700; font-size: 17px; margin-top: -1px; }
.nl-fuel .ck:first-of-type { border-top: 0; }
.nl-cards { margin: 0 -16px; }
.nl-card { display: block; width: 100%; text-align: left; padding: 10px 16px; border: 0; border-bottom: 1px solid var(--rule2); background: none; color: var(--label); font: inherit; cursor: pointer; }
.nl-card .h { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.nl-card .h .sig svg { width: 16px; height: 16px; }
.nl-card .ete { margin-left: auto; font-size: 17px; font-variant-numeric: tabular-nums; }
.nl-card .ete.sub { font-size: 14px; color: var(--label2); font-weight: 400; }
.nl-card .go { color: var(--label2); font-size: 20px; }
.nl-card .g { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 6px; }
.nl-card .g .k { display: block; font-size: 13px; font-weight: 700; color: var(--label2); }
.nl-card .g b { font-size: 16px; font-variant-numeric: tabular-nums; }
.nl-card .wd { font-size: 14px; color: var(--label2); margin-top: 4px; }
.nl-card .wd b { color: var(--label); } .nl-card .wd b.auto { color: var(--warn); }
.nl-tot { display: flex; justify-content: space-between; padding: 12px 16px; font-weight: 700; border-bottom: 1px solid var(--rule); }
.dlg-wx { display: block; margin: 14px 0 0; }
.dlg-wx input { width: 100%; }
.dlg-menu button:disabled { color: var(--label3); }
/* the point sheet on the full-width Navlog step: a side sheet on the right */
@media (min-width: 900px) { body.full-panel .dlg-pane { left: auto; top: 0; width: min(520px, 100%); max-height: none; border-top: 0; border-left: 1px solid var(--rule); } }
@media (max-width: 899px) { .nl-bar .rt-tabs { flex: 1 1 auto; } }
@media (min-width: 700px) and (max-width: 899px) { .nlt-wrap { margin: 0 -16px; } .nlt .w { padding-left: 16px; } }
.nl-top { margin: 0 -20px; }
.nl-top > .step-head, .nl-top > .figs { margin: 0; }
@media (min-width: 900px) {
  .nl-top { display: flex; align-items: stretch; border-bottom: 1px solid var(--rule); }
  .nl-top > .step-head { flex: 1; border-bottom: 0; }
  .nl-top > .figs { border-bottom: 0; border-left: 1px solid var(--rule); grid-auto-columns: minmax(140px, auto); }
}
@media (max-width: 899px) { .nl-top { margin: 0 -16px; } .nl-top > .step-head { padding-left: 16px; padding-right: 16px; } .nl-top > .figs > div { padding-left: 16px; padding-right: 12px; } }
body.steps-mini .lbl-x { display: none; }
@media (max-width: 520px) { .lbl-x { display: none; } }
/* Short screens, every step: the one-line task and the kicker go, figures get smaller (the list needs the height) */
@media (max-height: 780px) and (min-width: 900px), (max-height: 500px) {
  .step-head { padding-top: 10px; padding-bottom: 8px; }
  .step-head .step-task { display: none; }
  .figs > div { padding-top: 6px; padding-bottom: 6px; }
  .figs .v { font-size: 18px; }
}
@media (max-height: 500px) { .step-kicker { display: none; } .step-head h2 { font-size: 19px; margin: 0; } }

/* ---- Native dropdown lists (Windows / Linux draw the open list themselves): never light text on white.
   The list takes the panel colours of the current theme; the field keeps the B3 look. ---- */
select { color-scheme: dark; }
:root[data-theme=light] select { color-scheme: light; }
select option, select optgroup { background-color: var(--panel); color: var(--label); font: 400 16px var(--font); }
select option:checked { background-color: var(--cur); color: var(--label); font-weight: 700; }
select option:disabled { color: var(--label3); }

/* ---- Where am I: three levels that look different (agreed 2 Nov, 23:30) ----
 * 1 · step bar: current step = lime box + lime shade; done = green tick, white label; to do = dim.
 * 2 · tabs inside a step: no box; the selected tab is underlined AND shaded in the colour of what it shows
 *     (magenta main route, blue alternate, white fuel), like the lime shade of the current step.
 * 3 · the selected point: shaded in its route colour, a route-coloured bar, bold. */
.steps button { color: var(--label3); }
.steps button.done:not(.on) { color: var(--label); }
.steps button.on { background: var(--cur); color: var(--label); box-shadow: inset 0 0 0 2px var(--tint); }
.steps button:not(.on):not(.done) .num { border-color: var(--line); color: var(--label3); }
.icon-btn.gear.on { box-shadow: inset 0 0 0 2px var(--tint); }
.rt-tabs { border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; background: transparent; }
.rt-tabs button + button { border-left: 0; }
.rt-tabs button { color: var(--label2); background: transparent !important; box-shadow: none !important; }
.rt-tabs button.on { color: var(--label); }
.rt-tabs button.on[data-route-tab=main], .rt-tabs button.on[data-nl-tab=main] { background: color-mix(in srgb, var(--route) 16%, transparent) !important; box-shadow: inset 0 -4px 0 var(--route) !important; }
.rt-tabs button.on[data-route-tab=alt], .rt-tabs button.on[data-nl-tab=alt] { background: color-mix(in srgb, var(--alt) 18%, transparent) !important; box-shadow: inset 0 -4px 0 var(--alt) !important; }
.rt-tabs button.on[data-nl-tab=fuel] { background: color-mix(in srgb, var(--label) 10%, transparent) !important; box-shadow: inset 0 -4px 0 var(--label) !important; }
.rt-alt { color: var(--alt); }
.dlg-pane, .dlg-head { background: var(--raised); }
.dlg-scrim { background: rgba(0, 0, 0, 0.62); }
.dlg-path { font-size: 13px; font-weight: 700; color: var(--label2); padding: 10px 0 0; }
.dlg-path b { color: var(--route); } .dlg-pane.alt .dlg-path b { color: var(--alt); }
.btn:disabled, .btn[disabled] { border-style: dashed; }
/* phase names over the step bar on wide screens: Prepare · Plan · Check & present */
.phases { display: none; }
@media (min-width: 900px) {
  .phases { display: grid; grid-template-columns: 2fr 2fr 2fr; padding: 6px 20px 0; font-size: 13px; font-weight: 700; color: var(--label2); }
  .phases span { padding-left: 2px; }
  .tb-steps .modebar { padding-top: 4px; }
  :root { --top-h: 146px; }
}

/* Icon buttons: no browser padding (it pushed the icon off centre, e.g. the calendar in the time card);
   the time card's calendar, − and + are full 44 pt targets */
.icon-btn { padding: 0; display: inline-grid; place-items: center; line-height: 0; }
.icon-btn svg { display: block; margin: 0; }
.timecard .icon-btn.step { width: 44px; height: 44px; }
.timecard .icon-btn.cal svg { width: 22px; height: 22px; }
/* phones: the take-off time always shows whole (the word "Take-off" goes, the − / + stay 44 pt) */
@media (max-width: 520px) { #timeSub { display: none; } .time-main { font-size: 14px; letter-spacing: -0.01em; } .timecard { gap: 2px; padding: 4px; } }

/* ---- Navlog sheet ("Edit as sheet"): the school's paper form, always light like the printout, whatever the
   app theme. Its cells keep the form's own size (the 44 pt rule is for app controls, not form cells). ---- */
.nl-sheet {
  color-scheme: light;
  --bg: #EEF0F3; --panel: #FFFFFF; --ctl: #F4F5F7; --raised: #F7F8FA;
  --label: #111418; --label2: #3F4753; --label3: #5D6672;
  --rule: #8A93A0; --rule2: #D5D9E0; --line: #6B7380; --fill2: #E7EAEE;
  --tint: #00205D; --on-tint: #FFFFFF; --cur: #E6EAF2;
  color: #111418;
}
.nl-sheet input.sc { min-height: 23px; color: #111418; font-family: var(--mono); font-size: 13px; }
.nl-sheet input.sc::placeholder { color: #8A93A0; }
.nl-sheet input.sc.std { color: #0A4FB8; }
.nl-sheet input.sc.ov { color: #111418; }
.nl-sheet .btn { color: var(--label); background: var(--ctl); border-color: var(--line); }
.nl-sheet .btn.primary { background: var(--tint) !important; border-color: var(--tint) !important; color: #FFFFFF !important; }
.nl-sheet .btn:disabled { color: var(--label3); }
.nl-sheet { --route: #B0127A; --alt: #0A5FC8; }
.nl-sheet .segmented button { color: var(--label2); background: transparent; box-shadow: none; }
.nl-sheet .segmented button.on { color: var(--label); }
.nl-sheet [data-ss-route=main].on { background: color-mix(in srgb, var(--route) 14%, transparent) !important; box-shadow: inset 0 -4px 0 var(--route) !important; }
.nl-sheet [data-ss-route=alt].on { background: color-mix(in srgb, var(--alt) 16%, transparent) !important; box-shadow: inset 0 -4px 0 var(--alt) !important; }

/* =====================================================================================================
 * Type scale and sections (3 Nov) — one system for every screen (navlog-gui-rules §6, §8)
 *   21 / 700  step heading, key figures            → --fs-1
 *   16 / 400-700  body, values, rows, buttons, tabs, section headings → --fs-2
 *   14 / 400  secondary lines (sub-lines, notes, hints, raw METAR/TAF) → --fs-3
 *   13 / 700  labels: field labels, column heads, figure labels, kicker; 13/400 sources → --fs-4 (minimum)
 * Weights: 400 and 700 only (B612 has no others).
 * Sections: a section starts with its heading on a strong 2 px rule; rows inside are split by 1 px rules.
 * Not here on purpose: chart labels on the map (chart conventions) and the school's paper form (its own layout).
 * ===================================================================================================== */
:root { --rule-section: #5A6370; }
/* Sizes follow the device's text-size setting (rules §6 Scaling): --u is 1 rem = 16 px by default (browser
   text size / zoom on Mac, Windows, Android). On iPhone / iPad the root follows Dynamic Type
   (-apple-system-body, 17 px at the default size), so --u is scaled back to 16 px there and grows with the
   Larger Text setting. iOS only: on a Mac -apple-system-body is 13 px. */
:root { --u: 1rem; --fs-1: calc(var(--u) * 21 / 16); --fs-2: var(--u); --fs-3: calc(var(--u) * 14 / 16); --fs-4: calc(var(--u) * 13 / 16); }
@supports (font: -apple-system-body) and (-webkit-touch-callout: none) {
  html { font: -apple-system-body; }
  :root { --u: calc(1rem * 16 / 17); }
}
:root { --rule2: #343C47; }                          /* row rules: visible on the dark panel */
:root[data-theme=light] { --rule2: #CDD2DA; --rule-section: #6B7380; }
.sheet, .sheet-body, .dlg-pane, .popover, .sn-card { font-size: var(--fs-2); }
/* 21 */
.step-head h2, .dlg-head h3, .figs .v, .rt-phead h2 { font-size: var(--fs-1); }
/* 16 */
.btn, .btn.small, .segmented button, .rt-tabs button, .steps button, .tb-steps .steps button, .next-step,
.rrow .t, .row, .toggle-row, .fl-row, .ck, .nl-card .g b, .nl-card .h, .dlg-menu button, .rt-table td, .nlt td,
.field input, .field select, .field b, .value, .type-card b, .wx-head b, .leg-card b, .issues li, .warnings,
.time-main, .tb-title, .pop-item, .plan-item, select option { font-size: var(--fs-2); }
.rt-phead span, .fl-req, .dlg-grid .v, .nl-card .ete { font-size: calc(var(--u) * 17 / 16); } /* the one figure size inside lists (fits 390 px) */
/* section headings */
.group-title, .sheet .group-title, .fl-title, .cap, .dlg-body > h4 { font-size: var(--fs-2); font-weight: 700; color: var(--label); text-transform: none; letter-spacing: 0; }
/* 14 */
.step-task, .label, .note, .sub, .hint, .rrow .sub, .dlg-note, .dlg-sub, .nl-card .wd, .fl-l small, .type-card span,
.wp-sub, .leg-out, .pp-sub, .plan-item small, .wxchart figcaption, .chart-pdf, .fb-info, .wn-head span, .nm-text span,
.update-pill .up-text span, .fb-sub, .sep-tip, .mb-hint, .profile-info, .time-sub, .brand-sub, .sun, .pop-note,
.wx .label, .wp-why, .lc-note, .solo-row small, .toggle-row small, small.label, .tb-sub, .ss-note,
.mono, .metar, .taf, .notam, code, pre { font-size: var(--fs-3); }
.sun { font-size: var(--fs-4); }              /* sunrise / sunset / landing: a label row in the time card */
/* 13 */
.step-kicker, .figs .k, .k, .field span, .dlg-fields .field span, .stat .k, th, table.nl th, .nlt th, .rt-table th,
.badge, .pop-title, .fa-label, .lc-grid span, .dlg-path, .profile-title { font-size: var(--fs-4); font-weight: 700; text-transform: none; letter-spacing: 0; }
.src, .src-tag { font-size: var(--fs-4); font-weight: 400; }
.steps .num, .wpn, .wp-n, .leg-card .leg-no, .lc-n, .howto .n { font-size: var(--fs-4); }
.leaflet-control-attribution { font-size: 11px; } /* map credit line: chart furniture, not app text */

/* Sections: heading on a strong rule, air above; a group right after its heading has no second top rule */
.group-title, .sheet .group-title { margin: 28px -20px 0; padding: 14px 20px 8px; border-top: 2px solid var(--rule-section); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.group-title + .group, .group-title + .nl-wrap, .group-title + .rlist { border-top: 1px solid var(--rule2); }
.group { border-bottom: 1px solid var(--rule2); }
.group > * + *, .group .row + .row, .group .toggle-row + .toggle-row { border-top: 1px solid var(--rule2); }
.step-head + .figs, .figs { border-bottom: 2px solid var(--rule-section); }
.nl-top { border-bottom: 2px solid var(--rule-section); }
.nl-top > .figs { border-bottom: 0; }
.fl-title { border-top: 0; }
.nl-fuel { border-left-width: 2px; border-left-color: var(--rule-section); }
.action-bar { border-top: 2px solid var(--rule-section) !important; }
.dlg-head { border-bottom: 2px solid var(--rule-section); }
.rt-table th, .nlt th { border-bottom: 2px solid var(--rule-section); }
.rt-table td, .nlt tr.b td, .nlt tr.first td, .nl-card, .rrow, .fl-row, .ck, .dlg-menu button { border-color: var(--rule2); }
@media (max-width: 899px) { .group-title, .sheet .group-title { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; } }

/* Targets: switches and selects reach 44 pt (the visible switch stays its size; the tap area grows) */
.switch { position: relative; }
.switch::before { content: ""; position: absolute; inset: -7px -4px; }
.field select, .field input { min-height: 32px; }
/* last stragglers of the old sizes */
.sheet .group-title .btn.small, .group-title .btn.small { font-size: var(--fs-2); min-height: 44px; height: auto; padding: 0 12px; }
.sheet .stat .k { font-size: var(--fs-4); }
.nlt tr.sub td { font-size: var(--fs-2); color: var(--label2); }
.help-q > summary, .tip-head b, .pp-title, .wp.compact .wp-cname { font-size: var(--fs-2); }
.wn-rel li, .setup-body > p, .setup-body .setup-sub { font-size: var(--fs-3); }

/* the first section right under the step head: the head's strong rule already opens it */
.figs + .group-title, .step-head + .group-title, .nl-top + .group-title, .figs + .rlist + .group-title:first-of-type { border-top: 0; margin-top: 0; }
/* no floating cards (B3): old card boxes become ruled sections */
.step-card, .sep-card { background: transparent !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  border-top: 1px solid var(--rule2) !important; border-bottom: 1px solid var(--rule2) !important; }
.sheet .group { border-left: 0 !important; border-right: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
/* phones: the same scale, one step down where the width is 390 px (time card, slim step bar, key figures) */
@media (max-width: 520px) {
  .timecard .time-main { font-size: var(--fs-3); }
  .steps button, body.steps-mini .steps button { font-size: var(--fs-3); }
  .figs .v { font-size: calc(var(--u) * 17 / 16); }
}

/* Mission type cards: icon left, name and one line beside it */
.type-card { display: grid !important; grid-template-columns: 36px 1fr; column-gap: 12px; row-gap: 2px; align-items: start; text-align: left; padding: 12px 12px 12px 10px; }
.type-card .tc-ic { grid-row: 1 / span 2; width: 36px; height: 36px; margin-top: 2px; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.type-card b, .type-card span { grid-column: 2; }
.tc-ic .r { stroke: var(--route); }
.tc-ic .a { stroke: var(--alt); stroke-dasharray: 3 3; }
.tc-ic .ad { stroke: var(--label); fill: var(--ctl); }
.tc-ic .ad.alt { stroke: var(--alt); }
.tc-ic .pt { stroke: var(--route); fill: var(--route); }
.tc-ic .w { stroke: var(--label); }
.type-card.on .tc-ic .ad { fill: var(--cur); }
.type-card { grid-template-columns: 30px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 10px; row-gap: 4px; padding: 12px; }
.type-card svg.tc-ic { grid-row: 1; width: 30px; height: 30px; margin: 0; }
.type-card b { grid-column: 2; grid-row: 1; }
.type-card span { grid-column: 1 / -1; grid-row: 2; }
.type-card { align-content: start; grid-template-columns: 34px 1fr; }
.type-card svg.tc-ic { width: 34px; height: 34px; stroke-width: 2.4; }

/* ---- Fewer lines (3 Nov, 00:45): one line per section boundary, thin lines only between rows ----
 * Sections are told apart by their heading + space + ONE strong rule above the heading.
 * Inside a section: a thin rule between rows of a list; no box edges, no rule under the heading,
 * none before the first row or after the last, none above a one-line note. */
.group, .sheet .group, .group.pad, .sheet .group.pad, .nl-wrap, .profile-panel { border-top: 0 !important; border-bottom: 0 !important; }
.group-title + .group, .group-title + .nl-wrap, .group-title + .rlist { border-top: 0 !important; }
.group-title, .sheet .group-title { padding-bottom: 4px; }
.group > .row:has(> .grow.label:only-child), .group > .row:has(> .label:only-child), .group > p.note, .group > .note,
.group > .row:has(> span.label:only-child) { border-top: 0 !important; padding-top: 2px; }
.group > .row:has(> .grow.label:only-child) .label { font-size: var(--fs-3); }
/* the step head and its figures read as one block: no line between them, one strong line under */
.step-head { border-bottom: 0 !important; padding-bottom: 10px; }
.figs > div + div { border-left-color: var(--rule2); }
/* options / details blocks (Start a new mission, Fly again): just a row, no box */
details.group.options, .sheet details.group.options { border-top: 0 !important; border-bottom: 0 !important; }
details.options[open] > summary { border-bottom: 0; }
.step-card, .sep-card { border-top: 0 !important; border-bottom: 0 !important; }
/* a details block right after the head, then a section: the section's strong rule is the only line */
.figs + details.options { margin-top: 4px; }
/* rows of input boxes: the boxes separate themselves; no rule between them */
.group > .row:has(.field), .group > .row:has(.field) + .row, .group > .toggle-row:has(+ .row .field) { border-top: 0 !important; }
/* a section that opens the panel needs no line above it */
.panel > .group-title:first-child, .panel > :first-child.group-title { border-top: 0; margin-top: 4px; }
/* in-app confirmation (replaces the browser's confirm box) */
.ac-card { max-width: 420px; text-align: left; }
.ac-card h2 { font-size: var(--fs-1); margin: 0 0 8px; }
.ac-card p { font-size: var(--fs-2); color: var(--label2); margin: 0 0 18px; }
.ac-acts { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.ac-acts .btn { min-height: 48px; padding: 0 18px; }
.rt-need { display: flex; gap: 8px; align-items: flex-start; color: var(--warn); }
/* phones: the slim step bar gives the current step three columns so its name fits */
@media (max-width: 520px) {
  .steps, body.steps-mini .steps { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .steps button.on, body.steps-mini .steps button.on { grid-column: span 3; padding: 0 4px; column-gap: 4px; }
}
/* larger text: the Route tab row wraps instead of crowding */
@media (max-width: 899px) { .rt-bar { flex-wrap: wrap; } .rt-tabs { flex: 1 1 150px; } }
