:root {
  --bg: #0b1410; --panel: #12201a; --panel2: #182b22; --line: #2a4436;
  --text: #eef5f0; --muted: #8fa89a; --accent: #ffd23f; --accent2: #3ee08f;
  --danger: #ff5a5f; --blue: #58a6ff; --pol: #3f7bff; --fire: #ff5a3c; --ems: #ff8a8d; --dot: #ff9a1f;
  --p1: #ff5a5f; --p2: #ffb13b; --p3: #58a6ff;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--bg); color: var(--text); overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-user-select: none; user-select: none; touch-action: none; overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
canvas#map { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }
.h { font-weight: 900; font-style: italic; text-transform: uppercase; letter-spacing: .02em; }

/* ------------------------------------------------------------ HUD */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud button, #hud .sheet, #hud .icard, #hud .board, #hud .ln, #hud .radio, #hud .tip { pointer-events: auto; }
.box { background: rgba(8, 14, 11, .88); border: 1px solid #ffffff22; border-radius: 12px; box-shadow: 0 6px 20px #0008; }
.score { position: absolute; top: calc(8px + var(--sat)); left: calc(8px + var(--sal)); padding: 5px 10px 7px; min-width: 92px; }
.score b { display: block; font-size: 21px; font-weight: 900; font-style: italic; color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums; }
.score .flow { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 9.5px; font-weight: 900; letter-spacing: .1em; color: var(--muted); }
.score .flow i { font-style: italic; color: var(--accent2); font-size: 13px; letter-spacing: 0; }
.score .fbar { height: 4px; border-radius: 3px; background: #ffffff18; margin-top: 3px; overflow: hidden; }
.score .fbar div { height: 100%; width: 0; background: linear-gradient(90deg, #1fb46d, var(--accent2)); transition: width .3s; }
.clock { position: absolute; top: calc(8px + var(--sat)); left: 50%; transform: translateX(-50%); padding: 4px 12px 6px; text-align: center; white-space: nowrap; width: min(190px, calc(100vw - 230px)); }
.clock > b { display: block; font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.1; }
.clock > span { display: block; font-size: 9.5px; font-weight: 900; letter-spacing: .08em; color: var(--accent); overflow: hidden; text-overflow: ellipsis; }
.calm .t { display: flex; justify-content: space-between; font-size: 8.5px; font-weight: 900; letter-spacing: .12em; color: var(--muted); margin-top: 2px; }
.calm .t b { color: var(--accent2); font-variant-numeric: tabular-nums; }
.calm .bar { height: 6px; border-radius: 3px; background: #ffffff14; margin-top: 2px; overflow: hidden; }
.calm .bar div { height: 100%; width: 100%; background: linear-gradient(90deg, #ff5a5f, #ffd23f 45%, #3ee08f); background-size: 170px 100%; transition: width .25s; }
.calm.low .t b { color: var(--danger); }
.pause { position: absolute; top: calc(10px + var(--sat)); right: calc(10px + var(--sar)); width: 38px; height: 38px; border-radius: 10px; border: 1px solid #ffffff2a;
  background: rgba(8, 14, 11, .8); font-weight: 900; display: grid; place-items: center; font-size: 13px; }

/* phone lines */
.lines { position: absolute; top: calc(78px + var(--sat)); left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; pointer-events: auto; padding-bottom: 2px; }
.lines::-webkit-scrollbar { display: none; }
.ln { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; background: rgba(8, 14, 11, .92); border: 1px solid #ffffff22; border-radius: 12px; padding: 5px 10px 5px 5px; font-size: 11px; white-space: nowrap; text-align: left; }
.ln .ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; position: relative; background: #ffffff10; flex: 0 0 28px; }
.ln .ic svg { position: absolute; inset: -3px; width: 34px; height: 34px; transform: rotate(-90deg); }
.ln b { display: block; font-size: 11.5px; } .ln span { color: var(--muted); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ln.act { border-color: var(--accent2); background: #10301ef0; } .ln.act b { color: var(--accent2); }
.ln.ring .ic { animation: jiggle .45s infinite; background: #ffd23f22; } .ln.hot { border-color: #ff5a5f; } .ln.hot .ic { background: #ff5a5f33; }
.ln.hold { border-color: #58a6ff88; } .ln.free { opacity: .45; }
.ln.wait b { color: var(--danger); }
@keyframes jiggle { 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
@media (prefers-reduced-motion: reduce) { .ln.ring .ic { animation: none; } }

.feed { position: absolute; bottom: 40vh; left: calc(8px + var(--sal)); display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 4px; max-width: calc(100vw - 20px); }
.feed div { background: rgba(8, 14, 11, .88); border: 1px solid #ffffff1c; border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 800; animation: fin .25s; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed div.good { color: #9ff0c6; } .feed div.bad { color: #ff9a9d; } .feed div.warn { color: var(--accent); }
@keyframes fin { from { opacity: 0; transform: translateY(-4px); } }
.radio { position: absolute; top: calc(124px + var(--sat)); right: calc(8px + var(--sar)); width: min(64vw, 270px); padding: 7px 10px; font-size: 11.5px; line-height: 1.35; animation: fin .25s; }
.radio b { font-weight: 900; } .radio .who { display: block; font-size: 9px; letter-spacing: .14em; font-weight: 900; margin-bottom: 1px; }
.tip { position: absolute; left: 50%; transform: translateX(-50%); top: calc(124px + var(--sat)); background: rgba(8, 14, 11, .95); border: 1px solid #ffffff22; border-left: 4px solid var(--accent);
  padding: 9px 12px; border-radius: 10px; font-size: 12.5px; width: max-content; max-width: min(92vw, 420px); line-height: 1.4; box-shadow: 0 10px 30px #000a; }
.tip b { color: var(--accent); } .tip button { display: block; margin-top: 6px; margin-left: auto; font-size: 11px; font-weight: 900; color: var(--accent); }

/* ------------------------------------------------------------ the sheet (phone) */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px; background: linear-gradient(180deg, #14251d, #0f1b15); border-top: 1px solid #ffffff22;
  border-radius: 20px 20px 0 0; box-shadow: 0 -12px 30px #000a; padding: 6px 12px calc(10px + var(--sab)); display: flex; flex-direction: column; max-height: 64vh; }
.grab { width: 42px; height: 5px; border-radius: 3px; background: #ffffff30; margin: 0 auto 7px; flex: 0 0 auto; }
#sheet-body { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.sheet.min #sheet-body { max-height: 30vh; }
.tabs { display: flex; gap: 4px; background: #0006; border-radius: 11px; padding: 3px; margin-bottom: 8px; flex: 0 0 auto; }
.tabs button { flex: 1; text-align: center; font-size: 11.5px; font-weight: 900; padding: 6px 0; border-radius: 8px; color: var(--muted); letter-spacing: .04em; }
.tabs button.sel { background: var(--panel2); color: var(--text); box-shadow: 0 2px 6px #0006; }
.tabs em { font-style: normal; background: var(--danger); color: #fff; border-radius: 6px; padding: 0 5px; margin-left: 3px; font-size: 10px; }
.scroll { overflow-y: auto; min-height: 0; flex: 1 1 auto; overscroll-behavior: contain; touch-action: pan-y; scrollbar-width: thin; }
.empty { color: var(--muted); font-size: 12px; text-align: center; padding: 10px 6px 12px; line-height: 1.45; }
.empty b { color: var(--accent); }

/* incident rows */
.irow { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 8px; border-radius: 11px; background: #ffffff08; margin-bottom: 5px; font-size: 12px; text-align: left; border: 1px solid transparent; }
.irow .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 17px; flex: 0 0 32px; background: #ffffff10; }
.irow b { display: block; font-size: 12.5px; } .irow span { color: var(--muted); font-size: 10.5px; font-weight: 700; }
.irow .t { flex: 1; min-width: 0; } .irow .t span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.irow em { margin-left: auto; text-align: right; font-style: normal; font-weight: 900; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.irow em small { display: block; font-size: 9px; color: var(--muted); letter-spacing: .08em; }
.irow.req { border-color: #ffd23f88; } .irow.late em { color: var(--danger); }
.ptag { font: italic 900 10.5px system-ui; padding: 2px 7px; border-radius: 6px; color: #fff; flex: 0 0 auto; }
.ptag.p1 { background: var(--p1); } .ptag.p2 { background: var(--p2); color: #241900; } .ptag.p3 { background: var(--p3); color: #00172e; }

/* the caller */
.caller { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; flex: 0 0 auto; }
.av { width: 40px; height: 40px; border-radius: 13px; flex: 0 0 40px; position: relative; background: radial-gradient(circle at 35% 25%, #b9b2a2, #7c7566 70%); box-shadow: inset 0 -4px 0 #0003, 0 3px 8px #0006; }
.av i { position: absolute; top: 14px; width: 8px; height: 6px; border-radius: 50%; background: #ffd23f; box-shadow: 0 0 8px #ffd23f; }
.av i:first-of-type { left: 9px; } .av i:last-of-type { right: 9px; }
.av.worried i { height: 8px; top: 13px; background: #fff6c9; }
.av.calm i { height: 3px; top: 16px; }
.av.big { width: 52px; height: 52px; flex-basis: 52px; border-radius: 16px; } .av.big i { top: 19px; width: 9px; height: 7px; } .av.big i:first-of-type { left: 13px; } .av.big i:last-of-type { right: 13px; }
.headset { position: absolute; left: -5px; right: -5px; top: -4px; height: 34px; border: 4px solid #2a2f35; border-bottom: 0; border-radius: 30px 30px 0 0; }
.headset::after { content: ''; position: absolute; left: -7px; bottom: -12px; width: 10px; height: 16px; border-radius: 4px; background: #2a2f35; }
.caller .who { flex: 1; min-width: 0; } .caller .who b { display: block; font-size: 14px; }
.caller .who span { font-size: 10.5px; color: var(--muted); font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caller .who span.clue { color: #ff9a9d; }
.panic { width: 104px; flex: 0 0 104px; }
.panic .t { display: flex; justify-content: space-between; font-size: 8.5px; font-weight: 900; letter-spacing: .12em; color: var(--muted); }
.panic .bar { height: 7px; border-radius: 4px; background: #ffffff14; margin-top: 3px; position: relative; overflow: hidden; }
.panic .bar div { height: 100%; background: linear-gradient(90deg, #3ee08f, #ffd23f 50%, #ff5a5f); background-size: 104px 100%; transition: width .3s; }
.panic .bar i { position: absolute; top: 0; bottom: 0; left: 72%; width: 2px; background: #fff8; }
.hold { font-size: 10px; font-weight: 900; letter-spacing: .08em; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--panel2); flex: 0 0 auto; }

.chat { display: flex; flex-direction: column; gap: 5px; padding: 2px 0 6px; }
.bub { max-width: 86%; padding: 6px 10px; border-radius: 13px; font-size: 12.5px; line-height: 1.38; font-weight: 600; }
.bub.them { background: #ffffff10; border: 1px solid #ffffff14; border-bottom-left-radius: 4px; align-self: flex-start; }
.bub.you { background: #1d4ea8; border-bottom-right-radius: 4px; align-self: flex-end; color: #e6efff; }
.bub .kw { background: #ffd23f22; border: 0; border-bottom: 2px solid var(--accent); border-radius: 4px; padding: 0 3px; color: #ffe680; font: inherit; font-weight: 800; cursor: pointer; }
.bub .kw.got { background: var(--accent2); color: #002313; border-color: transparent; }
.bub.typing { color: var(--muted); letter-spacing: .25em; font-weight: 900; }
.bub.garble { color: #ffb3b5; font-style: italic; }

.card2 { background: #0008; border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px; margin: 2px 0 7px; flex: 0 0 auto; }
.card2 .lbl { font-size: 9px; font-weight: 900; color: var(--muted); letter-spacing: .14em; display: flex; justify-content: space-between; margin-bottom: 4px; }
.card2 .lbl b { color: var(--accent); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.fd { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; background: #ffffff08; border-radius: 8px; padding: 4px 7px; border: 1px dashed #ffffff22; min-width: 0; color: var(--muted); }
.fd i { font-style: normal; font-size: 12px; } .fd small { display: block; font-size: 8px; letter-spacing: .12em; color: var(--muted); font-weight: 900; }
.fd > div { min-width: 0; } .fd > div span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd.ok { border: 1px solid #3ee08f66; color: var(--text); } .fd.ok::after { content: '✓'; margin-left: auto; color: var(--accent2); font-weight: 900; }
.fd.warn { border: 1px solid #ff5a5f88; color: #ffb3b5; } .fd.warn::after { content: '!'; margin-left: auto; font-weight: 900; }
.asks { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 7px; flex: 0 0 auto; }
.ask { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px; font-size: 11.5px; font-weight: 800; display: flex; gap: 6px; align-items: center; text-align: left; line-height: 1.2; }
.ask kbd { font: 900 9px system-ui; background: #ffffff14; border-radius: 4px; padding: 1px 4px; color: var(--muted); }
.ask.calm { border-color: #3ee08f66; color: #9ff0c6; } .ask.used { opacity: .38; text-decoration: line-through; }
.ask:disabled { opacity: .5; }
.prow { display: flex; gap: 6px; align-items: stretch; flex: 0 0 auto; }
.pri { display: flex; gap: 4px; }
.pri button { width: 38px; border-radius: 10px; display: grid; place-items: center; font: italic 900 14px system-ui; border: 2px solid #ffffff22; background: #0005; color: var(--muted); }
.pri button.sel.p1 { background: var(--p1); border-color: #ffb3b5; color: #fff; }
.pri button.sel.p2 { background: var(--p2); border-color: #ffe0a8; color: #241900; }
.pri button.sel.p3 { background: var(--p3); border-color: #b8dcff; color: #00172e; }
.go { display: block; width: 100%; padding: 12px; border-radius: 13px; background: linear-gradient(180deg, #ffe066, #f0b400); color: #241900; font-size: 15px; box-shadow: 0 8px 20px #f0b40033; text-align: center; line-height: 1.1; }
.go small { display: block; font-size: 9px; font-style: normal; letter-spacing: .08em; opacity: .75; margin-top: 2px; }
.go:disabled { background: #2b3a32; color: #6f8478; box-shadow: none; }
.prow .go { flex: 1; }
.side { width: 54px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); display: grid; place-items: center; text-align: center; font: 900 9.5px system-ui; color: var(--muted); line-height: 1.15; padding: 4px 2px; }
.side.prank { color: #c8b8ff; }

/* pre-arrival instructions */
.instr { background: #0008; border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin-bottom: 7px; flex: 0 0 auto; }
.instr .lbl { font-size: 9.5px; font-weight: 900; color: var(--muted); letter-spacing: .14em; display: flex; justify-content: space-between; margin-bottom: 6px; }
.instr .lbl b { color: var(--ems); }
.cpr { display: flex; gap: 12px; align-items: center; }
.cprbtn { position: relative; width: 110px; height: 110px; border-radius: 50%; flex: 0 0 110px; border: 4px solid #ffffff18; }
.cprbtn .hit { position: absolute; inset: -4px; border-radius: 50%; border: 4px solid var(--accent2); clip-path: polygon(50% 50%, 38% 0, 62% 0); }
.cprbtn .beat { position: absolute; width: 14px; height: 14px; margin: -7px; border-radius: 50%; background: var(--ems); box-shadow: 0 0 10px var(--ems); left: 50%; top: 0; }
.cprbtn .core { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #c9ced3); display: grid; place-items: center; color: #7a1015; font: italic 900 14px system-ui; transition: transform .06s; }
.cprbtn.hitnow .core { transform: scale(.9); }
.cpr .info { flex: 1; font-size: 11.5px; line-height: 1.4; color: var(--muted); font-weight: 600; }
.cpr .info b { color: var(--text); } .cpr .q { height: 8px; border-radius: 4px; background: #ffffff14; overflow: hidden; margin: 5px 0; } .cpr .q div { height: 100%; background: var(--ems); transition: width .2s; }
.cpr .fb { font: italic 900 14px system-ui; min-height: 18px; } .fb.perfect, .fb.good { color: var(--accent2); } .fb.off { color: var(--danger); }
.cards { display: grid; gap: 5px; }
.cardopt { display: flex; gap: 7px; align-items: center; font-size: 12px; font-weight: 800; background: var(--panel2); border-radius: 9px; padding: 8px; border: 1px solid var(--line); text-align: left; }
.cardopt i { font-style: normal; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 900; background: #ffffff14; flex: 0 0 20px; }
.cardopt.ok { border-color: #3ee08f66; opacity: .7; } .cardopt.ok i { background: var(--accent2); color: #002313; }
.cardopt.bad { border-color: #ff5a5f88; color: #ff9a9d; text-decoration: line-through; opacity: .6; } .cardopt.bad i { background: var(--danger); color: #fff; }

/* the incident and its units */
.ihead { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; flex: 0 0 auto; }
.ihead .ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; background: #ffffff10; border: 1px solid #ffffff22; flex: 0 0 38px; }
.ihead .t { flex: 1; min-width: 0; } .ihead b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ihead span { font-size: 10.5px; color: var(--muted); font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clockr { text-align: right; font-weight: 900; font-variant-numeric: tabular-nums; flex: 0 0 auto; } .clockr b { font-size: 16px; color: var(--accent); font-style: italic; } .clockr small { display: block; font-size: 8.5px; letter-spacing: .12em; color: var(--muted); }
.clockr.late b { color: var(--danger); } .clockr.ok b { color: var(--accent2); }
.x { width: 30px; height: 30px; border-radius: 9px; background: #ffffff10; font-weight: 900; flex: 0 0 30px; }
.needs { display: flex; gap: 5px; margin-bottom: 7px; flex-wrap: wrap; flex: 0 0 auto; }
.nd { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 900; padding: 3px 8px; border-radius: 999px; background: #ffffff0c; border: 1px solid #ffffff1c; }
.nd.ok { border-color: #3ee08f88; color: #9ff0c6; } .nd.miss { border-color: #ffd23f99; color: var(--accent); } .nd.req { border-color: var(--danger); color: #ffb3b5; animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px #ff5a5f44; } }
.ulist { display: grid; gap: 4px; margin-bottom: 7px; }
.uc { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 11px; background: #ffffff08; border: 1px solid transparent; font-size: 12px; width: 100%; text-align: left; touch-action: pan-y; }
.uc .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; flex: 0 0 30px; position: relative; }
.uc .ic::after { content: ''; position: absolute; right: -3px; bottom: -3px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #12201a; background: var(--st, #3ee08f); }
.uc b { display: block; font-size: 12.5px; } .uc span { color: var(--muted); font-size: 10.5px; font-weight: 700; }
.uc .t { flex: 1; min-width: 0; } .uc .t span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc em { margin-left: auto; text-align: right; font-style: normal; font-weight: 900; font-size: 13px; font-variant-numeric: tabular-nums; }
.uc em small { display: block; font-size: 8.5px; color: var(--muted); letter-spacing: .1em; }
.uc.sel { border-color: var(--accent2); background: #3ee08f14; } .uc.sel em { color: var(--accent2); }
.uc.rec { border-color: #ffd23f55; }
.uc.busy { opacity: .55; }
.uc .chk { width: 22px; height: 22px; border-radius: 7px; border: 2px solid #ffffff33; display: grid; place-items: center; font-weight: 900; font-size: 12px; flex: 0 0 22px; }
.uc.sel .chk { background: var(--accent2); border-color: var(--accent2); color: #002313; }
.uc .grip { color: var(--muted); font-size: 14px; letter-spacing: -2px; padding: 0 2px; }
.sub3 { font-size: 9.5px; font-weight: 900; letter-spacing: .14em; color: var(--muted); margin: 3px 0 5px; display: flex; justify-content: space-between; }
.sub3 button { color: var(--accent); font-weight: 900; letter-spacing: .1em; font-size: 9.5px; }
.ghost { position: fixed; pointer-events: none; display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 12px; background: #1b3226; border: 2px solid var(--accent);
  box-shadow: 0 14px 30px #000c; transform: translate(-30%, -120%) rotate(-4deg); font-size: 12px; z-index: 30; }
.ghost .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 15px; background: #ffffff14; }
.ghost b { display: block; } .ghost span { font-size: 10px; color: var(--accent); font-weight: 900; }
.backcall { display: flex; align-items: center; gap: 8px; width: 100%; background: #3ee08f18; border: 1px solid #3ee08f66; border-radius: 10px; padding: 6px 9px; font-size: 11.5px; font-weight: 800; margin-bottom: 7px; color: #9ff0c6; text-align: left; flex: 0 0 auto; }

/* desktop: the console */
.keys { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 6px; white-space: nowrap; }
.keys div { background: rgba(8, 14, 11, .86); border: 1px solid #ffffff22; border-radius: 8px; padding: 4px 9px; font-size: 11px; font-weight: 700; color: var(--muted); }
.keys b { color: var(--text); background: #ffffff14; border-radius: 4px; padding: 0 5px; margin-right: 4px; }
body.desk .score { top: 10px; left: 10px; }
body.desk .clock { top: 10px; width: 230px; }
body.desk .lines { top: 66px; left: 10px; right: auto; width: 330px; flex-direction: column; gap: 4px; overflow: visible; }
body.desk .ln { width: 100%; }
body.desk .sheet { left: 10px; right: auto; bottom: 10px; width: 330px; max-width: none; margin: 0; border-radius: 14px; border: 1px solid #ffffff22; max-height: none; padding-top: 10px; }
body.desk .grab { display: none; }
body.desk .feed { top: 80px; bottom: auto; left: 352px; flex-direction: column; }
body.desk .radio { top: auto; bottom: 52px; right: 320px; }
body.desk .tip { top: auto; bottom: 52px; }
.icard { position: absolute; padding: 10px 12px; width: 450px; display: flex; flex-direction: column; max-height: calc(100vh - 140px); }
.board { position: absolute; top: 10px; right: 10px; bottom: 10px; width: 300px; padding: 10px; display: flex; flex-direction: column; }
.board .lbl { font-size: 10px; font-weight: 900; color: var(--muted); letter-spacing: .16em; margin: 2px 0 6px; display: flex; justify-content: space-between; }
.board .lbl b { color: var(--accent); }
.ugrp { font-size: 9.5px; font-weight: 900; letter-spacing: .14em; margin: 7px 0 3px; display: flex; justify-content: space-between; }
.ugrp span { color: var(--muted); }
.urow { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; font-size: 11.5px; margin-bottom: 2px; border: 1px solid transparent; width: 100%; text-align: left; }
.urow .ic { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 12px; flex: 0 0 24px; position: relative; }
.urow .ic kbd { position: absolute; top: -5px; left: -5px; background: var(--accent); color: #1a1400; font: 900 9px system-ui; border-radius: 4px; padding: 0 3px; }
.urow b { font-size: 12px; white-space: nowrap; }
.urow .where { color: var(--muted); font-size: 10px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.st { margin-left: auto; font-size: 9px; font-weight: 900; letter-spacing: .06em; padding: 2px 6px; border-radius: 5px; white-space: nowrap; }
.st.avail { background: #3ee08f22; color: var(--accent2); } .st.enroute { background: #ffb13b22; color: var(--p2); } .st.onscene { background: #58a6ff22; color: var(--blue); }
.st.return { background: #ffffff10; color: var(--muted); } .st.transport { background: #ff8a8d22; color: var(--ems); }
.urow.sel { border-color: var(--accent); background: #2a2a10; }

/* ------------------------------------------------------------ menu and screens */
.screen { position: fixed; inset: 0; overflow-y: auto; background: radial-gradient(120% 60% at 50% 0%, #3a1d2a 0%, var(--bg) 62%); touch-action: pan-y; }
.screen .wrap { padding: calc(14px + var(--sat)) max(16px, var(--sar)) calc(18px + var(--sab)) max(16px, var(--sal)); max-width: 540px; margin: 0 auto; }
.logo { text-align: center; margin: 0 0 8px; }
.logo .t1, .logo .t2 { font-size: 32px; line-height: .9; } .logo .t2 { color: var(--accent); }
.beacon { width: 58px; height: 34px; margin: 0 auto 6px; position: relative; }
.beacon::before { content: ''; position: absolute; left: 12px; right: 12px; bottom: 0; height: 12px; border-radius: 4px; background: #5f6e78; box-shadow: inset 0 -3px 0 #0004; }
.beacon::after { content: ''; position: absolute; left: 18px; right: 18px; bottom: 10px; height: 20px; border-radius: 12px 12px 3px 3px; background: radial-gradient(circle at 50% 70%, #fff 0 18%, #ff3b3b 45%, #a8101a);
  box-shadow: 0 0 22px #ff3b3b, 0 0 50px #ff3b3b88; animation: beam 1.4s infinite; }
@keyframes beam { 50% { box-shadow: 0 0 10px #ff3b3b, 0 0 20px #ff3b3b44; } }
.beacon i { position: absolute; bottom: 20px; width: 26px; height: 3px; border-radius: 2px; background: #ff3b3b; box-shadow: 0 0 8px #ff3b3b; }
.beacon i:first-child { left: -10px; transform: rotate(-15deg); } .beacon i:last-child { right: -10px; transform: rotate(15deg); }
.logo .sub { color: var(--muted); font-size: 10.5px; letter-spacing: .26em; margin-top: 6px; font-weight: 700; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 9px 12px; margin-bottom: 7px; }
.card > .lbl { font-size: 11px; font-weight: 900; color: var(--muted); letter-spacing: .14em; margin-bottom: 8px; text-transform: uppercase; display: flex; justify-content: space-between; }
.card > .lbl b { color: var(--accent); letter-spacing: .06em; }
.desk-id { display: flex; align-items: center; gap: 12px; }
.desk-id .who { flex: 1; min-width: 0; } .desk-id .who b { display: block; font-size: 16px; font-style: italic; font-weight: 900; } .desk-id .who span { font-size: 11px; color: var(--muted); font-weight: 700; }
.desk-id .xp { height: 6px; border-radius: 3px; background: #ffffff14; margin-top: 5px; overflow: hidden; } .desk-id .xp div { height: 100%; background: linear-gradient(90deg, #ff5a3c, #ffd23f); }
.desk-id .dpts { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; } .desk-id .dpts span { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; }
.dist { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; touch-action: pan-x; }
.dist::-webkit-scrollbar { display: none; }
.dc { flex: 0 0 104px; background: var(--panel2); border: 2px solid transparent; border-radius: 12px; padding: 5px; text-align: left; }
.dc canvas { display: block; width: 90px; height: 52px; border-radius: 8px; background: #233; }
.dc .nm { font-size: 11px; font-weight: 900; margin-top: 4px; } .dc .st2 { font-size: 10px; color: var(--accent); font-weight: 900; margin-top: 1px; }
.dc.sel { border-color: var(--accent); background: #2a2a10; } .dc.lock { opacity: .45; } .dc.lock .st2 { color: var(--muted); }
.seg { display: flex; gap: 6px; margin-bottom: 8px; }
.seg button { flex: 1; text-align: center; background: var(--panel2); border: 1px solid var(--line); padding: 9px 2px; border-radius: 10px; font-size: 12px; }
.seg button.sel { background: var(--accent); color: #1a1400; border-color: var(--accent); }
.seg.small { margin: 0; } .seg.small button { padding: 6px 10px; font-size: 11px; font-weight: 800; }
.shifts { display: grid; gap: 6px; }
.sh { display: flex; align-items: center; gap: 10px; background: var(--panel2); border: 2px solid transparent; border-radius: 11px; padding: 6px 10px 6px 8px; text-align: left; width: 100%; }
.sh .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 17px; background: #ff5a5f22; flex: 0 0 34px; }
.sh > div:nth-child(2) { min-width: 0; flex: 1; }
.sh .nm { font-weight: 900; font-size: 13.5px; } .sh .ds { font-size: 10.5px; color: var(--muted); font-weight: 700; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh .st3 { margin-left: auto; font-size: 15px; letter-spacing: .06em; color: #ffffff28; white-space: nowrap; text-align: right; } .sh .st3 em { font-style: normal; color: var(--accent); }
.sh .st3 small { display: block; font-size: 9.5px; letter-spacing: .04em; color: var(--muted); font-weight: 800; }
.sh.sel { border-color: var(--accent); background: #2a2a10; }
.row2 { display: flex; gap: 8px; align-items: stretch; }
.stn { flex: 1; display: flex; align-items: center; justify-content: space-between; text-align: left; }
.stn b { font-size: 16px; display: block; } .stn small { font-size: 10.5px; color: var(--muted); font-weight: 700; }
.bolts { font-weight: 900; font-style: italic; color: var(--accent); font-size: 17px; white-space: nowrap; }
.bolts.big { font-size: 28px; text-align: center; margin: 6px 0 10px; }
.howbtn { border-left: 1px solid var(--line); padding-left: 10px; font-size: 11px; font-weight: 900; color: var(--muted); letter-spacing: .06em; max-width: 70px; }
.screen .go { padding: 14px; font-size: 20px; margin-top: 4px; }
.foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; flex-wrap: wrap; }
.sound { font-size: 12px; font-weight: 800; color: var(--muted); padding: 6px 4px; }
.cloud { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 8px; padding: 8px 10px; background: var(--panel2); border-radius: 10px; font-size: 12px; line-height: 1.35; }
.cloud .ctag { font-weight: 900; color: var(--accent2); white-space: nowrap; } .cloud .cmsg { flex: 1; min-width: 150px; color: var(--muted); }
.cloud .cacts { display: flex; gap: 6px; }
.cloud .cacts button { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 800; }
.cloud .cacts .pri { background: var(--accent); color: #1a1400; border-color: var(--accent); }
.ttl { text-align: center; font-size: 32px; color: var(--accent); line-height: 1; }
.sub2 { text-align: center; color: var(--muted); font-weight: 800; font-size: 12px; letter-spacing: .06em; margin-top: 6px; line-height: 1.4; }
.ups { display: grid; gap: 7px; margin-bottom: 10px; }
.up { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; }
.up .t { flex: 1; } .up b { display: block; font-size: 14px; } .up span { font-size: 11px; color: var(--muted); font-weight: 700; }
.up .lv { font-size: 10px; color: var(--accent2); font-weight: 900; letter-spacing: .1em; }
.up button { background: var(--accent); color: #1a1400; border-radius: 9px; padding: 8px 10px; font-weight: 900; font-size: 12px; white-space: nowrap; }
.up button:disabled { background: #2b3a32; color: #6f8478; }

.overlay { position: fixed; inset: 0; background: rgba(6, 11, 8, .76); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); overflow-y: auto; touch-action: pan-y; z-index: 20; }
.panel { max-width: 430px; margin: 0 auto; padding: calc(max(24px, 5vh) + var(--sat)) 16px calc(20px + var(--sab)); }
.panel .go { margin-top: 14px; }
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.acts3 { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 8px; margin-top: 10px; }
.btn { padding: 12px 6px; border-radius: 12px; text-align: center; font-size: 14px; }
.btn.ghostb { background: var(--panel2); border: 1px solid var(--line); }
.btn.gold { background: linear-gradient(180deg, #ffe066, #f0b400); color: #241900; }
.bigstars { display: flex; justify-content: center; gap: 10px; margin: 14px 0 6px; }
.bigstars div { width: 60px; height: 60px; display: grid; place-items: center; font-size: 50px; line-height: 1; color: #ffffff1f; }
.bigstars div.on { color: var(--accent); text-shadow: 0 0 22px #ffd23f88; animation: pop .4s backwards; }
.bigstars div:nth-child(2) { transform: translateY(-10px) scale(1.15); }
.bigstars div:nth-child(2).on { animation-delay: .25s; } .bigstars div:nth-child(3).on { animation-delay: .5s; }
@keyframes pop { from { opacity: 0; scale: .3; } }
.why { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 12px; line-height: 1.4; } .why b { color: var(--text); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stat { background: var(--panel2); border-radius: 10px; padding: 7px 10px; }
.stat span { display: block; font-size: 9.5px; font-weight: 900; letter-spacing: .12em; color: var(--muted); }
.stat b { font-size: 18px; font-weight: 900; font-style: italic; font-variant-numeric: tabular-nums; }
.stat b small { font-size: 11px; color: var(--accent2); font-style: normal; margin-left: 4px; } .stat b small.bad { color: #ff8a8d; }
.total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; gap: 8px; }
.total b { font-size: 28px; font-style: italic; color: var(--accent); font-variant-numeric: tabular-nums; }
.total .best { font-size: 10px; font-weight: 900; background: var(--accent); color: #1a1400; border-radius: 6px; padding: 2px 7px; letter-spacing: .08em; }
.rank { background: var(--panel2); border-radius: 12px; padding: 9px 11px; margin-top: 8px; }
.rank .t { display: flex; justify-content: space-between; font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.rank .t b { color: var(--accent); } .rank .t span { color: var(--muted); }
.rank .xp { height: 8px; border-radius: 4px; background: #ffffff14; margin-top: 6px; overflow: hidden; position: relative; }
.rank .xp div { position: absolute; top: 0; bottom: 0; left: 0; background: var(--fire); } .rank .xp i { position: absolute; top: 0; bottom: 0; background: #ffd23f; }
.earn { text-align: center; font-size: 12.5px; font-weight: 800; color: var(--accent); margin-top: 8px; }
.how ol { margin: 14px 0 0 18px; display: grid; gap: 9px; font-size: 13px; line-height: 1.45; color: #cfdcd4; }
.how li b { color: var(--accent); } .how em { color: var(--accent2); font-style: normal; font-weight: 800; }
.keyshelp { margin-top: 12px; font-size: 11.5px; color: var(--muted); line-height: 1.5; } .keyshelp b { color: var(--text); }

/* landscape phones: the sheet docks on the right */
@media (orientation: landscape) and (max-height: 520px) {
  .sheet { left: auto; right: 0; top: 0; bottom: 0; width: min(46vw, 380px); max-width: none; max-height: none; border-radius: 16px 0 0 16px; border-top: 0; border-left: 1px solid #ffffff22; padding-top: calc(8px + var(--sat)); }
  .grab { display: none; }
  .clock { left: calc((100vw - min(46vw, 380px)) / 2); width: 160px; }
  .pause { right: calc(min(46vw, 380px) + 8px); }
  .lines { right: calc(min(46vw, 380px) + 8px); }
  .feed { bottom: 10px; }
  .radio { right: calc(min(46vw, 380px) + 8px); }
}

/* ------------------------------------------------------------ Two Desks lobby */
.coop { margin-bottom: 8px; }
.coop .hint { margin: 0 0 8px; }
.crow { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.crow label { font-size: 11px; font-weight: 900; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; white-space: nowrap; }
.crow input { flex: 1; min-width: 0; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; color: var(--text); font: 800 14px system-ui; -webkit-user-select: text; user-select: text; touch-action: manipulation; }
.crow #c-code { flex: 0 0 82px; text-transform: uppercase; letter-spacing: .2em; text-align: center; }
.crow .btn { padding: 9px 12px; font-size: 13px; }
.croom { background: #0006; border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin-bottom: 6px; }
.ccode { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ccode span { font-size: 10px; font-weight: 900; letter-spacing: .14em; color: var(--muted); }
.ccode b { font: italic 900 24px system-ui; color: var(--accent); letter-spacing: .14em; flex: 1; }
.ccode .btn { padding: 6px 10px; font-size: 12px; }
.cp { display: flex; align-items: center; gap: 8px; padding: 5px 4px; font-size: 13px; font-weight: 800; }
.cp .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp .nm small { color: var(--muted); font-weight: 700; margin-left: 4px; }
.cp .roles { display: flex; gap: 4px; }
.cp .roles button { padding: 5px 9px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line); font-size: 11px; font-weight: 900; color: var(--muted); }
.cp .roles button.sel { background: var(--accent); border-color: var(--accent); color: #1a1400; }
.cp .roles button:disabled { opacity: .5; }
.cmsg { font-size: 11.5px; color: var(--muted); min-height: 14px; line-height: 1.4; }
.cmsg.bad { color: #ff9a9d; }
.roletag { position: absolute; top: calc(10px + var(--sat)); right: calc(56px + var(--sar)); padding: 6px 10px; font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.roletag b { color: var(--accent); }
.ro { color: var(--muted); font-size: 11.5px; font-weight: 700; padding: 8px 2px; line-height: 1.4; } .ro b { color: var(--text); }

/* the sheet's two columns: one after the other on phones, side by side on a tablet in portrait */
.cols, .col { display: contents; }
body.tabp .cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; min-height: 0; flex: 1 1 auto; }
body.tabp .col { display: flex; flex-direction: column; min-height: 0; }
body.tabp .col .scroll { flex: 1 1 auto; }
body.tabp .sheet { max-width: none; left: 0; right: 0; max-height: 52vh; padding-left: max(18px, var(--sal)); padding-right: max(18px, var(--sar)); }
body.tabp .sheet:not(.min) { height: 50vh; }
body.tabp .sheet.min #sheet-body { max-height: 26vh; }
body.tabp .bub { font-size: 14px; } body.tabp .ask { font-size: 13px; padding: 10px; } body.tabp .go { font-size: 17px; padding: 14px; }
body.tabp .uc { padding: 8px 10px; font-size: 13.5px; } body.tabp .irow { padding: 9px 10px; }
body.tabp .score, body.tabp .clock { transform-origin: top left; }
body.tabp .clock { transform: translateX(-50%) scale(1.12); transform-origin: top center; }
body.tabp .score { transform: scale(1.12); }
body.tabp .lines { top: calc(86px + var(--sat)); }
body.tabp .ln { padding: 7px 12px 7px 7px; } body.tabp .ln b { font-size: 13px; }
/* tablet landscape: a left-hand pane with the lines on top and the sheet under them, the map beside it */
body.side .score { top: 10px; left: 10px; }
body.side .lines { top: 66px; left: 10px; right: auto; width: 364px; flex-direction: column; gap: 4px; overflow: visible; }
body.side .ln { width: 100%; }
body.side .sheet { left: 10px; right: auto; bottom: 10px; width: 364px; max-width: none; margin: 0; border-radius: 14px; border: 1px solid #ffffff22; max-height: none; padding-top: 10px; }
body.side .grab { display: none; }
body.side .clock { left: calc(384px + (100vw - 384px) / 2); }
body.side .feed { top: 80px; bottom: auto; left: 394px; flex-direction: column; }
body.side .radio { top: auto; bottom: 14px; right: 14px; }
body.side .tip { left: calc(384px + (100vw - 384px) / 2); }
body.side .bub { font-size: 13.5px; } body.side .ask { padding: 9px 8px; }
body.desk .roletag { right: 330px; }
body.side .roletag { right: 56px; }

/* ------------------------------------------------------------------ more calls: chases, outside help, support, casual */
.notes { display: flex; flex-wrap: wrap; gap: 5px; margin: -2px 0 7px; flex: 0 0 auto; }
.notes span { font-size: 9.5px; font-weight: 900; letter-spacing: .08em; padding: 3px 7px; border-radius: 6px; background: #58a6ff1c; color: #9fd0ff; }
.notes span.bad { background: #ff5a5f22; color: #ffb3b5; }
.chase { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; margin: 0 0 7px; padding: 8px 10px; border-radius: 10px; background: #3f7bff26; border: 1px solid #3f7bff88; text-align: left; flex: 0 0 auto; }
.chase b { font-size: 12.5px; color: #cfe0ff; } .chase span { font-size: 10px; color: var(--muted); font-weight: 700; }
.aid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 4px; margin-bottom: 7px; flex: 0 0 auto; }
.ab { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 4px; border-radius: 9px; background: var(--panel2); border: 1px solid var(--line); }
.ab i { font-style: normal; font-size: 15px; } .ab b { font-size: 9.5px; line-height: 1.1; text-align: center; } .ab small { font-size: 9px; font-weight: 900; color: var(--accent); }
.ab.used { opacity: .55; } .ab.used small { color: var(--accent2); }
.board .lbl .bx { margin-left: 8px; color: var(--muted); font-size: 11px; padding: 0 4px; }
.board.min { width: 48px; bottom: auto; padding: 6px 4px; }
.bmin { display: flex; flex-direction: column; align-items: center; width: 100%; gap: 2px; color: var(--muted); font-size: 11px; padding: 4px 0; }
.bmin b { color: var(--accent); font-size: 15px; } .bmin small { font-size: 8px; font-weight: 900; letter-spacing: .1em; }
body.desk.boardmin .radio { right: 68px; } body.desk.boardmin .roletag { right: 68px; }
.cbtns { display: flex; gap: 4px; justify-content: center; flex-wrap: nowrap; }
.cbtns:empty, .cbtns:not(:has(.autob:not(.hidden))) { display: none; }
.autob { display: block; margin: 4px 0 0; padding: 3px 8px; white-space: nowrap; border-radius: 999px; background: #ffffff10; border: 1px solid #ffffff26; color: var(--muted); font-weight: 900; font-size: 10.5px; letter-spacing: .04em; }
.autob.on { background: #3ee08f26; border-color: var(--accent2); color: #b8ffd9; }
body.casual .clock .calm { display: none; }

/* Casual: spawn a call */
.panel.spawn { max-width: 560px; }
.spg { font-size: 10px; font-weight: 900; letter-spacing: .14em; color: var(--muted); margin: 14px 0 6px; }
.spl { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 5px; }
.spi { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); text-align: left; }
.spi:active { border-color: var(--accent); }
.spi:disabled { opacity: .45; }
.spi .ic { font-size: 19px; width: 26px; text-align: center; flex: 0 0 26px; }
.spi .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.spi b { font-size: 12.5px; }
.spi .nd2 { font-size: 10.5px; color: #cfdcd4; font-weight: 700; }
.spi .x2 { font-size: 9.5px; color: var(--muted); font-weight: 800; }
.spi .ptag { flex: 0 0 auto; }
