/* After-Hours Dispatch · night-console look. Dark ink, beacon amber, siren red, calm teal. */
:root {
  color-scheme: dark;
  --bg: #080c14;
  --bg2: #0c121d;
  --panel: #111826;
  --panel2: #161f30;
  --line: #1f2a3e;
  --line2: #2b3953;
  --text: #e8edf6;
  --soft: #c4cddd;
  --muted: #8995ac;
  --dim: #5d6982;
  --amber: #ffb547;
  --amber-d: #3a2a10;
  --red: #ff5e57;
  --red-d: #3a1414;
  --teal: #45d3c0;
  --teal-d: #0f2f2c;
  --violet: #b296ff;
  --violet-d: #251d40;
  --blue: #74a9ff;
  --blue-d: #14233f;
  --radius: 14px;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { color: var(--text); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small, small { font-size: 12px; }
h2, h3 { margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 18px 0 8px; }

.ahd { min-height: 100vh; background:
  radial-gradient(900px 420px at 85% -120px, rgba(255, 181, 71, .10), transparent 70%),
  radial-gradient(700px 380px at -10% -80px, rgba(116, 169, 255, .08), transparent 70%), var(--bg); }

/* ---------- header ---------- */
.top { border-bottom: 1px solid var(--line); background: rgba(8, 12, 20, .72); backdrop-filter: blur(10px); }
.top-row, .top-row2 { max-width: 1680px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 16px; justify-content: space-between; }
.top-row2 { padding-top: 0; padding-bottom: 0; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .mark { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(145deg, #1a2234, #0d1320); border: 1px solid var(--line2); display: grid; place-items: center; color: var(--amber); flex: none; box-shadow: 0 0 24px rgba(255, 181, 71, .18); }
.brand .mark svg { width: 20px; height: 20px; }
.brand b { display: block; font-size: 17px; letter-spacing: -.02em; }
.brand small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small span { color: var(--soft); }
.top-right { display: flex; align-items: center; gap: 14px; flex: none; }
.clock { display: flex; align-items: baseline; gap: 8px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg2); }
.clock .mono { font-size: 14px; font-weight: 600; }
.clock small { color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; align-self: center; }
.dot.live { background: var(--teal); box-shadow: 0 0 0 0 rgba(69, 211, 192, .6); animation: beat 2s infinite; }
.dot.amber { background: var(--amber); }
@keyframes beat { 0% { box-shadow: 0 0 0 0 rgba(69, 211, 192, .5); } 70% { box-shadow: 0 0 0 8px rgba(69, 211, 192, 0); } 100% { box-shadow: 0 0 0 0 rgba(69, 211, 192, 0); } }

.switch { display: inline-flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px; border-radius: 999px; border: 1px solid var(--line2); background: var(--panel); font-weight: 600; font-size: 13px; }
.switch .knob { width: 38px; height: 22px; border-radius: 999px; background: var(--teal-d); border: 1px solid rgba(69, 211, 192, .5); position: relative; transition: background .2s; }
.switch .knob::after { content: ''; position: absolute; top: 2px; left: 18px; width: 16px; height: 16px; border-radius: 50%; background: var(--teal); transition: left .2s, background .2s; }
.switch.off .knob { background: var(--amber-d); border-color: rgba(255, 181, 71, .5); }
.switch.off .knob::after { left: 2px; background: var(--amber); }
.switch.off { color: var(--amber); }

.trades { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); }
.trades button { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 9px; border: 0; background: none; color: var(--muted); font-weight: 600; }
.trades button .ti svg { width: 15px; height: 15px; }
.trades button.on { background: var(--panel2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line2); }
.trades button.on .ti { color: var(--amber); }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { position: relative; padding: 16px 14px; border: 0; background: none; color: var(--muted); font-weight: 500; white-space: nowrap; }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--amber); }
.tabs .count { margin-left: 6px; font: 600 11px var(--mono); color: var(--dim); }

/* ---------- layout ---------- */
.wrap { max-width: 1680px; margin: 0 auto; padding: 18px 24px 8px; }
.card { background: linear-gradient(180deg, var(--panel), #0f1522); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-h h2 .muted { font-weight: 400; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line2); color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.tag.red { color: var(--red); border-color: rgba(255, 94, 87, .45); background: var(--red-d); }
.tag.amber { color: var(--amber); border-color: rgba(255, 181, 71, .4); background: var(--amber-d); }
.tag.teal { color: var(--teal); border-color: rgba(69, 211, 192, .4); background: var(--teal-d); }
.rec { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.link { border: 0; background: none; color: var(--amber); padding: 0; font-weight: 600; font-size: 13px; }
.link:hover { text-decoration: underline; }

.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.stat b { font-size: 20px; }
.stat small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.console { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.12fr); gap: 14px; align-items: start; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 14px; align-items: start; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); font-weight: 600; font-size: 13px; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: #1d2840; border-color: #3a4b6b; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--amber); border-color: var(--amber); color: #1d1406; }
.btn.primary:hover { background: #ffc46d; }
.btn.danger { color: var(--red); border-color: rgba(255, 94, 87, .45); background: var(--red-d); }
.btn.ghost { background: none; }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.btn.wide { width: 100%; padding: 12px; font-size: 14px; }
.btn:disabled { opacity: .38; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------- call card ---------- */
.ringer { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; background: var(--bg2); border: 1px dashed var(--line2); margin-bottom: 12px; }
.ringer b { display: block; font: 600 15px var(--mono); }
.ringer small { color: var(--muted); }
.ring-ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--red-d); color: var(--red); flex: none; position: relative; }
.ring-ic svg { width: 20px; height: 20px; animation: wobble 1.4s infinite; }
.ring-ic::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(255, 94, 87, .5); animation: ripple 1.4s infinite; }
@keyframes ripple { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
@keyframes wobble { 0%, 60%, 100% { transform: rotate(0); } 10%, 30%, 50% { transform: rotate(-12deg); } 20%, 40% { transform: rotate(12deg); } }
.ringer.big { border-style: solid; border-color: rgba(255, 94, 87, .35); }
.call.idle p.muted { margin: 0 0 14px; }
.queue { margin: 14px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.queue small { color: var(--muted); margin-right: 2px; }
.chip { border: 1px solid var(--line2); background: var(--bg2); color: var(--soft); border-radius: 999px; padding: 5px 11px; font-size: 12px; }
.chip:hover { border-color: var(--amber); color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }

.caller { display: flex; align-items: center; gap: 11px; min-width: 0; }
.caller > div { min-width: 0; }
.caller small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--panel2); border: 1px solid var(--line2); font: 600 12px var(--mono); color: var(--soft); flex: none; }
.avatar.amber { background: var(--amber-d); border-color: rgba(255, 181, 71, .45); color: var(--amber); }

.transcript { list-style: none; margin: 0; padding: 4px 4px 4px 0; display: flex; flex-direction: column; gap: 10px; max-height: 540px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.ln { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 10px; align-items: start; }
.ln .who { font-size: 11.5px; font-weight: 600; color: var(--muted); padding-top: 9px; display: flex; flex-direction: column; }
.ln .who i { font-style: normal; font-weight: 400; color: var(--dim); font-size: 10.5px; font-family: var(--mono); }
.ln p { margin: 0; padding: 9px 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); color: var(--soft); line-height: 1.5; }
.ln.ai p { background: linear-gradient(180deg, #14203a, #111a2e); border-color: #24365a; color: #dbe6ff; }
.ln.ai .who { color: var(--blue); }
.ln.new p { animation: rise .35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ln mark { background: none; color: var(--amber); border-bottom: 1.5px solid rgba(255, 181, 71, .55); padding: 0 1px; transition: background .15s; }
.ln mark.lit { background: rgba(255, 181, 71, .22); border-radius: 3px; }
.dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: dot 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
.hint { margin: 12px 0 0; color: var(--dim); }

/* ---------- triage ---------- */
.rules-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rules-mini li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 4px 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); }
.rules-mini li .then { grid-column: 2; font-size: 12px; }
.rules-mini.guard { margin-top: 10px; }
.rules-mini.guard li { grid-template-columns: 30px minmax(0, 1fr) 16px; color: var(--muted); font-size: 13px; }
.rid { font-size: 11px; font-weight: 600; color: var(--amber); padding-top: 2px; }
.then.red { color: var(--red); }
.then.teal { color: var(--teal); }
.then.blue { color: var(--blue); }
.lock { color: var(--dim); display: inline-flex; align-items: center; gap: 4px; }
.lock svg { width: 13px; height: 13px; }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.fact { padding: 9px 11px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); animation: rise .3s ease-out; min-width: 0; }
.fact dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.fact dd { margin: 2px 0 0; font-weight: 600; }
.facts.compact { margin-top: 16px; }
.facts.compact .fact { animation: none; padding: 7px 10px; }
.facts.compact dd { font-weight: 500; font-size: 13px; color: var(--soft); }
.scan { height: 3px; border-radius: 3px; background: var(--bg2); overflow: hidden; margin: 16px 0 10px; }
.scan span { display: block; width: 30%; height: 100%; background: linear-gradient(90deg, transparent, var(--amber), transparent); animation: scan 1.6s infinite linear; }
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

.decision { padding: 16px 18px; border-radius: 12px; border: 1px solid; display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; }
.decision b { font-size: 24px; letter-spacing: -.02em; line-height: 1.15; }
.decision small { font-size: 13px; opacity: .85; }
.decision::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: currentColor; opacity: .08; }
.d-em { color: var(--red); background: var(--red-d); border-color: rgba(255, 94, 87, .45); }
.d-tm { color: var(--teal); background: var(--teal-d); border-color: rgba(69, 211, 192, .45); }
.d-sf { color: var(--violet); background: var(--violet-d); border-color: rgba(178, 150, 255, .45); }
.d-hu { color: var(--amber); background: var(--amber-d); border-color: rgba(255, 181, 71, .45); }
.d-mo { color: var(--blue); background: var(--blue-d); border-color: rgba(116, 169, 255, .45); }
.d-an, .d-fb { color: var(--soft); background: var(--panel2); border-color: var(--line2); }

.conf { margin-top: 14px; }
.conf-top { display: flex; justify-content: space-between; align-items: baseline; }
.conf-top small { color: var(--muted); }
.conf-top b { font-size: 15px; }
.bar { position: relative; height: 8px; border-radius: 8px; background: var(--bg2); border: 1px solid var(--line); margin: 6px 0; }
.bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; background: linear-gradient(90deg, #2c3e60, var(--amber)); }
.bar i { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--text); border-radius: 2px; }

.reasons, .checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.reasons li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 10px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); cursor: default; transition: border-color .15s, background .15s; }
.reasons li.lit, .reasons li:hover { border-color: rgba(255, 181, 71, .5); background: #191a1c; }
.reasons q { display: block; color: var(--text); font-weight: 500; }
.reasons q::before { content: '“'; color: var(--amber); }
.reasons q::after { content: '”'; color: var(--amber); }
.reasons small { color: var(--muted); }
.checks li { display: grid; grid-template-columns: 18px 30px minmax(0, 1fr); gap: 8px; align-items: start; font-size: 13px; color: var(--soft); }
.checks .ok { color: var(--teal); padding-top: 2px; }
.checks .ok svg { width: 15px; height: 15px; }

/* ---------- action / dispatch ---------- */
.oncall { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.oncall li { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); }
.oncall li > div { flex: 1; min-width: 0; }
.oncall b { display: block; }
.oncall small { color: var(--muted); }
.pill { font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--amber); border: 1px solid rgba(255, 181, 71, .4); padding: 1px 6px; border-radius: 999px; margin-left: 4px; vertical-align: 2px; }
.status { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.status.free { color: var(--teal); background: var(--teal-d); }
.status.busy { color: var(--amber); background: var(--amber-d); }
.status.rest { color: var(--dim); background: var(--panel2); }
.ladder { margin-top: 16px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .015) 0 8px, transparent 8px 16px), var(--bg2); }
.ladder small { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 600; }
.ladder ol { margin: 8px 0 0; padding-left: 20px; color: var(--soft); display: flex; flex-direction: column; gap: 4px; }
.ladder b { color: var(--text); }

