/* Fireground Accountability: passport-board theme.
   Status colour is the only colour: green standby, amber working, red alert, slate out of service. */

@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: local('Barlow Condensed SemiBold'), url('fonts/barlow-condensed-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: local('Barlow Condensed Bold'), url('fonts/barlow-condensed-700.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 400; font-display: swap; src: local('Atkinson Hyperlegible'), url('fonts/atkinson-400.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 700; font-display: swap; src: local('Atkinson Hyperlegible Bold'), url('fonts/atkinson-700.woff2') format('woff2'); }

:root, :root[data-theme="night"] {
  --ground: #121a21; --panel: #1b2630; --panel2: #233140; --line: #34444f; --line-strong: #4b5d6a;
  --text: #eef2ea; --muted: #9aa8b3; --sel: #4c8dff; --sel-bg: rgba(76, 141, 255, .14);
  --avail: #22a85a; --work: #f0a818; --alert: #e0283f; --oos: #6b7a88;
  --avail-bg: rgba(34, 168, 90, .14); --work-bg: rgba(240, 168, 24, .12); --alert-bg: rgba(224, 40, 63, .18); --oos-bg: rgba(107, 122, 136, .18);
  --on-work: #1c1400; --on-solid: #fff; --ma: #3cc6b4;
  --shadow: 0 14px 34px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
:root[data-theme="day"] {
  --ground: #e4e7e2; --panel: #ffffff; --panel2: #f1f3ef; --line: #b9c0ba; --line-strong: #7d8781;
  --text: #0a0f12; --muted: #48535c; --sel: #1652d9; --sel-bg: rgba(22, 82, 217, .10);
  --avail: #13803f; --work: #b87400; --alert: #c01229; --oos: #56636f;
  --avail-bg: rgba(19, 128, 63, .10); --work-bg: rgba(184, 116, 0, .10); --alert-bg: rgba(192, 18, 41, .10); --oos-bg: rgba(86, 99, 111, .14);
  --on-work: #fff; --ma: #0b7d70;
  --shadow: 0 12px 28px rgba(20, 30, 25, .22);
  color-scheme: light;
}

:root {
  --f-sign: 'Barlow Condensed', 'Avenir Next Condensed', 'Bahnschrift SemiCondensed', 'Roboto Condensed', 'Arial Narrow', sans-serif-condensed, sans-serif;
  --f-body: 'Atkinson Hyperlegible', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 8px;
  --hit: 56px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--ground); color: var(--text); }
body {
  font: 17px/1.35 var(--f-body);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  overscroll-behavior: none; -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { margin: 0; font-family: var(--f-sign); font-weight: 700; letter-spacing: .01em; }
h2 { font-size: 26px; margin: 22px 0 10px; }
h3 { font-size: 19px; color: var(--muted); margin: 2px 0 8px; display: flex; align-items: center; gap: 8px; font-weight: 600; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.sm { font-size: 14px; }
.red { color: var(--alert) !important; }
.spacer { flex: 1; }
.num { font-family: var(--f-sign); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.count { font: 700 15px/1 var(--f-sign); font-variant-numeric: tabular-nums; background: var(--panel2); border: 1px solid var(--line); color: var(--text); border-radius: 99px; padding: 3px 9px; }
:focus-visible { outline: 3px solid var(--sel); outline-offset: 2px; }

/* ---------- controls ---------- */
input, select, textarea {
  font: inherit; color: var(--text); background: var(--panel2); border: 2px solid var(--line);
  border-radius: var(--r); padding: 11px 12px; min-height: var(--hit); width: 100%;
  -webkit-user-select: text; user-select: text;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sel); }
label { display: block; font-size: 15px; color: var(--muted); margin-top: 14px; }
label > input, label > select, label > textarea { margin-top: 6px; }
label.inline { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: 17px; }
label.inline input { width: 28px; min-height: 28px; height: 28px; margin: 0; accent-color: var(--sel); }

.btn, button {
  font: 600 18px/1.1 var(--f-sign); letter-spacing: .02em; color: var(--text);
  background: var(--panel2); border: 2px solid var(--line); border-radius: var(--r);
  min-height: var(--hit); min-width: var(--hit); padding: 0 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; cursor: pointer; white-space: nowrap; touch-action: manipulation;
}
.btn:active, button:active { transform: translateY(1px); background: var(--line); }
.btn.sm { min-height: 48px; min-width: 48px; padding: 0 14px; font-size: 16px; }
.btn.big { min-height: 72px; font-size: 20px; }
.btn.primary { background: var(--sel); border-color: var(--sel); color: #fff; }
.btn.ok { background: var(--avail); border-color: var(--avail); color: #fff; }
.btn.danger { background: var(--alert); border-color: var(--alert); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.on { border-color: var(--text); }
.btn.icon { padding: 0; width: var(--hit); }
.btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn svg { fill: currentColor; stroke-width: 2; }
.theme-btn svg circle { fill: currentColor; }

/* ---------- command header ---------- */
.screen { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.cmd {
  display: flex; align-items: stretch; gap: 0; min-height: 84px;
  padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left));
  background: var(--panel); border-bottom: 2px solid var(--line-strong);
}
.cmd > * { align-self: center; }
.cmd > .btn, .cmd > .sync, .cmd > .logo { margin-left: 8px; }
.cmd > .btn:first-child { margin-left: 0; }
.cmd .title { flex: 1; min-width: 0; padding: 0 14px; }
.cmd .name { font: 700 30px/1.05 var(--f-sign); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd .sub { color: var(--muted); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.logo { width: 44px; height: 44px; flex: 0 0 auto; }

/* Instruments: label above, big condensed figures below, separated by rules */
.inst {
  align-self: stretch !important; display: flex; flex-direction: column; justify-content: center;
  padding: 0 18px; border-left: 2px solid var(--line); min-width: 120px;
}
.inst .il { font-size: 14px; color: var(--muted); white-space: nowrap; }
.inst .iv { font: 700 44px/1 var(--f-sign); font-variant-numeric: tabular-nums; letter-spacing: .01em; white-space: nowrap; }
.inst .ix { font-size: 13px; color: var(--muted); white-space: nowrap; }
.par-next { min-width: 150px; border-radius: 0; transition: background .2s; }
.par-next[data-state="warn"] { background: var(--work); color: var(--on-work); }
.par-next[data-state="warn"] .il { color: inherit; }
.par-next[data-state="over"] { background: var(--alert); color: #fff; animation: alarm 1s steps(2) infinite; }
.par-next[data-state="over"] .il { color: #fff; }

.mayday-btn {
  position: relative; overflow: hidden; margin-left: 12px !important; min-height: 68px; min-width: 150px; padding: 0 20px;
  background: var(--alert); border-color: var(--alert); color: #fff; flex-direction: column; gap: 0;
  -webkit-user-select: none; user-select: none; touch-action: none;
}
.mayday-btn .lbl { position: relative; font: 700 28px/1 var(--f-sign); letter-spacing: .08em; }
.mayday-btn .hint { position: relative; font: 600 13px/1.2 var(--f-body); opacity: .9; }
.mayday-btn .fill { position: absolute; inset: 0; background: rgba(0, 0, 0, .35); transform: scaleX(0); transform-origin: left; }
.mayday-btn.holding .fill { transform: scaleX(1); transition: transform 1s linear; }
.mayday-btn:active { background: var(--alert); }

/* ---------- toolbar: actions, benchmarks, sync, log, theme ---------- */
.toolbar {
  display: flex; align-items: center; gap: 8px; padding: 8px max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left));
  background: var(--panel); border-bottom: 2px solid var(--line);
}
.bench { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 0 6px; border-left: 2px solid var(--line); border-right: 2px solid var(--line); }
.bench::-webkit-scrollbar { display: none; }
.bm { flex: 0 0 auto; font-size: 16px; min-height: 48px; background: transparent; border-style: dashed; }
.bm.done { border-style: solid; border-color: var(--avail); background: var(--avail-bg); color: var(--avail); }
.bm.done::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }

.sync { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); white-space: nowrap; padding: 0 6px; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--oos); flex: 0 0 auto; }
.sync.online .dot { background: var(--avail); }
.sync.offline { color: var(--text); }
.sync.offline .dot { background: var(--work); box-shadow: 0 0 0 3px var(--work-bg); }

/* ---------- MAYDAY banner ---------- */
.mayday-banner {
  display: flex; align-items: center; gap: 18px; padding: 10px 14px; min-height: 68px;
  background: var(--alert); color: #fff; font: 700 26px/1.1 var(--f-sign);
}
.mayday-banner b { letter-spacing: .1em; font-size: 30px; animation: alarm 1s steps(2) infinite; }
.mayday-banner .btn { background: #fff; border-color: #fff; color: #000; }
.has-mayday .board { box-shadow: inset 0 0 0 6px var(--alert); }

/* ---------- board ---------- */
.board { flex: 1; min-height: 0; display: grid; grid-template-columns: 290px 1fr; position: relative; }
.board.log-open { grid-template-columns: 290px 1fr 310px; }
.rail, .log-panel { overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--panel); padding: 12px 12px 140px; }
.rail { border-right: 2px solid var(--line); }
.log-panel { display: none; border-left: 2px solid var(--line); }
.log-open .log-panel { display: block; }
.groups { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 12px 150px; }
.ggrid { display: grid; gap: 12px; align-items: start; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }

@media (max-width: 1199px) {
  .board.log-open { grid-template-columns: 280px 1fr; }
  .log-open .log-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(360px, 90vw); z-index: 15; box-shadow: var(--shadow); }
  .board { grid-template-columns: 280px 1fr; }
  .inst { padding: 0 12px; min-width: 0; }
  .inst .iv { font-size: 38px; }
}
@media (max-width: 900px) {
  .cmd { flex-wrap: wrap; }
  .cmd .title { flex-basis: calc(100% - 72px); }
  .inst { border-left: 0; padding: 6px 12px 0 0; }
  .toolbar { flex-wrap: wrap; }
  .bench { order: 9; flex-basis: 100%; border: 0; padding: 0; }
  .board, .board.log-open { grid-template-columns: 1fr; grid-template-rows: auto 1fr; overflow-y: auto; }
  .rail { max-height: 34vh; border-right: 0; border-bottom: 2px solid var(--line); padding-bottom: 12px; }
}

/* Group columns: a strip of status colour across the top, like a board header card */
.group, .unassigned {
  background: var(--panel); border: 2px solid var(--line); border-top: 8px solid var(--line-strong);
  border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 140px;
}
.group.k-avail { border-top-color: var(--avail); }
.group.k-work { border-top-color: var(--work); }
.group.k-alert { border-top-color: var(--alert); border-color: var(--alert); }
.unassigned { background: var(--panel2); min-height: 0; margin-bottom: 14px; border-top-color: var(--avail); }
.group > header { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.gname { flex: 1; min-width: 0; font: 700 24px/1.05 var(--f-sign); text-align: left; justify-content: flex-start; padding: 0; background: none; border: 0; min-height: 48px; white-space: normal; }
button.gname { text-decoration: underline dotted var(--line-strong) 2px; text-underline-offset: 5px; }
.gcount { font: 700 30px/1 var(--f-sign); font-variant-numeric: tabular-nums; }
.gpar { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.gpar-t { font: 600 18px/1 var(--f-sign); font-variant-numeric: tabular-nums; color: var(--muted); }
.gpar-t[data-state="warn"] { color: var(--work); }
.gpar-t[data-state="over"] { color: var(--alert); font-weight: 700; }
.nopar { color: var(--muted); font-size: 14px; margin-top: auto; }
.empty { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 15px; padding: 8px 2px; border: 2px dashed var(--line); border-radius: var(--r); padding-left: 10px; }
.group.add { border-style: dashed; border-top-width: 2px; background: transparent; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.target { cursor: pointer; border-style: dashed; border-color: var(--sel); background-color: var(--sel-bg); }
.drop-hint { text-align: center; color: var(--sel); font: 700 18px var(--f-sign); padding: 8px; border: 2px dashed var(--sel); border-radius: var(--r); }
.drop-over { border-color: var(--sel) !important; border-style: solid !important; background: var(--sel-bg) !important; box-shadow: 0 0 0 4px var(--sel); }

/* ---------- passport tags ---------- */
.tags { display: flex; flex-direction: column; gap: 6px; }
.tag {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%; justify-content: flex-start;
  min-height: 62px; padding: 6px 8px 6px 20px; text-align: left; white-space: normal;
  background: var(--panel2); border: 2px solid var(--line); border-left: 14px solid var(--oos); border-radius: 6px;
  font-family: var(--f-body); font-weight: 400; font-size: 17px; letter-spacing: 0;
}
/* the ring hole a passport tag hangs from */
.tag::before { content: ''; position: absolute; left: -11px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--panel); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25); }
.tag .rk { flex: 0 0 auto; font: 700 16px/1 var(--f-sign); letter-spacing: .03em; min-width: 42px; text-align: center; padding: 5px 3px; border: 2px solid var(--line-strong); border-radius: 4px; }
.tag .cn { flex: 1; min-width: 0; font-weight: 700; font-size: 18px; line-height: 1.15; overflow-wrap: break-word; }
.tag .dept { display: block; font-size: 13px; font-weight: 700; color: var(--ma); margin-top: 2px; }
.tag .oos-note { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 2px; }
.tag .tm { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 0 auto; }
.tag .par { font: 700 19px/1 var(--f-sign); font-variant-numeric: tabular-nums; padding: 5px 6px; border-radius: 4px; min-width: 58px; text-align: center; border: 2px solid var(--line); }
.tag .par[data-state="warn"] { background: var(--work); border-color: var(--work); color: var(--on-work); }
.tag .par[data-state="over"] { background: var(--alert); border-color: var(--alert); color: #fff; }
.tag .air { font: 600 14px/1 var(--f-sign); font-variant-numeric: tabular-nums; color: var(--muted); }
.tag .air span { color: var(--text); }

.tag.st-avail { border-left-color: var(--avail); }
.tag.st-work { border-left-color: var(--work); }
.tag.st-oos { border-left-color: var(--oos); background: repeating-linear-gradient(135deg, var(--oos-bg) 0 10px, transparent 10px 20px), var(--panel2); }
.tag.st-oos .cn { color: var(--muted); }
.tag.st-alert, .tag.par-over { border-left-color: var(--alert); border-color: var(--alert); background: var(--alert-bg); }
.tag.st-alert[data-st="alert"] .cn { color: var(--alert); }
.tag.ma .rk { border-color: var(--ma); color: var(--ma); }
.tag.sel { box-shadow: 0 0 0 4px var(--sel); border-color: var(--sel); border-left-color: inherit; }
.tag.sel.st-avail { border-left-color: var(--avail); } .tag.sel.st-work { border-left-color: var(--work); } .tag.sel.st-oos { border-left-color: var(--oos); }
.tag.roster { min-height: 56px; border-style: dashed; border-left-style: solid; border-left-color: var(--line-strong); background: transparent; }
.tag.roster.sel { border-style: solid; background: var(--sel-bg); }
.tag.lifted { opacity: .35; }
.ghost-tag { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; box-shadow: var(--shadow); opacity: .95; }
.ghost-n { position: absolute; right: -10px; top: -10px; background: var(--sel); color: #fff; font: 700 18px/1 var(--f-sign); border-radius: 99px; padding: 6px 10px; }
body.dragging, body.dragging * { cursor: grabbing !important; }

/* roster rail */
.search { margin-bottom: 10px; }
.ptabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 4px 0 10px; }
.ptabs button { min-height: 56px; padding: 4px 6px; white-space: normal; flex-direction: column; gap: 3px; font-size: 17px; color: var(--muted); background: transparent; }
.ptabs button.on { color: var(--text); background: var(--panel2); border-color: var(--text); }
.ptabs button.ma.on { border-color: var(--ma); }
.depts { display: flex; flex-direction: column; gap: 6px; }
.dept-btn { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 64px; padding: 8px 12px; white-space: normal; text-align: left; border-left: 8px solid var(--ma); }
.dept-btn .dn { font-size: 19px; }
.dept-btn .dc { display: flex; gap: 10px; font: 400 14px var(--f-body); color: var(--muted); }
.dept-btn .dc b { color: var(--ma); }
.dept-btn.oncall { background: var(--panel2); }
.btn.ma-add { width: 100%; margin-bottom: 10px; border-style: dashed; border-color: var(--ma); color: var(--ma); background: transparent; white-space: normal; }
.back-link { padding-left: 0; justify-content: flex-start; }
.back-link::before { content: '‹'; font-size: 26px; line-height: 0; }
.ma-head { margin-top: 6px; color: var(--ma); }

/* command log */
.log { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.log li { display: grid; grid-template-columns: 52px 1fr; column-gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.log time { font: 600 17px/1.2 var(--f-sign); font-variant-numeric: tabular-nums; color: var(--muted); }
.log .by { grid-column: 2; font-size: 12px; color: var(--muted); }
.log li.mayday { color: var(--alert); font-weight: 700; }
.log li.par span:first-of-type { color: var(--avail); }

/* selection bar */
.selbar {
  position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--panel); border: 3px solid var(--sel); border-radius: 12px; box-shadow: var(--shadow);
}
.selinfo { flex: 1; min-width: 220px; display: flex; flex-direction: column; }
.selinfo b { font: 700 22px/1.1 var(--f-sign); }
.selinfo .muted { font-size: 15px; }

/* ---------- modal / toast ---------- */
#modal:empty { display: none; }
.overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .62); }
.dialog { width: min(680px, 100%); max-height: 90vh; overflow: auto; padding: 22px; background: var(--panel); border: 2px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); }
.dialog h2 { margin-top: 0; font-size: 32px; }
.dialog.mayday { border: 4px solid var(--alert); }
.pick-grid, .export-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin: 14px 0; }
.export-list { grid-template-columns: 1fr 1fr; }
.md-pick, .export-list .btn { flex-direction: column; align-items: flex-start; gap: 4px; white-space: normal; text-align: left; padding: 10px 14px; }
.md-pick .muted, .export-list .muted { font-family: var(--f-body); font-weight: 400; }
.actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 18px; }
.tally { margin-right: auto; font: 700 22px var(--f-sign); color: var(--work); }
.tally.all { color: var(--avail); }
.roll-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.roll-row b { font: 700 22px var(--f-sign); }
.roll-row.ok b { color: var(--avail); }
.roll-names { color: var(--muted); font-size: 15px; margin-top: 2px; }
.roll-names .okname { color: var(--avail); }
.okmark { color: var(--avail); font: 700 18px var(--f-sign); padding: 0 12px; }
#toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); z-index: 60; }
.toast { display: flex; align-items: center; gap: 14px; background: var(--text); color: var(--ground); padding: 12px 18px; border-radius: 10px; font-weight: 700; box-shadow: var(--shadow); }
.toast .btn { color: var(--text); }

/* ---------- home / settings / report ---------- */
.page { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 18px 16px 80px; }
.page > * { max-width: 1080px; margin-left: auto; margin-right: auto; }
.panel { background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 14px; }
.panel h2 { margin-top: 0; }
.panel h3 { margin-top: 18px; }
.start { border-top: 8px solid var(--avail); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > label { flex: 1 1 200px; }
.row > .grow { flex: 3 1 320px; }
.row > .btn { flex: 0 0 auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.inc-card {
  display: block; color: inherit; text-decoration: none; padding: 16px 16px 16px 22px;
  background: var(--panel); border: 2px solid var(--line); border-left: 14px solid var(--work); border-radius: 8px;
}
.inc-card .inc-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font: 700 26px/1.1 var(--f-sign); margin-bottom: 6px; }
.inc-card.closed { border-left-color: var(--oos); }
.inc-card.closed .inc-top { color: var(--muted); }
.inc-card.is-mayday { border-color: var(--alert); border-left-color: var(--alert); }
.flag { display: inline-block; margin-top: 10px; padding: 4px 10px; border-radius: 4px; background: var(--alert); color: #fff; font: 700 18px var(--f-sign); letter-spacing: .08em; }
.unit-row, .unit-head { display: grid; grid-template-columns: 1.4fr 1fr 1fr 56px; gap: 8px; margin-bottom: 8px; }
.unit-head { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
@media (max-width: 700px) { .unit-row, .unit-head { grid-template-columns: 1fr 1fr; } }

.sheet { background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 24px; }
.sheet h1 { font-size: 40px; line-height: 1.05; margin-bottom: 6px; }
.report table { width: 100%; border-collapse: collapse; font-size: 15px; margin-bottom: 8px; }
.report th, .report td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.report th { color: var(--muted); font-weight: 700; font-size: 14px; border-bottom: 2px solid var(--line-strong); }
.report td.num { white-space: nowrap; }
.report tr.mayday td { color: var(--alert); font-weight: 700; }
.printed { margin-top: 18px; font-size: 13px; }

@keyframes alarm { 50% { filter: brightness(.72); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  :root { --ground: #fff; --panel: #fff; --panel2: #fff; --text: #000; --muted: #444; --line: #bbb; --line-strong: #666; --alert: #b00; }
  html, body { background: #fff; color: #000; }
  .noprint, #toast, #modal { display: none !important; }
  .screen { height: auto; display: block; }
  .page { overflow: visible; padding: 0; }
  .sheet { border: 0; padding: 0; }
  .report table { font-size: 11pt; }
  .report tr { break-inside: avoid; }
  .report h2 { break-after: avoid; }
}

/* close incident */
.close-btn { border-style: dashed; }
.close-checks { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.close-checks li { padding: 10px 12px 10px 16px; border-left: 8px solid var(--line-strong); background: var(--panel2); border-radius: 6px; font-size: 17px; }
.close-checks li.good { border-left-color: var(--avail); }
.close-checks li.warn { border-left-color: var(--work); }
.close-checks li.bad { border-left-color: var(--alert); color: var(--alert); font-weight: 700; }

/* import */
.import-panel { border-top: 8px solid var(--sel); }
.file-pick { position: relative; width: 100%; margin-top: 10px; color: var(--text); border-style: dashed; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.imp-error { color: var(--alert); font-weight: 700; margin-top: 10px; }
.imp-table { max-height: 38vh; overflow: auto; border: 2px solid var(--line); border-radius: 8px; }
.imp-table table { width: 100%; border-collapse: collapse; font-size: 15px; }
.imp-table th, .imp-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.imp-table th { position: sticky; top: 0; background: var(--panel2); color: var(--muted); }
.imp-table tr.s-new td:last-child { color: var(--avail); font-weight: 700; }
.imp-table tr.s-update td:last-child { color: var(--work); font-weight: 700; }
.imp-table tr.s-same td, .imp-table tr.s-dup td { color: var(--muted); }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* groups per incident type */
.load-btn { width: 100%; margin-top: 10px; border-style: dashed; white-space: normal; }
.md-pick.current { border-color: var(--text); }
.type-lists { align-items: stretch; }
.type-lists textarea { min-height: 230px; }

/* PIN screen */
.pin-screen { align-items: center; justify-content: center; overflow-y: auto; padding: 16px; }
.pin-box { width: min(380px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.pin-box .logo { width: 64px; height: 64px; margin-bottom: 6px; }
.pin-box h1 { font-size: 36px; }
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 14px 0 4px; min-height: 22px; }
.pd { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--line-strong); }
.pd.on { background: var(--text); border-color: var(--text); }
.pin-msg { min-height: 24px; color: var(--alert); font-weight: 700; margin: 0; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; margin: 8px 0 10px; }
.keypad .key { min-height: 76px; font-size: 34px; }
.keypad .key.ok { font-size: 22px; background: var(--sel); border-color: var(--sel); color: #fff; }
.sync.signin { color: var(--work); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; min-height: 48px; }
.sync.signin .dot { background: var(--work); }
