/* VoxCross Caller — design system
 * White, flat, hairline structure, one blue (the VoxCross brand). No glows, no gradients.
 * Type: Figtree for everything, Archivo for the line you say and for titles.
 * Scale: 12 · 13 · 15 · 18 · 24 · 36 px. Spacing on an 8 px grid.
 * Color is for state only: green = live / done, amber = waiting, red = hang up / stop.
 * Motion: none on keyboard actions; card changes ≤160 ms.
 */
:root {
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #f3f5f8; --surface-3: #e9edf3;
  --line: #e4e7ee; --line-2: #d2d7e1; --line-3: #b7bfcc;
  --fg: #0d121b; --fg2: #465063; --fg3: #667185; --fg4: #a2aab9;
  --brand: #2b66f5; --brand-ink: #1c4fd1; --brand-soft: #eaf0fe; --on-brand: #ffffff;
  --good: #0c7d56; --good-soft: #e2f4ec; --good-line: #a5dcc5;
  --warn: #9a5b00; --warn-soft: #fdf1dc; --warn-line: #ecd09a;
  --bad: #c2332a; --bad-soft: #fdeceb; --bad-line: #efb9b4;
  --practice: #6a48d7; --practice-soft: #efeafd;
  --mode: var(--brand); --modeA: var(--brand-soft);

  /* names the dialer scripts use inline */
  --panel: var(--surface); --panel2: var(--surface-2); --panel3: var(--surface-3); --bg2: var(--surface-2);
  --line2: var(--line-2); --line3: var(--line-3);
  --sig: var(--good); --sig2: var(--brand-ink); --sigA: var(--good-soft); --sigB: var(--good-line);
  --amber: var(--warn); --amberA: var(--warn-soft); --red: var(--bad); --redA: var(--bad-soft);
  --cyan: var(--brand-ink); --cyanA: var(--brand-soft);

  --display: "Archivo", "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: var(--body);
  --r: 10px; --r-sm: 6px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --gap: 16px;
}
body.practice { --mode: var(--practice); --modeA: var(--practice-soft); }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg); font: 400 13px/1.5 var(--body); overflow: hidden;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-ink); }
mark { background: none; color: inherit; font-weight: 600; }
kbd { font: 600 12px/1 var(--body); border: 1px solid var(--line-2); border-radius: 4px; padding: 2px 5px;
  background: var(--surface-2); color: var(--fg2); white-space: nowrap; }
.mono { font-family: var(--body); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.small { font-size: 12px; }
[hidden] { display: none !important; }
.spacer { flex: 1; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
button:focus:not(:focus-visible), input:focus:not(:focus-visible) { outline: none; }

/* ---------------- app shell ---------------- */
#app { height: 100vh; display: grid; grid-template-rows: auto minmax(0, 1fr); }

.topbar { display: grid; align-items: center; gap: 24px; grid-template-columns: auto auto minmax(0, 1fr);
  background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 24px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 18px/1 var(--display); letter-spacing: -.01em; white-space: nowrap; }
.brand svg { width: 24px; height: 24px; }
.brand .lg-d { fill: #0b1633; } .brand .lg-b { fill: var(--brand); }
.brand span { font-weight: 500; color: var(--fg3); }

.nav { display: flex; gap: 4px; min-width: 0; height: 100%; }
.nav button { border: 0; background: transparent; color: var(--fg2); cursor: pointer; padding: 0 12px; height: 100%;
  font: 600 13px/1 var(--body); white-space: nowrap; position: relative; }
.nav button[aria-current="page"] { color: var(--fg); }
.nav button[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--brand); }
@media (hover: hover) and (pointer: fine) { .nav button:hover { color: var(--fg); } }

.clocks { display: flex; align-items: center; justify-content: flex-end; gap: 24px; min-width: 0; }
.dialclock, .clock, .usermenu { flex: none; }
.phone-pill { min-width: 0; }
.phone-pill .pd-state { min-width: 0; }
.phone-pill .btn { flex: none; }
.clock, .dialclock .dc-txt { display: flex; flex-direction: column; line-height: 1.2; }
.clock small, .dialclock small { font: 500 12px/1.3 var(--body); color: var(--fg3); }
.clock b, .dialclock b { font: 600 15px/1.3 var(--body); }
.dialclock { display: flex; align-items: center; gap: 8px; }
.dialclock svg { width: 28px; height: 28px; transform: rotate(-90deg); flex: none; }
.dialclock .track { fill: none; stroke: var(--line); stroke-width: 4; }
.dialclock .prog { fill: none; stroke: var(--fg4); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .6s linear; }
.dialclock.running .prog { stroke: var(--mode); }
.dialclock.break .prog { stroke: var(--warn); }
.dialclock em { display: none; }
/* Connection: silent while it works; a plain sentence when it does not. No orphan dot. */
.conn { display: none; align-items: center; gap: 8px; font: 600 12px/1 var(--body); color: var(--bad); background: var(--bad-soft);
  padding: 7px 10px; border-radius: 999px; white-space: nowrap; }
.conn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.conn.bad { display: inline-flex; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2); background: var(--surface);
  color: var(--fg); border-radius: var(--r-sm); padding: 0 14px; height: 36px; cursor: pointer;
  font: 600 13px/1 var(--body); white-space: nowrap; transition: border-color .12s ease, background-color .12s ease; }
@media (hover: hover) and (pointer: fine) { .btn:hover { border-color: var(--line-3); background: var(--surface-2); } }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
@media (hover: hover) and (pointer: fine) { .btn.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); } }
.btn.small { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.small kbd { margin-left: -2px; }
.btn.danger { color: var(--bad); border-color: var(--bad-line); }
.btn.on { background: var(--mode); border-color: var(--mode); color: var(--on-brand); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
/* Start is solid blue; while dialing it becomes a quiet Pause */
#arm { min-width: 96px; }
body.practice #arm { background: var(--practice); border-color: var(--practice); }
body.armed #arm { background: var(--surface); border-color: var(--line-2); color: var(--fg); filter: none; }
#auto { display: none; }
body.practice #auto { display: inline-flex; }
body.practice.auto-on #auto { background: var(--practice-soft); border-color: var(--practice); color: var(--practice); }
#pd-hangup, #pd-hangup-pill { background: var(--bad); border-color: var(--bad); color: #fff; }

/* phone line status */
.phone-pill { display: flex; align-items: center; gap: 8px; font: 600 13px/1 var(--body); color: var(--fg2); white-space: nowrap; }
.phone-pill .pd-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); flex: 0 0 auto; }
.phone-pill.on .pd-dot { background: var(--good); }
.phone-pill.on .pd-state { color: var(--fg); }
.phone-dock { position: fixed; right: 0; bottom: 0; z-index: 95; width: 1000px; height: 2px; overflow: hidden; opacity: .02; pointer-events: none; }
.phone-dock .pd-bar { display: none; align-items: center; gap: 12px; padding: 12px 16px; font: 600 13px/1 var(--body);
  color: var(--fg); background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 6; }
