/* I Got This — tower & cockpit vernacular.
   Type: B612 (Airbus cockpit face) for prose, B612 Mono for data.
   Colour: cockpit semantics — amber = caution/available/selected, green = you, cyan = other pilots, red = warning. */
:root {
  --ink: #0B1016;
  --panel: rgba(16, 23, 32, 0.94);
  --panel-solid: #101720;
  --raised: #182230;
  --raised-2: #21303F;
  --hair: rgba(200, 220, 240, 0.10);
  --hair-strong: rgba(200, 220, 240, 0.22);
  --text: #E8EDF2;
  --muted: #8A96A3;
  --dim: #56616D;
  --amber: #FFB000;
  --amber-2: #FFC94D;
  --green: #5CE08A;
  --blue: #4D8DFF;
  --red: #FF4D4D;
  --live: #EEF2F6;
  --sans: 'B612', system-ui, -apple-system, sans-serif;
  --mono: 'B612 Mono', ui-monospace, Menlo, Consolas, monospace;
  --r-strip: 3px;
  --r-panel: 8px;
  --topbar: 52px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 13px/1.45 var(--sans); color: var(--text); background: var(--ink); overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.hidden { display: none !important; }
.dim { color: var(--dim); }
.spacer { flex: 1; }
.num { font-family: var(--mono); }

/* ── top bar ── */
#topbar { position: absolute; top: 0; left: 0; right: 0; height: var(--topbar); z-index: 1000; display: flex; align-items: center; gap: 18px; padding: 0 16px; background: rgba(11, 16, 22, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--hair); }
.brand { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand b { color: var(--amber); }
.brand .mark, .modal-brand .mark { color: var(--amber); display: inline-block; transform: rotate(-45deg); font-size: 15px; }
.search { position: relative; width: 320px; }
.search input { width: 100%; height: 32px; padding: 0 12px; border-radius: 4px; border: 1px solid var(--hair-strong); background: var(--raised); outline: none; }
.search input { -webkit-appearance: none; appearance: none; }
.search input::-webkit-search-decoration, .search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.search input::placeholder { color: var(--dim); }
.search input:focus { border-color: var(--amber); }
.dropdown { position: absolute; top: 38px; left: 0; right: 0; background: var(--panel-solid); border: 1px solid var(--hair-strong); border-radius: 4px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55); max-height: 340px; overflow-y: auto; }
.dropdown .row { display: flex; gap: 12px; align-items: baseline; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--hair); }
.dropdown .row:hover { background: var(--raised); }
.dropdown .row .k { font-family: var(--mono); color: var(--amber); min-width: 76px; font-weight: 700; }
.dropdown .row .d { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.readouts { display: flex; gap: 22px; align-items: baseline; white-space: nowrap; color: var(--muted); font-size: 12px; }
.readouts b { font-weight: 400; color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.readouts .led { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 7px; vertical-align: 0; box-shadow: 0 0 6px var(--green); }
.readouts .led.off { background: var(--red); box-shadow: 0 0 6px var(--red); }
.icon-btn { height: 30px; min-width: 30px; padding: 0 8px; border-radius: 4px; border: 1px solid var(--hair-strong); background: var(--raised); color: var(--muted); font-size: 12px; }
.icon-btn:hover { color: var(--text); }
.icon-btn.active { border-color: var(--amber); color: var(--amber); }
.me { display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 30px; border-radius: 4px; background: var(--raised); border: 1px solid var(--hair-strong); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; flex: none; }
.me .score { font-family: var(--mono); color: var(--amber); }

/* ── map ── */
#map-wrap { position: absolute; inset: var(--topbar) 0 0 0; overflow: hidden; background: var(--ink); }
#map { position: absolute; inset: 0; background: var(--ink); }
/* heading-up: the map is a square as big as the screen diagonal, centred, and rotated by minus your heading */
#map-wrap.hdgup #map { inset: auto; transform-origin: 50% 50%; will-change: transform; }
.leaflet-container { font-family: var(--sans); }
.leaflet-control-zoom { border: 1px solid var(--hair-strong) !important; border-radius: 4px !important; overflow: hidden; margin-bottom: 42px !important; }
.leaflet-control-zoom a { background: var(--panel-solid) !important; color: var(--text) !important; border-color: var(--hair) !important; width: 32px !important; height: 32px !important; line-height: 32px !important; }
.leaflet-control-zoom a:hover { background: var(--raised) !important; }
.leaflet-control-attribution { background: rgba(11, 16, 22, 0.75) !important; color: var(--dim) !important; font-size: 10px !important; margin-bottom: 26px !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.plane-canvas { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 450; }
.leaflet-container.plane-hover { cursor: pointer; }

/* ── columns ── */
.column { position: absolute; top: calc(var(--topbar) + 12px); bottom: 42px; width: 392px; z-index: 900; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.column > * { pointer-events: auto; }
#left { left: 12px; }
#right { right: 12px; width: 416px; gap: 8px; }
#detail { overflow-y: auto; min-height: 0; }
#detail::-webkit-scrollbar, .tab-body::-webkit-scrollbar, #chat-log::-webkit-scrollbar, .dropdown::-webkit-scrollbar { width: 6px; }
#detail::-webkit-scrollbar-thumb, .tab-body::-webkit-scrollbar-thumb, #chat-log::-webkit-scrollbar-thumb, .dropdown::-webkit-scrollbar-thumb { background: var(--raised-2); border-radius: 3px; }

/* board head: split-flap counter (click to collapse the board) */
.board-shell { border: 1px solid var(--hair); border-radius: var(--r-panel); background: var(--panel); backdrop-filter: blur(10px); }
.board-head { width: 100%; display: flex; align-items: center; gap: 14px; padding: 10px 14px; text-align: left; border-radius: var(--r-panel) var(--r-panel) 0 0; }
.board-head:hover { background: rgba(255, 255, 255, 0.03); }
.board-head .chev { margin-left: auto; color: var(--muted); font-size: 16px; transform: translateY(3px); transition: transform 0.2s; }
#left.collapsed .board-head .chev { transform: translateY(-2px) rotate(180deg); }
#left.collapsed .tab-body, #left.collapsed .tabs { display: none; }
#left.collapsed .board-head { border-radius: var(--r-panel); }
#left.collapsed { bottom: auto; }
.flap { display: flex; gap: 3px; perspective: 300px; }
.flap .t { position: relative; width: 24px; height: 34px; background: #05070A; border-radius: 3px; font: 700 23px/34px var(--mono); color: var(--amber); text-align: center; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07); transform-style: preserve-3d; }
.flap .t::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0, 0, 0, 0.9); }
.flap .t.flip { animation: flap 0.36s ease-in-out; }
@keyframes flap { 0% { transform: rotateX(0); } 50% { transform: rotateX(-88deg); } 100% { transform: rotateX(0); } }
.board-title { line-height: 1.25; }
.board-title b { display: block; font-size: 15px; font-weight: 700; }
.board-title span { color: var(--muted); font-size: 12px; }
.tabs { display: flex; padding: 0 6px; border-top: 1px solid var(--hair); }
.tab { height: 34px; padding: 0 10px; color: var(--muted); display: flex; align-items: center; gap: 8px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--amber); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--raised-2); color: var(--text); font: 700 11px/18px var(--mono); text-align: center; }
.tab-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; min-height: 0; perspective: 900px; }

