/* SkyHeading Web: the app's dark cockpit colours around the painters' own drawing. */
:root {
    --bg: #16181c;
    --panel: #1f2329;
    --raised: #272c34;
    --line: #353b45;
    --text: #e8ebf0;
    --muted: #8c95a3;
    --accent: #2f7de1;
    --accent-dim: #1d4f8f;
    --good: #3fb950;
    --warn: #e3a33b;
    --bad: #e5534b;
    --magenta: #d63fd6;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; }
a { color: #7fb3ff; }

header.top { display: flex; align-items: center; gap: 18px; height: 48px; padding: 0 16px;
    background: #0b0d10; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
header.top .brand { color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: 1px; white-space: nowrap; }
header.top .brand span { color: var(--accent); }
nav.sections { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
nav.sections a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; white-space: nowrap; font-size: 14px; }
nav.sections a:hover { color: var(--text); background: var(--panel); }
nav.sections a.active { color: #fff; background: var(--accent-dim); }
nav.sections a.later { opacity: .6; }
nav.sections a small { margin-left: 4px; font-size: 10px; text-transform: uppercase; color: var(--muted); }
.account-chip { display: flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; font-size: 14px; white-space: nowrap; }

main.page { padding: 16px; }
.narrow { max-width: 680px; margin: 0 auto; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-bottom: 14px; }
.card h2 { margin: 0 0 10px; font-size: 13px; color: #9fb4d3; text-transform: uppercase; letter-spacing: .6px; }
.card.gate { max-width: 560px; margin: 40px auto; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select { width: 100%; padding: 8px 10px; font-size: 15px; color: var(--text); background: var(--raised);
    border: 1px solid var(--line); border-radius: 6px; }
button, .button { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 8px 14px;
    font-size: 14px; cursor: pointer; text-decoration: none; margin: 10px 8px 0 0; }
button.plain, .button.plain { background: var(--raised); color: var(--text); border: 1px solid var(--line); }
button.danger { background: var(--bad); }
button.small { padding: 4px 10px; margin: 0; font-size: 13px; }
button:disabled { opacity: .5; cursor: default; }
.buttons { display: flex; flex-wrap: wrap; align-items: center; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td { padding: 7px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.right { text-align: right; white-space: nowrap; }
.muted { color: var(--muted); font-size: 13px; }
.error { color: var(--bad); margin-top: 10px; }
.big { font-size: 18px; font-weight: 600; }
.dev { margin-top: 10px; }
.dev button { margin: 4px 4px 0 0; }

/* The Plan tab: rows like the iPad's grouped table. */
.plan-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.segmented { display: inline-flex; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.segmented button { margin: 0; background: transparent; color: var(--muted); padding: 6px 14px; border-radius: 6px; }
.segmented button.on { background: var(--accent-dim); color: #fff; }
.search { max-width: 260px; }
.group { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; overflow: hidden; }
.group > .head { font-size: 12px; color: #9fb4d3; text-transform: uppercase; letter-spacing: .6px; padding: 10px 14px 4px; }
.group > .foot { font-size: 12px; color: var(--muted); padding: 6px 14px 10px; }
.row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--line); min-height: 44px; }
.group > .head + .row { border-top: 0; }
.row.tap { cursor: pointer; }
.row.tap:hover { background: var(--raised); }
.row .text { flex: 1; min-width: 0; }
.row .detail { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.row.dim .main { color: var(--muted); }
.row .check { color: var(--good); font-weight: 700; }
.row .chev { color: var(--muted); }
.row .del { background: transparent; color: var(--muted); border: 1px solid var(--line); margin: 0; padding: 3px 9px; font-size: 12px; }
.row .del:hover { color: #fff; background: var(--bad); border-color: var(--bad); }
.plan-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 16px; }
@media (max-width: 900px) { .plan-cols { grid-template-columns: minmax(0, 1fr); } }

/* Editor screens: the painters' canvases filling the window under a title bar. */
.screen { display: flex; flex-direction: column; height: calc(100vh - 48px - 32px); min-height: 420px; }
.screen-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.screen-bar h1 { font-size: 16px; margin: 0; flex: 1; }
.screen-bar button { margin: 0; }
.screen-status { color: var(--muted); font-size: 13px; padding: 6px 4px 0; min-height: 22px; }
.panes { flex: 1; display: grid; gap: 6px; min-height: 0; }
.panes.side { grid-template-columns: 55fr 45fr; }
.panes.stack { grid-template-rows: 60fr 40fr; }
.panes > * { min-width: 0; min-height: 0; }
.bar-pane { height: 84px; }
.bar-pane.tall { height: 104px; }
sky-canvas, .sky-canvas { display: block; position: relative; width: 100%; height: 100%; overflow: hidden;
    background: #101215; border-radius: 6px; touch-action: none; outline: none; }
.sky-canvas canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; transform-origin: 0 0; }
.map-wrap { position: relative; flex: 1; min-height: 0; }
.map-wrap .over-bottom { position: absolute; left: 0; right: 0; bottom: 0; }

/* Weather: the national map, then the airport cards. */
.wx-map { height: min(62vh, 640px); min-height: 360px; }
.wx-value { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

/* Preview Fly: HITS (WebGL2) with the HUD over it, the Map and Profile beside it. */
.preview { flex: 1; display: grid; grid-template-columns: minmax(0, 62fr) minmax(0, 38fr); gap: 6px; min-height: 0; }
.preview .hits { position: relative; min-height: 0; border-radius: 6px; overflow: hidden; background: #9ec2e6; }
.preview .hits canvas.gl, .preview .hits canvas.hud { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.preview-side canvas { width: 100%; height: 100%; display: block; background: #101215; border-radius: 6px; }
.fly-scrub { width: 160px; }
.preview .hits .sky-canvas { position: absolute; inset: 0; }
.sky-canvas.clear { background: transparent; }
.hits-message { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #1c2024;
    color: #dcdcdc; font-size: 15px; }
.preview-side { display: grid; grid-template-rows: 60fr 40fr; gap: 6px; min-height: 0; }
@media (max-width: 900px) { .preview { grid-template-columns: 1fr; grid-template-rows: 60fr 40fr; } .preview-side { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; } }

/* Menus (the shared MenuChoice lists) and dialogs. */
.veil { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: center; justify-content: center; }
.veil.clear { background: transparent; display: block; }
.menu { position: fixed; z-index: 60; min-width: 240px; max-width: min(440px, 92vw); max-height: 70vh; overflow-y: auto;
    background: var(--raised); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.5); padding: 4px 0; }
.menu .title { font-size: 12px; color: var(--muted); padding: 8px 14px 4px; text-transform: uppercase; letter-spacing: .5px; }
.menu .item { display: flex; gap: 8px; padding: 8px 14px; cursor: pointer; white-space: pre-wrap; }
.menu .item:hover { background: var(--accent-dim); }
.menu .item.off { color: var(--muted); cursor: default; }
.menu .item.off:hover { background: transparent; }
.menu .item.heading { color: var(--muted); font-size: 12px; cursor: default; padding-top: 10px; }
.menu .item.heading:hover { background: transparent; }
.menu .item .tick { width: 14px; color: var(--good); }
.menu .item .more { margin-left: auto; color: var(--muted); }
.menu .back { color: #7fb3ff; }
.dialog { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; width: min(440px, 92vw);
    box-shadow: 0 16px 40px rgba(0,0,0,.55); }
.dialog h3 { margin: 0 0 8px; font-size: 16px; }
.dialog p { margin: 0 0 6px; }
.dialog.wide { width: min(760px, 94vw); }
.sheet { max-height: 62vh; overflow-y: auto; font-size: 14px; line-height: 1.45; }
.sheet p { margin: 0 0 8px; }
.sheet .raw { margin-top: 12px; padding: 10px; background: #0d0f12; border-radius: 6px; font-family: ui-monospace, Consolas, monospace;
    font-size: 12.5px; color: #b9c2cf; white-space: pre-wrap; }
.keypad { background: #08080a; border-radius: 12px; overflow: hidden; box-shadow: 0 16px 40px rgba(0,0,0,.6); }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: 10px 16px; background: #5a1d1d; color: #fff; z-index: 100; }
#blazor-error-ui .reload { color: #fff; margin-left: 10px; }
