/* AEROTAKTIKA · REPLIKA, Koprivnica. Author: Vladimir Fašaić.
   Dark theme with the yellow accent, sized for fingers and a tablet held sideways: a status bar, the stage, the dock.
   Nothing scrolls the page itself. Red is for fire and danger only, amber for stale and caution. */
:root {
  --bg: #0A0E13; --surface: #10161E; --raised: #161E28; --stroke: #223041; --stroke-strong: #34475F;
  --accent: #FFD900; --brand-red: #E01E37; --on-accent: #14110A; --text: #F1F4F8; --text2: #9AA7B8; --muted: #5F6C7D;
  --success: #34D27B; --warning: #FF9F1A; --danger: #F0453A; --fire: #FF5A1F; --info: #3BA7FF;
  --font: "Bahnschrift", "Segoe UI", system-ui, -apple-system, "Roboto", sans-serif;
  --status-h: 54px; --dock-h: 74px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
html { height: 100dvh; }
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); overscroll-behavior: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: var(--raised); border: 1px solid var(--stroke-strong); border-radius: 10px;
  padding: 12px 16px; min-height: 60px; min-width: 60px; font-weight: 600; letter-spacing: .02em; cursor: pointer; touch-action: manipulation; }
button:active { transform: translateY(1px); filter: brightness(1.15); }
button:disabled { opacity: .35; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.ghost { background: transparent; }
button.big { min-height: 60px; font-size: 1.1rem; }
.muted { color: var(--text2); }

/* ---- Brightness: three steps (the page is dimmed, not the screen) ---- */
html[data-brightness="1"] { filter: brightness(.45); }
html[data-brightness="2"] { filter: brightness(.72); }

/* ---- The top bar, stage, dock ---- */
#app { display: flex; flex-direction: column; height: 100%; position: relative; overflow: hidden; }
/* The top bar of every screen (statusbar.js TopBar): the logo, AERO TAKTIKA, the role chip, the fire block, a spacer, the clock and
   the pills (the connection, POMOĆNI PRIKAZ, ISPITNI POSLUŽITELJ), then the mode's end, if any. One line from 1024 px:
   the fire block gives way first (ellipsis), then the pills wrap among themselves; narrower, the pills take a line of their own.
   Above every overlay (R35), so POMOĆNI PRIKAZ and BEZ VEZE always show. */
.status { flex: none; position: relative; z-index: 60; display: flex; align-items: center; gap: 6px 12px; min-height: var(--status-h);
  padding: 6px 14px 9px; background: #0C1117; }
/* Under the bar a thin line from the orange of the name to the red of the brand. */
.status::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; pointer-events: none;
  background: linear-gradient(90deg, var(--fire), var(--brand-red)); }
.status .logo { flex: none; width: 32px; height: 32px; border-radius: 6px; }
.name { font-size: 1.35rem; letter-spacing: .08em; color: var(--accent); }
.status .name { flex: none; font-size: 1.3rem; font-weight: 700; letter-spacing: .04em; color: var(--text); white-space: nowrap; }
.status .name span { color: var(--fire); }
.bar-role, .bar-end { flex: none; display: flex; align-items: center; gap: 6px; }
/* The fire block takes the room the rest leaves (so the pills wrap only once it is down to 6em); without one, the spacer does. */
.bar-fire { flex: 1 1 0; min-width: 6em; display: flex; align-items: center; }
.bar-fire > * { min-width: 0; }
.bar-gap { flex: 1 1 0; min-width: 0; }
.bar-fire + .bar-gap { display: none; }
.status .clock { flex: none; font-size: 1.6rem; font-weight: 700; line-height: 1; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.status .clock:empty { display: none; }
.pills { flex: 0 1 auto; min-width: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
.pill.link:empty { display: none; }   /* the enrollment screen: no connection to show yet */
.status.offline { background: #6B1010; }
.status.offline .link-state { color: #FFFFFF; }
/* The fire block: a dot (green while the fire is open), the name small over the time large; the name ends in … when it is long. */
.fire-block { display: flex; align-items: center; gap: 9px; min-width: 0; }
.fire-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.fire-block.live .fire-dot { background: var(--success); box-shadow: 0 0 8px var(--success); }
.fire-block.none .fire-dot { display: none; }
.fire-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.fire-name, .status .device-name { min-width: 0; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fire-name { display: flex; }                 /* the name gives way (…), its suffix (VJEŽBA, ZATVOREN) never does */
.fire-name .fire-name-text { flex: 1 1 0; width: 0; min-width: 2em; overflow: hidden; text-overflow: ellipsis; }
/* width: 0 makes the fire block's least width 2em of the name plus the suffix, so the pills wrap before VJEŽBA or ZATVOREN is cut. */
.bar-fire:has(> .fire-block) { min-width: min-content; }
.fire-name .fire-name-suffix { flex: none; white-space: pre; }
.fire-text .fire-name { font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text2); }
.fire-text .fire-time { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.fire-text .fire-time:empty { display: none; }
.fire-block.none .fire-text .fire-name { font-size: 1rem; color: var(--text); }
/* The tablet's #who, as the reference tablet: the callsign large in gold, the type in grey (drawn from data-type: #who reads
   "866 · Požar …" as one line), then the fire in a chip, its outline green only while the map is current. Only the fire's name
   gives way (…): · VJEŽBA never does (R92), and the callsign and the type keep their size, ending in … only beyond 45 % and 30 %
   of the line. The fire slot keeps 17em, room for the callsign, its type and · VJEŽBA after a few letters of the name; the
   pills wrap among themselves first. */
.status.aircraft .bar-fire { min-width: 17em; }
.status .who { display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; }
.status .who .callsign { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.8rem;
  font-weight: 800; line-height: 1.15; letter-spacing: .02em; color: var(--accent); font-variant-numeric: tabular-nums; }
.status .who .aircraft-type { flex: none; max-width: 30%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem;
  font-weight: 700; line-height: 1.3; letter-spacing: .04em; color: var(--text2); }
.status .who .aircraft-type::before { content: attr(data-type); content: attr(data-type) / ""; }
.fire-chip { flex: 0 1 auto; min-width: 0; display: flex; padding: 3px 12px; border-radius: 999px; border: 2px solid var(--stroke-strong);
  color: var(--text); font-size: .85rem; font-weight: 800; letter-spacing: .06em; line-height: 1.35; text-transform: uppercase;
  white-space: nowrap; }
.fire-chip .chip-name { min-width: 2em; overflow: hidden; text-overflow: ellipsis; }
.fire-chip .chip-exercise { flex: none; white-space: pre; }   /* never cut; pre keeps the space of " · VJEŽBA" */
.fire-chip.current { border-color: var(--success); color: var(--success); }
.fire-chip:not(.on-fire) { color: var(--text2); }
.status .device-name { font-size: 1.05rem; font-weight: 700; color: var(--text2); }
/* Read by a screen reader (a separator in the text), not seen. */
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* ISPITNI POSLUŽITELJ (R86): a thin yellow-black stripe over the bar, without words; the pill in the bar says it. */
.test-stripe { flex: none; position: relative; z-index: 60; height: 6px;
  background: repeating-linear-gradient(135deg, var(--accent) 0 10px, var(--on-accent) 10px 20px); }
@media (max-width: 1023.98px) {
  /* A tablet held upright, a small laptop: the pills on a line of their own under the rest. */
  .status { flex-wrap: wrap; }
  .status .bar-gap { display: none; }
  .status .clock { margin-left: auto; }
  .status .pills { order: 10; flex: 1 1 100%; }
}
@media (max-width: 559.98px) {
  /* A phone: the logo speaks for the name, the fire block takes a line of its own. */
  .status .name { display: none; }
  .status .bar-fire { order: 5; flex: 1 1 100%; }
}

/* ---- Pills and the role chip ---- */
/* A status pill: a dot and a short text (the texts are capitals; units such as s and m keep their case). .ok green, .warn amber
   (stale, caution), .bad red, .test the test server's amber. A block of one line, so a text too long for its room ends in …
   (in a flex box the text would only be cut). */
.pill { display: inline-block; max-width: 100%; min-height: 30px; padding: 6px 11px; border-radius: 8px; vertical-align: middle;
  border: 1px solid var(--stroke-strong); background: var(--raised); color: var(--text); font-size: .78rem; font-weight: 700;
  letter-spacing: .05em; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums; }
.pill::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; vertical-align: 1px;
  background: var(--muted); }
.pill.plain::before { display: none; }
.pill.ok::before { background: var(--success); box-shadow: 0 0 6px var(--success); }
.pill.warn { color: var(--warning); border-color: #6A4A12; }
.pill.warn::before { background: var(--warning); }
.pill.bad { color: #FFFFFF; border-color: var(--danger); background: #3A0E0E; }
.pill.bad::before { background: #FF6B61; box-shadow: 0 0 6px var(--danger); }
.pill.test { color: var(--on-accent); border-color: var(--warning); background: var(--warning); }
.pill.test::before { background: var(--on-accent); }
.pill.aux { color: var(--warning); }
.pill.aux::before { background: var(--warning); }
/* The role: ZAPOVJEDNIK, ADMINISTRATOR, a callsign on the tablet; gold, dark words; one line that ends in … (a block, as the pill). */
.chip-role { display: inline-block; min-height: 28px; max-width: 100%; padding: 5px 10px; border-radius: 7px; vertical-align: middle;
  background: var(--accent); color: var(--on-accent); font-size: .82rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
svg.icon { flex: none; display: block; }
.update { flex: none; margin: 8px 14px 0; box-shadow: 0 10px 30px rgba(0, 0, 0, .55); position: relative; z-index: 50; }
.stage { flex: 1; min-height: 0; position: relative; padding: 12px 14px; overflow: hidden; }
.card { background: var(--surface); border: 1px solid var(--stroke); border-radius: 16px; padding: 14px 16px; min-width: 0; min-height: 0; }
.card.error { border-color: var(--warning); color: var(--warning); }
.dock { flex: none; height: calc(var(--dock-h) + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 8px;
  padding: 7px 12px calc(7px + env(safe-area-inset-bottom)); background: #0C1117; border-top: 1px solid var(--stroke); }
.dock button { min-width: 120px; }
.dock b { color: var(--accent); font-variant-numeric: tabular-nums; }

/* ---- Enrollment and the mode placeholder ---- */
input { -webkit-user-select: text; user-select: text; }   /* body forbids selection; Safari then cannot type into a field */
.enroll, .mode { max-width: 640px; margin: 0 auto; }
.enroll h2, .mode h2 { margin: 0 0 8px; font-size: 1.6rem; letter-spacing: .06em; color: var(--accent); }
.enroll form { display: grid; gap: 10px; margin: 14px 0; }
.enroll input { font: inherit; font-size: 2rem; letter-spacing: .25em; text-align: center; text-transform: uppercase; min-height: 70px;
  padding: 8px 12px; color: var(--text); background: var(--bg); border: 2px solid var(--stroke-strong); border-radius: 10px; }
.enroll input:focus { outline: none; border-color: var(--accent); }
.enroll .problem { margin: 0; color: var(--warning); font-weight: 700; }
.enroll .note { margin: 0 0 14px; color: var(--text2); }
.enroll .credit { display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--stroke); font-size: .85rem; color: var(--text2); }
.enroll .credit b { color: var(--text); }
/* ---- Aircraft tablet (modes/aircraft.js): the map fills the stage, panels and the card lie over it ---- */
button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.warnings { flex: none; position: relative; z-index: 60; }
.warning-line { padding: 5px 14px; font-weight: 700; color: var(--warning); background: #241A06; border-bottom: 1px solid #4A3608; }
/* PREUZMI KARTU POŽARA (N MB): a line under the status bar, over nothing, that the crew may ignore (R35, R57). */
.fire-offer { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 6px 14px; background: #0C1117;
  border-bottom: 1px solid var(--stroke); }
.fire-offer .progress { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text2); }
.fire-offer .problem { font-weight: 700; color: var(--warning); }
/* PAKETI KARATA on a device (packs-device.js): the tablet's POSTAVKE and the commander's POSTAVKE; the rows are the .pack-row below. */
.device-packs { display: flex; flex-direction: column; gap: 8px; }
.device-packs .state { font-variant-numeric: tabular-nums; }
/* A pack's row (packs-device.js; the administrator's rows have their own look, under .admin-screen below). */
.pack-list { display: flex; flex-direction: column; gap: 8px; }
.pack-row { display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--raised); border: 1px solid var(--stroke); }
.pack-row .line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.pack-row .name { font-size: 1.15rem; letter-spacing: .02em; color: var(--text); }
.pack-row .badge { align-self: center; }
.pack-row .state { font-weight: 700; color: var(--text2); }
.pack-row .state.ok { color: var(--success); }
.pack-row .state.caution { color: var(--warning); }
.pack-row .detail { font-weight: 600; font-variant-numeric: tabular-nums; }
.pack-row .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pack-row .actions:not(:has(button:not([hidden]))) { display: none; }
.pack-row .rebuild.armed { color: var(--warning); border-color: var(--warning); }
.pack-row .delete.armed { color: var(--danger); border-color: var(--danger); }   /* a destructive second tap */
.stage.flush { padding: 0; }
/* The tablet, as the reference tablet: the map fills the screen; over its left one column (.map-column) holds the data tiles,
   DIRECT TO, the open panel (only as tall as it needs, then it scrolls), a toast and the card at its foot, so none lies over
   another; the map buttons, rounded squares, stand at the right. --strip-room: the foot kept free for the PREUZMI? strip
   (picker.js); --map-foot: the strip at the map's foot where the map draws its scale (right) and the source's attribution
   (left): nothing lies on it. */
.aircraft-screen { position: absolute; inset: 0; overflow: hidden; background: #0B1118; --strip-room: 0px; --map-foot: 36px; }
#map { position: absolute; top: 0; left: 0; width: 100%; height: calc(100% - var(--strip-room)); display: block; }
/* The map's buttons (mapbuttons.js): a column of dark 60 × 60 px squares, an icon each (the brightness step and the layer in small
   letters under theirs); a choice that is on has a gold border and a gold icon. 60 px also with a mouse. */
.map-buttons { position: absolute; top: 10px; right: 10px; bottom: calc(10px + var(--strip-room)); display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.map-buttons button { flex: none; width: 60px; height: 60px; min-width: 60px; min-height: 60px; padding: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px; border-radius: 12px; border: 1px solid var(--stroke-strong); color: var(--text);
  background: rgba(16, 22, 30, .92); }
.map-buttons .map-button-text { display: block; max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: .62rem; font-weight: 700; letter-spacing: .04em; line-height: 1.25; font-variant-numeric: tabular-nums; }
.map-buttons button:has(.map-button-text) svg.icon { width: 22px; height: 22px; }
/* On the tablet the map's buttons are rounded squares of a 16 px radius, as on the reference tablet (R91). The square is only
   drawn (::before), so the whole 60 × 60 px box takes a tap, its corners too; a choice that is on draws it in gold. Their column
   ends where its last button does (never on the map's foot). */
.aircraft-screen .map-buttons { bottom: auto; max-height: calc(100% - 10px - var(--map-foot) - var(--strip-room)); }
.aircraft-screen .map-buttons button { position: relative; z-index: 0; border-radius: 0; border-color: transparent; background: transparent;
  box-shadow: none; }
.aircraft-screen .map-buttons button::before { content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: 16px;
  border: 1px solid var(--stroke-strong); background: rgba(16, 22, 30, .92); box-shadow: 0 6px 16px rgba(0, 0, 0, .45); }
.aircraft-screen .map-buttons button[aria-pressed="true"] { border-color: transparent; box-shadow: none; }
.aircraft-screen .map-buttons button[aria-pressed="true"]::before { border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent), 0 6px 16px rgba(0, 0, 0, .45); }
.map-column { position: absolute; top: 10px; left: 10px; right: 80px; bottom: calc(var(--map-foot) + var(--strip-room)); display: flex;
  flex-direction: column; align-items: flex-start; gap: 8px; pointer-events: none; }   /* the map between its parts takes the taps */
.map-column > * { flex: none; max-width: 100%; pointer-events: auto; }
/* The data tiles (R84): small dark tiles, a caption in capitals over a large value and maybe a small note (PRIKAZ OD …, ±5 m);
   amber when stale, red when lost. VEZA is the bar's connection (R92): its dot is green, amber or red as the pill's was. They
   only show. */
.data-tiles { display: flex; flex-wrap: wrap; gap: 6px; }
.data-tile { min-width: 84px; display: flex; flex-direction: column; gap: 1px; padding: 7px 12px 8px; border-radius: 10px; color: var(--text);
  background: rgba(16, 22, 30, .92); border: 1px solid var(--stroke); box-shadow: 0 6px 16px rgba(0, 0, 0, .4); }
.data-tile.warn { color: var(--warning); }
.data-tile.bad { color: var(--danger); border-color: var(--danger); }
.tile-caption { font-size: .68rem; font-weight: 700; letter-spacing: .1em; line-height: 1.35; text-transform: uppercase; color: var(--text2);
  white-space: nowrap; }
.data-tile[data-tile="link"] .tile-caption::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px;
  border-radius: 50%; vertical-align: 1px; background: var(--muted); }
.data-tile.ok .tile-caption::before { background: var(--success); box-shadow: 0 0 6px var(--success); }
.data-tile.warn .tile-caption::before { background: var(--warning); }
.data-tile.bad .tile-caption::before { background: var(--danger); box-shadow: 0 0 6px var(--danger); }
.tile-body { display: flex; flex-direction: column; }
.tile-value { font-size: 1.3rem; font-weight: 700; line-height: 1.2; letter-spacing: .01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile-note { font-size: .72rem; font-weight: 700; letter-spacing: .04em; line-height: 1.3; font-variant-numeric: tabular-nums; white-space: nowrap;
  color: var(--text2); }
.data-tile.bad .tile-note { color: var(--text); }
/* NAV and ✚ TOČKA are floating panels (float-panel.js), POSTAVKE a panel of the same look: in the column, only as tall as they
   need; what does not fit scrolls. Every button keeps 60 × 60 px on the tablet, also with a mouse. */
.map-column > .float-panel, .map-column > .panel { position: relative; z-index: auto; flex: 0 1 auto; min-height: 0; width: min(440px, 100%); }
.aircraft-screen .float-panel-head button { min-width: 60px; min-height: 60px; }
.panel { overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--stroke); box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
.panel h3, .marker-card h3 { margin: 0; font-size: 1.2rem; letter-spacing: .06em; color: var(--accent); }
.panel h4 { margin: 10px 0 0; font-size: .85rem; letter-spacing: .1em; color: var(--text2); }
.map-column p { margin: 0; }
.aircraft-screen .caution { color: var(--warning); font-weight: 700; }
.direct-bar .age, .direct-bar > button { flex: none; white-space: nowrap; }
.map-column .row { display: flex; flex-wrap: wrap; gap: 8px; }
.map-column .row > button { flex: 1 1 140px; }
.map-column .problem, .picker .problem { color: var(--warning); font-weight: 700; }
.badge { justify-self: start; align-self: start; padding: 1px 8px; border-radius: 6px; font-size: .8rem; font-weight: 800;
  letter-spacing: .06em; color: var(--on-accent); background: var(--accent); }
.badge.other { color: var(--text2); background: none; box-shadow: inset 0 0 0 1px var(--text2); }
.nav-list { display: flex; flex-direction: column; gap: 6px; }
.nav-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 10px; text-align: left; }
.nav-row .row-name { grid-column: 2; }
.nav-row .badge[hidden] + .row-name { grid-column: 1 / -1; }
.nav-row .leg { grid-column: 1 / -1; font-variant-numeric: tabular-nums; color: var(--text2); font-weight: 600; }
.propose .kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.propose .kind { min-height: 72px; }
.settings .value { font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.settings .about { display: grid; gap: 4px; font-size: .9rem; color: var(--text2); }
.settings .about b { color: var(--text); }
.settings .statement { margin: 4px 0 0; padding-left: 18px; }
.settings #change-aircraft.armed { color: var(--warning); border-color: var(--warning); }
/* The card at the column's foot (after a toast, if one shows). */
.marker-card { order: 2; margin-top: auto; width: min(400px, 100%); display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--stroke-strong); box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
.marker-card .label { font-size: 1.15rem; font-weight: 700; }
.marker-card .leg { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.direct-bar { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 14px; border-radius: 12px; background: rgba(16, 22, 30, .95);
  border: 2px solid #E05CFF; color: #F0A8FF; font-weight: 700; box-shadow: 0 6px 16px rgba(0, 0, 0, .4); }
.direct-bar .text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker { position: absolute; inset: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 24px 16px; background: var(--bg); }
.picker h2 { margin: 0; font-size: 1.6rem; letter-spacing: .08em; color: var(--accent); }
.picker .question { font-size: 1.3rem; font-weight: 700; text-align: center; }
.picker .row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.picker .choices { width: min(780px, 100%); display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.picker .aircraft-choice { min-height: 72px; font-size: 1.3rem; }
/* A bound tablet's PREUZMI? question: a strip at the map's foot, the map and the status bar stay usable (R35). */
.picker.strip { inset: auto 10px 10px 10px; padding: 10px 14px; flex-direction: row; flex-wrap: wrap; justify-content: center;
  border-radius: 14px; background: rgba(16, 22, 30, .97); border: 2px solid var(--warning); }
.picker.strip .question { font-size: 1.1rem; }
/* Over the map, under the status bar (which stays on top, R35): the content keeps clear of it. */
.overlay { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 150px 24px 24px;
  background: rgba(5, 7, 10, .93); }
.notice { font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: .03em; line-height: 1.3; text-align: center;
  color: var(--accent); cursor: pointer; }
.disclaimer .card { width: min(640px, 100%); display: grid; gap: 12px; }
.disclaimer h2 { margin: 0; letter-spacing: .08em; color: var(--warning); }
.disclaimer ul { margin: 0; padding-left: 22px; display: grid; gap: 8px; font-size: 1.15rem; }
.toast { position: fixed; left: 50%; bottom: calc(var(--dock-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 45; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 10px; font-weight: 700; color: var(--text);
  background: #1D2633; border: 1px solid var(--stroke-strong); box-shadow: 0 10px 30px rgba(0, 0, 0, .55); }
/* The tablet's notices, as on the reference tablet: a yellow banner over the map's top, dark bold words, clear of the map's buttons
   (it may lie over the data tiles, which only show, for the 8 s it stays); a tap closes it sooner. */
.aircraft-screen > .overlay.notice { position: absolute; inset: auto; top: 10px; left: 10px; right: 80px; z-index: 40; display: block;
  max-width: 760px; margin: 0 auto; padding: 14px 20px; border-radius: 12px; background: var(--accent); color: var(--on-accent);
  font-size: clamp(1.05rem, 1.9vw, 1.3rem); font-weight: 800; letter-spacing: .03em; line-height: 1.3; text-align: left;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
/* The tablet's toast: a part of the column, at its foot above the card, so it lies over nothing (a tall panel gives it room for its
   6 s and scrolls). */
.map-column > .toast { position: static; order: 1; margin-top: auto; transform: none; max-width: 100%; }
.map-column:has(> .toast:not([hidden])) > .marker-card { margin-top: 0; }

/* ---- Commander (modes/commander.js), a tactical map: the map fills the stage; over it float POŽAR at the left and TAKTIČKI ALATI
   at the right (each folds to its head), the map's buttons in a column beside TAKTIČKI ALATI, DNEVNIK at the foot, and the panels
   of the bottom nav (POŽARI, VIDEO, POSTAVKE) in the place of TAKTIČKI ALATI. Narrower than 1024 px the panels start folded to
   heads that fit two in a row, the map's buttons stand under them and DNEVNIK takes the whole foot. Red only for fire and danger:
   the lists use calm colours and amber for stale and caution. ---- */
.commander-screen { position: absolute; inset: 0; overflow: hidden; background: #0B1118; --strip-room: 0px;
  --panel-w: clamp(300px, 24vw, 340px); --head-h: 60px;
  /* The strip at the map's foot where the map draws its scale (right) and the source's attribution (left): nothing floats over
     it. DNEVNIK stands on it, and --foot-room is everything up to DNEVNIK's top. */
  --map-foot: 36px; --foot-room: calc(var(--map-foot) + 70px); }
.commander-screen .caution { color: var(--warning); }
.commander-screen .problem { margin: 0; color: var(--warning); font-weight: 700; }
.commander-screen p { margin: 0; }
.commander-screen .row { display: flex; flex-wrap: wrap; gap: 8px; }
.commander-screen .row > button { flex: 1 1 120px; }
.commander-screen button.armed { color: var(--warning); border-color: var(--warning); }
.commander-screen .float-panel-head { min-height: 48px; }
.float-panel-badges { flex: none; display: flex; align-items: center; gap: 6px; }
/* A count in a panel's head (proposals waiting, conflict drafts): seen also while the panel is folded. */
.count-badge { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--accent); background: rgba(255, 217, 0, .15); color: var(--accent); font-size: .8rem; font-weight: 800;
  font-variant-numeric: tabular-nums; line-height: 1.3; }
.count-badge.warn { border-color: var(--warning); background: #241A06; color: var(--warning); }
/* Where each floats. */
.commander-screen .side-panel { top: 10px; left: 10px; width: var(--panel-w); max-height: calc(100% - 10px - var(--map-foot)); }
.commander-screen .tool-palette { top: 10px; right: 10px; width: var(--panel-w); max-height: calc(100% - 10px - var(--map-foot)); }
.commander-screen .menu-panel { top: 10px; right: 10px; z-index: 20; width: var(--panel-w);
  max-height: calc(100% - 10px - var(--map-foot)); }
.commander-screen .map-buttons { bottom: auto; max-height: calc(100% - 20px - var(--foot-room)); }
.commander-screen.right-open .map-buttons, .commander-screen.right-folded .map-buttons { right: calc(var(--panel-w) + 20px); }
.commander-screen .float-panel-body > .panel-section + .panel-section { margin-top: 6px; }
/* Captions inside the panels, as POSTAVI OZNAKU: small grey capitals. */
.panel-section h3, .tool-palette h4, .menu-panel h4 { margin: 4px 0 0; font-size: .78rem; font-weight: 700; letter-spacing: .1em; line-height: 1.35;
  text-transform: uppercase; color: var(--text2); }
.panel-section { display: flex; flex-direction: column; gap: 8px; }
.commander-screen .float-panel button.big { font-size: .85rem; }

/* POŽAR: the aircraft, each a row: the callsign in bold, its type and DEMO on one line (… when long), its age and the battery,
   whether its tablet has the map; KAMERA and UKLONI at the right. Then the proposals, dashed. */
.aircraft-list, .proposal-list { display: flex; flex-direction: column; gap: 6px; }
.aircraft-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; padding: 8px 10px; border-radius: 10px;
  background: var(--raised); border: 1px solid var(--stroke); }
.aircraft-row > .line, .aircraft-row > .state-line, .aircraft-row > .map-state { grid-column: 1; min-width: 0; }
.aircraft-row .line { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.aircraft-row .callsign { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 1.1rem; letter-spacing: .03em;
  line-height: 1.3; }
.aircraft-row .type { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text2); font-size: .9rem;
  font-weight: 600; }
.aircraft-row .line .badge { flex: none; align-self: center; }
.aircraft-row .state-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: .9rem; }
.aircraft-row .state-line:not(:has(> :not([hidden]))) { display: none; }
.aircraft-row .battery { color: var(--text2); font-weight: 600; }
.aircraft-row .age { font-weight: 700; font-variant-numeric: tabular-nums; color: #4DD0E1; }
.aircraft-row .age.caution { color: var(--warning); }
.aircraft-row .age.lost, .aircraft-row .age.none { color: #8A94A3; }
.aircraft-row .waiting { font-weight: 800; }
.aircraft-row .map-state { font-size: .85rem; font-weight: 700; }
.aircraft-row .map-state.ok { color: var(--success); }
.aircraft-row .map-state.unknown { color: var(--text2); }
.aircraft-row .row-actions { grid-column: 2; grid-row: 1 / span 3; display: flex; flex-direction: column; gap: 6px; }
.aircraft-row .row-actions:not(:has(> button:not([hidden]))) { display: none; }
.aircraft-row .camera { display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.aircraft-row .remove { max-width: 120px; padding: 6px 10px; font-size: .8rem; }
.proposal-row { display: grid; gap: 6px; padding: 8px 10px; border-radius: 10px; background: var(--raised); border: 1px dashed var(--stroke-strong); }
.proposal-row .text { font-weight: 700; }
.proposal-row .decided { font-weight: 700; }

/* POŽARI, VIDEO, POSTAVKE: floating panels of the bottom nav in the place of TAKTIČKI ALATI. */
.menu-panel .fires, .menu-panel .helpers, .camera-choices { display: flex; flex-direction: column; gap: 6px; }
.menu-panel .fire-choice, .chooser .choice { display: grid; gap: 2px; text-align: left; }
.menu-panel .fire-choice b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-panel .detail, .chooser .detail { color: var(--text2); font-size: .9rem; font-weight: 600; }
.menu-panel .about { display: grid; gap: 4px; font-size: .9rem; color: var(--text2); }
.menu-panel .about b { color: var(--text); }
.menu-panel .statement { margin: 4px 0 0; padding-left: 18px; }
.menu-panel button.armed { color: var(--warning); border-color: var(--warning); }
.camera-choice { display: flex; align-items: center; gap: 10px; text-align: left; }
.camera-choice b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.incident-form { display: grid; gap: 8px; padding: 10px; border-radius: 10px; border: 1px solid var(--accent); }
.incident-form .field { display: grid; gap: 4px; }
.incident-form input { font: inherit; font-size: 1.1rem; min-width: 0; min-height: 60px; padding: 8px 12px; color: var(--text); background: var(--bg);
  border: 2px solid var(--stroke-strong); border-radius: 10px; }
.incident-form input:focus { outline: none; border-color: var(--accent); }
.incident-form .point { font-weight: 700; font-variant-numeric: tabular-nums; }
.helper-row { display: grid; gap: 4px; padding: 8px 10px; border-radius: 10px; background: var(--raised); }
.chooser { position: absolute; inset: 0; z-index: 30; display: flex; align-items: flex-start; justify-content: center; padding: 24px 16px;
  overflow-y: auto; background: rgba(5, 7, 10, .75); }
.chooser h3 { margin: 0; font-size: 1.1rem; letter-spacing: .08em; color: var(--accent); }
.chooser .card { width: min(680px, 100%); display: grid; gap: 10px; }
.chooser .choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.chooser .choice { min-height: 72px; }
.commander-screen .empty-state { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100% - 32px));
  z-index: 5; display: grid; gap: 10px; }
.empty-state h2 { margin: 0; font-size: 1.6rem; letter-spacing: .06em; color: var(--accent); }
.empty-state .device { font-size: 1.2rem; font-weight: 700; }

/* DNEVNIK: a bar at the map's foot, the newest entry in one line with its time; the whole log opens above it. */
.log-bar { position: absolute; bottom: var(--map-foot); left: calc(var(--panel-w) + 20px); right: calc(var(--panel-w) + 20px); z-index: 9;
  max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 6px 18px; border-radius: 14px;
  border: 1px solid var(--stroke); background: rgba(16, 22, 30, .94); box-shadow: 0 12px 32px rgba(0, 0, 0, .5); color: var(--text);
  font-weight: 600; text-align: left; }
.log-bar > svg.icon { color: var(--accent); }
.log-bar .log-label { flex: none; color: var(--accent); letter-spacing: .08em; }
.log-bar .log-latest { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; line-height: 1.35; }
.log-bar[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
.log-bar .time, .log-panel .time { color: var(--text2); font-variant-numeric: tabular-nums; }
.commander-screen .log-panel { bottom: var(--foot-room); left: calc(var(--panel-w) + 20px); right: calc(var(--panel-w) + 20px); z-index: 14;
  max-width: 640px; margin: 0 auto; max-height: calc(100% - var(--foot-room) - 10px); }
.log-panel .events { margin: 0; padding: 0; list-style: none; font-size: .95rem; }
.log-panel .event { padding: 5px 0; border-bottom: 1px solid var(--stroke); }

/* TAKTIČKI ALATI (draw-tools.js, tool-palette.js): ODABERI / BRIŠI / PONIŠTI as big tiles, the kinds in two columns with their icon in
   the kind's colour, NATPIS and ZA: with a chip for each aircraft. The tool in use outlined in gold on a soft gold. */
.tool-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tool-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 64px;
  padding: 6px 4px; border-radius: 10px; border: 1px solid var(--stroke); background: var(--raised); color: var(--text); font-size: .72rem;
  font-weight: 700; letter-spacing: .03em; line-height: 1.3; text-transform: uppercase; text-align: center; }
.tool-tile > span { max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  line-height: 1.45; }   /* room for the carons of Š and Č over the capitals */
.tool-tile[aria-pressed="true"] { border-color: var(--accent); background: rgba(255, 217, 0, .15); color: var(--accent); box-shadow: none; }
.tool-palette .field { display: grid; gap: 4px; margin-top: 4px; }
.tool-palette .field > span { font-size: .78rem; font-weight: 700; letter-spacing: .1em; line-height: 1.35; text-transform: uppercase;
  color: var(--text2); }
.tool-palette input { font: inherit; font-size: 1.05rem; min-width: 0; min-height: 60px; padding: 8px 12px; color: var(--text); background: var(--bg);
  border: 2px solid var(--stroke-strong); border-radius: 10px; }
.tool-palette input:focus { outline: none; border-color: var(--accent); }
.tool-palette .for { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tool-palette .for-title { font-size: .78rem; font-weight: 700; letter-spacing: .1em; color: var(--text2); }
.tool-palette .callsigns { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.tool-palette .for-aircraft { max-width: 100%; padding: 4px 16px; border-radius: 999px; font-size: .95rem; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.tool-palette .for-aircraft[aria-pressed="true"] { background: rgba(255, 217, 0, .15); box-shadow: none; }
.tool-palette .how { font-size: .8rem; }
/* The kinds a little tighter than the shared .tool-btn, so their longest words (IZBACIVANJA, HELIKOPTERA) stay whole in two columns. */
.tool-palette .tool-btn { gap: 7px; padding: 6px 8px; letter-spacing: .01em; }
.tool-palette .tool-btn > svg.icon { width: 22px; height: 22px; }
.tool-palette .drafts { display: grid; gap: 6px; padding: 8px 10px; border-radius: 10px; border: 2px solid var(--warning); background: #241A06; }
.tool-palette .drafts h4 { margin: 0; color: var(--warning); }
.tool-palette .draft-list { display: grid; gap: 6px; }
.tool-palette .draft-row { display: grid; gap: 4px; }
.tool-palette .draft-row .text { font-weight: 700; }
.tool-palette .draft-row button { flex: 1 1 100px; padding: 6px 8px; font-size: .85rem; }
@media (pointer: fine) and (not (any-pointer: coarse)) {
  /* Only a mouse, no touch screen: the chips take less height. Whenever a finger can be used they keep 60 px. */
  .tool-palette .for-aircraft { min-height: 44px; }
  .commander-screen { --head-h: 48px; }   /* a panel head with its 44 px button */
}
.draw-bar { position: absolute; top: 10px; left: calc(var(--panel-w) + 20px); z-index: 13; display: flex; align-items: center; gap: 8px;
  max-width: calc(100% - 2 * var(--panel-w) - 120px); padding: 4px 4px 4px 12px; border-radius: 12px; background: rgba(16, 22, 30, .95);
  border: 2px solid var(--accent); font-weight: 700; }
.draw-bar .text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draw-bar button { flex: none; padding: 8px 12px; }
.feature-card { position: absolute; left: calc(var(--panel-w) + 20px); bottom: var(--foot-room); z-index: 12;
  width: min(420px, calc(100% - 2 * var(--panel-w) - 120px)); max-height: calc(100% - var(--foot-room) - 90px); overflow-y: auto; display: grid;
  gap: 6px; padding: 12px 14px; border-radius: 14px; background: rgba(16, 22, 30, .97); border: 1px solid var(--stroke-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
.feature-card h3 { margin: 0; font-size: 1.2rem; letter-spacing: .06em; color: var(--accent); }
.feature-card .label { font-size: 1.1rem; font-weight: 700; }
.feature-card .seen-list { display: grid; gap: 2px; }
.feature-card .seen { font-weight: 700; font-variant-numeric: tabular-nums; }
.feature-card .seen.ok { color: var(--success); }
.feature-card .seen.unknown { color: var(--text2); }
.feature-card .conflict { color: var(--warning); font-weight: 700; }
.feature-card .how { font-size: .85rem; }
/* The commander's video panels (video-panel.js): bottom right over the map, left of its buttons, several side by side; ⛶ fills the
   screen (or, where the browser refuses, the whole map area: the status bar stays). NEMA SLIKE is amber: stale, not danger. */
.video-panels { position: absolute; right: calc(var(--panel-w) + 100px); bottom: var(--foot-room); z-index: 12; display: flex; flex-wrap: wrap-reverse;
  justify-content: flex-end; align-items: flex-end; gap: 8px; max-width: calc(100% - 2 * var(--panel-w) - 130px); pointer-events: none; }
.video-panel { pointer-events: auto; width: min(400px, 100%); display: flex; flex-direction: column; gap: 6px; padding: 6px;
  border-radius: 14px; background: rgba(16, 22, 30, .97); border: 1px solid var(--stroke-strong); box-shadow: 0 10px 30px rgba(0, 0, 0, .55); }
.video-panel .head { display: flex; align-items: center; gap: 6px; }
.video-panel .title { flex: 1; min-width: 0; margin: 0 0 0 6px; font-size: 1.1rem; letter-spacing: .06em; color: var(--accent);
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-panel .aux-note { display: none; flex: none; font-size: .85rem; font-weight: 700; letter-spacing: .06em; color: var(--warning); }
.video-panel .head button { flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 6px 12px; font-size: 1.3rem;
  line-height: 1; }
.video-panel .picture { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.video-panel video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.video-panel .overlay { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: calc(100% - 24px); margin: 0;
  padding: 8px 14px; border-radius: 10px; background: rgba(5, 7, 10, .82); text-align: center; font-size: 1.15rem; font-weight: 800;
  letter-spacing: .04em; color: var(--text); }
.video-panel .overlay.caution { color: var(--warning); border: 2px solid var(--warning); }
.video-panel .overlay .text, .video-panel .overlay .note { display: block; }
.video-panel .overlay .note { margin-top: 4px; font-size: .8em; }
.video-panels:has(> .video-panel.maximized) { inset: 0; max-width: none; z-index: 40; }
.video-panels:has(> .video-panel.maximized) > .video-panel:not(.maximized) { display: none; }
.video-panel.maximized, .video-panel:fullscreen { width: 100%; height: 100%; border-radius: 0; }
.video-panel.maximized .picture, .video-panel:fullscreen .picture { flex: 1; aspect-ratio: auto; }
.video-panel:fullscreen .aux-note { display: inline; }
.video-panel.maximized .overlay, .video-panel:fullscreen .overlay { font-size: clamp(1.2rem, 3vw, 2.4rem); }
/* The commander's notices: a banner over the map, under the status bar, not over the whole screen; a short line above DNEVNIK. */
.commander-app .overlay.notice { inset: auto; top: calc(var(--status-h) + 24px); left: 50%; transform: translateX(-50%);
  width: min(760px, calc(100% - 32px)); padding: 16px 20px; border-radius: 14px; border: 2px solid var(--accent);
  background: rgba(16, 22, 30, .97); font-size: clamp(1.1rem, 2.4vw, 1.5rem); }
.commander-app .toast { bottom: calc(var(--dock-h) + 120px + env(safe-area-inset-bottom)); }
@media (max-width: 1023.98px) {
  /* A tablet held upright, a small laptop: the panels fold to heads that fit two in a row; one opened lies over the map, above the
     other head and the map's buttons, and leaves DNEVNIK free; the rest moves out of their way. */
  .commander-screen .float-panel.minimized { width: auto; max-width: calc(50% - 15px); }
  .commander-screen .side-panel:not(.minimized), .commander-screen .tool-palette:not(.minimized) { z-index: 15;
    width: min(var(--panel-w), calc(100% - 20px)); max-height: calc(100% - 20px - var(--foot-room)); }
  .commander-screen .menu-panel { width: min(380px, calc(100% - 20px)); }
  .commander-screen.right-open .map-buttons, .commander-screen.right-folded .map-buttons { top: calc(var(--head-h) + 22px); right: 10px;
    max-height: calc(100% - var(--head-h) - 32px - var(--foot-room)); }
  .log-bar, .commander-screen .log-panel { left: 10px; right: 10px; }
  .draw-bar { top: calc(var(--head-h) + 22px); left: 10px; max-width: calc(100% - 100px); }
  .feature-card { left: 10px; width: min(420px, calc(100% - 90px)); }
  .video-panels { right: 80px; max-width: calc(100% - 90px); }
}
@media (max-width: 559.98px) {
  /* A phone: the folded heads one under the other at the left (the map's buttons keep the right), an opened panel as wide as
     the screen. */
  .commander-screen .float-panel.minimized { max-width: calc(100% - 90px); }
  .commander-screen .tool-palette.minimized { top: calc(var(--head-h) + 18px); left: 10px; right: auto; }
  .commander-screen.right-folded .map-buttons { top: 10px; max-height: calc(100% - 20px - var(--foot-room)); }
  .commander-screen .side-panel:not(.minimized), .commander-screen .tool-palette:not(.minimized), .commander-screen .menu-panel {
    left: 10px; right: 10px; width: auto; }
  .draw-bar { top: calc(2 * var(--head-h) + 26px); }
}
/* ---- Administrator (modes/admin.js), as the reference boards: the page shown scrolls above the bottom nav; each page has a big
   white title in capitals, one muted line under it, and its content in cards (board.js); the lists are the rows of a log. Red only
   for fire, danger and a destructive second tap (OPOZOVI, OBRIŠI); amber for stale and caution. Every button and field keeps
   60 × 60 px (the global button rule): an administrator may use a tablet. ---- */
.admin-screen { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.admin-content { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; display: flex;
  flex-direction: column; padding: 16px 28px 28px; }
.admin-screen p { margin: 0; }
/* Whose screen this is, over every page's title (the reference has the board's group over its title). */
.admin-kicker { flex: none; margin: 0 0 2px; font-size: .78rem; font-weight: 700; letter-spacing: .16em; line-height: 1.4; color: var(--text2);
  text-transform: uppercase; }
.admin-section { flex: none; display: flex; flex-direction: column; gap: 18px; width: 100%; max-width: 1560px; min-width: 0; }
.page-head { display: grid; gap: 4px; min-width: 0; }
.admin-screen .page-title { margin: 0; font-size: 2rem; font-weight: 800; line-height: 1.2; letter-spacing: .03em; text-transform: uppercase;
  color: var(--text); overflow-wrap: anywhere; }
.page-sub { font-size: .92rem; line-height: 1.4; color: var(--text2); }
/* The cards: side by side on a wide screen (NOVI … at the left, the list at the right, as NOVA ZAPOVIJED and DNEVNIK ZAPOVIJEDI),
   one under the other on a narrow one. */
.board { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; min-width: 0; }
.board-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@media (min-width: 760px) {
  .board-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-grid .about-card { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  .board-split { grid-template-columns: minmax(340px, 5fr) minmax(0, 7fr); }
}
/* A card: a bordered box; its head a gold icon, a title in capitals and, at the right, a count or the card's actions. */
.admin-screen .card { display: flex; flex-direction: column; min-width: 0; padding: 0; background: var(--surface); border: 1px solid var(--stroke);
  border-radius: 12px; }
.card-head { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-height: 50px; padding: 12px 16px 4px; }
.card-head > svg.icon { width: 20px; height: 20px; color: var(--accent); }
.card-title { flex: 1 1 auto; min-width: 0; margin: 0; font-size: .9rem; font-weight: 800; letter-spacing: .08em; line-height: 1.35;
  text-transform: uppercase; color: var(--text); }
.card-side { flex: 0 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 10px;
  margin-left: auto; font-size: .76rem; font-weight: 700; letter-spacing: .06em; line-height: 1.35; text-align: right; text-transform: uppercase;
  color: var(--text2); font-variant-numeric: tabular-nums; }
.card-side:not(:has(> :not([hidden]))) { display: none; }
.card-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 8px 16px 16px; }
.card-body > .primary, .card-body > .lead + .primary { align-self: flex-start; }
.admin-screen .caution, .admin-screen .problem { color: var(--warning); font-weight: 700; }
.admin-screen .ok { color: var(--success); }
.admin-screen .row { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-screen .row > button { flex: 1 1 160px; }
/* A choice pressed (a role, a type, a layer, a zoom, the language): gold on a soft gold, as the reference's command chosen. */
.admin-screen button[aria-pressed="true"] { background: rgba(255, 217, 0, .12); }
/* The forms keep their fields: captions in small grey capitals, dark fields that turn gold while typed in. */
.admin-form { display: grid; gap: 10px; }
.admin-form h4 { margin: 6px 0 0; font-size: .75rem; font-weight: 700; letter-spacing: .1em; color: var(--text2); }
.admin-form .field { display: grid; gap: 6px; }
.admin-form .field > span:first-child { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text2); }
.admin-screen input[type="text"] { min-width: 0; font: inherit; font-size: 1.15rem; min-height: 60px; padding: 8px 14px; color: var(--text);
  background: var(--bg); border: 1px solid var(--stroke-strong); border-radius: 8px; }
.admin-screen input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.admin-form .hint { font-weight: 400; font-size: .85rem; color: var(--text2); }
.admin-form .choices, .device-row .binding-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.admin-form .choices button, .device-row .binding-choices button { text-align: left; }
.admin-screen .check { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 14px; justify-self: start; cursor: pointer;
  font-weight: 600; border-radius: 8px; border: 1px solid var(--stroke-strong); background: var(--bg); }
.admin-screen .check input { width: 28px; height: 28px; margin: 0; accent-color: var(--accent); }
/* A first tap that only asks (OPOZOVI, OBRIŠI, NOVI KLJUČ, OBNOVI, an aircraft another tablet has): its border and words in the
   colour of what the second tap does, on a tint of it, and a bar along its foot that drains over the time the second tap counts
   (--second-tap, set by admin.js). Red for what cannot be undone, amber for the rest. */
.admin-screen button.armed { --armed: var(--warning); color: var(--armed); border: 2px solid var(--armed);
  background: linear-gradient(var(--armed), var(--armed)) left bottom / 100% 4px no-repeat, color-mix(in srgb, var(--armed) 16%, var(--raised));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--armed) 28%, transparent); animation: armed-drain var(--second-tap, 5s) linear forwards; }
.admin-screen .device-row .revoke.armed, .admin-screen .pack-row .delete.armed { --armed: var(--danger); }
@keyframes armed-drain { to { background-size: 0% 4px, auto; } }
@media (prefers-reduced-motion: reduce) {
  .admin-screen button.armed { animation: none; }
}
/* NOVI UREĐAJ, NOVI ZRAKOPLOV and the code. */
.new-card .lead { font-size: .92rem; }
.enroll-card .who { font-weight: 700; }
.enroll-card .qr { width: min(280px, 100%); aspect-ratio: 1; padding: 10px; border-radius: 8px; background: #FFFFFF; image-rendering: pixelated; }
.enroll-card .code { font-size: 2.4rem; font-weight: 800; letter-spacing: .2em; font-variant-numeric: tabular-nums; color: var(--accent);
  -webkit-user-select: text; user-select: text; }
.enroll-card .code.expired { color: var(--muted); text-decoration: line-through; }
.enroll-card .countdown { font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.enroll-card .card-body > button { align-self: flex-start; }
/* The lists as a log: each row a dark box with a coloured edge for its state (green on the link or ready, amber waiting or failed,
   blue while built, muted otherwise), the name in bold, the details under it in grey, the state with its dot at the right, then
   the row's actions. */
.device-list, .fleet-list, .admin-screen .pack-list, .overview .fire-list { display: flex; flex-direction: column; gap: 8px; }
.device-row, .fleet-row, .admin-screen .pack-row, .fire-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr);
  align-items: center; gap: 4px 14px; padding: 10px 14px 10px 24px; border-radius: 10px; background: var(--raised); border: 1px solid var(--stroke); }
.device-row::before, .fleet-row::before, .admin-screen .pack-row::before, .fire-row::before { content: ""; position: absolute; left: 10px;
  top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--muted); }
.device-row[data-state="online"]::before, .fleet-row[data-state="online"]::before, .admin-screen .pack-row[data-state="ready"]::before,
  .fire-row[data-state="commanded"]::before { background: var(--success); }
.device-row[data-state="waiting"]::before, .admin-screen .pack-row[data-state="failed"]::before,
  .fire-row[data-state="uncommanded"]::before { background: var(--warning); }
.admin-screen .pack-row[data-state="building"]::before { background: var(--info); }
.device-row.revoked { opacity: .6; }
.device-row .line, .fleet-row .line, .admin-screen .pack-row .line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
/* .name is also the logo's text in the status bar: here it is a device's name, in the text colour. */
.device-row .name, .fleet-row .callsign, .admin-screen .pack-row .name { min-width: 0; font-size: 1.1rem; font-weight: 800; letter-spacing: .02em;
  color: var(--text); overflow-wrap: anywhere; }
.device-row .badge, .fleet-row .badge, .admin-screen .pack-row .badge { align-self: center; }
.device-row .sub, .fleet-row .sub, .admin-screen .pack-row .detail, .admin-screen .pack-row .layers { min-width: 0; font-size: .85rem;
  font-weight: 600; letter-spacing: .03em; color: var(--text2); }
.admin-screen .pack-row .detail { font-variant-numeric: tabular-nums; }
/* The state at the right: a dot in its colour, then its words. */
.device-row > .state, .fleet-row > .online, .admin-screen .pack-row > .state { justify-self: end; white-space: nowrap; font-size: .8rem;
  font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text); font-variant-numeric: tabular-nums; }
.device-row > .state::before, .fleet-row > .online::before, .admin-screen .pack-row > .state::before, .fire-row .commander::before {
  content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; vertical-align: 0; background: var(--muted); }
.device-row > .state.ok::before, .fleet-row > .online.ok::before, .admin-screen .pack-row > .state.ok::before, .fire-row .commander::before {
  background: var(--success); box-shadow: 0 0 6px var(--success); }
.device-row > .state.caution::before, .admin-screen .pack-row > .state.caution::before, .fire-row .commander.caution::before {
  background: var(--warning); box-shadow: none; }
.admin-screen .pack-row > .state.busy::before { background: var(--info); }
/* A list whose last read failed or is old (data-stale) never wears the live look: the edge and the dot go muted, no glow. */
[data-stale] .device-row[data-state="online"]::before, [data-stale] .fleet-row[data-state="online"]::before,
  [data-stale] .fire-row[data-state="commanded"]::before { background: var(--muted); }
[data-stale] .device-row > .state.ok::before, [data-stale] .fleet-row > .online.ok::before, [data-stale] .fire-row .commander::before {
  background: var(--muted); box-shadow: none; }
[data-stale] .fire-row .commander.caution::before { background: var(--warning); }
.device-row > .state.caution, .admin-screen .pack-row > .state.caution { color: var(--text); }
.device-row > .state.revoked { color: var(--text2); }
/* UREĐAJI: the name over its role; the state and OPOZOVI at the right; a tablet's aircraft and PROMIJENI, and its choices, under. */
.device-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.device-row > * { grid-column: 1 / -1; }
.device-row > .line { grid-column: 1; grid-row: 1; }
.device-row > .sub { grid-column: 1; grid-row: 2; }
.device-row > .state { grid-column: 2; grid-row: 1 / span 2; }
.device-row > .revoke { grid-column: 3; grid-row: 1 / span 2; max-width: 12em; }
.device-row .binding { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-top: 4px; }
.device-row .aircraft { font-size: 1.05rem; font-weight: 700; }
/* ZRAKOPLOVI: the callsign over its type, the link at the right, the camera's addresses under. */
.fleet-row { grid-template-columns: minmax(0, 1fr) auto; }
.fleet-row > * { grid-column: 1 / -1; }
.fleet-row > .line { grid-column: 1; grid-row: 1; }
.fleet-row > .sub { grid-column: 1; grid-row: 2; }
.fleet-row > .online { grid-column: 2; grid-row: 1 / span 2; }
.fleet-row .camera { display: grid; gap: 6px; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--stroke); }
.fleet-row .camera h4 { margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: .1em; color: var(--text2); }
.fleet-row .address { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.fleet-row .address .kind { font-size: .8rem; font-weight: 800; letter-spacing: .06em; color: var(--text2); }
.fleet-row .address input[type="text"] { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9rem; }
.fleet-row .new-key { justify-self: start; }
/* STANJE: the server's lines, a name at the left and its value at the right. */
.status-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); margin: 0; }
.status-list dt, .status-list dd { padding: 11px 0; border-bottom: 1px solid var(--stroke); }
.status-list > :nth-last-child(-n + 2) { border-bottom: 0; }
.status-list dt { padding-right: 28px; color: var(--text2); font-weight: 600; }
.status-list dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
/* PAKETI: NOVI PAKET with its map, then the packs; each row its state and OBNOVI / OBRIŠI at the right. */
.packs-map-box { position: relative; height: min(440px, 52vh); min-height: 260px; border-radius: 8px; overflow: hidden;
  background: #0B1118; border: 1px solid var(--stroke-strong); }
#packs-map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pack-form .area, .pack-form .estimate { font-weight: 700; }
.pack-form .area { color: var(--text2); }
.pack-form .zooms { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.pack-form .zooms button { text-align: center; }
.pack-form > .primary { justify-self: start; }
.admin-screen .pack-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.admin-screen .pack-row > * { grid-column: 1; }
.admin-screen .pack-row > .state { grid-column: 2; grid-row: 1 / span 3; }
.admin-screen .pack-row > .actions { grid-column: 3; grid-row: 1 / span 3; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.admin-screen .pack-row .actions button { max-width: 12em; }
/* POSTAVKE: the language and the brightness side by side, O APLIKACIJI under them. */
.admin-screen #brightness { flex: 0 1 240px; background: var(--raised); }
.admin-screen #brightness b { color: var(--accent); font-variant-numeric: tabular-nums; }
.admin-section .about { display: grid; gap: 4px; font-size: .9rem; color: var(--text2); }
.admin-section .about b { color: var(--text); }
.admin-section .statement { margin: 4px 0 0; padding-left: 18px; }
/* POŽARI: the fires at the left and the map at the right fill the rest of the height (the fires scroll in their card); on a narrow
   screen the fires above the map. */
.admin-content[data-section="overview"] > .overview { flex: 1 1 0; min-height: 520px; }
.overview { --strip-room: 0px; }
.overview-board { flex: 1 1 0; min-height: 0; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
  align-items: stretch; }
.fires-card, .map-card { min-height: 0; }
.fires-card .card-body { overflow-y: auto; overscroll-behavior: contain; }
.map-card { overflow: hidden; }
.map-card .card-side { text-transform: none; letter-spacing: .02em; font-weight: 600; }
.map-card .card-body { padding: 0; border-top: 1px solid var(--stroke); }
.overview .map-box { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; background: #0B1118; }
.fire-row { gap: 6px; }
.fire-row .fire-title { display: grid; gap: 2px; justify-items: start; padding: 6px 0; text-align: left; background: transparent;
  border-color: transparent; }
.fire-row .fire-title .name { font-size: 1.1rem; font-weight: 800; color: var(--text); }
.fire-row .fire-title .detail, .fire-row .helpers { color: var(--text2); font-weight: 600; font-size: .85rem; letter-spacing: .03em; }
.fire-row .commander { font-weight: 700; font-size: .92rem; }
.fire-row .units { display: grid; gap: 4px; }
.unit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; padding: 6px 10px; border-radius: 8px; background: var(--surface); }
.unit-row .type { color: var(--text2); font-weight: 600; }
.unit-row .age { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; color: #4DD0E1; }
.unit-row .age.caution { color: var(--warning); }
.unit-row .age.lost, .unit-row .age.none { color: #8A94A3; }
/* DODIJELI ZAPOVIJEDANJE: a card over the whole screen of the administrator. */
.admin-screen .chooser .card { display: grid; gap: 10px; padding: 16px 18px; }
@media (max-width: 1099.98px) {
  .admin-content { padding: 14px 20px 24px; }
}
@media (max-width: 759.98px) {
  /* A phone or a tablet held upright: the fires above the map. */
  .admin-content[data-section="overview"] > .overview { min-height: 660px; }
  .overview-board { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 45%) minmax(0, 1fr); }
}
@media (max-width: 639.98px) {
  /* A phone: smaller margins and title; in a row the state goes under the name, the actions keep the right. */
  .admin-content { padding: 12px 12px 20px; }
  .admin-screen .page-title { font-size: 1.6rem; }
  .card-head { padding: 10px 12px 2px; }
  .card-body { padding: 8px 12px 12px; }
  .device-row, .fleet-row, .admin-screen .pack-row, .fire-row { padding: 10px 10px 10px 20px; }
  .device-row::before, .fleet-row::before, .admin-screen .pack-row::before, .fire-row::before { left: 8px; }
  .device-row { grid-template-columns: minmax(0, 1fr) auto; }
  .device-row > .state { grid-column: 1; grid-row: 3; justify-self: start; }
  .device-row > .revoke { grid-column: 2; grid-row: 1 / span 3; max-width: 9em; }
  .fleet-row > .online { grid-column: 1; grid-row: 3; justify-self: start; }
  .admin-screen .pack-row { grid-template-columns: minmax(0, 1fr); }
  .admin-screen .pack-row > .state { grid-column: 1; grid-row: auto; justify-self: start; }
  .admin-screen .pack-row > .actions { grid-column: 1; grid-row: auto; justify-content: flex-start; }
  .fleet-row .address { grid-template-columns: minmax(0, 1fr) auto; }
  .fleet-row .address .kind { grid-column: 1 / -1; }
  .status-list { grid-template-columns: minmax(0, 1fr); }
  .status-list dt { padding: 10px 0 0; border-bottom: 0; }
  .status-list dd { padding-top: 2px; }
}
/* The administrator's bottom nav has six items: on a phone the names get smaller; on a narrow phone (360 px) only the icons show,
   60 px each, and the names stay for a screen reader. Every item keeps 60 × 64 px. */
@media (max-width: 559.98px) {
  .admin-app .bottom-nav { gap: 0; padding-left: 2px; padding-right: 2px; }
  .admin-app .bottom-nav .nav-item { padding-left: 2px; padding-right: 2px; font-size: clamp(.56rem, 2.45vw, .8rem); }
}
@media (max-width: 379.98px) {
  .admin-app .bottom-nav { padding-left: 0; padding-right: 0; }
  .admin-app .bottom-nav .nav-item { padding: 6px 0; }
  .admin-app .bottom-nav .nav-label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
}

/* ---- Shared pieces of the screens: the bottom nav, floating panels, the tool grid ---- */
/* The bottom nav (bottom-nav.js): an icon over its name in capitals; the section shown outlined in gold on a soft gold. Every
   button keeps 60 px; on a phone the names get smaller and end in … before a button gets narrower than 60 px. */
.bottom-nav { flex: none; display: flex; justify-content: center; gap: 4px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: #0C1117; border-top: 1px solid var(--stroke); }
.bottom-nav .nav-item { position: relative; flex: 0 1 128px; min-width: 60px; min-height: 64px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; padding: 6px 4px; border-radius: 12px; border: 1px solid transparent;
  background: transparent; color: var(--text2); font-size: clamp(.64rem, 2.6vw, .8rem); font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; }
.bottom-nav .nav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.35; }
.bottom-nav .nav-item[aria-pressed="true"] { border-color: var(--accent); background: rgba(255, 217, 0, .15); color: var(--accent);
  box-shadow: none; }
.bottom-nav .nav-badge { position: absolute; top: 8px; left: calc(50% + 8px); width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px #0C1117; }
@media (max-width: 559.98px) {
  .bottom-nav { gap: 2px; padding-left: 4px; padding-right: 4px; }
  .bottom-nav .nav-item { flex: 1 1 0; letter-spacing: 0; }
}
/* A floating panel over the map: a head (an icon, a title in capitals, − to minimise) and its body, which scrolls. Minimised
   (.minimized) only the head stays. The owner places it (top, left …). */
.float-panel { position: absolute; z-index: 10; display: flex; flex-direction: column; min-height: 0; max-height: 100%; overflow: hidden;
  background: var(--surface); border: 1px solid var(--stroke); border-radius: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
.float-panel-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 0 0 0 14px; color: var(--text); }
.float-panel-head > svg.icon { color: var(--accent); }
.float-panel-head h3, .float-panel-title { flex: 1; min-width: 0; margin: 0; font-size: .95rem; font-weight: 700; letter-spacing: .06em;
  line-height: 1.35; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.float-panel-head button { flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 0;
  background: transparent; border-color: transparent; color: var(--text2); }
.float-panel-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column;
  gap: 10px; padding: 2px 14px 14px; }
.float-panel.minimized .float-panel-body { display: none; }
/* The tool grid: two columns of buttons, an icon at the left and the name at the right in capitals, two lines at most; the tool
   in use outlined in gold on a soft gold. */
.tool-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.tool-btn { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 6px 10px; text-align: left; border-radius: 10px;
  border: 1px solid var(--stroke); background: var(--raised); color: var(--text); font-size: .78rem; font-weight: 700; letter-spacing: .03em;
  line-height: 1.3; text-transform: uppercase; }
.tool-btn > span { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow-wrap: break-word; }
.tool-btn[aria-pressed="true"], .tool-btn.active { border-color: var(--accent); background: rgba(255, 217, 0, .15); color: var(--accent);
  box-shadow: none; }
@media (pointer: fine) and (not (any-pointer: coarse)) {
  /* Only a mouse, no touch screen: smaller; whenever a finger can be used they keep 60 × 60 px. */
  .float-panel-head button { min-width: 44px; min-height: 44px; }
  .tool-btn { min-height: 44px; }
}

/* The logo on the enrollment screen and the daily statement: centred, never stretched. */
.brand-logo { display: block; width: min(320px, 100%); height: auto; margin: 0 auto; border-radius: 10px; }
