:root {
[hidden] { display: none !important; }
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --bg: #f2f2f7;
  --label: #111114;
  --label2: rgba(60, 60, 67, 0.62);
  --label3: rgba(60, 60, 67, 0.36);
  --sep: rgba(60, 60, 67, 0.16);
  --fill: rgba(118, 118, 128, 0.12);
  --fill2: rgba(118, 118, 128, 0.2);
  --glass: rgba(255, 255, 255, 0.72);
  --glass-heavy: rgba(248, 248, 250, 0.86);
  --glass-edge: rgba(255, 255, 255, 0.6);
  --tint: #0a84ff;
  --route: #d1009a;
  --alt: #0a84ff;
  --ok: #248a3d;
  --warn: #c93400;
  --bad: #d70015;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.16), 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.12);
  --r: 14px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --label: #f5f5f7;
    --label2: rgba(235, 235, 245, 0.62);
    --label3: rgba(235, 235, 245, 0.32);
    --sep: rgba(84, 84, 88, 0.5);
    --fill: rgba(118, 118, 128, 0.24);
    --fill2: rgba(118, 118, 128, 0.36);
    --glass: rgba(30, 30, 34, 0.68);
    --glass-heavy: rgba(22, 22, 26, 0.86);
    --glass-edge: rgba(255, 255, 255, 0.08);
    --tint: #0a84ff;
    --ok: #30d158;
    --warn: #ff9f0a;
    --bad: #ff453a;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--label); font: 15px/1.4 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

#map { position: fixed; inset: 0; background: #e8e6df; }
.leaflet-container { font-family: var(--font); }
.leaflet-control-attribution { background: var(--glass) !important; backdrop-filter: blur(12px); border-radius: 8px 0 0 0; font-size: 10px; color: var(--label2); }
.leaflet-control-attribution a { color: var(--label2); }
.leaflet-control-zoom { display: none; }

/* Materials */
.glass { background: var(--glass); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); border: 0.5px solid var(--glass-edge); box-shadow: var(--shadow-sm); }
.glass-heavy { background: var(--glass-heavy); backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%); border-top: 0.5px solid var(--glass-edge); box-shadow: var(--shadow); }
@media (prefers-reduced-transparency: reduce) {
  .glass, .glass-heavy { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* Brand, time card, right column */
.pill { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 10px; border-radius: 22px; }
.brand-mark { width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(145deg, #2a2f3d, #0b0d12); position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 6px 5px; border-top: 2px solid #ff3bc4; border-right: 2px solid #ff3bc4; transform: skewX(-12deg); border-radius: 0 3px 0 0; }
.brand-text { font-weight: 650; letter-spacing: -0.01em; }
.brand-sub { font-size: 12px; color: var(--label2); font-variant-numeric: tabular-nums; }
.round { width: 44px; height: 44px; border-radius: 22px; display: grid; place-items: center; cursor: pointer; transition: transform 120ms ease-out; }
.round:active, .btn:active, .segmented button:active { transform: scale(0.95); }

.time-main { font-weight: 650; font-size: 15px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.time-sub { font-size: 12px; color: var(--label2); font-variant-numeric: tabular-nums; }
.sun .warn { color: var(--warn); font-weight: 600; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--tint) var(--p, 0%), var(--fill2) var(--p, 0%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.25), 0 0 0 0.5px rgba(0,0,0,0.06); margin-top: -10px; }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--fill2); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--tint); }
input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.25); }

.popover { position: fixed; top: calc(var(--safe-t) + 64px); right: 12px; z-index: 1100; width: 270px; border-radius: 16px; padding: 10px; transform-origin: top right; animation: pop 220ms cubic-bezier(.2,.9,.3,1.1); }
@keyframes pop { from { opacity: 0; transform: scale(0.92); } }
.pop-title { font-size: 12px; font-weight: 600; color: var(--label2); text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 6px 6px; }
.radio, .check { display: flex; gap: 10px; align-items: center; padding: 9px 6px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.radio:hover, .check:hover { background: var(--fill); }
.radio input, .check input { accent-color: var(--tint); width: 18px; height: 18px; margin: 0; }
.pop-sep { height: 0.5px; background: var(--sep); margin: 6px 0; }
.pop-note { font-size: 11px; color: var(--label2); padding: 6px; }

.chip { pointer-events: none; position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--sheet-h, 200px) + 14px); z-index: 900; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 17px; font-size: 13px; font-weight: 500; transition: bottom 280ms cubic-bezier(.2,.8,.2,1), opacity 200ms; white-space: nowrap; }
.chip .dot { width: 8px; height: 8px; border-radius: 4px; background: var(--route); }
.chip.alt .dot { background: var(--alt); }

