/* DialRail — dark control-room UI with neon status colors.
   Each neon has one job: cyan = Patti and main actions, lime = allowed / OK,
   magenta = opt-outs and needs-attention, amber = simulated, red = blocked, violet = unsure. */
:root {
  color-scheme: dark;
  --void: #090B16;
  --surface: #11162A;
  --surface-2: #161c34;
  --surface-3: #1d2440;
  --line: #2a3358;
  --line-2: #1c2340;
  --ink: #F1F5FF;
  --ink-2: #c9cfe3;
  --ink-3: #A6ADC5;
  --cyan: #35E7FF;
  --cyan-ink: #8ef2ff;
  --cyan-tint: rgba(53, 231, 255, .12);
  --magenta: #FF4FD8;
  --magenta-tint: rgba(255, 79, 216, .13);
  --lime: #C9FF55;
  --lime-tint: rgba(201, 255, 85, .12);
  --amber: #ffc53d;
  --amber-tint: rgba(255, 197, 61, .12);
  --red: #ff5470;
  --red-tint: rgba(255, 84, 112, .13);
  --violet: #b39cff;
  --violet-tint: rgba(179, 156, 255, .14);
  /* old names, mapped onto the neon set */
  --signal: var(--cyan); --signal-ink: var(--cyan-ink); --signal-tint: var(--cyan-tint);
  --sim: var(--amber); --sim-tint: var(--amber-tint);
  --ok: var(--lime); --ok-tint: var(--lime-tint);
  --bad: var(--red); --bad-tint: var(--red-tint);
  --unsure: var(--violet); --unsure-tint: var(--violet-tint);
  --paper: var(--void);
  --glow-cyan: 0 0 0 1px rgba(53, 231, 255, .55), 0 0 18px rgba(53, 231, 255, .35);
  --glow-magenta: 0 0 0 1px rgba(255, 79, 216, .55), 0 0 18px rgba(255, 79, 216, .3);
  --radius-s: 8px;
  --radius-m: 14px;
  --font-display: Bahnschrift, "DIN Alternate", "DIN Next", "Segoe UI Variable Display", "Segoe UI", sans-serif;
  --font-body: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --step--1: 0.8125rem;
  --step-0: 0.9375rem;
  --step-1: 1.125rem;
  --step-2: 1.4rem;
  --step-3: 2rem;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body); font-size: var(--step-0); line-height: 1.55; color: var(--ink);
  background: radial-gradient(1200px 600px at 85% -10%, rgba(255, 79, 216, .08), transparent 60%),
              radial-gradient(900px 500px at 20% 110%, rgba(53, 231, 255, .07), transparent 60%), var(--void);
  background-attachment: fixed; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0; letter-spacing: .005em; font-weight: 600; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 .75em; max-width: 72ch; }
a { color: var(--cyan-ink); text-decoration-color: rgba(53, 231, 255, .4); text-underline-offset: 2px; }
a:hover { color: var(--cyan); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(255, 79, 216, .35); }
.muted { color: var(--ink-3); }
.small { font-size: var(--step--1); }
.nowrap { white-space: nowrap; }
.code { font-family: ui-monospace, Consolas, Menlo, monospace; font-size: .85em; background: var(--surface-3); padding: 0 .3em; border-radius: 4px; }
details summary { cursor: pointer; }

