/* Earshot components. Uses only tokens from tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; cursor: default;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.25; }
h1 { font-family: var(--font-brand); font-weight: 700; }
h1 { font-size: 22px; letter-spacing: -0.01em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0; }
a { color: var(--blue); cursor: pointer; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select, summary, [role='button'], a, label[for] { cursor: pointer; }
input[type='text'], input[type='search'], input[type='email'], input[type='password'], input[type='number'], input[type='date'], textarea { cursor: text; }
button[disabled], select[disabled], input[disabled] { cursor: not-allowed; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); font-weight: 600; }
.row { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.stack > * + * { margin-top: var(--s3); }
.hidden { display: none !important; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: var(--s3); top: -60px; background: var(--surface); color: var(--text); padding: var(--s2) var(--s3); border: 2px solid var(--focus); border-radius: var(--radius); z-index: 100; }
.skip:focus { top: var(--s3); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: var(--s4) var(--s3); position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--s4);
}
.brand { display: flex; align-items: center; gap: var(--s2); padding: var(--s1) var(--s2); text-decoration: none; color: var(--text); }
.brand svg { flex: none; }
.brand-mark { flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.wordmark { font-family: var(--font-brand); font-weight: 800; font-size: 24px; line-height: 1; letter-spacing: -0.01em; color: var(--navy); }
:root[data-theme="dark"] .wordmark { color: var(--text); }
.brand-by { font-size: 11px; font-weight: 500; color: var(--text-3); letter-spacing: 0.02em; margin-top: 3px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  padding: 8px 12px; border-radius: var(--radius); color: var(--text-2); text-decoration: none; font-weight: 500;
  border-left: 3px solid transparent;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current='page'] { background: var(--accent-bg); color: var(--text); border-left-color: var(--accent); font-weight: 600; }
.nav .count { font-family: var(--font-mono); font-size: 12px; background: var(--accent); color: var(--accent-ink); border-radius: var(--radius-pill); padding: 0 7px; min-width: 20px; text-align: center; }
.side-foot { margin-top: auto; font-size: 12px; color: var(--text-3); padding: 0 var(--s2); }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.top {
  display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s5);
  border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 20; min-height: 56px;
}
.top .grow { flex: 1; }
.top .who { display: flex; flex-direction: column; line-height: 1.25; text-align: right; }
.top .who b { font-weight: 600; font-size: 13px; word-break: break-all; }
.top .who span { font-size: 12px; color: var(--text-2); }
.btn.menu-btn { display: none; }
.top .brand-mobile { display: none; }
#banners { padding: 0 var(--s5); }
#banners:empty { display: none; }
#banners .banner:first-child { margin-top: var(--s3); }
main#app { padding: var(--s5); width: 100%; max-width: calc(var(--content-max) + 2 * var(--s5)); outline: none; min-height: 60vh; }

@media (max-width: 899px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 60; left: 0; top: 0; width: 260px; transform: translateX(-102%); transition: transform 0.18s ease-out; box-shadow: var(--shadow); }
  .side.is-open { transform: none; }
  .btn.menu-btn { display: inline-flex; }
  .top .brand-mobile { display: flex; }
  .top, #banners, main#app { padding-left: var(--s4); padding-right: var(--s4); }
  main#app { padding-top: var(--s4); }
}
.scrim { position: fixed; inset: 0; background: var(--overlay); z-index: 50; }

/* ---------- buttons and fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 6px 14px; border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-weight: 500; text-decoration: none; line-height: 1.2; white-space: nowrap;
  transition: background 0.15s ease-out, border-color 0.15s ease-out;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-quiet:hover { background: var(--surface-2); color: var(--text); }
.btn-good { border-color: var(--green); color: var(--green); }
.btn-good:hover { background: var(--green-bg); }
.btn-bad { border-color: var(--red); color: var(--red); }
.btn-bad:hover { background: var(--red-bg); }
.btn[aria-pressed='true'] { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.is-busy { opacity: 0.7; pointer-events: none; }
.btn.is-busy::before { content: ''; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
.btn[disabled] { opacity: 0.55; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { min-width: 36px; padding: 6px; }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .field > .label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); font-weight: 600; }
.input, .select, .textarea {
  width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
.select { padding-right: 8px; }
.textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.help { font-size: 12px; color: var(--text-2); }
.err-text { font-size: 13px; color: var(--red); font-weight: 500; }

/* ---------- panels ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.page-head .sub { color: var(--text-2); margin-top: 4px; max-width: 70ch; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4); }
.panel + .panel { margin-top: var(--s4); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; min-height: 22px;
  border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; line-height: 1.3;
  background: var(--surface-2); color: var(--text-2); border: 1px solid transparent; white-space: nowrap; max-width: 100%;
}
.chip .chip-txt { overflow: hidden; text-overflow: ellipsis; }
.chip::before { font-size: 9px; line-height: 1; }
.chip-red { background: var(--red-bg); color: var(--red); }
.chip-red::before { content: '\25B2'; }
.chip-orange { background: var(--orange-bg); color: var(--orange); }
.chip-orange::before { content: '\25C6'; }
.chip-green { background: var(--green-bg); color: var(--green); }
.chip-green::before { content: '\2713'; font-size: 11px; }
.chip-blue { background: var(--blue-bg); color: var(--blue); }
.chip-grey::before { content: '\25CB'; }
.chip-ai { background: transparent; border: 1px dashed currentColor; }
.chip-tag { background: var(--blue-bg); color: var(--blue); text-transform: uppercase; letter-spacing: 0.04em; }
.chip-tag::before { content: none; }
.chip-note { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 2px; opacity: 0.95; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.grade { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; min-height: 22px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; font-family: var(--font-mono); white-space: nowrap; }
.grade .letter { font-family: var(--font-body); }
.grade-green { background: var(--green-bg); color: var(--green); }
.grade-orange { background: var(--orange-bg); color: var(--orange); }
.grade-red { background: var(--red-bg); color: var(--red); }
.grade-none { background: var(--surface-2); color: var(--text-2); font-family: var(--font-body); font-weight: 500; }

/* ---------- states ---------- */
.state { text-align: center; padding: var(--s6) var(--s4); color: var(--text-2); border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.state h3 { color: var(--text); margin-bottom: 4px; font-size: 15px; }
.state .btn { margin-top: var(--s3); }
.state-error { border-style: solid; border-color: var(--red); background: var(--red-bg); color: var(--text); }
.state-error h3 { color: var(--red); }
.skel { background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }
.banner { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); margin-bottom: var(--s3); }
.banner b { font-weight: 600; }
.banner-error { background: var(--red-bg); border-color: var(--red); }
.banner-warn { background: var(--orange-bg); border-color: var(--orange); }
.banner-info { background: var(--blue-bg); border-color: var(--blue); }
.banner .grow { flex: 1; }
.toasts { position: fixed; right: var(--s4); bottom: var(--s4); display: flex; flex-direction: column; gap: var(--s2); z-index: 90; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: var(--s3) var(--s4); border-radius: var(--radius); box-shadow: var(--shadow); font-weight: 500; animation: pop 0.18s ease-out; }
.toast-error { background: var(--red); color: #fff; }
:root[data-theme='dark'] .toast-error { color: #1a0b0a; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

dialog.confirm { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: var(--s5); width: min(440px, calc(100vw - 32px)); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25); }
dialog.confirm::backdrop { background: var(--overlay); }
dialog.confirm h2 { margin-bottom: var(--s2); }
dialog.confirm .actions { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s5); flex-wrap: wrap; }

