/* The strip board, drawn as the EHAM handoff's mockup (docs/plans/radio-and-runways.md): a 68 pt
   header with the position tabs, a 64 pt identity row, and edge-to-edge columns that share the width
   and scroll on their own. Dark unless the controller says otherwise, and never by the device's preference: it is worked beside
   a radar scope in a room kept dim, and a board that turns white because the iPad decided it is daytime
   is a board nobody can look at. The light board is at the end of this file. Every colour is a token so
   a state cannot be spelled two ways.

   Sized for a 13-inch iPad Pro in landscape, 1376 x 1032 pt: nothing tappable is under 44 px. */

/* A sheet drawn from inside the board (the layout editor's) is dark like every other sheet, whatever
   the board is: it takes the whole set again and not the light board's it would inherit. */
:root, .board .sheet {
    color-scheme: dark;

    --bg: #0b1013;
    --header: #0f161a;
    --col: #131a1f;
    --col-rwy: #121b22;
    /* The bars across a column: clearly lighter than the rack they lie on, or a dark board is one tone throughout. */
    --col-head: #202c35;
    --line: #243038;
    --line-soft: #1f2a31;
    --edge: #2b3942;
    /* The line round a column's rack: white on the light board, and only a shade up on the dark one, where white would glare. */
    --rack-edge: #33434d;
    --text: #e3eaee;
    --muted: #8fa2ad;
    --muted-2: #9aabb5;
    --dim: #5a6870;

    --good: #3ecf8e;
    --warn: #ffb020;
    --bad: #d9483b;
    --accent: #5cc8ff;

    /* Strips: a departure is blue and an arrival amber, on the band and the body both. */
    --dep: #2f7ac0;
    --dep-body: #1c3347;
    --arr: #e0a33a;
    --arr-body: #362d1b;
    --plain-body: #1d2833;
    /* VFR, circuits and local IFR: red, and darker than --bad so a finding still stands out on it. */
    --local: #b8322b;
    --local-body: #3a1d1f;
    --calling: #ffb020;

    /* A button at rest and switched off: tokens, so the light board changes them without out-ranking a strip, which is a button too. */
    --btn: #141c21;
    --btn-off: #111719;

    /* The old board's names for the same things, still read by the sheet, the keypad and pairing. */
    --bay: var(--col);
    --bar: var(--header);

    --radius: 6px;

    /* How large everything is drawn: 1 is the sizes this file says, 0.7 seven tenths of them. The one
       place to change it. See `body`, below, for how, and `scale()` in board.js and arrange.js, which
       read it: a script that puts something where a pointer is has to know. */
    --ui-scale: 0.75;
    --ui: "IBM Plex Sans Condensed", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.35 var(--ui);

    /* Nothing on this board scrolls the page, and a rubber-band bounce during a drag looks like the
       board coming apart. The columns scroll themselves. */
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
}

/* The page never scrolls, and a body laid out larger than the window (below) must not make it try. */
html { overflow: hidden; }

/* Everything at --ui-scale: the body is laid out that much larger than the window and drawn scaled back
   into it, so every size in this file keeps its meaning and its proportion to the others, and a board
   at 0.7 simply has room for more. A transform and not `zoom`: browsers still disagree about what a
   zoomed element's measured box is, and the drag is made of measured boxes; under a transform they all
   say the same -- measured boxes and pointers are in the window's pixels, lengths set from a script are
   in the page's. Fixed elements, the sheets and what a drag shows, are the body's and scale with it. */
body {
    width: calc(100% / var(--ui-scale));
    height: calc(100% / var(--ui-scale));
    transform: scale(var(--ui-scale));
    transform-origin: 0 0;
    display: flex;
    flex-direction: column;
    /* No bottom inset here: the status bar and the banner each keep themselves clear of the home
       indicator, and padding the body as well left a bare strip of background under the status bar. */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}

#app { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

h1, h2 { margin: 0; font-weight: 600; }
h1 { font-size: 1.3rem; }
h2 { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 0.9rem 0 0.35rem; }
.muted { color: var(--muted); }
.spacer { flex: 1; }

button {
    font: inherit;
    color: var(--text);
    background: var(--btn);
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    padding: 0.45rem 0.7rem;
    min-height: 44px;
    cursor: pointer;
    touch-action: manipulation;
}

button:disabled { color: var(--dim); background: var(--btn-off); cursor: default; }
button.quiet { background: transparent; }
button.small { min-height: 36px; padding: 0.25rem 0.6rem; font-size: 0.85rem; }

/* --- The board ------------------------------------------------------------------------------ */

.board {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    overflow: hidden;
}

/* Header, 68 pt: the aerodrome and its runways, the mode, the tabs in the middle, the gestures. */
.hdr {
    height: 68px;
    flex: none;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 16px;
    border-bottom: 1px solid var(--line-soft);
    background: var(--header);
}

