/* Rehearsal Room — design system
   Layout: coach = fixed left sidebar + scrolling workspace (max 1180px);
   learner = top bar + single focused column; meeting = full-bleed dark stage with a rail.
   Colour logic: cobalt = actions, amber "cue light" = someone is speaking / live, green = coach. */
@font-face { font-family: "Bricolage Grotesque"; src: url(/fonts/bricolage.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url(/fonts/hanken.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Hanken Grotesk"; src: url(/fonts/hanken-ext.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; src: url(/fonts/plexmono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(/fonts/plexmono-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --paper: #F3F5F8; --surface: #FFFFFF; --sunken: #EBEEF3; --raised: #FAFBFC; --ink: #121826; --ink-2: #2B3344; --muted: #5A6477; --faint: #8A93A5; --line: #DDE2EA; --line-2: #E8ECF2;
  --cobalt: #2D46D2; --cobalt-ink: #FFFFFF; --cobalt-soft: #E7EBFD; --cobalt-line: #BCC6F5;
  --cue: #E8961F; --cue-soft: #FCF0DC; --ok: #1B7F55; --ok-soft: #DEF3E9; --warn: #9F6410; --warn-soft: #FBEFD7; --bad: #BA3A34; --bad-soft: #FBE4E2; --coach: #1F8F63;
  --shadow-1: 0 1px 2px rgba(18,24,38,.05); --shadow-2: 0 1px 2px rgba(18,24,38,.06), 0 12px 32px rgba(18,24,38,.08);
  --scrim: rgba(13,17,26,.5);
  --room-bg: #0C1018; --room-tile: #182030; --room-tile-2: #212A3D; --room-line: #2A3349; --room-ink: #EAEEF6; --room-muted: #96A2B9; --room-bar: #111622; --room-cue: #F4A93C; --room-red: #E5484D; --room-cobalt: #7086FF; --room-coach: #4CC08D;
  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px;
  --side: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E121A; --surface: #151B26; --sunken: #1B2230; --raised: #18202C; --ink: #E8ECF4; --ink-2: #CBD2DF; --muted: #98A2B6; --faint: #6F7A8F; --line: #262E3F; --line-2: #202837;
    --cobalt: #8295FF; --cobalt-ink: #0B0F1A; --cobalt-soft: #1C2447; --cobalt-line: #36437F;
    --cue: #F2AA45; --cue-soft: #392A14; --ok: #4CC08D; --ok-soft: #12301F; --warn: #E3AB4D; --warn-soft: #362812; --bad: #EF6D66; --bad-soft: #3A1A19; --coach: #4CC08D;
    --shadow-1: 0 1px 2px rgba(0,0,0,.3); --shadow-2: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.35); --scrim: rgba(0,0,0,.62);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0E121A; --surface: #151B26; --sunken: #1B2230; --raised: #18202C; --ink: #E8ECF4; --ink-2: #CBD2DF; --muted: #98A2B6; --faint: #6F7A8F; --line: #262E3F; --line-2: #202837;
  --cobalt: #8295FF; --cobalt-ink: #0B0F1A; --cobalt-soft: #1C2447; --cobalt-line: #36437F;
  --cue: #F2AA45; --cue-soft: #392A14; --ok: #4CC08D; --ok-soft: #12301F; --warn: #E3AB4D; --warn-soft: #362812; --bad: #EF6D66; --bad-soft: #3A1A19; --coach: #4CC08D;
  --shadow-1: 0 1px 2px rgba(0,0,0,.3); --shadow-2: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.35); --scrim: rgba(0,0,0,.62);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, video { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 650; letter-spacing: -.012em; text-wrap: balance; margin: 0; color: var(--ink); }
h1 { font-size: clamp(26px, 3vw, 34px); line-height: 1.12; }
h2 { font-size: 19px; line-height: 1.25; }
h3 { font-size: 16px; line-height: 1.3; }
p { margin: 0; }
a { color: var(--cobalt); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.eyebrow { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lede { color: var(--muted); max-width: 64ch; margin-top: 6px; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shells ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100%; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 4px; padding: 18px 14px 14px; background: var(--surface); border-right: 1px solid var(--line); padding-left: max(14px, env(safe-area-inset-left, 0px)); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; min-width: 0; }
.brand-mark { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--ink); display: grid; place-items: center; }
.brand-mark::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--cue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cue) 32%, transparent); }
.brand b { display: block; font-family: var(--f-display); font-weight: 700; font-size: 16px; letter-spacing: -.02em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.brand > div { min-width: 0; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14.5px; }
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item:hover { background: var(--sunken); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--cobalt-soft); color: var(--ink); }
.nav-item[aria-current="page"] svg { color: var(--cobalt); }
.nav-item .badge { margin-left: auto; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who small { color: var(--muted); font-size: 12px; }
.main { min-width: 0; }
.page { max-width: 1180px; margin: 0 auto; padding-block: 30px 72px; padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); }
.mobilebar { display: none; }
@media (max-width: 920px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 70; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-2); }
  .shell.menu-open .side { transform: none; }
  .shell.menu-open::after { content: ""; position: fixed; inset: 0; background: var(--scrim); z-index: 60; }
  .mobilebar { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; gap: 10px; background: var(--surface); border-bottom: 1px solid var(--line); padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); }
  .mobilebar b { font-family: var(--f-display); font-size: 16px; }
  .page { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 20px 64px; }
}
/* learner top bar */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; gap: 12px; min-height: 62px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.topbar .brand { padding: 0; flex: 1; }
.page.narrow { max-width: 1040px; }