/* ── board rows: one line per flight, click to open ── */
.rows { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--hair); border-radius: var(--r-strip); backdrop-filter: blur(10px); overflow: hidden; }
.row { position: relative; border-left: 5px solid var(--amber); border-bottom: 1px solid var(--hair); cursor: pointer; transform-origin: top center; }
.row:last-child { border-bottom: 0; }
.row.taken { border-left-color: var(--blue); }
.row.mine { border-left-color: var(--green); }
.row.done { border-left-color: var(--dim); opacity: 0.65; }
.row:hover { background: rgba(255, 255, 255, 0.03); }
.row.open { background: var(--raised); }
.row.enter { animation: strip-in 0.45s ease-out both; }
@keyframes strip-in { from { transform: rotateX(-75deg); opacity: 0; } to { transform: none; opacity: 1; } }
.row-main { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px; padding: 9px 12px 9px 11px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.row-main .t { font-size: 11px; }
.row-main .rt { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.row-main .rt b { font: 700 20px/1 var(--mono); color: var(--text); letter-spacing: -0.02em; }
.row-main .rt i { font-style: normal; color: var(--muted); transform: rotate(45deg); display: inline-block; font-size: 12px; }
.row-main .rt .no { margin-left: 8px; font-size: 12px; color: var(--muted); }
.row-main .pts { color: var(--amber); white-space: nowrap; }
.row.taken .row-main .pts, .row.done .row-main .pts { color: var(--muted); }
.row .prog { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; }
.row .prog i { display: block; height: 100%; width: var(--p, 0%); background: var(--blue); }
.row.mine .prog i { background: var(--green); }
.row-more { padding: 0 12px 12px 11px; font-size: 12.5px; color: var(--muted); }
.row-more .line1 { font-family: var(--mono); font-size: 11.5px; margin-bottom: 4px; }
.row-more .line1 b { color: var(--text); font-weight: 400; }
.row-more .reason { color: var(--text); }
.row-more .by { color: var(--blue); }
.row.mine .row-more .by { color: var(--green); }
.row.done .row-more .by.ok { color: var(--green); }
.row.done .row-more .by.bad { color: var(--red); }
.row .take { margin-top: 10px; width: 100%; height: 32px; border-radius: 3px; background: var(--amber); color: var(--ink); font-weight: 700; }
.row .take:hover { background: var(--amber-2); }
.row .take:disabled { background: transparent; border: 1px solid var(--hair-strong); color: var(--dim); cursor: default; }

/* ── lists (leaderboard / pilots) ── */
.list { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--hair); border-radius: var(--r-strip); }
.list:empty { display: none; }
.lrow { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--hair); }
.lrow:last-child { border-bottom: 0; }
.lrow .rank { font-family: var(--mono); color: var(--dim); }
.lrow .name { font-weight: 700; display: flex; align-items: center; gap: 8px; overflow: hidden; }
.lrow .sub { color: var(--muted); font-size: 11.5px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .pts { font-family: var(--mono); color: var(--amber); white-space: nowrap; }
.lrow.me .name { color: var(--green); }
.lrow.offline { opacity: 0.5; }
.lrow .flying { color: var(--blue); }
.empty { color: var(--muted); padding: 22px 16px; background: var(--panel); border-radius: var(--r-strip); border: 1px dashed var(--hair-strong); font-size: 12.5px; }

/* ── chat ── */
#chat { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--hair); border-radius: var(--r-strip); min-height: 180px; max-height: 42%; }
#chat-log { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
#chat-log .m .n { font-weight: 700; margin-right: 6px; }
#chat-log .ev { color: var(--muted); font-size: 11.5px; }
#chat-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--hair); }
#chat-form input { flex: 1; height: 30px; padding: 0 10px; border-radius: 3px; border: 1px solid var(--hair-strong); background: var(--raised); outline: none; }
#chat-form input:focus { border-color: var(--amber); }
#chat-form button { height: 30px; padding: 0 12px; border-radius: 3px; background: var(--raised-2); }

/* ── detail panel ── */
.dp { background: var(--panel); border: 1px solid var(--hair); border-radius: var(--r-panel); overflow: hidden; backdrop-filter: blur(10px); }
.dp-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--hair); }
.dp-head .t { flex: 1; min-width: 0; }
.dp-head .no { font: 700 19px/1.2 var(--mono); color: var(--amber); }
.dp-head .no .dim { font-weight: 400; font-size: 13px; }
.dp-head .no.player { color: var(--blue); }
.dp-head .no.me { color: var(--green); }
.sep { display: inline-block; width: 1px; height: 10px; background: var(--hair-strong); margin: 0 8px; vertical-align: -1px; }
.dp-head .al { color: var(--muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-head .close { width: 30px; height: 30px; border-radius: 3px; border: 1px solid var(--hair-strong); color: var(--muted); font-size: 16px; }
.dp-head .close:hover { color: var(--text); }
.dp-image { height: 150px; position: relative; overflow: hidden; background: radial-gradient(120% 90% at 30% 20%, #2C4560 0%, #131E2B 55%, #0B1016 100%); display: flex; align-items: center; justify-content: center; }
.dp-image svg { width: 200px; height: 200px; opacity: 0.92; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.6)); }
.dp-image.has-photo { background-size: cover; background-position: center; }
.dp-image.has-photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.78)); }
.dp-image .tname { position: absolute; left: 16px; bottom: 12px; color: #fff; font-weight: 700; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); z-index: 1; }
.dp-image .treg { position: absolute; right: 16px; bottom: 12px; color: var(--muted); font: 11.5px var(--mono); z-index: 1; }
.dp-route { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; padding: 16px; border-bottom: 1px solid var(--hair); }
.dp-route .ap { text-align: center; min-width: 0; }
.dp-route .ap .iata { font: 700 32px/1 var(--mono); letter-spacing: -0.02em; }
.dp-route .ap .city { font-size: 12.5px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-route .ap .sub { color: var(--muted); font-size: 11px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-route .mid { display: flex; align-items: center; justify-content: center; }
.dp-route .mid span { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--hair-strong); display: inline-flex; align-items: center; justify-content: center; color: var(--amber); transform: rotate(45deg); }
.dp-progress { padding: 12px 16px; border-bottom: 1px solid var(--hair); }
.dp-progress .bar { position: relative; height: 3px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.45) 0 8px, transparent 8px 14px); }
.dp-progress .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--amber); }
.dp-progress .bar .pl { position: absolute; top: 50%; transform: translate(-50%, -50%) rotate(45deg); color: #fff; font-size: 15px; text-shadow: 0 0 6px rgba(0, 0, 0, 0.9); }
.dp-progress .meta { display: flex; justify-content: space-between; color: var(--muted); font: 11.5px var(--mono); margin-top: 9px; }
.dp-grid { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--hair); }
.dp-grid .cell { padding: 9px 16px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; min-width: 0; border-bottom: 1px solid var(--hair); }
.dp-grid .cell:nth-child(odd) { border-right: 1px solid var(--hair); }
.dp-grid .cell.wide { grid-column: 1 / -1; border-right: 0; }
.dp-grid .cell:nth-last-child(1), .dp-grid .cell:nth-last-child(2):not(.wide) { border-bottom: 0; }
.dp-grid .cell label { color: var(--muted); font-size: 12px; white-space: nowrap; }
.dp-grid .cell b { font: 13px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-section { padding: 9px 16px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--hair); }
.dp-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.dp-actions button { height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11.5px; color: var(--text); border-right: 1px solid var(--hair); }
.dp-actions button:last-child { border-right: 0; }
.dp-actions button .ic { font-size: 15px; color: var(--muted); }
.dp-actions button:hover { background: var(--raised); }
.dp-actions button.active, .dp-actions button.active .ic { color: var(--amber); }
.dp-actions button.primary { background: var(--amber); color: var(--ink); font-weight: 700; }
.dp-actions button.primary .ic { color: var(--ink); }
.dp-actions button.primary:hover { background: var(--amber-2); }
.dp-actions button.danger, .dp-actions button.danger .ic { color: var(--red); }
.dp-note { padding: 9px 16px 12px; color: var(--dim); font-size: 11.5px; border-top: 1px solid var(--hair); }

