/* Logic V design system, shared by practice-web, demo-web and dialer-web. Each Dockerfile copies this folder to static/.
   See DESIGN.md. Tokens first, then base elements, the shell, components, and page-specific pieces last. */

@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(ibm-plex-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url(ibm-plex-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url(ibm-plex-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 700; font-display: swap; src: url(ibm-plex-sans-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 600; font-display: swap; src: url(ibm-plex-mono-latin-600-normal.woff2) format("woff2"); }

:root {
  color-scheme: dark;

  /* Brand charcoal ramp (brand/constants.md, owner decision 2026-10-19): page, cards, raised panels, borders. */
  --bg: #1b1c1f; --card: #232428; --panel: #28292e; --line: #35373d; --line-strong: #6a6d75;
  --ink: #eeeff1; --muted: #a3a6ae; --faint: #868992;
  --shell: #1b1c1f; --shell-ink: #eeeff1; --shell-muted: #a3a6ae; --shell-line: #35373d; --shell-hover: #28292e;
  --plate: #2c2d33; --plate-ink: #ffffff; --plate-muted: #a3a6ae;
  --primary: #eeeff1; --primary-ink: #1b1c1f; --primary-hover: #ffffff;

  /* Brand red: the fourth bar, where you are, what is live, and hang up. Red text uses the lighter tint. */
  --red: #bb1827; --red-text: #f2828d; --on-red: #ffffff;
  --accent: #bb1827; --accent-ink: #ffffff;
  --focus: #f2828d;

  /* State. */
  --good: #4cc38a; --ok: #e5b25a; --bad: #f2828d; --bad-wash: #3a1f24; --ok-wash: #33291a;

  /* Chart series, validated with the dataviz palette checker against #232428. */
  --s-practice: #c9cbd1; --s-real: #e5484d;
  --st-eou: #8a8d96; --st-llm: #e5484d; --st-tts: #eeeff1; --st-other: #4a4c53;

  /* Type and space. */
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;
  --t-label: .72rem; --t-xs: .78rem; --t-sm: .875rem; --t-base: 1rem; --t-md: 1.125rem; --t-lg: 1.375rem; --t-xl: 1.875rem;
  --t-2xl: 2.5rem; --t-plate: 3rem; --t-hero: 4.5rem;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  /* Small, crisp corners like logicv.com (3/5px); the live call stage keeps a slightly softer frame. */
  --r-plate: 3px; --r-control: 5px; --r-card: 8px; --r-stage: 12px;
  --radius: var(--r-card);
  --ease: cubic-bezier(.16, 1, .3, 1);
  /* Colours the components use that aren't base tokens, so the light theme can swap them too. */
  --bar-bg: rgb(27 28 31 / .92); --red-hover: #d01d2e; --red-active: #a5121f; --red-glow: rgb(187 24 39 / .6);
  --good-text: #86dbb0; --good-wash: #1f3a2d; --bad-line: #6b2b33;
  --info-text: #a9cdf2; --info-wash: #24364a; --warn-text: #f1c977; --warn-wash: #3a3020;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scrollbar-color: var(--muted) transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); caret-color: var(--red);
       font: 400 1rem/1.5 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
main { max-width: 1120px; margin: 0 auto; padding: var(--s5) var(--s4) var(--s7); }
h1 { font-size: var(--t-xl); font-weight: 600; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 var(--s1); text-wrap: balance; }
h2 { font-size: var(--t-md); font-weight: 600; line-height: 1.3; margin: var(--s6) 0 var(--s3); padding-top: var(--s3); border-top: 2px solid var(--line-strong); }
h3 { font-weight: 600; }
p { margin: var(--s3) 0; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--red-text); }
ul, ol { margin: var(--s2) 0; padding-left: 20px; }
li { margin: 2px 0; }
.sub { color: var(--muted); margin: 0 0 var(--s5); max-width: 68ch; }
.muted, .mut { color: var(--muted); }
.good { color: var(--good); } .ok, .warn { color: var(--ok); } .weak, .bad { color: var(--bad); }
.hidden { display: none !important; }
.note { color: var(--muted); font-size: var(--t-sm); margin-top: var(--s3); max-width: 68ch; }
.err { color: var(--bad); margin-top: var(--s3); }
.err:empty { display: none; }

/* ---------- controls ---------- */
button { font: inherit; font-weight: 500; color: var(--ink); background: transparent; border: 1px solid var(--line-strong);
         border-radius: var(--r-control); padding: 8px 14px; min-height: 38px; cursor: pointer;
         transition: background .15s, color .15s, border-color .15s; }
button:hover:not(:disabled) { background: var(--panel); }
button:active:not(:disabled) { background: var(--line); }
button:disabled { opacity: .45; cursor: not-allowed; }
.primary, .pri { background: var(--red); color: var(--on-red); border-color: var(--red); font-weight: 600; padding: 9px 20px; }
.primary:hover:not(:disabled), .pri:hover:not(:disabled) { background: var(--red-hover); border-color: var(--red-hover); }
.primary:active:not(:disabled), .pri:active:not(:disabled) { background: var(--red-active); }
.primary:disabled, .pri:disabled { background: var(--panel); border-color: var(--line); color: var(--muted); opacity: 1; }
.pri.subtle, .demo .primary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.pri.subtle:hover:not(:disabled), .demo .primary:hover:not(:disabled) { background: var(--red); border-color: var(--red); color: var(--on-red); }
.danger, .end, .rec { background: var(--red) !important; color: var(--on-red) !important; border-color: var(--red) !important; font-weight: 600; }
.danger:disabled, .end:disabled { background: var(--panel) !important; color: var(--muted) !important; border-color: var(--line) !important; opacity: 1; }
.danger:hover:not(:disabled), .end:hover:not(:disabled) { filter: brightness(.92); }
.ghost { background: transparent; }
.linkbtn { background: none; border: 0; min-height: 0; padding: 0; color: var(--ink); font-weight: 400; text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; }
.linkbtn:hover:not(:disabled) { background: none; color: var(--red-text); text-decoration-color: currentColor; }
.linkbtn.del { color: var(--red-text); text-decoration-color: currentColor; }

input, textarea, select { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong);
         border-radius: var(--r-control); padding: 8px 12px; min-height: 38px; max-width: 100%; }
input, textarea { width: 100%; }
input[type=checkbox] { width: auto; min-height: 0; accent-color: var(--red); margin: 0 var(--s1) 0 0; vertical-align: -1px; }
input[type=date], input[type=datetime-local] { width: auto; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:hover, textarea:hover, select:hover { border-color: var(--ink); }
input:user-invalid { border-color: var(--bad); }
.field { display: grid; gap: var(--s1); font-size: var(--t-sm); font-weight: 500; }
.field input, .field select { font-size: var(--t-base); font-weight: 400; }

.seg { display: inline-flex; flex-wrap: wrap; }
.seg button { border-radius: 0; margin-left: -1px; font-weight: 400; }
.seg button:first-child { border-radius: var(--r-control) 0 0 var(--r-control); margin-left: 0; }
.seg button:last-child { border-radius: 0 var(--r-control) var(--r-control) 0; }
.seg button.on { background: var(--ink); color: var(--bg); font-weight: 600; position: relative; }

.pill { display: inline-block; padding: 1px 8px; border-radius: var(--r-plate); border: 1px solid var(--line); background: var(--panel); font-size: var(--t-xs); white-space: nowrap; }
.seg button::first-letter, .disp button::first-letter { text-transform: uppercase; }
.tag { font-size: var(--t-xs); font-weight: 400; border: 1px solid var(--line); border-radius: var(--r-plate); padding: 1px 6px; color: var(--muted); margin-left: var(--s2); vertical-align: 2px; }
.chip { display: inline-block; min-height: 0; border: 1px solid var(--line); background: var(--card); border-radius: var(--r-plate); padding: 2px 8px; font-size: var(--t-sm); font-weight: 400; margin: 2px 4px 2px 0; }
.chip:hover:not(:disabled) { border-color: var(--ink); background: var(--card); }
.chip.miss { border-style: dashed; border-color: var(--muted); color: var(--muted); }

/* ---------- the shell ---------- */
.bar { position: sticky; top: 0; z-index: 5; background: var(--bar-bg); backdrop-filter: blur(10px); color: var(--shell-ink); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); padding: 12px var(--s5); border-bottom: 1px solid var(--line); }
.bar .brand { display: flex; align-items: center; gap: var(--s3); margin-right: auto; min-width: 0; }
.bar .brand img { height: 18px; width: auto; display: block; }
.bar .app { font: 600 var(--t-label)/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; margin: 0; padding-left: var(--s3); border-left: 1px solid var(--shell-line); color: var(--shell-ink); white-space: nowrap; }
.bar .muted, .bar .mut { color: var(--shell-muted); }
.bar button { background: transparent; color: var(--shell-ink); border-color: transparent; font-weight: 400; min-height: 32px; padding: 4px 10px; }
.bar button:hover:not(:disabled) { background: var(--shell-hover); }
.bar .linkbtn { padding: 4px 8px; text-decoration: none; }
.bar .linkbtn:hover:not(:disabled) { color: var(--shell-ink); }
.bar .linkbtn.on { font-weight: 600; box-shadow: inset 0 -2px 0 var(--red); border-radius: 0; }
.bar select { background: var(--shell-hover); color: var(--shell-ink); border-color: var(--shell-line); min-height: 32px; padding: 3px 8px; }
.bar :focus-visible { outline-color: var(--shell-ink); }
.userbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); font-size: var(--t-sm); }
#who { margin-right: var(--s3); }
body:has(#app.hidden) .userbar { display: none; }

/* Tabs: standard, with the current one marked in red. Used on the page and inside the bar. */
.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--line); margin: 0 0 var(--s5); overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; border-radius: 0; color: var(--muted); padding: 8px 12px; white-space: nowrap; box-shadow: inset 0 -2px 0 transparent; }
.tabs button:hover:not(:disabled) { background: none; color: var(--ink); }
.tabs button.on { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--red); }
.bar .tabs { border: 0; margin: 0; }
.bar .tabs button { color: var(--shell-muted); }
.bar .tabs button:hover:not(:disabled) { color: var(--shell-ink); background: none; }
.bar .tabs button.on { color: var(--shell-ink); }

