:root {
  --bg: #0b0f14;
  --panel: rgba(13, 19, 27, 0.92);
  --line: #1f2a37;
  --text: #d8e1ea;
  --muted: #9aa6b2;          /* >= 4.5:1 on every panel, ribbon and title-bar background (WCAG 1.4.3) */
  --field-line: #66768a;     /* form-field and chip boundaries: >= 3:1 on the panels (WCAG 1.4.11) */
  --accent: #3fb5ff;
  --ok: #3ddc84;
  --warn: #ffc53d;
  --bad: #ff7b7b;
  --sar: #ff7a1a;
  --civ: #5ad1ff;
  --sea: #6a9dff;
  --unk: #ffd84d;
  --rf: #da85ff;
  --psa: #ffb020;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; font-size: 12px; }
/* ---------------------------------------------------------------- shell: title bar, ribbon, map, status bar */
:root { --title-h: 34px; --ribbon-h: 106px; --status-h: 24px; --ribbon-bg: #1b1f24; --ribbon-line: #2c333b; }
body.ribbon-collapsed { --ribbon-h: 30px; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-weight: 400; }

#titlebar {
  position: absolute; top: 0; left: 0; right: 0; height: var(--title-h); display: flex; align-items: center; gap: 16px;
  padding: 0 10px; background: #111418; border-bottom: 1px solid var(--ribbon-line); z-index: 10;
}
.brand { font-weight: 700; letter-spacing: .18em; font-size: 13px; white-space: nowrap; margin: 0; }
.brand .logo { color: var(--accent); }
.brand .sub { color: var(--muted); font-weight: 500; }
.mission { color: var(--muted); flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpis { display: flex; gap: 16px; margin-left: auto; }
.kpi { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.kpi .k { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.kpi .v { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12px; }

#ribbon {
  position: absolute; top: var(--title-h); left: 0; right: 0; height: var(--ribbon-h); background: var(--ribbon-bg);
  border-bottom: 1px solid var(--ribbon-line); z-index: 10; overflow: hidden;
}
.ribbon-tabs { display: flex; gap: 2px; padding: 0 8px; height: 30px; align-items: flex-end; }
.rtab { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--text); padding: 6px 14px 5px;
  font-size: 12px; cursor: pointer; }
.rtab:hover { background: rgba(255,255,255,.05); }
.rtab.active { color: var(--accent); background: #23292f; border-bottom-color: var(--accent); }
body.ribbon-collapsed .ribbon-page { display: none; }
.ribbon-page { display: flex; height: calc(var(--ribbon-h) - 30px); padding: 4px 6px 0; background: #23292f; overflow-x: auto; }
.rgroup { display: flex; flex-direction: column; border-right: 1px solid var(--ribbon-line); padding: 0 6px; }
.rbtns { display: flex; gap: 2px; flex: 1; align-items: flex-start; }
.rlabel { text-align: center; color: var(--muted); font-size: 10px; padding: 1px 0 3px; }
.rbtn { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 56px; max-width: 78px; padding: 4px 5px;
  background: transparent; border: 1px solid transparent; border-radius: 3px; color: var(--text); font-size: 11px;
  line-height: 1.15; cursor: pointer; text-align: center; }
.rbtn svg, .win-icon, .mapbtn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round; }
.rbtn:hover { background: rgba(255,255,255,.07); border-color: var(--ribbon-line); }
.rbtn.active { background: rgba(63,181,255,.16); border-color: rgba(63,181,255,.55); color: #fff; }
.rbtn:focus-visible, .rtab:focus-visible, .mapbtn:focus-visible, .win-head:focus-visible, .win-btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; }

#map-area { position: absolute; top: calc(var(--title-h) + var(--ribbon-h)); bottom: var(--status-h); left: 0; right: 0; }
#cesiumContainer { position: absolute; inset: 0; }
.cesium-viewer-bottom { left: 56px !important; }
#cesiumContainer:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
#map-controls { position: absolute; top: 14px; left: 10px; display: flex; flex-direction: column; gap: 8px; z-index: 3; }
.mapbtn { width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255,255,255,.85); background: rgba(10,14,18,.55);
  color: #fff; font-size: 22px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; }
.mapbtn svg { width: 22px; height: 22px; }
.mapbtn:hover { background: rgba(63,181,255,.35); }

#statusbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--status-h); display: flex; align-items: center; gap: 14px;
  padding: 0 10px; background: #111418; border-top: 1px solid var(--ribbon-line); z-index: 10; font-variant-numeric: tabular-nums;
  font-size: 11px; white-space: nowrap; overflow: hidden;
}
#statusbar .spacer { flex: 1; }
.link { padding: 2px 8px; border-radius: 3px; font-weight: 600; font-size: 10px; letter-spacing: .08em; }
.link.up { background: rgba(61,220,132,.15); color: var(--ok); }
.link.down { background: rgba(255,90,90,.15); color: var(--bad); }

.btn { background: var(--accent); color: #031018; border: 0; border-radius: 4px; padding: 6px 12px; font-weight: 600; cursor: pointer; }
.btn.small { padding: 3px 8px; font-size: 11px; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--field-line); }
.icon-btn.flat { border: 0; width: 28px; height: 24px; color: var(--muted); }

/* ---------------------------------------------------------------- floating windows */
.win { position: fixed; display: flex; flex-direction: column; min-width: 180px; min-height: 60px; max-width: calc(100vw - 16px);
  background: rgba(20, 25, 31, 0.96); border: 1px solid #3a434d; border-radius: 4px; box-shadow: 0 6px 24px rgba(0,0,0,.45);
  resize: both; overflow: hidden; z-index: 20; }
.win.front { border-color: rgba(63,181,255,.7); }
.win.dragging { opacity: .9; user-select: none; }
.win.rolled { height: auto !important; min-height: 0; resize: none; }
.win.rolled .win-body { display: none; }
.win-head { display: flex; align-items: center; gap: 6px; height: 28px; flex: 0 0 28px; padding: 0 4px 0 8px; background: #2a3139;
  cursor: move; user-select: none; touch-action: none; border-bottom: 1px solid #3a434d; }
.win.front .win-head { background: #2d3a47; }
.win-icon { width: 16px; height: 16px; color: var(--accent); flex: 0 0 auto; }
.win-title { flex: 1; font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
body.large-text .win-title { font-size: 15px; }
.win-btn { background: transparent; border: 0; color: var(--muted); width: 24px; height: 22px; border-radius: 3px; cursor: pointer;
  font-size: 16px; line-height: 1; }
.win-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.win-btn[data-act="close"]:hover { background: #c42b1c; }
.win-body { flex: 1; overflow: auto; padding: 4px 12px 10px; min-height: 0; }

.panel h3 { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 10px 0 6px; font-weight: 600; }
.panel section + section { border-top: 1px solid var(--line); }
.panel label { display: block; padding: 2px 0; cursor: pointer; }
.panel label.inline { display: inline; margin-right: 8px; }
select, input[type=password] { width: 100%; background: #0f1620; color: var(--text); border: 1px solid var(--field-line); border-radius: 4px; padding: 5px; }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 10px; padding: 3px 4px; border-bottom: 1px solid var(--line); }
td { padding: 3px 4px; border-bottom: 1px solid rgba(31,42,55,.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: rgba(63,181,255,.08); }
tr.offline td { color: var(--muted); text-decoration: line-through; }
.cls { padding: 1px 5px; border-radius: 3px; font-size: 10px; font-weight: 600; }
.cls.sar { background: rgba(255,122,26,.2); color: var(--sar); }
.cls.civ { background: rgba(90,209,255,.15); color: var(--civ); }
.cls.sea { background: rgba(79,140,255,.18); color: var(--sea); }
.cls.unk { background: rgba(255,216,77,.15); color: var(--unk); }
.cls.rf { background: rgba(208,107,255,.18); color: var(--rf); }
.good { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }

#events { list-style: none; padding: 0; margin: 0; }
#events li { padding: 2px 0; color: var(--muted); }
#events li b { color: var(--text); font-weight: 600; }

.legend { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--muted); font-size: 10px; }
.legend .ramp { flex: 1; height: 8px; border-radius: 2px; background: linear-gradient(90deg, rgba(20,40,80,.2), #1f6fb2, #29c1a0, #f2d544, #ff5a3a); }
.legend-grid { display: grid; grid-template-columns: 16px 1fr; gap: 4px 6px; align-items: center; }
.sw { width: 14px; height: 14px; border-radius: 2px; display: inline-grid; place-items: center; color: #0b0f14; font-size: 10px;
  font-weight: 800; line-height: 1; }
.sw.sar { background: var(--sar); } .sw.civ { background: var(--civ); } .sw.sea { background: var(--sea); }
.sw.unk { background: var(--unk); } .sw.rf { background: var(--rf); }
.sw.excl { background: rgba(255,60,60,.5); border: 1px solid var(--bad); color: var(--text); } .sw.psa { background: rgba(255,176,32,.35); border: 1px solid var(--psa); color: var(--text); }

.admin-head { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
#admin-history { width: 100%; height: 60px; display: block; margin: 4px 0; }
.node-card { border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; margin-top: 8px; }
.node-card .hdr { display: flex; justify-content: space-between; font-weight: 600; }
.node-card .decision { margin: 3px 0 5px; }
.node-card .decision.dispatch { color: var(--ok); }
.node-card .decision.hold { color: var(--warn); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.chip { background: rgba(255,90,90,.12); color: #ffb0b0; padding: 1px 6px; border-radius: 10px; font-size: 10px; }

dialog { background: #0f1620; color: var(--text); border: 1px solid var(--line); border-radius: 8px; width: 320px; }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog h2, dialog h3 { margin: 0 0 4px; font-size: 15px; }
dialog .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.error { color: var(--bad); min-height: 16px; margin-top: 6px; }


/* ---------------------------------------------------------------- tabs, buttons, notices */
.tab { background: transparent; border: 1px solid var(--field-line); color: var(--muted); padding: 3px 9px; font-size: 11px; cursor: pointer; }
.tab:first-child { border-radius: 4px 0 0 4px; }
.tab:last-child { border-radius: 0 4px 4px 0; }
.tab.active { background: rgba(63,181,255,.15); color: var(--text); border-color: var(--accent); }
.icon-btn { background: transparent; border: 1px solid var(--field-line); color: var(--text); border-radius: 4px; width: 26px; height: 26px;
  cursor: pointer; font-size: 15px; line-height: 1; }
.icon-btn:hover, .tab:hover { border-color: var(--accent); }
.btn:focus-visible, .tab:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.small { font-size: 10px; }
.btn.danger { background: var(--bad); color: #1a0505; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.notice { background: rgba(255,197,61,.1); border: 1px solid rgba(255,197,61,.4); color: var(--warn); padding: 6px 8px; border-radius: 4px; margin-bottom: 8px; }
.terrain-row { margin-top: 6px; }
#map-notice { margin-top: 6px; font-size: 11px; }

@media (max-width: 900px) {
  /* nothing is hidden at a narrow width or at 200 % zoom (WCAG 1.4.4): tighter spacing, the mission name truncates */
  #titlebar { gap: 8px; }
  .kpis { gap: 8px; }
  .rbtn { min-width: 48px; font-size: 10px; }
}

/* ---------------------------------------------------------------- operational server (body.ops-mode) */
body:not(.ops-mode) .ops-only { display: none !important; }
.setup-banner { position: fixed; top: calc(var(--title-h) + var(--ribbon-h) + 12px); left: 50%; transform: translateX(-50%); z-index: 100000; display: flex; gap: 10px;
  align-items: center; padding: 7px 12px; border-radius: 4px; background: rgba(255,197,61,.14); color: var(--warn);
  border: 1px solid rgba(255,197,61,.5); box-shadow: 0 4px 14px rgba(0,0,0,.4); max-width: calc(100% - 120px); }
.setup-banner.pick { top: calc(var(--title-h) + var(--ribbon-h) + 56px); background: rgba(63,181,255,.16); color: #cfeaff; border-color: rgba(63,181,255,.6); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-top: 6px; }
.form-grid label { display: flex; flex-direction: column; gap: 3px; color: var(--muted); font-size: 11px; }
.form-grid label.wide { grid-column: 1 / -1; }
.form-grid label.check { flex-direction: row; align-items: center; gap: 6px; color: var(--text); }
.form-grid input[type=text], .form-grid input[type=number], .form-grid select, .zone input, .zone select, .zone textarea,
.cap-settings input {
  background: #0f1620; color: var(--text); border: 1px solid var(--field-line); border-radius: 4px; padding: 5px; width: 100%;
  font-variant-numeric: tabular-nums; }
.form-row { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; flex-wrap: wrap; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.zone { border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; margin: 6px 0; }
.zone .zhead { display: flex; gap: 6px; align-items: center; }
.zone .zhead .kind { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 3px; white-space: nowrap; }
.zone .kind.excl { background: rgba(255,90,90,.15); color: var(--bad); }
.zone .kind.prio { background: rgba(255,176,32,.15); color: var(--psa); }
.zone .zgrid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px 8px; margin-top: 4px; }
.zone .zgrid label { display: flex; flex-direction: column; gap: 2px; color: var(--muted); font-size: 10px; }
.zone textarea { font-family: ui-monospace, Consolas, monospace; font-size: 11px; resize: vertical; margin-top: 4px; }
.caps { display: flex; flex-direction: column; gap: 4px; }
.cap { border: 1px solid var(--line); border-radius: 4px; padding: 4px 8px; }
.cap > label { display: flex; gap: 6px; align-items: center; font-weight: 600; }
.cap-settings { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px 8px; margin: 4px 0 2px; }
.cap-settings label { display: flex; flex-direction: column; gap: 2px; color: var(--muted); font-size: 10px; font-weight: 400; }
.cap-settings label.wide { grid-column: 1 / -1; }
.cap-settings label.check { flex-direction: row; align-items: center; gap: 5px; color: var(--text); }
#enrolled-table td { max-width: 140px; }
.state-tag { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 3px; }
.state-tag.online { background: rgba(61,220,132,.15); color: var(--ok); }
.state-tag.offline { background: rgba(125,139,153,.18); color: var(--muted); }
.state-tag.revoked { background: rgba(255,90,90,.15); color: var(--bad); }

/* ---------------------------------------------------------------- security marking, data mode (IMS 5.3) */
.class-marking { padding: 2px 8px; border-radius: 3px; font-weight: 700; font-size: 10px; letter-spacing: .06em;
  white-space: nowrap; background: #3a3f46; color: #fff; }
.class-marking.UNCLASSIFIED { background: #007a33; }
.class-marking.CUI { background: #502b85; }
.class-marking.CONFIDENTIAL { background: #0033a0; }
.class-marking.SECRET { background: #c8102e; }
.mode-banner { padding: 2px 8px; border-radius: 3px; font-weight: 700; font-size: 10px; letter-spacing: .06em;
  white-space: nowrap; background: #ffc53d; color: #111; }
.mode-banner.EXERCISE { background: #ff8c1a; }
.mode-banner.LIVE { background: #263238; color: #fff; }  /* same scheme as FOVEA-Lite (Marking.kt modeColors) */
body.mode-SIMULATION #titlebar { box-shadow: inset 0 -2px 0 #ffc53d; }
body.mode-EXERCISE #titlebar { box-shadow: inset 0 -2px 0 #ff8c1a; }
.clearance-btn { background: none; border: 1px solid var(--field-line); color: var(--muted); font-size: 10px;
  padding: 1px 6px; border-radius: 3px; cursor: pointer; }
.clearance-btn:hover { color: var(--text); border-color: var(--accent); }

/* ---------------------------------------------------------------- operator windows (approvals, tasking, track detail,
   network, keys). Contrast: text >= 4.5:1 on the panel; states never by colour alone (text labels everywhere). */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=text], input[type=number], input[type=search], textarea { background: #0f1620; color: var(--text); border: 1px solid var(--field-line); border-radius: 4px; padding: 4px 5px; }
.count-badge { display: inline-block; min-width: 16px; padding: 0 4px; margin-left: 2px; border-radius: 8px; background: var(--warn); color: #1a1200; font-size: 10px; font-weight: 700; text-align: center; }
.win-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.seg { display: inline-flex; border: 1px solid var(--field-line); border-radius: 4px; overflow: hidden; }
.seg-btn { background: transparent; color: var(--text); border: 0; padding: 4px 10px; cursor: pointer; font: inherit; }
.seg-btn.active { background: rgba(63,181,255,.18); color: #fff; }
.ap-list .empty { padding: 12px 0; }
.result-line { margin: 0 0 6px; min-height: 1em; font-weight: 600; }
.ap-card { border: 1px solid var(--line); border-radius: 6px; padding: 8px; margin-bottom: 8px; background: rgba(15,22,32,.85); }
.ap-card header { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; font-size: 13px; }
.ap-card footer { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.ap-card h3, .ap-card h4 { margin: 4px 0; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ap-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 10px; }
.ap-modify { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 6px; }
.expiry { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text); }
.expiry.soon { color: var(--bad); font-weight: 700; }
.risk { padding: 0 6px; border-radius: 3px; font-size: 10px; font-weight: 700; border: 1px solid currentColor; }
.risk-LOW { color: var(--ok); } .risk-MEDIUM { color: var(--warn); } .risk-HIGH { color: #fff; background: #b3261e; border-color: #b3261e; }
.marking-chip { font-size: 10px; padding: 0 5px; border-radius: 3px; background: #1b5e20; color: #fff; }
.pts { margin: 2px 0; padding-left: 16px; font-variant-numeric: tabular-nums; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 2px 8px; margin: 4px 0; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
.decision { margin: 2px 0 4px; font-weight: 600; }
table.compact td { max-width: 180px; } table.compact caption { text-align: left; color: var(--muted); font-size: 10px; padding: 2px 0; }
.warn-line { color: var(--warn); }
.mode-note { margin: 0 0 6px; padding: 4px 6px; border-radius: 4px; border: 1px solid var(--line); }
.mode-note.LIVE { border-color: var(--bad); color: #ffd7d7; }
.mode-note.EXERCISE, .mode-note.SIMULATION { border-color: var(--warn); }
.asset-info { margin: 4px 0 6px; }
.limits th { width: 35%; }
.pt-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 4px; align-items: end; margin-bottom: 2px; }
.pt-row input { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 40px; }
.chip-fig { margin: 0; width: 112px; } .chip-fig img { width: 112px; height: 84px; object-fit: cover; border: 1px solid var(--line); border-radius: 3px; background: #000; }
.chip-fig figcaption { font-size: 10px; color: var(--muted); }
.trk-head { font-size: 13px; margin-bottom: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
#nw-graph { width: 100%; height: auto; background: #0a1018; border: 1px solid var(--line); border-radius: 4px; }
#nw-graph circle { fill: #e8f1ff; stroke: #0b0f14; stroke-width: 2; } #nw-graph circle.router { fill: var(--accent); stroke: #fff; }
#nw-graph .stale circle { fill: #6b7785; } #nw-graph text { fill: var(--text); font-size: 11px; }
.meter { display: inline-block; width: 70px; height: 8px; background: #1f2a37; border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 4px; }
.meter span { display: block; height: 100%; } .meter span.good { background: var(--ok); } .meter span.warn { background: var(--warn); } .meter span.bad { background: var(--bad); }
.plan { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 4px; }
.diff td.old { color: #ffb4ab; text-decoration: line-through; } .diff td.new { color: #b6f2c8; }
td.actions { max-width: none; white-space: nowrap; }
#confirm-dialog { width: 420px; } #confirm-dialog label { display: block; margin-top: 6px; } #confirm-dialog input[type=text] { width: 100%; }
#viewer-dialog label { display: block; margin: 6px 0; } #viewer-dialog input { width: 100%; }
/* command-post screens: larger type everywhere (Home > Windows > Large Text) */
body.large-text { font-size: 15px; }
body.large-text th { font-size: 13px; } body.large-text .btn.small { font-size: 13px; } body.large-text .small { font-size: 13px; }
body.large-text .risk, body.large-text .count-badge, body.large-text .marking-chip, body.large-text .chip-fig figcaption { font-size: 12px; }
@media (max-width: 700px) { .ap-grid { grid-template-columns: 1fr; } .pt-row { grid-template-columns: 1fr 1fr; } }
/* ---------------------------------------------------------------- Fused Tracks window: search, filter chips, sort,
   virtualised rows (tracks.js). The controls stay put; only the table scrolls. */
#win-tracks .win-body { display: flex; flex-direction: column; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.trk-controls { flex: 0 0 auto; max-height: 55%; overflow: auto; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.trk-searchrow { display: flex; align-items: center; gap: 8px; }
.trk-searchrow input { flex: 1; min-width: 0; background: #0f1620; color: var(--text); border: 1px solid var(--field-line); border-radius: 4px; padding: 4px 6px; font: inherit; }
.trk-count { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
#trk-filters summary { cursor: pointer; color: var(--muted); padding: 4px 0 2px; font-size: 11px; }
#trk-filters summary span { color: var(--warn); }
.trk-fgrid { display: grid; grid-template-columns: max-content 1fr; gap: 3px 8px; align-items: center; }
.trk-flabel { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.fchips { display: flex; flex-wrap: wrap; gap: 3px; }
.fchip { background: transparent; color: var(--text); border: 1px solid var(--field-line); border-radius: 10px; padding: 1px 8px;
  font: inherit; font-size: 11px; cursor: pointer; min-height: 22px; }
.fchip[aria-pressed="true"] { background: rgba(63,181,255,.2); border-color: var(--accent); color: #fff; }
.fchip[aria-pressed="true"]::before { content: "\2713\00a0"; }
.trk-other { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.trk-stale input { width: 64px; }
.trk-frow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.trk-scroll { flex: 1 1 0; min-height: 80px; overflow: auto; overscroll-behavior: contain; }
#track-table thead th { position: sticky; top: 0; background: #121a24; z-index: 1; padding: 0; }
.th-sort { background: transparent; border: 0; color: inherit; font: inherit; padding: 3px 4px; width: 100%; text-align: left; cursor: pointer; }
th[aria-sort="ascending"] .th-sort::after { content: " \25B2"; color: var(--accent); }
th[aria-sort="descending"] .th-sort::after { content: " \25BC"; color: var(--accent); }
#track-table tbody tr { height: 22px; }
#track-table tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#track-table tbody tr:focus td { background: rgba(63,181,255,.12); }
/* ---------------------------------------------------------------- selected item on the map (replaces Cesium's info box) */
.map-info { position: absolute; left: 60px; bottom: 44px; width: 340px; max-width: calc(100% - 80px); max-height: 45%; z-index: 15;
  display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,.45); }
.map-info header { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 10px; border-bottom: 1px solid var(--line); }
.map-info header b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-info iframe { border: 0; width: 100%; min-height: 40px; flex: 1 1 auto; background: #111a24; color-scheme: dark; border-radius: 0 0 6px 6px; }

/* sign-in security (IMS 9.3): notice and consent banner, administrator alarms, notices */
#banner-dialog { width: min(720px, 94vw); }
#banner-text { white-space: pre-wrap; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 60vh; overflow: auto;
  background: #0b1118; border: 1px solid var(--line); border-radius: 4px; padding: 10px; margin: 8px 0; }
#reauth-dialog label { display: block; margin: 6px 0; } #reauth-dialog input { width: 100%; }
.alarm-banner { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 50; background: var(--bad); color: #1a0505;
  font-weight: 700; padding: 6px 14px; border-radius: 0 0 6px 6px; max-width: 80vw; }
.notice { position: fixed; bottom: 34px; left: 50%; transform: translateX(-50%); z-index: 50; background: #13202c; color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 14px; box-shadow: 0 4px 16px rgba(0,0,0,.5); }

/* ---------------------------------------------------------------- accessibility (Section 508 / WCAG 2.1 AA; docs/compliance/vpat.md) */
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100001; background: var(--accent); color: #031018; padding: 6px 12px;
  border-radius: 0 0 4px 4px; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 0; outline: 2px solid #fff; outline-offset: 0; }
.map-help { margin: 0; }
th .sr-only { position: absolute; }
/* the session-timeout warning (WCAG 2.2.1): the time left, stay signed in or sign out */
#timeout-dialog { width: min(420px, 94vw); border-color: var(--warn); }
#timeout-dialog .left { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--warn); }
/* reflow (WCAG 1.4.10): at 320 CSS px (1280 px at 400 % zoom) and up to 760 px the console becomes one column that scrolls
   vertically: title bar, ribbon (wrapping, every button reachable), map, the open windows one under the other, status bar */
@media (max-width: 760px) {
  html, body { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; }
  body { display: flex; flex-direction: column; }
  #titlebar, #ribbon, #map-area, #statusbar { position: relative; top: auto; bottom: auto; left: auto; right: auto; }
  #titlebar { order: 1; height: auto; min-height: var(--title-h); flex-wrap: wrap; row-gap: 4px; padding: 4px 10px; }
  #titlebar .kpis { margin-left: 0; flex-wrap: wrap; }
  .mission, .mode-banner, .class-marking { white-space: normal; }
  #ribbon { order: 2; height: auto; overflow: visible; }
  .ribbon-tabs { flex-wrap: wrap; height: auto; }
  .ribbon-page { height: auto; flex-wrap: wrap; overflow: visible; row-gap: 4px; }
  .rgroup { border-right: 0; }
  #map-area { order: 3; height: 55vh; min-height: 180px; flex: 0 0 auto; }
  #windows { order: 4; }
  #windows .win { position: relative !important; left: auto !important; top: auto !important; width: auto !important;
    max-width: none !important; height: auto !important; max-height: none !important; margin: 8px; resize: none; z-index: auto !important; }
  #windows .win-body { overflow: visible; }
  #windows .win-head { cursor: default; }
  .trk-controls { max-height: none; }
  .trk-scroll { max-height: 60vh; flex: 0 0 auto; }
  .form-grid, .zone .zgrid, .cap-settings, .ap-grid { grid-template-columns: 1fr; }
  #statusbar { order: 5; height: auto; min-height: var(--status-h); flex-wrap: wrap; white-space: normal; row-gap: 2px; padding: 4px 10px; }
  .setup-banner { max-width: calc(100% - 16px); flex-wrap: wrap; }
  .map-info { left: 8px; width: auto; right: 8px; max-width: none; }
  td { max-width: 40vw; }
}
/* motion (prefers-reduced-motion): no transitions; the map's camera flights jump instead of flying (app.js, windows.js) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* Windows high-contrast / forced colours: keep focus and selection visible */
@media (forced-colors: active) {
  .fchip[aria-pressed="true"], .rbtn.active, .seg-btn.active, .rtab.active { outline: 2px solid Highlight; }
  :focus-visible { outline: 2px solid Highlight; }
}
.win-body:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