/* ── HUD (instrument strip) ── */
#hud { position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%); width: min(860px, calc(100% - 880px)); min-width: 620px; z-index: 950; background: var(--panel); border: 1px solid var(--hair); border-radius: var(--r-panel); backdrop-filter: blur(10px); }
.fleet { background: var(--panel); border: 1px solid var(--hair); border-radius: var(--r-panel); backdrop-filter: blur(10px); flex: none; }
.fleet-head { display: flex; align-items: baseline; gap: 10px; padding: 10px 14px 6px; }
.fleet-head b { font-size: 14px; }
.fleet-head span { color: var(--muted); font-size: 12px; }
.fleet-list { display: flex; flex-direction: column; }
.fleet-list .fc { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; padding: 8px 14px 10px; border-top: 1px solid var(--hair); border-left: 4px solid var(--blue); color: var(--muted); font: 12px var(--mono); text-align: left; width: 100%; }
.fleet-list .fc b { color: var(--text); margin-right: 6px; }
.fleet-list .fc span { font-size: 11px; grid-column: 2; grid-row: 1; justify-self: end; }
.fleet-list .fc i { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--blue); }
.fleet-list .fc:hover { background: rgba(255, 255, 255, 0.03); }
.fleet-list .fc.active { border-left-color: var(--green); color: var(--text); }
.fleet-list .fc.active i { background: var(--green); }
.fleet-list .fc.active span { color: var(--green); }
.fleet-list .fc.hold { border-left-color: var(--amber); }
.fleet-list .fc.hold span { color: var(--amber); }
.fleet-list .fc.add { display: block; text-align: center; color: var(--amber); border-left-color: transparent; }
.gauge.risk b { color: var(--amber); }
.gauge .band { color: var(--amber); margin-left: 6px; text-transform: none; letter-spacing: 0; }
.gauge.risk .band { animation: blink 1s steps(2) infinite; }
.hud-top { display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-bottom: 1px solid var(--hair); }
.hud-flight { font-family: var(--mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.hud-flight b { color: var(--green); font-size: 14px; margin-right: 8px; }
.hud-phase { font: 11.5px var(--mono); color: var(--text); padding: 3px 9px; border-radius: 3px; background: var(--raised); white-space: nowrap; }
.hud-phase.warn { background: rgba(255, 77, 77, 0.18); color: var(--red); }
.hud-phase.good { background: rgba(92, 224, 138, 0.15); color: var(--green); }
.hud-score { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; display: flex; align-items: baseline; gap: 6px; }
.hud-score b { font-size: 16px; color: var(--amber); }
.hud-score .chip { padding: 1px 6px; border-radius: 3px; border: 1px solid var(--hair-strong); font-size: 11px; color: var(--text); }
.hud-score .chip.off { color: var(--dim); border-style: dashed; }
.hud-steer { display: flex; align-items: stretch; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--hair); }
.turn-btn { width: 56px; border-radius: 4px; border: 1px solid var(--hair-strong); color: var(--muted); font-size: 20px; }
.turn-btn:hover, .turn-btn.hot { background: var(--raised); color: var(--text); }
.turn-btn.want { border-color: var(--amber); color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber); }
.turn-btn.want:hover, .turn-btn.want.hot { background: var(--amber); color: var(--ink); }
.tape-wrap { flex: 1; position: relative; min-width: 0; }
#hdg-tape { display: block; width: 100%; height: 48px; border-radius: 3px; background: #05070A; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.turn-cue { position: absolute; right: 10px; bottom: 5px; font: 700 12px var(--mono); color: var(--amber); white-space: nowrap; pointer-events: none; }
.turn-cue.ok { color: var(--green); }
.hud-gauges { display: flex; flex-wrap: wrap; align-items: stretch; }
.gauge { flex: 1 1 90px; min-width: 90px; padding: 5px 12px; border-right: 1px solid var(--hair); display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.gauge label { color: var(--muted); font: 10.5px var(--mono); }
.gauge b { font: 700 20px/1.1 var(--mono); }
.gauge small { color: var(--muted); font: 10.5px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 100%; }
.gauge.bars { flex: 1.3 1 150px; min-width: 150px; gap: 1px; }
.thr-keys { float: right; display: inline-flex; gap: 3px; }
.thr-keys button { width: 22px; height: 16px; line-height: 14px; border-radius: 3px; border: 1px solid var(--hair-strong); color: var(--text); font: 700 13px var(--mono); }
.thr-keys button:hover, .thr-keys button.hot { background: var(--amber); color: var(--ink); border-color: var(--amber); }
.gauge.bars .bar { height: 5px; background: var(--raised-2); margin: 3px 0 5px; }
.gauge.bars .bar i { display: block; height: 100%; width: 0; background: var(--amber); }
.gauge.bars .bar i#hud-fuel { background: var(--green); }
.hud-btns { display: none; flex: 1.8 1 260px; display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 5px; padding: 8px 10px; }
.hud-phase.traffic { background: rgba(255, 77, 77, 0.25); color: var(--red); animation: blink 0.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.4; } }
.hud-btns button { height: 25px; border-radius: 3px; border: 1px solid var(--hair-strong); color: var(--muted); font-size: 11.5px; padding: 0 8px; }
.hud-btns button.active { color: var(--amber); border-color: var(--amber); }
.hud-btns button.danger { color: var(--red); }
.hud-btns .warp, .hud-btns .modes { grid-column: 1 / -1; display: flex; gap: 4px; }
.hud-btns .modes button { flex: 1; padding: 0; }
.hud-btns .modes button.active { background: var(--amber); color: var(--ink); border-color: var(--amber); }
#hud.easy .adv { display: none; }
.hud-btns .warp button { flex: 1; padding: 0; font-family: var(--mono); }
.hud-check { display: flex; flex-wrap: wrap; gap: 5px; padding: 6px 12px 0; }
.hud-check:empty { display: none; }
.hud-check .ck { font: 11.5px var(--mono); padding: 3px 9px; border-radius: 3px; border: 1px solid var(--hair-strong); color: var(--muted); }
.hud-check .ck.ok { color: var(--green); border-color: rgba(92, 224, 138, 0.6); }
.hud-check .ck.bad { color: var(--amber); border-color: rgba(255, 176, 0, 0.6); }
.hud-hint { padding: 6px 12px 7px; color: var(--amber); font-size: 12px; min-height: 14px; }
#keys-hint { font-size: 10.5px; }