/* ---------- surfaces ---------- */
.card:has(> table) { overflow-x: auto; }
.signin, .call.card, .flash.card, form.card, #setupBanner, .player.card, #dispCard, .call-panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s4); }
.signin { max-width: 400px; margin: var(--s7) auto; padding: var(--s5); }
.page-title { font-size: var(--t-xl); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; border: 0; padding: 0; margin: 0 0 var(--s1); }
.signin h2, .signin .title { font-size: var(--t-lg); font-weight: 600; margin: 0 0 var(--s4); padding: 0; border: 0; display: block; }
.form { display: grid; gap: var(--s3); }
.formrow { display: flex; gap: var(--s2); flex-wrap: wrap; }
.formrow input, .formrow select { flex: 1; min-width: 150px; }

/* A plate: a number that matters, set like a posted room number. */
.plate { display: inline-block; background: var(--plate); color: var(--plate-ink); border-radius: var(--r-plate); padding: var(--s2) var(--s3);
         font-family: var(--mono); font-size: var(--t-plate); font-weight: 600; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums;
         box-shadow: inset 0 -3px 0 var(--red); }
.plate .muted, .plate .mut { color: var(--plate-muted); letter-spacing: 0; }
.plate-sm { font-size: var(--t-sm); padding: 2px 6px; letter-spacing: 0; min-width: 2.2em; text-align: center; }

