/* Podium — laptop-first speaking coach.
   Layout: fixed bottle-green sidebar (the "green room") + a wide working stage; practice booth = stage left, monitor column right.
   Palette: brass on bottle green, cool paper neutrals. Display: Bricolage Grotesque · Body: Public Sans · Data: IBM Plex Mono */
:root {
  --bg: #F2F4F1;
  --surface: #FFFFFF;
  --surface-2: #F7F8F5;
  --ink: #142420;
  --text: #24302C;
  --muted: #5D6A65;
  --line: #D9DFDA;
  --accent: #A3741F;
  --accent-strong: #8A5F14;
  --accent-soft: rgba(163, 116, 31, 0.16);
  --side: #173A33;
  --side-ink: #E8EFEA;
  --side-muted: #9DB3AA;
  --good: #2C7A52;
  --ok: #B7791F;
  --low: #B0412E;
  --good-soft: rgba(44, 122, 82, 0.12);
  --low-soft: rgba(176, 65, 46, 0.12);
  --ok-soft: rgba(183, 121, 31, 0.14);
  --rec: #D23A2A;
  --shadow: 0 1px 2px rgba(20, 36, 32, 0.06), 0 4px 18px rgba(20, 36, 32, 0.05);
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1513; --surface: #151F1C; --surface-2: #1A2622; --ink: #EEF3EF; --text: #D5DDD8; --muted: #8E9C96; --line: #2A3833;
    --accent: #D6A651; --accent-strong: #E6B967; --accent-soft: rgba(214, 166, 81, 0.18); --side: #0A110F; --side-ink: #E8EFEA; --side-muted: #8AA197;
    --good: #57B985; --ok: #E0A93F; --low: #E2715C; --good-soft: rgba(87, 185, 133, 0.14); --low-soft: rgba(226, 113, 92, 0.14); --ok-soft: rgba(224, 169, 63, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1513; --surface: #151F1C; --surface-2: #1A2622; --ink: #EEF3EF; --text: #D5DDD8; --muted: #8E9C96; --line: #2A3833;
  --accent: #D6A651; --accent-strong: #E6B967; --accent-soft: rgba(214, 166, 81, 0.18); --side: #0A110F; --side-ink: #E8EFEA; --side-muted: #8AA197;
  --good: #57B985; --ok: #E0A93F; --low: #E2715C; --good-soft: rgba(87, 185, 133, 0.14); --low-soft: rgba(226, 113, 92, 0.14); --ok-soft: rgba(224, 169, 63, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: 30px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
h4 { font-size: 12px; font-family: var(--font-body); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
p { margin: 0; }
a { color: var(--accent-strong); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; color: var(--accent-strong); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.error { color: var(--low); }
.good { color: var(--good); }

/* ---------- shell ---------- */
#app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100%; }
.sidebar { background: var(--side); color: var(--side-ink); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 14px; padding: 18px 12px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--side-ink); text-decoration: none; padding: 2px 8px 6px; }
.mark { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); color: var(--side); font: 700 18px var(--font-display); }
.brand-name { font: 700 19px var(--font-display); letter-spacing: -0.01em; }
.me { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: var(--r); padding: 12px; display: grid; gap: 6px; }
.me-rating { display: flex; align-items: baseline; justify-content: space-between; }
.me-rating b { font-size: 22px; color: #fff; }
.me-rating span { font-size: 12px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.me small { color: var(--side-muted); font-size: 12px; }
.nav { display: grid; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--side-muted); text-decoration: none; font-weight: 500; font-size: 14px; }
.nav-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav-link:hover { color: var(--side-ink); background: rgba(255, 255, 255, 0.05); }
.nav-link.on { color: #fff; background: rgba(255, 255, 255, 0.09); box-shadow: inset 3px 0 0 var(--accent); }
.nav-foot { margin-top: auto; display: grid; gap: 2px; }
.engine-pill { margin: 8px 10px 0; font-size: 11px; color: var(--side-muted); font-family: var(--font-mono); }
main { padding: 28px max(16px, 3vw) 64px; max-width: 1280px; width: 100%; outline: none; display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 6px; max-width: 68ch; }
.loading { grid-column: 1 / -1; display: grid; place-items: center; align-content: center; gap: 12px; min-height: 100vh; color: var(--muted); }

/* ---------- cards & controls ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); min-width: 0; }
.card-title { font-size: 17px; }
.btn { font: 600 14px var(--font-body); border-radius: 9px; padding: 9px 16px; border: 1px solid transparent; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; transition: background 0.15s, border-color 0.15s; }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { background: var(--accent-strong); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: default; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; padding: 4px 8px; border-radius: 6px; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.link { background: none; border: 0; padding: 0; color: var(--accent-strong); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.chip { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; padding: 3px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-strong); white-space: nowrap; }
.btn-chip { border: 0; cursor: pointer; font-family: var(--font-mono); }
input, textarea, select { font: 15px var(--font-body); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; width: 100%; min-width: 0; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field { display: grid; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.help, .field small { color: var(--muted); font-size: 12.5px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.form-actions { display: flex; gap: 8px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.check input { width: auto; accent-color: var(--accent); }
.profile { display: grid; gap: 14px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 12px; font: 600 14px var(--font-body); color: var(--muted); cursor: pointer; margin-bottom: -1px; }
.tab.on { color: var(--ink); border-color: var(--accent); }
.tab:hover { color: var(--ink); }
.notice { background: var(--accent-soft); color: var(--ink); border-radius: var(--r); padding: 10px 14px; font-weight: 500; }

/* ---------- rating & meters ---------- */
.rating { display: grid; gap: 12px; }
.rating-num { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.rating-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; width: 100%; }
.rating-value { font: 700 64px/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.rank-name { font: 700 20px var(--font-display); color: var(--accent-strong); }
.rank-ladder { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; font-size: 11px; color: var(--muted); }
.rung { border-top: 3px solid var(--line); padding-top: 4px; }
.rung.past { border-color: var(--accent); }
.rung.now { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.progress { height: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.progress.thin { height: 5px; background: rgba(255, 255, 255, 0.08); border: 0; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); border-radius: 99px; transition: width 0.6s ease; }
.progress-cap { font-size: 13px; color: var(--muted); }
.chart { width: 100%; height: auto; max-width: 100%; }
.meter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 22px; }
.meter { display: grid; gap: 6px; }
.meter-top { display: flex; justify-content: space-between; align-items: baseline; }
.meter-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.meter-val { font-size: 15px; color: var(--ink); }
.trend { font-size: 11px; margin-left: 6px; }
.trend.up, .up { color: var(--good); }
.trend.down, .down { color: var(--low); }
.meter-track { position: relative; height: 10px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.meter-fill { height: 100%; transition: width 0.6s ease; }
.meter-fill.good { background: var(--good); } .meter-fill.ok { background: var(--ok); } .meter-fill.low { background: var(--low); }
.tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--bg); opacity: 0.9; }

/* ---------- dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 18px; }
.dash-side { display: flex; flex-direction: column; gap: 18px; }
.workout { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.workout a { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; text-decoration: none; color: var(--ink); font-weight: 500; }
.workout a:hover { border-color: var(--accent); }
.workout .check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; color: #fff; }
.workout li.done .check { background: var(--good); border-color: var(--good); }
.workout li.done span:not(.check) { color: var(--muted); text-decoration: line-through; }
.workout small { color: var(--muted); }
.streak { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.streak b { font-size: 30px; color: var(--accent-strong); }
.streak small { width: 100%; color: var(--muted); }
.focus b { color: var(--ink); }
.sessions { width: 100%; border-collapse: collapse; font-size: 14px; }
.sessions th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.sessions td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sessions td.note { color: var(--muted); font-size: 13px; max-width: 420px; }
.card:has(.sessions) { overflow-x: auto; }

/* ---------- path ---------- */
.path { display: grid; gap: 14px; }
.level { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; display: grid; gap: 14px; }
.level.locked { opacity: 0.55; }
.level-head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.level-no { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-weight: 500; }
.level.locked .level-no { background: var(--line); color: var(--muted); }
.level-meta { color: var(--muted); font-size: 13px; }
.lessons { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.lesson { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.lesson p { font-size: 14px; color: var(--text); flex: 1; }
.lesson.done { border-color: var(--good); }
.lesson-actions { display: flex; gap: 6px; }
.mission { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; border-top: 1px dashed var(--line); padding-top: 12px; }
.mission p { flex: 1; min-width: 200px; }

/* ---------- pitches ---------- */
.pitch-groups { display: grid; gap: 18px; }
.pitch-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.pitch { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); min-width: 0; }
.pitch-top { display: flex; gap: 8px; align-items: center; }
.pitch-text { display: grid; gap: 6px; flex: 1; align-content: start; }
.pitch-text .tp-line { font-size: 15px; }
.pitch-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.practice-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }

/* ---------- teleprompter & booth ---------- */
.tp-line { font-size: 17px; line-height: 1.6; color: var(--text); }
.tp-line strong { color: var(--ink); font-weight: 700; box-shadow: inset 0 -0.45em 0 var(--accent-soft); }
.tp-line .dir { display: inline; font-style: italic; color: var(--muted); font-size: 0.88em; }
.tp-line .pause { color: var(--accent); font-weight: 700; margin: 0 2px; }
.teleprompter { max-height: 340px; overflow-y: auto; padding: 18px 20px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 12px; scroll-behavior: smooth; }
.teleprompter .tp-line { font-size: 21px; line-height: 1.55; transition: opacity 0.2s; }
.teleprompter .tp-line.done { opacity: 0.38; }
.teleprompter .tp-line.now { color: var(--ink); }
.booth { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.booth-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.booth-prompt p { font-size: 17px; }
.booth-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 16px; }
.booth-wrap { display: flex; flex-direction: column; gap: 18px; }
.booth-result:empty { display: none; }
.booth-controls { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.booth-hint { color: var(--muted); font-size: 13px; flex: 1; min-width: 180px; }
.rec-btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px 12px 16px; border-radius: 99px; border: 2px solid var(--ink); background: var(--surface); color: var(--ink); font: 700 15px var(--font-body); cursor: pointer; }
.rec-btn:hover { border-color: var(--rec); }
.rec-ic { width: 16px; height: 16px; border-radius: 50%; background: var(--rec); flex: none; }
.rec-btn.on { background: var(--rec); border-color: var(--rec); color: #fff; }
.rec-btn.on .rec-ic { background: #fff; border-radius: 3px; }
.rec-btn:disabled { opacity: 0.5; }
.countdown { font: 700 72px var(--font-display); color: var(--accent); text-align: center; }
.cam-box { position: relative; aspect-ratio: 4 / 3; max-width: 100%; border-radius: 12px; overflow: hidden; background: #0C1412; }
.cam { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); opacity: 0; transition: opacity 0.3s; }
.cam-box.on .cam { opacity: 1; }
.cam-note { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px; font-size: 12px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, 0.65)); }
.live { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface); display: grid; gap: 10px; }
.live-head { display: flex; align-items: center; gap: 8px; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.live.on .rec-dot { background: var(--rec); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
.timer { margin-left: auto; font-size: 16px; color: var(--ink); }
.lvl { height: 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; flex: 1; min-width: 120px; }
.lvl-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--good), var(--ok) 70%, var(--low)); transition: width 0.08s linear; }
canvas.pitch-trace { width: 100%; height: 64px; background: var(--surface-2); border-radius: 6px; padding: 0; border: 0; }
.live-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.live-stat { display: grid; }
.live-stat b { font-size: 20px; color: var(--ink); }
.live-stat small { font-size: 11px; color: var(--muted); }

/* ---------- report ---------- */
.report { display: flex; flex-direction: column; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); }
.report-head { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 22px; align-items: center; }
.ring { position: relative; width: 116px; height: 116px; }
.ring svg { width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 10; }
.ring-fg { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; }
.ring.good .ring-fg { stroke: var(--good); } .ring.ok .ring-fg { stroke: var(--ok); } .ring.low .ring-fg { stroke: var(--low); }
.ring-txt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-txt b { font-size: 30px; color: var(--ink); line-height: 1; }
.ring-txt small { font-size: 11px; color: var(--muted); }
.delta { display: grid; text-align: center; padding: 10px 14px; border-radius: 12px; }
.delta.up { background: var(--good-soft); } .delta.down { background: var(--low-soft); }
.delta b { font-size: 26px; }
.delta small { color: var(--muted); font-size: 12px; }
.report-meters .meter-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; }
.wins ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; color: var(--good); }
.wins li span, .wins li { color: var(--text); }
.wins li::marker { color: var(--good); content: "✓  "; }
.tips { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.tip { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); border-left: 3px solid var(--line); }
.tip.sev-high { border-left-color: var(--low); background: var(--low-soft); }
.tip.sev-mid { border-left-color: var(--ok); }
.tip-m { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.tip-go { font-size: 13px; font-weight: 600; white-space: nowrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 0; }
.fact { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; }
.fact dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.fact dd { margin: 2px 0 0; font-size: 15px; color: var(--ink); }
.lines { display: grid; gap: 6px; }
.line-acc { display: grid; grid-template-columns: 52px 1fr; gap: 2px 10px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); }
.line-acc small { grid-column: 2; color: var(--muted); font-size: 12px; }
.line-acc.low .num { color: var(--low); } .line-acc.ok .num { color: var(--ok); } .line-acc.good .num { color: var(--good); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.compare > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.transcript, .polished { font-size: 15px; line-height: 1.65; padding: 12px 14px; background: var(--surface-2); border-radius: 9px; white-space: pre-line; }
mark { border-radius: 3px; padding: 0 2px; color: var(--ink); }
.m-fill { background: var(--ok-soft); box-shadow: inset 0 -2px 0 var(--ok); }
.m-hedge { background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.m-comp { background: var(--low-soft); box-shadow: inset 0 -2px 0 var(--low); }
.legend { font-size: 12px; color: var(--muted); }
.play-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.play-row audio { height: 34px; max-width: 100%; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-box:empty { display: none; }
.ai-box, .ai-text { white-space: pre-wrap; background: var(--accent-soft); border-radius: var(--r); padding: 14px; color: var(--ink); }

/* ---------- studio ---------- */
.studio { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; }
.script-list { display: flex; flex-direction: column; gap: 3px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; padding-right: 4px; }
.script-list h4 { margin: 14px 0 4px; }
.script-item { text-align: left; background: none; border: 0; border-radius: 8px; padding: 7px 10px; font: 500 14px var(--font-body); color: var(--text); cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.script-item:hover { background: var(--surface); }
.script-item.on { background: var(--surface); box-shadow: inset 3px 0 0 var(--accent); color: var(--ink); }
.script-item small { color: var(--muted); }
.studio-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.script-editor { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.editor-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.title-input { flex: 1; min-width: 200px; font: 700 20px var(--font-display); background: transparent; border-color: transparent; padding-left: 4px; }
.title-input:hover { border-color: var(--line); }
.editor-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(220px, 1fr); gap: 14px; }
.script-area { font-size: 16px; min-height: 300px; font-family: var(--font-body); }
.ear-check { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); font-size: 13.5px; }
.ear-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.flags { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.flags li { padding-left: 18px; position: relative; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.flags li::before { position: absolute; left: 0; font-weight: 700; }
.flags li.bad::before { content: "!"; color: var(--low); } .flags li.warn::before { content: "•"; color: var(--ok); } .flags li.good::before { content: "✓"; color: var(--good); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.script-preview { white-space: pre-wrap; font: 14.5px/1.6 var(--font-body); background: var(--surface-2); padding: 12px; border-radius: 9px; margin: 0; color: var(--text); }
.changes { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
.changes s { color: var(--muted); } .changes small { color: var(--muted); }
.versions .spark { display: flex; align-items: flex-end; gap: 4px; height: 56px; }
.spark .bar { width: 14px; background: var(--accent); border-radius: 3px 3px 0 0; opacity: 0.85; }
.gen { display: grid; gap: 12px; }

/* ---------- role-play ---------- */
.scn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.scn { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: border-color 0.15s, transform 0.15s; }
.scn:hover { border-color: var(--accent); transform: translateY(-1px); }
.scn-top { display: flex; gap: 12px; align-items: center; }
.scn-top small { color: var(--muted); }
.scn p { font-size: 14px; flex: 1; }
.scn-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.diff { color: var(--accent); letter-spacing: 2px; font-size: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--side); color: var(--accent); display: grid; place-items: center; font: 700 15px var(--font-display); flex: none; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.arena { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.arena-main { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); min-width: 0; }
.char-card { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.char-card small { color: var(--muted); }
.char-card .tabs { border: 0; margin-left: auto; }
.mood { display: flex; gap: 12px; align-items: center; margin-left: auto; flex: none; }
.mood-tag { flex: none; }
.mood-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 3px 8px; border-radius: 99px; }
.mood-tag.warm { background: var(--good-soft); color: var(--good); } .mood-tag.open { background: var(--accent-soft); color: var(--accent-strong); } .mood-tag.guarded { background: var(--ok-soft); color: var(--ok); } .mood-tag.cold { background: var(--low-soft); color: var(--low); }
.mini { display: grid; gap: 2px; width: 90px; }
.mini small { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.mini-track { height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.mini-track i { display: block; height: 100%; background: var(--accent); transition: width 0.5s; }
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 220px; max-height: 420px; overflow-y: auto; padding: 4px; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 14px; display: grid; gap: 2px; }
.bubble .who { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.bubble.them { background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.you { background: var(--side); color: var(--side-ink); align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble.you .who { color: var(--side-muted); }
.coach-row { display: flex; gap: 10px; align-items: baseline; padding: 10px 12px; border-radius: 9px; background: var(--accent-soft); }
.coach-whisper { color: var(--ink); font-size: 14px; }
.turns { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.turns p { font-size: 14px; }
.turn-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.tag { font-size: 11px; padding: 2px 7px; border-radius: 99px; font-weight: 600; }
.tag.good { background: var(--good-soft); color: var(--good); } .tag.bad { background: var(--low-soft); color: var(--low); }

/* ---------- drills ---------- */
.obj-card { background: var(--side); color: var(--side-ink); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; display: grid; gap: 10px; }
.obj-card h2 { color: #fff; font-size: 26px; }
.obj-card .muted { color: var(--side-muted); }
.obj-card .eyebrow { color: var(--accent); }
.obj-card .btn.ghost { color: var(--side-ink); border-color: rgba(255, 255, 255, 0.2); }
.model { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: grid; gap: 10px; }
.acra-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.acra-step { padding: 6px 12px; border-radius: 99px; font-weight: 600; font-size: 13px; background: var(--low-soft); color: var(--low); }
.acra-step.ok { background: var(--good-soft); color: var(--good); }
.warm { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(200px, 1fr); gap: 18px; }
.warm-list { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.warm-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 6px 8px; border-radius: 8px; }
.warm-list li span { grid-column: 1; color: var(--muted); font-size: 14px; }
.warm-list li small { grid-row: 1; grid-column: 2; color: var(--muted); }
.warm-list li.now { background: var(--accent-soft); }
.warm-now { display: grid; gap: 4px; place-items: center; min-height: 140px; text-align: center; }
.warm-now .big { font: 700 56px var(--font-display); color: var(--accent-strong); }

/* ---------- debrief, settings, owner ---------- */
.debrief { display: grid; gap: 14px; }
.with-mic { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; }
.advice { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); }
.debrief-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.debrief-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.debrief-list p { grid-column: 1 / -1; color: var(--muted); font-size: 14px; }
.voice-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.model-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.kokoro { display: grid; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 4px; }
.stat b { font-size: 28px; color: var(--ink); }
.stat small { color: var(--muted); }

/* ---------- auth ---------- */
.auth-wrap { grid-column: 1 / -1; min-height: 100vh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left, 0px)); background: var(--side); }
.auth { width: min(420px, 100%); background: var(--surface); border-radius: 16px; padding: 28px; display: grid; gap: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
.brand-lg { display: flex; align-items: center; gap: 10px; font: 700 20px var(--font-display); color: var(--ink); }
.auth .sub { color: var(--muted); }
.auth-msg { color: var(--low); font-size: 14px; min-height: 1em; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; }

/* ---------- modal & toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(10, 18, 16, 0.55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; width: min(620px, 100%); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px; overflow-y: auto; display: grid; gap: 12px; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
#toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 60; max-width: min(420px, calc(100vw - 36px)); }
.toast { background: var(--ink); color: var(--bg); padding: 11px 15px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); transition: opacity 0.3s, transform 0.3s; }
.toast.good { background: var(--good); color: #fff; } .toast.warn { background: var(--ok); color: #fff; } .toast.error { background: var(--low); color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ---------- smaller laptops, tablets, phones ---------- */
@media (max-width: 1100px) {
  .booth, .arena { grid-template-columns: minmax(0, 1fr) 260px; }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px max(16px, env(safe-area-inset-left, 0px)); gap: 8px; }
  .me, .engine-pill { display: none; }
  .nav, .nav-foot { display: flex; flex-wrap: wrap; margin: 0; }
  .nav-link span { display: none; }
  main { padding: 18px max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px)); }
  .booth, .arena, .studio, .editor-body, .compare, .warm { grid-template-columns: 1fr; }
  .booth-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .booth-side > * { flex: 1 1 240px; }
  .script-list { position: static; max-height: 240px; }
  .report-head { grid-template-columns: auto auto; }
  .report-meters { grid-column: 1 / -1; }
  .tip { grid-template-columns: 1fr; }
  .voice-row { grid-template-columns: 1fr; }
  .rating-value { font-size: 48px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