/* ── toasts ── */
#toasts { position: absolute; top: calc(var(--topbar) + 12px); left: 50%; transform: translateX(-50%); z-index: 1200; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast { background: var(--panel-solid); border: 1px solid var(--hair-strong); border-left: 4px solid var(--amber); border-radius: 3px; padding: 9px 14px; font-size: 12.5px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); max-width: 520px; animation: toast-in 0.2s ease-out; }
.toast.good { border-left-color: var(--green); }
.toast.bad { border-left-color: var(--red); }
.toast.info { border-left-color: var(--blue); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ── bottom bar ── */
#bottombar { position: absolute; left: 0; right: 0; bottom: 0; height: 28px; z-index: 900; display: flex; align-items: center; gap: 14px; padding: 0 16px; font-size: 11px; color: var(--muted); background: rgba(11, 16, 22, 0.88); border-top: 1px solid var(--hair); }
.sw { display: inline-block; width: 9px; height: 9px; border-radius: 1px; margin: 0 5px 0 14px; vertical-align: -1px; }
.sw-live { background: var(--live); } .sw-player { background: var(--blue); } .sw-me { background: var(--blue); box-shadow: 0 0 0 2px var(--green); width: 7px; height: 7px; margin-right: 6px; } .sw-sel { background: var(--amber); }
#legend .sw:first-child { margin-left: 0; }
#shown-info { font-family: var(--mono); }

/* ── modals ── */
.modal { position: absolute; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; background: rgba(5, 8, 12, 0.72); backdrop-filter: blur(6px); }
.modal-card { width: 540px; max-width: calc(100% - 40px); background: var(--panel-solid); border: 1px solid var(--hair-strong); border-radius: var(--r-panel); padding: 26px 30px 28px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.modal-brand { font-size: 15px; font-weight: 700; margin-bottom: 18px; }
.modal-brand b { color: var(--amber); }
.modal-card h1 { font-size: 26px; line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.01em; }
.modal-card p { color: var(--muted); line-height: 1.55; margin: 0 0 20px; max-width: 46ch; }
.modal-card p.fine { margin: 20px 0 0; font-size: 12px; color: var(--dim); }
#join-form { display: flex; gap: 8px; }
#join-form input { flex: 1; height: 42px; padding: 0 14px; border-radius: 4px; border: 1px solid var(--hair-strong); background: var(--raised); outline: none; font-size: 14px; }
#join-form input:focus { border-color: var(--amber); }
#join-form button, #result-close { height: 42px; padding: 0 18px; border-radius: 4px; background: var(--amber); color: var(--ink); font-weight: 700; }
#join-form button:hover, #result-close:hover { background: var(--amber-2); }
.how { margin-top: 22px; display: grid; gap: 7px; color: var(--muted); font-size: 12.5px; }
.how b { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--hair-strong); color: var(--text); align-items: center; justify-content: center; margin-right: 8px; font: 700 11px var(--mono); }
.result-lines { display: flex; flex-direction: column; margin: 10px 0 14px; border: 1px solid var(--hair); border-radius: 3px; }
.result-lines .rl { display: flex; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--hair); color: var(--muted); }
.result-lines .rl:last-child { border-bottom: 0; }
.result-lines .rl b { font-family: var(--mono); color: var(--amber); }
.result-lines .rl b.neg { color: var(--red); }
.result-total { font: 700 26px var(--mono); color: var(--amber); margin-bottom: 18px; }
.result-total.bad { color: var(--red); }
#result-close { width: 100%; }