/* The meter: the logo's five bars, fourth in red. It shows the state of a live call. */
.meter { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 96px; padding: 0 var(--s5); background: var(--plate); border-radius: var(--r-plate); }
.meter i { display: block; width: 7px; height: 56px; background: var(--plate-ink); transform: scaleY(.28); transform-origin: center; transition: transform .25s var(--ease); }
.meter i:nth-child(4) { background: var(--red); }
.meter.listening i { animation: m-listen 2.4s ease-in-out infinite; transform: scaleY(.42); }
.meter.thinking i { animation: m-think 1.1s ease-in-out infinite; }
.meter.speaking i, .meter.live i { animation: m-talk .62s ease-in-out infinite alternate; }
.meter i:nth-child(2) { animation-delay: .12s !important; } .meter i:nth-child(3) { animation-delay: .24s !important; }
.meter i:nth-child(4) { animation-delay: .08s !important; } .meter i:nth-child(5) { animation-delay: .2s !important; }
@keyframes m-listen { 50% { transform: scaleY(.6); } }
@keyframes m-think { 0%, 100% { transform: scaleY(.2); } 50% { transform: scaleY(.55); } }
@keyframes m-talk { from { transform: scaleY(.3); } to { transform: scaleY(1); } }
.meter-sm { height: 58px; padding: 0 var(--s3); gap: 5px; }
.meter-sm i { width: 5px; height: 36px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--good); display: inline-block; margin-right: var(--s2); animation: p 1.4s infinite; }
@keyframes p { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .meter.speaking i, .meter.live i { transform: scaleY(.8); }
}

/* Lists */
table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
td { color: var(--ink); }
td, th { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td:first-child, th:first-child { padding-left: 0; } td:last-child, th:last-child { padding-right: 0; }
th { color: var(--muted); font: 600 var(--t-label)/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; border-bottom-color: var(--line-strong); white-space: nowrap; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel); }
tr.test td { color: var(--muted); }
.wrap { overflow-x: auto; }

