/* Incident Room · Norselabs */
@font-face { font-family: "Orbitron"; src: url("../fonts/orbitron-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Orbitron"; src: url("../fonts/orbitron-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Orbitron"; src: url("../fonts/orbitron-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #141210; --bg-deep: #0c0b0a; --panel: #1a1714; --panel-2: #211d19; --term: #0e0c0b;
  --line: rgba(239, 232, 220, 0.08); --line-2: rgba(239, 232, 220, 0.15);
  --cream: #efe8dc; --muted: #9a9286; --dim: #6f685e; --steel: #7eb6d9; --gold: #d4a017; --orange: #e07a2f;
  --ok: #8fca9d; --warn: #d4a017; --bad: #e0533d; --crit: #ff4d3a;
  --display: "Orbitron", system-ui, sans-serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 12px; --ease: cubic-bezier(.2, .7, .1, 1);
  --bar-h: 54px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--cream); }
body { font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--orange); }
code, kbd, pre { font-family: var(--mono); }
code { font-size: .92em; background: rgba(239, 232, 220, .07); padding: 1px 5px; border-radius: 5px; color: #f3e7cf; }
kbd { font-size: .82em; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--cream); background: rgba(255,255,255,.03); }
:focus-visible { outline: 2px solid var(--steel); outline-offset: 2px; border-radius: 6px; }
::selection { background: #5a4a33; color: #fff6e6; }
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 200; background: var(--panel); padding: 8px 12px; border-radius: 8px; }
.skip:focus { top: 12px; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; color: var(--muted); padding: 24px; text-align: center; }
.gold { color: var(--gold); } .dim { color: var(--muted); } .sep { color: var(--dim); margin: 0 .5em; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(239,232,220,.12); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(239,232,220,.22); }
* { scrollbar-color: rgba(239,232,220,.14) transparent; scrollbar-width: thin; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: rgba(239,232,220,.04); color: var(--cream); padding: 10px 16px; border-radius: 10px; font-weight: 550; letter-spacing: .01em; transition: background .2s, border-color .2s, transform .15s var(--ease), box-shadow .2s; }
.btn:hover { background: rgba(239,232,220,.09); border-color: rgba(239,232,220,.28); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #ec8a3d, #d96b22); border-color: #f09a55; color: #1a1006; box-shadow: 0 6px 24px rgba(224,122,47,.25), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-primary:hover { background: linear-gradient(180deg, #f39a50, #e07a2f); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--cream); background: rgba(239,232,220,.06); }
.btn-danger:hover { color: var(--bad); }
.btn-wide { width: 100%; justify-content: center; }
.btn-k { font: 600 11px/1 var(--mono); padding: 3px 5px; border-radius: 5px; background: rgba(0,0,0,.18); opacity: .8; }
.btn-hint { padding: 7px 12px; font-size: 13px; border-color: rgba(212,160,23,.4); color: #f1d27a; background: rgba(212,160,23,.08); }
.btn-hint small { color: var(--muted); font-weight: 500; margin-left: 2px; }
.btn-hint:disabled { opacity: .45; }
.iconbtn { display: inline-flex; align-items: center; gap: 8px; height: 34px; min-width: 34px; justify-content: center; padding: 0 9px; border-radius: 9px; border: 1px solid var(--line-2); background: rgba(239,232,220,.03); color: var(--muted); font-size: 16px; }
.iconbtn:hover { color: var(--cream); border-color: rgba(239,232,220,.3); }
.iconbtn .lbl { font-size: 12.5px; }
.ico-sound { width: 16px; height: 16px; display: inline-block; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9h4l5-4v14l-5-4H4z'/%3E%3Cpath d='M16 9l5 6M21 9l-5 6' stroke='black' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9h4l5-4v14l-5-4H4z'/%3E%3Cpath d='M16 9l5 6M21 9l-5 6' stroke='black' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat; }
.js-sound.on { color: var(--gold); border-color: rgba(212,160,23,.45); }
.js-sound.on .ico-sound { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9h4l5-4v14l-5-4H4z'/%3E%3Cpath d='M16.5 8.5a5 5 0 0 1 0 7M19 6a8.5 8.5 0 0 1 0 12' stroke='black' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9h4l5-4v14l-5-4H4z'/%3E%3Cpath d='M16.5 8.5a5 5 0 0 1 0 7M19 6a8.5 8.5 0 0 1 0 12' stroke='black' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }

.screen { position: fixed; inset: 0; overflow: hidden; }

/* ---------- title ---------- */
#s-title { background: radial-gradient(90% 70% at 50% 40%, #1d1915 0%, #141210 50%, #0b0a09 100%); }
#title-bg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .9; }
.title-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(60% 55% at 50% 48%, rgba(20,18,16,.92) 0%, rgba(20,18,16,.55) 55%, rgba(12,11,10,.2) 100%), linear-gradient(180deg, rgba(12,11,10,.7), transparent 18%, transparent 80%, rgba(12,11,10,.85)); }
.topline { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 20px 28px; z-index: 3; }
.brand img { height: 22px; width: auto; display: block; opacity: .92; }
.title-center { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 80px 24px 90px; }
.kicker { font: 600 11.5px/1 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.blink-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--crit); box-shadow: 0 0 12px var(--crit); animation: blink 1.4s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: .15; } }
.game-title { margin: 26px 0 18px; font: 700 clamp(46px, 9.5vw, 118px)/.92 var(--display); letter-spacing: .08em; text-transform: uppercase; display: flex; flex-direction: column; align-items: center; }
.game-title span:first-child { color: var(--cream); text-shadow: 0 0 40px rgba(239,232,220,.08); }
.game-title span:last-child { color: var(--orange); text-shadow: 0 0 18px rgba(224,122,47,.55), 0 0 60px rgba(224,83,61,.35); animation: neon 6s infinite; padding-left: .08em; }
@keyframes neon { 0%, 18%, 22%, 62%, 64%, 100% { opacity: 1; } 20%, 63% { opacity: .55; } }
.tagline { max-width: 620px; color: #cfc6b8; font-size: clamp(15px, 1.6vw, 17.5px); line-height: 1.6; margin: 0 0 30px; }
.tagline code { color: var(--steel); background: rgba(126,182,217,.1); }
.title-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.title-actions .btn { padding: 13px 20px; font-size: 15px; }
.title-progress { margin-top: 22px; font-size: 13px; color: var(--muted); min-height: 20px; max-width: 560px; }
.title-foot { position: absolute; bottom: 0; left: 0; right: 0; z-index: 2; padding: 18px; text-align: center; font-size: 12px; color: var(--dim); }

/* ---------- screen bars (board / manual) ---------- */
.paper { background: radial-gradient(120% 80% at 50% 0%, #1f1b17 0%, #141210 55%, #0e0d0b 100%); }
.screen-bar { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(12,11,10,.4); }
.screen-title { font: 700 18px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; margin: 0; }
.bar-right { display: flex; align-items: center; gap: 14px; }
.stats { color: var(--muted); font-size: 13px; }
.board-scroll, .debrief-scroll { position: absolute; top: 64px; left: 0; right: 0; bottom: 0; overflow: auto; padding: 28px 22px 60px; }
.debrief-scroll { top: 0; }
.board { max-width: 1180px; margin: 0 auto; display: grid; gap: 34px; }
.track-h { font: 600 13px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--cream); margin: 0 0 16px; display: flex; gap: 12px; align-items: baseline; }
.track-h span { font: 500 12.5px var(--sans); letter-spacing: 0; text-transform: none; color: var(--muted); }
.track-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(206px, 1fr)); gap: 18px; }
.case-card { position: relative; text-align: left; border: 0; border-radius: 6px; padding: 22px 16px 14px; min-height: 172px; display: flex; flex-direction: column; color: #2a241c; background: linear-gradient(180deg, #f1e9da, #e6dcc8); box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 12px 30px rgba(0,0,0,.45), 0 2px 4px rgba(0,0,0,.4); transform: rotate(var(--tilt)); transition: transform .25s var(--ease), box-shadow .25s; }
.case-card::before { content: ""; position: absolute; top: 8px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff9b6b, #b8401f 70%); box-shadow: 0 2px 3px rgba(0,0,0,.5); }
.case-card:not(:disabled):hover { transform: rotate(0deg) translateY(-4px); box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 18px 40px rgba(0,0,0,.55); }
.case-card:focus-visible { outline: 3px solid var(--steel); outline-offset: 3px; }
.cc-top { display: flex; justify-content: space-between; font: 700 10.5px/1 var(--mono); letter-spacing: .12em; color: #7a6c58; }
.cc-kind { letter-spacing: .04em; font-weight: 600; }
.cc-title { font: 700 18px/1.15 var(--display); letter-spacing: .02em; margin: 12px 0 6px; color: #1d1812; }
.cc-topic { font-size: 12.5px; color: #5d5245; line-height: 1.35; }
.cc-foot { margin-top: auto; padding-top: 12px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #6b5f50; border-top: 1px dashed rgba(60,48,34,.25); }
.cc-open { font: 700 11px/1 var(--mono); letter-spacing: .14em; color: #b04a1b; }
.cc-lock { font-size: 11.5px; }
.cc-best { font-family: var(--mono); font-size: 11.5px; }
.stars i { font-style: normal; color: rgba(60,48,34,.25); font-size: 15px; letter-spacing: 1px; }
.stars i.on { color: #c4900b; text-shadow: 0 1px 0 rgba(0,0,0,.15); }
.case-card .stamp { position: absolute; right: 12px; bottom: 36px; font: 700 13px/1 var(--display); letter-spacing: .16em; color: rgba(190,40,30,.8); border: 2.5px solid rgba(190,40,30,.72); padding: 5px 7px 4px; border-radius: 4px; transform: rotate(-8deg); mix-blend-mode: multiply; pointer-events: none; }
.case-card.solved .cc-foot { margin-top: auto; }
.case-card.solved .cc-topic { margin-bottom: 34px; padding-right: 0; }
.case-card.boss .stamp { mix-blend-mode: normal; color: rgba(255,90,70,.85); border-color: rgba(255,90,70,.75); }
.case-card.locked { background: linear-gradient(180deg, #4a443c, #3b362f); color: #9a9286; box-shadow: 0 8px 20px rgba(0,0,0,.4); }
.case-card.locked .cc-title, .case-card.locked .cc-topic, .case-card.locked .cc-top { color: #8b8378; }
.case-card.locked::before { background: #6a6258; }
.case-card.boss { background: linear-gradient(160deg, #2b1512, #170c0a 70%); color: var(--cream); box-shadow: 0 0 0 1px rgba(224,83,61,.5), 0 14px 40px rgba(224,83,61,.18), 0 12px 30px rgba(0,0,0,.6); }
.case-card.boss .cc-title { color: #ffd9a8; font-size: 22px; }
.case-card.boss .cc-topic, .case-card.boss .cc-top, .case-card.boss .cc-foot { color: #d8a68c; border-color: rgba(255,200,160,.18); }
.case-card.boss .cc-open { color: var(--crit); }
.case-card.boss.locked { opacity: .7; }
.track-final .track-cards { grid-template-columns: minmax(206px, 440px); }
.board-extra { display: flex; flex-wrap: wrap; gap: 16px 22px; align-items: center; color: var(--muted); font-size: 13px; padding-top: 6px; border-top: 1px solid var(--line); }
.unlock-all { display: flex; gap: 8px; align-items: center; cursor: pointer; }
input[type="checkbox"] { accent-color: var(--orange); width: 16px; height: 16px; }

/* ---------- field manual ---------- */
.manual-intro { max-width: 1180px; margin: 0 auto 20px; color: var(--muted); }
.manual { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.fm-card { background: linear-gradient(180deg, #1e1a16, #181512); border: 1px solid var(--line-2); border-radius: 12px; padding: 16px 16px 12px; box-shadow: 0 10px 30px rgba(0,0,0,.35); position: relative; overflow: hidden; }
.fm-card::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--steel), var(--gold)); opacity: .8; }
.fm-no { font: 600 10.5px/1 var(--mono); letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.fm-title { font: 700 16px/1.2 var(--display); margin: 8px 0 12px; letter-spacing: .03em; }
.fm-items { margin: 0; display: grid; gap: 2px 0; }
.fm-items dt { margin: 6px 0 0; }
.fm-items dt code { background: none; padding: 0; color: var(--steel); font-size: 12.5px; word-break: break-word; }
.fm-items dd { margin: 0 0 4px; color: #bdb4a6; font-size: 12.5px; }
.fm-card.locked { opacity: .55; border-style: dashed; }
.fm-card.locked::after { background: var(--dim); }
.fm-lock { color: var(--dim); font-size: 13px; }

/* ---------- pager cold open ---------- */
#s-pager { background: radial-gradient(80% 60% at 50% 30%, #241612 0%, #120f0d 55%, #080706 100%); display: grid; place-items: center; }
.pager-wrap { width: min(440px, 92vw); text-align: center; }
.pager-time { font: 200 clamp(64px, 14vw, 104px)/1 var(--sans); letter-spacing: -.02em; color: #f4ede2; font-variant-numeric: tabular-nums; }
.pager-date { color: var(--muted); margin: 6px 0 34px; font-size: 15px; }
.pager-card { text-align: left; background: rgba(36, 31, 27, .82); border: 1px solid rgba(255, 255, 255, .09); border-radius: 20px; padding: 16px 16px 16px; box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(224,83,61,.15), 0 0 60px rgba(224,83,61,.12); backdrop-filter: blur(14px); position: relative; overflow: hidden; }
.pager-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--crit), var(--orange)); }
.pager-card.ring { animation: ring .9s var(--ease); }
@keyframes ring { 0% { transform: translateY(-30px) scale(.96); opacity: 0; } 25% { transform: translateY(0) scale(1); opacity: 1; } 35%, 55%, 75% { transform: translateX(-5px); } 45%, 65% { transform: translateX(5px); } 85%, 100% { transform: none; } }
.pager-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pager-app { font: 700 11px/1 var(--display); letter-spacing: .2em; color: #ffd7c4; background: linear-gradient(180deg, #c8442c, #8f2a1a); padding: 6px 8px; border-radius: 7px; }
.pager-sub { color: var(--muted); font-size: 12.5px; }
.pager-body { display: grid; gap: 6px; margin-bottom: 12px; }
.pg-alert { font: 600 15px/1.35 var(--mono); color: #ffb39e; }
.pg-line { font: 13px/1.45 var(--mono); color: #d8cfc1; }
.pager-case { font-size: 13px; color: var(--cream); margin-bottom: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.pager-case span { font: 600 11px/1 var(--mono); letter-spacing: .12em; color: var(--muted); margin-right: 6px; }
.boss-tag { font: 700 10px/1 var(--display); letter-spacing: .14em; color: #fff; background: var(--crit); padding: 3px 6px; border-radius: 4px; margin-left: 4px; vertical-align: 2px; }
.pager-foot { color: var(--dim); font-size: 13px; margin-top: 22px; }

/* ---------- case screen ---------- */
#s-case { display: flex; flex-direction: column; background: var(--bg); }
.case-bar { height: var(--bar-h); flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 0 14px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #1a1714, #161310); position: relative; z-index: 3; }
.cb-left, .cb-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cb-right { justify-content: flex-end; }
.cb-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.cb-id { font: 600 11px/1 var(--mono); letter-spacing: .14em; color: var(--muted); white-space: nowrap; }
.cb-name { font: 700 15px/1.1 var(--display); letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer { font: 600 24px/1 var(--display); letter-spacing: .08em; font-variant-numeric: tabular-nums; color: var(--cream); padding: 6px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(0,0,0,.25); min-width: 112px; text-align: center; transition: color .3s, border-color .3s, background .3s; }
.timer.low { color: var(--gold); border-color: rgba(212,160,23,.5); }
.timer.over { color: var(--crit); border-color: rgba(255,77,58,.55); background: rgba(255,77,58,.08); animation: pulse-b 1s infinite; }
@keyframes pulse-b { 50% { box-shadow: 0 0 0 4px rgba(255,77,58,.12); } }
#s-case.sandbox .timer { font-size: 14px; letter-spacing: .14em; color: var(--steel); }
#s-case.sandbox .score-pill, #s-case.sandbox #b-hint { display: none; }
.score-pill { display: flex; align-items: baseline; gap: 4px; font: 600 16px/1 var(--mono); color: var(--cream); padding: 8px 12px; border-radius: 10px; background: rgba(239,232,220,.05); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.score-pill small { font-size: 11px; color: var(--muted); }
.score-pill.bump { animation: bump .5s var(--ease); }
@keyframes bump { 30% { transform: scale(1.12); color: var(--orange); } }

.case-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(300px, 380px); gap: 10px; padding: 10px; }
.pane { min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.pane-left, .pane-right { overflow: auto; padding-right: 2px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; flex: none; }
.card-h { margin: 0 0 10px; font: 600 10.5px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.h-dim { color: var(--dim); letter-spacing: .1em; font-family: var(--mono); text-transform: none; font-weight: 400; }

/* ticket */
.ticket { border-top: 3px solid var(--orange); background: linear-gradient(180deg, #221d18, #1a1714 120px); }
.tk-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tk-id { font: 600 11px/1 var(--mono); color: var(--muted); letter-spacing: .08em; }
.tk-sev { font: 700 10px/1 var(--display); letter-spacing: .14em; padding: 4px 7px; border-radius: 5px; background: rgba(212,160,23,.15); color: var(--gold); }
.tk-sev.sev-sev1 { background: rgba(255,77,58,.16); color: #ff8a78; box-shadow: inset 0 0 0 1px rgba(255,77,58,.4); }
.tk-sev.sev-sev2 { background: rgba(224,122,47,.16); color: #f2a167; }
.tk-sev.sev-sev3 { background: rgba(126,182,217,.12); color: var(--steel); }
.tk-title { font: 650 16px/1.3 var(--sans); margin: 10px 0 4px; color: #fff4e4; }
.tk-from { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.tk-from b { color: #cfc6b8; font-weight: 600; }
.tk-body { font-size: 13px; color: #d6cdbf; line-height: 1.55; }
.tk-body p { margin: 0 0 8px; }
.tk-body p:last-child { margin-bottom: 0; }
.tk-hints { margin-top: 12px; padding-top: 10px; border-top: 1px dashed rgba(212,160,23,.3); display: grid; gap: 8px; }
.tk-hints-h { font: 600 10px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.tk-hint { display: grid; grid-template-columns: 20px 1fr; gap: 8px; align-items: start; animation: appear .35s var(--ease); }
.tk-hint b { width: 20px; height: 20px; border-radius: 50%; background: rgba(212,160,23,.18); color: var(--gold); font: 700 11px/20px var(--mono); text-align: center; }
.tk-hint pre { margin: 0; white-space: pre-wrap; font: 12px/1.5 var(--mono); color: #eadfb9; }

/* objectives */
.obj-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.obj-list li { display: grid; grid-template-columns: 18px 1fr auto; gap: 9px; align-items: start; font-size: 13px; line-height: 1.45; color: #ddd4c6; }
.obj-list li.none { display: block; color: var(--muted); }
.ob-box { width: 16px; height: 16px; margin-top: 2px; border-radius: 4px; border: 1.5px solid rgba(239,232,220,.3); position: relative; transition: background .3s, border-color .3s; }
.obj-list li.opt .ob-box { border-style: dashed; border-radius: 50%; }
.obj-list li.done .ob-box { background: var(--ok); border-color: var(--ok); }
.obj-list li.done .ob-box::after { content: ""; position: absolute; left: 4.5px; top: 1px; width: 4px; height: 8px; border: solid #142016; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.obj-list li.done .ob-text { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(143,202,157,.5); }
.ob-tag { font: 600 9.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); border: 1px solid rgba(212,160,23,.35); padding: 3px 5px; border-radius: 4px; margin-top: 2px; }

/* comms */
.comms { flex: 1 1 auto; min-height: 140px; display: flex; flex-direction: column; }
.comms-feed { display: grid; gap: 10px; align-content: start; overflow: auto; max-height: 340px; }
.comms-feed:empty::before { content: "Quiet. For now."; color: var(--dim); font-size: 12.5px; }
.msg { display: grid; grid-template-columns: 28px 1fr; gap: 9px; animation: appear .4s var(--ease); }
.av { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font: 700 10.5px/1 var(--mono); color: #141210; background: var(--c, #9a9286); }
.msg .mh { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; }
.msg .mh b { color: var(--cream); font-weight: 650; }
.msg .mh time { color: var(--dim); font: 11px var(--mono); }
.msg .mt { font-size: 13px; color: #d6cdbf; line-height: 1.5; }
.msg.bot .av { border-radius: 50%; }
.msg.bot .mt { color: #b9c9d4; }

/* ---------- terminal ---------- */
.pane-term { background: var(--term); border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; gap: 0; box-shadow: inset 0 0 80px rgba(0,0,0,.35); position: relative; }
.pane-term::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 28px; background: linear-gradient(180deg, #1b1815, #15120f); border-bottom: 1px solid var(--line); z-index: 1; }
.pane-term::after { content: "oncall@ops-01 — bash"; position: absolute; top: 0; left: 0; right: 0; height: 28px; line-height: 28px; text-align: center; font: 11.5px/28px var(--mono); color: var(--dim); z-index: 1; pointer-events: none; background: radial-gradient(circle at 16px 14px, #e0533d 0 5px, transparent 5.5px), radial-gradient(circle at 34px 14px, #d4a017 0 5px, transparent 5.5px), radial-gradient(circle at 52px 14px, #5f8f6a 0 5px, transparent 5.5px); }
#term { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: 28px; }
.term-screen { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 12px 16px 10px; font: 13.5px/1.55 var(--mono); color: #e6decf; cursor: text; overscroll-behavior: contain; }
.term-out { white-space: pre-wrap; word-break: break-word; }
.tl { min-height: 1.55em; }
.tl.k-out { color: #e6decf; }
.tl.k-err { color: #f08a75; }
.tl.k-stderr { color: #e9a08f; }
.tl.k-dim { color: var(--muted); }
.tl.k-cmd { color: #fff6e8; margin-top: 4px; }
.tl.k-cmd .cmdtext { color: #fff6e8; }
.tl.k-opts { color: var(--steel); }
.tl.k-hint { color: #bcd6e8; border-left: 2px solid var(--steel); padding: 2px 0 2px 10px; margin: 4px 0; background: linear-gradient(90deg, rgba(126,182,217,.08), transparent 60%); }
.tl.k-guard { color: #ffd0a8; border: 1px solid rgba(224,122,47,.45); background: rgba(224,122,47,.08); border-radius: 8px; padding: 6px 10px; margin: 6px 0; }
.tl.k-banner { color: var(--muted); }
.t-bad { color: #ff7a63; font-weight: 600; }
.t-warn { color: #e8bd4a; }
.t-ok { color: #9bd8a9; }
.tl.k-err .t-bad { color: #ff8c77; }
.term-out mark { background: rgba(212,160,23,.32); color: #fff3cf; border-radius: 2px; padding: 0 1px; }
.term-in { display: flex; align-items: baseline; gap: 0; min-height: 1.55em; }
.term-prompt { white-space: pre; flex: none; }
.p-ctx { color: var(--gold); }
.p-user { color: var(--ok); font-weight: 600; }
.p-root { color: var(--crit); font-weight: 600; }
.p-dir { color: var(--steel); font-weight: 600; }
.p-ctr { color: var(--orange); font-weight: 600; }
.p-confirm { color: var(--gold); }
.term-input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: #fff6e8; font: inherit; padding: 0; caret-color: var(--orange); }
.term-input:focus-visible { outline: none; }
.term.busy .term-screen::after { content: ""; display: inline-block; width: 8px; height: 1.1em; vertical-align: -2px; background: var(--orange); opacity: .7; animation: blink 1s steps(2, jump-none) infinite; }
.chips-wrap { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); background: rgba(20,18,16,.85); overflow: hidden; }
.chips-lbl { font: 600 10px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--dim); flex: none; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.chip-btn { flex: none; font: 12px/1 var(--mono); color: #cfe2ef; background: rgba(126,182,217,.08); border: 1px solid rgba(126,182,217,.25); border-radius: 999px; padding: 7px 11px; white-space: nowrap; transition: background .2s, border-color .2s; }
.chip-btn:hover { background: rgba(126,182,217,.16); border-color: rgba(126,182,217,.5); }

/* ---------- right pane: probes / meter / alerts ---------- */
.probes { display: grid; gap: 6px; }
.probe { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 3px 9px; align-items: center; font-size: 12.5px; padding: 6px 8px; border-radius: 8px; background: rgba(239,232,220,.03); }
.probe.none { display: block; color: var(--muted); background: none; padding: 0; }
.pr-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dim); }
.probe.ok .pr-dot { background: var(--ok); box-shadow: 0 0 8px rgba(143,202,157,.6); }
.probe.bad .pr-dot { background: var(--crit); box-shadow: 0 0 8px rgba(255,77,58,.7); animation: blink 1.2s infinite; }
.pr-label { font-family: var(--mono); color: #d8cfc1; overflow-wrap: anywhere; line-height: 1.35; }
.pr-res { grid-column: 2; font: 600 11.5px/1.3 var(--mono); }
.probe.ok .pr-res { color: var(--ok); }
.probe.bad .pr-res { color: #ff8a78; }
.meter-card { border-color: rgba(224,83,61,.35); background: linear-gradient(180deg, #221512, #1a1714); }
.mt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.meter-card .mt { display: flex; flex-direction: column; gap: 4px; padding: 7px 6px; border-radius: 8px; background: rgba(0,0,0,.25); text-align: center; }
.meter-card .mt b { font: 700 16px/1 var(--mono); color: var(--cream); font-variant-numeric: tabular-nums; }
.meter-card .mt span { font-size: 10.5px; color: var(--muted); }
.meter-card .mt.bad b { color: #ff7a63; }
.meter-card .mt.ok b { color: var(--ok); }
.meter-card .mt.warn b { color: var(--gold); }
.meter-card .mt-lost b { color: #ffb08a; }
.mt-spark { display: block; width: 100%; height: 46px; margin-top: 8px; }
.alerts { display: grid; gap: 6px; }
.alert { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "s n a" "d d d"; gap: 3px 8px; align-items: center; padding: 8px 10px; border-radius: 8px; background: rgba(239,232,220,.03); border-left: 3px solid var(--dim); font-size: 12.5px; }
.alert.none { display: block; color: var(--muted); border: 0; background: none; padding: 0; }
.al-state { grid-area: s; font: 700 9.5px/1 var(--display); letter-spacing: .14em; padding: 3px 6px; border-radius: 4px; }
.al-name { grid-area: n; font: 600 12.5px/1.2 var(--mono); color: var(--cream); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-age { grid-area: a; font: 11px var(--mono); color: var(--dim); }
.al-desc { grid-area: d; color: var(--muted); font-size: 12px; line-height: 1.4; }
.alert.firing { border-left-color: var(--gold); background: rgba(212,160,23,.06); }
.alert.firing .al-state { background: rgba(212,160,23,.2); color: var(--gold); }
.alert.firing.sev-critical { border-left-color: var(--crit); background: rgba(255,77,58,.07); }
.alert.firing.sev-critical .al-state { background: var(--crit); color: #fff; animation: blink 1.4s infinite; }
.alert.resolved { border-left-color: var(--ok); opacity: .75; }
.alert.resolved .al-state { background: rgba(143,202,157,.16); color: var(--ok); }
.alert.resolved .al-name { text-decoration: line-through; text-decoration-color: rgba(143,202,157,.5); color: var(--muted); }

/* ---------- live system view ---------- */
.sys-card { padding: 12px; }
.view { display: grid; gap: 14px; font-size: 12px; }
.vsec { display: grid; gap: 8px; }
.vsec-h { font: 600 10.5px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vsec-h b { font-family: var(--mono); letter-spacing: .02em; text-transform: none; color: var(--cream); font-weight: 600; font-size: 12px; }
.vh-ico { color: var(--steel); font-size: 13px; }
.vh-dim { font-family: var(--mono); letter-spacing: 0; text-transform: none; color: var(--dim); font-weight: 400; font-size: 11px; }
.vsub-h { font: 600 9.5px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--dim); margin-top: 4px; }
.vsub-h:has(+ :empty) { display: none; }
[role="button"] { cursor: pointer; }
.nets { display: grid; gap: 8px; }
.net { border: 1px dashed rgba(239,232,220,.16); border-radius: 10px; padding: 8px; }
.net.net-user { border-color: rgba(126,182,217,.35); background: rgba(126,182,217,.03); }
.net-h { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; font-family: var(--mono); font-size: 11px; }
.net-name { color: var(--cream); font-weight: 600; }
.net.net-user .net-name { color: var(--steel); }
.net-meta { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net.net-sys .net-meta { color: #b38b5c; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 6px; }
.tiles:empty::before { content: "no containers"; color: var(--dim); font: 11px var(--mono); }
.tile { background: #221e1a; border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; transition: border-color .3s, background .3s; min-width: 0; }
.tile:hover, .node:hover, .pod:hover, .svc:hover, .vol:hover { border-color: rgba(126,182,217,.55); }
.t-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.t-top b { font: 600 12px/1.2 var(--mono); color: var(--cream); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-img { font: 10.5px/1.3 var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-st { font: 600 10.5px/1.2 var(--mono); }
.t-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.t-chips:empty { display: none; }
.chip { font: 10px/1 var(--mono); padding: 3px 5px; border-radius: 4px; background: rgba(239,232,220,.06); color: #cfc6b8; white-space: nowrap; }
.chip-port { color: #f2c7a3; background: rgba(224,122,47,.12); }
.chip-net { color: #bcd6e8; background: rgba(126,182,217,.12); }
.chip-vol { color: #e5d29a; background: rgba(212,160,23,.12); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--dim); display: inline-block; }
.st-ok .dot { background: var(--ok); box-shadow: 0 0 6px rgba(143,202,157,.6); }
.st-bad .dot { background: var(--crit); box-shadow: 0 0 6px rgba(255,77,58,.8); animation: blink 1.1s infinite; }
.st-warn .dot { background: var(--gold); }
.st-off .dot { background: #5a544c; }
.tile.st-ok .t-st { color: var(--ok); }
.tile.st-bad { border-color: rgba(255,77,58,.4); background: linear-gradient(180deg, rgba(255,77,58,.09), #221e1a); }
.tile.st-bad .t-st { color: #ff8a78; }
.tile.st-warn .t-st { color: var(--gold); }
.tile.st-off { opacity: .6; }
.tile.st-off .t-st { color: var(--muted); }
.vols { display: flex; flex-wrap: wrap; gap: 6px; }
.vols:empty::before { content: "no volumes"; color: var(--dim); font: 11px var(--mono); }
.vol { display: inline-flex; align-items: center; gap: 6px; font: 11px var(--mono); padding: 5px 8px; border-radius: 7px; border: 1px solid var(--line); background: #221e1a; }
.v-ico { color: var(--gold); }
.v-name { color: var(--cream); }
.v-meta { color: var(--dim); }
.vol.vol-dangling { border-style: dashed; border-color: rgba(212,160,23,.45); }
.vol.vol-dangling .v-meta { color: var(--gold); }

.nodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.node { background: #221e1a; border: 1px solid var(--line); border-radius: 9px; padding: 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; align-content: start; min-width: 0; transition: border-color .3s; }
.node.cordoned { background: repeating-linear-gradient(-45deg, rgba(212,160,23,.08) 0 8px, rgba(0,0,0,0) 8px 16px), #221e1a; border-color: rgba(212,160,23,.5); }
.node.notready { border-color: rgba(255,77,58,.5); }
.n-h { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.n-h b { font: 600 12px/1 var(--mono); color: var(--cream); }
.n-ok { font: 600 9.5px/1 var(--mono); color: var(--ok); }
.n-tag { font: 700 8.5px/1 var(--mono); color: #1a1408; background: var(--gold); padding: 3px 4px; border-radius: 3px; letter-spacing: .02em; }
.n-bar { position: relative; height: 14px; border-radius: 4px; background: rgba(239,232,220,.07); overflow: hidden; }
.n-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, rgba(126,182,217,.35), rgba(126,182,217,.55)); transition: width .6s var(--ease); }
.n-bar span { position: relative; font: 9.5px/14px var(--mono); color: #d8e6ef; padding-left: 5px; }
.n-pods { display: flex; flex-wrap: wrap; gap: 4px; min-height: 22px; }
.n-sys { font: 10px var(--mono); color: var(--dim); }
.pod { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-width: 0; overflow: hidden; font: 10.5px/1 var(--mono); padding: 4px 6px; border-radius: 6px; background: rgba(239,232,220,.05); border: 1px solid var(--line); transition: border-color .3s, background .3s, opacity .3s; }
.p-app { color: var(--cream); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 92px; flex: 0 1 auto; min-width: 24px; }
.p-id { flex: none; }
.pod.st-bad .p-id, .pod.st-warn .p-id { display: none; }
.p-id { color: var(--dim); }
.p-st { font-size: 9.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 0 1 auto; }
.p-rs { flex: none; }
.p-rs { color: #ffb08a; font-size: 9.5px; }
.pod.st-ok { border-color: rgba(143,202,157,.25); }
.pod.st-bad { background: rgba(255,77,58,.12); border-color: rgba(255,77,58,.45); }
.pod.st-bad .p-st { color: #ff8a78; }
.pod.st-warn { background: rgba(212,160,23,.08); border-color: rgba(212,160,23,.35); }
.pod.st-warn .p-st { color: var(--gold); }
.pod.st-off { opacity: .45; }
.tray { border: 1px dashed rgba(212,160,23,.5); border-radius: 9px; padding: 8px; background: rgba(212,160,23,.04); }
.tray.empty { display: none; }
.tray-h { font: 600 9.5px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.tray-pods { display: flex; flex-wrap: wrap; gap: 4px; }
.svcs { display: grid; gap: 4px; }
.svc { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font: 11px/1.2 var(--mono); padding: 6px 8px; border-radius: 7px; background: #221e1a; border: 1px solid var(--line); min-width: 0; }
.s-name { color: var(--cream); font-weight: 600; white-space: nowrap; }
.s-sel { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-ep { white-space: nowrap; font-weight: 600; }
.svc.st-ok .s-ep { color: var(--ok); }
.svc.st-bad { border-color: rgba(255,77,58,.4); background: rgba(255,77,58,.07); }
.svc.st-bad .s-ep { color: #ff8a78; }
.svc.hpa .s-name { color: var(--steel); }
.svc.hpa.st-warn { border-color: rgba(212,160,23,.4); }
.svc.hpa.st-warn .s-ep { color: var(--gold); }
.appear { animation: appear .45s var(--ease) both; }
.leave { animation: leave .38s var(--ease) both; pointer-events: none; }
.flash { animation: flash .7s var(--ease); }
@keyframes appear { from { opacity: 0; transform: translateY(4px) scale(.97); } }
@keyframes leave { to { opacity: 0; transform: scale(.9); } }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(255,77,58,.8); } 100% { box-shadow: 0 0 0 8px rgba(255,77,58,0); } }

/* ---------- toasts ---------- */
.toasts { position: absolute; top: calc(var(--bar-h) + 14px); left: 50%; transform: translateX(-50%); width: min(460px, 92vw); display: grid; gap: 8px; z-index: 20; pointer-events: none; }
.toast { pointer-events: auto; background: rgba(33,29,25,.96); border: 1px solid var(--line-2); border-left: 3px solid var(--steel); border-radius: 10px; padding: 10px 14px; font-size: 13px; color: var(--cream); box-shadow: 0 14px 40px rgba(0,0,0,.5); animation: toast-in .35s var(--ease); transition: opacity .45s, transform .45s; }
.toast.t-ok { border-left-color: var(--ok); }
.toast.t-bad, .toast.t-guard { border-left-color: var(--crit); }
.toast.t-msg { border-left-color: var(--gold); }
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }
#s-case.solved-flash .case-grid { animation: solved 1.8s var(--ease); }
@keyframes solved { 0% { filter: none; } 20% { filter: brightness(1.25) saturate(1.2); } 100% { filter: brightness(.6); } }
#s-case.solved-flash::after { content: "RESOLVED"; position: absolute; inset: 0; display: grid; place-items: center; font: 700 clamp(40px, 8vw, 88px)/1 var(--display); letter-spacing: .2em; color: var(--ok); text-shadow: 0 0 40px rgba(143,202,157,.6); pointer-events: none; z-index: 30; animation: resolved-in 1.2s var(--ease) both; }
@keyframes resolved-in { from { opacity: 0; transform: scale(1.3); letter-spacing: .5em; } }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(8,7,6,.72); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal-card { background: #1c1916; border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 30px 90px rgba(0,0,0,.6); }
.editor { width: min(880px, 100%); height: min(640px, 92dvh); display: flex; flex-direction: column; overflow: hidden; }
.ed-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #191613; }
.ed-ico { color: var(--orange); }
.ed-name { font: 600 13px var(--mono); color: var(--cream); }
.ed-kind { font: 11px var(--mono); color: var(--muted); background: rgba(239,232,220,.06); padding: 2px 6px; border-radius: 4px; }
.ed-kind:empty { display: none; }
.ed-keys { margin-left: auto; font-size: 12px; color: var(--muted); }
.ed-body { flex: 1; min-height: 0; display: flex; background: var(--term); overflow: hidden; }
.ed-gutter { margin: 0; padding: 12px 8px 12px 12px; font: 13px/1.6 var(--mono); color: #4f4a43; text-align: right; user-select: none; min-width: 44px; overflow: hidden; border-right: 1px solid var(--line); }
.ed-text { flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: #eee5d6; font: 13px/1.6 var(--mono); padding: 12px 14px; white-space: pre; overflow: auto; tab-size: 2; caret-color: var(--orange); }
.ed-foot { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); }
.ed-tip { margin-right: auto; font-size: 12px; color: var(--muted); }
.menu { width: min(380px, 100%); padding: 22px; display: grid; gap: 10px; }
.menu-h { margin: 0 0 6px; font: 700 18px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; text-align: center; }
.menu-opts { display: flex; justify-content: center; gap: 22px; margin-top: 6px; color: #d6cdbf; font-size: 13.5px; }
.menu-opts label { display: flex; gap: 7px; align-items: center; cursor: pointer; }
.menu-keys { margin: 4px 0 0; color: var(--muted); font-size: 12px; text-align: center; line-height: 1.9; }

/* ---------- debrief ---------- */
.debrief { max-width: 1080px; margin: 0 auto; padding-top: 18px; }
.db-head { position: relative; padding: 26px 0 22px; border-bottom: 1px solid var(--line); margin-bottom: 22px; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "k s" "t s"; align-items: end; gap: 4px 20px; }
.db-kicker { grid-area: k; font: 600 11.5px/1 var(--mono); letter-spacing: .16em; color: var(--muted); }
.db-title { grid-area: t; margin: 0; font: 700 clamp(28px, 4.4vw, 46px)/1.05 var(--display); letter-spacing: .03em; }
.db-score { grid-area: s; text-align: right; }
.db-stars { font-size: 38px; letter-spacing: 4px; line-height: 1; }
.db-stars i { font-style: normal; color: rgba(239,232,220,.12); display: inline-block; }
.db-stars i.on { color: var(--gold); text-shadow: 0 0 22px rgba(212,160,23,.55); animation: star-pop .55s var(--ease) both; animation-delay: var(--d); }
@keyframes star-pop { 0% { transform: scale(0) rotate(-40deg); opacity: 0; } 70% { transform: scale(1.25); opacity: 1; } 100% { transform: none; } }
.db-pts { font: 500 14px var(--mono); color: var(--muted); margin-top: 6px; }
.db-pts b { font: 700 28px var(--display); color: var(--cream); }
.pb { font: 700 10px/1 var(--display); letter-spacing: .12em; color: #1a1406; background: var(--gold); padding: 3px 6px; border-radius: 4px; vertical-align: 4px; text-transform: uppercase; }
.db-stamp { position: absolute; right: 230px; top: 4px; font: 700 26px/1 var(--display); letter-spacing: .18em; color: rgba(224,64,48,.9); border: 4px double rgba(224,64,48,.85); padding: 10px 14px 8px; border-radius: 6px; transform: rotate(-9deg); animation: stamp .55s cubic-bezier(.3, 1.6, .5, 1) .15s both; pointer-events: none; text-shadow: 0 0 1px rgba(224,64,48,.6); }
@keyframes stamp { 0% { transform: rotate(-9deg) scale(2.6); opacity: 0; } 60% { opacity: 1; } 100% { transform: rotate(-9deg) scale(1); opacity: 1; } }
.db-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 26px; align-items: start; }
.db-main { display: grid; gap: 18px; }
.db-sec h3 { margin: 0 0 8px; font: 600 11px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--orange); }
.db-sec p { margin: 0; color: #ddd4c6; font-size: 14.5px; line-height: 1.65; }
.db-cmds { margin: 0; padding: 12px 14px; background: var(--term); border: 1px solid var(--line-2); border-radius: 10px; font: 13px/1.7 var(--mono); color: #eee5d6; white-space: pre-wrap; word-break: break-word; }
.pp { color: var(--ok); user-select: none; }
.db-yours { margin-top: 8px; font-size: 13px; color: var(--muted); }
.db-yours summary { cursor: pointer; }
.db-yours pre { margin: 8px 0 0; padding: 10px 12px; background: rgba(0,0,0,.25); border-radius: 8px; font: 12px/1.6 var(--mono); color: #bdb4a6; white-space: pre-wrap; max-height: 220px; overflow: auto; }
.db-note { border-left: 3px solid var(--steel); padding-left: 14px; }
.db-note h3 { color: var(--steel); }
.db-mistakes h3 { color: var(--crit); }
.mk { padding: 8px 12px; border-radius: 8px; background: rgba(255,77,58,.07); border: 1px solid rgba(255,77,58,.25); margin-bottom: 6px; }
.mk b { font-size: 13.5px; }
.mk-pen { font: 600 12px var(--mono); color: #ff8a78; margin-left: 6px; }
.mk p { font-size: 13px !important; margin-top: 4px !important; color: #cfc6b8 !important; }
.db-side { display: grid; gap: 18px; }
.db-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.db-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); color: #d6cdbf; }
.db-table td:last-child { text-align: right; font-family: var(--mono); white-space: nowrap; }
.db-table tr.tot td { font-weight: 700; color: var(--cream); background: rgba(239,232,220,.04); border-bottom: 0; font-size: 14px; }
.db-card-h { font: 600 10.5px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.db-card-wrap .fm-card { animation: appear .6s var(--ease) .8s both; }
.db-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.db-actions .btn { padding: 12px 18px; }

/* ---------- case tabs (mobile only) ---------- */
.case-tabs { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .case-grid { grid-template-columns: minmax(230px, 260px) minmax(0, 1fr) minmax(280px, 330px); }
  .term-screen { font-size: 13px; }
}
@media (max-width: 900px) {
  :root { --bar-h: 50px; }
  .case-bar { grid-template-columns: auto 1fr auto; padding: 0 8px; gap: 8px; }
  .cb-mid { justify-self: center; }
  .cb-name { display: none; }
  .cb-right .js-sound { display: none; }
  .timer { font-size: 18px; min-width: 0; padding: 6px 10px; }
  .score-pill { font-size: 14px; padding: 7px 9px; }
  .btn-hint { padding: 7px 10px; }
  .btn-hint small { display: none; }
  .case-grid { display: block; position: relative; padding: 8px 8px 0; }
  .pane { position: absolute; inset: 8px 8px 0; display: none; }
  #s-case[data-tab="term"] .pane-term, #s-case[data-tab="brief"] .pane-left, #s-case[data-tab="sys"] .pane-right { display: flex; }
  .pane-left, .pane-right { padding-bottom: 12px; }
  .pane-term { border-radius: 12px 12px 0 0; border-bottom: 0; }
  .term-screen { font-size: 11.5px; padding: 10px 12px; overflow-x: auto; }
  .term-out { width: max-content; min-width: 100%; }
  .tl { max-width: calc(100vw - 42px); }
  .tl.tbl { white-space: pre; max-width: none; word-break: normal; }
  .chips-wrap { padding: 8px; }
  .chips-lbl { display: none; }
  .chip-btn { padding: 9px 12px; font-size: 12.5px; }
  .comms-feed { max-height: none; }
  .case-tabs { display: grid; grid-template-columns: repeat(3, 1fr); flex: none; border-top: 1px solid var(--line-2); background: #171411; padding-bottom: env(safe-area-inset-bottom); }
  .case-tabs button { border: 0; background: none; color: var(--muted); padding: 13px 4px 12px; font: 600 11px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; position: relative; }
  .case-tabs button.on { color: var(--cream); box-shadow: inset 0 2px 0 var(--orange); }
  .case-tabs i { display: none; position: absolute; top: 9px; margin-left: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
  .case-tabs i.on { display: inline-block; }
  .topline { padding: 16px; }
  .title-foot .sep, .title-foot span:last-child { display: none; }
  .screen-bar { padding: 0 10px; }
  .screen-title { font-size: 14px; letter-spacing: .14em; }
  .stats { display: none; }
  .board-scroll { padding: 20px 14px 50px; }
  .track-cards { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .case-card { min-height: 160px; padding: 20px 12px 12px; }
  .cc-title { font-size: 15.5px; }
  .db-head { grid-template-columns: 1fr; grid-template-areas: "k" "t" "s"; }
  .db-score { text-align: left; margin-top: 10px; }
  .db-stamp { right: 0; top: -6px; font-size: 16px; padding: 7px 9px 5px; }
  .db-grid { grid-template-columns: 1fr; }
  .db-actions { justify-content: stretch; }
  .db-actions .btn { flex: 1 1 auto; justify-content: center; }
  .ed-keys { display: none; }
  .editor { height: 88dvh; }
}
@media (max-width: 420px) {
  .cb-id { font-size: 10px; letter-spacing: .08em; }
  .title-actions .btn { padding: 12px 14px; font-size: 14px; }
  .mt-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (hover: none) { .tile:hover, .node:hover, .pod:hover, .svc:hover, .vol:hover { border-color: var(--line); } }

/* ---------- reduced motion ---------- */
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
.reduce-motion .game-title span:last-child { animation: none !important; }
.reduce-motion .blink-dot, .reduce-motion .probe.bad .pr-dot, .reduce-motion .st-bad .dot, .reduce-motion .alert.firing.sev-critical .al-state, .reduce-motion .timer.over { animation: none !important; }
@media (max-width: 600px) {
  .kicker { display: block; text-align: center; font-size: 10px; letter-spacing: .14em; line-height: 1.7; max-width: 300px; }
  .kicker .blink-dot { display: inline-block; margin-right: 6px; vertical-align: 1px; }
}