/* ---------- tables ---------- */
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; min-width: 880px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); font-weight: 600; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr.link-row:hover { background: var(--accent-bg); cursor: pointer; }
table.t td.num, table.t th.num { text-align: right; }
table.t a.cell-link { color: var(--text); font-weight: 600; text-decoration: none; }
table.t a.cell-link:hover { text-decoration: underline; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s3); }

/* ---------- tabs ---------- */
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 7px 14px; font-weight: 500; min-height: 36px; color: var(--text-2); border-right: 1px solid var(--border); }
.seg button:last-child { border-right: 0; }
.seg button[aria-selected='true'] { background: var(--text); color: var(--bg); font-weight: 600; }
.seg button:not([aria-selected='true']):hover { background: var(--surface-2); color: var(--text); }
.seg button:focus-visible { outline-offset: -3px; }

/* ---------- progress ---------- */
.bar { position: relative; height: 12px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.bar > .planned { position: absolute; left: 0; top: 0; bottom: 0; background: var(--border-strong); transition: width 0.2s ease-out; }
.bar > .done { position: absolute; left: 0; top: 0; bottom: 0; background: var(--green); transition: width 0.2s ease-out; }
.bar-score { height: 8px; }
.bar-score > .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--radius-pill); }
.fill-green { background: var(--green); }
.fill-orange { background: var(--orange); }
.fill-red { background: var(--red); }

/* ---------- today ---------- */
.today-grid { display: grid; grid-template-columns: 1fr; gap: var(--s4); align-items: start; }
.today-tabs { margin-bottom: var(--s4); }
.market-panel { display: none; }
.market-panel.is-active { display: block; }
@media (min-width: 1360px) {
  .today-grid { grid-template-columns: 1fr 1fr; }
  .market-panel { display: block; }
  .today-tabs { display: none; }
}
.market-panel .mp-head { padding-bottom: var(--s3); border-bottom: 1px solid var(--border); margin-bottom: var(--s3); }
.mp-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); margin: var(--s3) 0; }
.stat { border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: var(--radius); padding: var(--s2) var(--s3); background: var(--surface); }
.stat .n { font-family: var(--font-mono); font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.stat-green { border-left-color: var(--green); }
.stat-orange { border-left-color: var(--orange); }
.stat-red { border-left-color: var(--red); }
.budget-line { display: flex; justify-content: space-between; gap: var(--s3); font-size: 13px; margin-bottom: 6px; flex-wrap: wrap; }
.call-rows > li + li { margin-top: var(--s2); }
.call-row { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s3); background: var(--surface); display: grid; gap: var(--s2); }
.call-row.is-listened { background: var(--surface-2); color: var(--text-2); }
.call-row.is-listened .agent { color: var(--text-2); }
.call-row .top-line { display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.call-row .agent { font-weight: 600; font-size: 15px; color: var(--text); }
.call-row .meta { color: var(--text-2); font-size: 13px; display: flex; gap: var(--s3); flex-wrap: wrap; }
.call-row .reasons { display: flex; flex-direction: column; gap: 4px; }
.call-row .reasons .chip { white-space: normal; border-radius: var(--radius); align-items: flex-start; padding-top: 3px; padding-bottom: 3px; }
.call-row .actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.call-row .listen-form { display: grid; gap: var(--s2); padding-top: var(--s2); border-top: 1px dashed var(--border-strong); }
.who-when { font-size: 13px; }

/* ---------- calls ---------- */
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3); align-items: end; }
.active-filters { margin-top: var(--s3); }
.state-cell { color: var(--text-2); font-size: 13px; }
.dim { color: var(--text-3); }