.hdr-left { display: flex; align-items: baseline; gap: 10px; min-width: 260px; }
/* The weather, right of the tabs: the letter large, QNH and wind beside it, the METAR under them. */
.wxbox { display: flex; align-items: center; gap: 12px; flex: 0 1 auto; min-width: 0; max-width: 34%; font-family: var(--mono); }
.wxbox .info { display: flex; gap: 10px; flex: none; }
.wxbox .letter { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.wxbox .letter b { font-size: 34px; font-weight: 700; color: var(--text); }
.wxbox .letter i { font-style: normal; font-size: 10px; color: var(--muted); margin-top: 2px; letter-spacing: 0.06em; }
.wxbox .wxr { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wxbox .wxtop { display: flex; align-items: baseline; gap: 14px; white-space: nowrap; }
.wxbox .wxtop i { font-style: normal; font-size: 11px; color: var(--muted); }
.wxbox .wxtop b { font-size: 15px; color: var(--text); }
.wxbox .metar { font-size: 11px; color: #9fb0b9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-right { display: flex; align-items: center; gap: 14px; min-width: 260px; justify-content: flex-end; }
.apt { font-family: var(--mono); font-weight: 600; font-size: 22px; letter-spacing: 0.06em; }

.rcfg { font-family: var(--mono); font-size: 14px; font-weight: 600; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.rcfg .rl { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.rcfg .shut { text-decoration: line-through; color: #ffb4ab; }
.rcfg .none { font-size: 12px; font-weight: 500; color: var(--muted); }

.tabs { display: flex; gap: 8px; flex-grow: 1; justify-content: center; }

.tab {
    min-height: 44px;
    min-width: 128px;
    padding: 0 18px;
    border: 1px solid var(--edge);
    background: var(--btn);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.04em;
}

.tab.on { background: var(--text); color: var(--bg); border-color: var(--text); }
/* Only looked at: a dashed edge while it is not on show, and hatched grey once it is, as a closed-off
   area is drawn -- the board under it moves nothing, and the tab is where the eye checks why. */
.tab.view:not(.on) { border-style: dashed; color: var(--muted); }
.tab.view.on {
    color: var(--bg);
    border-color: var(--muted-2);
    background: repeating-linear-gradient(135deg, var(--text) 0 3px, var(--muted-2) 3px 6px);
}
.tab:disabled { cursor: not-allowed; opacity: 0.5; background: var(--btn); color: var(--text); }

.badge {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    background: var(--calling);
    color: #1a1204;
    border-radius: 4px;
    padding: 2px 5px;
    animation: blink 1s steps(2, start) infinite;
}

.ghost-btn { min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--warn); background: #2a1f08; color: #ffd27a; font-weight: 600; }
.menu-btn { min-width: 44px; padding: 0 12px; font-size: 20px; line-height: 1; }

.warn {
    background: #4a1612;
    color: #ffd6d1;
    border: 1px solid var(--bad);
    border-radius: 6px;
    padding: 6px 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 38%;
}

.fault { flex: none; margin: 0; padding: 6px 16px; font-size: 13px; color: #ffd6d1; background: #2a1512; border-bottom: 1px solid var(--line-soft); }
/* The hub link, under the header, only while it is not simply linked. Amber for a hub out of reach --
   the board still works, from what it last had -- and red for one that will not have this host, where
   strips cannot be held at all. */
.hubline { flex: none; margin: 0; padding: 6px 16px; font-size: 13px; color: #ffd27a; background: #2a1f08; border-bottom: 1px solid var(--line-soft); }
.hubline.signedout, .hubline.refused { color: #ffd6d1; background: #2a1512; }

/* A handover the hub has not been told of: the other controller does not see it yet. */
.strip.undelivered .who { color: var(--warn); }

/* A controller with no board of their own: the strip reaches them in EuroScope and nowhere else. */
.actions .noboard { border-style: dashed; }
.actions .noboard .nb { font-size: 0.75em; color: var(--warn); }


/* The columns, as smartSTRIPS draws a board (docs/EFESPANSAscreen1.png): standing apart on the desk,
   sharing the width, each a rack a little narrower than the bars across it. A lane's caption is a
   large bar the whole width of its column; a part of a lane is under a thin one; and the strips reach
   nearly as far as the bars, over the edges of the rack. No sideways scroll at all: every column of a
   tab is on screen, and each scrolls down on its own. The one exception is a layouts file whose
   minimum widths a screen cannot hold: then the row scrolls, because a column narrower than its file
   says is the lesser harm only until it is one cut off at the edge. */
.cols { flex-grow: 1; min-height: 0; display: flex; gap: 10px; padding: 8px 10px 12px; overflow-x: auto; }

/* The rack is the column's own background, drawn narrower than the column: nothing in the column is
   wrapped or inset to make it, so a bar is the column's width by being in it. It runs to the foot of
   the column whatever the lanes fill, which is what is seen under a lane only a few strips tall.
   Two layers, the edge and one pixel inside it the rack, because a background has no border of its
   own; and nothing closes the column at its foot but the rack's own edge, clear of the toolbar by the
   row's padding, as on the real board (docs/tower-real.png). */
.col {
    --inset: 7px;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    --rack: var(--col);
    background:
        linear-gradient(var(--rack), var(--rack)) center / calc(100% - 2 * var(--inset) - 2px) calc(100% - 2px) no-repeat,
        linear-gradient(var(--rack-edge), var(--rack-edge)) center / calc(100% - 2 * var(--inset)) 100% no-repeat;
    border-radius: 4px 4px 0 0;
    overflow: hidden;
}

.col.rwy { --rack: var(--col-rwy); }
.col.closed { box-shadow: inset 0 0 0 2px var(--bad); border-color: var(--bad); }

/* The count is out of the row, at the bar's right end, so the caption is centred on the bar and not
   on what is left beside a number. */
.colhead { position: relative; flex: none; display: flex; align-items: baseline; justify-content: center; gap: 8px; padding: 9px 34px; border-radius: 4px; background: var(--col-head); }
.col.closed .colhead { background: #4a1612; }
.colhead .ct { font-weight: 700; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
/* The frequency a transfer lane sends the pilot to: said with every transfer, so it reads at a glance. */
.colhead .fq { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.colhead .cs { font-size: 12px; color: var(--muted-2); flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col.closed .colhead .cs { color: #ffb4ab; }
/* Hidden to try the board with a title and a frequency only: "to pick up" tells a controller nothing the
   title did not. Still in the layouts file and the editor; take this rule out to have it back. */
.colhead .cs { display: none; }
.colhead .cn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 12px; color: var(--muted-2); }

.closedbar { flex: none; background: var(--bad); color: #fff; font-size: 12px; font-weight: 600; padding: 6px 12px; letter-spacing: 0.03em; }

/* A lane that only passes a strip to another tab of this board: marked, so it is not read as a handover. */
.colhead .fwd { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 1px 4px; }

/* A column is a stack of lanes; a lane is a heading over one or more parts, each a bay. */
.lane { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }

.sec { display: flex; flex-direction: column; min-height: 0; }
/* The slot's own colour is on its strips, inside the rack: on the part it would stand out past the rack's edges. */
.sec.slot { flex: none; }
.sec.slot .strips { min-height: calc(var(--rows, 1) * (var(--strip-h, 60px) + var(--strip-gap)) - var(--strip-gap) + 16px); margin: 0 var(--inset); border-bottom: 1px dashed #33444f; background: #101a20; }
/* Sized from nothing, not from its strips: the room a drag makes at the foot of a list (board.js)
   must scroll inside the part, not grow it and push the parts beside it out of place. */
.sec.list { flex: 1 1 0; }
/* The lane itself above its sections, for the strips of none of them: as tall as what is in it, and a
   thin place to drop when empty. Sharing the lane equally, it took most of the room and was mostly empty. */
.sec.list.rest { flex: 0 1 auto; }

/* A runway slot holds two: it opens no hole under a held strip, because it would grow and move every
   part below it. A drop there needs no gap to aim at. */
.sec.slot .strips.making-room::after { display: none; }
.sec.slot .strips .make-room { transform: none; }

/* A split column: its lanes share it in equal parts, each under a heading of its own, the next
   heading drawn as the division. Each part scrolls on its own, like any column. */
.col.split .lane { flex: 1 1 0; }
/* Lanes given a minimum height may be more than the column: it scrolls, so none is cut off unseen. */
.col.split { overflow-y: auto; }
/* A part of a lane is under a thin bar, the column's width like the caption's, with its name small on it. */
.sectitle { flex: none; margin-top: 3px; padding: 0 10px; border-radius: 3px; background: var(--col-head); font-size: 10px; line-height: 15px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; text-align: center; color: var(--muted); }
.sectitle .fq { margin-left: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0; color: var(--accent); }

/* Positioned so its strips' offsetTop is measured from it, which is what board.js's orderAt reads. The
   two pixels at the sides are what a strip stops short of a bar by. */
.strips { --strip-gap: 6px; position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px 2px; display: flex; flex-direction: column; gap: var(--strip-gap); }
.sec.slot .strips { overflow: visible; }

/* A part the layouts file makes so many strips tall (`rows`): room for that many of the strips its face
   draws -- the page says how tall one is, --strip-h -- and a thin bar to close it, with the rack left
   empty under that. More strips than it was given room for scroll inside it, like any part. The bar
   is left off where the next part's own is drawn straight after it. */
.sec.rowed { flex: none; }
.sec.rowed > .strips { flex: none; height: calc(var(--rows) * (var(--strip-h, 60px) + var(--strip-gap)) - var(--strip-gap) + 16px); }
.sec.rowed::after { content: ""; flex: none; height: 4px; border-radius: 2px; background: var(--col-head); }
.sec.rowed:has(+ .sec > .sectitle)::after { display: none; }
/* The last part of a lane draws no line under itself: what follows is the next caption or the empty
   rack, and a line there reads as a strip lying at the foot of the lane. */
.sec.rowed:last-child::after { display: none; }
.sec.slot:last-child .strips { border-bottom: 0; }

/* A runway column has its runway in the middle, at one height in every runway column: Final shares the
   half above it, Line up and Holding point the half below (LayoutCatalog.RunwayBays). Each half's parts
   grow in proportion to the other half's count, so the halves are equal; a half with no part in it is
   an empty spacer of the lane's own (::before above, ::after below), as tall as the other half. */
.col.rwy .lane::before, .col.rwy .lane::after { content: none; flex: 1 1 0; }
.col.rwy .lane > .colhead, .col.rwy .lane > .closedbar { order: -1; }
.col.rwy .lane:has(> .sec.slot):not(:has(> .sec.list + .sec.slot))::before { content: ""; }
.col.rwy .lane:has(> .sec.slot):not(:has(> .sec.slot + .sec.list))::after { content: ""; }
.col.rwy .lane:has(> .sec.slot ~ .sec.list ~ .sec.list)::before,
.col.rwy .lane:has(> .sec.slot ~ .sec.list ~ .sec.list) > .sec.list:has(~ .sec.slot) { flex-grow: 2; }
.col.rwy .lane:has(> .sec.list ~ .sec.list ~ .sec.slot)::after,
.col.rwy .lane:has(> .sec.list ~ .sec.list ~ .sec.slot) > .sec.slot ~ .sec.list { flex-grow: 2; }

/* The drag's hole: the strips from the landing place down move by the held strip's height. See board.js. */
.strips .make-room { transform: translateY(calc(var(--room, 0px) + var(--strip-gap))); transition: transform 0.12s ease; }
.strips.making-room::after { content: ""; flex: none; height: var(--room, 0px); }

/* --- One strip: ~60 pt, a band for the direction, the callsign and two lines ----------------- */

.strip {
    display: flex;
    width: 100%;
    min-height: 60px;
    text-align: left;
    border: 0;
    border-radius: 6px;
    padding: 0;
    overflow: hidden;
    flex: none;
    background: var(--plain-body);
    color: var(--text);
    touch-action: none;

    /* The strip's own text colours, so light strips (below) only redefine these. */
    --s-strong: #e6eef2;
    --s-body: #c5d2d9;
    --s-soft: #9fb0b9;
    --s-line: #5b6b74;
    --s-warn: #f2c96b;
    --s-bad: #ff8a80;
}

/* Light strips, as on smartSTRIPS (docs/EFESPANSAscreen1.png): pale yellow arrivals, pale blue
   departures, pale red VFR and local traffic, dark text. Chosen per device from the toolbar; the board
   around them goes light with them (the light board, at the end of this file). A strip being dragged
   is a copy on the body, outside the board, so board.js marks it and it is named here too. */
.board[data-strips="light"],
.strip.ghost[data-strips="light"] {
    --plain-body: #e4e8ec;
    --dep-body: #cfe8fb;
    --arr-body: #f8e7a6;
    --local-body: #f6cdc8;
    --dep: #3d8fd6;
    --arr: #e8b623;
    --local: #d2453b;
}
.board[data-strips="light"] .strip,
.board[data-strips="light"] .fbar,
.strip.ghost[data-strips="light"] {
    --text: #18212a;
    --muted: #55636c;
    --dim: #8a959c;
    --s-strong: #0f171e;
    --s-body: #243039;
    --s-soft: #4f5d66;
    --s-line: #7d8a92;
    --s-warn: #9a5b00;
    --s-bad: #c0271c;
}
.board[data-strips="light"] .strip.arr .k, .strip.ghost[data-strips="light"].arr .k { color: #2a1f00; }

.strip.dep { background: var(--dep-body); }
.strip.arr { background: var(--arr-body); }
.strip.local { background: var(--local-body); }

.strip .k {
    width: 30px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    letter-spacing: 0.1em;
    background: #33465a;
}

.strip.dep .k { background: var(--dep); color: #fff; }
.strip.arr .k { background: var(--arr); color: #1a1204; }
.strip.local .k { background: var(--local); color: #fff; }

.strip .cs { font-family: var(--mono); font-weight: 600; font-size: 16px; }
/* The holding point or exit given: a small outlined chip, so it reads as a fact about the strip and not a flag. */
.strip .pt { margin-left: 5px; font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 0 4px; border: 1px solid currentColor; border-radius: 3px; }
.strip .tel { flex: 1 1 auto; min-width: 0; font-size: 11px; letter-spacing: .04em; color: var(--s-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip .ty { font-family: var(--mono); font-size: 12px; color: var(--s-body); white-space: nowrap; }
.sheet .sqoff { color: #f2c96b; }
.strip .cs .flag { display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 3px; background: var(--bad); color: #fff; font-size: 12px; line-height: 16px; vertical-align: middle; }
.strip .cs .heard { display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: var(--calling); vertical-align: middle; }

/* --- Grid faces: smartSTRIPS' slots, each a cell over a cell or one over both rows ---------------- */

/* Measured, so a strip fits the lane it is in and not the screen: see the container rules below. */
.strip.grid { min-height: 46px; container: strip / inline-size; }
.strip .g { flex: 1 1 auto; min-width: 0; display: flex; align-items: stretch; padding: 3px 6px; column-gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--s-body); }
/* Shares of the width and not widths: when a slot is dropped the ones left take its room. */
.strip .g .slot { flex: 1 1 0; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.strip .g .slot.small { flex-grow: 0.7; }
.strip .g .slot.large { flex-grow: 1.8; }
.strip .g .slot.span { justify-content: center; }
.strip .g .slot > span { min-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip .g .slot + .slot { border-left: 1px solid color-mix(in srgb, var(--s-soft) 30%, transparent); padding-left: 8px; }
.strip .g .c { margin-left: 0; }
.strip .g .dest { font-weight: 600; color: var(--s-strong); }
.strip .g .climb { font-weight: 600; color: var(--s-strong); }
.strip .g .climb.expected { font-weight: 400; color: var(--muted); }
.strip .g .climb .rfl { font-weight: 400; color: var(--s-soft); }
.strip .g .climb .unset { font-size: 10px; letter-spacing: 0.06em; color: var(--dim); }
.strip .g .place { margin-left: 6px; color: var(--s-soft); }
.strip .g .nil { font-size: 10px; letter-spacing: 0.06em; color: var(--dim); }
.strip .g .clr { font-weight: 700; color: var(--good); }
.strip .g .bad { color: var(--s-bad); font-weight: 600; text-decoration: underline wavy var(--bad); }
.strip .g .fpl { padding: 0 4px; border: 1px solid var(--s-soft); border-radius: 3px; font-size: 0.8em; color: var(--s-soft); }
.strip .g .fpl.attention { border-color: var(--bad); color: var(--bad); }
.strip .g .sq { font-weight: 600; color: var(--s-strong); }
.strip .g .sq.off { color: var(--s-warn); }
.strip .g .ty { font-size: 12px; color: var(--s-body); }
.strip .g .tel { font-size: 11px; letter-spacing: .04em; color: var(--s-soft); }
.strip .g .pt { align-self: flex-start; font-size: 11px; font-weight: 700; padding: 0 4px; border: 1px solid currentColor; border-radius: 3px; }
/* The flight rules as a small filled box: VFR stands out, as the orange box does on smartSTRIPS. */
.strip .g .frb { align-self: flex-start; min-width: 18px; text-align: center; padding: 0 4px; border-radius: 2px; font-weight: 700; background: color-mix(in srgb, var(--s-soft) 25%, transparent); color: var(--s-strong); }
.strip .g .frb.vfr { background: #f07a1a; color: #fff; }
/* The callsign, large and centred over both rows, with a handover in flight under it. */
.strip .g .call { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; }
.strip .g .call .cs { font-size: 21px; font-weight: 600; letter-spacing: 0.02em; color: var(--s-strong); line-height: 1.05; white-space: nowrap; }
.strip .g .call .who { font-size: 11px; color: var(--accent); white-space: nowrap; }
.board[data-strips="light"] .strip .g .call .who, .strip.ghost[data-strips="light"] .g .call .who { color: #0b5fa5; }

/* A strip narrower than its face: the slots the layout marked give way, first then second, so what is
   left can be read whole instead of every cell cut short. Then the strip itself tightens. The widths
   are worked out from a seven-letter callsign at its size and are unmeasured on the iPad. */
@container strip (max-width: 400px) {
    .g .slot.drop-1 { display: none; }
}
@container strip (max-width: 310px) {
    .g .slot.drop-2 { display: none; }
}
@container strip (max-width: 250px) {
    .k { width: 20px; }
    .g { padding: 3px 4px; column-gap: 5px; }
    .g .slot + .slot { padding-left: 5px; }
    .g .call .cs { font-size: 17px; }
}

/* A column of strips of one line is narrow however wide the screen: the room goes to the lanes worked in. */
.col.w-narrow { max-width: 260px; }
/* Narrow leaves no room for the telephony beside a handover's "→ APP" and the squawk; a lane only read
   needs the callsign, who it went to and the squawk more, and the sheet still has the rest. */
.col.w-narrow .strip .tel { display: none; }

.strip.calling { box-shadow: 0 0 0 3px var(--calling); animation: pulse 1.1s ease-in-out infinite; }
.strip.cocked .k { box-shadow: inset -4px 0 0 var(--warn); }
.strip.theirs, .strip.offered { opacity: 0.72; }

.strip.working .cs::after { content: " ·"; color: var(--accent); }

.strip.lifted { display: none; }

.strip.ghost {
    position: fixed;
    z-index: 50;
    pointer-events: none;
    opacity: 0.92;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px var(--calling); } 50% { box-shadow: 0 0 0 3px var(--calling), 0 0 16px 4px rgba(255, 176, 32, 0.55); } }
@keyframes blink { 50% { opacity: 0.35; } }
@keyframes unsettled { 50% { opacity: 0.45; } }

/* --- The overflow: what the mockup has no room for and the board cannot do without ---------- */

.writes { display: flex; }
.writes button { border-radius: 0; border-right-width: 0; min-height: 40px; font-size: 0.85rem; }
.writes button:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.writes button:last-child { border-radius: 0 var(--radius) var(--radius) 0; border-right-width: 1px; }
.writes button.on { background: var(--accent); border-color: var(--accent); color: #06121e; font-weight: 600; }
.writes button.on.armed { background: var(--bad); border-color: var(--bad); color: #1a0806; }


.position-pick { font: inherit; color: var(--text); background: #141c21; border: 1px solid var(--edge); border-radius: var(--radius); min-height: 44px; padding: 0 0.6rem; }

/* --- The flight plan status picker: a small list where the status was tapped ---------------------- */

/* The status on a strip that can be set: a target of its own, a finger wide however short the value. */
.strip .fpl.pick { cursor: pointer; min-width: 30px; text-align: center; }
.strip .fpl.pick.nil { border-style: dashed; color: var(--dim); }

/* Takes the tap that closes the picker, so it never lands on the strip or lane underneath. The
   pointer cursor is for iPad Safari, which sends no click to a plain div without one. */
.pop-backdrop { position: fixed; inset: 0; z-index: 55; background: transparent; cursor: pointer; }
.pop {
    position: fixed;
    z-index: 56;
    width: 140px;
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    background: #1b252c;
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}
.pop-title { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); padding: 2px 4px 4px; }
.pop button { min-height: 40px; font-family: var(--mono); font-weight: 600; text-align: left; padding: 0 10px; }
.pop button.on { background: var(--accent); border-color: var(--accent); color: #06121e; }

/* --- Sheets: the pad and the actions ------------------------------------------------------ */

.sheet {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    /* A sheet opened from the toolbar is the toolbar's child, and would take its nowrap with it. */
    white-space: normal;
}

.pad, .actions {
    width: min(420px, 92vw);
    max-height: 92vh;
    overflow-y: auto;
    padding: 0.8rem;
    background: var(--bay);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
}

.actions { width: min(520px, 94vw); }

.pad > header, .actions > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.pad .what, .actions .what { font-family: var(--mono); font-size: 1.1rem; font-weight: 700; }

.entry {
    font-family: var(--mono);
    font-size: 1.8rem;
    text-align: center;
    padding: 0.4rem;
    background: #10161c;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    min-height: 3rem;
}

.entry.empty { color: var(--dim); font-size: 1.1rem; line-height: 2.7rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0; }
.chips button { min-height: 40px; font-family: var(--mono); }

.keys { display: grid; gap: 0.35rem; margin-top: 0.4rem; }
.keys.digits { grid-template-columns: repeat(3, 1fr); }
.keys.alnum { grid-template-columns: repeat(6, 1fr); }
.keys button { font-family: var(--mono); font-size: 1.15rem; min-height: 48px; padding: 0; }
.keys .wide { grid-column: span 1; font-family: inherit; font-size: 0.9rem; }
.keys.digits .wide { grid-column: span 1; }
.keys .go { background: var(--accent); border-color: var(--accent); color: #06121e; font-weight: 700; }

.actions .row { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.actions .row button { flex: 1 1 auto; }
.actions .row button.on { background: var(--accent); border-color: var(--accent); color: #06121e; font-weight: 600; }
.actions .row button.preferred { border-color: var(--accent); }
.actions .findings { list-style: none; margin: 0 0 0.5rem; padding: 0; }
.actions .findings li { color: #ffd6d1; border-left: 3px solid var(--bad); padding: 0.2rem 0.6rem; margin-bottom: 0.25rem; font-family: var(--mono); font-size: 0.85rem; }
.actions .bad { color: #ff8a80; box-shadow: inset 0 0 0 1px var(--bad); }
.actions .route { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); word-break: break-all; }

.notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.35rem; }
.notes .note { display: flex; flex-direction: column; align-items: flex-start; min-height: 48px; }
.notes .note .lbl { font-size: 0.6rem; color: var(--dim); }
.notes .note .val { font-family: var(--mono); font-size: 0.9rem; }
.notes .note.empty { color: var(--dim); }

/* --- Pairing, faults and the banner ------------------------------------------------------- */

.pair {
    margin: auto;
    padding: 1.5rem;
    max-width: 30rem;
    text-align: center;
}

.pair form { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1rem; }

.pair .code {
    font: 700 2rem/1 var(--mono);
    letter-spacing: 0.2em;
    text-align: center;
    width: 9rem;
    padding: 0.5rem;
    color: var(--text);
    background: #10161c;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-transform: uppercase;
}

.pair .error { color: var(--bad); }

/* The hosts online on a hub, to watch one without a code. */
.pair .hosts { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-top: 0.5rem; }
.pair .host { font: 600 0.95rem/1 var(--mono); padding: 0.6rem 0.9rem; }
.pair .signin { display: inline-block; padding: 0.6rem 1.2rem; border-radius: 6px; background: var(--accent, #2d6cdf); color: #fff; text-decoration: none; font-weight: 600; }

/* The status bar: every link's state and one message, along the bottom of the board. It sits in
   the board's column rather than over it, so it never covers a strip. */
/* The tapped strip written out in full, EuroScope's F6 strip: three rows of columns, the route and
   remarks taking whatever width is left and cut short when they must -- the sheet has them whole. */
.fbar {
    flex: none;
    display: flex;
    align-items: stretch;
    min-height: 62px;
    border-top: 1px solid var(--line);
    border-left: 6px solid var(--dim);
    background: var(--plain-body);
    font-family: var(--mono);
    font-size: 12px;
    line-height: 18px;
    color: var(--text);
    cursor: pointer;
}
.fbar.dep { border-left-color: var(--dep); background: var(--dep-body); }
.fbar.arr { border-left-color: var(--arr); background: var(--arr-body); }
.fbar.local { border-left-color: var(--local); background: var(--local-body); }
.fbar .fc { display: flex; flex-direction: column; justify-content: center; flex: none; min-width: 52px; padding: 2px 10px; border-right: 1px solid color-mix(in srgb, var(--text) 14%, transparent); white-space: nowrap; }
.fbar .fc > span { min-height: 18px; }
.fbar .id .cs { font-size: 15px; font-weight: 700; letter-spacing: 0.03em; }
.fbar .lv { text-align: right; }
.fbar .wide { flex: 1 1 auto; min-width: 0; }
.fbar .txt { overflow: hidden; text-overflow: ellipsis; }
.fbar .dim { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.fbar .vfr { color: #f2c96b; font-weight: 600; }
.fbar .sq { font-weight: 600; text-align: right; }
.fbar .sq .off { color: #f2c96b; }
.fbar .x { flex: none; width: 40px; border: 0; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; }

/* Where the screen has the room -- a desk, not an iPad -- the tapped strip is written out across the top,
   under the header, as a strip bay's flight plan panel is, larger and with the route on two lines. Placed
   by the screen alone: what a device can show is not the vACC's to say. */
@media (min-width: 1400px) and (min-height: 900px) {
    .board > .hdr { order: -2; }
    .board > .fbar { order: -1; border-top: 0; border-bottom: 1px solid var(--line); min-height: 88px; font-size: 13px; line-height: 22px; }
    .fbar .fc { padding: 4px 14px; }
    .fbar .fc > span { min-height: 22px; }
    .fbar .id .cs { font-size: 19px; }
    .fbar .wide .txt { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}

.statusbar {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 4px 12px calc(4px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line-soft);
    background: var(--header);
    font-size: 12px;
    white-space: nowrap;
}
.statusbar .st { font-family: var(--mono); padding: 3px 8px; border-radius: 4px; color: var(--muted); box-shadow: inset 0 0 0 1px var(--edge); }
.statusbar .st.good { color: var(--good); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 45%, transparent); }
.statusbar .st.warn { color: var(--warn); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 45%, transparent); }
.statusbar .st.bad { color: #ff8a80; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 55%, transparent); }
/* Fine, in training: blue where green would be, so the bar says which world the board is in. */
.statusbar .st.train { color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent); }
.statusbar .msg {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 26px;
    margin-left: 8px;
    padding: 0 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    font: inherit;
    color: var(--muted);
    background: none;
    border: none;
    border-radius: 4px;
}
.statusbar .msg.bad { color: #ffd6d1; background: #2a1512; box-shadow: inset 0 0 0 1px var(--bad); }
.statusbar .msg.note { color: #cfe4f4; background: #10222e; box-shadow: inset 0 0 0 1px var(--accent); }
.statusbar .at, .messages .at { font-family: var(--mono); color: var(--dim); margin-right: 8px; }

.messages { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; }
.messages li { padding: 0.3rem 0; border-bottom: 1px solid var(--line-soft); }
.actions .fault-line { color: #ffd6d1; border-left: 3px solid var(--bad); padding: 0.2rem 0.6rem; }

/* The last thing the host said about a command, before there is a board to have a status bar.
   Tapped to dismiss; it is a message, not a dialog, and must never stand between a finger and a strip. */
.banner {
    position: fixed;
    left: 50%;
    bottom: calc(0.8rem + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 45;
    max-width: 80vw;
    padding: 0.55rem 0.9rem;
    background: #2a1b1b;
    color: #f0c5c1;
    border: 1px solid var(--bad);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* News rather than a refusal -- a band taken, a rung given back. Drawn apart from a failed write,
   because a board that says "Now covering DEL." in the colour of a rejected command teaches the
   controller to stop reading the banner. */
.banner.note {
    background: #10222e;
    color: #cfe4f4;
    border-color: var(--accent);
}

/* --- The splash ---------------------------------------------------------------------------- */

/* A radar scope and the logo, from the first byte until the board is drawn: Blazor's download, the
   relay, pairing and the host's first board. It sits outside #app (index.html), so the page starting
   does not replace it and jump the sweep; what it is waiting for is the line the page draws in #app.
   Gone the moment #app holds a board or the code panel. Always dark, like the room the scope is in. */
:root {
    /* The scope's size, and where the line under it goes: the splash's column is the scope, a gap and
       the brand, centred and lifted by its bottom padding. */
    --splash-d: min(46rem, 68vmin);
    --splash-foot: calc(50% - 2rem + (var(--splash-d) + 4rem) / 2);
}

.splash {
    --d: var(--splash-d);
    --phosphor: #5cc8ff;
    --sweep: 4.8s;

    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.2rem;
    padding-bottom: 4rem;
    background: radial-gradient(ellipse at 50% 42%, #0f1d26 0%, #0b1013 62%);
    transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

body:has(#app .board, #app .pair) .splash {
    opacity: 0;
    visibility: hidden;
}

.scope {
    position: relative;
    width: var(--d);
    height: var(--d);
    border-radius: 50%;
    background: radial-gradient(circle closest-side, #0c2230 0%, #081620 70%, #050d13 100%);
    box-shadow: 0 0 0 1px #1d3746, 0 0 3rem rgba(92, 200, 255, 0.10), inset 0 0 3rem rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.scope svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; }
.scope .ring { stroke: rgba(92, 200, 255, 0.14); stroke-width: 0.5; }
.scope .edge { stroke: rgba(92, 200, 255, 0.35); stroke-width: 0.8; }
/* Every 5 and every 30 degrees, drawn as one dashed circle each: 2 pi r over 72 and over 12. */
.scope .ticks { stroke: rgba(92, 200, 255, 0.30); stroke-width: 3; stroke-dasharray: 0.6 7.69; }
.scope .ticks.major { stroke: rgba(92, 200, 255, 0.55); stroke-width: 5; stroke-dasharray: 1 48.22; }
.scope .cross { stroke: rgba(92, 200, 255, 0.08); stroke-width: 0.5; }
.scope .coast { stroke: rgba(143, 162, 173, 0.30); stroke-width: 0.8; }
.scope .centreline { stroke: rgba(143, 162, 173, 0.30); stroke-width: 0.5; stroke-dasharray: 2 2; }
.scope .runway { stroke: #8fa2ad; stroke-width: 1.2; stroke-linecap: round; }

/* The beam, leading edge at north when unturned, and the afterglow behind it. */
.sweep {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0deg 285deg, rgba(92, 200, 255, 0.05) 315deg, rgba(92, 200, 255, 0.30) 360deg);
    animation: sweep var(--sweep) linear infinite;
}

.sweep::after {
    content: "";
    position: absolute;
    left: calc(50% - 1px);
    top: 0;
    width: 2px;
    height: 50%;
    background: linear-gradient(to top, rgba(92, 200, 255, 0.15), var(--phosphor));
    box-shadow: 0 0 8px var(--phosphor);
}

@keyframes sweep { to { transform: rotate(360deg); } }

/* A target at bearing --b and --r of the range out, lit as the beam passes over it and fading until
   the next pass: its delay is the time the beam takes to reach its bearing. Its history trails off
   along --tx/--ty, and the label stays upright because the turn there is turned back. */
.blip {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    transform: rotate(calc(var(--b) * 1deg)) translateY(calc(var(--r) * var(--d) / -2)) rotate(calc(var(--b) * -1deg));
    animation: blip var(--sweep) linear infinite;
    animation-delay: calc(var(--b) / 360 * var(--sweep) - var(--sweep));
}

.blip::before {
    content: "";
    position: absolute;
    left: -3px;
    top: -3px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--phosphor);
    box-shadow:
        0 0 6px var(--phosphor),
        calc(var(--tx) * 1px) calc(var(--ty) * 1px) 0 -1px rgba(92, 200, 255, 0.55),
        calc(var(--tx) * 2px) calc(var(--ty) * 2px) 0 -1.5px rgba(92, 200, 255, 0.35),
        calc(var(--tx) * 3px) calc(var(--ty) * 3px) 0 -2px rgba(92, 200, 255, 0.2);
}

.blip span {
    position: absolute;
    left: 0.9rem;
    top: -1.6rem;
    font: 500 0.85rem/1.15 var(--mono);
    color: var(--phosphor);
    white-space: nowrap;
    padding-left: 0.35rem;
    border-left: 1px solid rgba(92, 200, 255, 0.4);
}

/* The one calling, in the logo's amber, as the board marks a strip whose pilot is on the frequency. */
.blip.calling { --phosphor: #ffb020; }

@keyframes blip {
    0% { opacity: 1; }
    60% { opacity: 0.45; }
    100% { opacity: 0.3; }
}

.splash-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    font: 600 1.5rem/1 var(--mono);
    letter-spacing: 0.32em;
    color: var(--text);
}

/* What the splash is waiting for, drawn by the page in #app and laid over the splash's foot. Before
   Blazor is up it is the download's percentage, which Blazor keeps in --blazor-load-percentage-text. */
.splash-stage {
    position: fixed;
    left: 0;
    right: 0;
    top: calc(var(--splash-foot) + 2.4rem);
    z-index: 41;
    margin: 0;
    text-align: center;
    font: 500 1rem/1.4 var(--mono);
    letter-spacing: 0.06em;
    color: var(--muted);
}

.splash-stage::before {
    content: "";
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    margin-right: 0.7rem;
    border-radius: 50%;
    background: var(--accent);
    vertical-align: 0.1em;
    animation: stage 1.2s ease-in-out infinite alternate;
}

.splash-stage.loading::after { content: "Loading the board " var(--blazor-load-percentage-text, ""); }

@keyframes stage { from { opacity: 0.25; } to { opacity: 1; } }

.splash-load {
    position: fixed;
    left: calc(50% - 7rem);
    top: calc(var(--splash-foot) + 5.2rem);
    z-index: 41;
    width: 14rem;
    height: 2px;
    background: #1e2833;
}

.splash-load i {
    display: block;
    height: 100%;
    width: var(--blazor-load-percentage, 0%);
    background: var(--accent);
    transition: width 0.1s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .sweep, .blip, .splash-stage::before { animation: none; }
}

#blazor-error-ui {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    padding: 0.7rem 1.2rem;
    background: #2a1b1b;
    color: #f0c5c1;
    border-top: 1px solid var(--bad);
}

#blazor-error-ui .dismiss {
    position: absolute;
    right: 0.75rem;
    top: 0.6rem;
    cursor: pointer;
}

/* --- The toolbar ---------------------------------------------------------------------------- */

/* Along the bottom, as smartSTRIPS has one: the clock, the board's settings, the strips' colours and
   the position, then the tools, then what the status bar always said. One bar: the status bar was at
   the foot of the board already, and a second row there is a row of strips less. Tall enough to be
   touched, which the status bar on its own never had to be -- and a quarter taller than a finger needs,
   asked for: its buttons are 55 px, and drawn at --ui-scale that is what is left of them. */
.toolbar {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 65px;
    padding: 5px 12px calc(5px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line-soft);
    background: var(--header);
    white-space: nowrap;
}

.toolbar .tclock { font-family: var(--mono); font-size: 20px; font-weight: 600; letter-spacing: 0.02em; color: var(--text); min-width: 96px; }
.toolbar .tpos { font-family: var(--mono); font-size: 13px; font-weight: 600; padding: 14px 12px; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--edge); }
.toolbar .tbtn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 55px; min-height: 55px; padding: 0 12px; font-size: 22px; line-height: 1; }
.toolbar .tbtn.text { font-size: 14px; padding: 0 14px; }
/* A picture on a button is drawn in lines, in the button's own colour: lit, dimmed and light with it. */
.toolbar .tbtn svg { flex: none; width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.toolbar .tbtn.done { background: var(--accent); border-color: var(--accent); color: #06121e; font-weight: 600; }
.toolbar .tools { display: flex; align-items: center; gap: 6px; margin-left: 8px; }
.toolbar .tools:empty { display: none; }
/* Pressed is writing: the menu's red, and sunk, so it reads as a state and not as something to tap. */
.toolbar .tbtn.twrite { font-family: var(--mono); }
.toolbar .tbtn.twrite.armed { background: var(--bad); border-color: var(--bad); color: #1a0806; box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.45); }
/* The corner is the logo's; it is not a button and gives way before the message does. */
.toolbar .tbrand { flex: none; display: inline-flex; align-items: center; gap: 8px; margin-left: 4px; font-size: 14px; font-weight: 700; letter-spacing: 0.14em; color: var(--text); }
.toolbar .tlogo { flex: none; width: 44px; height: 44px; }
.toolbar .tnum { font-family: var(--mono); font-size: 15px; min-width: 26px; text-align: center; }
.toolbar .thint { font-size: 12px; color: var(--muted); padding: 0 6px; }
/* The aerodrome whose boards the editor arranges: a button among the toolbar's, that opens the system's own list. */
.toolbar .tpick { font: inherit; font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--text); background: var(--btn); border: 1px solid var(--edge); border-radius: var(--radius); min-height: 40px; padding: 0 10px; cursor: pointer; }

/* The links and the message keep their own look, and take what room the tools leave. */
.toolbar .statusbar { flex: 1 1 0; min-width: 0; min-height: 0; padding: 0; border: 0; background: none; justify-content: flex-end; overflow: hidden; }
.toolbar .statusbar .msg { flex: 0 1 auto; }

/* --- The layout editor ---------------------------------------------------------------------- */

/* The board at work is hidden while one is arranged, never removed: the drag is attached to it. */
.cols[hidden] { display: none; }

/* A column of the file: its bar to pick it by, then its lanes as the board draws them. The runways
   block is one column of the file and a column for every runway inside. */
.arranging .edcol { box-shadow: inset 0 0 0 1px transparent; }
.arranging .edbar {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    cursor: grab;
    padding: 0 10px;
    border: 0;
    border-bottom: 1px dashed var(--edge);
    border-radius: 0;
    background: #0d1418;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
}
.arranging .edbar .grip { color: var(--dim); letter-spacing: -0.2em; }
.arranging .edbar .ek { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.arranging .edrwys { flex: 1 1 0; min-height: 0; display: flex; gap: 10px; }

/* The toggle on the bar: a share of the width or pixels, the one it is lit. Clear of the splitter,
   which is the bar's last 16 px. */
.arranging .edbar .emode { flex: none; display: flex; min-height: 32px; margin-right: 10px; padding: 0; border: 1px solid currentColor; border-radius: 5px; background: none; color: inherit; font-family: var(--mono); font-size: 12px; letter-spacing: 0; text-transform: none; overflow: hidden; cursor: pointer; }
.arranging .edbar .emode span { display: flex; align-items: center; padding: 0 8px; opacity: 0.55; }
.arranging .edbar .emode span.on { opacity: 1; background: var(--accent); color: #06121e; font-weight: 700; }
.arranging .edcol.picked > .edbar .emode span.on { background: #06121e; color: var(--accent); }

/* A lane's heading is pressed and dragged here, and is as tall as it is on the board: its name to the
   left, to leave room for the chips. Not a button, as the bar is not: the chips in it are. */
.arranging .edhead { justify-content: flex-start; align-items: center; gap: 6px; padding: 3px 34px 3px 10px; cursor: grab; }
.arranging .edhead .ct { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: left; }

/* What is said of a column or a lane, on it: its size, and a lane's data. Each says the value and opens
   the sheet that sets it; dashed where nothing is said yet. A long one gives way to the name. */
.arranging .echip { flex: 0 1 auto; min-width: 0; max-width: 11em; min-height: 30px; padding: 0 8px; border: 1px solid currentColor; border-radius: 5px; background: none; color: inherit; font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.arranging .echip.nil { border-style: dashed; opacity: 0.7; }
/* The cross that takes a column or a lane off the board: a chip that never gives way to a long name. */
.arranging .echip.edel { flex: none; min-width: 30px; padding: 0; }
.arranging .edbar .echip.edel { margin-right: 10px; }

/* What is picked, which is what the toolbar's tools act on. */
.arranging .edcol.picked { box-shadow: inset 0 0 0 2px var(--accent); }
.arranging .edcol.picked > .edbar { background: var(--accent); color: #06121e; border-bottom-style: solid; }
.arranging .edcol.picked > .edbar .grip { color: #06121e; }
.arranging .lane.picked { box-shadow: inset 0 0 0 2px var(--accent); }
.arranging .lane.picked > .edhead { background: var(--accent); color: #06121e; }
.arranging .lane.picked > .edhead .cs, .arranging .lane.picked > .edhead .cn { color: #06121e; }

/* Looked at, not worked: a strip here is not tapped or dragged. */
.arranging .strip { pointer-events: none; }

/* Dragged, not scrolled or selected: a bar, a heading and a splitter take the touch for themselves,
   as a strip does on the board at work (arrange.js). Two fingers still scroll, which is board.js's. */
.arranging { user-select: none; -webkit-user-select: none; }
.arranging .edbar, .arranging .edhead, .arranging .splitter { touch-action: none; }
.arranging.docking, .arranging.docking * { cursor: grabbing; }
.arranging .moving { opacity: 0.4; }

/* A splitter is the edge between two neighbours, drawn inside the first of them: a strip of the
   column's right side, wide enough for a finger and marked by a short bar. Inside, not between, so
   the columns and the room between them are exactly the board's own. The one at the foot of a lane
   or a part is no edge between two: it makes that part so many strips tall, and nothing else moves. */
.arranging .edcol, .arranging .edcol > .lane, .arranging .sec { position: relative; }
.arranging .splitter { position: absolute; z-index: 3; }
.arranging .splitter.across { top: 0; bottom: 0; right: 0; width: 16px; cursor: col-resize; }
.arranging .splitter.down { left: 0; right: 0; bottom: 0; height: 16px; cursor: row-resize; }
.arranging .splitter::after { content: ""; position: absolute; border-radius: 2px; background: var(--muted); opacity: 0.7; }
.arranging .splitter.across::after { top: 50%; right: 3px; width: 4px; height: 44px; transform: translateY(-50%); }
.arranging .splitter.down::after { left: 50%; bottom: 3px; width: 44px; height: 4px; transform: translateX(-50%); }
.arranging .splitter:hover::after { background: var(--accent); opacity: 1; }

/* What a drag shows, on the body and outside the board's colours: the name of what is held, the line
   where it or an edge would go, and beside a splitter what the two sides would come to. */
.arrange-ghost, .arrange-mark, .arrange-tag { position: fixed; left: 0; top: 0; pointer-events: none; }
.arrange-ghost { z-index: 51; padding: 8px 12px; border-radius: 6px; background: #5cc8ff; color: #06121e; font-size: 13px; font-weight: 700; white-space: nowrap; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); }
.arrange-mark { z-index: 50; border-radius: 2px; background: #5cc8ff; box-shadow: 0 0 0 1px #06121e; }
.arrange-tag { z-index: 51; padding: 5px 9px; border-radius: 5px; border: 1px solid #5cc8ff; background: #06121e; color: #fff; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; white-space: pre; }

.renames { display: flex; flex-direction: column; gap: 0.5rem; }
.renames label { display: flex; align-items: center; gap: 0.6rem; }
.renames label span { flex: none; width: 5rem; font-size: 0.8rem; color: var(--muted); }
.renames input { flex: 1 1 auto; min-height: 44px; padding: 0 0.6rem; font: inherit; color: var(--text); background: #0d1418; border: 1px solid var(--edge); border-radius: var(--radius); }
.renames button.on { background: var(--accent); border-color: var(--accent); color: #06121e; font-weight: 600; }

/* --- The light board ------------------------------------------------------------------------ */

/* The board around light strips, as smartSTRIPS draws one (docs/EFESPANSAscreen1.png): a pale grey
   desk, racks a shade darker, slate bars with their names in white, and a pale toolbar. Colours only:
   the shape -- racks standing apart, the bars across them -- is the board's own, dark or light, and is
   said with the columns above. Nothing here moves a strip or changes one, and a strip's own colours
   are set above, on the strip.

   The tokens a strip reads from the board -- --accent, --good, --warn, --bad -- are left alone here for
   that reason, and darkened only on the parts that hold no strip. The sheets, the picker and the pages
   before there is a board are outside it and stay dark. */
.board[data-strips="light"] {
    color-scheme: light;

    --bg: #e3e4eb;
    --header: #eceef2;
    --col: #d5d7df;
    --col-rwy: #cfd3de;
    --col-head: #474d63;
    --line: #b7bbc8;
    --line-soft: #c8cbd6;
    --edge: #aab0be;
    --rack-edge: #fff;
    --text: #1c2230;
    --muted: #586073;
    --muted-2: #677084;
    --dim: #8b92a3;
    --btn: #f5f6f9;
    --btn-off: #e4e6ec;
}

/* Colour is inherited as it was worked out, not as a token: a sheet inside the board asks again. And so
   does the light board itself -- without it the airport in the header and the position in the toolbar,
   which set no colour of their own, kept the dark board's pale text on a pale ground. */
.board .sheet { color: var(--text); }
.board[data-strips="light"] { color: var(--text); }

/* The home indicator's strip under the toolbar is the body's, not the board's. */
body:has(.board[data-strips="light"]) { background: #eceef2; }

.board[data-strips="light"] .wxbox .metar { color: var(--muted); }
.board[data-strips="light"] .rcfg .shut { color: #c0271c; }

.board[data-strips="light"] .col.closed { border-color: var(--bad); }

/* The slate bar: white on it, so what was muted on the dark heading is pale here, not grey. */
.board[data-strips="light"] .colhead {
    --muted: #c9cedc;
    --muted-2: #c9cedc;
    --line: #7b8299;
    color: #fff;
}
.board[data-strips="light"] .arranging .edhead { color: #fff; }
.board[data-strips="light"] .sectitle { color: #fff; }

.board[data-strips="light"] .sec.slot .strips { border-bottom-color: #8e94a6; background: #c6cad6; }
.board[data-strips="light"] .sectitle .fq { color: #0b5fa5; }
.board[data-strips="light"] .arranging .edbar { background: #dfe1e8; }

.board[data-strips="light"] .toolbar { --good: #14804f; --warn: #9a5b00; --accent: #0b5fa5; }
.board[data-strips="light"] .toolbar .statusbar .st.bad { color: #c0271c; }
.board[data-strips="light"] .toolbar .tbtn.done,
.board[data-strips="light"] .toolbar .tbtn.twrite.armed { color: #fff; }