/* ---------- page header ---------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.ph > div:first-child { min-width: 0; flex: 1 1 380px; }
.ph .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; text-decoration: none; margin-bottom: 10px; font-weight: 600; }
.crumb:hover { color: var(--ink); }
.crumb svg { width: 15px; height: 15px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 8px 15px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--ink); transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { border-color: var(--cobalt-line); background: var(--cobalt-soft); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--cobalt); border-color: var(--cobalt); color: var(--cobalt-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--cobalt) 86%, var(--ink)); border-color: transparent; }
.btn-live { background: var(--cue); border-color: var(--cue); color: #1A1205; }
.btn-live:hover { background: color-mix(in srgb, var(--cue) 88%, var(--ink)); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn-quiet:hover { background: var(--sunken); border-color: transparent; color: var(--ink); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { min-height: 48px; padding: 12px 20px; font-size: 15.5px; border-radius: 12px; }
.btn svg, .icon-btn svg { width: 17px; height: 17px; flex: none; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
.spinner { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- chips, pills ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: var(--sunken); color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip.cobalt { background: var(--cobalt-soft); color: var(--cobalt); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.live { background: var(--cue-soft); color: var(--warn); }
.chip.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.level { font-family: var(--f-mono); font-weight: 500; font-size: 12px; letter-spacing: .03em; padding: 2px 7px; border-radius: 6px; background: var(--ink); color: var(--paper); }
.score { font-family: var(--f-mono); font-weight: 500; font-size: 13px; padding: 2px 8px; border-radius: 6px; background: var(--sunken); color: var(--muted); }
.score.hi { background: var(--ok-soft); color: var(--ok); } .score.mid { background: var(--warn-soft); color: var(--warn); } .score.lo { background: var(--bad-soft); color: var(--bad); }
.badge { font-family: var(--f-mono); font-size: 11px; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--cue); color: #1A1205; text-align: center; }
.tag { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; color: var(--cobalt); }

/* ---------- cards & sections ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { flex: 1; min-width: 0; }
.card-head .count { font-family: var(--f-mono); color: var(--muted); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@media (max-width: 1000px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 30px 0 12px; }
.section-title .count { font-family: var(--f-mono); color: var(--muted); font-size: 13px; }
.empty { border: 1.5px dashed var(--line); border-radius: var(--r-lg); padding: 30px 22px; display: grid; gap: 10px; justify-items: start; }
.empty p { color: var(--muted); max-width: 62ch; }
.empty .btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.skel { border-radius: var(--r-lg); background: linear-gradient(90deg, var(--sunken), var(--surface), var(--sunken)); background-size: 200% 100%; animation: sk 1.4s linear infinite; min-height: 120px; }
@keyframes sk { to { background-position: -200% 0; } }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); background: var(--cue-soft); color: var(--ink); }
.notice.info { background: var(--cobalt-soft); }
.notice p { flex: 1; min-width: 0; }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--warn); }

/* rows / lists */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-top: 1px solid var(--line-2); min-width: 0; text-decoration: none; color: inherit; }
.row:first-child { border-top: 0; }
a.row:hover, .row.click:hover { background: var(--raised); border-radius: 10px; cursor: pointer; }
.row .main-col { flex: 1; min-width: 0; }
.row .main-col b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .main-col small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .side-col { display: flex; align-items: center; gap: 10px; flex: none; }
.initials { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 13.5px; color: #0B0F1A; }
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--raised); }
.tbl .who { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.tbl .who b { display: block; }
.tbl .who small { color: var(--muted); font-size: 12.5px; }

/* kpis */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 22px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; }
.kpi b { display: block; font-family: var(--f-display); font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: 13px; }