.phone-dock iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; position: relative; z-index: 1; }
.phone-dock.open { left: 50%; top: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%);
  width: min(1180px, calc(100vw - 32px)); height: min(760px, calc(100vh - 32px)); opacity: 1; pointer-events: auto;
  display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface);
  box-shadow: 0 24px 64px rgba(13, 18, 27, .22); overflow: hidden; }
.phone-dock.open .pd-bar { display: flex; }
.phone-dock.open iframe { flex: 1; min-height: 0; }

/* ---------------- views ---------------- */
.view { min-height: 0; padding: var(--gap) 24px; }
.view:not(.active) { display: none; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px;
  min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.ph { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; min-height: 18px; }
.ph h3 { margin: 0; font: 600 12px/1.5 var(--body); color: var(--fg3); }
.ph .code { font: 500 12px/1.5 var(--body); color: var(--fg3); }
.ph .code.on { color: var(--good); }
.scroll { overflow: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.muted { color: var(--fg3); }
.empty { color: var(--fg3); font-size: 13px; text-align: center; padding: 24px 8px; line-height: 1.7; }

/* ---------------- dialer ---------------- */
#view-dialer.active { display: grid; gap: var(--gap); height: 100%;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr) minmax(280px, 340px);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "deck deck deck" "prac prac prac" "left center right" "keys keys keys"; }
body:not(.practice) #view-dialer.active { grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "deck deck deck" "left center right" "keys keys keys"; }

/* deck: mode · start · state · today */
.deck { grid-area: deck; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.modes { display: inline-flex; background: var(--surface-3); border-radius: 8px; padding: 3px; gap: 2px; }
.modes button { border: 0; background: transparent; color: var(--fg2); height: 30px; padding: 0 14px; border-radius: 6px;
  font: 600 13px/1 var(--body); cursor: pointer; white-space: nowrap; }
.modes button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 0 0 1px var(--line-2); }
body.practice .modes button[aria-pressed="true"] { color: var(--practice); }
.call-state { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 999px;
  background: var(--surface-3); color: var(--fg2); font: 600 12px/1 var(--body); white-space: nowrap; }
.call-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--fg4); }
.call-state b { font-weight: 600; }
body[data-call="ready"] .call-state { background: var(--modeA); color: var(--mode); }
body[data-call="ready"] .call-state i { background: var(--mode); }
body[data-call="ringing"] .call-state { background: var(--warn-soft); color: var(--warn); }
body[data-call="ringing"] .call-state i { background: var(--warn); }
body[data-call="live"] .call-state { background: var(--good-soft); color: var(--good); }
body[data-call="live"] .call-state i { background: var(--good); }

.today { display: flex; align-items: center; gap: 24px; }
.tstat { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.tstat b { font: 600 18px/1 var(--body); }
.tstat small { font: 500 12px/1 var(--body); color: var(--fg3); }
.tstat.win b { color: var(--good); }
.tgoal { display: flex; flex-direction: column; gap: 6px; min-width: 96px; }
.tgoal b { font: 500 12px/1 var(--body); color: var(--fg3); text-align: right; }
.tgoal .bar, .kpi .bar { height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.tgoal .bar i, .kpi .bar i { display: block; height: 100%; width: 100%; background: var(--mode); transform-origin: left; transform: scaleX(0);
  transition: transform .5s var(--ease-out); }

.practice-bar { grid-area: prac; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--practice-soft); border-radius: var(--r); padding: 8px 12px; }
body:not(.practice) .practice-bar { display: none; }
.pb-note { font: 600 13px/1.3 var(--body); color: var(--practice); margin-right: 4px; }
  cursor: pointer; text-align: left; line-height: 1.3; }
#prac-hud { font: 500 13px/1.3 var(--body); color: var(--practice); letter-spacing: 0; margin-left: auto; }
.prac-reveal { color: var(--fg2); font-style: italic; margin: 4px 0 8px; }
.report-fixes { margin: 4px 0 10px 18px; padding: 0; }
.report-fixes li { margin: 3px 0; }
[data-prac-retry] { margin-top: 4px; }
#practice-input input { font-size: 16px; }
.ph-pat { color: var(--bad); } .ph-int { color: var(--good); }

.col { display: flex; flex-direction: column; gap: var(--gap); min-height: 0; }
.left { grid-area: left; } .right { grid-area: right; }