@media (max-width: 1500px) { #hud { width: min(860px, calc(100% - 40px)); } }
@media (max-width: 1100px) { .column { width: 340px; } #right { width: 360px; } .search { width: 220px; } }
@media (prefers-reduced-motion: reduce) { .strip.enter, .flap .t.flip, .toast { animation: none; } }


/* ── design round 3: fewer, grouped controls ── */
.live-pill { display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 15px; background: var(--raised); border: 1px solid var(--hair-strong); color: var(--muted); font-size: 12px; white-space: nowrap; }
.live-pill b { color: var(--text); font-weight: 400; font-variant-numeric: tabular-nums; }
.live-pill .led { margin: 0; }
.live-pill .clock { color: var(--dim); padding-left: 8px; border-left: 1px solid var(--hair-strong); }
.live-pill .clock b { color: var(--muted); }

#mapctl { position: absolute; right: 58px; bottom: 40px; z-index: 900; display: flex; align-items: center; gap: 6px; }
#mapctl > button, #mapctl .cam button { height: 30px; padding: 0 10px; border-radius: 4px; border: 1px solid var(--hair-strong); background: var(--panel-solid); color: var(--muted); font-size: 12px; white-space: nowrap; }
#mapctl button:hover { color: var(--text); }
#mapctl button.active { color: var(--amber); border-color: var(--amber); }
#mapctl .cam { display: flex; gap: 6px; margin-right: 6px; }
#mapctl .cam #cam-me { color: var(--green); }
#mapctl .cam #cam-dest { color: var(--amber); }
#right { bottom: 84px; }

.hud-top .spacer { flex: 1; }
.pillgroup { display: flex; border: 1px solid var(--hair-strong); border-radius: 13px; overflow: hidden; }
.pillgroup button { height: 24px; padding: 0 9px; font: 11.5px var(--mono); color: var(--muted); border-right: 1px solid var(--hair); }
.pillgroup button:last-child { border-right: 0; }
.pillgroup button.active { background: var(--amber); color: var(--ink); }
.pill-btn { height: 26px; padding: 0 12px; border-radius: 13px; border: 1px solid var(--amber); color: var(--amber); font-size: 12px; font-weight: 700; white-space: nowrap; }
.pts-pill { height: 26px; padding: 0 12px; border-radius: 13px; background: rgba(255, 176, 0, 0.12); color: var(--amber); font: 12px var(--mono); white-space: nowrap; }
.pts-pill b { font-size: 14px; }
.hud-mults { display: flex; flex-wrap: wrap; gap: 5px; padding: 6px 12px 0; justify-content: flex-end; font: 11px var(--mono); color: var(--muted); }
.hud-mults .chip { padding: 1px 7px; border-radius: 10px; border: 1px solid var(--hair-strong); color: var(--text); }
.hud-mults .chip.off { color: var(--dim); border-style: dashed; }
.pop-wrap { position: relative; }
.pop { position: absolute; right: 0; bottom: 34px; width: 340px; background: var(--panel-solid); border: 1px solid var(--hair-strong); border-radius: var(--r-panel); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6); padding: 8px; display: flex; flex-direction: column; gap: 4px; z-index: 5; }
.pop-title { font-weight: 700; padding: 4px 6px 6px; }
.pop .opt { display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; text-align: left; padding: 8px 10px; border-radius: 4px; border: 1px solid transparent; cursor: pointer; }
.pop .opt b { grid-column: 1; }
.pop .opt span { grid-column: 1; color: var(--muted); font-size: 12px; line-height: 1.35; }
.pop .opt em { grid-column: 2; grid-row: 1 / span 2; align-self: center; font: 700 12px var(--mono); font-style: normal; color: var(--amber); }
.pop .opt:hover { background: var(--raised); }
.pop .opt.active { border-color: var(--amber); background: rgba(255, 176, 0, 0.08); }
.pop .opt.toggle { grid-template-columns: auto 1fr auto; border-top: 1px solid var(--hair); border-radius: 0 0 4px 4px; margin-top: 4px; padding-top: 10px; }
.pop .opt.toggle input { grid-row: 1 / span 2; align-self: center; accent-color: var(--amber); width: 16px; height: 16px; }
.pop .opt.toggle b, .pop .opt.toggle span { grid-column: 2; }
.pop .opt.toggle em { grid-column: 3; }
.pop-keys { color: var(--dim); font-size: 11px; padding: 8px 10px 4px; border-top: 1px solid var(--hair); line-height: 1.5; }
.pop .abort { margin: 4px 6px 2px; height: 28px; border-radius: 4px; border: 1px solid rgba(255, 77, 77, 0.5); color: var(--red); font-size: 12px; }
.row-main .len { font: 11px var(--mono); color: var(--muted); }
.board-hint { padding: 8px 12px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--hair); }
.dp-cta { margin: 0 12px 12px; height: 40px; width: calc(100% - 24px); border-radius: 4px; background: var(--amber); color: var(--ink); font-weight: 700; font-size: 14px; }
.dp-cta:hover { background: var(--amber-2); }
.dp-cta:disabled { background: transparent; border: 1px solid var(--hair-strong); color: var(--dim); }
.dp-pills { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--hair); }
.dp-pills .p { padding: 3px 10px; border-radius: 12px; border: 1px solid var(--hair-strong); font: 12px var(--mono); color: var(--text); }
.dp-pills .p.pts { border-color: rgba(255, 176, 0, 0.6); color: var(--amber); }
.dp-pills .p.why { font-family: var(--sans); color: var(--muted); }
#hud { width: min(760px, calc(100% - 880px)); min-width: 600px; }
#bottombar #shown-info { margin-left: auto; }

body.flying #legend { display: none; }
.toast { max-width: 380px; }