/* ---------- call page ---------- */
.back { display: inline-flex; margin-bottom: var(--s3); font-size: 13px; }
.call-head { display: flex; gap: var(--s5); align-items: center; flex-wrap: wrap; }
.call-head .info { flex: 1; min-width: 260px; }
.call-head .meta { display: flex; gap: var(--s2) var(--s4); flex-wrap: wrap; color: var(--text-2); margin-top: 6px; }
.ring { position: relative; width: 84px; height: 84px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .track { stroke: var(--surface-2); }
.ring .val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.ring .val b { font-family: var(--font-mono); font-size: 22px; }
.ring .val span { font-size: 12px; font-weight: 700; }
.call-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--s4); margin-top: var(--s4); align-items: start; }
@media (max-width: 1099px) { .call-grid { grid-template-columns: minmax(0, 1fr); } }
.transcript { max-height: none; }
.line { display: grid; grid-template-columns: 52px 66px minmax(0, 1fr); gap: var(--s2); padding: 6px 8px; border-radius: var(--radius); border-left: 4px solid transparent; align-items: baseline; }
.line:hover { background: var(--surface-2); }
.line .ts { font-family: var(--font-mono); font-size: 12px; border: 0; background: transparent; color: var(--text-2); text-align: left; padding: 2px 0; min-height: 24px; }
.line .ts:hover { color: var(--accent); text-decoration: underline; }
.line .side-lbl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.line.is-agent .side-lbl { color: var(--accent); }
.line.is-caller .side-lbl { color: var(--blue); }
.line .txt { overflow-wrap: anywhere; cursor: pointer; }
.line.is-flag-red { background: var(--red-bg); border-left-color: var(--red); }
.line.is-flag-orange { background: var(--orange-bg); border-left-color: var(--orange); }
.line .ticks { grid-column: 3; display: flex; gap: 6px; flex-wrap: wrap; }
.line.is-playing { outline: 2px solid var(--accent); outline-offset: -2px; }
.line.is-hit { animation: hit 2.4s ease-out; }
@keyframes hit { 0%, 55% { box-shadow: 0 0 0 3px var(--focus); } 100% { box-shadow: 0 0 0 3px transparent; } }
.timeline { position: relative; height: 44px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; cursor: pointer; }
.timeline .seg-a, .timeline .seg-b { position: absolute; height: 12px; border-radius: 2px; }
.timeline .seg-a { top: 8px; background: var(--accent); }
.timeline .seg-b { top: 24px; background: var(--blue); }
.timeline .tick { position: absolute; top: 0; width: 3px; height: 100%; background: var(--red); opacity: 0.85; }
.timeline .tick.orange { background: var(--orange); }
.timeline .head { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); pointer-events: none; left: 0; }
.legend { display: flex; gap: var(--s4); font-size: 12px; color: var(--text-2); margin-top: 6px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
.side-col > .panel + .panel { margin-top: var(--s3); }
.part + .part { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--border); }
.part .ph { display: flex; justify-content: space-between; gap: var(--s2); align-items: baseline; }
.part .pnote { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.jump { border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--radius-pill); padding: 0 8px; min-height: 24px; font-size: 12px; font-family: var(--font-mono); }
.jump:hover { background: var(--accent-bg); }
.flag-item { border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius); padding: var(--s3); background: var(--surface); }
.flag-item + .flag-item { margin-top: var(--s2); }
.flag-item.sev-red { border-left-color: var(--red); }
.flag-item.sev-orange { border-left-color: var(--orange); }
.flag-item.is-ai { border-left-style: dashed; }
.flag-item.is-dismissed { opacity: 0.7; background: var(--surface-2); }
.flag-item .plain { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.flag-item .detail { font-size: 13px; margin-top: 4px; overflow-wrap: anywhere; }
.flag-item .rv { font-size: 13px; margin-top: 6px; }
.flag-actions { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s2); }
.disagree-form { display: grid; gap: var(--s2); margin-top: var(--s2); padding: var(--s3); border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--bg); }
.notes li { padding: var(--s2) 0; border-bottom: 1px solid var(--border); }
.notes li:last-child { border-bottom: 0; }
.audio-bar { display: flex; align-items: center; gap: var(--s2) var(--s3); flex-wrap: wrap; }
.audio-bar .scrub { flex-basis: 100%; order: 5; }
@media (max-width: 899px) { .audio-bar .btn { padding-left: 10px; padding-right: 10px; } }
.audio-bar audio { display: none; }
.audio-bar .play-btn { min-width: 104px; min-height: 44px; font-size: 16px; }
.audio-bar .scrub { flex: 1 1 100%; min-width: 180px; accent-color: var(--accent); height: 28px; cursor: pointer; }
.audio-bar .clock { min-width: 96px; text-align: center; }
.audio-bar .audio-note { flex-basis: 100%; font-size: 13px; order: 6; }
.q-item + .q-item { margin-top: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--border); }