/* Ruled grids: choices and statistics share one frame instead of separate boxes. */
.grid, .tiles, .metrics, .multiples { display: grid; border-top: 1px solid var(--line-strong); }
.grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid > .card, .tiles > .card, .metrics > .card, .multiples > .card { padding: var(--s3) var(--s4) var(--s3) 0; border-bottom: 1px solid var(--line); }
.tiles > .card, .multiples > .card { border-bottom: 0; }
.tiles, .multiples { row-gap: var(--s1); }
.grid > .persona { padding: var(--s4); background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.tiles { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.metrics { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.multiples { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tile .v, .metric .v, .multiples .v { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: -.02em; }
.tile .v { font-size: var(--t-2xl); } .metric .v, .multiples .v { font-size: var(--t-xl); }
.tile .k, .metric .k, .multiples .k, .stat-label, .stage, .biz, .label { color: var(--muted); font: 600 var(--t-label)/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.tile .d { font-size: var(--t-xs); margin-top: var(--s1); }

.row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; margin-top: var(--s4); }
.dim { display: grid; grid-template-columns: 170px 1fr 36px; gap: var(--s3); align-items: center; margin: var(--s3) 0 2px; font-variant-numeric: tabular-nums; }
.dim b { text-align: right; }
.dim-note { margin: 0 0 var(--s3) 182px; font-size: var(--t-sm); max-width: 68ch; }
.dim-note q { color: var(--muted); }
.score-track { height: 6px; background: var(--line); border-radius: 2px; overflow: visible; position: relative; }
.score-track i { display: block; height: 100%; background: var(--ink); border-radius: 2px; position: relative; }
.score-track i::after { content: ""; position: absolute; right: -1px; top: -5px; width: 3px; height: 14px; background: var(--red); border-radius: 1px; }
.dim b { font-family: var(--mono); font-size: var(--t-md); }
.prog { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: var(--s2); }
.prog i { display: block; height: 100%; background: var(--ink); }

/* Pick a prospect */
.persona { display: flex; flex-direction: column; justify-content: flex-start; text-align: left; width: 100%; font-weight: 400; min-height: 0; transition: background .15s; }
.persona b { display: block; font-weight: 600; font-size: var(--t-md); }
.persona .t { display: block; color: var(--muted); font-size: var(--t-sm); }
.persona p { margin: var(--s2) 0 0; font-size: var(--t-sm); }
.persona .stage { display: block; }
.persona:hover:not(:disabled) { background: var(--panel); }
.grid > .persona.on, .grid > .persona.on:hover:not(:disabled) { background: var(--panel); color: var(--ink); box-shadow: inset 0 3px 0 var(--red), inset 0 0 0 1px var(--line-strong); }
.persona.on b::after { content: "Selected"; margin-left: var(--s2); font: 600 var(--t-label)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--red-text); vertical-align: 2px; }
.stage { font-size: var(--t-xs); color: var(--muted); }
.action-bar { position: sticky; bottom: 0; z-index: 3; background: var(--bg); padding: var(--s3) 0; margin-top: var(--s2); border-top: 1px solid var(--line); }
.action-bar .spacer { margin-left: auto; }

/* In a call */
.call { text-align: center; padding: var(--s6) var(--s4); }
.call .who, #callWho { font-size: var(--t-lg); font-weight: 600; }
.call .timer { margin: var(--s3) 0; }
.call .meter { margin-bottom: var(--s4); }
#call:has(#callState .pulse) .meter i { animation: m-talk .62s ease-in-out infinite alternate; }
.score-head { display: flex; gap: var(--s4); align-items: center; flex-wrap: wrap; }
.big { font-size: var(--t-xl); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }
.plate.big { font-size: var(--t-plate); }
.plate.big .muted { font-size: var(--t-xs); font-weight: 400; margin-top: 2px; }
.tx { max-height: 420px; overflow: auto; font-size: var(--t-sm); }
.tx > div { padding: 6px 0; border-bottom: 1px solid var(--line); }
.tx > div:last-child { border-bottom: 0; }
.tx .s { font-weight: 600; margin-right: 2px; }
.tx .ts { color: var(--muted); font-size: var(--t-xs); margin-right: var(--s2); font-variant-numeric: tabular-nums; }
.seek { cursor: pointer; } .seek:hover { background: var(--panel); }
.seekq { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.player { position: sticky; top: 56px; z-index: 2; display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; margin-top: var(--s3); }
.player audio { flex: 1; min-width: 240px; height: 36px; }
.ico { width: 14px; height: 14px; vertical-align: -2px; }

/* Drills */
.flash { text-align: center; padding: var(--s6) var(--s4); }
.flash .cue { font-size: var(--t-lg); font-weight: 500; line-height: 1.3; margin: var(--s3) auto var(--s4); max-width: 44ch; text-wrap: balance; }
.flash .ans { font-size: var(--t-md); font-weight: 600; margin: var(--s4) auto; max-width: 56ch; }
.btns { display: flex; gap: var(--s2); justify-content: center; flex-wrap: wrap; }
.qlist li { margin: var(--s2) 0; }
.seqrow { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: var(--s2) 0; }
.seqrow .k { width: 90px; color: var(--muted); font-size: var(--t-sm); }

/* A page's own title, above its sections. */
#ops > h2:first-child, #latency > h2:first-child, #users > h2:first-child { font-size: var(--t-xl); font-weight: 600; letter-spacing: -.02em; border: 0; padding: 0; margin: 0 0 var(--s2); }
#latency > h2:first-child + p, #ops > h2:first-child + p { margin-top: 0 !important; }
#detail > .card + .card { margin-top: var(--s5); padding-top: var(--s3); border-top: 2px solid var(--line-strong); }
#detail > .card:first-child > .row { margin-top: 0; }
#call.stack > .card + .card { margin-top: var(--s5); }
#call.stack > .card:not(#dispCard) + .card:not(#dispCard) { padding-top: var(--s3); border-top: 2px solid var(--line-strong); }

/* Charts */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; font-variant-numeric: tabular-nums; }
.chart .grid { all: unset; stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--muted); stroke-width: 1; }
.legend { display: flex; gap: var(--s4); font-size: var(--t-sm); color: var(--muted); margin: 0 0 var(--s2); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.wf { display: flex; height: 12px; border-radius: 2px; overflow: hidden; background: var(--line); }
.wf i { display: block; height: 100%; }
.wf i + i { box-shadow: inset 2px 0 0 var(--card); }
.wfrow { display: grid; grid-template-columns: 52px 1fr 54px; gap: var(--s2); align-items: center; font-size: var(--t-sm); margin: 3px 0; font-variant-numeric: tabular-nums; }
.datebar { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
#tip { position: fixed; pointer-events: none; z-index: 10; background: var(--ink); color: var(--bg); font-size: var(--t-xs); padding: 6px 8px; border-radius: var(--r-plate); max-width: 240px; line-height: 1.35; box-shadow: 0 4px 12px rgb(0 0 0 / .25); }

/* Ops */
.capacity-track { position: relative; height: 8px; margin: var(--s3) 0 var(--s4); background: var(--line); border-radius: 4px; }
.capacity-track > div:first-child { height: 100%; border-radius: 4px; }
.stat-label { font-size: var(--t-sm); color: var(--muted); }
.stat-value { font: 600 var(--t-lg)/1.2 var(--mono); font-variant-numeric: tabular-nums; }
.subhead { font-size: var(--t-base); margin: var(--s4) 0 var(--s2); }

/* Dialer */
.toolbar { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; margin-bottom: var(--s3); }
.toolbar .spacer { margin-left: auto; }
.toolbar select { width: auto; }
.toolbar .row { margin: 0; }
.notice { background: var(--ok-wash); border: 1px solid var(--line); color: var(--ink); border-radius: var(--r-card); padding: var(--s3) var(--s4); margin-bottom: var(--s3); }
.callopts { display: grid; grid-template-columns: auto minmax(180px, 280px) minmax(0, 1fr); gap: var(--s2) var(--s3); align-items: center; margin-bottom: var(--s3); }
.callopts .check { display: flex; align-items: center; gap: var(--s2); font-weight: 500; white-space: nowrap; }
.callopts input[type=checkbox] { width: 18px; height: 18px; margin: 0; }
.callopts select, .callopts input:not([type]) { width: 100%; }
.callopts select:disabled, .callopts input:disabled { opacity: .5; }
.callopts .check:has(#notesOnly) { white-space: normal; }
.callopts .warn { grid-column: 1 / -1; margin: 0; font-size: var(--t-sm); }
.callopts .check:has(#callerName) { grid-column: 1 / -1; }  /* own row, so the notice and record rows line up in the 3 columns */
.callopts .check:has(#callerName) input { max-width: 280px; }
.addform { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s2); margin-bottom: var(--s3); }
.stack > * + * { margin-top: var(--s3); }
.call-now { align-items: stretch; }
.call-now .plate, .call-now .meter { height: 58px; display: inline-flex; align-items: center; }
.call-now #callState { align-self: center; }
.caps { max-height: 300px; overflow: auto; font-size: var(--t-sm); margin-top: var(--s2); }
.caps p { margin: var(--s1) 0; }
.caps .rep b { color: var(--s-practice); } .caps .prospect b { color: var(--good); }
.caps p.notice { background: none; border: 0; padding: 0; margin: var(--s1) 0; color: var(--muted); }
.disp { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s2) 0; }
.disp button { font-weight: 400; }
.disp button.on { background: var(--ink); color: var(--bg); font-weight: 600; border-color: var(--ink); }
.disp button[data-d=meeting_booked], .disp button[data-d=callback] { border-color: var(--good-text); color: var(--good-text); }
.disp button[data-d=not_interested], .disp button[data-d=wrong_number], .disp button[data-d=dnc] { border-color: var(--bad-line); color: var(--red-text); }
.disp button[data-d=meeting_booked].on, .disp button[data-d=callback].on { background: var(--good-text); color: var(--bg); }
.disp button[data-d=not_interested].on, .disp button[data-d=wrong_number].on, .disp button[data-d=dnc].on { background: var(--red-text); color: var(--bg); }
.tl p { cursor: pointer; margin: 2px 0; padding: 4px 0; font-size: var(--t-sm); }
.tl p:hover { background: var(--panel); }
.card > b:first-child, .tl > b:first-child { display: block; font-weight: 600; margin-bottom: var(--s2); }

/* Demo gallery and call */
.gallery { padding-top: var(--s4); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); gap: var(--s7); align-items: start; }
.gallery-intro { position: sticky; top: 72px; }
.gallery-intro h1 { font-size: var(--t-hero); line-height: 1; letter-spacing: -.035em; font-weight: 700; margin: var(--s2) 0 var(--s4); }
.gallery-intro .meter { margin: 0 0 var(--s5); }
.gallery-intro .sub { margin-bottom: 0; }
.demo-list { border-top: 1px solid var(--line-strong); }
.demo { display: grid; grid-template-columns: 1fr auto; gap: var(--s2) var(--s4); align-items: center; padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.demo h2 { font-size: var(--t-md); margin: 0; padding: 0; border: 0; }
.demo p { margin: var(--s1) 0 0; color: var(--muted); font-size: var(--t-sm); }
.biz { font-size: var(--t-sm); color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: var(--s2); vertical-align: -1px; }
.phone { font-size: var(--t-sm); margin-top: var(--s1); font-variant-numeric: tabular-nums; }
#search { margin-bottom: var(--s3); }
.demo-call { max-width: 620px; margin: 0 auto; }
.demo-call h1 { margin-top: var(--s1); }
.demo-call .sub { margin-bottom: var(--s2); }
.demo-call .stagehead { text-align: center; }
.demo-call .sub, .demo-call #disclaimer { margin-left: auto; margin-right: auto; }
.back { margin-bottom: var(--s4); text-align: left; }
.orb { display: flex; width: max-content; margin: var(--s5) auto var(--s3); }
.state { color: var(--muted); min-height: 24px; text-align: center; }
.controls { display: flex; gap: var(--s2); justify-content: center; margin: var(--s4) 0; flex-wrap: wrap; }
.captions { text-align: left; background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: var(--s4) 0 0; height: 240px; overflow-y: auto; font-size: var(--t-lg); line-height: 1.4; }
.captions:empty::before { content: "Captions appear here while you talk."; color: var(--muted); }
.captions .line { margin: 0 0 var(--s3); color: var(--faint); transition: color .4s var(--ease); }
.captions .line:last-child, .captions .line:nth-last-child(2) { color: var(--ink); }
.captions .who { display: block; font: 600 var(--t-label)/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; }
.captions .you .who { color: var(--red-text); }
#botcheck:empty { display: none; }
.demo-call .note { text-align: center; margin-left: auto; margin-right: auto; }
.demo-call #disclaimer:empty { display: none; }
#admin h2 { margin-top: var(--s6); }
.login { max-width: 340px; display: grid; gap: var(--s2); margin-bottom: var(--s4); }
body.embed .bar { display: none; }
body.embed main { padding: var(--s3); }
body.embed .captions { height: 160px; }
body.embed .orb { margin: var(--s3) auto var(--s2); }
body.embed .orb.meter { height: 64px; }
body.embed .orb.meter i { height: 38px; }

/* ---------- phone width ---------- */
@media (max-width: 760px) {
  .gallery { grid-template-columns: 1fr; gap: var(--s5); }
  .gallery-intro { position: static; }
  .gallery-intro .meter { display: none; }
}
@media (max-width: 640px) {
  main { padding: var(--s4) var(--s4) var(--s6); }
  .hide-sm { display: none; }
  .bar { position: static; padding: var(--s2) var(--s4); }
  #who, #scopeWrap > .muted { display: none; }
  .userbar { flex-wrap: nowrap; }
  .userbar:has(#opsBtn:not(.hidden)) { width: 100%; justify-content: space-between; }
  .toolbar .spacer { flex-basis: 100%; margin: 0; }
  .callopts { grid-template-columns: 1fr; }
  .action-bar { position: static; }
  .bar .tabs { order: 5; width: 100%; }
  .player { top: 8px; }
  .dim { grid-template-columns: 112px 1fr 30px; gap: var(--s2); }
  .dim-note { margin-left: 0; }
  .signin { margin: var(--s5) auto; padding: var(--s4); }
  .plate { font-size: var(--t-xl); } .plate.big { font-size: var(--t-xl); } .plate-sm { font-size: var(--t-sm); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-bar select { flex: 1; min-width: 0; }
  .action-bar .primary { width: 100%; }
  .action-bar .spacer { display: none; }
  .demo { grid-template-columns: 1fr; }
  .demo .primary { width: 100%; }
  input, select, textarea { font-size: 16px; }  /* below this, iOS zooms the page on focus */
}


/* ---------- v2: the live call is the hero ---------- */
/* Big meters: one per speaker, fed by LVViz with that speaker's real audio (bars read --b0..--b4). */
.meter.xl { height: auto; padding: var(--s5) var(--s6); gap: 14px; background: transparent; }
.meter.xl i { width: 14px; height: 148px; border-radius: 2px; transform: scaleY(.1); }
.meter.md { height: auto; padding: 0; gap: 7px; background: transparent; }
.meter.md i { width: 7px; height: 56px; border-radius: 1px; transform: scaleY(.12); }
.meter.live i { animation: none !important; transition: transform .08s linear; transform: scaleY(calc(.08 + var(--b, 0) * .92)); }
.meter.live i:nth-child(1) { --b: var(--b0); } .meter.live i:nth-child(2) { --b: var(--b1); } .meter.live i:nth-child(3) { --b: var(--b2); }
.meter.live i:nth-child(4) { --b: var(--b3); } .meter.live i:nth-child(5) { --b: var(--b4); }
.meter.idle i { animation: m-listen 3s ease-in-out infinite; }
.meter.ended i { animation: none; transform: scaleY(.1); opacity: .45; }  /* call over: flat and dimmed, not breathing */

.stage-call { position: relative; display: grid; gap: var(--s5); padding: var(--s6) var(--s6) var(--s5); background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-stage); text-align: left; overflow: hidden; }
.stage-top { display: flex; align-items: center; gap: var(--s3); }
.stage-top .label { flex: 1; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); flex: none; }
.stage-call:has(.pulse) .live-dot { background: var(--red); box-shadow: 0 0 0 0 var(--red-glow); animation: live 1.6s ease-out infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 10px rgb(187 24 39 / 0); } 100% { box-shadow: 0 0 0 0 rgb(187 24 39 / 0); } }
.stage-call .pulse { display: none; }
.stage-call .timer, .call-panel #timer { font: 600 var(--t-2xl)/1 var(--mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums; background: none; box-shadow: none; padding: 0; color: var(--ink); }
.stage-who { font-size: var(--t-2xl); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.spk { margin: 0; display: grid; justify-items: center; gap: var(--s2); padding: var(--s4) 0 var(--s3); background: var(--bg); border-radius: var(--r-card); border: 1px solid var(--line); }
.spk .label { margin: 0; }
.stream { min-height: 132px; max-height: 260px; overflow-y: auto; font-size: var(--t-lg); line-height: 1.4; border-top: 1px solid var(--line); padding-top: var(--s4); }
.stream:empty::before { content: "Live captions appear here as you talk."; color: var(--faint); font-size: var(--t-base); }
.stream p { margin: 0 0 var(--s3); color: var(--faint); }
.stream p:last-child, .stream p:nth-last-child(2) { color: var(--ink); }
.stream b { display: block; font: 600 var(--t-label)/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stream .you b, .stream .rep b { color: var(--red-text); }
.stage-foot { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: var(--s4); }
.stage-foot p { flex: 1; margin: 0; font-size: var(--t-sm); min-width: 240px; }
.stage-foot .danger { min-width: 140px; min-height: 48px; font-size: var(--t-md); }

/* Dialer: the same stage inside the call panel. */
.call-panel { padding: var(--s6); border-radius: var(--r-stage); }
.call-panel #callWho { font-size: var(--t-2xl); font-weight: 700; letter-spacing: -.03em; }
.call-panel .duo { margin-top: var(--s5); }
#call.stack .caps { font-size: var(--t-lg); line-height: 1.4; max-height: 260px; }
#call.stack .caps p { color: var(--faint); margin: 0 0 var(--s3); }
#call.stack .caps p:last-child, #call.stack .caps p:nth-last-child(2) { color: var(--ink); }
#call.stack .caps b { display: block; font: 600 var(--t-label)/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
#call.stack .caps .rep b { color: var(--red-text); }

/* Demo: the agent's meter is the stage; yours sits beside it. */
.demo-call { max-width: 760px; }
.demo-stage { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: var(--s4); margin: var(--s5) 0 var(--s3); padding: var(--s5); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-stage); }
.demo-stage .orb { margin: 0; justify-self: center; }
.demo-stage .you { display: grid; justify-items: center; gap: var(--s2); }
.demo-call h1 { font-size: var(--t-2xl); letter-spacing: -.03em; font-weight: 700; }

/* Results: the score as an editorial headline. */
.score-head .plate.big { font-size: var(--t-hero); padding: var(--s3) var(--s4); }
#result > .card:first-child { padding: var(--s6) 0 var(--s4); border-bottom: 1px solid var(--line); }
#result > .card:first-child p { font-size: var(--t-lg); line-height: 1.45; max-width: 60ch; margin-top: var(--s4); }
.page-title { font-size: var(--t-2xl); font-weight: 700; letter-spacing: -.03em; }
h2 { font-size: var(--t-md); }
.gallery-intro .sub { font-size: var(--t-md); }
.demo h2 { font-size: var(--t-lg); }
.persona b { font-size: var(--t-lg); letter-spacing: -.01em; }

@media (max-width: 640px) {
  .stage-call, .call-panel { padding: var(--s5) var(--s4); }
  .meter.xl { padding: var(--s4); gap: 9px; }
  .meter.xl i { width: 10px; height: 96px; }
  .stage-who, .call-panel #callWho { font-size: var(--t-xl); }
  .stage-call .timer, .call-panel #timer { font-size: var(--t-xl); }
  .gallery-intro h1 { font-size: var(--t-2xl); }
  .demo-stage { grid-template-columns: 1fr; justify-items: center; }
  .score-head .plate.big { font-size: var(--t-2xl); }
}

/* Status at a glance: colour carries the state, the word stays for anyone who can't see colour. */
.pill { border-color: transparent; background: var(--panel); color: var(--ink); font: 600 var(--t-label)/1.6 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; }
.pill.s-new { background: var(--info-wash); color: var(--info-text); }
.pill.s-callback, .pill.o-callback_agreed, .pill.o-info_requested { background: var(--warn-wash); color: var(--warn-text); }
.pill.s-meeting_booked, .pill.o-meeting_booked, .pill.s-contacted, .pill.o-referral_or_transfer { background: var(--good-wash); color: var(--good-text); }
.pill.s-dnc, .pill.s-not_interested, .pill.o-rejected, .pill.o-prospect_hung_up, .pill.s-bad_number { background: var(--bad-wash); color: var(--red-text); }
.pill.s-attempted, .pill.o-incomplete { background: var(--panel); color: var(--muted); }
#rows td:first-child b, #histRows td b { font-size: var(--t-base); }
.callopts { padding: var(--s4); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); }
.toolbar select, .callopts select, .callopts input:not([type]) { background: var(--bg); }
.stage-call #callState, .call-panel #callState { color: var(--ink); }
@media (max-width: 640px) {
  .duo { gap: var(--s2); }
}


/* ---------- v2, round 2 ---------- */
/* One header block per page: a mono label, a strong title, one line of context. */
.page-head { margin: var(--s2) 0 var(--s5); }
.page-head .label { display: none; }  /* the tab bar already names the page */
.page-head h2, .page-head h1 { font-size: var(--t-2xl); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin: 0; padding: 0; border: 0; }
.page-head p { margin: var(--s2) 0 0; color: var(--muted); max-width: 68ch; }

/* Ghost buttons instead of underlined links inside tables. */
td .linkbtn { text-decoration: none; border: 1px solid var(--line-strong); border-radius: var(--r-control); padding: 3px 10px; font-size: var(--t-xs); }
td .linkbtn:hover:not(:disabled) { border-color: var(--red); color: var(--ink); }

/* Sign-in: a brand moment beside the form. */
.signin-wrap { display: grid; grid-template-columns: 1fr 400px; gap: var(--s7); align-items: center; max-width: 920px; margin: var(--s7) auto; }
.signin-wrap .signin { margin: 0; }
.signin-brand .meter { padding: 0 0 var(--s5); }
.signin-brand h1 { font-size: var(--t-2xl); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin: 0 0 var(--s3); }
.signin-brand p { color: var(--muted); font-size: var(--t-md); max-width: 36ch; margin: 0; }
.signin .primary, .signin .pri { width: 100%; min-height: 44px; }

/* Demo call: two equal meters, agent and you. */
.demo-stage { grid-template-columns: 1fr 1fr; align-items: stretch; }
.demo-stage .you .meter.md { gap: 14px; }
.demo-stage .you .meter.md i { width: 14px; height: 148px; }
/* Meter row grows, label row doesn't: both labels sit on the same line whatever the meter size. */
.demo-stage .agent-col, .demo-stage .you { display: grid; grid-template-rows: 1fr auto; justify-items: center; align-items: center; gap: var(--s2); }
.state { font: 600 var(--t-label)/1.6 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.gallery-intro { display: flex; flex-direction: column; }
.gallery-intro .meter { padding: 0; margin: 0 0 var(--s4); align-self: flex-start; }
.gallery-intro h1 { margin-top: 0; }

/* Phone: each table row becomes a stacked card with labelled values. */
@media (max-width: 640px) {
  table.stackable thead, table.stackable tr:has(> th) { display: none; }
  table.stackable, table.stackable tbody, table.stackable tr, table.stackable td { display: block; width: 100%; }
  table.stackable tr { padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
  /* Cells stay ordinary blocks so names, line breaks and buttons inside them flow normally; the label is pinned
     in a fixed left gutter instead of being a flex sibling (which split a cell's contents into ragged columns). */
  table.stackable td { border: 0; padding: 3px 0; position: relative; min-width: 0; overflow-wrap: anywhere; }
  table.stackable td[data-label] { padding-left: calc(36% + var(--s3)); }
  table.stackable td[data-label]::before { content: attr(data-label); position: absolute; left: 0; top: 3px; width: 36%; color: var(--muted); font: 600 var(--t-label)/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
  table.stackable td:not([data-label]):not(:first-child) { padding-top: var(--s2); }
  table.stackable td button, table.stackable td .btn { max-width: 100%; }
  table.stackable td:first-child { font-weight: 600; }
  table.stackable td.hide-sm, table.stackable .hide-sm { display: none; }
  table.stackable td[colspan] { display: block; }
  table.stackable td[colspan]::before { display: none; }
  .signin-wrap { grid-template-columns: 1fr; gap: var(--s5); margin: var(--s5) auto; }
  .demo-stage .you .meter.md i { width: 10px; height: 96px; }
  .demo-stage { grid-template-columns: 1fr 1fr; }
}
/* Demo admin: questions an agent couldn't answer, and teaching it. */
.qa { border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s3) var(--s4); margin-block: var(--s3); display: grid; gap: var(--s2); }
.qa p { margin: 0; }
.qa.hl { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
.field textarea { font: inherit; font-weight: 400; width: 100%; box-sizing: border-box; padding: var(--s2); border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--card); color: var(--ink); }
details { margin-block: var(--s3); } details > summary { cursor: pointer; font-weight: 600; } details[open] { display: grid; gap: var(--s3); }
/* Fill-in forms: small grey kicker labels above clearly filled boxes, columns that wrap instead of overflowing. */
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s3) var(--s4); align-items: end; }
.fields label { display: grid; gap: var(--s1); min-width: 0; color: var(--muted); font: 600 var(--t-label)/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.fields input, .fields select { font: 400 var(--t-base)/1.4 "IBM Plex Sans", system-ui, sans-serif; letter-spacing: normal; text-transform: none; color: var(--ink); background: var(--panel); border-color: var(--line-strong); min-width: 0; }
.fields input:focus { background: var(--bg); }
details.card > summary { font-size: var(--t-md); }
details.card > summary .muted { font-weight: 400; font-size: var(--t-sm); }

/* v2 review fixes (8 Nov). Red stays the only accent; the gallery intro starts level with the list. */
.gallery .biz .dot { display: none; }
.gallery-intro .meter { display: none; }
.gallery-intro h1 { margin-top: 0; }
@media (max-width: 640px) {
  .stream, #call.stack .caps { max-height: min(46vh, 340px); padding-bottom: var(--s3); }
}
.action-bar .opt { display: inline-flex; align-items: center; gap: var(--s2); }
@media (max-width: 640px) {
  .action-bar .opt { display: grid; grid-template-columns: 1fr; gap: var(--s1); width: 100%; }
  .action-bar .opt select, .action-bar .opt .seg { width: 100%; }
  .action-bar .opt .seg button { flex: 1; }
  .action-bar .spacer { display: none; }
  .action-bar .primary { width: 100%; }
}
/* Keep the latency chart near its drawn size, so its axis labels stay at label size instead of scaling up. */
svg.trend-svg { width: 100%; max-width: 760px; height: auto; display: block; }
/* Demo call: elapsed time above the meters, like practice and dialer calls; a stronger state line under them. */
.demo-timer { font: 600 var(--t-2xl)/1 var(--mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums; text-align: center; color: var(--ink); margin: var(--s2) 0 var(--s3); }
.demo-stage + .state { font-size: var(--t-sm); margin-top: var(--s3); }

/* Light theme: logicv.com's colours (logicv-site tokens: white pages, ink #1F1F1F, slate greys, hairlines #E2E2E2,
   charcoal cover blocks #2B2B2B). Pages opt in with <html data-theme="light">: the demo panel inside logicv.com
   always does, the standalone demo follows the visitor's system, staff tools stay dark unless ?theme=light. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff; --card: #ffffff; --panel: #f7f7f5; --line: #e2e2e2; --line-strong: #c9c9c9;
  --ink: #1f1f1f; --muted: #5e5e5e; --faint: #757575;
  --shell: #ffffff; --shell-ink: #1f1f1f; --shell-muted: #5e5e5e; --shell-line: #e2e2e2; --shell-hover: #f0f0ee;
  --plate: #2b2b2b; --plate-ink: #ffffff; --plate-muted: #b4b4b4;
  --primary: #1f1f1f; --primary-ink: #ffffff; --primary-hover: #000000;
  --red: #bb1827; --red-text: #bb1827; --on-red: #ffffff; --accent: #bb1827; --accent-ink: #ffffff; --focus: #bb1827;
  --good: #1f7a4d; --ok: #8a5a00; --bad: #b3261e; --bad-wash: #fbeced; --ok-wash: #fbf3e2;
  --s-practice: #4c4c4c; --s-real: #bb1827; --st-eou: #8c8c8c; --st-llm: #bb1827; --st-tts: #1f1f1f; --st-other: #c9c9c9;
  --bar-bg: rgb(255 255 255 / .92); --red-hover: #a5121f; --red-active: #931220; --red-glow: rgb(187 24 39 / .45);
  --good-text: #1f7a4d; --good-wash: #e6f4ec; --bad-line: #e8b4ba;
  --info-text: #1d4f86; --info-wash: #e8f0fa; --warn-text: #7a4f00; --warn-wash: #fbf3e2;
}
.logo-light { display: none; }
:root[data-theme="light"] .logo-dark { display: none; }
:root[data-theme="light"] .logo-light { display: block; }
/* The header carries both logos; only the one for the current theme shows (beats .bar .brand img). */
.bar .brand img.logo-light { display: none; }
:root[data-theme="light"] .bar .brand img.logo-dark { display: none; }
:root[data-theme="light"] .bar .brand img.logo-light { display: block; }
/* Open-air meters (no charcoal plate behind them) draw in ink on light pages; the fourth bar stays red. */
:root[data-theme="light"] .meter.xl i, :root[data-theme="light"] .meter.md i { background: var(--ink); }
:root[data-theme="light"] .meter.xl i:nth-child(4), :root[data-theme="light"] .meter.md i:nth-child(4) { background: var(--red); }

/* Gallery visuals (v2-visuals): kicker, breathing sound wave, fact chips, a line drawing per demo, and the how-it-works strip.
   Drawings are currentColor in muted grey with one red detail (.r fill, .rs stroke), so both themes work. */
.gallery-intro .kicker { color: var(--red-text); margin-bottom: var(--s3); }
.hero-wave { width: 100%; max-width: 360px; aspect-ratio: 640 / 300; height: auto; display: block; margin: var(--s5) 0 var(--s4); }
.gallery-intro .facts { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4); }
.gallery-intro .facts span { font: 600 var(--t-label)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line); border-radius: var(--r-plate); padding: 7px 9px; }
.gallery .demo { grid-template-columns: 76px 1fr auto; }
.gallery .demo .art { width: 76px; height: 76px; border-radius: var(--r-control); background: var(--panel); border: 1px solid var(--line); color: var(--muted); display: grid; place-items: center; }
.gallery .demo .art svg { width: 62%; height: 62%; }
.gallery .r, .how .r { fill: var(--red); } .gallery .rs, .how .rs { stroke: var(--red); }
/* .how sits after the .gallery grid (not inside it), so the sticky .gallery-intro can never overlap it. */
.how { list-style: none; counter-reset: how; margin: var(--s7) 0 0; padding: var(--s5) 0 0; border-top: 1px solid var(--line-strong);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.how li { counter-increment: how; display: grid; gap: var(--s2); align-content: start; padding: 0 var(--s4); color: var(--muted); font-size: var(--t-sm); }
.how li:first-child { padding-left: 0; }
.how li + li { border-left: 1px dashed var(--line); }
.how li::before { content: "STEP " counter(how); font: 600 var(--t-label)/1 var(--mono); letter-spacing: .08em; color: var(--red-text); }
.how svg { width: 40px; height: 40px; color: var(--muted); }
.how b { color: var(--ink); font-size: var(--t-base); }
@media (max-width: 900px) {
  .how { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s5); }
  .how li:nth-child(3) { border-left: 0; padding-left: 0; }
}
@media (max-width: 640px) {
  .hero-wave { max-width: 220px; margin: var(--s2) 0 var(--s3); }
  .gallery .demo { grid-template-columns: 56px 1fr; }
  .gallery .demo .art { width: 56px; height: 56px; grid-row: span 1; }
  .gallery .demo > button { grid-column: 1 / -1; }
  .how { grid-template-columns: 1fr; }
  .how li, .how li:nth-child(3), .how li + li { border-left: 0; padding: 0; }
  .how li + li, .how li:nth-child(3) { border-top: 1px dashed var(--line); padding-top: var(--s4); }
  .how { row-gap: var(--s4); }
}
@media (prefers-reduced-motion: reduce) { .hero-wave { animation: none; } }

/* Demo page: the owner's after-call text (demos/summary.py), styled like a text message. */
.ownerText { margin-top: var(--s4); border: 1px solid var(--line); border-radius: 14px; padding: var(--s3) var(--s4); text-align: left; }
.ownerText .ownerHead { font: 600 var(--t-label)/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ownerText pre { margin: var(--s2) 0; white-space: pre-wrap; word-break: break-word; font: inherit; color: var(--ink); }
.ownerText .ownerFoot { font-size: var(--t-label); color: var(--muted); }