.tech { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.tech > div:nth-child(2) { flex: 1; min-width: 0; }
.tech b { display: block; }
.tech small { color: var(--muted); display: block; }
.eta { text-align: right; flex: none; }
.eta b { font-size: 20px; color: var(--amber); }
.why { margin: 10px 0; color: var(--soft); font-size: 13px; }
.why small { color: var(--muted); }
.swap { margin: 8px 0 0; font-size: 13px; }

.map { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); margin-top: 4px; }
.map .mapbg { fill: #0b1220; }
.map .dotp { fill: #1a2438; }
.map .st { stroke: #1d2940; stroke-width: 5; stroke-linecap: round; }
.map .sl { fill: #4b5873; font: 500 6.5px var(--mono); letter-spacing: .04em; }
.map .river { fill: none; stroke: #10294a; stroke-width: 13; stroke-linecap: round; }
.map .rl { fill: #36618f; font: italic 600 7px var(--sans); }
.map .park { fill: #0f2a22; stroke: #18392f; }
.map .pl { fill: #3d7a66; font: 600 6.5px var(--sans); }
.map .route { fill: none; stroke: var(--amber); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 700; stroke-dashoffset: 700; animation: draw 1.6s ease-out forwards; }
.map .route-glow { fill: none; stroke: var(--amber); stroke-width: 7; opacity: .35; stroke-linecap: round; stroke-linejoin: round; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.map .pin.start circle { fill: #251a08; stroke: var(--amber); stroke-width: 1.5; }
.map .pin.start g { fill: var(--amber); }
.map .pin.end circle { fill: var(--red); }
.map .pin.end .pulse { fill: none; stroke: var(--red); stroke-width: 1.5; animation: mp 1.8s infinite; transform-origin: center; transform-box: fill-box; }
.map .pin.end .core { fill: #fff; }
@keyframes mp { from { opacity: .9; transform: scale(.6); } to { opacity: 0; transform: scale(1.3); } }
.map .mover { fill: #fff; stroke: var(--amber); stroke-width: 2; }
.map .ml { fill: var(--soft); font: 600 8px var(--sans); paint-order: stroke; stroke: #0b1220; stroke-width: 3px; }
.map .ml.end { fill: #ffd2cf; }

.materials { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.materials li { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 10px; align-items: start; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.materials li:last-child { border-bottom: 0; }
.materials small { display: block; color: var(--muted); }
.mt { font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .05em; text-align: center; padding: 3px 0; border-radius: 6px; margin-top: 1px; }
.mt.van { color: var(--teal); background: var(--teal-d); }
.mt.shop { color: var(--amber); background: var(--amber-d); }

.sms { margin-top: 14px; border-radius: 14px; border: 1px solid var(--line2); background: #0d1424; overflow: hidden; }
.sms-h { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sms-h > span:first-child { color: var(--blue); }
.sms-h svg { width: 14px; height: 14px; }
.sms-h small { color: var(--muted); flex: 1; }
.sim { font: 600 10.5px var(--mono); padding: 2px 8px; border-radius: 999px; color: var(--muted); background: var(--panel2); }
.sim.sent { color: var(--teal); background: var(--teal-d); }
.sim.held { color: var(--amber); background: var(--amber-d); }
.sms p { margin: 12px; padding: 10px 13px; border-radius: 14px 14px 14px 4px; background: #1e6bff; color: #fff; line-height: 1.45; max-width: 92%; font-size: 13.5px; }

.slot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.slot > div { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); }
.slot small { color: var(--muted); display: block; }
.slot b { font-size: 15px; }
.slot.dim { opacity: .65; }
.cb { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid rgba(255, 181, 71, .35); background: var(--amber-d); margin: 10px 0; }
.cb b { display: block; }
.cb small { color: var(--muted); }

.note { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg2); color: var(--soft); margin: 8px 0; }
.note.amber { border-color: rgba(255, 181, 71, .35); background: var(--amber-d); color: #ffe2b3; }
.note.teal { border-color: rgba(69, 211, 192, .35); background: var(--teal-d); color: #c2f3ec; }

.action-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.signer { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.signer > small { color: var(--muted); }
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); flex-wrap: wrap; }
.seg button { border: 0; background: none; color: var(--muted); padding: 5px 10px; border-radius: 7px; font-size: 12px; font-weight: 600; }
.seg button.on { background: var(--panel2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line2); }
.overrides { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 8px; }
.hold-pick { padding: 12px; border-radius: 12px; border: 1px solid rgba(255, 181, 71, .35); background: var(--amber-d); }
.hold-pick small { color: #ffe2b3; }
.stamp { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(69, 211, 192, .4); background: var(--teal-d); }
.stamp > span { color: var(--teal); flex: none; }
.stamp > span svg { width: 20px; height: 20px; }
.stamp > div { flex: 1; min-width: 0; }
.stamp b { display: block; color: #d3f7f1; }
.stamp small { color: #8fc9c0; }
.stamp.held { border-color: rgba(255, 181, 71, .4); background: var(--amber-d); }
.stamp.held > span { color: var(--amber); }
.stamp.held b { color: #ffe2b3; }
.stamp.held small { color: #c9a777; }
.stamp.callback { border-color: rgba(116, 169, 255, .4); background: var(--blue-d); }
.stamp.callback > span { color: var(--blue); }
.stamp.callback b { color: #d7e6ff; }
.stamp.callback small { color: #93acd6; }

/* ---------- paused ribbon ---------- */
.ribbon { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 14px; border-radius: 12px; border: 1px solid rgba(255, 181, 71, .45); background: repeating-linear-gradient(135deg, rgba(255, 181, 71, .06) 0 10px, transparent 10px 20px), var(--amber-d); color: #ffe2b3; }
.ribbon .ri { color: var(--amber); flex: none; }
.ribbon .ri svg { width: 18px; height: 18px; }
.ribbon > div { flex: 1; min-width: 0; }

/* ---------- log & audit ---------- */
.nlog, .audit { list-style: none; margin: 0; padding: 0; }
.nlog li { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.nlog li:last-child { border-bottom: 0; }
.nlog .t, .audit .t { color: var(--muted); font-size: 12px; padding-top: 2px; }
.nl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 2px; color: var(--soft); }
.dchip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid; }
.audit li { display: grid; grid-template-columns: 70px 70px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: start; }
.audit li:last-child { border-bottom: 0; }
.audit li > div b { display: block; font-size: 13px; }
.audit li > div span { color: var(--soft); font-size: 13px; }
.actor { font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .05em; padding: 3px 0; border-radius: 6px; text-align: center; margin-top: 1px; }
.actor.agent { color: var(--blue); background: var(--blue-d); }
.actor.human { color: var(--teal); background: var(--teal-d); }
.actor.override { color: var(--amber); background: var(--amber-d); }
.actor.rule { color: var(--violet); background: var(--violet-d); }
.actor.system { color: var(--muted); background: var(--panel2); }

/* ---------- roster ---------- */
.roster { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
.person { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--bg2); display: flex; flex-direction: column; gap: 10px; }
.person.primary { border-color: rgba(255, 181, 71, .45); box-shadow: 0 0 0 1px rgba(255, 181, 71, .12), 0 10px 30px -18px rgba(255, 181, 71, .5); }
.person.resting { opacity: .7; }
.p-h { display: flex; align-items: center; gap: 10px; }
.p-h > div { flex: 1; min-width: 0; }
.p-h b { display: block; }
.p-h small { color: var(--muted); }
.person dl { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.person dl div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.person dt { color: var(--muted); }
.person dd { margin: 0; text-align: right; color: var(--soft); }
.person .btn { align-self: flex-start; }
.ladder.wide ol { flex-direction: row; flex-wrap: wrap; gap: 6px 26px; }

/* ---------- rules ---------- */
.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rule { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); }
.rule.off { opacity: .55; }
.rule .rt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rule .then { font-size: 12.5px; }
.toggle { width: 40px; height: 24px; border-radius: 999px; border: 1px solid var(--line2); background: var(--panel2); position: relative; padding: 0; }
.toggle span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--dim); transition: left .2s, background .2s; }
.toggle.on { background: var(--teal-d); border-color: rgba(69, 211, 192, .5); }
.toggle.on span { left: 19px; background: var(--teal); }
.slider { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.slider b { color: var(--amber); }
.slider input { width: 100%; accent-color: var(--amber); }
.offswitch { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; border-radius: 12px; border: 1px solid rgba(255, 94, 87, .3); background: linear-gradient(90deg, rgba(255, 94, 87, .07), transparent); }
.offswitch b { display: block; }
.offswitch small { color: var(--muted); }

/* ---------- footer ---------- */
.foot { max-width: 1680px; margin: 0 auto; padding: 14px 24px 34px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--dim); font-size: 12px; }
.foot p { margin: 0; max-width: 820px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .console { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .console .action { grid-column: 1 / -1; }
  .ac-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .ac-b > h3:first-child { margin-top: 0; }
  .roster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .two { grid-template-columns: minmax(0, 1fr); }
  .stats { display: flex; overflow-x: auto; scrollbar-width: none; margin-left: -2px; margin-right: -2px; padding: 0 2px 2px; }
  .stats::-webkit-scrollbar { display: none; }
  .stats .stat { flex: 0 0 auto; min-width: 132px; }
  .top-row2 { flex-direction: column; align-items: stretch; gap: 0; padding-top: 2px; }
  .trades { align-self: flex-start; }
  .tabs { margin: 4px -8px 0; }
}
@media (max-width: 720px) {
  .console { grid-template-columns: minmax(0, 1fr); }
  .ac-grid { display: block; }
  .ac-b > h3:first-child { margin-top: 18px; }
  .transcript { max-height: 420px; }
  .stat { flex-direction: column; gap: 0; padding: 8px 12px; }
  .stat b { font-size: 18px; }
}
@media (max-width: 560px) {
  .top-row { padding: 12px 16px; gap: 10px; }
  .top-row2 { padding: 0 16px; }
  .wrap { padding: 14px 16px 6px; }
  .foot { padding: 12px 16px 28px; flex-direction: column; align-items: flex-start; }
  .brand .mark { width: 34px; height: 34px; }
  .brand b { font-size: 15px; }
  .brand small { white-space: normal; line-height: 1.3; }
  .stat small { white-space: normal; line-height: 1.25; }
  .clock small { display: none; }
  .clock { padding: 6px 10px; }
  .top-right { gap: 8px; }
  .switch { padding: 4px; }
  .switch .sw-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .trades { width: 100%; }
  .trades button { flex: 1; justify-content: center; padding: 8px 6px; }
  .tabs button { padding: 13px 10px; }
  .card { padding: 14px; }
  .ln { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .ln .who { flex-direction: row; gap: 8px; padding-top: 0; }
  .overrides { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .overrides .btn:first-child { grid-column: 1 / -1; }
  .roster { grid-template-columns: minmax(0, 1fr); }
  .audit li { grid-template-columns: 62px minmax(0, 1fr); }
  .audit li .actor { grid-column: 2; justify-self: start; padding: 2px 8px; }
  .audit li > div { grid-column: 2; }
  .nlog li { grid-template-columns: 62px minmax(0, 1fr); }
  .offswitch { flex-direction: column; align-items: stretch; }
  .decision b { font-size: 21px; }
  .facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ribbon { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .map .route { stroke-dashoffset: 0; }
}

/* ---------- filters, empty notes, toast ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 10px; }
.filters .chip { display: inline-flex; align-items: center; gap: 6px; }
.filters .chip i { font: 600 10.5px var(--mono); font-style: normal; color: var(--dim); }
.chip.on { background: var(--amber-d); border-color: rgba(255, 181, 71, .55); color: var(--amber); }
.chip.on i { color: var(--amber); }
.empty-note { margin: 6px 0 4px; padding: 16px; border: 1px dashed var(--line2); border-radius: 12px; color: var(--muted); text-align: center; }
button.stat { font: inherit; color: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
button.stat:hover { border-color: var(--line2); background: var(--panel); }
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 60; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 12px; background: #f4f7fc; color: #0b111c; font: 500 13.5px/1.4 var(--sans); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .6); transition: opacity .2s, transform .2s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast b { font-weight: 700; }
html.lab-capture .toast { display: none; }

/* ---------- touch: 44px targets ---------- */
@media (pointer: coarse), (max-width: 640px) {
  .btn, .btn.sm, .chip, .seg button, .trades button, .switch, .toggle-hit, .link { min-height: 44px; }
  .link { display: inline-flex; align-items: center; }
  .tabs button { min-height: 46px; }
  .toggle { position: relative; }
  .toggle::before { content: ''; position: absolute; inset: -10px -6px; }
  .reasons li { min-height: 44px; }
  .seg button { padding: 5px 12px; }
}

@media (max-width: 420px) {
  .brand { gap: 9px; }
  .brand b { font-size: 14.5px; white-space: nowrap; }
  .clock .dot { display: none; }
  .clock .mono { font-size: 13px; }
  .top-right { gap: 6px; }
}

/* phones: fade the right edge of the scrolling nav so it reads as scrollable */
@media (max-width: 560px) { .tabs { -webkit-mask-image: linear-gradient(90deg, #000 86%, transparent); mask-image: linear-gradient(90deg, #000 86%, transparent); padding-right: 28px; } }