/* ---------- review ---------- */
.rv-item { display: grid; gap: var(--s2); padding: var(--s3) var(--s4); border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.rv-item + .rv-item { margin-top: var(--s2); }
.rv-item.sev-red { border-left-color: var(--red); }
.rv-item.sev-orange { border-left-color: var(--orange); }
.rv-item.is-ai { border-left-style: dashed; }
.rv-item.is-leaving { opacity: 0.35; transition: opacity 0.2s ease-out; }

/* ---------- login ---------- */
body.login { display: grid; place-items: center; min-height: 100vh; padding: var(--s4); }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s6); }
.login-card .brand { padding: 0; margin-bottom: var(--s5); }
.login-card h1 { font-size: 20px; margin-bottom: var(--s1); }
.login-card form > * + * { margin-top: var(--s3); }
.login-card .btn { width: 100%; }
.qr { display: block; width: 200px; height: 200px; margin: var(--s3) auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; image-rendering: pixelated; }
.keybox { font-family: var(--font-mono); word-break: break-all; padding: var(--s2) var(--s3); background: var(--surface-2); border-radius: var(--radius); font-size: 13px; }
.login-top { position: fixed; top: var(--s3); right: var(--s4); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
@media print { .side, .top, .audio-bar, .toasts { display: none !important; } .shell { display: block; } }

/* ---------- small additions ---------- */
.is-loading { opacity: 0.55; transition: opacity 0.15s ease-out; pointer-events: none; }
.line { scroll-margin-top: 90px; scroll-margin-bottom: 120px; }

.today-grid > .panel { margin-top: 0; }

/* ---------- part B: shared bits ---------- */
.page-tools { display: flex; align-items: flex-end; gap: var(--s3) var(--s4); flex-wrap: wrap; margin-bottom: var(--s4); }
.page-tools .field { min-width: 180px; }
.note-box { border: 1px solid var(--border-strong); border-left: 4px solid var(--blue); border-radius: var(--radius); background: var(--surface); padding: var(--s3) var(--s4); }
.note-box.warn { border-left-color: var(--orange); }
.note-box.bad { border-left-color: var(--red); }
.note-box.good { border-left-color: var(--green); }
.note-box h3 { margin-bottom: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s3) var(--s4); align-items: start; }
.form-grid .wide { grid-column: 1 / -1; }
.dot { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.dot::before { font-size: 11px; line-height: 1; }
.dot-green { color: var(--green); }
.dot-green::before { content: '\25CF'; }
.dot-orange { color: var(--orange); }
.dot-orange::before { content: '\25C6'; }
.dot-red { color: var(--red); }
.dot-red::before { content: '\25B2'; }
.dot-grey { color: var(--text-2); }
.dot-grey::before { content: '\25CB'; }
.meter { position: relative; height: 10px; border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; min-width: 80px; }
.meter > i { position: absolute; left: 0; top: 0; bottom: 0; display: block; }
.meter > i.g { background: var(--green); }
.meter > i.o { background: var(--orange); }
.meter > i.r { background: var(--red); }
.meter > i.n { background: var(--text-2); }
.cell-stack { display: grid; gap: 4px; }
.sub-note { font-size: 13px; color: var(--text-2); }
.err-box { margin-top: var(--s2); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px var(--s4); font-size: 13px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.section-title { margin: var(--s5) 0 var(--s3); display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.section-title:first-child { margin-top: 0; }
.section-title .sub-note { font-weight: 400; }
.secret-box { border: 2px solid var(--accent); border-radius: var(--radius); background: var(--accent-bg); padding: var(--s4); margin: var(--s3) 0; }
.secret-box .pw { font-family: var(--font-mono); font-size: 18px; letter-spacing: 0.04em; padding: var(--s2) var(--s3); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); display: inline-block; overflow-wrap: anywhere; user-select: all; }
.preview-box { border: 2px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.preview-box + .preview-box { margin-top: var(--s3); }
.preview-box .pv-head { padding: var(--s2) var(--s3); background: var(--surface-2); border-bottom: 1px solid var(--border-strong); font-size: 13px; }
.preview-box iframe { display: block; width: 100%; height: 420px; border: 0; background: #fff; }

/* ---------- reports ---------- */
.report .r-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s3); }
.report .r-head h2 { font-size: 20px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: var(--s3); margin: var(--s3) 0 var(--s4); }
.tile { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--border); border-left: 5px solid var(--border-strong); border-radius: var(--radius); padding: var(--s3); background: var(--surface); color: var(--text); text-decoration: none; }
a.tile:hover { background: var(--accent-bg); }
.tile .tl { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); font-weight: 600; }
.tile .tn { font-family: var(--font-mono); font-size: 28px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile .tn small { font-size: 16px; }
.tile .tn.is-empty { font-size: 14px; font-family: var(--font-body); color: var(--text-2); padding: 8px 0; }
.tile .td { font-size: 13px; font-weight: 600; }
.tile .tgo { font-size: 12px; color: var(--blue); text-decoration: underline; }
.tile.t-green { border-left-color: var(--green); }
.tile.t-green .td { color: var(--green); }
.tile.t-orange { border-left-color: var(--orange); }
.tile.t-orange .td { color: var(--orange); }
.tile.t-red { border-left-color: var(--red); }
.tile .td.flat { color: var(--text-2); }
.volume { display: flex; gap: var(--s2) var(--s4); flex-wrap: wrap; font-size: 13px; padding: var(--s2) var(--s3); background: var(--surface-2); border-radius: var(--radius); }
.volume b { font-family: var(--font-mono); }
.r-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
@media (max-width: 1099px) { .r-cols { grid-template-columns: minmax(0, 1fr); } }
.attn li { display: flex; gap: var(--s3); align-items: baseline; justify-content: space-between; padding: var(--s2) 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.attn li:last-child { border-bottom: 0; }
.attn .rank { font-family: var(--font-mono); font-weight: 600; margin-right: var(--s2); }
.dist-row { display: grid; grid-template-columns: 90px minmax(80px, 1fr) 110px; gap: var(--s3); align-items: center; padding: 6px 0; }
.dist-row .meter { height: 14px; }
.flag-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: 6px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.flag-row:last-child { border-bottom: 0; }
.report table.t { min-width: 0; }
.report tr.total td { font-weight: 700; background: var(--surface-2); }
.report-foot { margin-top: var(--s4); }
.report .panel + .panel { margin-top: var(--s4); }

/* ---------- questions ---------- */
.q-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: var(--s4); }
@media (max-width: 1099px) { .q-card { grid-template-columns: minmax(0, 1fr); } }
.panel.q-card + .panel.q-card { margin-top: var(--s3); }
.q-card h3 { font-size: 15px; }
.q-answer { margin-top: var(--s2); padding: var(--s2) var(--s3); border-left: 3px solid var(--green); background: var(--green-bg); border-radius: 0 var(--radius) var(--radius) 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.q-answer.draft { border-left-color: var(--orange); background: var(--orange-bg); }
.q-counts { display: grid; grid-template-columns: 1fr auto; gap: 4px var(--s3); font-size: 13px; align-content: start; margin: 0; }
.q-counts dt { color: var(--text-2); }
.q-counts dd { margin: 0; text-align: right; font-family: var(--font-mono); }
.q-edit { margin-top: var(--s3); padding: var(--s3); border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--bg); display: grid; gap: var(--s3); }
.history li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; overflow-wrap: anywhere; }
.history li:last-child { border-bottom: 0; }