/* altitude band ladder: a slim scale beside the number, green cruise band, red edges, a small marker */
.gauge.altg { flex-direction: row; align-items: stretch; gap: 10px; flex: 1.3 1 150px; padding-right: 10px; }
.alt-text { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.altbar { position: relative; width: 6px; margin: 4px 0; border-radius: 3px; background: var(--raised-2); flex: none; }
.altbar .z { position: absolute; left: 0; right: 0; }
.altbar .z.low { bottom: 0; border-radius: 0 0 3px 3px; background: repeating-linear-gradient(180deg, rgba(255, 77, 77, 0.55) 0 2px, transparent 2px 4px); }
.altbar .z.cruise { background: var(--green); border-radius: 3px; }
.altbar .z.high { top: 0; border-radius: 3px 3px 0 0; background: repeating-linear-gradient(180deg, rgba(255, 77, 77, 0.55) 0 2px, transparent 2px 4px); }
.altbar .mk { position: absolute; left: -7px; width: 0; height: 0; border: 5px solid transparent; border-left: 7px solid #fff; transform: translateY(5px); transition: bottom .2s linear; }
.altg.risk .altbar .mk { border-left-color: var(--red); }
.altg.cruise .altbar .mk { border-left-color: var(--green); }
.gauge .band { display: block; font: 10.5px var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.altg.cruise .band, .altg.cruise b { color: var(--green); }
.altg.risk .band, .altg.risk b { color: var(--red); }
.altg.risk .band { animation: blink 1s steps(2) infinite; }

#join-form { flex-wrap: wrap; }
#join-form input { min-width: 150px; }
.join-error { color: var(--red); font-size: 12.5px; min-height: 16px; margin-top: 8px; }
.modal-card p.fine.small { margin-top: 4px; }
.me #logout-btn { margin-left: 4px; color: var(--dim); font-size: 13px; padding: 0 2px; }
.me #logout-btn:hover { color: var(--text); }

.dp-modes { display: flex; align-items: center; gap: 6px; padding: 10px 16px 0; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.dp-modes button { height: 26px; padding: 0 12px; border-radius: 13px; border: 1px solid var(--hair-strong); color: var(--muted); font-size: 12px; }
.dp-modes button.active { background: var(--amber); color: var(--ink); border-color: var(--amber); }
.dp-modes em { font-style: normal; color: var(--dim); font-size: 11.5px; width: 100%; }

/* ── flight phases: stepper, step list, takeoff / approach gauges, banners ── */
#hud { position: absolute; }
.phases { display: flex; align-items: center; padding: 8px 12px 0; gap: 0; }
.phases .ph { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; position: relative; color: var(--dim); font: 10.5px var(--mono); letter-spacing: 0.02em; }
.phases .ph::before { content: ''; position: absolute; left: -50%; right: 50%; top: 5px; height: 2px; background: var(--raised-2); }
.phases .ph:first-child::before { display: none; }
.phases .ph i { width: 12px; height: 12px; border-radius: 50%; background: var(--raised-2); border: 2px solid var(--panel-solid); position: relative; z-index: 1; }
.phases .ph.done { color: var(--muted); }
.phases .ph.done i, .phases .ph.done::before { background: var(--green); }
.phases .ph.now { color: var(--text); font-weight: 700; }
.phases .ph.now i { background: var(--amber); box-shadow: 0 0 0 3px rgba(255, 176, 0, 0.25); }
.phases .ph.now::before { background: var(--green); }
.phase-card { margin: 8px 12px 0; padding: 8px 12px; border-radius: 6px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--hair); display: flex; gap: 14px; align-items: stretch; }
.phase-steps { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.phase-steps .st { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--muted); }
.phase-steps .st b { font-family: var(--mono); font-weight: 400; width: 14px; flex: none; color: var(--dim); }
.phase-steps .st.ok { color: var(--text); }
.phase-steps .st.ok b { color: var(--green); }
.phase-steps .st.now { color: var(--amber); }
.phase-steps .st.now b { color: var(--amber); }
.phase-steps .st em { font-style: normal; color: var(--dim); font-size: 11px; margin-left: auto; white-space: nowrap; }
.phase-steps .st kbd { font: 11px var(--mono); padding: 0 5px; border: 1px solid var(--hair-strong); border-radius: 3px; color: var(--text); }
.phase-gauge { display: flex; gap: 14px; flex: none; }
.phase-gauge label { display: block; color: var(--muted); font: 10.5px var(--mono); margin-bottom: 4px; }
.phase-gauge small { display: block; color: var(--muted); font: 10.5px var(--mono); margin-top: 4px; white-space: nowrap; }
.phase-gauge .track { position: relative; width: 170px; height: 8px; background: var(--raised-2); border-radius: 4px; }
.phase-gauge .track .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--amber); border-radius: 4px; }
.phase-gauge .track .window { position: absolute; top: 0; bottom: 0; background: rgba(92, 224, 138, 0.55); border-radius: 4px; }
.phase-gauge .track .mark { position: absolute; top: -4px; width: 2px; height: 16px; background: #fff; transform: translateX(-1px); }
.phase-gauge .track .mark.v { background: var(--green); }
.gs-col { display: flex; flex-direction: column; }
.ladder { position: relative; width: 170px; height: 44px; background: var(--raised-2); border-radius: 4px; }
.ladder .zone { position: absolute; left: 0; right: 0; top: 50%; height: 10px; transform: translateY(-50%); background: rgba(92, 224, 138, 0.35); }
.ladder::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(255, 255, 255, 0.5); }
.ladder .diamond { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: var(--amber); font-size: 16px; transition: top .2s linear; }
.ladder .diamond.ok { color: var(--green); }
.hud-banner { position: absolute; left: 50%; top: -58px; transform: translate(-50%, 0); padding: 8px 22px; border-radius: 8px; background: rgba(11, 16, 22, 0.92); border: 1px solid var(--amber); color: var(--amber); font: 700 20px var(--mono); letter-spacing: 0.08em; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; white-space: nowrap; }
.hud-banner.show { opacity: 1; transform: translate(-50%, -8px); }
.hud-banner.good { border-color: var(--green); color: var(--green); }
.hud-banner.bad { border-color: var(--red); color: var(--red); }
@media (prefers-reduced-motion: reduce) { .hud-banner { transition: none; } }

/* ── phase panel at the top, HUD stays small at the bottom ── */
#phasebar { position: absolute; top: calc(var(--topbar) + 12px); left: 50%; transform: translateX(-50%); width: min(640px, calc(100% - 880px)); min-width: 520px; z-index: 950; background: var(--panel); border: 1px solid var(--hair); border-radius: var(--r-panel); backdrop-filter: blur(10px); padding: 0 0 8px; }
#phasebar .phases { padding: 10px 14px 0; }
#phasebar .phase-card { margin: 8px 10px 0; }
#phasebar .hud-banner { top: auto; bottom: -56px; transform: translate(-50%, 0); }
#phasebar .hud-banner.show { transform: translate(-50%, 8px); }
/* toasts: top centre on the radar; while flying the top belongs to the phase panel, so they move to the bottom left, above the folded board */
body.flying #toasts { top: auto; bottom: 44px; left: 12px; transform: none; align-items: flex-start; }
body.flying #left.collapsed { bottom: auto; }
@media (max-width: 1500px) { #phasebar { width: min(640px, calc(100% - 40px)); } }

/* ── score card, top right: projected points, difficulty, live +/- deltas ── */
.scorecard { position: relative; background: var(--panel); border: 1px solid var(--hair); border-radius: var(--r-panel); backdrop-filter: blur(10px); padding: 10px 14px 10px; flex: none; }
.sc-top { display: flex; align-items: center; gap: 12px; }
.sc-pts { display: flex; flex-direction: column; line-height: 1.1; flex: 1; }
.sc-pts b { font: 700 28px var(--mono); color: var(--amber); }
.sc-pts span { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.scorecard .pop { top: 34px; bottom: auto; right: 0; }
.scorecard .hud-mults { justify-content: flex-start; padding: 8px 0 0; }
/* score deltas float just below the card, out over the map, newest on top */
.sc-floats { position: absolute; right: calc(100% + 12px); top: calc(100% - 4px); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; z-index: 70; }
.sc-float { font: 700 18px var(--mono); padding: 4px 12px; border-radius: 12px; background: rgba(11, 16, 22, 0.96); border: 1px solid var(--hair-strong); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); white-space: nowrap; animation: sc-float 3s ease-out forwards; }
.sc-float.up { color: var(--green); border-color: rgba(92, 224, 138, 0.6); }
.sc-float.down { color: var(--red); border-color: rgba(255, 77, 77, 0.6); }
.sc-float small { font-weight: 400; color: var(--muted); margin-left: 8px; font-size: 12px; }
@keyframes sc-float { 0% { opacity: 0; transform: translateY(-10px) scale(0.9); } 12% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .sc-float { animation-duration: 0.01s; } }

/* ── profile / logbook ── */
.me { cursor: pointer; }
.me:hover { border-color: var(--amber); }
/* hero: name, rank, points and the road to the next rank */
.pr-hero { position: relative; padding: 22px 16px 16px; text-align: center; border-bottom: 1px solid var(--hair); background: radial-gradient(120% 90% at 50% 0%, rgba(92, 224, 138, 0.10), transparent 60%); }
.pr-hero .close { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 3px; border: 1px solid var(--hair-strong); color: var(--muted); font-size: 16px; }
.pr-hero .close:hover { color: var(--text); }
.pr-wings { font-size: 22px; color: var(--green); opacity: 0.9; }
.pr-name { font: 700 24px/1.15 var(--mono); color: var(--green); margin-top: 4px; word-break: break-word; }
.pr-rank { margin-top: 4px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber); }
.pr-pts { margin-top: 10px; font-size: 13px; color: var(--muted); }
.pr-pts b { font: 700 32px/1 var(--mono); color: var(--text); margin-right: 4px; letter-spacing: -0.01em; }
.pr-prog { height: 4px; margin: 12px 24px 0; border-radius: 2px; background: var(--raised-2); overflow: hidden; }
.pr-prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--amber), var(--green)); border-radius: 2px; }
.pr-next { margin-top: 8px; font-size: 11px; color: var(--dim); }
/* stat tiles */
.pr-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--hair); border-bottom: 1px solid var(--hair); }
.pr-tile { background: var(--panel); padding: 12px 12px 10px; min-width: 0; }
.pr-tile b { display: block; font: 700 20px/1.1 var(--mono); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-tile.text b { font-size: 14px; line-height: 1.3; min-height: 22px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pr-tile.good b { color: var(--green); }
.pr-tile.amber b { color: var(--amber); }
.pr-tile span { display: block; margin-top: 4px; font-size: 11px; line-height: 1.3; color: var(--muted); }
/* landing quality bar */
.pr-landings { border-bottom: 1px solid var(--hair); padding-bottom: 12px; }
.pr-landings .dp-section { border-bottom: 0; }
.pr-bar { display: flex; height: 10px; margin: 0 16px; border-radius: 5px; overflow: hidden; gap: 2px; }
.pr-bar i, .pr-legend i { background: var(--raised-2); }
.pr-bar i.butter, .pr-legend i.butter { background: var(--green); }
.pr-bar i.smooth, .pr-legend i.smooth { background: #9fe3b4; }
.pr-bar i.firm, .pr-legend i.firm { background: var(--amber); }
.pr-bar i.hard, .pr-legend i.hard { background: #ff8a3d; }
.pr-bar i.rough, .pr-legend i.rough { background: #ff6a4d; }
.pr-bar i.lost, .pr-legend i.lost { background: var(--red); }
.pr-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 16px 0; font: 11px var(--mono); color: var(--muted); }
.pr-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }
/* logbook rows: date · route · result · points */
.logbook { display: flex; flex-direction: column; max-height: 46vh; overflow-y: auto; }
.logbook .lg { display: grid; grid-template-columns: 44px 1fr auto 58px; gap: 10px; align-items: center; padding: 9px 16px; border-bottom: 1px solid var(--hair); font-size: 12px; }
.logbook .lg:hover { background: rgba(255, 255, 255, 0.025); }
.logbook .lg .t { color: var(--dim); font: 11px var(--mono); white-space: nowrap; }
.logbook .lg .rt { min-width: 0; }
.logbook .lg .rt b { font: 700 13px var(--mono); }
.logbook .lg .rt i { font-style: normal; color: var(--dim); margin: 0 5px; }
.logbook .lg .rt small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logbook .lg .q { text-align: right; white-space: nowrap; }
.logbook .lg .q em { display: inline-block; font: 11px var(--mono); font-style: normal; padding: 2px 7px; border-radius: 9px; border: 1px solid var(--hair-strong); color: var(--muted); }
.logbook .lg .q small { display: block; color: var(--dim); font: 10px var(--mono); margin-top: 3px; }
.logbook .lg .p { text-align: right; font: 700 13px var(--mono); color: var(--amber); white-space: nowrap; }
.logbook .lg.butter .q em { color: var(--green); border-color: rgba(92, 224, 138, 0.5); }
.logbook .lg.smooth .q em { color: #9fe3b4; border-color: rgba(159, 227, 180, 0.45); }
.logbook .lg.hard .q em, .logbook .lg.rough .q em { color: #ff8a3d; border-color: rgba(255, 138, 61, 0.5); }
.logbook .lg.lost .q em { color: var(--red); border-color: rgba(255, 77, 77, 0.5); }
.logbook .lg.lost .p { color: var(--red); }
.logbook .lg.lost .rt b { color: var(--muted); }
.logbook .empty { padding: 18px 16px; color: var(--dim); font-size: 12px; }

/* nose attitude in the V/S gauge: a tiny aircraft against a horizon line, tilted by the flight-path angle (exaggerated ×2) */
.gauge.nose { flex: 1.3 1 150px; min-width: 150px; }
.nose-row { display: flex; align-items: center; gap: 8px; }
.nose-h { position: relative; width: 30px; height: 20px; flex: none; }
.nose-h::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(255, 255, 255, 0.35); }
.nose-h svg { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; transform-origin: center; transition: transform .15s linear; }

.gauge.spdg { flex: 1.2 1 140px; }

/* ── QA round: widths that never collide, popover on top, scrolling board ── */
:root { --colw: 400px; }
.column { width: var(--colw); }
#right { width: var(--colw); }
#detail { width: auto; }
#phasebar { width: min(640px, calc(100% - 2 * var(--colw) - 72px)); min-width: 440px; }
#hud { width: min(760px, calc(100% - 2 * var(--colw) - 72px)); min-width: 520px; }
#scorecard { position: relative; z-index: 3; }
#scorecard .pop { z-index: 60; }
#tab-flights { overflow-y: auto; }
.rows { overflow: visible; }
.rows .row:first-child { border-radius: var(--r-strip) var(--r-strip) 0 0; }
.rows .row:last-child { border-radius: 0 0 var(--r-strip) var(--r-strip); }
.gauge.spdg, .gauge.altg { flex: 1.3 1 160px; min-width: 160px; }
.phase-steps .st { font-size: 12px; }
.phase-steps .st em { max-width: 48%; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1500px) { :root { --colw: 352px; } }
@media (max-width: 1300px) { :root { --colw: 320px; } #phasebar { min-width: 400px; } #hud { min-width: 480px; } .search { width: 200px; } }

/* ── radio: its own card at the bottom of the left column ── */
.radiopanel { flex: none; border: 1px solid var(--hair); border-radius: var(--r-panel); background: var(--panel); backdrop-filter: blur(10px); padding: 10px 12px 10px; display: flex; flex-direction: column; gap: 6px; }
.rp-head { display: flex; align-items: center; gap: 10px; }
.rp-power { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 10px 0 8px; border-radius: 13px; border: 1px solid var(--hair-strong); color: var(--muted); font: 700 12px var(--mono); }
.rp-power .rp-ico { font-size: 14px; }
.radiopanel.on .rp-power { color: var(--amber); border-color: var(--amber); }
.rp-head #radio-lock { margin-left: auto; height: 26px; padding: 0 9px; border-radius: 13px; border: 1px solid var(--hair-strong); color: var(--muted); font-size: 12px; }
.rp-head #radio-lock.on { color: var(--amber); border-color: var(--amber); }
.radiopanel.off #radio-lock { display: none; }
.rp-head #radio-next { margin-left: 0; height: 26px; padding: 0 9px; border-radius: 13px; border: 1px solid var(--hair-strong); color: var(--muted); }
.rp-head #radio-next:hover { color: var(--text); }
.radiopanel.off #radio-next, .radiopanel.off .rp-signal, .radiopanel.off .rp-foot { display: none; }
.rp-signal { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.rp-signal i { width: 3px; background: var(--amber); border-radius: 1px; animation: rp-bar 1.1s ease-in-out infinite; height: 40%; opacity: 0.9; }
.rp-signal i:nth-child(2) { animation-delay: 0.2s; } .rp-signal i:nth-child(3) { animation-delay: 0.4s; } .rp-signal i:nth-child(4) { animation-delay: 0.6s; }
@keyframes rp-bar { 0%, 100% { height: 30%; } 50% { height: 100%; } }
.radiopanel.paused .rp-signal i { animation: none; height: 30%; opacity: 0.4; }
.rp-body { min-width: 0; line-height: 1.3; }
.rp-body b { display: block; font: 700 14px var(--mono); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radiopanel.off .rp-body b { color: var(--muted); font-weight: 400; }
.rp-body small { display: block; color: var(--dim); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-foot { display: flex; align-items: center; gap: 10px; }
.rp-vol { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.rp-vol input[type=range] { width: 90px; accent-color: var(--amber); }
.rp-near { margin-left: auto; color: var(--dim); font: 11px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* flying toasts sit above the radio card */
body.flying #toasts { bottom: 44px; }
body.flying.radio-on #toasts { bottom: 160px; }
/* sound toggle in the bottom bar */
.sfx-btn { height: 22px; padding: 0 8px; border-radius: 11px; border: 1px solid transparent; color: var(--muted); font-size: 13px; margin-right: 6px; }
.sfx-btn:hover { border-color: var(--hair-strong); color: var(--text); }
.sfx-btn.muted { opacity: 0.55; }

/* ── weather below: a quiet full-screen layer between the map and the panels ── */
#wx { position: absolute; top: var(--topbar); left: 0; width: 100%; height: calc(100% - var(--topbar)); display: block; pointer-events: none; z-index: 600; }
.wx-chip { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; padding: 2px 8px; border-radius: 10px; border: 1px solid transparent; color: var(--muted); font: 11px var(--mono); background: transparent; }
.wx-chip:hover { border-color: var(--hair-strong); color: var(--text); }
.wx-chip.off { opacity: 0.5; text-decoration: line-through; }
.wx-chip #wx-icon { font-size: 12px; }

/* radio: countdown before an automatic switch */
.rp-switch { display: flex; flex-direction: column; gap: 5px; padding: 6px 8px; border-radius: 6px; background: rgba(255, 176, 0, 0.08); border: 1px solid rgba(255, 176, 0, 0.35); }
.rp-switch-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text); }
.rp-switch-row span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-switch-row button { height: 22px; padding: 0 9px; border-radius: 11px; border: 1px solid var(--amber); color: var(--amber); font: 700 11px var(--mono); white-space: nowrap; }
.rp-switch-row button:hover { background: rgba(255, 176, 0, 0.15); }
.rp-switch-track { height: 4px; border-radius: 2px; background: var(--raised-2); overflow: hidden; }
.rp-switch-track i { display: block; height: 100%; width: 100%; background: var(--amber); transition: width 0.2s linear; }
.radiopanel.locked .rp-power { border-style: dashed; }

/* feedback note in the bottom bar */
#bottombar .feedback { color: var(--dim); font-size: 11px; margin-right: 14px; text-decoration: none; white-space: nowrap; }
#bottombar .feedback:hover { color: var(--amber); }
@media (max-width: 1250px) { #bottombar .feedback { display: none; } }