/* prospect */
#lead { flex: 1 1 auto; }
.lead-firm { font: 700 24px/1.15 var(--display); letter-spacing: -.01em; text-wrap: balance; }
.lead-person { color: var(--fg2); margin-top: 8px; font-size: 13px; }
.lead-person b { color: var(--fg); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { font: 500 12px/1 var(--body); padding: 5px 8px; border-radius: 999px; color: var(--fg2); background: var(--surface-3); white-space: nowrap; }
.chip.sig { color: var(--good); background: var(--good-soft); } .chip.amber { color: var(--warn); background: var(--warn-soft); }
.chip.red { color: var(--bad); background: var(--bad-soft); } .chip.cyan { color: var(--brand-ink); background: var(--brand-soft); }
.lead-time { display: flex; align-items: baseline; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.lead-time b { font: 600 24px/1 var(--body); letter-spacing: -.01em; }
.lead-time span { color: var(--fg3); font-size: 13px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 16px 0 0; font-size: 13px; }
.facts dt { color: var(--fg3); font: 500 12px/1.6 var(--body); }
.facts dd { margin: 0; color: var(--fg2); min-width: 0; overflow-wrap: anywhere; }
.upnext { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--fg3); line-height: 1.6; }
.upnext b { color: var(--fg); font-weight: 600; }
.upnext .why { color: var(--brand-ink); }
#lead .empty { text-align: left; padding: 0; }

/* callbacks */
.cb-item { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.cb-item:last-child { border-bottom: 0; }
.cb-item time { font: 600 13px/1.5 var(--body); color: var(--fg2); }
.cb-item .who { color: var(--fg); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-item .sub { grid-column: 2; color: var(--fg3); font-size: 12px; }
.cb-item.due time { color: var(--warn); }

/* ---------------- the card: what to say ---------------- */
.center { grid-area: center; position: relative; display: flex; flex-direction: column; min-height: 0; }
.coach { flex: 1; position: relative; display: flex; flex-direction: column; min-height: 0; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 32px 40px 24px;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; --kc: var(--brand-ink); --kcA: var(--brand-soft); }
.coach.kind-script, .coach.kind-gatekeeper, .coach.kind-voicemail, .coach.kind-info { --kc: var(--brand-ink); --kcA: var(--brand-soft); }
.coach.kind-objection { --kc: var(--warn); --kcA: var(--warn-soft); }
.coach.kind-warn, .coach.kind-dnc { --kc: var(--bad); --kcA: var(--bad-soft); }
.coach.kind-won { --kc: var(--good); --kcA: var(--good-soft); border-color: var(--good-line); }
.coach.kind-hold, .coach.kind-idle, .coach.kind-report { --kc: var(--fg2); --kcA: var(--surface-3); }
.chead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.cchip { font: 600 12px/1 var(--body); color: var(--kc); background: var(--kcA); padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.cconf { font: 500 12px/1 var(--body); color: var(--warn); background: var(--warn-soft); padding: 6px 10px; border-radius: 999px; }
.cheard { margin-left: auto; font-size: 13px; color: var(--fg2); font-style: italic; max-width: 60%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cscore { font: 700 24px/1 var(--body); color: var(--fg); } .cscore small { font-size: 13px; color: var(--fg3); }
.cbody { margin: 24px 0 16px; }
.csay { margin: 0; font: 600 36px/1.22 var(--display); letter-spacing: -.02em; text-wrap: pretty; color: var(--fg); }
.coach.long .csay { font-size: 24px; line-height: 1.32; letter-spacing: -.01em; }
.coach.kind-hold .csay { color: var(--fg3); }
.csay mark, .ces mark, .cask mark, .crep mark { background: none; color: var(--brand-ink); font-weight: inherit; }
.ces { margin: 12px 0 0; font-size: 15px; line-height: 1.5; color: var(--fg3); text-wrap: pretty; }
/* reading marks: ↑ voice up · [4s] silence · [smile] · [slow] · CAPS louder */
.mk { display: inline-block; vertical-align: .22em; margin: 0 .2em; padding: 4px 8px; border-radius: 999px;
  font: 600 12px/1 var(--body); letter-spacing: 0; white-space: nowrap; }
.mk-wait { color: var(--warn); background: var(--warn-soft); }
.mk-smile { color: var(--good); background: var(--good-soft); }
.mk-tone { color: var(--brand-ink); background: var(--brand-soft); }
.mk-do { color: var(--fg2); background: var(--surface-3); }
.mk-up { color: var(--brand); background: none; padding: 0; font: 700 .8em/1 var(--display); vertical-align: 0; margin: 0 .06em; }
.mk-uhm { color: var(--fg3); background: none; padding: 0; font: 500 italic .62em/1.1 var(--body); vertical-align: .1em; }
.ces .mk, .cask .mk, .crep .mk, .ctone .mk, .v .mk { vertical-align: .05em; }
.ces .mk-up, .cask .mk-up, .crep .mk-up, .v .mk-up { font-size: 1em; }
b.caps { font-weight: 700; color: var(--fg); }
.ces b.caps { color: var(--fg2); }
.v .then { color: var(--fg3); }
.flag { display: inline-block; font: 600 12px/1 var(--body); color: var(--fg3); background: var(--surface-3);
  border-radius: 4px; padding: 3px 6px; margin-right: 8px; vertical-align: 2px; }
.cask, .crep { margin-top: 24px; padding: 16px 20px; border-radius: 8px; background: var(--surface-2); }
.cask p, .crep p { margin: 0; font-size: 18px; line-height: 1.42; }
.crep p[lang="en"] { color: var(--fg2); }
.cask .ces, .crep .ces { font-size: 13px; margin-top: 8px; }
.ck { display: block; font: 600 12px/1 var(--body); color: var(--fg3); margin-bottom: 8px; }
.cfoot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.ctone { font: 500 12px/1.5 var(--body); color: var(--fg3); }
.cwhy { font-size: 13px; line-height: 1.6; color: var(--fg2); }
.cnext { font-size: 12px; color: var(--fg3); }
.cafter { font-size: 13px; color: var(--fg2); }
.report-title { font-size: 24px !important; line-height: 1.25 !important; }
.report-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.report-list li { display: flex; gap: 10px; align-items: baseline; font-size: 15px; color: var(--fg2); }
.report-list li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--fg4); transform: translateY(-1px); }
.report-list li.good::before { background: var(--good); }
.report-list li.bad::before { background: var(--bad); }
.report-list li.star { color: var(--good); font-weight: 600; } .report-list li.star::before { background: var(--good); }

@keyframes cardIn { from { opacity: .6; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.coach .cbody { animation: cardIn .14s var(--ease-out); }

.callbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; row-gap: 12px; margin-top: var(--gap); padding: 12px 16px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.timer { font: 600 24px/1 var(--body); color: var(--fg3); min-width: 76px; }
.timer.guard { color: var(--warn); }
.timer.safe { color: var(--good); }
.timer.lock { color: var(--warn); }
.guardtxt { font-size: 12px; white-space: nowrap; }
#guard-ring { color: var(--warn); font-weight: 600; }
.callbar .cid { font: 500 12px/1.4 var(--body); color: var(--fg3); min-width: 0; flex: 1 1 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.callbar .cid b { color: var(--fg2); font-weight: 600; }
.callbar .bg { font: 500 12px/1.3 var(--body); color: var(--warn); background: var(--warn-soft); padding: 5px 10px; border-radius: 999px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.callbar .bg em { font-style: normal; font-weight: 600; }
.speed { font: 500 13px/1.4 var(--body); color: var(--fg2); }
.speed b { color: var(--fg); font-weight: 600; }
#mic { display: flex; align-items: center; gap: 6px; font: 500 12px/1 var(--body); color: var(--fg3); }
#mic .wave { width: 3px; height: 8px; background: var(--fg4); border-radius: 2px; display: inline-block; }
#mic.on { color: var(--good); }
#mic.on .wave { background: var(--good); animation: wv .9s ease-in-out infinite; }
#mic.on .wave:nth-child(2) { animation-delay: .15s; } #mic.on .wave:nth-child(3) { animation-delay: .3s; }
@keyframes wv { 0%, 100% { transform: scaleY(.6); } 50% { transform: scaleY(1.7); } }
.book-btn { }
body.book-open .book-btn { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
/* Back / Yes / No / Next / I'm lost — steer the card by hand when speech recognition misses */
.steer { order: 10; flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding-top: 12px; border-top: 1px solid var(--line); }
.steer button { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); color: var(--fg); font: 500 13px/1 var(--body); cursor: pointer; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .steer button:hover { background: var(--surface-2); border-color: var(--line-3); } }
.steer button.flash { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.steer button.flash kbd { background: transparent; border-color: transparent; color: var(--on-brand); }

#coach-next { position: absolute; left: 50%; bottom: 132px; transform: translateX(-50%); z-index: 7;
  background: var(--fg); color: var(--surface); border-radius: 999px; padding: 8px 14px; font: 600 12px/1 var(--body);
  pointer-events: none; white-space: nowrap; }
#autobar { position: absolute; left: 24px; right: 24px; bottom: 128px; z-index: 8; background: var(--surface);
  border: 1px solid var(--warn-line); border-radius: var(--r); padding: 12px 16px; box-shadow: 0 8px 24px rgba(13, 18, 27, .1); }
.ab-txt { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.ab-txt b { font: 700 24px/1 var(--body); color: var(--warn); min-width: 28px; text-align: center; }
.ab-txt span { flex: 1; }
.ab-track { height: 4px; background: var(--surface-3); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.ab-track i { display: block; height: 100%; background: var(--warn); transform-origin: left; transform: scaleX(0); }

/* all objections (F7) */
#card { position: absolute; inset: 0; z-index: 6; display: none; flex-direction: column; gap: 16px; padding: 24px 32px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); overflow: auto; }
#card.show { display: flex; }
#card .step { padding: 0 0 16px; border-bottom: 1px solid var(--line); }
#card .k { font: 600 12px/1.4 var(--body); color: var(--warn); }
#card .v { font-size: 15px; line-height: 1.5; margin-top: 4px; }
#card .v.es { color: var(--fg3); font-size: 13px; }

/* preflight: what has to be true before Start */
.preflight { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: var(--gap); font: 500 12px/1.3 var(--body); color: var(--fg3); }
.preflight .pf-title { font-weight: 600; color: var(--fg2); margin-inline-end: 4px; }
.preflight .pf { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--fg2); white-space: nowrap; }
.preflight .pf i { width: 8px; height: 8px; border-radius: 50%; background: var(--fg4); }
.preflight .pf b { color: var(--fg); font-weight: 600; }
.preflight .pf.ok i { background: var(--good); }
.preflight .pf.no { border-color: var(--bad-line); background: var(--bad-soft); } .preflight .pf.no i { background: var(--bad); }
.preflight .pf.warn { border-color: var(--warn-line); background: var(--warn-soft); } .preflight .pf.warn i { background: var(--warn); }

/* transcript */
#transcript { flex: 1 1 auto; }
#turns { display: flex; flex-direction: column; gap: 12px; }
.turn { line-height: 1.5; }
.turn .who { font: 600 12px/1.3 var(--body); color: var(--fg3); margin-bottom: 2px; }
.turn.lead .who { color: var(--brand-ink); }
.turn.lead .txt { font-size: 15px; color: var(--fg); }
.turn.agent .txt { font-size: 13px; color: var(--fg2); }
.turn.partial .txt { opacity: .55; font-style: italic; }
.turn.fixed .who::after { content: " · corrected"; font-weight: 500; color: var(--fg4); }
#practice-input { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
#practice-input .hint { font-size: 12px; color: var(--fg3); margin-bottom: 6px; }
input.field, textarea.field, select.field, #practice-input input {
  width: 100%; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 8px 12px; color: var(--fg); font-size: 13px; }
input.field::placeholder, textarea.field::placeholder { color: var(--fg4); }
input.field:focus, textarea.field:focus, select.field:focus, #practice-input input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.field { resize: vertical; min-height: 72px; line-height: 1.5; }
.notebox { display: flex; flex-direction: column; gap: 6px; }

/* outcome keys */
.keys { grid-area: keys; display: flex; gap: 8px; flex-wrap: wrap; }
.key { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--line-2); background: var(--surface);
  border-radius: var(--r-sm); cursor: pointer; color: var(--fg); font: 500 13px/1 var(--body); white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .key:hover { background: var(--surface-2); border-color: var(--line-3); } }
.key.flash { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.key.flash kbd { background: transparent; border-color: transparent; color: var(--on-brand); }
body:not(.armed) .key.dial, .key.off { color: var(--fg4); }
body:not(.armed) .key.dial kbd, .key.off kbd { color: var(--fg4); }
#key-F7 { margin-left: auto; }
#key-F9 { font-weight: 600; }
#key-F10 { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 600; }
#key-F10 kbd { background: rgba(255, 255, 255, .16); border-color: transparent; color: #fff; }
#key-F8 { color: var(--bad); }

/* ---------------- Day and line sheet ---------------- */
.sheet { position: fixed; top: 56px; right: 0; bottom: 0; z-index: 80; width: min(420px, 100vw); display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--line-2); box-shadow: -16px 0 48px rgba(13, 18, 27, .1); }
.sh-head { display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--line); font: 700 18px/1.2 var(--display); }
.sh-body { padding: 24px; display: flex; flex-direction: column; gap: 32px; }
.goal { display: flex; align-items: center; gap: 16px; }
.goal svg { width: 56px; height: 56px; transform: rotate(-90deg); flex: none; }
.goal .track { fill: none; stroke: var(--surface-3); stroke-width: 5; }
.goal .prog { fill: none; stroke: var(--brand); stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease-out); }
.kpi-strip { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.kpi { min-width: 0; }
.kpi small { display: block; font: 500 12px/1.3 var(--body); color: var(--fg3); }
.kpi b { display: block; font: 600 18px/1.3 var(--body); }
.kpi.win b { color: var(--good); }
.kpi em { display: block; font: 400 12px/1.3 var(--body); font-style: normal; color: var(--fg3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; }
.sh-facts dt { color: var(--fg3); font-size: 12px; line-height: 1.6; } .sh-facts dd { margin: 0; color: var(--fg2); }

#zones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.zone { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface); overflow: hidden; }
.zone .zh { display: flex; justify-content: space-between; align-items: baseline; }
.zone b { font: 600 13px/1 var(--body); color: var(--fg); }
.zone .zt { font: 600 13px/1 var(--body); color: var(--fg2); }
.zone i { display: block; height: 4px; margin: 10px 0 8px; background: var(--surface-3); border-radius: 2px; position: relative; overflow: hidden; }
.zone i::after { content: ""; position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--w, 0)); background: var(--zc, var(--fg4)); }
.zone .zl { display: flex; justify-content: space-between; gap: 4px; font: 500 12px/1.2 var(--body); color: var(--fg3); white-space: nowrap; }
.zone.peak { --zc: var(--good); } .zone.good { --zc: var(--brand); } .zone.ok { --zc: var(--warn); } .zone.low { --zc: var(--bad); }
.zone.off { opacity: .5; }
.zone.best { border-color: var(--good-line); background: var(--good-soft); }
#zhint { font-size: 13px; color: var(--fg2); margin-top: 12px; line-height: 1.5; }
#zhint b { color: var(--fg); }

.dids { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.did { position: relative; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface); line-height: 1.4; min-width: 0; }
.did b { font: 600 13px/1.3 var(--body); }
.did span { display: block; font-size: 12px; color: var(--fg3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.did em { font: 400 12px/1.3 var(--body); font-style: normal; color: var(--fg2); }
.did em strong { font-weight: 600; color: var(--fg); }
.did.h-healthy em strong { color: var(--good); } .did.h-watch em strong { color: var(--warn); }
.did.h-rest em strong { color: var(--bad); } .did.h-warming em strong { color: var(--brand-ink); }
.did.active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.did.capped, .did.h-capped { opacity: .6; }
.did.h-rest { border-color: var(--bad-line); background: var(--bad-soft); }
.did small { display: block; font-size: 12px; line-height: 1.3; color: var(--fg3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.did .dact { position: absolute; top: 8px; right: 8px; font: 600 12px/1 var(--body); padding: 5px 8px; border-radius: 4px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--fg2); cursor: pointer; opacity: 0; transition: opacity .12s; }
.did:hover .dact, .did .dact:focus-visible { opacity: 1; }
.hdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: .04em; background: var(--fg4); }
.hdot.h-healthy { background: var(--good); } .hdot.h-watch { background: var(--warn); }
.hdot.h-rest { background: var(--bad); } .hdot.h-capped { background: var(--fg4); } .hdot.h-warming { background: var(--brand); }

/* ---------------- Leads ---------------- */
#view-crm.active { display: grid; gap: var(--gap); height: 100%; grid-template-columns: minmax(360px, 440px) minmax(0, 1fr); }
.search { display: flex; gap: 8px; }
.search .btn.small { height: 36px; }
.pipeline { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.pipeline button { border: 1px solid var(--line-2); background: var(--surface); color: var(--fg2); border-radius: 999px; height: 28px; padding: 0 12px;
  font: 500 12px/1 var(--body); cursor: pointer; display: flex; align-items: center; gap: 6px; }
.pipeline button b { color: var(--fg); font-weight: 600; }
.pipeline button[aria-pressed="true"] { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.pipeline button[aria-pressed="true"] b { color: var(--brand-ink); }
.leadrow { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.leadrow .f { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leadrow .s { grid-column: 1; font-size: 12px; color: var(--fg3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leadrow .st { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.leadrow[aria-selected="true"] { background: var(--brand-soft); }
@media (hover: hover) and (pointer: fine) { .leadrow:not([aria-selected="true"]):hover { background: var(--surface-2); } }
#crm-profile { padding: 24px 32px; }
/* these panels scroll: their blocks keep their own height instead of squeezing into each other */
#crm-profile > *, #day-panel > * { flex-shrink: 0; }
.profile-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.stagebox { margin-left: auto; text-align: right; }
.stagebox .next { font-size: 13px; color: var(--fg2); max-width: 340px; margin-top: 8px; }
.timeline { display: flex; flex-direction: column; }
.tl { padding: 16px 0; border-bottom: 1px solid var(--line); }
.tl:last-child { border-bottom: 0; }
.tl header { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font: 400 12px/1.4 var(--body); color: var(--fg3); }
.tl header b { color: var(--fg); font-weight: 600; font-size: 13px; }
.tl .sum { margin: 8px 0 0; font-size: 13px; line-height: 1.55; color: var(--fg2); }
.tl details { margin-top: 8px; }
.tl summary { cursor: pointer; font: 600 12px/1 var(--body); color: var(--brand-ink); }
.tl .tx { margin-top: 8px; display: grid; gap: 4px; font-size: 13px; max-height: 320px; overflow: auto; }
.tl .tx .l { color: var(--fg); } .tl .tx .a { color: var(--fg3); }
.tl .tx span { font: 600 12px/1 var(--body); margin-right: 6px; }
.notes-list { display: grid; gap: 12px; margin-top: 16px; }
.notes-list div { font-size: 13px; color: var(--fg2); }
.notes-list time { display: block; font: 400 12px/1.4 var(--body); color: var(--fg3); }
.two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; min-height: 0; }
.tag { display: inline-block; font: 600 12px/1 var(--body); padding: 4px 8px; border-radius: 4px; color: var(--fg2); background: var(--surface-3); white-space: nowrap; }
.tag.MTG { color: var(--good); background: var(--good-soft); } .tag.NI, .tag.DNC { color: var(--bad); background: var(--bad-soft); }
.tag.CALLBK { color: var(--warn); background: var(--warn-soft); } .tag.A { color: var(--brand-ink); background: var(--brand-soft); }

/* ---------------- Stats ---------------- */
#view-analytics.active { display: grid; gap: var(--gap); height: 100%; grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); }
#day-panel { padding: 24px 32px; }
.cal-head { display: flex; align-items: center; gap: 8px; }
.cal-head b { flex: 1; text-align: center; font: 700 18px/1 var(--display); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 16px; }
.cal .dow { font: 500 12px/1 var(--body); color: var(--fg3); text-align: center; padding-bottom: 6px; }
.day { aspect-ratio: 1 / 1; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); padding: 6px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between; min-width: 0; position: relative; overflow: hidden; }
.day::before { content: ""; position: absolute; inset: 0; background: var(--brand); opacity: var(--heat, 0); pointer-events: none; }
.day > * { position: relative; }
.day .dn { font: 600 12px/1 var(--body); color: var(--fg); }
.day .dm { font: 400 12px/1.2 var(--body); color: var(--fg2); white-space: nowrap; overflow: hidden; }
.day.mtg .dn::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--good); margin-left: 5px; vertical-align: 1px; }
.day.today { border-color: var(--line-3); }
.day[aria-selected="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.day.pad { visibility: hidden; }
.bigkpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 24px 16px; }
.bk { min-width: 0; }
.bk small { display: block; font: 500 12px/1.3 var(--body); color: var(--fg3); }
.bk b { display: block; font: 600 24px/1.25 var(--body); }
.bk span { font-size: 12px; color: var(--fg3); }
.bk.win b { color: var(--good); }
.hours { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 4px; align-items: end; height: 132px; margin-top: 8px; }
.hour { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 1px; }
.hour i { display: block; border-radius: 2px 2px 0 0; background: var(--surface-3); min-height: 2px; }
.hour i.a { background: var(--brand); border-radius: 0; }
.hour span { font: 400 12px/1 var(--body); color: var(--fg3); text-align: center; margin-top: 6px; }
.objbars { display: grid; gap: 12px; }
.objbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; font-size: 13px; }
.objbar .mono { font-size: 12px; }
.objbar .t { height: 4px; grid-column: 1 / -1; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.objbar .t i { display: block; height: 100%; background: var(--warn); transform-origin: left; }
table.calls { width: 100%; border-collapse: collapse; font-size: 13px; }
table.calls th { text-align: left; font: 600 12px/1 var(--body); color: var(--fg3); padding: 8px; border-bottom: 1px solid var(--line-2);
  position: sticky; top: 0; background: var(--surface); }
table.calls td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.calls td.m { white-space: nowrap; color: var(--fg2); }
table.calls tr[data-lead] { cursor: pointer; }
@media (hover: hover) and (pointer: fine) { table.calls tr[data-lead]:hover td { background: var(--surface-2); } }

/* ---------------- My setup ---------------- */
#view-studio.active { display: grid; gap: var(--gap); height: 100%; overflow: auto;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); align-content: start; grid-auto-rows: max-content; }
.studio-card { min-height: 280px; overflow: visible; padding: 24px; }
.studio-card .ph h3 { font: 700 18px/1.2 var(--display); color: var(--fg); }
.studio-card p.lead-in { margin: 0 0 16px; color: var(--fg2); font-size: 13px; line-height: 1.55; }
.setup-steps { margin: 0 0 16px; padding-left: 18px; display: grid; gap: 8px; font-size: 13px; color: var(--fg2); line-height: 1.55; }
.setup-steps b { color: var(--fg); font-weight: 600; }
.setup-steps code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); border-radius: 4px; padding: 1px 5px; font-size: 12px; color: var(--fg); }
.meter { position: relative; height: 12px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; width: 100%; transform-origin: left; transform: scaleX(0);
  background: linear-gradient(90deg, var(--good) 0 70%, var(--warn) 70% 88%, var(--bad) 88%); }
.meter .peak { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--fg); left: 0; }
.meter-legend { display: flex; justify-content: space-between; font: 400 12px/1 var(--body); color: var(--fg3); margin-top: 6px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row + .row { margin-top: 16px; }
.row label { font: 500 12px/1.3 var(--body); color: var(--fg3); min-width: 90px; }
.presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
.preset { border: 1px solid var(--line-2); border-radius: 8px; padding: 12px; background: var(--surface); cursor: pointer; text-align: left; }
.preset b { font: 600 13px/1.2 var(--body); } .preset span { display: block; font-size: 12px; color: var(--fg3); margin-top: 4px; line-height: 1.4; }
.preset[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); } .preset[aria-pressed="true"] b { color: var(--brand-ink); }
input[type="range"] { width: 100%; accent-color: var(--brand); }
.gainscale { display: flex; justify-content: space-between; font: 400 12px/1 var(--body); color: var(--fg3); width: 100%; }
.status { font-size: 13px; color: var(--fg2); min-height: 20px; }
.status.bad { color: var(--bad); } .status.good { color: var(--good); }
.ab { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.ab .slot { border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.ab .slot small { font: 500 12px/1 var(--body); color: var(--fg3); display: block; margin-bottom: 8px; }
audio { width: 100%; height: 36px; }
.prompter { border-radius: 8px; padding: 16px 20px; background: var(--surface-2); }
.prompter p { margin: 0; font: 500 18px/1.5 var(--display); }
.prompter p.es { font: 400 13px/1.5 var(--body); color: var(--fg3); margin-top: 8px; }
.rec { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); display: inline-block; }
.recording .rec { animation: recp 1s ease-in-out infinite; }
@keyframes recp { 50% { opacity: .25; } }
.hist { display: grid; gap: 8px; margin-top: 8px; }
.hist div { display: flex; align-items: center; gap: 8px; font: 400 12px/1.2 var(--body); color: var(--fg2); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-grid label { display: flex; flex-direction: column; gap: 6px; font: 600 13px/1.3 var(--body); color: var(--fg); }
.settings-grid label span { font: 400 12px/1.4 var(--body); color: var(--fg3); }
.settings-grid label input.field, .settings-grid label .switch { margin-top: auto; }
.settings-grid label span:not(.switch) { min-height: 32px; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { width: 36px; height: 20px; appearance: none; background: var(--line-2); border-radius: 999px; position: relative; cursor: pointer; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  transition: transform .16s var(--ease-out); }
.switch input:checked { background: var(--brand); } .switch input:checked::after { transform: translateX(16px); }

/* ---------------- modal · toast · book · keypad ---------------- */
.modal { position: fixed; inset: 0; z-index: 95; display: none; place-items: center; background: rgba(13, 18, 27, .36); }
.modal.show { display: grid; }
.modal .box { width: min(620px, 94vw); max-height: 88vh; overflow: auto; background: var(--surface); border-radius: 12px; padding: 24px;
  display: flex; flex-direction: column; gap: 12px; box-shadow: 0 24px 64px rgba(13, 18, 27, .22); }
@keyframes modalIn { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
.modal.show .box { animation: modalIn .16s var(--ease-out); }
.modal h2 { margin: 0; font: 700 18px/1.2 var(--display); }
.cb-opt { display: flex; gap: 12px; align-items: center; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.cb-opt.on { border-color: var(--brand); background: var(--brand-soft); }
.cb-opt small { margin-left: auto; color: var(--fg3); font-size: 12px; }
#toast { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); z-index: 99; background: var(--fg); color: #fff;
  border-radius: 8px; padding: 12px 18px; font-size: 13px; font-weight: 500; opacity: 0; pointer-events: none;
  transition: opacity .16s ease; max-width: min(720px, 90vw); text-align: center; box-shadow: 0 8px 24px rgba(13, 18, 27, .18); }
#toast.show { opacity: 1; } #toast.good { background: var(--good); } #toast.bad { background: var(--bad); }

.book { position: fixed; top: 72px; right: 16px; bottom: 72px; z-index: 85; width: min(560px, calc(100vw - 32px));
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 24px 64px rgba(13, 18, 27, .22); overflow: hidden; }
.book .bk-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); font: 400 13px/1 var(--body); color: var(--fg2); }
.book .bk-head b { font: 700 18px/1 var(--display); color: var(--fg); }
.book .bk-who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.book .bk-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.book .bk-zones { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.book .bk-zones small, .book .bk-email small { display: block; font: 500 12px/1.3 var(--body); color: var(--fg3); }
.book .bk-zones b { font: 600 15px/1.3 var(--body); color: var(--fg); }
.book .bk-label { font: 600 13px/1.2 var(--body); color: var(--fg2); }
.book .bk-slots { display: grid; gap: 8px; }
.book .bk-slot { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--fg); cursor: pointer; font: 600 16px/1.25 var(--body); }
.book .bk-slot kbd { flex: none; }
.book .bk-slot small { display: block; font: 400 12px/1.3 var(--body); color: var(--fg3); }
.book .bk-slot:hover { border-color: var(--brand); }
.book .bk-slot.on { border-color: var(--good); background: var(--good-soft); }
.book .bk-slot.card { box-shadow: inset 3px 0 0 var(--brand); }
.book .bk-more { display: grid; gap: 4px; max-height: 220px; overflow-y: auto; }
.book .bk-more .day { font: 600 12px/1.2 var(--body); color: var(--fg3); margin-top: 6px; }
.book .bk-more .bk-slot { padding: 6px 10px; font: 500 13px/1.3 var(--body); }
.book .bk-email input { width: 100%; font: 500 16px/1.3 var(--body); padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--fg); }
.book .bk-email input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.book .bk-email input.bad { border-color: var(--bad); }
.book .bk-readback { font: 600 20px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; color: var(--fg); word-break: break-all; min-height: 26px; }
.book .bk-actions { display: flex; align-items: center; gap: 12px; }
.book .bk-result { font: 600 14px/1.4 var(--body); }
.book .bk-result.good { color: var(--good); } .book .bk-result.bad { color: var(--bad); }
.keypad { position: fixed; right: 24px; bottom: 96px; z-index: 90; width: 240px; padding: 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 16px 48px rgba(13, 18, 27, .18); }
.keypad[hidden] { display: none; }
.kp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; }
.kp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kp-grid button { height: 48px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--fg);
  font: 600 18px/1 var(--body); cursor: pointer; }
.kp-grid button:active { background: var(--brand-soft); border-color: var(--brand); }
.kp-foot { margin-top: 12px; font-size: 12px; line-height: 1.4; }

/* ---------------- narrower windows ---------------- */
@media (max-width: 1500px) {
  .clock { display: none; }
  .topbar { gap: 16px; padding: 0 16px; }
  .clocks { gap: 16px; }
  .nav button { padding: 0 9px; }
  .nav button[aria-current="page"]::after { left: 9px; right: 9px; }
}
@media (max-width: 1360px) {
  .today { gap: 16px; }
  .coach { padding: 24px 28px 20px; }
}
/* the admin has seven views: below this width they get their own row instead of sliding under the phone line */
@media (min-width: 981px) and (max-width: 1559px) {
  body[data-role="admin"] .topbar { height: auto; grid-template-columns: auto minmax(0, 1fr); padding: 8px 16px 0; row-gap: 4px; }
  body[data-role="admin"] .topbar .nav { grid-column: 1 / -1; order: 4; height: 36px; }
}
@media (min-width: 981px) and (max-width: 1100px) {
  .topbar { height: auto; grid-template-columns: auto minmax(0, 1fr); padding: 8px 16px 0; row-gap: 4px; }
  .topbar .nav { grid-column: 1 / -1; order: 4; height: 36px; }
}
@media (min-width: 981px) and (max-width: 1280px) {
  .keys { gap: 6px; }
  .key { padding: 0 8px; gap: 6px; font-size: 12px; }
}
@media (max-width: 1180px) {
  #view-dialer.active { grid-template-columns: minmax(250px, 290px) minmax(0, 1fr) minmax(240px, 280px); }
  .tgoal { display: none; }
  .csay { font-size: 24px; line-height: 1.3; }
}
/* short windows (laptop with browser chrome): the line to say keeps its room */
@media (min-width: 981px) and (max-height: 820px) {
  .center { overflow-y: auto; }
  .coach { min-height: 200px; padding-top: 16px; padding-bottom: 14px; }
  .preflight { margin-top: 8px; gap: 6px; }
  .preflight .pf { height: 24px; padding: 0 8px; }
  .callbar { margin-top: 8px; padding: 8px 12px; row-gap: 8px; }
  .steer { padding-top: 8px; }
  .steer button { height: 28px; }
}
/* a half-screen browser: one column that scrolls, nothing overlaps */
@media (max-width: 980px) {
  body { overflow: auto; }
  #app { height: auto; min-height: 100vh; }
  .topbar { height: auto; padding: 8px 16px; grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .topbar .nav { grid-column: 1 / -1; order: 4; height: 40px; }
  .dialclock { display: none; }
  .view { padding: 16px; }
  #view-dialer.active, body:not(.practice) #view-dialer.active { height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: none;
    grid-template-areas: "deck" "prac" "center" "left" "right" "keys"; }
  body:not(.practice) #view-dialer.active { grid-template-areas: "deck" "center" "left" "right" "keys"; }
  .center { min-height: 62vh; }
  .col { min-height: auto; }
  #lead-panel, #transcript { min-height: 220px; }
  .keys { position: sticky; bottom: 0; z-index: 20; background: var(--bg); padding: 8px 0; }
  #key-F7 { margin-left: 0; }
  #view-crm.active, #view-analytics.active { height: auto; grid-template-columns: minmax(0, 1fr); }
  .two { grid-template-columns: minmax(0, 1fr); }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .coach .cbody, .modal.show .box { animation: none; }
  #mic.on .wave, .recording .rec { animation: none; }
  .dialclock .prog, .goal .prog, .tgoal .bar i { transition: none; }
}

/* ---------------- v2: roles ---------------- */
.usermenu { display: flex; align-items: center; gap: 10px; }
.um-name { display: flex; flex-direction: column; line-height: 1.2; font: 600 13px/1.2 var(--body); white-space: nowrap; }
.um-name small { font: 500 12px/1.3 var(--body); color: var(--fg3); }
.lock-note { font: 600 12px/1 var(--body); color: var(--practice); background: var(--practice-soft); padding: 7px 10px; border-radius: 999px; white-space: nowrap; }
.modes button:disabled { color: var(--fg4); cursor: not-allowed; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 0; }
.my-stats { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--fg2); height: 26px; padding: 0 10px; border-radius: 6px; font: 600 12px/1 var(--body); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 0 0 1px var(--line-2); }
.keypad.off .kp-grid button { color: var(--fg4); cursor: not-allowed; }
.studio-card .code.on { color: var(--good); } .studio-card .code.bad { color: var(--bad); }
.admin-view.active { display: block; overflow: auto; height: 100%; }

/* ---------------- audit 2026-11-26: boot, loading, focus, states ---------------- */
/* nothing is drawn until the role is known (role.js) */
html.role-pending #app { visibility: hidden; }
#gate { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.gate-box { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 32px 28px; }
.gate-box h1 { margin: 0 0 8px; font: 700 24px/1.2 var(--display); letter-spacing: -.01em; }
.gate-box p { margin: 0 0 24px; color: var(--fg2); font-size: 15px; line-height: 1.5; }
.gate-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gate-actions .btn { height: 44px; padding: 0 20px; font-size: 15px; }

/* loading placeholders: same height as the content that replaces them, so nothing jumps */
.sk { display: block; height: 12px; border-radius: 4px; background: var(--surface-3); }
.sk-block { display: grid; gap: 12px; padding: 4px 0; }
.sk-title { height: 20px; width: 62%; }
.sk-line { width: 100%; } .sk-line.short { width: 46%; }
.sk-say { height: 28px; width: 88%; } .sk-say.short { width: 54%; }
.upnext .sk { margin: 4px 0; }
@media (prefers-reduced-motion: no-preference) {
  .sk { animation: skPulse 1.4s ease-in-out infinite; }
  @keyframes skPulse { 50% { opacity: .55; } }
}

/* idle prospect panel: one short instruction, not three lines of keys */
#lead .empty.idle-lead { margin: auto 0; line-height: 1.6; font-size: 13px; max-width: 34ch; }
#lead .empty.idle-lead b { display: block; font: 600 15px/1.4 var(--body); color: var(--fg); margin-bottom: 4px; }

/* rows that act as buttons: pointer, focus ring inside the panel, pressed feedback */
.cb-item[role="button"], .leadrow[role="button"] { cursor: pointer; }
.cb-item[role="button"]:focus-visible, .leadrow[role="button"]:focus-visible { outline-offset: -2px; border-radius: 6px; }
@media (hover: hover) and (pointer: fine) { .cb-item[role="button"]:hover .who { color: var(--brand-ink); } }
.panel .scroll:focus-visible { outline-offset: -2px; }

/* the mode switch and keys keep a visible ring even on dark fills */
.modes button:focus-visible, .key:focus-visible, .btn:focus-visible, .nav button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn.primary:focus-visible, #pd-hangup-pill:focus-visible, .key.hang:focus-visible { outline-color: var(--fg); }

/* phone line: states read as a sentence, long ones never push the layout */
.phone-pill .pd-state { overflow: hidden; text-overflow: ellipsis; max-width: 34ch; }
.usermenu { padding-left: 16px; border-left: 1px solid var(--line); }
.tag.NEW { color: var(--fg2); background: var(--surface-3); }
.lock-note { line-height: 1.3; }
#toast { max-width: min(560px, calc(100vw - 24px)); text-align: center; line-height: 1.4; }
.cb-opt { width: 100%; background: var(--surface); color: var(--fg); font: inherit; text-align: left; }
.cb-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cb-actions .cb-keys { margin-left: auto; }

/* calling hours board (admin and callers) */
.hoursbar { margin-top: var(--gap); padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  font: 500 13px/1.4 var(--body); color: var(--fg2); }
.hoursbar .hb-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; color: var(--fg); }
.hoursbar .hb-n { font: 700 26px/1 var(--display); color: var(--good); font-variant-numeric: tabular-nums; }
.hoursbar .hb-n.off { color: var(--fg4); }
.hoursbar .hb-zones { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hoursbar .hb-z { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hoursbar .hb-z b { color: var(--fg); font-weight: 600; }
.hoursbar .hb-z.on { border-color: var(--good-line); background: var(--good-soft); color: var(--fg); }
.hoursbar .hb-z.off { color: var(--fg3); }
.hoursbar .hb-chart { display: flex; align-items: flex-end; gap: 4px; height: 64px; margin-top: 12px; }
.hoursbar .hb-bar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.hoursbar .hb-bar i { display: block; width: 100%; height: calc(var(--h) * 44px + 2px); border-radius: 3px 3px 0 0; background: var(--good-line); }
.hoursbar .hb-bar.now i { background: var(--good); }
.hoursbar .hb-bar.zero i { background: var(--line); }
.hoursbar .hb-bar em { font: 500 10px/1 var(--body); color: var(--fg3); font-style: normal; font-variant-numeric: tabular-nums; }
.hoursbar .hb-bar.now em { color: var(--fg); font-weight: 600; }
.hoursbar .hb-foot { margin-top: 8px; font-size: 11px; color: var(--fg3); }

/* 2-dic-2026: aviso si la rotacion de numeros se detiene */
#rot.bad { color: #b42318; font-weight: 600; }