/* ---------- Shell ---------- */
.band { background: linear-gradient(90deg, rgba(255, 197, 61, .14), rgba(255, 197, 61, .04)); color: #ffe3a0; border-bottom: 1px solid rgba(255, 197, 61, .3); padding: .4rem 1.25rem; font-size: var(--step--1); display: flex; gap: .7rem; align-items: center; }
.band strong { font-weight: 650; color: var(--amber); }
.band-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); flex: none; }
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 34px); }
.nav { background: rgba(9, 11, 22, .94); border-right: 1px solid var(--line-2); color: var(--ink-2); padding: 1.2rem .8rem; display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .7rem; padding: .2rem .4rem .6rem; color: var(--ink); text-decoration: none; }
.brand-mark { width: 40px; height: 40px; flex: none; border-radius: 9px; box-shadow: 0 0 0 1px rgba(53, 231, 255, .35), 0 0 16px rgba(53, 231, 255, .25); }
.brand-name { display: flex; flex-direction: column; line-height: 1; }
.brand-word { display: block; width: 118px; height: auto; }
.brand-name span { display: block; font-family: var(--font-body); font-weight: 400; font-size: .7rem; color: var(--ink-3); margin-top: .25rem; }
.nav-links { display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: .72rem; color: var(--ink-3); padding: .9rem .7rem .3rem; }
.nav-links a { color: var(--ink-2); text-decoration: none; padding: .5rem .7rem; border-radius: 10px; display: flex; gap: .65rem; align-items: center; border: 1px solid transparent; }
.nav-links a svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.nav-links a .nav-label { flex: 1; }
.nav-links a:hover { background: var(--surface-2); color: #fff; }
.nav-links a[aria-current="page"] { background: var(--cyan-tint); color: #fff; font-weight: 600; border-color: rgba(53, 231, 255, .45); box-shadow: 0 0 16px rgba(53, 231, 255, .18); }
.nav-links a[aria-current="page"] svg { color: var(--cyan); opacity: 1; }
.nav-count { background: var(--magenta); color: #1a0016; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 0 .45rem; box-shadow: 0 0 10px rgba(255, 79, 216, .6); }
.nav-foot { margin-top: auto; border-top: 1px solid var(--line-2); padding: 1rem .3rem 2.4rem; }
.nav-foot label { display: block; font-size: .76rem; color: var(--ink-3); margin-bottom: .3rem; }
.nav-foot select { width: 100%; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-s); padding: .4rem .5rem; }
.nav-foot p { font-size: .72rem; color: var(--ink-3); margin: .45rem 0 0; }
main { padding: 1.9rem 2.2rem 4rem; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-head p { margin: .45rem 0 0; color: var(--ink-2); }
.crumbs { font-size: var(--step--1); margin-bottom: .35rem; }
.crumbs a { color: var(--ink-3); }

/* ---------- Building blocks ---------- */
.panel { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 1.15rem 1.3rem; }
.panel + .panel { margin-top: 1rem; }
.panel h3 { margin-bottom: .55rem; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.grid-main > div > .panel + .panel, .grid-main > div > section + section { margin-top: 1rem; }
.stack > * + * { margin-top: .75rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
hr.soft { border: 0; border-top: 1px solid var(--line-2); margin: 1rem 0; }

.btn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--line); background: var(--surface-3); padding: .5rem .95rem; border-radius: 10px; cursor: pointer; text-decoration: none; color: var(--ink); font-weight: 600; line-height: 1.2; transition: box-shadow .15s, border-color .15s, background .15s; }
.btn:hover { border-color: rgba(53, 231, 255, .6); box-shadow: 0 0 12px rgba(53, 231, 255, .2); }
.btn.primary { background: var(--cyan); border-color: var(--cyan); color: #021419; box-shadow: var(--glow-cyan); }
.btn.primary:hover { background: #6eefff; }
.btn.danger { color: var(--red); border-color: rgba(255, 84, 112, .45); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--cyan-ink); }
.btn.small { padding: .32rem .65rem; font-size: var(--step--1); border-radius: 8px; }
.btn.tiny { padding: .1rem .4rem; font-size: .74rem; min-width: 1.8rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }

.pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 650; padding: .12rem .55rem; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.pill.sim { background: var(--amber-tint); color: var(--amber); border-color: rgba(255, 197, 61, .4); }
.pill.ok { background: var(--lime-tint); color: var(--lime); border-color: rgba(201, 255, 85, .4); }
.pill.bad { background: var(--red-tint); color: #ff8da0; border-color: rgba(255, 84, 112, .45); }
.pill.unsure { background: var(--violet-tint); color: var(--violet); border-color: rgba(179, 156, 255, .4); }
.pill.info { background: var(--cyan-tint); color: var(--cyan-ink); border-color: rgba(53, 231, 255, .4); }
.pill.off { background: var(--surface-3); color: var(--ink-3); }
.pill.optout { background: var(--magenta-tint); color: #ff8be9; border-color: rgba(255, 79, 216, .45); }
a.pill { text-decoration: none; }

.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.stat { padding: .95rem 1.1rem; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: var(--radius-m); position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 2px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.stat:nth-child(2)::before { background: var(--lime); box-shadow: 0 0 12px var(--lime); }
.stat:nth-child(3)::before { background: var(--violet); box-shadow: 0 0 12px var(--violet); }
.stat:nth-child(4)::before { background: var(--magenta); box-shadow: 0 0 12px var(--magenta); }
.stat:nth-child(5)::before { background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.stat b { display: block; font-family: var(--font-display); font-size: 2rem; font-weight: 600; font-variant-numeric: tabular-nums; color: #fff; }
.stat span { font-size: var(--step--1); color: var(--ink-3); }
.stat.warn b { color: var(--magenta); text-shadow: 0 0 14px rgba(255, 79, 216, .5); }

table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-weight: 600; font-size: var(--step--1); color: var(--ink-3); padding: .45rem .6rem; border-bottom: 1px solid var(--line); }
table.list td { padding: .65rem .6rem; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.clickable { cursor: pointer; }
table.list tr.clickable:hover td { background: rgba(53, 231, 255, .05); }

.empty { border: 1px dashed var(--line); border-radius: var(--radius-m); padding: 1.5rem; text-align: center; color: var(--ink-2); background: rgba(17, 22, 42, .6); }
.notice { border-left: 3px solid var(--amber); background: var(--amber-tint); padding: .65rem .9rem; border-radius: 0 var(--radius-s) var(--radius-s) 0; color: #ffe3a0; font-size: var(--step--1); }
.notice.info { border-color: var(--cyan); background: var(--cyan-tint); color: var(--cyan-ink); }
.notice.bad { border-color: var(--red); background: var(--red-tint); color: #ffb3c0; }

/* ---------- Forms ---------- */
.field { margin-bottom: 1rem; }
.field label, .field .label { display: block; font-weight: 600; margin-bottom: .3rem; color: var(--ink); }
.field .help, .help { font-size: var(--step--1); color: var(--ink-3); margin: -.1rem 0 .35rem; max-width: 70ch; }
.field input[type=text], .field input[type=number], .field input[type=time], .field input[type=password], .field input[type=search], .field select, .field textarea, .input, select.input {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-s); padding: .5rem .65rem; background: #0c1020; color: var(--ink);
}
input[type=time]::-webkit-calendar-picker-indicator { filter: invert(.8); }
.field textarea { resize: vertical; min-height: 4.5rem; }
.field input:focus, .field textarea:focus, .field select:focus, .input:focus { border-color: var(--cyan); outline: 0; box-shadow: 0 0 0 3px rgba(53, 231, 255, .18); }
input[type=checkbox], input[type=radio] { accent-color: var(--cyan); }
.check { display: flex; gap: .6rem; align-items: flex-start; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-s); margin-bottom: .45rem; background: rgba(12, 16, 32, .6); }
.check input { margin-top: .25rem; }
.check b { display: block; font-weight: 600; }
.check.locked { background: rgba(29, 36, 64, .5); }
.field label.check { display: flex; font-weight: normal; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); border-radius: 999px; padding: .25rem .8rem; font-size: var(--step--1); cursor: pointer; text-decoration: none; }
.chip:hover { border-color: rgba(53, 231, 255, .6); color: #fff; }
.chip[aria-pressed="true"] { background: var(--cyan); color: #021419; border-color: var(--cyan); font-weight: 650; box-shadow: var(--glow-cyan); }
.chip.chip-optout[aria-pressed="true"] { background: var(--magenta); border-color: var(--magenta); color: #1a0016; box-shadow: var(--glow-magenta); }

/* ---------- Agent editor ---------- */
.editor { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.steps { list-style: none; margin: 0; padding: 0; position: sticky; top: 1rem; counter-reset: step; }
.steps li { counter-increment: step; }
.steps a { display: flex; gap: .6rem; align-items: center; padding: .5rem .55rem; border-radius: var(--radius-s); text-decoration: none; color: var(--ink-2); }
.steps a::before { content: counter(step); width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: .75rem; font-weight: 700; flex: none; }
.steps a[aria-current="step"] { background: var(--surface-2); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(53, 231, 255, .45); }
.steps a[aria-current="step"]::before { background: var(--cyan); color: #021419; border-color: var(--cyan); box-shadow: 0 0 10px rgba(53, 231, 255, .6); }
.steps a.done::before { content: "✓"; border-color: var(--lime); color: var(--lime); }
.savebar { position: sticky; bottom: 0; margin-top: 1rem; background: rgba(9, 11, 22, .9); backdrop-filter: blur(6px); border-top: 1px solid var(--line); padding: .75rem 0; display: flex; gap: .6rem; align-items: center; }
.dirty { color: var(--amber); font-weight: 600; font-size: var(--step--1); }
.readiness li { list-style: none; display: flex; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--line-2); }
.readiness ul { padding: 0; margin: 0; }
.readiness .mark { width: 1.3rem; flex: none; font-weight: 700; text-align: center; }
.readiness .ok .mark { color: var(--lime); }
.readiness .no .mark { color: var(--red); }
.readiness .blocked .mark { color: var(--ink-3); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.tpl { text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 1rem; cursor: pointer; color: var(--ink); }
.tpl:hover { border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.tpl h3 { font-size: 1rem; margin-bottom: .3rem; }
.tpl p { font-size: var(--step--1); color: var(--ink-2); margin: 0; }
.tpl.blank { border-style: dashed; }

/* ---------- Playground: the call timeline ---------- */
.play { display: grid; grid-template-columns: 290px minmax(0, 1fr) 330px; gap: 1rem; align-items: start; }
.call { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: var(--radius-m); display: flex; flex-direction: column; min-height: 560px; }
.call-head { padding: .8rem 1.1rem; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.line-state { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; }
.line-state i { width: .6rem; height: .6rem; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); animation: pulse 1.6s ease-in-out infinite; }
.line-state.closed i { background: var(--ink-3); box-shadow: none; animation: none; }
@keyframes pulse { 50% { opacity: .45; } }
.timeline { flex: 1; padding: 1rem 1.1rem 1rem 2.6rem; position: relative; overflow-y: auto; max-height: calc(100vh - 330px); min-height: 360px; }
.timeline::before { content: ""; position: absolute; left: 1.35rem; top: 0; bottom: 0; width: 2px; background: repeating-linear-gradient(to bottom, var(--line) 0 6px, transparent 6px 10px); }
.turn { position: relative; margin-bottom: 1rem; max-width: 62ch; }
.turn::before { content: ""; position: absolute; left: -1.53rem; top: .45rem; width: .65rem; height: .65rem; border-radius: 50%; background: var(--void); border: 2px solid var(--ink-3); }
.turn.agent::before { border-color: var(--cyan); background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.turn.customer .who, .turn.customer .bubble { margin-left: 2.25rem; }
.turn.customer::before { border-color: var(--magenta); }
.turn.system::before { border-color: var(--amber); background: var(--amber-tint); }
.who { font-size: .76rem; font-weight: 650; color: var(--ink-3); margin-bottom: .15rem; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.bubble { padding: .6rem .85rem; border-radius: 12px; background: rgba(53, 231, 255, .1); border: 1px solid rgba(53, 231, 255, .28); color: #e6fbff; }
.turn.customer .bubble { background: var(--surface-3); border-color: var(--line); color: var(--ink); }
.turn.system .bubble { background: transparent; border: 1px dashed rgba(255, 197, 61, .45); color: #ffe3a0; font-size: var(--step--1); }
.bubble .unheard { color: var(--ink-3); text-decoration: line-through; }
.bubble .cursor { display: inline-block; width: .45rem; height: .9rem; background: var(--cyan); vertical-align: -2px; margin-left: 2px; animation: blink .9s steps(2) infinite; }
@keyframes blink { to { opacity: 0; } }
.receipts { margin-top: .35rem; display: flex; flex-direction: column; gap: .25rem; }
.receipt { display: flex; gap: .45rem; align-items: center; font-size: .78rem; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--radius-s); padding: .25rem .5rem; background: var(--surface); }
.receipt .pill { font-size: .7rem; }
.kb-chip { font-size: .72rem; color: var(--cyan-ink); background: var(--surface); border: 1px solid rgba(53, 231, 255, .35); border-radius: 999px; padding: 0 .45rem; }
.composer { border-top: 1px solid var(--line-2); padding: .75rem; display: flex; flex-direction: column; gap: .5rem; }
.composer form { display: flex; gap: .5rem; }
.composer input { flex: 1; }
.next-line { display: flex; gap: .5rem; align-items: center; font-size: var(--step--1); color: var(--ink-2); background: var(--surface-3); border-radius: var(--radius-s); padding: .45rem .6rem; }
.next-line q { flex: 1; font-style: italic; }
.side h3 { font-size: .98rem; margin-bottom: .5rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .25rem .75rem; font-size: var(--step--1); }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.action-row { border-bottom: 1px solid var(--line-2); padding: .5rem 0; font-size: var(--step--1); }
.action-row:last-child { border-bottom: 0; }
.action-row .err { color: var(--ink-2); margin-top: .2rem; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs button { background: none; border: 0; padding: .5rem .85rem; cursor: pointer; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tabs button[aria-selected="true"] { color: #fff; border-color: var(--cyan); text-shadow: 0 0 10px rgba(53, 231, 255, .5); }

/* ---------- Improvements board ---------- */
.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.flow-col > h3 { display: flex; justify-content: space-between; margin-bottom: .6rem; }
.prop { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-m); padding: .85rem .95rem; margin-bottom: .6rem; }
.prop .diff { display: grid; gap: .35rem; margin: .5rem 0; font-size: var(--step--1); }
.prop .was, .diff-item .was { background: var(--red-tint); padding: .35rem .5rem; border-radius: var(--radius-s); color: #ffc2cc; }
.prop .now, .diff-item .now { background: var(--lime-tint); padding: .35rem .5rem; border-radius: var(--radius-s); color: #dcffb3; }
.loop { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: var(--step--1); color: var(--ink-2); margin-bottom: 1rem; }
.loop span { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: .2rem .7rem; }
.loop .gate { border-color: var(--cyan); font-weight: 600; color: #fff; }

/* ---------- Knowledge ---------- */
.entry { border: 1px solid var(--line); border-radius: var(--radius-s); padding: .75rem; margin-bottom: .6rem; background: var(--surface); }
.entry.needs { border-color: rgba(255, 197, 61, .45); background: rgba(255, 197, 61, .06); }
.entry .entry-grid { display: grid; grid-template-columns: 1fr 160px; gap: .5rem; }
.entry.material { border-left: 3px solid var(--cyan); }
.entry.material.collapsed { padding: .6rem .75rem; }
.entry.editing { border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.kb-status { display: flex; align-items: center; gap: .75rem; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1rem; }
.kb-toolbar { display: flex; gap: .6rem; align-items: center; margin-bottom: .9rem; flex-wrap: wrap; }
.kb-search { max-width: 380px; }
.kb-type { width: auto; }
.kb-more { margin-top: .5rem; }
.kb-history table { margin-top: .75rem; }
.kb-compare, .kb-publish .diff-list { margin-top: .75rem; }
.kb-publish { border-color: var(--cyan); }
.diff-item { padding: .45rem 0; border-bottom: 1px solid var(--line-2); font-size: var(--step--1); }
.diff-item .was, .diff-item .now { margin-top: .3rem; }
.mat-preview { margin: .25rem 0 0; }
.kb-answer { margin: .35rem 0 0; max-width: 72ch; }

/* ---------- Toast ---------- */
#toasts { position: fixed; right: 1.25rem; bottom: 1.25rem; display: flex; flex-direction: column; gap: .5rem; z-index: 50; }
.toast { background: #0c1020; color: var(--ink); border: 1px solid rgba(53, 231, 255, .55); padding: .7rem .95rem; border-radius: 10px; max-width: 380px; font-size: var(--step--1); box-shadow: 0 0 20px rgba(53, 231, 255, .25); }
.toast.bad { border-color: var(--red); box-shadow: 0 0 20px rgba(255, 84, 112, .3); }

/* ---------- Small layout utilities (kept out of inline styles for the CSP) ---------- */
.u1 { padding:0;margin:0;list-style:none; }
.u2 { padding:.35rem 0;border-bottom:1px solid var(--line-2); }
.u3 { max-width:50ch; }
.u4 { margin-bottom:1rem; }
.u5 { margin:1.75rem 0 .75rem; }
.u6 { text-align:right; }
.u7 { margin-top:.75rem; }
.u8 { margin-bottom:.4rem; }
.u9 { margin-bottom:.5rem; }
.u10 { max-width:420px; }
.u11 { margin-top:.5rem; }
.u12 { font-size:1.1rem;margin-bottom:.8rem; }
.u13 { margin-top:.35rem; }
.u14 { margin-top:.4rem; }
.u15 { display:block; }
.u16 { width:100%;justify-content:center; }
.u17 { margin-top:.3rem; }
.u18 { margin:1rem; }
.u19 { margin:.4rem 0 0; }
.u20 { margin:.4rem 0 0;padding-left:1.2rem; }
.u21 { margin-top:1rem; }
.u22 { margin-top:.6rem; }
.u23 { max-height:none; }
.u24 { font-size:.98rem;margin:.45rem 0 .2rem; }
.u25 { margin:.5rem 0 0; }
.u26 { margin-top:1.25rem; }
.u27 { margin:0; }
.u28 { margin:.35rem 0 0; }
.u29 { max-width:70ch; }
.u30 { margin:.3rem 0 0;padding-left:1.1rem; }
.u31 { margin-top: .6rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
label.btn:has(+ .visually-hidden:focus-visible) { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ---------- Settings ---------- */
.setup-steps { padding-left: 1.2rem; margin: 0; }
.setup-steps > li { margin-bottom: 1rem; }
.key-input { max-width: 420px; font-family: ui-monospace, Consolas, Menlo, monospace; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-top: .6rem; }
.voice-play .timeline { min-height: 420px; }
.v-list { margin: .4rem 0 0; padding-left: 1.2rem; }
.v-h { font-size: 1.1rem; margin-bottom: .8rem; }
.v-btn { width: 100%; justify-content: center; margin-top: .6rem; }
.owner-zone { border: 1px solid rgba(255, 79, 216, .45); border-radius: calc(var(--radius-m) + 4px); padding: .75rem; margin-bottom: 1rem; background: rgba(255, 79, 216, .05); }
.owner-zone-head { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; padding: .25rem .5rem .75rem; }
.owner-zone-head h2 { font-size: 1.15rem; }
.owner-zone .panel + .panel { margin-top: .75rem; }

/* ---------- Selling ---------- */
.sell-sub { margin: .2rem 0 .8rem 1.6rem; padding-left: .8rem; border-left: 2px solid var(--line); }
.sell-steps { list-style: none; counter-reset: sell; margin: .6rem 0 0; padding: 0; }
.sell-steps li { counter-increment: sell; display: flex; align-items: center; gap: .8rem; padding: .55rem 0; border-top: 1px solid var(--line-2); color: var(--ink-3); }
.sell-steps li::before { content: counter(sell); flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-size: var(--step--1); font-weight: 600; background: var(--surface-3); color: var(--ink-3); }
.sell-steps li.on { color: var(--ink); }
.sell-steps li.on::before { background: var(--lime); color: #0d1a00; box-shadow: 0 0 10px rgba(201, 255, 85, .6); }
.sell-steps li > div { flex: 1; }
.disc { border: 1px solid var(--line); border-radius: var(--radius-s); padding: .7rem .8rem; margin-bottom: .6rem; background: var(--surface); }
.pay-panel { border-color: rgba(255, 197, 61, .5); background: rgba(255, 197, 61, .06); }
.pay-panel .row { gap: .5rem; }

/* ---------- Agent lifecycle ---------- */
.delete-confirm { border-color: var(--red); background: var(--red-tint); margin-bottom: 1rem; }
.delete-confirm[hidden] { display: none; }
.delete-confirm p { margin: .4rem 0 .8rem; }
.delete-confirm .btn.danger { background: var(--red); color: #1a0007; border-color: var(--red); }
.deleted-agents summary { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.deleted-agents[open] summary { margin-bottom: .6rem; }

/* ---------- Voice picker ---------- */
.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .5rem; margin-top: .6rem; }
.voice-opt { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); cursor: pointer; }
.voice-opt.on { border-color: var(--cyan); background: var(--cyan-tint); box-shadow: 0 0 12px rgba(53, 231, 255, .2); }
.voice-opt .voice-name { flex: 1; display: flex; flex-direction: column; gap: .1rem; }
.voice-opt .voice-name .pill { align-self: flex-start; }
.ambience-opts { gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin: .2rem 0 .4rem 1.9rem; }
.ambience-opts .field { margin: 0; min-width: 12rem; }
.ambience-h { margin: 1.4rem 0 .6rem; }
.ambience-empty p { margin: 0 0 .5rem; }
.price-opt .po-head { margin-bottom: .4rem; gap: .4rem; }
.po-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0 .8rem; }

/* ---------- Documents ---------- */
.analysis { border-color: rgba(53, 231, 255, .5); }
.analysis .an-h { margin: 1.1rem 0 .5rem; font-size: var(--step-0); }
.analysis .an-item > span { display: flex; flex-direction: column; gap: .2rem; }
.analysis .an-text { color: var(--ink-2); white-space: pre-line; }
.analysis .an-notes { display: grid; gap: .4rem; margin: .6rem 0; }
.docfile { border: 1px solid var(--line); border-radius: var(--radius-s); padding: .75rem .9rem; background: var(--surface); display: grid; gap: .5rem; }
table.layers { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
table.layers td { padding: .35rem .5rem .35rem 0; border-top: 1px solid var(--line-2); vertical-align: top; }
table.layers td:first-child { width: 11rem; white-space: nowrap; }
.docflags { margin: 0; padding-left: 1.1rem; display: grid; gap: .2rem; }
.bad-text { color: #ff8da0; }
.ok-text { color: var(--lime); }
.docpage { border-top: 1px solid var(--line-2); padding-top: .6rem; display: grid; gap: .5rem; }
.docpage-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .8rem; align-items: start; }
.docpage-cols img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; }
pre.pagetext { white-space: pre-wrap; font-size: .78rem; max-height: 32rem; overflow: auto; background: #0c1020; padding: .6rem; border-radius: var(--radius-s); margin: 0; }
.script-progress { margin: .2rem 0 .6rem; padding-left: 1.2rem; display: grid; gap: .15rem; }

/* ---------- Dialing rules page ---------- */
.day-pick { gap: .25rem; }
.field input.input-auto, .field select.input-auto, .input.input-auto { width: auto; }
.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.2rem, 1fr)); gap: .35rem .75rem; margin: .5rem 0 1rem; }
.state-pick { display: flex; gap: .3rem; align-items: center; }
.slot-row { gap: .5rem; margin-bottom: .35rem; }
.callout { border-radius: 12px; padding: .85rem 1.05rem; margin-top: 1rem; }
.callout.warn { background: rgba(255, 197, 61, .07); border: 1px solid rgba(255, 197, 61, .55); box-shadow: 0 0 18px rgba(255, 197, 61, .12); }
.callout.ok { background: var(--lime-tint); border: 1px solid rgba(201, 255, 85, .5); }
.callout h3 { margin: 0 0 .35rem; font-size: 1.05rem; color: var(--amber); }
.callout.ok b { color: var(--lime); }
.conflict { border-top: 1px solid rgba(255, 197, 61, .25); padding: .65rem 0; }
.conflict ul { margin: .3rem 0 .4rem 1.1rem; padding: 0; }
.opt-row { display: flex; gap: .75rem; align-items: center; margin: .4rem 0; }
.opt-row .btn { flex: 0 0 auto; min-width: 11rem; justify-content: center; }
.options { border-top: 1px solid rgba(255, 197, 61, .25); padding-top: .65rem; }
.options h4 { margin: 0 0 .3rem; font-size: .98rem; }

/* ---------- State guide ---------- */
.guide { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.guide-tools { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.guide-tools .input { max-width: 260px; }
.usmap { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); grid-template-rows: repeat(8, auto); gap: 5px; }
.tile { aspect-ratio: 1 / 1; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: clamp(.7rem, 1.1vw, 1rem); padding: 0; position: relative; transition: transform .12s, box-shadow .12s; }
.tile small { font-family: var(--font-body); font-weight: 500; font-size: clamp(.5rem, .62vw, .66rem); color: var(--ink-3); }
.tile:hover { transform: translateY(-2px); }
.tile.on { border-color: rgba(201, 255, 85, .55); color: #eaffcf; background: rgba(201, 255, 85, .09); }
.tile.on:hover { box-shadow: 0 0 14px rgba(201, 255, 85, .45); }
.tile.strict { border-color: rgba(53, 231, 255, .6); background: rgba(53, 231, 255, .1); color: #d8fbff; }
.tile.strict:hover { box-shadow: 0 0 14px rgba(53, 231, 255, .5); }
.tile.off { border-color: rgba(255, 79, 216, .6); background: rgba(255, 79, 216, .1); color: #ffd1f6; }
.tile.blocked { border-color: rgba(255, 84, 112, .65); background: rgba(255, 84, 112, .12); color: #ffc2cc; }
.tile.dim { opacity: .22; }
.tile.selected { outline: 2px solid #fff; outline-offset: 2px; box-shadow: 0 0 20px rgba(255, 255, 255, .35); }
.tile .dot { position: absolute; top: 4px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .9rem; font-size: var(--step--1); color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend i { width: .8rem; height: .8rem; border-radius: 3px; border: 1px solid; display: inline-block; }
.legend .l-on { border-color: var(--lime); background: rgba(201, 255, 85, .2); }
.legend .l-strict { border-color: var(--cyan); background: rgba(53, 231, 255, .2); }
.legend .l-off { border-color: var(--magenta); background: rgba(255, 79, 216, .2); }
.legend .l-blocked { border-color: var(--red); background: rgba(255, 84, 112, .2); }
.legend .l-dot { border-radius: 50%; border-color: var(--amber); background: var(--amber); width: .5rem; height: .5rem; }
.sg-detail { position: sticky; top: 1rem; }
.sg-title { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin-bottom: .2rem; }
.sg-title h2 { font-size: 1.7rem; }
.sg-status { margin: .3rem 0 1rem; }
.week { display: grid; gap: 4px; margin: .4rem 0 1rem; }
.week-row { display: grid; grid-template-columns: 2.6rem 1fr 7.4rem; gap: .6rem; align-items: center; font-size: var(--step--1); }
.week-row .bar { position: relative; height: 12px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.week-row .bar i { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: linear-gradient(90deg, var(--cyan), var(--lime)); box-shadow: 0 0 10px rgba(53, 231, 255, .5); }
.week-row .closed { color: var(--ink-3); }
.week-scale { display: grid; grid-template-columns: 2.6rem 1fr 7.4rem; gap: .6rem; font-size: .68rem; color: var(--ink-3); }
.week-scale div { display: flex; justify-content: space-between; }
.facts { display: grid; gap: .6rem; margin: 0 0 1rem; }
.fact { display: grid; grid-template-columns: 1.6rem 1fr; gap: .5rem; align-items: start; font-size: var(--step--1); }
.fact .ico { width: 1.6rem; height: 1.6rem; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.fact .ico.c { background: var(--cyan-tint); color: var(--cyan); }
.fact .ico.l { background: var(--lime-tint); color: var(--lime); }
.fact .ico.m { background: var(--magenta-tint); color: var(--magenta); }
.fact .ico.a { background: var(--amber-tint); color: var(--amber); }
.fact .ico.r { background: var(--red-tint); color: var(--red); }
.fact b { color: #fff; }
.holiday-list { columns: 2; font-size: var(--step--1); color: var(--ink-2); margin: .3rem 0 0; padding-left: 1.1rem; }
.sources { font-size: .76rem; color: var(--ink-3); border-top: 1px solid var(--line-2); padding-top: .6rem; margin-top: .6rem; }
/* tile-map positions (no inline styles: the CSP blocks them) */
.r0 { grid-row: 1; } .r1 { grid-row: 2; } .r2 { grid-row: 3; } .r3 { grid-row: 4; } .r4 { grid-row: 5; } .r5 { grid-row: 6; } .r6 { grid-row: 7; } .r7 { grid-row: 8; }
.c0 { grid-column: 1; } .c1 { grid-column: 2; } .c2 { grid-column: 3; } .c3 { grid-column: 4; } .c4 { grid-column: 5; } .c5 { grid-column: 6; } .c6 { grid-column: 7; } .c7 { grid-column: 8; } .c8 { grid-column: 9; } .c9 { grid-column: 10; } .c10 { grid-column: 11; }
.w-s0{left:0%}.w-s1{left:4.17%}.w-s2{left:8.33%}.w-s3{left:12.5%}.w-s4{left:16.67%}.w-s5{left:20.83%}.w-s6{left:25%}.w-s7{left:29.17%}.w-s8{left:33.33%}.w-s9{left:37.5%}.w-s10{left:41.67%}.w-s11{left:45.83%}.w-s12{left:50%}.w-s13{left:54.17%}.w-s14{left:58.33%}.w-s15{left:62.5%}.w-s16{left:66.67%}.w-s17{left:70.83%}.w-s18{left:75%}.w-s19{left:79.17%}.w-s20{left:83.33%}.w-s21{left:87.5%}.w-s22{left:91.67%}.w-s23{left:95.83%}
.w-e0{right:100%}.w-e1{right:95.83%}.w-e2{right:91.67%}.w-e3{right:87.5%}.w-e4{right:83.33%}.w-e5{right:79.17%}.w-e6{right:75%}.w-e7{right:70.83%}.w-e8{right:66.67%}.w-e9{right:62.5%}.w-e10{right:58.33%}.w-e11{right:54.17%}.w-e12{right:50%}.w-e13{right:45.83%}.w-e14{right:41.67%}.w-e15{right:37.5%}.w-e16{right:33.33%}.w-e17{right:29.17%}.w-e18{right:25%}.w-e19{right:20.83%}.w-e20{right:16.67%}.w-e21{right:12.5%}.w-e22{right:8.33%}.w-e23{right:4.17%}.w-e24{right:0%}

/* ---------- Opt-out list ---------- */
.optout-words { font-style: italic; color: #ffd1f6; }
.optout-head { display: flex; align-items: center; gap: .6rem; }
.optout-head .count { font-family: var(--font-display); font-size: 1.6rem; color: var(--magenta); text-shadow: 0 0 14px rgba(255, 79, 216, .55); }

@media (max-width: 1250px) {
  .play { grid-template-columns: 1fr; }
  .timeline { max-height: none; }
  .guide { grid-template-columns: 1fr; }
  .sg-detail { position: static; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .nav-links { flex-direction: row; flex-wrap: wrap; }
  .nav-group { display: none; }
  .nav-foot { margin-top: 0; border: 0; padding: 0; }
  main { padding: 1.25rem 1rem 3rem; }
  .grid-2, .grid-main, .editor, .flow, .grid-3 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .steps { position: static; display: flex; flex-wrap: wrap; }
  .opt-row { flex-wrap: wrap; }
}
@media (max-width: 760px) { .docpage-cols { grid-template-columns: 1fr; } table.layers td:first-child { white-space: normal; width: auto; } }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

a.stat { text-decoration: none; color: inherit; }
a.stat:hover { border-color: rgba(255, 79, 216, .6); box-shadow: 0 0 16px rgba(255, 79, 216, .2); }

/* ---------- Analytics ---------- */
.an-filters { display: flex; gap: .6rem 1rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.an-hero { display: grid; grid-template-columns: minmax(220px, 1fr) 3fr; gap: 1rem; align-items: stretch; }
.hero-fig { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid rgba(53, 231, 255, .45); border-radius: var(--radius-m); padding: 1.1rem 1.3rem; display: flex; flex-direction: column; justify-content: center; gap: .2rem; box-shadow: 0 0 22px rgba(53, 231, 255, .12); }
.hero-fig b { font-family: var(--font-display); font-size: 3.6rem; line-height: 1; font-weight: 600; color: #fff; text-shadow: 0 0 18px rgba(53, 231, 255, .45); }
.hero-fig .label, .tile2 .label { font-size: var(--step--1); color: var(--ink-2); font-weight: 600; }
.an-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.tile2 { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: var(--radius-m); padding: .8rem 1rem; display: flex; flex-direction: column; gap: .1rem; text-decoration: none; color: inherit; }
.tile2 b { font-family: var(--font-display); font-size: 1.75rem; font-weight: 600; color: #fff; line-height: 1.1; }
.optout-tile { border-color: rgba(255, 79, 216, .45); }
.optout-tile:hover { box-shadow: 0 0 16px rgba(255, 79, 216, .25); }
.hbars, .funnel { display: grid; gap: .45rem; }
.hbar { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr 5.5rem; gap: .6rem; align-items: center; font-size: var(--step--1); border-radius: 6px; padding: 1px 2px; }
.hbar-name { color: var(--ink-2); display: flex; align-items: center; gap: .4rem; }
.hbar-track { height: 14px; background: var(--surface-3); border-radius: 0 4px 4px 0; overflow: hidden; }
.hbar-track i { display: block; height: 100%; width: 0; background: #119cbb; border-radius: 0 4px 4px 0; }
.hbar-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.hbar-val small { color: var(--ink-3); margin-left: .35rem; }
.hbar.hot, .hbar:focus-visible { background: rgba(53, 231, 255, .06); }
.hbar.hot .hbar-track i { background: #35c9e6; }
.mini-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: .6rem; margin: .4rem 0 .9rem; }
.mini-tiles > div { background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: .55rem .75rem; display: flex; flex-direction: column; }
.mini-tiles b { font-family: var(--font-display); font-size: 1.4rem; color: #fff; font-weight: 600; }
.mini-tiles span { font-size: var(--step--1); color: var(--ink-3); }
.mini-tiles .warn b { color: var(--magenta); }
svg.viz { width: 100%; height: auto; display: block; }
svg.viz .ax { fill: var(--ink-3); font-size: 11px; font-family: var(--font-body); font-variant-numeric: tabular-nums; }
svg.viz .ax.strong { fill: var(--ink); font-weight: 600; }
svg.viz rect[data-tip]:focus { outline: none; }
svg.viz rect[data-tip].hot { fill: rgba(255, 255, 255, .05); }
.legend .key { width: .8rem; height: .8rem; border-radius: 3px; display: inline-block; border: 0; }
.key.k-main { background: #119cbb; }
.key.k-other { background: #3a4468; }
.heat { display: grid; gap: 3px; overflow-x: auto; }
.heat-row { display: grid; grid-template-columns: 2.6rem repeat(13, minmax(1.6rem, 1fr)); gap: 3px; align-items: center; }
.heat-head span { font-size: .7rem; color: var(--ink-3); text-align: center; }
.heat-row a { font-family: var(--font-display); font-weight: 600; color: var(--ink); text-decoration: none; font-size: .9rem; }
.hm { height: 24px; border-radius: 4px; display: block; }
.hm.b0 { background: #0c5f73; } .hm.b1 { background: #0f7f99; } .hm.b2 { background: #119cbb; } .hm.b3 { background: #35c9e6; } .hm.b4 { background: #8eefff; }
.hm.na { background: transparent; border: 1px dashed var(--line); }
.hm.hot, .hm:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.heat-legend i.hm { width: 1.4rem; height: .8rem; display: inline-block; }
.meter { display: inline-block; width: 5rem; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; vertical-align: middle; margin-right: .45rem; }
.meter i { display: block; height: 100%; width: 0; background: #119cbb; border-radius: 4px; }
td.num { font-variant-numeric: tabular-nums; }
.viz-tip { position: fixed; z-index: 60; pointer-events: none; background: #0c1020; color: var(--ink); border: 1px solid rgba(53, 231, 255, .5); border-radius: 8px; padding: .35rem .6rem; font-size: var(--step--1); font-weight: 600; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); max-width: 280px; }
@media (max-width: 960px) { .an-hero { grid-template-columns: 1fr; } .an-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hbar { grid-template-columns: 7rem 1fr 4.5rem; } }
.heat-row { grid-template-columns: 2.6rem repeat(4, minmax(4.5rem, 1fr)); }
.heat-head span { line-height: 1.25; padding-bottom: .2rem; }
.heat-head b { color: var(--ink-2); }
.hm { height: 30px; display: grid; place-items: center; font-size: .8rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.hm.b0, .hm.b1, .hm.b2 { color: #fff; }
.hm.b3, .hm.b4 { color: #04161c; }
.hm.na { color: var(--ink-3); font-weight: 400; font-size: .72rem; }
.hm.best { box-shadow: 0 0 0 2px var(--lime) inset; }
.heat-legend i.hm { height: .9rem; }

.chip:has(input:checked) { background: var(--cyan-tint); border-color: var(--cyan); color: #fff; }
.chip input { accent-color: var(--cyan); }

table.activity td.ev { min-width: 13rem; }
table.activity pre.pagetext { max-height: 16rem; margin-top: .35rem; }

.kb-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.kb-cards .panel + .panel { margin-top: 0; }
.kb-card { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: .4rem; }
.kb-card:hover { border-color: rgba(53, 231, 255, .6); box-shadow: 0 0 16px rgba(53, 231, 255, .15); }
.kb-card h3 { margin: 0; }

.loop { gap: .5rem 1.6rem; }
.loop span { position: relative; }
.loop span:not(:last-child)::after { content: "\2192"; position: absolute; right: -1.2rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); }

/* ---------- Play / Stop ---------- */
.btn.run-play:not([disabled]) { border-color: rgba(201, 255, 85, .6); color: var(--lime); }
.btn.run-play:not([disabled]):hover { background: var(--lime-tint); box-shadow: 0 0 14px rgba(201, 255, 85, .3); }
.btn.run-stop { border-color: rgba(255, 84, 112, .6); color: #ff8da0; }
.btn.run-stop:hover { background: var(--red-tint); box-shadow: 0 0 14px rgba(255, 84, 112, .3); }
.run-dot { width: .65rem; height: .65rem; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); flex: none; animation: pulse 1.8s ease-in-out infinite; }
.run-bar { display: flex; align-items: center; gap: .9rem; padding: .8rem 1rem; margin-bottom: 1rem; border: 1px solid rgba(201, 255, 85, .4); background: rgba(201, 255, 85, .05); border-radius: var(--radius-m); }
.run-bar > div { flex: 1; display: flex; flex-direction: column; }
.run-bar .small { color: var(--ink-2); }
.run-bar.stopped { border-color: rgba(255, 84, 112, .6); background: var(--red-tint); }
.run-bar.stopped .run-dot, .nav-run.stopped .run-dot { background: var(--red); box-shadow: 0 0 10px var(--red); animation: none; }
.nav-links a.nav-run { font-size: .78rem; color: var(--ink-2); border: 1px solid rgba(201, 255, 85, .35); border-radius: 999px; padding: .3rem .7rem; margin: 0 0 .4rem; gap: .5rem; }
.nav-links a.nav-run.stopped { border-color: rgba(255, 84, 112, .6); color: #ffb3c0; }

/* ---------- Call queue ---------- */
.q-order { margin: .4rem 0 .6rem; padding-left: 1.3rem; display: grid; gap: .45rem; }
.q-order li { color: var(--ink-2); }
.q-order .pill { margin-right: .35rem; }
.q-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 1.2rem; }
.q-table td:first-child { width: 2.5rem; color: var(--ink-3); }
.up-next { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.1rem; padding: .7rem 1rem; margin-bottom: 1rem; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); text-decoration: none; color: var(--ink); }
.up-next:hover { border-color: rgba(53, 231, 255, .6); }
.up-next > span:last-child { margin-left: auto; }

.rec-player { width: 100%; margin: .2rem 0 .3rem; }
table.timing td:first-child { color: var(--ink-2); }

/* ---------- Sign-in ---------- */
body.signed-out .shell { display: none; }
#auth { min-height: calc(100vh - 3rem); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 1rem 3rem; }
.auth-card { width: min(30rem, 100%); background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 2rem 2rem 1.6rem; box-shadow: 0 0 0 1px rgba(53, 231, 255, .06), 0 24px 60px rgba(0, 0, 0, .45); }
.auth-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.6rem; }
.auth-card h1 { font-size: var(--step-2, 1.6rem); margin: 0 0 .4rem; }
.auth-lede, .auth-small { color: var(--ink-2); margin: 0 0 1.2rem; }
.auth-small { font-size: var(--step--1); margin: 1.2rem 0 0; }
.auth-note { background: rgba(53, 231, 255, .08); border: 1px solid rgba(53, 231, 255, .3); border-radius: var(--radius-s); padding: .55rem .75rem; margin: 0 0 1rem; }
.auth-err { color: var(--red); min-height: 1.2em; margin: .9rem 0 0; font-weight: 600; }
.auth-err:empty { display: none; }
.auth-card .field input { width: 100%; }
.field input[type=email] { width: 100%; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-s); padding: .5rem .6rem; font: inherit; }
.field input[type=email]:focus { border-color: var(--cyan); outline: 0; box-shadow: 0 0 0 3px rgba(53, 231, 255, .18); }
.code-input { font-size: 1.45rem !important; letter-spacing: .3em; font-variant-numeric: tabular-nums; }
.auth-switch { display: block; margin-top: .9rem; }
.auth-steps { padding-left: 1.2rem; margin: 0 0 1.2rem; color: var(--ink-2); }
.auth-steps li { margin-bottom: .7rem; }
.setup-key { display: flex; align-items: center; gap: .6rem; margin-top: .5rem; flex-wrap: wrap; }
.setup-key code, .big-code { font-size: 1.15rem; letter-spacing: .08em; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--radius-s); padding: .35rem .6rem; color: var(--lime, #C9FF55); word-break: break-all; }
.codes { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.codes code { display: block; text-align: center; font-size: 1.05rem; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--radius-s); padding: .35rem; }
.auth-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.auth-check { display: flex; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.linklike { background: none; border: 0; padding: 0; color: var(--cyan-ink, #35E7FF); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 2px; }
/* signed-in user in the nav */
.user-chip { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.user-chip .avatar { width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center; background: rgba(53, 231, 255, .14); border: 1px solid rgba(53, 231, 255, .45); color: var(--ink); font-weight: 700; flex: none; }
.user-chip strong { display: block; font-size: .9rem; }
.user-chip span span { display: block; font-size: .74rem; color: var(--ink-3); }
.user-links { display: flex; gap: .9rem; font-size: .8rem; }
.temp-pw { border-color: rgba(201, 255, 85, .5); margin-bottom: 1rem; }
.row-acts { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.users-page > * + * { margin-top: 1rem; }
ul.plain { list-style: none; padding: 0; margin: .5rem 0 0; }
ul.plain li { padding: .25rem 0; }
ul.plain.small li { font-size: var(--step--1); color: var(--ink-2); }
.chain { margin-bottom: 1rem; }
.chain.ok { border-color: rgba(201, 255, 85, .45); }
.chain.bad { border-color: rgba(255, 84, 112, .6); background: rgba(255, 84, 112, .08); }
.sec-page > * + * { margin-top: 1rem; }
.sec-checks { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; gap: .65rem; }
.sec-checks li { display: flex; gap: .7rem; align-items: flex-start; }
.sec-dot { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex: none; font-size: .9rem; }
.sec-dot.ok { background: rgba(201, 255, 85, .16); color: #C9FF55; border: 1px solid rgba(201, 255, 85, .55); }
.sec-dot.bad { background: rgba(255, 196, 77, .14); color: #FFC44D; border: 1px solid rgba(255, 196, 77, .55); }
.inline-row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.nh-panel { border-top: 1px solid var(--line); padding-top: 1rem; }
.nh-table td { vertical-align: top; }
.nh-swap td { background: rgba(53, 231, 255, .05); }
.nh-swap-form { gap: .7rem; align-items: center; flex-wrap: wrap; }
.nh-settings > * + * { margin-top: .5rem; }
a.nh-alert { display: block; text-decoration: none; color: inherit; margin-bottom: 1rem; }
.nh-choice { margin-top: .5rem; padding: .55rem .7rem; border: 1px solid rgba(255, 84, 112, .45); border-radius: var(--radius-s); background: rgba(255, 84, 112, .06); }
.nh-choice .row { margin-top: .4rem; gap: .4rem; flex-wrap: wrap; }