/* ---------- settings ---------- */
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, 260px); gap: var(--s2) var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--border); align-items: start; }
@media (max-width: 699px) { .set-row { grid-template-columns: minmax(0, 1fr); } }
.set-row .sl { font-weight: 600; }
.set-row .sd { font-size: 13px; color: var(--text-2); }
.panel-foot { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; padding-top: var(--s3); margin-top: var(--s2); }
.rubric-part { display: grid; grid-template-columns: minmax(0, 1fr) 110px 130px; gap: var(--s2) var(--s3); padding: var(--s3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.rubric-part + .rubric-part { margin-top: var(--s2); }
.rubric-part .guide { grid-column: 1 / -1; }
.rubric-part .rp-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
@media (max-width: 699px) { .rubric-part { grid-template-columns: minmax(0, 1fr); } }
.total-line { font-weight: 600; }
.checks { display: flex; gap: var(--s3); flex-wrap: wrap; }
.checks label { display: inline-flex; gap: 6px; align-items: center; }
.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s3); }
.job { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s3); display: grid; gap: var(--s2); align-content: start; }

/* ---------- print (executive summary) ---------- */
@page { size: letter; margin: 0.5in; }
@media print {
  html, body { background: #fff !important; color: #000 !important; }
  body { font-size: 11px; }
  .side, .top, .audio-bar, .toasts, #banners, .no-print, .btn, .skip, .scrim, dialog { display: none !important; }
  .shell { display: block; }
  main#app { padding: 0; max-width: none; min-height: 0; }
  .panel, .report, .tile, .note-box, .table-wrap, .state { background: #fff !important; border-color: #000 !important; box-shadow: none; }
  .panel { padding: 8px; border-radius: 0; }
  .panel + .panel, .report .panel + .panel { margin-top: 8px; }
  a, a.tile { color: #000 !important; text-decoration: none !important; }
  .tile .tgo { display: none; }
  .tiles { grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 6px 0; }
  .tile { padding: 6px; border-left-width: 5px; border-left-color: #000 !important; break-inside: avoid; }
  .tile .tn { font-size: 20px; color: #000; }
  .tile .td, .tile .tl, .tile .td.flat { color: #000 !important; }
  .r-cols { grid-template-columns: 1fr 1fr; gap: 8px; }
  .table-wrap { overflow: visible !important; }
  table.t { min-width: 0 !important; font-size: 10.5px; }
  table.t th { background: #eee !important; color: #000 !important; padding: 3px 6px; border-bottom: 1px solid #000; }
  table.t td { padding: 3px 6px; border-bottom: 1px solid #999; }
  tr, .attn li, .flag-row, .dist-row, .tile { break-inside: avoid; page-break-inside: avoid; }
  thead { display: table-header-group; }
  table.t { table-layout: auto; width: 100%; }
  table.t th { white-space: normal !important; }
  table.t td, table.t th { overflow-wrap: anywhere; }
  .chip, .grade { background: #fff !important; color: #000 !important; border: 1px solid #000 !important; }
  .chip-ai { border-style: dashed !important; }
  .meter { background: #fff !important; border-color: #000 !important; }
  .meter > i { background: #000 !important; }
  .dot { color: #000 !important; }
  h1 { font-size: 16px; }
  .report .r-head h2 { font-size: 15px; }
  h2 { font-size: 13px; }
  .page-head .sub { display: none; }
  .section-title { margin: 8px 0 4px; }
  .muted, .faint, .sub-note, .help { color: #333 !important; }
}

.r-cols > .panel { margin-top: 0 !important; }

/* ---------- Home dashboard ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); align-items: start; }
.box { grid-column: span var(--w, 1); position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--s4); min-width: 0; display: flex; flex-direction: column; gap: var(--s3); }
.box.has-h { overflow: auto; }
.box-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.box-head h2 { font-family: var(--font-brand); font-size: 17px; font-weight: 700; }
.box-go { font-size: 13px; font-weight: 500; white-space: nowrap; }
.box-body { min-width: 0; }
.box-empty { padding: var(--s2) 0; }
.tiles-tight { margin: 0; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.kv-list li { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); padding: 7px 0; border-bottom: 1px solid var(--border); }
.kv-list li:last-child { border-bottom: 0; }
.kv-list li { flex-wrap: wrap; }
.kv-list li .dot { white-space: normal; text-align: right; min-width: 0; }
.kv-list a { font-family: var(--font-mono); font-weight: 600; text-decoration: none; }
.kv-list a:hover { text-decoration: underline; }
.plain-list li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.plain-list li:last-child { border-bottom: 0; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.split-col h3 { margin-bottom: var(--s2); color: var(--navy); }
:root[data-theme='dark'] .split-col h3 { color: var(--accent); }
.stack-sm > * + * { margin-top: var(--s3); }
.big-stat .n { font-family: var(--font-brand); font-weight: 800; font-size: 40px; line-height: 1; color: var(--navy); }
:root[data-theme='dark'] .big-stat .n { color: var(--text); }
.big-stat .l { color: var(--text-2); margin-top: 2px; }
.box.is-editing { border-style: dashed; border-color: var(--bright); padding-top: var(--s3); cursor: default; }
.box.is-editing .box-body { opacity: 0.8; pointer-events: none; }
.box-edit { display: flex; align-items: center; gap: var(--s2) var(--s3); flex-wrap: wrap; padding-bottom: var(--s2); border-bottom: 1px dashed var(--border-strong); }
.box-drag { cursor: grab; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 4px 10px 4px 24px; border-radius: var(--radius-pill); background: var(--surface-2); position: relative; user-select: none; }
.box-drag::before { content: ''; position: absolute; left: 9px; top: 50%; width: 8px; height: 12px; margin-top: -6px; background: radial-gradient(circle, var(--text-3) 1.3px, transparent 1.6px) 0 0 / 4px 4px; }
.box.is-dragging { opacity: 0.45; }
.box.drop-before { box-shadow: -6px 0 0 0 var(--bright); }
.box.drop-after { box-shadow: 6px 0 0 0 var(--bright); }
.box-grip { position: absolute; right: 2px; bottom: 2px; width: 26px; height: 26px; border: 0; background: transparent; cursor: nwse-resize; touch-action: none; border-radius: 6px; }
.box-grip::after { content: ''; position: absolute; right: 5px; bottom: 5px; width: 12px; height: 12px; background: linear-gradient(135deg, transparent 0 50%, var(--bright) 50% 58%, transparent 58% 70%, var(--bright) 70% 78%, transparent 78%); }
.box-grip:hover, .box-grip:focus-visible { background: var(--accent-bg); }
.home-actions .sub-note { margin-right: var(--s2); }
.tray { margin-top: var(--s4); }
.tray h2 { margin-bottom: var(--s3); }
.tray-list li { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.tray-list li:last-child { border-bottom: 0; }
@media (max-width: 899px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .box { grid-column: 1 / -1; }
  .split { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Help panel ---------- */
.help-scrim { position: fixed; inset: 0; background: var(--overlay); z-index: 70; }
.help-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); z-index: 80; background: var(--surface); border-left: 1px solid var(--border-strong); box-shadow: -8px 0 24px rgba(9, 49, 93, 0.16); display: flex; flex-direction: column; transform: translateX(104%); transition: transform 0.18s ease-out; }
.help-panel.is-open { transform: none; }
.help-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s4); border-bottom: 1px solid var(--border); }
.help-head h2 { font-family: var(--font-brand); font-size: 20px; font-weight: 800; }
.help-tools { display: grid; gap: var(--s2); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); }
.help-tools input { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); }
.help-scroll { overflow-y: auto; padding: var(--s3) var(--s4) var(--s5); flex: 1; }
.help-sub { margin: var(--s3) 0 var(--s2); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2); }
.help-topic { border: 1px solid var(--border); border-radius: var(--radius); padding: 0 var(--s3); margin-bottom: var(--s2); background: var(--bg); }
.help-topic summary { padding: 10px 0; font-weight: 600; }
.help-body { padding: 0 0 var(--s3); }
.help-body p + p { margin-top: var(--s2); }

/* ---------- First sign-in tour ---------- */
.tour-layer { position: fixed; inset: 0; z-index: 120; }
.tour-hole { position: fixed; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(9, 49, 93, 0.62), 0 0 0 3px var(--bright); transition: left 0.18s ease-out, top 0.18s ease-out, width 0.18s ease-out, height 0.18s ease-out; pointer-events: none; }
.tour-card { position: fixed; width: min(380px, calc(100vw - 24px)); background: var(--surface); color: var(--text); border-radius: 14px; padding: var(--s4) var(--s5); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3); display: grid; gap: var(--s2); }
.tour-card h2 { font-family: var(--font-brand); font-size: 20px; font-weight: 800; }
.tour-count { font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; }
.tour-actions { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); }
.tour-actions .grow { flex: 1; }
@media print { .help-panel, .help-scrim, .tour-layer { display: none !important; } }
.audio-host { display: contents; }

/* ---- Report builder ---- */
.rb-set { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s3) var(--s4); margin: var(--s3) 0 0; min-width: 0; }
.rb-set > legend { padding: 0 var(--s2); font-weight: 600; font-size: 13px; color: var(--text-2); }
.rb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s4); }
.rb-grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.rb-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px var(--s4); }
.rb-check { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; font-size: 14px; }
.rb-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.rb-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s3); margin-top: var(--s2); }
.rb-card { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s3); background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.rb-card .row { margin-top: auto; }
.rb-bar { display: grid; grid-template-columns: 1.2fr 1.2fr 1fr; gap: var(--s5); }
.rb-bar-col .label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); font-weight: 600; display: block; margin-bottom: 4px; }
.rb-summary { margin-bottom: var(--s4); }
.rb-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); margin: var(--s2) 0; }
.rb-tile { border: 1px solid var(--border); border-left: 4px solid var(--teal); border-radius: var(--radius); padding: var(--s2) var(--s3); background: var(--surface); }
.rb-tile-label { font-size: 12px; color: var(--text-2); }
.rb-tile-value { font-family: var(--font-mono); font-size: 24px; font-weight: 500; color: var(--navy); }
.rb-tiles-sm .rb-tile-value { font-size: 20px; }
.rb-highlights, .rb-notes { margin: var(--s2) 0 0; padding-left: 20px; }
.rb-highlights li { margin: 2px 0; }
.rb-chg { font-size: 12px; font-weight: 600; }
.rb-chg.good { color: var(--green); }
.rb-chg.bad { color: var(--red); }
.rb-chart { margin: 0; }
.rb-svg { width: 100%; height: auto; max-height: 340px; display: block; }
.rb-legend { display: flex; gap: var(--s4); flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin-top: 4px; }
.rb-key i, .rb-pie-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.rb-pie { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: var(--s5); align-items: center; }
.rb-pie-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rb-pie-legend li { display: flex; align-items: center; gap: 4px; }
.rb-pie-legend b { margin-left: auto; font-family: var(--font-mono); font-weight: 500; }
.rb-fig { background: none; border: 0; padding: 0; font: inherit; font-family: var(--font-mono); color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 24px; }
.rb-fig:hover { color: var(--accent-hover); }
.rb-sub { font-size: 12px; color: var(--text-3); }
.rb-total td { font-weight: 700; background: var(--surface-2); }
.rb-print-head { display: none; }
@media (max-width: 960px) { .rb-grid, .rb-grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rb-bar { grid-template-columns: 1fr; gap: var(--s3); } .rb-pie { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .rb-grid, .rb-grid4 { grid-template-columns: 1fr; } }
@media print {
  .rb-noprint { display: none !important; }
  .rb-print-head { display: block; margin-bottom: 8px; }
  .rb-result { border: 0; padding: 0; }
  .rb-fig { color: inherit; text-decoration: none; }
}

/* ---------- call page: one listening workspace ---------- */
.call-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }
.call-top .back { margin-bottom: 0; }
.call-nav { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.call-nav .is-off { opacity: 0.45; pointer-events: none; }
.call-summary { padding: var(--s3) var(--s4); }
.call-summary .ring { width: 64px; height: 64px; }
.call-summary .ring .val b { font-size: 18px; }
.call-summary h1 { font-size: 22px; }
.workspace { min-width: 0; }
.deck { position: sticky; top: 56px; z-index: 15; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: var(--s2) var(--s3); box-shadow: 0 4px 14px rgba(9, 49, 93, 0.1); margin-bottom: var(--s3); }
.speakers { display: flex; align-items: stretch; gap: var(--s2); flex-wrap: wrap; margin-bottom: 6px; }
.spk { flex: 1 1 200px; max-width: 320px; display: flex; align-items: center; gap: var(--s2); padding: 4px var(--s3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); min-width: 0; }
.spk > i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.spk-agent > i { background: var(--accent); }
.spk-caller > i { background: var(--blue); }
.spk-name { font-weight: 600; overflow-wrap: anywhere; }
.spk.is-live { background: var(--accent-bg); border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.spk-caller.is-live { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue) inset; }
.live-badge { align-self: center; flex: 1 1 160px; text-align: right; font-size: 13px; font-weight: 600; color: var(--text-2); }
.deck-time { margin-top: var(--s2); }
.deck .timeline { height: 40px; cursor: pointer; overflow: visible; }
.deck .timeline .tick { border: 0; padding: 0; width: 8px; margin-left: -4px; border-radius: 2px; cursor: pointer; z-index: 2; }
.deck .timeline .tick:hover, .deck .timeline .tick:focus-visible { width: 12px; margin-left: -6px; outline-offset: 2px; }
.deck-search { margin-top: var(--s2); }
.deck-search .input { max-width: 320px; }
.deck-keys { margin-top: 2px; font-size: 13px; color: var(--text-2); }
.deck-keys summary { cursor: pointer; min-height: 24px; }
.deck .legend { margin-top: 4px; }
.line { scroll-margin-top: calc(var(--deck-h, 220px) + 70px); }
.line .line-flags { grid-column: 3; list-style: none; margin: 4px 0 2px; padding: 0; display: grid; gap: var(--s2); }
.line .line-flags .flag-item { background: var(--surface); }
.line.is-match { background: var(--accent-bg); }
.line.is-match-cur { outline: 2px solid var(--blue); outline-offset: -2px; }
.flag-index { border-left: 4px solid var(--border-strong); padding: var(--s2) var(--s3); border-radius: var(--radius); background: var(--surface-2); list-style: none; }
.flag-index + .flag-index { margin-top: var(--s2); }
.flag-index.sev-red { border-left-color: var(--red); }
.flag-index.sev-orange { border-left-color: var(--orange); }
.flag-index .plain { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.call-grid.is-tabs { grid-template-columns: minmax(0, 1fr); }
.call-grid.is-tabs .tab-panes { display: grid; gap: var(--s3); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--border); margin-bottom: var(--s3); }
.tab { border: 0; background: transparent; padding: 10px 14px; min-height: 44px; font-weight: 600; color: var(--text-2); border-bottom: 3px solid transparent; margin-bottom: -2px; cursor: pointer; }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab:hover { background: var(--surface-2); }
@media (max-width: 899px) { .deck { top: 0; position: static; } .live-badge { margin-left: 0; flex-basis: 100%; } }
@media (max-width: 1099px) and (min-width: 900px) { .speakers { gap: var(--s2); } }
@media print { .deck, .call-nav, .tabs { display: none !important; } }

.audio-bar .audio-note { flex: 1 1 auto; order: 4; font-size: 12px; margin: 0; }
.audio-bar .scrub { order: 5; flex: 1 1 100%; height: 18px; margin: 0; }
.deck .timeline { height: 30px; }
.deck .timeline .seg-a { top: 5px; height: 8px; }
.deck .timeline .seg-b { top: 17px; height: 8px; }
.deck .audio-bar .play-btn { min-width: 88px; min-height: 36px; font-size: 15px; }
.deck.deck-min .spk .help, .deck.deck-min .deck-search { display: none; }
.deck.deck-min .live-badge { flex-basis: 140px; }

.deck-time { position: relative; }
.scrub-over { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; z-index: 1; cursor: pointer; }
.deck-time:focus-within .timeline { outline: 3px solid var(--accent); outline-offset: 2px; }
.deck-search .row { gap: var(--s2); }
.deck.deck-min .timeline { display: none; }
.deck.deck-min .scrub-over { display: block; position: static; opacity: 1; height: 20px; }