/* setup checklist */
.checklist { display: grid; gap: 4px; }
.check { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 10px; text-decoration: none; color: inherit; }
.check:hover { background: var(--raised); }
.check .dot { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line); color: transparent; }
.check.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.check .dot svg { width: 14px; height: 14px; }
.check .txt { flex: 1; min-width: 0; }
.check .txt small { display: block; color: var(--muted); font-size: 13px; }
.check.done .txt b { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.fieldset { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fieldset > h3, .legend { font-family: var(--f-mono); font-size: 11.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.frow { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .lbl { font-size: 13.5px; font-weight: 600; }
.field .help { font-size: 12.5px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--raised); border-radius: 10px; padding: 9px 12px; min-height: 40px; }
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-soft); background: var(--surface); }
input[type=range] { width: 100%; accent-color: var(--cobalt); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg button:hover { border-color: var(--cobalt-line); color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--cobalt); }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; }
.toggle input { width: 18px; height: 18px; accent-color: var(--cobalt); }
.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.choice { border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; background: var(--surface); text-align: left; }
.choice:hover { border-color: var(--cobalt-line); }
.choice[aria-pressed="true"], .choice.on { border-color: var(--cobalt); background: var(--cobalt-soft); }
.choice svg { width: 22px; height: 22px; flex: none; color: var(--cobalt); margin-top: 1px; }
.choice b { display: block; }
.choice small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.check-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; cursor: pointer; min-width: 0; background: var(--surface); }
.check-item.on { border-color: var(--cobalt); background: var(--cobalt-soft); }
.check-item input { accent-color: var(--cobalt); }
.check-item .txt { min-width: 0; flex: 1; }
.check-item .txt b { display: block; font-size: 13.5px; }
.check-item .txt small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.form-error { color: var(--bad); font-size: 13.5px; font-weight: 600; }
.copybox { display: flex; gap: 8px; align-items: center; background: var(--sunken); border-radius: 10px; padding: 6px 6px 6px 12px; min-width: 0; }
.copybox code { flex: 1; min-width: 0; font-family: var(--f-mono); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 80; background: var(--scrim); display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: max(20px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
.sheet { background: var(--surface); border-radius: var(--r-xl); width: min(720px, 100%); box-shadow: var(--shadow-2); margin: auto 0; display: flex; flex-direction: column; min-width: 0; animation: up .18s ease-out; }
.sheet.wide { width: min(1060px, 100%); }
.sheet.small { width: min(480px, 100%); }
@keyframes up { from { opacity: 0; transform: translateY(8px); } }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { flex: 1; min-width: 0; }
.sheet-body { padding: 22px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.sheet-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; position: sticky; bottom: 0; background: var(--surface); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.sheet-foot .note { margin-right: auto; color: var(--muted); font-size: 13px; }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(560px, calc(100% - 32px)); }
.toast { background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow-2); animation: up .2s ease-out; }
.toast.bad { background: var(--bad); color: #fff; }

/* ---------- avatar tiles ---------- */
.av { position: relative; overflow: hidden; background: var(--room-tile); }
.av > svg, .av > img, .av > video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.av > video.talk { opacity: 0; transition: opacity .18s; }
.av.talking > video.talk { opacity: 1; }
.av.round { border-radius: 50%; flex: none; }
.av.round > svg, .av.round > img, .av.round > video { transform: scale(1.7) translateY(8%); }
.av.round > img.photo, .av.round > video { transform: scale(1.45); object-position: 50% 30%; }
.av.xs { width: 34px; height: 34px; } .av.sm { width: 44px; height: 44px; } .av.md { width: 56px; height: 56px; }
.stackav { display: flex; }
.stackav .av { box-shadow: 0 0 0 2px var(--surface); }
.stackav .av + .av { margin-left: -10px; }

/* agent library cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.agent-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; min-width: 0; text-decoration: none; color: inherit; transition: box-shadow .15s, border-color .15s; }
.agent-card:hover { border-color: var(--cobalt-line); box-shadow: var(--shadow-2); }
.agent-card .av { aspect-ratio: 16 / 9; }
.agent-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.agent-card .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.realism { position: absolute; top: 10px; left: 10px; z-index: 2; }
.tile-name { position: absolute; left: 10px; bottom: 10px; z-index: 2; background: rgba(8,11,18,.62); color: #F2F4F8; font-size: 12.5px; font-weight: 600; padding: 4px 9px; border-radius: 7px; backdrop-filter: blur(6px); max-width: calc(100% - 20px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* scenario cards */
.scn { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.scn-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.scn-top .meta { margin-left: auto; font-size: 12.5px; color: var(--muted); font-family: var(--f-mono); }
.clamp3 { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.scn-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.scn-foot .sp { flex: 1; }

/* agent editor */
.editor { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 28px; align-items: start; }
.editor-preview { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 12px; }
.preview-tile { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: var(--room-tile); max-width: 100%; }
.preview-tile .av { position: absolute; inset: 0; }
.preview-tile.speaking { box-shadow: 0 0 0 3px var(--room-cue), 0 0 26px color-mix(in srgb, var(--room-cue) 35%, transparent); }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.step-head { display: flex; align-items: center; gap: 12px; }
.step-head .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-mono); font-size: 12px; background: var(--cobalt-soft); color: var(--cobalt); flex: none; }
.step-head h2 { flex: 1; font-size: 17px; }
.tpl-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tpl-row button { border: 1px dashed var(--cobalt-line); background: var(--cobalt-soft); color: var(--ink); border-radius: 10px; padding: 7px 11px; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.voice { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 10px; cursor: pointer; background: var(--surface); text-align: left; }
.voice[aria-pressed="true"] { border-color: var(--cobalt); background: var(--cobalt-soft); }
.voice b { display: block; font-size: 13.5px; text-transform: capitalize; }
.voice small { display: block; color: var(--muted); font-size: 12px; }
.voice .play { margin-left: auto; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--sunken); color: var(--ink); flex: none; }
.voice .play svg { width: 13px; height: 13px; }
.portraits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.portrait { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: var(--sunken); padding: 0; }
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait[aria-pressed="true"] { border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-soft); }
.gen-status { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
@media (max-width: 860px) { .editor { grid-template-columns: minmax(0, 1fr); } .editor-preview { position: static; } }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid line { stroke: var(--line-2); }
.chart .axis text { fill: var(--muted); font: 11px var(--f-mono); }
.chart .lineA { fill: none; stroke: var(--cobalt); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .areaA { fill: var(--cobalt); opacity: .09; }
.chart .dotA { fill: var(--surface); stroke: var(--cobalt); stroke-width: 2.5; }
.chart .last { fill: var(--cobalt); }
.chart .lbl { fill: var(--ink); font: 600 12px var(--f-mono); }
.spark { width: 76px; height: 26px; display: block; }
.spark path { fill: none; stroke: var(--cobalt); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--cobalt); }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
.bar-row .lb { font-size: 14px; font-weight: 600; }
.bar-row .v { font-family: var(--f-mono); font-size: 12.5px; color: var(--muted); }
.bar-row .v .up { color: var(--ok); } .bar-row .v .down { color: var(--bad); }
.bar-track { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--cobalt); }
.bar-fill.lo { background: var(--bad); } .bar-fill.mid { background: var(--cue); }

/* ---------- debrief ---------- */
.db { display: flex; flex-direction: column; gap: 18px; }
.db-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; }
.ring { position: relative; width: 128px; height: 128px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .val b { font-family: var(--f-display); font-size: 36px; line-height: 1; font-weight: 750; }
.ring .val small { display: block; font-size: 11px; color: var(--muted); font-family: var(--f-mono); margin-top: 2px; }
.level-badge { display: inline-flex; align-items: baseline; gap: 8px; font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.level-badge b { font-family: var(--f-display); font-size: 22px; color: var(--cobalt); letter-spacing: 0; }
.plain-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.plain-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.mk { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; margin-top: 1px; }
.mk.good { background: var(--ok-soft); color: var(--ok); } .mk.part { background: var(--warn-soft); color: var(--warn); } .mk.miss { background: var(--bad-soft); color: var(--bad); } .mk.n { background: var(--cobalt-soft); color: var(--cobalt); font-family: var(--f-mono); }
.corr-head, .corr-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 18px; }
.corr-head { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.corr-row { padding: 12px 0; border-top: 1px solid var(--line-2); }
.corr-row .said { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--bad) 60%, transparent); }
.corr-row .better { font-weight: 650; }
.corr-row .why { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.qa-item { padding: 14px 0; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 6px; }
.qa-item:first-of-type { border-top: 0; padding-top: 0; }
.qa-item .q { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.qa-item blockquote { margin: 4px 0 0; padding: 9px 12px; border-left: 3px solid var(--cobalt); background: var(--cobalt-soft); border-radius: 0 8px 8px 0; font-size: 14px; }
.verdict { font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; }
.verdict.good { background: var(--ok-soft); color: var(--ok); } .verdict.partial { background: var(--warn-soft); color: var(--warn); } .verdict.missed { background: var(--bad-soft); color: var(--bad); }
.vocab { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.vcard { border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; display: flex; flex-direction: column; gap: 3px; }
.vcard b { font-weight: 650; }
.vcard span { font-size: 13px; color: var(--muted); }
.vcard i { font-size: 13px; }
.vcard.known { opacity: .6; }
.vcard .vfoot { display: flex; justify-content: flex-end; margin-top: 4px; }
.phrase { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line-2); font-size: 14.5px; }
.phrase:first-child { border-top: 0; }
.transcript { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; max-height: 560px; overflow-y: auto; }
.t-ln { font-size: 14px; }
.t-ln b { font-weight: 650; }
.t-ln.you b { color: var(--cobalt); } .t-ln.agent b { color: var(--warn); } .t-ln.coach b { color: var(--coach); }
summary { cursor: pointer; font-weight: 650; font-family: var(--f-display); font-size: 17px; }
.db-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 54px 20px; text-align: center; }
.loader { display: flex; gap: 6px; align-items: flex-end; height: 34px; }
.loader i { width: 7px; border-radius: 4px; background: var(--cobalt); animation: ld 1s ease-in-out infinite alternate; height: 8px; }
.loader i:nth-child(2) { animation-delay: .12s; } .loader i:nth-child(3) { animation-delay: .24s; } .loader i:nth-child(4) { animation-delay: .36s; } .loader i:nth-child(5) { animation-delay: .48s; }
@keyframes ld { to { height: 34px; } }

/* ---------- auth screens ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; background:
  radial-gradient(900px 500px at 85% -10%, color-mix(in srgb, var(--cobalt) 14%, transparent), transparent 60%),
  radial-gradient(700px 400px at 0% 110%, color-mix(in srgb, var(--cue) 12%, transparent), transparent 60%), var(--paper); }
.auth-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 30px; box-shadow: var(--shadow-2); display: flex; flex-direction: column; gap: 18px; }
.auth-card .brand { padding: 0; }

/* ---------- learner home ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: end; margin-bottom: 26px; }
.hero h1 { font-size: clamp(28px, 3.6vw, 40px); }
.next-live { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 18px 20px; border-radius: var(--r-lg); background: var(--ink); color: var(--paper); margin-bottom: 22px; }
.next-live .txt { flex: 1; min-width: 220px; }
.next-live b { font-family: var(--f-display); font-size: 18px; display: block; color: var(--paper); }
.next-live small { color: color-mix(in srgb, var(--paper) 70%, transparent); }
@media (max-width: 640px) { .hero { grid-template-columns: minmax(0, 1fr); } }

/* ================= meeting room ================= */
.room { position: fixed; inset: 0; z-index: 50; background: var(--room-bg); color: var(--room-ink); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); color-scheme: dark; }
.room-head { display: flex; align-items: center; gap: 12px; padding: 12px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px)); min-width: 0; }
.room-head .ttl { font-family: var(--f-display); font-weight: 650; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; color: var(--room-ink); }
.rec { width: 9px; height: 9px; border-radius: 50%; background: var(--room-red); flex: none; animation: pulse 1.6s ease-in-out infinite; }
.phase { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--room-line); color: var(--room-muted); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.phase.qa, .phase.wrap { border-color: var(--room-cue); color: var(--room-cue); }
.room-head .sp { flex: 1; }
.timer { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 13.5px; color: var(--room-muted); white-space: nowrap; }
.timer b { color: var(--room-ink); font-weight: 500; }
.people-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--room-ink); background: var(--room-tile-2); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.people-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--room-coach); }
.room-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 0; }
.room.rail-off .room-main { grid-template-columns: minmax(0, 1fr); }
.room.rail-off .rail { display: none; }
.stage { position: relative; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: safe center; padding: 8px 16px 10px; overflow-y: auto; }
.tiles { display: grid; gap: 12px; justify-content: center; align-content: center; width: 100%; }
.tile { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--room-tile); transition: box-shadow .2s, opacity .3s; max-width: 100%; }
.tile .av { position: absolute; inset: 0; }
.tile > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile.mirror > video { transform: scaleX(-1); }
.tile.speaking { box-shadow: 0 0 0 3px var(--room-cue), 0 0 30px color-mix(in srgb, var(--room-cue) 35%, transparent); }
.tile.human-speaking { box-shadow: 0 0 0 3px var(--room-cobalt); }
.tile.coach.human-speaking { box-shadow: 0 0 0 3px var(--room-coach); }
.tile.waiting { opacity: .45; }
.tile.next-up::after { content: "✋"; position: absolute; top: 10px; right: 12px; font-size: 20px; animation: up .3s ease-out; }
.tile.photo.speaking .av > img { animation: talk .5s ease-in-out infinite alternate; }
@keyframes talk { to { transform: scale(1.025); } }
.tile-label { position: absolute; left: 10px; bottom: 10px; z-index: 3; display: flex; align-items: center; gap: 7px; max-width: calc(100% - 20px); background: rgba(8,11,18,.66); backdrop-filter: blur(8px); padding: 5px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: #F1F4F9; min-width: 0; }
.tile-label span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-label small { font-weight: 500; color: #AEB8CC; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-label .muted-mic { color: #FF9C98; }
.tile-label .muted-mic svg { width: 14px; height: 14px; display: block; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; flex: none; }
.eq i { width: 3px; height: 4px; border-radius: 2px; background: #AEB8CC; }
.tile.speaking .eq i, .tile.human-speaking .eq i { background: var(--room-cue); animation: eq .45s ease-in-out infinite alternate; }
.tile.human-speaking .eq i { background: var(--room-cobalt); }
.tile .eq i:nth-child(2) { animation-delay: .15s; } .tile .eq i:nth-child(3) { animation-delay: .3s; }
@keyframes eq { to { height: 12px; } }
.tile .ph-center { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(160deg, var(--room-tile-2), var(--room-tile)); }
.tile .ph-center .initials { width: 68px; height: 68px; font-size: 24px; }
.badge-tl { position: absolute; top: 10px; left: 10px; z-index: 3; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; background: rgba(8,11,18,.6); color: #CFD6E4; padding: 3px 7px; border-radius: 6px; }
.captions { margin-top: 12px; max-width: min(880px, 100%); width: 100%; min-height: 58px; text-align: center; font-size: 17px; line-height: 1.45; color: #F3F5FA; }
.captions .who { display: block; font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--room-cue); margin-bottom: 2px; }
.captions .txt { background: rgba(0,0,0,.45); padding: 3px 10px; border-radius: 6px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.captions.you .who { color: var(--room-cobalt); } .captions.coach .who { color: var(--room-coach); }
.status-line { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: 13px; color: var(--room-muted); margin-top: 6px; min-height: 20px; text-align: center; }
.dots { display: inline-flex; gap: 4px; } .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--room-muted); animation: dot 1s infinite; } .dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { opacity: .25; transform: translateY(-2px); } }
.lobby-card { margin-top: 14px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: center; background: var(--room-tile-2); padding: 14px 16px; border-radius: 14px; max-width: 680px; text-align: left; }
.lobby-card p { flex: 1; min-width: 220px; font-size: 14px; color: var(--room-muted); }
.lobby-card b { color: var(--room-ink); display: block; font-size: 15px; }
.rail { border-left: 1px solid var(--room-line); display: flex; flex-direction: column; min-height: 0; background: var(--room-bar); }
.rail-tabs { display: flex; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--room-line); align-items: center; }
.rail-tabs button { border: 0; background: transparent; color: var(--room-muted); padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer; }
.rail-tabs button[aria-pressed="true"] { background: var(--room-tile-2); color: var(--room-ink); }
.rail-tabs .sp { flex: 1; }
.rail .icon-btn { color: var(--room-muted); } .rail .icon-btn:hover { background: var(--room-tile-2); color: var(--room-ink); }
.feed { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.ln { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ln .h { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; }
.ln .h b { color: var(--room-ink); }
.ln .h time { font-family: var(--f-mono); font-size: 11px; color: var(--room-muted); }
.ln p { font-size: 14px; color: #D5DBE7; overflow-wrap: anywhere; }
.ln.you .h b { color: var(--room-cobalt); } .ln.agent .h b { color: var(--room-cue); } .ln.coach .h b { color: var(--room-coach); }
.ln.steer { border-left: 2px solid var(--room-coach); padding-left: 8px; } .ln.steer p { color: #9FD8BC; font-style: italic; }
.ln.sys p { color: var(--room-muted); font-size: 12.5px; font-style: italic; }
.ln.sys.phase-mark p { font-style: normal; font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; text-align: center; color: var(--room-cue); }
.ln.err p { color: #FFB3AE; font-style: normal; }
.composer { border-top: 1px solid var(--room-line); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.composer form { display: flex; gap: 8px; align-items: flex-end; }
.room textarea, .room input[type=text], .room select { background: var(--room-tile); border-color: var(--room-line); color: var(--room-ink); }
.room textarea:focus, .room input:focus, .room select:focus { border-color: var(--room-cobalt); box-shadow: 0 0 0 3px rgba(112,134,255,.2); background: var(--room-tile); }
.composer textarea { min-height: 46px; max-height: 160px; font-size: 14.5px; resize: none; }
.composer .hint, .room .hint { color: var(--room-muted); font-size: 12.5px; }
.room kbd { font-family: var(--f-mono); font-size: 11px; border: 1px solid var(--room-line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--room-tile); }
.coach-tools { padding: 12px 14px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; min-height: 0; flex: 1; }
.coach-tools h4 { font-size: 11.5px; font-family: var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--room-muted); font-weight: 500; }
.coach-tools .grp { display: flex; flex-direction: column; gap: 8px; }
.qchips { display: flex; flex-wrap: wrap; gap: 6px; }
.qchips button { border: 1px solid var(--room-line); background: transparent; color: var(--room-ink); border-radius: 999px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; }
.qchips button:hover { border-color: var(--room-cobalt); }
.room-bar { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px max(16px, env(safe-area-inset-right, 0px)) 14px max(16px, env(safe-area-inset-left, 0px)); flex-wrap: wrap; position: relative; }
.rbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 46px; height: 46px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--room-tile-2); color: var(--room-ink); cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; }
.rbtn:hover { background: #2C3650; }
.rbtn svg { width: 19px; height: 19px; flex: none; }
.rbtn.off { background: #3A2326; color: #FFB3B0; }
.rbtn.on { background: var(--room-cobalt); color: #0B0F1A; }
.rbtn.cue { background: var(--room-cue); color: #1A1205; }
.rbtn.green { background: var(--room-coach); color: #06150E; }
.rbtn.red { background: var(--room-red); color: #fff; padding: 0 20px; }
.rbtn.sm { height: 38px; min-width: 38px; font-size: 13px; }
.rbtn[disabled] { opacity: .45; cursor: not-allowed; }
.confirm-pop { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--room-tile-2); border: 1px solid var(--room-line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(0,0,0,.5); z-index: 6; }
.confirm-pop .btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.confirm-pop span { font-size: 14px; color: var(--room-muted); }
.mic-meter { height: 6px; border-radius: 99px; background: var(--room-tile); overflow: hidden; }
.mic-meter i { display: block; height: 100%; width: 0; background: var(--room-coach); transition: width .08s; }
/* pre-join */
.prejoin { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: center; max-width: 1180px; margin: 0 auto; padding: 28px max(20px, env(safe-area-inset-right, 0px)) 40px max(20px, env(safe-area-inset-left, 0px)); overflow-y: auto; }
.pj-preview { position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: var(--room-tile); }
.pj-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.pj-preview .ph-center { position: absolute; inset: 0; display: grid; place-items: center; }
.pj-panel { background: var(--room-bar); border: 1px solid var(--room-line); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pj-panel h1 { color: var(--room-ink); font-size: 26px; }
.pj-panel dl { margin: 0; display: grid; gap: 10px; }
.pj-panel dt { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--room-muted); }
.pj-panel dd { margin: 2px 0 0; font-size: 14px; color: #D5DBE7; }
.pj-panel dd ul { margin: 2px 0 0; padding-left: 18px; }
.pj-people { display: flex; gap: 8px; flex-wrap: wrap; }
.pj-person { display: flex; align-items: center; gap: 8px; background: var(--room-tile); border-radius: 999px; padding: 4px 12px 4px 4px; font-size: 13px; }
.pj-person .av { box-shadow: none; }
.pj-devices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pj-devices .field label { color: var(--room-muted); font-size: 12.5px; font-weight: 600; }
@media (max-width: 900px) {
  .room-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .rail { border-left: 0; border-top: 1px solid var(--room-line); height: min(42vh, 400px); }
  .rbtn .lbl { display: none; }
  .rbtn { min-width: 40px; height: 40px; padding: 0 10px; }
  .rbtn.red { padding: 0 14px; }
  .room-bar { gap: 6px; padding-top: 8px; padding-bottom: 10px; }
  .stage { padding: 6px 10px 8px; }
  .tiles { gap: 8px; }
  .lobby-card { padding: 10px 12px; gap: 10px; margin-top: 8px; }
  .lobby-card p { min-width: 0; font-size: 13px; }
  .captions { font-size: 15px; min-height: 44px; }
  .prejoin { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .room-head .people-pill { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; } }

/* ---------- test mode bar ---------- */
.testbar { background: var(--cue-soft); border-bottom: 1px solid color-mix(in srgb, var(--cue) 40%, transparent); }
.testbar-in { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); font-size: 13.5px; }
.testbar-in > svg { width: 18px; height: 18px; color: var(--warn); flex: none; }
.testbar-in p { flex: 1 1 320px; min-width: 0; }
.test-switch { margin-top: 10px; border: 1px dashed var(--line); background: transparent; cursor: pointer; text-align: left; font: inherit; font-weight: 600; font-size: 14px; }
.test-switch:hover { border-color: var(--cobalt-line); }

/* ---------- faces ---------- */
.noface { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; background: radial-gradient(120% 90% at 50% 30%, color-mix(in srgb, var(--tint, #8FA3FF) 22%, #1d2433), #121722 70%); color: #C9D1E0; text-align: center; padding: 10px; }
.noface .initials { width: 64px; height: 64px; font-size: 22px; color: #0B0F1A; box-shadow: 0 0 0 4px rgba(255,255,255,.06); }
.noface small { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: #AEB8CC; }
.noface .spinner { width: 13px; height: 13px; }
.av.round .noface { padding: 0; }
.av.round .noface .initials { width: 100%; height: 100%; font-size: 12px; box-shadow: none; }
.av.xs .noface .initials, .av.sm .noface .initials { font-size: 11.5px; }
.av > img.photo { animation: drift 14s ease-in-out infinite alternate; transform-origin: 50% 35%; }
.av.round > img.photo { animation: none; }
.av.talking > img.photo { animation: talkphoto .42s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1.02) translateY(0); } to { transform: scale(1.06) translateY(-0.6%); } }
@keyframes talkphoto { from { transform: scale(1.04) translateY(0); } to { transform: scale(1.055) translateY(-0.5%); } }
.face-status { display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border-radius: 12px; background: var(--sunken); font-size: 14px; }
.face-status.ok { background: var(--ok-soft); color: var(--ok); }
.face-status.cobalt { background: var(--cobalt-soft); color: var(--ink); }
.face-status.live { background: var(--cue-soft); color: var(--ink); }
.face-status.bad { background: var(--bad-soft); color: var(--bad); }
.face-status .spinner { margin-top: 2px; }
.agent-card .av .noface small { font-size: 12px; }