/* Bottom sheet */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; height: 88vh; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; transform: translateY(calc(88vh - var(--sheet-h, 200px))); will-change: transform; touch-action: none; }
.sheet.anim { transition: transform 420ms cubic-bezier(.2,.9,.25,1); }
.grabber { height: 22px; display: grid; place-items: center; cursor: grab; flex: none; }
.grabber span { width: 38px; height: 5px; border-radius: 3px; background: var(--label3); }
.summary { display: flex; align-items: center; gap: 4px; padding: 0 16px 10px; flex: none; }
.stat { display: grid; flex: 1; min-width: 0; }
.stat .k { font-size: 11px; color: var(--label2); text-transform: uppercase; letter-spacing: 0.03em; font-weight: 500; }
.stat .v { font-size: 19px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat .v.bad { color: var(--bad); }
.stat .v.ok { color: var(--ok); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 18px; border: 0; background: var(--fill); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: transform 120ms ease-out, background 150ms; }
.btn.primary { background: var(--tint); color: #fff; }
.btn.wide { width: 100%; }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.danger { color: var(--bad); }
.btn svg { width: 17px; height: 17px; }

.tabs { display: flex; gap: 10px; padding: 0 16px 10px; flex: none; flex-wrap: wrap; }
.segmented { display: flex; background: var(--fill); border-radius: 9px; padding: 2px; flex: 1; min-width: 260px; }
.segmented.small { flex: 0 0 auto; min-width: 0; }
.segmented button { flex: 1; border: 0; background: none; border-radius: 7px; height: 30px; padding: 0 12px; font-size: 13px; font-weight: 500; cursor: pointer; transition: background 180ms, box-shadow 180ms; }
.segmented button.on { background: var(--bg); box-shadow: 0 3px 8px rgba(0,0,0,0.12), 0 0 0 0.5px rgba(0,0,0,0.04); font-weight: 600; }
@media (prefers-color-scheme: dark) { .segmented button.on { background: #636366; } }

.sheet-body { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 0 16px calc(var(--safe-b) + 24px); touch-action: pan-y; -webkit-overflow-scrolling: touch; }
/* bottom sheet (portrait): the part pushed below the screen by the detent is padded, so the end of the content can always be scrolled into view */
.sheet-body { padding-bottom: calc(88vh - var(--sheet-h, 200px) + var(--safe-b) + 24px); }

/* Lists */
.group { background: var(--glass); border-radius: var(--r); margin: 0 0 14px; overflow: hidden; border: 0.5px solid var(--sep); }
@media (prefers-color-scheme: dark) { .group { background: rgba(44,44,48,0.7); } }
.group-title { font-size: 12px; color: var(--label2); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; margin: 16px 4px 6px; display: flex; justify-content: space-between; align-items: center; }
.group-title .btn { text-transform: none; letter-spacing: 0; }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 44px; border-top: 0.5px solid var(--sep); }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .label { color: var(--label2); font-size: 14px; }
.row .value { font-weight: 600; font-variant-numeric: tabular-nums; }
.row.check-ok .value { color: var(--ok); }
.row.check-bad .value { color: var(--bad); }

.wp { display: grid; grid-template-columns: 30px 1fr auto; gap: 6px 10px; padding: 10px 12px; border-top: 0.5px solid var(--sep); align-items: center; }
.wp:first-child { border-top: 0; }
.wp-n { width: 26px; height: 26px; border-radius: 13px; display: grid; place-items: center; background: var(--route); color: #fff; font-size: 12px; font-weight: 700; }
.alt-mode .wp-n { background: var(--alt); }
.wp-name { border: 0; background: transparent; font-weight: 600; font-size: 16px; padding: 4px 0; width: 100%; min-width: 0; border-radius: 6px; }
.wp-name:focus { outline: none; background: var(--fill); padding: 4px 6px; }
.wp-sub { font-size: 12px; color: var(--label2); grid-column: 2 / 3; margin-top: -4px; font-variant-numeric: tabular-nums; }
.wp-actions { display: flex; gap: 4px; }
.icon-btn { width: 32px; height: 32px; border-radius: 16px; border: 0; background: var(--fill); display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 16px; height: 16px; }
.leg { grid-column: 2 / 4; display: flex; flex-wrap: wrap; gap: 6px; }
.field { display: flex; flex-direction: column; background: var(--fill); border-radius: 9px; padding: 4px 8px 5px; min-width: 64px; flex: 1; }
.field span { font-size: 10px; color: var(--label2); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.field input, .field select { border: 0; background: transparent; padding: 0; font-weight: 600; font-variant-numeric: tabular-nums; width: 100%; font-size: 15px; outline: none; }
.field.narrow { flex: 0 1 70px; }
.field a { font-size: 13px; color: var(--tint); font-weight: 600; text-decoration: none; padding-top: 2px; }
.leg-out { grid-column: 2 / 4; font-size: 12px; color: var(--label2); font-variant-numeric: tabular-nums; display: flex; gap: 12px; flex-wrap: wrap; }
.leg-out b { color: var(--label); font-weight: 600; }
.empty { text-align: center; color: var(--label2); padding: 26px 16px; font-size: 14px; }
.warnings { background: rgba(255, 159, 10, 0.12); color: var(--warn); border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-top: 0.5px solid var(--sep); font-size: 14px; }
.toggle-row:first-child { border-top: 0; }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--fill2); transition: background 200ms; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,0.15); transition: transform 260ms cubic-bezier(.3,1.3,.5,1); }
.switch input:checked + span { background: #34c759; }
.switch input:checked + span::after { transform: translateX(20px); }
.note { font-size: 12px; color: var(--label2); margin: 6px 4px 14px; line-height: 1.45; }
.note a { color: var(--tint); }

/* Navlog table (mirrors the FlyBy form) */
.nl-wrap { overflow-x: auto; border-radius: var(--r); border: 0.5px solid var(--sep); background: var(--glass); margin-bottom: 12px; }
table.nl { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; width: 100%; min-width: 720px; }
table.nl th { font-size: 10.5px; font-weight: 600; color: var(--label2); text-transform: uppercase; letter-spacing: 0.03em; padding: 6px 6px; text-align: center; border-bottom: 0.5px solid var(--sep); white-space: nowrap; background: var(--fill); }
table.nl td { padding: 3px 6px; text-align: center; white-space: nowrap; }
table.nl tbody tr.top td { padding-top: 7px; }
table.nl tbody tr.bot td { padding-bottom: 7px; border-bottom: 0.5px solid var(--sep); color: var(--label); }
table.nl td.wpt { text-align: left; font-weight: 600; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
table.nl td.muted { color: var(--label3); }
table.nl td.strong { font-weight: 700; }
table.nl tr.auto td.wpt { color: var(--label2); }
table.nl tr.std td.ete { color: var(--tint); }
.nl-head { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-bottom: 12px; }
.nl-head .field { min-width: 0; }

/* Map markers */
.wpt-marker { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--route); box-shadow: 0 2px 6px rgba(0,0,0,0.35); display: grid; place-items: center; font: 700 10px/1 var(--font); color: var(--route); }
.wpt-marker.alt { border-color: var(--alt); color: var(--alt); }
.wpt-marker.sel { transform: scale(1.25); }
.wpt-label { background: rgba(255,255,255,0.92); border-radius: 6px; padding: 2px 6px; font: 600 11px/1.3 var(--font); color: #111; box-shadow: 0 1px 4px rgba(0,0,0,0.25); white-space: nowrap; transform: translate(14px, -50%); display: inline-block; }
.mid-handle { width: 14px; height: 14px; border-radius: 50%; background: rgba(255,255,255,0.9); border: 2px solid var(--route); box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.mid-handle.alt { border-color: var(--alt); }
.pt-ad { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid #1d4fa8; background: rgba(255,255,255,0.85); }
.pt-vrp { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 12px solid #1d4fa8; filter: drop-shadow(0 0 1px #fff); }
.pt-label { font: 700 10px/1 var(--font); color: #1d4fa8; text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 2px #fff; white-space: nowrap; transform: translate(10px, -6px); display: inline-block; }
.tick { width: 8px; height: 8px; border-radius: 50%; background: var(--route); border: 1.5px solid #fff; }
.hat { background: rgba(255,255,255,0.94); border: 1.5px solid var(--route); border-radius: 7px; padding: 2px 6px; font: 700 10.5px/1.25 var(--font); color: #111; white-space: nowrap; display: inline-block; transform: translate(-50%, -140%); box-shadow: 0 1px 4px rgba(0,0,0,0.25); font-variant-numeric: tabular-nums; }
.hat.alt { border-color: var(--alt); }
.leaflet-popup-content-wrapper { border-radius: 14px; background: var(--glass-heavy); backdrop-filter: blur(30px); color: var(--label); box-shadow: var(--shadow); }
.leaflet-popup-tip { background: var(--glass-heavy); }
.leaflet-popup-content { margin: 12px 14px; font: 14px/1.4 var(--font); }
.pp-title { font-weight: 650; font-size: 15px; }
.pp-sub { color: var(--label2); font-size: 12px; margin-bottom: 8px; }
.pp-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pp-actions a { color: var(--tint); font-weight: 600; text-decoration: none; font-size: 13px; }

.toast-actions { display: flex; gap: 8px; margin-top: 8px; justify-content: center; }
.toast.ask { pointer-events: auto; }
.toast { position: fixed; top: calc(var(--safe-t) + 70px); left: 50%; transform: translateX(-50%); z-index: 2000; padding: 10px 16px; border-radius: 14px; font-size: 14px; font-weight: 500; max-width: 90vw; animation: pop 220ms ease-out; }

@media (max-width: 640px) {
  .brand-text, .brand-sub { display: none; }
  .pill.brand { padding: 0 10px; }
  .stat .v { font-size: 16px; }
  #btnPdf span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet.anim, .chip, .popover, .toast { transition: none; animation: none; }
}
@media print { body > *:not(#map) { display: none; } }
.leaflet-tooltip.wpt-tip { background: rgba(255,255,255,0.94); border: 0; border-radius: 7px; padding: 2px 7px; font: 650 11.5px/1.35 var(--font); color: #111; box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.leaflet-tooltip.wpt-tip::before { display: none; }
.field b { font-weight: 650; font-size: 15px; padding-top: 1px; }
.wp-sub a { color: var(--tint); text-decoration: none; font-weight: 600; }

/* ---------- Modes, M&B ---------- */
.modebar { padding: 0 16px 10px; flex: none; }
.modebar .segmented { min-width: 0; }
.row.wrap { gap: 6px; flex-wrap: wrap; }
.field.full { flex: 1 1 100%; }
table.mbt { min-width: 0; }
table.mbt td { text-align: right; padding: 8px 10px; }
table.mbt th { white-space: normal; padding: 6px 8px; }
table.mbt td { padding: 8px 8px; }
table.mbt td.wpt { text-align: left; max-width: none; }
table.mbt tr.total td { font-weight: 700; }
table.mbt tr.total.ok td:not(.wpt) { color: var(--ok); }
table.mbt tr.total.bad td:not(.wpt) { color: var(--bad); }
.narrow-only { }

/* ---------- Vertical profile ---------- */
.profile-dock { display: none; }
.profile-panel { height: 220px; border-radius: var(--r); background: var(--glass); border: 0.5px solid var(--sep); overflow: hidden; }
.profile-panel canvas, .profile-body canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: ns-resize; }
.note.warn, .profile-info.warn { color: var(--warn); }

.leg-out .tag { background: var(--fill2); color: var(--label); border-radius: 6px; padding: 1px 6px; font-weight: 600; }
.leg-out .hint { color: var(--warn); flex-basis: 100%; }
.pt-ad.minor { width: 10px; height: 10px; border-width: 2px; border-color: #5a6f9a; }

/* ---------- Time card (slim, top centre of the map area) ---------- */
:root { --panel-x: 12px; --dock-h: 0px; }
.timecard {
  position: fixed; z-index: 1000; top: calc(var(--safe-t) + 8px);
  /* centred in the space between the panel and the right column (logo pill + map buttons) */
  left: calc(var(--panel-x) + (100vw - var(--panel-x) - var(--rc-w, 76px) - 24px) / 2); transform: translateX(-50%);
  width: min(560px, calc(100vw - var(--panel-x) - var(--rc-w, 76px) - 36px));
  border-radius: 16px; padding: 4px 6px; display: flex; align-items: center; gap: 4px;
  transition: left 380ms cubic-bezier(.2,.9,.25,1), width 380ms cubic-bezier(.2,.9,.25,1);
}
.time-col { flex: 1; min-width: 0; display: grid; }
.time-label { background: none; border: 0; padding: 0 4px; text-align: left; display: flex; align-items: baseline; gap: 8px; cursor: pointer; white-space: nowrap; overflow: hidden; }
.time-main { font-size: 14px; }
.sun { font-size: 11px; color: var(--label2); display: inline-flex; gap: 8px; font-variant-numeric: tabular-nums; margin-left: auto; overflow: hidden; }
.timecard input[type=range] { height: 18px; }
.timecard input[type=range]::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -7px; }
.icon-btn.step { width: 30px; height: 30px; flex: none; }
.icon-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- Right column ---------- */
.rightcol { position: fixed; z-index: 1000; top: calc(var(--safe-t) + 8px); right: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.rightcol .brand { height: 40px; }
.popover { top: calc(var(--safe-t) + 60px); right: 64px; }
.plans-pop { width: 300px; max-height: 70vh; overflow: auto; }
.plan-item { display: flex; align-items: center; gap: 8px; padding: 8px 6px; border-radius: 10px; }
.plan-item:hover { background: var(--fill); }
.plan-item .grow { flex: 1; min-width: 0; cursor: pointer; }
.plan-item b { display: block; font-size: 14px; }
.plan-item small { color: var(--label2); font-size: 12px; }
.file-btn { position: relative; overflow: hidden; margin-top: 6px; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.plans-pop .btn.wide { margin-top: 6px; }

/* ---------- Plan bar (callsign, plans, update winds) ---------- */
.planbar { display: flex; align-items: center; gap: 6px; padding: 0 16px 10px; flex: none; }
.planbar .callsign { flex: 1; min-width: 0; padding: 3px 8px 4px; }
.planbar .callsign input { font-size: 14px; text-transform: uppercase; }

/* ---------- Wide layout: full-height left panel + bottom profile strip ---------- */
.panel-toggle { display: none; }
@media (min-width: 900px) {
  :root { --side-w: 400px; --panel-x: calc(var(--side-w) + 24px); --dock-h: 128px; }
  .panel-closed { --panel-x: 12px; }
  .profile-collapsed { --dock-h: 30px; }
  .sheet {
    left: 12px; right: auto; width: var(--side-w);
    top: calc(var(--safe-t) + 12px); bottom: calc(12px + var(--safe-b));
    height: auto; border-radius: 22px; border: 0.5px solid var(--glass-edge);
    transform: none; touch-action: auto;
    transition: transform 380ms cubic-bezier(.2,.9,.25,1), opacity 300ms;
  }
  .sheet-body { padding-bottom: calc(var(--safe-b) + 24px); }
  .panel-closed .sheet { transform: translateX(calc(-100% - 24px)); opacity: 0.4; pointer-events: none; }
  .panel-toggle {
    display: grid; place-items: center; position: fixed; z-index: 1001; cursor: pointer;
    top: calc(var(--safe-t) + 18px); left: calc(var(--panel-x) - 10px); width: 26px; height: 44px; border-radius: 13px;
    transition: left 380ms cubic-bezier(.2,.9,.25,1);
  }
  .panel-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 380ms; }
  .panel-closed .panel-toggle svg { transform: rotate(180deg); }
  .grabber { display: none; }
  .modebar { padding-top: 14px; }
  .summary { flex-wrap: wrap; row-gap: 8px; }
  .summary .btn { flex: 1 0 100%; }
  .tabs { flex-direction: column; gap: 8px; }
  .tabs .segmented { min-width: 0; width: 100%; }
  .narrow-only { display: none; }
  .profile-dock {
    display: flex; flex-direction: column; position: fixed; z-index: 950;
    left: var(--panel-x); right: 12px; bottom: calc(12px + var(--safe-b)); height: var(--dock-h);
    border-radius: 14px; border: 0.5px solid var(--glass-edge); overflow: hidden;
    transition: height 320ms cubic-bezier(.2,.9,.25,1), left 380ms cubic-bezier(.2,.9,.25,1);
  }
  .profile-head { display: flex; align-items: center; gap: 10px; padding: 0 4px 0 12px; height: 30px; flex: none; }
  .profile-title { font-weight: 650; font-size: 12px; }
  .profile-info { font-size: 11px; color: var(--label2); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
  .profile-dock .icon-btn { width: 26px; height: 26px; background: none; }
  .profile-dock .icon-btn svg { transition: transform 320ms cubic-bezier(.2,.9,.25,1); }
  .profile-dock.collapsed .icon-btn svg { transform: rotate(180deg); }
  .profile-body { flex: 1; min-height: 0; padding: 0 4px 4px; }
  .chip { left: calc(var(--panel-x) + (100vw - var(--panel-x)) / 2); bottom: calc(var(--dock-h) + 22px + var(--safe-b)); transition: left 380ms cubic-bezier(.2,.9,.25,1), bottom 320ms; }
  .leaflet-bottom { bottom: calc(var(--dock-h) + 12px); transition: bottom 320ms; }
  .leaflet-left { left: var(--panel-x); }
}
@media (max-width: 899px) {
  .profile-dock { display: none !important; }
  .timecard { left: 12px; transform: none; width: calc(100vw - 36px - var(--rc-w, 44px)); }
  .rightcol .brand-text, .rightcol .brand-sub { display: none; }
  .rightcol .brand { padding: 0 8px; width: 60px; justify-content: center; }
  .sun { display: none; }
}

/* ---------- Briefing ---------- */
.mono { font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.wx { padding: 10px 12px; border-top: 0.5px solid var(--sep); }
.wx:first-child { border-top: 0; }
.wx-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.wx-head b { font-size: 15px; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; letter-spacing: 0.02em; }
.badge.ok { background: rgba(52,199,89,0.16); color: var(--ok); }
.badge.bad { background: rgba(255,59,48,0.14); color: var(--bad); }
.badge.warn { background: rgba(255,159,10,0.16); color: var(--warn); }
.badge.muted { background: var(--fill); color: var(--label2); }
.issues { list-style: none; margin: 0 0 12px; padding: 0; }
.issues li { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border-radius: 12px; margin-bottom: 6px; font-size: 13.5px; line-height: 1.4; }
.issues li.bad { background: rgba(255,59,48,0.10); }
.issues li.warn { background: rgba(255,159,10,0.12); }
.issues li.info { background: var(--fill); }
.issues li .ic { font-weight: 800; flex: none; width: 16px; text-align: center; }
.issues li.bad .ic { color: var(--bad); } .issues li.warn .ic { color: var(--warn); } .issues li.info .ic { color: var(--label2); }
.copy-row { display: flex; justify-content: flex-end; padding: 0 12px 10px; }
.tem-row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-top: 0.5px solid var(--sep); font-size: 14px; }
.tem-row:first-child { border-top: 0; }
.tem-row input { accent-color: var(--tint); width: 18px; height: 18px; margin: 1px 0 0; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; }
.chips label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 15px; background: var(--fill); font-size: 13px; font-weight: 600; cursor: pointer; }
.chips input { accent-color: var(--tint); margin: 0; }
.alt-arrow { font-size: 11px; font-weight: 800; margin-left: 2px; }
.alt-arrow.up { color: var(--ok); } .alt-arrow.down { color: var(--tint); }

/* ---------- Map annotations ---------- */
.hat { font-size: 10px; padding: 1px 5px; border-width: 1px; border-radius: 5px; transform: translate(-50%, -180%); background: rgba(255,255,255,0.9); }
.cd-label { position: absolute; transform: translate(10px, -50%); background: #111; color: #fff; font: 800 10px/1 var(--font); padding: 3px 5px; border-radius: 4px; white-space: nowrap; letter-spacing: 0.03em; }
.cd-label.up::after, .cd-label.down::after { content: ""; }
.wind-arrow { position: absolute; transform: translate(-50%, 18px); display: flex; align-items: center; gap: 2px; pointer-events: none; }
.wind-arrow svg { width: 16px; height: 16px; transform: rotate(var(--r)); fill: none; stroke: #0a5bd8; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1.5px #fff); }
.wind-arrow span { font: 700 10px/1 var(--font); color: #0a5bd8; text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 2px #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.snap-ring { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 2.5px solid #34c759; background: rgba(52,199,89,0.15); }
.snap-label { position: absolute; transform: translate(16px, -50%); background: #34c759; color: #fff; font: 700 11px/1 var(--font); padding: 3px 6px; border-radius: 5px; white-space: nowrap; }
.wx.active { box-shadow: inset 3px 0 0 var(--tint); }
.field span { overflow-wrap: anywhere; }

/* ---------- Breathing room (roadmap 65) ---------- */
@media (min-width: 900px) { :root { --side-w: 430px; } }
.modebar, .planbar, .summary, .tabs { padding-left: 20px; padding-right: 20px; padding-bottom: 14px; }
.sheet-body { padding-left: 20px; padding-right: 20px; }
.group { margin-bottom: 20px; border-radius: 14px; }
.group-title { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; margin: 28px 4px 8px; }
.row, .toggle-row { padding: 12px 14px; min-height: 48px; }
.row.wrap { gap: 10px; }
.wp { padding: 12px 14px; gap: 8px 12px; }
.leg { gap: 8px; }
.wx { padding: 12px 14px; }
.wx-head { margin-bottom: 6px; }
.field { padding: 6px 10px 7px; border-radius: 10px; }
.field span { text-transform: none; letter-spacing: 0; font-size: 11px; font-weight: 500; }
.stat .k { text-transform: none; letter-spacing: 0; font-size: 12px; }
.note { margin: 8px 4px 22px; line-height: 1.5; }
.issues li { padding-top: 10px; padding-bottom: 10px; }
details.options > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; min-height: 48px; cursor: pointer; font-weight: 500; }
details.options > summary::-webkit-details-marker { display: none; }
details.options > summary::after { content: '›'; color: var(--label2); font-size: 20px; transform: rotate(90deg); transition: transform 200ms; }
details.options[open] > summary::after { transform: rotate(270deg); }
details.options[open] > summary { border-bottom: 0.5px solid var(--sep); }
.wxcharts { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 6px; }
.wxchart { margin: 0; }
.warn-text { color: var(--orange, #e0700a); }
.wxchart img { width: 100%; border-radius: 8px; background: var(--fill); min-height: 60px; display: block; }
.wxchart figcaption { font-size: 12px; color: var(--label2); margin-top: 4px; }
.wxchart figcaption a { color: var(--tint); }
.wxchart.failed img { display: none; }
.chart-pdf { font-size: 12.5px; margin-top: 6px; padding: 8px 10px; border-radius: 8px; line-height: 1.35; }
.chart-pdf.ok { color: var(--green, #1f9d55); background: rgba(52,199,89,0.12); }
.chart-pdf.no { color: var(--label); background: rgba(255,149,0,0.16); }
.wxchart.failed .chart-pdf { display: none; }
.wxchart.failed figcaption::before { content: 'Not available here — '; }

/* ---------- Guided steps (GUI rework, 11 Oct) ---------- */
:root { --c-mission: #7c4ddb; --c-plan: #d1009a; --c-mb: #0e9384; --c-brief: #e0700a; }
@media (prefers-color-scheme: dark) { :root { --c-mission: #a27bff; --c-plan: #ff4fc3; --c-mb: #2cc7b4; --c-brief: #ff9f40; } }
@media (min-width: 900px) { :root { --side-w: clamp(420px, 40vw, 640px); } }
.sheet { --accent: var(--tint); }
.sheet[data-mode=mission] { --accent: var(--c-mission); }
.sheet[data-mode=plan] { --accent: var(--c-plan); }
.sheet[data-mode=mb] { --accent: var(--c-mb); }
.sheet[data-mode=brief] { --accent: var(--c-brief); }
.sheet[data-mode=settings] { --accent: #636366; }
.sheet::before { content: ''; position: absolute; left: 22px; right: 22px; top: 0; height: 4px; border-radius: 0 0 4px 4px; background: var(--accent); opacity: 0.9; pointer-events: none; }
.sheet .btn.primary { background: var(--accent); }
.sheet .group-title { color: var(--accent); }
.sheet .group-title .btn { color: var(--label); }

.modebar { display: flex; align-items: center; gap: 8px; }
.steps { display: flex; flex: 1; gap: 4px; background: var(--fill); border-radius: 12px; padding: 3px; min-width: 0; }
.steps button { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: none; border-radius: 9px; height: 38px; padding: 0 6px; font-size: 13.5px; font-weight: 600; color: var(--label2); cursor: pointer; transition: background 180ms, color 180ms; }
.steps .num { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11.5px; font-weight: 800; background: var(--fill2); color: var(--label2); flex: none; }
.steps .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps button.on { background: var(--bg); color: var(--label); box-shadow: 0 3px 8px rgba(0,0,0,0.12); }
.steps button.on .num, .steps button.done .num { background: var(--c); color: #fff; }
.steps button.done:not(.on) .num { font-size: 0; }
.steps button.done:not(.on) .num::after { content: '✓'; font-size: 12px; }
@media (prefers-color-scheme: dark) { .steps button.on { background: #48484c; } }
.icon-btn.gear { width: 38px; height: 38px; border-radius: 11px; background: var(--fill); border: 0; display: grid; place-items: center; cursor: pointer; flex: none; color: var(--label2); }
.icon-btn.gear.on { background: #636366; color: #fff; }

.next-step { margin: 8px 0 18px; height: 48px; font-size: 15.5px; font-weight: 700; background: var(--c) !important; }
.group.pad, .pad { padding: 4px 4px; }
.group.pad > .row:first-child { padding-top: 10px; }

.howto { display: grid; gap: 8px; margin: 18px 0 4px; padding: 14px; border-radius: 14px; background: linear-gradient(135deg, rgba(124,77,219,0.10), rgba(224,112,10,0.10)); border: 0.5px solid var(--sep); font-size: 14px; }
.howto .n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--c); color: #fff; font-weight: 800; font-size: 12px; margin-right: 8px; }
.howto b { margin-right: 4px; }

.type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; }
.type-card { text-align: left; border: 1.5px solid var(--sep); background: var(--bg); border-radius: 12px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; transition: border-color 160ms, background 160ms; }
.type-card b { font-size: 14.5px; }
.type-card span { font-size: 12px; color: var(--label2); line-height: 1.35; }
.type-card.on { border-color: var(--c-mission); background: rgba(124,77,219,0.10); }
#msForm, #msSingle { padding: 0 10px 12px; }
#msForm .row, #msSingle .row { padding-left: 0; padding-right: 0; }

.leg-card .leg-no { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 12px; background: var(--c-plan); color: #fff; font-weight: 800; font-size: 12.5px; }
.leg-card .grow { flex: 1; }
.leg-card.active { box-shadow: inset 4px 0 0 var(--c-plan); background: rgba(209,0,154,0.06); }
.leg-actions { padding: 8px 0 0 !important; min-height: 0 !important; gap: 8px; display: flex; align-items: center; flex-wrap: wrap; }
.leg-actions .field.cs { flex: 0 1 150px; }
.leg-actions .field.cs input { text-transform: uppercase; }
.leg-actions .refuel { border: 0; padding: 4px 0; flex: 1; font-size: 13px; }

.step-card { border: 1.5px solid var(--c); background: color-mix(in srgb, var(--c) 8%, var(--glass)); }
.step-card .btn input { display: none; }

.sig-pad { width: 100%; height: 130px; display: block; border-radius: 10px; background: #fff; border: 1px dashed var(--sep); touch-action: none; cursor: crosshair; }
@media (prefers-color-scheme: dark) { .sig-pad { background: #f4f4f6; } }

a.btn { text-decoration: none; display: inline-flex; align-items: center; }
[data-set=callsign], [data-set=soloOut], [data-set=soloIn], #msCallsign, #callsignInput { text-transform: uppercase; }

/* HAT boxes: bigger, numbered per leg */
.hat { display: inline-flex !important; align-items: stretch; gap: 0; padding: 0 !important; border: 2px solid var(--route) !important; border-radius: 8px !important; overflow: hidden; font: 800 12.5px/1 var(--font) !important; transform: translate(-50%, -150%) !important; background: rgba(255,255,255,0.97) !important; box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important; }
.hat .hn { background: var(--route); color: #fff; padding: 5px 7px; display: grid; place-items: center; font-weight: 900; }
.hat .hv { padding: 5px 7px; border-left: 1px solid rgba(0,0,0,0.12); color: #111; }
.hat.alt { border-color: var(--alt) !important; }
.hat.alt .hn { background: var(--alt); }
#msForm .field.narrow { flex: 0 0 112px; }

/* Own chart: airspace labels and grid minimum altitudes (Rogers style) */
.as-edge { position: absolute; transform: translate(-50%, -50%) rotate(var(--a)); white-space: nowrap; font: 800 10.5px/1 var(--font); letter-spacing: 0.02em; text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff; pointer-events: none; }
.as-box { position: absolute; transform: translate(-50%, -50%); text-align: center; white-space: nowrap; font: 800 11px/1.25 var(--font); color: #cc2a2a; text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff; pointer-events: none; }
.ama { position: absolute; transform: translate(-50%, -50%); font: 900 34px/1 var(--font); color: rgba(205, 35, 35, 0.55); text-shadow: 0 0 2px rgba(255,255,255,0.6); pointer-events: none; }
.ama small { font-size: 20px; }

.nav-box { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; text-align: center; font: 700 10.5px/1.3 var(--font); color: #1d3f8f; background: rgba(255,255,255,0.88); border: 1.2px solid #1d3f8f; border-radius: 3px; padding: 2px 5px; pointer-events: none; }
.leg-out .minalt b { color: var(--ok); }
.leg-out .minalt.low b { color: var(--bad); }

/* ---------- Sheet view: the navlog as the LNAV Excel / VOFP form ---------- */
.nl-sheet { position: fixed; z-index: 1500; left: 0; top: 0; bottom: 0; width: 66vw; background: #f4f2ec; color: #111; display: flex; flex-direction: column; box-shadow: 4px 0 24px rgba(0,0,0,0.25); padding-top: var(--safe-t, 0px); }
body.sheet-full .nl-sheet { width: 100vw; }
@media (max-width: 900px) { .nl-sheet { width: 100vw; } }
body.sheet-open #sheet { visibility: hidden; }
.ss-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #fff; border-bottom: 1px solid #d6d2c8; flex-wrap: wrap; }
.ss-bar b { font-size: 16px; margin-right: 6px; }
.ss-bar .grow { flex: 1; }
.ss-bar .btn { color: #111; }
.ss-bar .btn.primary { color: #fff; }
.ss-scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 12px; }
.ss-form { min-width: min-content; }
.ss-grid { table-layout: fixed; width: 640px; }
.ss-grid col.c-nm { width: 122px; }
.ss-head td:not(.lb):not(.ttl) { min-width: 92px; }
.ss-head, .ss-grid { border-collapse: collapse; background: #fff; font: 600 12px/1.2 var(--font); color: #111; }
.ss-head { width: 100%; min-width: 900px; margin-bottom: 10px; }
.ss-head td { border: 1px solid #222; padding: 0 4px; height: 26px; }
.ss-head td.lb { font-weight: 700; white-space: nowrap; background: #f1f1f1; }
.ss-head td.ttl { font-weight: 800; text-align: center; font-size: 14px; letter-spacing: 0.03em; }
.ss-head td.tt { font-weight: 800; text-align: center; }
.ss-halves { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.ss-page + .ss-page { margin-top: 16px; }
.ss-pg { font: 700 12px var(--font); color: #555; margin: 4px 0; }
.ss-grid th { border: 1px solid #222; background: #e9e9e9; padding: 2px 3px; font-size: 10.5px; font-weight: 800; text-align: center; white-space: nowrap; }
.ss-grid td { border: 1px solid #222; padding: 0; height: 24px; text-align: center; overflow: hidden; }
.ss-grid tr.t td { border-bottom-color: #bbb; }
.ss-grid tr.b td { border-top-color: #bbb; }
.ss-grid tr.auto td { background: #fbfbf4; }
input.sc { width: 100%; min-width: 0; height: 100%; min-height: 23px; border: 0; background: transparent; text-align: center; font: inherit; color: inherit; padding: 0 3px; border-radius: 0; -webkit-appearance: none; }
input.sc:focus { outline: 2px solid #0a84ff; outline-offset: -2px; background: #eaf3ff; }
input.sc.nm { text-align: left; font-weight: 700; }
input.sc.b { font-weight: 800; }
input.sc.std { color: #0a5bd6; font-weight: 800; }
input.sc.h { text-align: left; }
input.sc.ov, .ov-key { background: #ffe7a8; }
.ss-head input.sc.ov { background: #ffe7a8; }
.ss-note { padding: 8px 12px 14px; font-size: 12.5px; color: #444; background: #fff; border-top: 1px solid #d6d2c8; }
.ov-key { padding: 0 4px; border-radius: 3px; }

.sheet-open-btn { margin-top: 8px; width: 100%; }

/* ---------- Colour and separation: you always see which step, tab and route you are working on ---------- */
:root { --c-tab-route: var(--c-plan); --c-tab-navlog: #5856d6; --c-tab-fuel: #c77c00; --c-tab-profile: #2e9d55; }
@media (prefers-color-scheme: dark) { :root { --c-tab-navlog: #8e8cff; --c-tab-fuel: #ffb340; --c-tab-profile: #4cd27a; } }
/* steps: the open one is tinted in its colour with a coloured underline */
.steps button.on { background: color-mix(in srgb, var(--c) 15%, var(--bg)); color: var(--c); box-shadow: inset 0 -3px 0 var(--c), 0 2px 6px rgba(0,0,0,0.10); }
.steps button:not(.on) .lbl { color: var(--label2); }
/* plan tabs, each with its own colour */
#tabs button[data-tab=route] { --c: var(--c-tab-route); }
#tabs button[data-tab=navlog] { --c: var(--c-tab-navlog); }
#tabs button[data-tab=fuel] { --c: var(--c-tab-fuel); }
#tabs button[data-tab=profile] { --c: var(--c-tab-profile); }
#tabs button.on, #routeSel button.on { background: color-mix(in srgb, var(--c) 16%, var(--bg)); color: var(--c); font-weight: 700; box-shadow: inset 0 -3px 0 var(--c); }
/* main pink / alternate blue, as on the map */
#routeSel button[data-route=main] { --c: var(--route); }
#routeSel button[data-route=alt] { --c: var(--alt); }
#routeSel button::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 0; }
/* the panel takes the colour of what is open */
.sheet[data-mode=plan][data-tab=navlog] { --accent: var(--c-tab-navlog); }
.sheet[data-mode=plan][data-tab=fuel] { --accent: var(--c-tab-fuel); }
.sheet[data-mode=plan][data-tab=profile] { --accent: var(--c-tab-profile); }
.sheet[data-mode=plan][data-route=alt]:not([data-tab=fuel]) { --accent: var(--alt); }
.sheet[data-mode=plan][data-route=alt]:not([data-tab=fuel]) .sheet-body::before {
  content: 'ALTERNATE ROUTE — you are editing the alternate'; display: block; margin: 2px 0 10px; padding: 7px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--alt) 14%, transparent); color: var(--alt); font: 800 12px/1.2 var(--font); letter-spacing: 0.03em; }
/* sections: coloured marker on each title, a tinted edge on each card, more air between them */
.sheet .group-title { color: var(--accent); font-weight: 700; }
.sheet .group-title > span:first-child::before { content: ''; display: inline-block; width: 4px; height: 14px; border-radius: 2px; background: var(--accent); margin-right: 8px; vertical-align: -2px; }
.sheet .group { border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--sep)); box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.sheet .group + .group-title { margin-top: 26px; }
.sheet .tabs { border-bottom: 1px solid color-mix(in srgb, var(--accent) 25%, var(--sep)); margin-bottom: 4px; }

.btn.icon-only { min-width: 38px; padding: 0 8px; font-size: 18px; font-weight: 700; }
.btn.icon-only:disabled { opacity: 0.35; }

ul.issues.tappable li { cursor: pointer; }
ul.issues.tappable li:active { filter: brightness(0.95); }
ul.issues li .go { margin-left: auto; padding-left: 8px; color: var(--label3, #999); font-size: 18px; line-height: 1; align-self: center; }
@keyframes flashbg { 0% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.flash { animation: flashbg 1.4s ease-out 2; border-radius: 12px; }

ul.ready-list li { cursor: pointer; }
ul.issues li.ok { background: rgba(52,199,89,0.10); }
ul.issues li.ok .ic { color: #1f9d55; }
ul.ready-list li b { font-weight: 700; }

/* compact route list */
.wp.compact { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; min-height: 48px; }
.wp.compact .wp-n { flex: none; }
.wp.compact .wp-cname { font-weight: 700; font-size: 15px; min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp.compact .wp-line { display: flex; gap: 10px; font-size: 13px; color: var(--label2); flex: none; font-variant-numeric: tabular-nums; }
.wp.compact .wp-line b { color: var(--label); }
.wp.compact .go { color: var(--label3, #999); font-size: 18px; }
.wp-flag { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--warn, #ff9f0a); color: #fff; font-weight: 900; font-size: 12px; }
.wp.open { box-shadow: inset 4px 0 0 var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
@media (max-width: 520px) { .wp.compact .wp-line span:nth-child(4) { display: none; } }

/* plan status */
.plan-status { padding: 0 20px 10px; font-size: 12.5px; color: var(--label2); line-height: 1.35; }
.plan-status b { color: var(--label); }
.plan-status .st.ok { color: #1f9d55; }
.plan-status .st.warn { color: var(--warn, #c77c00); font-weight: 600; }
.sheet:not([data-mode=plan]) .plan-status { display: none; }
/* recent messages */
#btnLog { position: relative; }
#btnLog.has-new::after { content: ''; position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: #ff3b30; }
.log-pop { max-height: 60vh; overflow: auto; width: 320px; }
.log-row { display: grid; grid-template-columns: 42px 1fr; gap: 6px; padding: 7px 4px; border-top: 0.5px solid var(--sep); font-size: 13px; line-height: 1.35; }
.toast { cursor: pointer; }
/* leg card */
.leg-popup .leaflet-popup-content { margin: 12px 14px; }
.leg-card-pop { --c: var(--route); font: 500 13px/1.3 var(--font); min-width: 230px; }
.leg-card-pop.alt { --c: var(--alt); }
.lc-title { font-weight: 800; font-size: 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.lc-n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 6px; background: var(--c); color: #fff; font-size: 12px; padding: 0 4px; }
.lc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 10px; margin-bottom: 8px; }
.lc-grid span { display: block; font-size: 10.5px; color: #777; text-transform: uppercase; letter-spacing: 0.03em; }
.lc-grid b { font-size: 15px; font-variant-numeric: tabular-nums; }
.lc-note { font-size: 12px; color: #555; margin-bottom: 6px; }
.bad-t { color: #d70015; }
.leg-card-pop .btn { width: 100%; background: var(--c); }
.hat { cursor: pointer; }
/* panel width handle (wide screens) */
.panel-resize { display: none; }
@media (min-width: 900px) {
  .panel-resize { display: block; position: fixed; z-index: 1002; top: calc(var(--safe-t) + 80px); bottom: calc(40px + var(--safe-b)); left: calc(12px + var(--side-w) - 5px); width: 10px; cursor: col-resize; touch-action: none; }
  .panel-resize::after { content: ''; position: absolute; left: 3px; top: 50%; width: 4px; height: 44px; margin-top: -22px; border-radius: 2px; background: var(--label3, #aaa); opacity: 0.55; }
  .panel-resize:hover::after, body.resizing .panel-resize::after { opacity: 1; background: var(--accent, #0a84ff); }
  .panel-closed .panel-resize { display: none; }
  body.resizing { user-select: none; }
  body.resizing .sheet { transition: none; }
}
#routeSel button { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; }
#routeSel button::before { flex: none; }

/* ---------- Compact planner header on wide screens: more room for the route ---------- */
@media (min-width: 900px) {
  .sheet .modebar { padding-top: 10px; padding-bottom: 8px; }
  .sheet .planbar { padding-bottom: 6px; }
  .planbar .callsign { padding: 2px 8px 3px; }
  .planbar .callsign span { font-size: 10.5px; }
  .planbar .callsign input { height: 22px; }
  .planbar .btn.small { height: 34px; }
  .plan-status { padding-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
  .sheet .summary { flex-wrap: nowrap; padding-bottom: 8px; gap: 10px; align-items: flex-end; }
  .sheet .summary .btn { flex: 0 0 auto; height: 36px; padding: 0 12px; font-size: 14px; }
  .sheet .stat .k { font-size: 11px; }
  .sheet .stat .v { font-size: 17px; }
  .sheet .tabs { flex-direction: row; flex-wrap: wrap; gap: 6px; padding-bottom: 8px; }
  .sheet .tabs #tabs { flex: 1 0 100%; }
  .sheet .tabs #routeSel { flex: 1 1 0; width: auto; min-width: 0; }
  .sheet .tabs .segmented button { height: 30px; }
  .sheet .tabs .sheet-open-btn { flex: 0 0 auto; width: auto; margin-top: 0; height: 34px; padding: 0 12px; }
  .sheet-open-btn .long { display: none; }
  .levelmode .row { padding-top: 6px; padding-bottom: 6px; }
  .sheet details.options > summary { padding-top: 12px; padding-bottom: 12px; }
  .sheet .group-title .btn.small { height: 28px; padding: 0 9px; font-size: 12.5px; }
  .sheet .group-title > span:first-child { white-space: nowrap; }
}

.wp.open [data-collapse] { cursor: pointer; }
.collapse-btn { font-size: 18px; font-weight: 800; line-height: 1; }

/* Accuracy notice (every app open) */
.startup-notice { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b)); background: rgba(0, 0, 0, 0.42); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sn-card { width: min(420px, 100%); max-height: 100%; overflow: auto; background: var(--glass-heavy); -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%); border: 0.5px solid var(--glass-edge); border-radius: 20px; box-shadow: var(--shadow); padding: 24px 22px 18px; color: var(--label); font-family: var(--font); text-align: center; animation: snIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.15); }
.sn-icon svg { width: 40px; height: 40px; fill: none; stroke: var(--warn); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sn-card h2 { margin: 8px 0 10px; font-size: 19px; font-weight: 700; }
.sn-card p { margin: 0 0 10px; font-size: 15px; line-height: 1.4; color: var(--label2); }
.sn-card p b { color: var(--label); }
.sn-btn { margin-top: 8px; width: 100%; min-height: 48px; border: 0; border-radius: 12px; background: var(--tint); color: #fff; font: 600 16px var(--font); cursor: pointer; }
.sn-btn:active { opacity: 0.8; }
@keyframes snIn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .sn-card { animation: none; } }

/* ---------- GUI pass (26 Oct): pinned actions, quieter help, clearer states ---------- */
/* Main action of each step pinned to the bottom of the panel, always reachable */
.action-bar { display: grid; gap: 8px; margin: 14px -16px 0; padding: 12px 16px 4px; }
.action-bar .next-step { margin: 0; }
.action-bar:empty { display: none; }
@media (min-width: 900px) {
  .action-bar {
    position: sticky; bottom: calc(-1 * (var(--safe-b) + 24px)); z-index: 5;
    margin: 18px -20px 0; padding: 12px 20px calc(var(--safe-b) + 24px);
    background: var(--sheet-solid); border-top: 0.5px solid var(--sep);
  }
}
/* Placeholders read as hints, never as values */
input::placeholder { text-transform: none; color: var(--label3, rgba(60,60,67,0.3)); font-style: italic; font-weight: 400; opacity: 1; }
/* Values that cannot be judged yet */
.stat .v.pending { color: var(--label2); }
.mb-hint { font-size: 12.5px; color: var(--warn); padding: 0 20px 10px; flex: none; }
.label .warn { color: var(--warn); font-weight: 600; }
.mb-hint[hidden] { display: none; }
.btn:disabled { opacity: 0.45; cursor: default; }
/* Mission progress in the step bar */
.steps button { position: relative; }
.steps .prog { position: absolute; top: -5px; right: -2px; font-size: 9.5px; font-weight: 800; padding: 1px 5px; border-radius: 8px; background: var(--c); color: #fff; font-variant-numeric: tabular-nums; line-height: 1.35; box-shadow: 0 0 0 2px var(--bg); }
.warnings.soft { background: rgba(255,159,10,0.12); color: var(--warn); }
.note.tight { margin: 0 4px 10px; }
.leg-card .btn.small:not(.primary) { background: var(--fill); }
/* Collapsible help */
.howto-wrap, details.info { margin: 10px 0 4px; }
.howto-wrap > summary, details.info > summary { list-style: none; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--label2); padding: 8px 4px; display: flex; align-items: center; gap: 6px; }
.howto-wrap > summary::-webkit-details-marker, details.info > summary::-webkit-details-marker { display: none; }
.howto-wrap > summary::before, details.info > summary::before { content: 'i'; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid currentColor; font: italic 700 11px/1 Georgia, serif; }
.howto-wrap .howto { margin-top: 4px; }
details.options .levelmode { padding: 4px 0; border-bottom: 0.5px solid var(--sep); }
/* Labelled map buttons */
.round.labelled { width: 60px; height: 52px; padding: 0; border-radius: 16px; grid-template-columns: 100%; grid-template-rows: auto auto; justify-items: center; gap: 2px; align-content: center; position: relative; overflow: hidden; }
.round.labelled svg { width: 20px; height: 20px; }
.round.labelled .cap { display: block; max-width: calc(100% - 4px); font-size: 9.5px; font-weight: 600; color: var(--label2); line-height: 1.1; text-align: center; white-space: nowrap; letter-spacing: -0.01em; }
#btnLog.has-new::after { top: 6px; right: 8px; }
.rightcol { align-items: flex-end; }
.popover { top: calc(var(--safe-t) + 60px); right: 72px; }
/* Profile strip stays closed until there is a route to show */
.profile-dock.no-route .icon-btn, .profile-dock.no-route #altStepBtn { visibility: hidden; }
.chip[hidden] { display: none; }

:root { --sheet-solid: #f6f6f8; }
@media (prefers-color-scheme: dark) { :root { --sheet-solid: #1b1b1f; } }
/* Time card: date + take-off on top, sun times on their own line under the slider */
.timecard .time-col { grid-template-areas: 'label' 'slider' 'sun'; }
.timecard .time-label { grid-area: label; }
.timecard input[type=range] { grid-area: slider; }
.timecard .sun { grid-area: sun; margin: 0 4px 1px; justify-content: space-between; display: flex; }
@media (max-width: 899px) { .timecard .sun { display: none; } }
/* the right column only catches taps on its own buttons, never on the chart around them */
.rightcol { pointer-events: none; }
.rightcol > * { pointer-events: auto; }

/* Feedback & feature requests (Settings) */
.fb .row + .row { margin-top: 8px; }
.fb-intro { margin: 0 2px 10px; line-height: 1.45; }
.field textarea { border: 0; background: transparent; padding: 2px 0 0; font: inherit; font-size: 15px; font-weight: 500; width: 100%; resize: vertical; min-height: 96px; outline: none; color: inherit; line-height: 1.4; }
.field textarea::placeholder, .field input::placeholder { font-weight: 400; }
.fb-ref { flex: 0 1 120px; min-width: 96px; }
.fb-check { margin-top: 6px; padding-left: 2px; }
.fb-info { font-size: 12px; line-height: 1.45; margin: 0 2px 4px; overflow-wrap: anywhere; }
.fb-problems { font-size: 13px; font-weight: 600; color: var(--warn); margin: 8px 2px 0; }
.fb-actions { margin-top: 12px; }
.fb-actions .btn { flex: 1 1 auto; }
.fb-sent { margin: 10px 2px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fb-contact { margin: 12px 2px 0; font-size: 13px; }
.fb-contact a { color: var(--tint); font-weight: 600; text-decoration: none; }

/* What's new (once per update) */
.startup-notice[hidden] { display: none; }
.wn-badge svg { width: 38px; height: 38px; fill: var(--tint); stroke: none; }
.wn-list { text-align: left; max-height: 52vh; overflow: auto; margin: 0 -4px 4px; padding: 0 4px; }
.wn-rel + .wn-rel { margin-top: 14px; padding-top: 12px; border-top: 0.5px solid var(--sep); }
.wn-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 15px; }
.wn-head span { font-size: 12px; color: var(--label2); white-space: nowrap; }
.wn-rel ul { margin: 6px 0 0; padding-left: 18px; }
.wn-rel li { font-size: 14.5px; line-height: 1.4; color: var(--label2); margin: 0 0 5px; }
.wn-link { margin-top: 10px; background: none; border: 0; color: var(--tint); font: 600 14px var(--font); cursor: pointer; padding: 6px; }
.fb-contact .btn { margin-right: 8px; }

/* "Start a new mission" — top of the Mission step, clearly marked */
details.new-mission { margin-top: 4px; border: 1px solid color-mix(in srgb, var(--c-mission) 45%, transparent); }
details.new-mission > summary { justify-content: flex-start; gap: 12px; }
details.new-mission > summary::after { margin-left: auto; }
.nm-plus { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 14px; display: grid; place-items: center; background: var(--c-mission); }
.nm-plus svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; }
.nm-text { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; }
.nm-text b { font-size: 15px; font-weight: 650; color: var(--c-mission); }
.nm-text span { font-size: 12.5px; color: var(--label2); font-weight: 400; }
