:root {
  color-scheme: light dark;
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --ink: #172230;
  --muted: #5c6a79;
  --line: #d9e0e8;
  --accent: #2153d0;
  --accent-ink: #ffffff;
  --say-bg: #e8effe;
  --amber: #a85507;
  --amber-bg: #fff2df;
  --good: #11744d;
  --good-bg: #e2f4ec;
  --bad: #b3261e;
  --bad-bg: #fdeceb;
  --side: #14202d;
  --side-ink: #d7e1ec;
  --side-muted: #8b9bb0;
  --side-active: #22344a;
  --radius: 10px;
  --radius-l: 14px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e151e; --surface: #16202c; --surface-2: #1c2836; --ink: #e5ecf4; --muted: #8d9db0; --line: #273546;
    --accent: #7aa2ff; --accent-ink: #0b1630; --say-bg: #17284a; --amber: #f2a54c; --amber-bg: #2e2110;
    --good: #5fd3a2; --good-bg: #12302a; --bad: #ff8b82; --bad-bg: #36191a;
    --side: #0a1017; --side-active: #1a2736;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-wrap: anywhere; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
h1 { font-size: 24px; letter-spacing: -.015em; }
h2 { font-size: 17px; }
h3 { font-size: 14.5px; }
p { margin: 0; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small-text { font-size: 12.5px; }
.error-text { color: var(--bad); }
.warn-text { color: var(--amber); }
.good-text { color: var(--good); }

button, .btn {
  font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 7px 13px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; white-space: nowrap;
}
button:hover, .btn:hover { border-color: var(--muted); }
button:disabled { opacity: .5; cursor: default; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
button.primary:hover { filter: brightness(1.07); }
button.ghost, .btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover, .btn.ghost:hover { color: var(--ink); background: var(--surface-2); }
button.small, .btn.small { padding: 3px 9px; font-size: 12.5px; }
button.danger { color: var(--bad); }
button.link { border: 0; background: none; color: var(--accent); padding: 2px; }
button.link:hover { text-decoration: underline; }
button.big { padding: 11px 16px; font-size: 15px; }

input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=url], select, textarea {
  font: inherit; width: 100%; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
}
textarea { resize: vertical; line-height: 1.5; }
textarea.code { font: 12.5px/1.55 var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.field { display: grid; gap: 5px; }
.label { font-weight: 600; font-size: 13px; }
.hint { color: var(--muted); font-size: 12.5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 3px; }
.stack { display: grid; gap: 12px; align-content: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 18px; display: grid; gap: 12px; align-content: start; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.mid, .pill.warm { background: var(--amber-bg); color: var(--amber); }
.pill.hot { background: var(--bad-bg); color: var(--bad); }
.pill.cold, .pill.info { background: var(--say-bg); color: var(--accent); }
.box-chip { display: inline-flex; gap: 4px; align-items: center; padding: 1px 8px; border-radius: 6px; font-size: 12px; border: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.box-chip b { font-weight: 600; color: var(--muted); font-size: 11px; }

.notice { padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.notice.warn { background: var(--amber-bg); }
.notice.error { background: var(--bad-bg); color: var(--bad); }
.notice.good { background: var(--good-bg); color: var(--good); }
.empty { border: 1px dashed var(--line); border-radius: var(--radius-l); padding: 28px 20px; text-align: center; display: grid; gap: 6px; justify-items: center; }
.progress { height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 30%; background: var(--accent); animation: indet 1.3s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(330%); } }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 16px 12px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; padding: 2px 6px; }
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.ws-switch { background: var(--side-active); color: var(--side-ink); border-color: transparent; font-weight: 600; }
.ws-role { font-size: 12px; color: var(--side-muted); padding: 0 6px; margin-top: -8px; }
.nav { display: grid; gap: 2px; }
.nav a { color: var(--side-ink); text-decoration: none; padding: 8px 10px; border-radius: 8px; display: flex; align-items: center; gap: 10px; font-weight: 500; }
.nav a:hover { background: var(--side-active); }
.nav a[aria-current="page"] { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 #7aa2ff; }
.nav svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.nav-sep { height: 1px; background: var(--side-active); margin: 4px 6px; }
.side-foot { margin-top: auto; display: grid; gap: 6px; font-size: 12.5px; color: var(--side-muted); padding: 0 6px; }
.side-foot button { background: none; border: 0; color: var(--side-muted); padding: 0; justify-content: flex-start; }
.side-foot button:hover { color: var(--side-ink); }
.mock-flag { font-size: 11.5px; background: #3a2c10; color: #f2c37a; border-radius: 6px; padding: 4px 8px; }
.main { padding: 26px clamp(16px, 3.5vw, 44px) 60px; min-width: 0; }
.page { display: grid; gap: 16px; max-width: 1180px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; display: grid; gap: 14px; }
.auth-card .brand { color: var(--ink); padding: 0; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.segmented label { position: relative; }
.segmented input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; text-align: center; padding: 6px 8px; border-radius: 7px; color: var(--muted); font-weight: 500; }
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 30, 50, .12); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }

/* ---------- coach ---------- */
.coach-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.coach-col { display: grid; gap: 12px; align-content: start; }
.setup-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.box-select { display: grid; gap: 4px; }
.box-select .label { font-size: 12.5px; color: var(--muted); }
.detected { font-size: 12px; color: var(--accent); font-weight: 600; }
.live-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 10px 12px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); animation: blink 1.4s infinite; }
.live-dot.practice { background: var(--accent); animation: none; }
@keyframes blink { 50% { opacity: .25; } }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; }
.live-bar .spacer { flex: 1; }
.stages { display: flex; flex-wrap: wrap; gap: 5px; }
.stage { font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px dashed var(--line); background: transparent; color: var(--muted); }
.stage.hit { border: 1px solid transparent; background: var(--good-bg); color: var(--good); font-weight: 600; }
.stage.hit::before { content: "\2713"; margin-right: 4px; }
.nudge { background: var(--amber-bg); color: var(--amber); border-radius: var(--radius); padding: 8px 12px; font-weight: 600; font-size: 13px; }

.now { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 16px 18px 14px; display: grid; gap: 7px; position: relative; overflow: hidden; min-height: 150px; align-content: start; }
.now::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); }
.now[data-kind="objection"]::before { background: var(--amber); }
.now[data-kind="empty"]::before { background: var(--line); }
.now-head { display: flex; justify-content: space-between; gap: 8px; min-height: 18px; }
.now-tag { font-size: 13px; font-weight: 700; color: var(--accent); }
.now[data-kind="objection"] .now-tag { color: var(--amber); }
.now-meta { font-size: 12px; color: var(--muted); }
.now-say { font-size: 22px; line-height: 1.38; font-weight: 600; letter-spacing: -.01em; }
.now[data-kind="empty"] .now-say { font-size: 15px; font-weight: 400; color: var(--muted); }
.now.streaming .now-say::after { content: ""; display: inline-block; width: 8px; height: 1em; margin-left: 3px; vertical-align: -2px; background: var(--accent); animation: blink 1s infinite; }
.now-why { color: var(--muted); }
.now-match { font-size: 12.5px; color: var(--good); font-weight: 600; }
.now-why:empty, .now-match:empty { display: none; }
.now.thinking::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: sweep 1.1s linear infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.quick { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
.earlier { display: grid; gap: 8px; }
.earlier-item { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; }
.earlier-item.objection { border-left-color: var(--amber); }
.earlier-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.earlier-head b { color: var(--muted); }
.earlier-head button { margin-left: auto; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tab { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); padding: 7px 12px; font-weight: 600; position: relative; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab .dot { position: absolute; top: 6px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.notes { display: grid; gap: 0; }
.note-summary { font-weight: 600; padding-bottom: 8px; }
.note-row { display: grid; grid-template-columns: 96px 1fr; gap: 8px; font-size: 13.5px; padding: 8px 0; border-top: 1px solid var(--line); }
.note-k { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.note-v ul { margin: 0; padding-left: 16px; }
.transcript { max-height: 60vh; overflow-y: auto; display: grid; gap: 6px; align-content: start; }
.line { font-size: 13.5px; }
.line b { font-size: 12px; margin-right: 6px; }
.line.them b { color: var(--accent); }
.line.me b { color: var(--good); }
.line.interim { color: var(--muted); }
.practice-bar { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; }
.practice-bar select { width: auto; }
.float-note { padding: 22px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius-l); }
body.pip { padding: 10px; min-height: 0; }
body.pip .now-say { font-size: 21px; }

/* ---------- debrief ---------- */
.debrief { display: grid; gap: 16px; }
.db-outcome { font-size: 15.5px; font-weight: 600; }
.db-onething { background: var(--say-bg); border-radius: var(--radius); padding: 11px 14px; }
.db-k { display: block; font-size: 11.5px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.db-section { display: grid; gap: 8px; }
.db-section ul { margin: 0; padding-left: 18px; }
.db-dl { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; margin: 0; }
.db-dl dt { color: var(--muted); }
.db-dl dd { margin: 0; }
.debrief blockquote { margin: 0; padding-left: 10px; border-left: 3px solid var(--line); color: var(--muted); font-style: italic; }
.db-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.db-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); display: grid; gap: 6px; align-content: start; }
.db-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; }
.db-evidence { color: var(--muted); font-size: 13px; }
.db-better { background: var(--say-bg); border-radius: 6px; padding: 7px 9px; }
.db-pre { white-space: pre-wrap; font: inherit; margin: 0; background: var(--surface-2); border-radius: var(--radius); padding: 11px 13px; }

/* ---------- lists & tables ---------- */
.list { display: grid; gap: 6px; }
.list-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; text-align: left; width: 100%; }
button.list-row { justify-content: stretch; }
.list-row .sub { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 3px; }
.list-row-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
table.data { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; }
table.data th, table.data td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13.5px; }
table.data th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--surface-2); }
table.data tr:last-child td { border-bottom: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters select { width: auto; }

/* ---------- train & boxes ---------- */
.drop { border: 2px dashed var(--line); border-radius: var(--radius-l); padding: 22px; text-align: center; display: grid; gap: 8px; justify-items: center; background: var(--surface); }
.drop.over { border-color: var(--accent); background: var(--say-bg); }
.kind-select { width: auto; padding: 3px 6px; font-size: 12.5px; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.prof-list { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
.obj-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 5px; }
.obj-card .db-better { margin-top: 2px; }
.box-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.box-col { display: grid; gap: 8px; }
.box-col-head { display: flex; justify-content: space-between; align-items: baseline; }
.box-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px; display: grid; gap: 6px; }
.box-card[data-kind="prospect"] { border-top: 3px solid #2153d0; }
.box-card[data-kind="call"] { border-top: 3px solid #11744d; }
.box-card[data-kind="segment"] { border-top: 3px solid #7a4cc2; }
.box-card[data-kind="outcome"] { border-top: 3px solid #a85507; }
.box-card p { font-size: 13px; }
.box-card .k { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.proposal { display: grid; gap: 6px; }
.proposal label { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; cursor: pointer; }

/* ---------- insights ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 12px 14px; }
.stat strong { display: block; font-size: 24px; letter-spacing: -.02em; }
.bars { display: grid; gap: 6px; }
.bar { display: grid; grid-template-columns: 130px 1fr 32px; gap: 8px; align-items: center; font-size: 13px; }
.bar-track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 5px; }
.bar-fill.amber { background: var(--amber); }

/* ---------- hubspot ---------- */
.hs-results { display: grid; gap: 4px; }
.hs-contact { display: grid; justify-items: start; text-align: left; width: 100%; padding: 7px 10px; gap: 0; }
.hs-contact.selected { border-color: var(--accent); background: var(--say-bg); }
.hs-done { display: flex; gap: 10px; align-items: flex-start; }
.tick { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--good-bg); color: var(--good); font-weight: 700; }
.chip-selected { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--accent); background: var(--say-bg); border-radius: 8px; padding: 6px 6px 6px 10px; }

.method-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.method-card { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; background: var(--surface); }
.method-card:has(input:checked) { border-color: var(--accent); background: var(--say-bg); }
.method-card input { margin-top: 3px; }
.method-card span { display: grid; gap: 2px; }

dialog { border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); color: var(--ink); width: min(640px, 94vw); padding: 20px; }
dialog::backdrop { background: rgba(10, 20, 30, .45); }
dialog form { display: grid; gap: 12px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 8px 16px; border-radius: 999px; font-weight: 600; z-index: 50; }

@media (max-width: 980px) {
  .coach-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .nav { display: flex; flex-wrap: wrap; }
  .side-foot { display: none; }
  .grid2, .grid3, .setup-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- role-play ---------- */
.rp { display: grid; gap: 12px; }
.rp-log { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 14px; display: grid; gap: 10px; align-content: start; max-height: 56vh; min-height: 220px; overflow-y: auto; }
.rp-msg { max-width: 78%; padding: 9px 13px; border-radius: 14px; display: grid; gap: 2px; }
.rp-msg p { line-height: 1.45; }
.rp-msg.prospect { background: var(--surface-2); justify-self: start; border-bottom-left-radius: 4px; }
.rp-msg.rep { background: var(--say-bg); justify-self: end; border-bottom-right-radius: 4px; }
.rp-who { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.rp-input { display: grid; gap: 8px; }
.score-ring { width: 96px; height: 96px; border-radius: 50%; display: grid; place-content: center; text-align: center; border: 6px solid var(--line); flex: none; }
.score-ring strong { font-size: 28px; line-height: 1; }
.score-ring span { font-size: 11.5px; color: var(--muted); }
.score-ring.good { border-color: var(--good); }
.score-ring.mid { border-color: var(--amber); }
.score-ring.bad { border-color: var(--bad); }
.tryout { min-height: 100vh; display: grid; justify-items: center; padding: 32px 16px; }
.tryout-card { width: min(760px, 100%); }
a.tab { display: inline-block; }
