/* VivaRoom — single-page UI.
   Look: a chat product. A sidebar holds your vivas; the viva itself is one full-page conversation
   with the composer at the bottom. The two examiners keep their colours (the two voices in the logo),
   and their words light up inside their own message as they speak.
   Accessibility: WCAG 2.2 AA contrast, visible focus, 44px targets, reduced-motion support,
   nothing conveyed by colour alone. */

/* Design tokens.
   Canvas and surfaces are cool and quiet; ink does the work. Coral and teal belong to the two
   examiners only (they are the two voices in the logo), so colour on the stage always means "who is speaking". */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --ink: #12161f;
  --ink-soft: #535c6e;
  --line: #e2e5eb;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: #e5f3f1;
  --external: #b4384d;
  --internal: #0f766e;
  --student: #2b4a7a;
  --ok: #16794c;
  --warn: #9a5800;
  --bad: #b42318;
  --focus: #2563eb;
  /* stage (always dark) */
  --stage: #10141c;
  --stage-2: #171d29;
  --stage-line: #263044;
  --stage-ink: #eef0f4;
  --stage-soft: #a9b1c3;
  --stage-dim: #8b94a8; /* readable (6:1) yet clearly dimmer than spoken words */
  --glow-external: #ec8f9c;
  --glow-internal: #5fc3b9;
  --glow-student: #9db6ea;
  --glow-think: #8a93a8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18, 22, 31, .05), 0 1px 1px rgba(18, 22, 31, .03);
  --shadow-lg: 0 12px 32px rgba(18, 22, 31, .12), 0 2px 6px rgba(18, 22, 31, .06);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: var(--sans);
  --brand-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0f15;
    --surface: #141922;
    --surface-2: #1b212c;
    --ink: #e8ebf1;
    --ink-soft: #a3abbc;
    --line: #262d3a;
    --accent: #4fbfb4;
    --accent-ink: #06201d;
    --accent-soft: #15302e;
    --external: #ef9aa8;
    --internal: #5fc3b9;
    --student: #9fb4dc;
    --ok: #5cc28a;
    --warn: #e3a951;
    --bad: #f08a80;
    --focus: #7aa2ff;
    --stage: #090c11;
    --stage-2: #121722;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .45);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 .75em; }
[hidden] { display: none !important; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 10; background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: 8px; }
.skip-link:focus { top: 1rem; }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: .6rem; }
.brand-mark { display: block; flex: none; width: 30px; height: 30px; }
.brand-name { font-family: var(--brand-serif); font-size: 1.18rem; font-weight: 700; letter-spacing: .005em; }

.demo-banner { margin: 1rem clamp(1rem, 4vw, 2.5rem) 0; padding: .75rem 1rem; background: var(--surface-2); border: 1px dashed var(--warn); border-radius: 10px; }
.alert { margin: 1rem clamp(1rem, 4vw, 2.5rem) 0; padding: .85rem 1rem; border-radius: 10px; background: color-mix(in srgb, var(--bad) 12%, var(--surface)); border: 1px solid var(--bad); }

main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: clamp(1rem, 3vw, 2rem); outline: none; }
.view { animation: rise .35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.1rem, 2.5vw, 1.5rem); }
.card-title { font-size: 1.2rem; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .6rem 1.15rem; border-radius: 10px; border: 1px solid transparent; font: 600 1rem/1 var(--sans); cursor: pointer; transition: background-color .15s, border-color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not([disabled]) { background: color-mix(in srgb, var(--accent) 85%, var(--ink)); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not([disabled]) { background: var(--surface-2); }
.btn-block { width: 100%; }
.btn.is-loading .btn-label::after { content: "…"; }
.link-btn { background: none; border: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; padding: .25rem; min-height: 44px; }

/* ---------- Setup ---------- */
.setup-intro h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); letter-spacing: -.01em; margin-top: .5rem; }
.lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 36rem; }
.how { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .85rem; }
.how li { display: flex; align-items: center; gap: .85rem; font-weight: 500; }
.how li span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; flex: none; }
.field { margin-bottom: 1.1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }
label, .label { display: block; font-weight: 600; margin-bottom: .35rem; }
.hint { font-size: .875rem; color: var(--ink-soft); margin: .35rem 0 0; }
input[type="text"], select, textarea { width: 100%; min-height: 44px; padding: .65rem .8rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
input[aria-invalid="true"] { border-color: var(--bad); }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; min-height: 132px; padding: 1.25rem; text-align: center; font-weight: 400; border: 2px dashed var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone-icon { color: var(--accent); }
.dropzone-file { font-weight: 600; color: var(--accent); word-break: break-all; }
.dropzone.has-file { border-style: solid; border-color: var(--accent); }
.check { display: grid; grid-template-columns: auto 1fr; gap: .25rem .7rem; align-items: start; }
.check input { width: 22px; height: 22px; margin-top: .15rem; accent-color: var(--accent); }
.check label { font-weight: 500; margin: 0; }
.check .hint { grid-column: 2; }
.status-line { min-height: 1.5em; margin: .75rem 0 0; color: var(--ink-soft); font-size: .95rem; text-align: center; }

/* ---------- Shared pieces of the viva room ---------- */
.live-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .65rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: .8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #d4483a; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes morph {
  0%, 100% { border-radius: 58% 42% 55% 45% / 48% 56% 44% 52%; }
  33% { border-radius: 42% 58% 47% 53% / 58% 42% 58% 42%; }
  66% { border-radius: 52% 48% 38% 62% / 44% 54% 46% 56%; }
}
@keyframes swell { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes halo { 0% { transform: scale(.95); opacity: .5; } 100% { transform: scale(1.8); opacity: 0; } }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }
@keyframes micpulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--student) 45%, transparent); } 100% { box-shadow: 0 0 0 16px transparent; } }
.skip { min-height: 32px; padding: 0 .75rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font: 600 .8rem var(--sans); cursor: pointer; }
.skip:hover { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); }

/* source chips (in messages) */
.src { display: inline-flex; align-items: center; gap: .4rem; max-width: 100%; padding: .3rem .7rem; border-radius: 999px; font-size: .8rem; line-height: 1.3; text-decoration: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.src svg { flex: none; }
.src .src-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22rem; color: var(--ink-soft); }
a.src:hover { border-color: var(--accent); }
.unverified { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border-radius: 999px; font-size: .8rem; border: 1px dashed var(--warn); color: var(--warn); }
kbd { font: 600 .72rem/1 var(--sans); padding: .15rem .35rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--ink); }

/* checklist and reading */
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.progress.slim { height: 6px; margin: .5rem 0 .9rem; }
.progress-fill { display: block; height: 100%; width: 0; background: var(--accent); transition: width .5s ease; }
.progress-text { font-size: .88rem; color: var(--ink-soft); margin: .5rem 0 1rem; }
.coverage { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.coverage li { display: grid; grid-template-columns: 24px 1fr; gap: 0 .6rem; align-items: center; font-size: .92rem; line-height: 1.3; }
.coverage .cov-state { grid-column: 2; font-size: .76rem; color: var(--ink-soft); }
.cov-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); font-size: .75rem; font-weight: 700; }
.cov-in_progress .cov-icon { border-color: var(--warn); color: var(--warn); }
.cov-in_progress { font-weight: 600; }
.cov-covered .cov-icon { background: var(--ok); border-color: var(--ok); color: #fff; }
.reading-status { margin: 0; font-size: .88rem; color: var(--ink-soft); }
.reading-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.reading-list li { font-size: .86rem; line-height: 1.35; }
.reading-list .rl-kind { display: block; font-size: .74rem; font-weight: 650; color: var(--ink-soft); }
.reading-list a, .reading-list .rl-title { display: block; color: var(--ink); text-decoration: none; }
.reading-list a:hover .rl-title-text { text-decoration: underline; }
.reading-list .rl-label { font-weight: 600; }
.reading-list .rl-title-text { color: var(--ink-soft); }
.switch { display: flex; align-items: center; gap: .5rem; }
.switch input { width: 38px; height: 22px; margin: 0; accent-color: var(--accent); }
.switch label { margin: 0; font-weight: 550; font-size: .88rem; }

/* ---------- Report ---------- */
.report { max-width: 860px; margin: 0 auto; }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; color: var(--accent); margin: 0 0 .25rem; }
.doc-title { font-family: var(--serif); font-style: italic; color: var(--ink-soft); }
.readiness { display: grid; grid-template-columns: auto auto; align-items: baseline; justify-content: center; width: 128px; height: 128px; border-radius: 50%; place-content: center; text-align: center; border: 8px solid var(--accent-soft); background: var(--surface); }
.readiness-num { font: 700 2.4rem/1 var(--serif); }
.readiness-pct { font: 700 1.1rem/1 var(--serif); }
.readiness-label { grid-column: 1 / -1; font-size: .8rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }
.report-overall { font-size: 1.1rem; margin: 1.25rem 0; }
.section-title { font-size: 1.15rem; margin-top: 1.75rem; }
.subhead { color: var(--ink-soft); font-size: .95rem; }
.report-refs { font-size: 1rem; }
.scorecard { width: 100%; border-collapse: collapse; font-size: .95rem; }
.scorecard th, .scorecard td { text-align: left; padding: .65rem .5rem; border-bottom: 1px solid var(--line); }
.scorecard th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; border: 1px solid currentColor; }
.badge-good { color: var(--ok); } .badge-mid { color: var(--warn); } .badge-bad { color: var(--bad); } .badge-none { color: var(--ink-soft); }
.report-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 700px) { .report-cols { grid-template-columns: 1fr; } }
.ticks, .arrows, .check-list { padding-left: 1.2rem; }
.ticks li::marker { content: "✓  "; color: var(--ok); }
.arrows li::marker { content: "→  "; color: var(--warn); }
.check-list li::marker { content: "?  "; color: var(--warn); font-weight: 700; }
.ticks li, .arrows li, .questions li, .check-list li { margin-bottom: .45rem; }
.check-list li { font-size: .92rem; color: var(--ink-soft); }
.report-actions { display: flex; gap: .75rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 2rem; }

.footer { text-align: center; padding: 1.25rem; color: var(--ink-soft); font-size: .875rem; border-top: 1px solid var(--line); }
.footer p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  body { background: #fff; color: #000; }
  .topbar, .footer, .no-print, .alert, .demo-banner, #view-setup, #view-room, .side-nav { display: none !important; }
  .card { box-shadow: none; border: 0; }
  main { padding: 0; }
  .reading-list a::after { content: " (" attr(href) ")"; font-size: .8em; color: #555; }
}

/* ---------- Accounts ---------- */
input[type="email"], input[type="password"] { width: 100%; min-height: 44px; padding: .65rem .8rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
.btn-sm { min-height: 40px; padding: .45rem .85rem; font-size: .95rem; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover:not([disabled]) { background: color-mix(in srgb, var(--bad) 85%, #000); }
.btn-google { background: var(--surface); color: var(--ink); border-color: var(--line); text-decoration: none; }
.btn-google:hover { background: var(--surface-2); }
.center { text-align: center; }
.status-line.left { text-align: left; }

.account-nav { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.menu { position: relative; }
.menu-trigger { display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: .25rem .5rem; border-radius: 10px; cursor: pointer; list-style: none; }
.menu-trigger::-webkit-details-marker { display: none; }
.menu-trigger:hover { background: var(--surface-2); }
.menu-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.menu-email { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; color: var(--ink-soft); }
.menu-list { position: absolute; right: 0; top: calc(100% + .35rem); z-index: 20; min-width: 200px; padding: .35rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.menu-item { display: block; width: 100%; min-height: 44px; padding: .5rem .75rem; text-align: left; background: none; border: 0; border-radius: 8px; color: var(--ink); font: inherit; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); }

#view-auth { display: grid; grid-template-columns: 1.1fr minmax(0, 440px); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
@media (max-width: 900px) { #view-auth { grid-template-columns: 1fr; } #view-auth .setup-intro .lede { display: none; } }
.trust { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: .7rem; }
.trust li { position: relative; padding-left: 1.8rem; color: var(--ink-soft); }
.trust li::before { content: ""; position: absolute; left: 0; top: .3rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--accent-soft); box-shadow: inset 0 0 0 4px var(--accent-soft), inset 0 0 0 10px var(--accent); }
.auth-card .card-title { font-size: 1.45rem; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem; margin: .5rem 0 0; }
.auth-switch { margin: 1rem 0 0; text-align: center; color: var(--ink-soft); }
.divider { display: flex; align-items: center; gap: .75rem; margin: 1rem 0; color: var(--ink-soft); font-size: .9rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 4.5rem; }
.pw-toggle { position: absolute; right: .25rem; top: 50%; transform: translateY(-50%); min-height: 36px; min-width: 56px; padding: 0 .6rem; border: 0; border-radius: 8px; background: transparent; color: var(--accent); font: 600 .9rem var(--sans); cursor: pointer; }
.pw-toggle:hover { background: var(--surface-2); }
.code-input { font: 600 1.5rem/1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace !important; letter-spacing: .4em; text-align: center; }
input[type="text"][aria-invalid="true"], input[type="email"][aria-invalid="true"], input[type="password"][aria-invalid="true"] { border-color: var(--bad); }

.view.narrow { max-width: 820px; margin: 0 auto; }
.view-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.view-head h1 { margin: 0; }
.viva-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .85rem; }
.viva-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.viva-item-main { min-width: 0; flex: 1 1 18rem; }
.viva-item-title { font-size: 1.1rem; margin: 0 0 .25rem; overflow-wrap: anywhere; }
.viva-item-meta { margin: 0 0 .4rem; color: var(--ink-soft); font-size: .92rem; }
.viva-item-actions { display: flex; gap: .5rem; }
.pill { display: inline-block; padding: .15rem .65rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .85rem; font-weight: 600; }
.pill-live { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.account-line { margin-bottom: 1.25rem; }
#view-account .card { margin-bottom: 1.25rem; }
.card.danger { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.report-transcript { margin-top: 1.5rem; }
@media print { .account-nav, .report-transcript:not([open]) { display: none !important; } }

/* ---------- Practice / exam mode ---------- */
.mode-choice { border: 0; padding: 0; margin: 0 0 1.1rem; min-width: 0; }
.mode-choice legend { margin-bottom: .45rem; padding: 0; }
.mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
@media (max-width: 600px) { .mode-options { grid-template-columns: 1fr; } }
.mode-option { position: relative; display: flex; gap: .65rem; align-items: flex-start; padding: .85rem .95rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.mode-option:hover { background: var(--surface-2); }
.mode-option:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.mode-option input { margin-top: .2rem; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.mode-option input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.mode-body { display: grid; gap: .2rem; }
.mode-title { font-weight: 700; display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.mode-desc { color: var(--ink-soft); font-size: .92rem; line-height: 1.45; }

/* ---------- Help buttons in the room ---------- */
.help-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip-btn { min-height: 36px; padding: .3rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font: 600 .86rem var(--sans); cursor: pointer; }
.chip-btn:hover:not([disabled]) { border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); color: var(--ink); }
.chip-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.chip-btn[disabled] { opacity: .5; cursor: not-allowed; }
.chip-btn[hidden] { display: none; }

/* ---------- Labels on coaching moments ---------- */
.kind-tag { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .01em; background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line); }
.kind-coach { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); border-color: transparent; }
.kind-hint, .kind-rephrase { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.kind-retry { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); border-color: transparent; }

/* ---------- Report: questions you found hard ---------- */
.coach-list { list-style: none; padding: 0; margin: .5rem 0 1.5rem; display: grid; gap: .8rem; }
.coach-item { padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); break-inside: avoid; }
.coach-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; align-items: center; margin-bottom: .35rem; }
.coach-area { font-size: .85rem; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.coach-badge { padding: .12rem .6rem; border-radius: 999px; font-size: .82rem; font-weight: 700; }
.coach-good { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.coach-bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.coach-neutral { background: var(--surface-2); color: var(--ink-soft); }
.coach-q { margin: 0 0 .5rem; font-family: var(--serif); font-size: 1.05rem; }

/* ---------- Setup: saved thesis / upload, focus areas ---------- */
.doc-source { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
.doc-source legend { padding: 0; margin-bottom: .45rem; }
.seg { display: inline-flex; flex-wrap: wrap; gap: .25rem; padding: .25rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.seg-opt { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: .3rem .85rem; border-radius: 9px; cursor: pointer; font-weight: 600; }
.seg-opt:has(input:checked) { background: var(--surface); box-shadow: var(--shadow); }
.seg-opt input { accent-color: var(--accent); }
#saved-pick { margin: .75rem 0 0; }
#saved-pick select { width: 100%; }
.focus-pick { margin: 0 0 1.1rem; border: 1px solid var(--line); border-radius: 12px; padding: .2rem .95rem; background: var(--surface); }
.focus-pick summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.focus-pick[open] { padding-bottom: .85rem; }
.hint-inline { font-weight: 400; color: var(--ink-soft); margin-left: .3rem; }
.focus-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem .9rem; }
@media (max-width: 600px) { .focus-grid { grid-template-columns: 1fr; } }
.focus-opt { display: flex; align-items: center; gap: .55rem; min-height: 40px; cursor: pointer; }
.focus-opt input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- Saved theses & progress ---------- */
.thesis-list { list-style: none; padding: 0; margin: .5rem 0 2rem; display: grid; gap: .9rem; }
.thesis-title { margin: 0 0 .2rem; font-size: 1.15rem; overflow-wrap: anywhere; }
.progress-table { width: 100%; border-collapse: collapse; margin: .75rem 0 1rem; font-size: .95rem; }
.progress-table th, .progress-table td { padding: .4rem .25rem; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
.progress-table th { font-weight: 600; width: 45%; }
.progress-table tr.is-weak th::after { content: "Focus"; margin-left: .5rem; padding: .05rem .45rem; border-radius: 999px; font-size: .72rem; font-weight: 700; background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.progress-table .latest { color: var(--ink-soft); text-align: right; white-space: nowrap; }
.dots { white-space: nowrap; }
.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; vertical-align: middle; margin-right: .3rem; }
.dot-good { background: var(--ok); }
.dot-ok { background: var(--warn); }
.dot-weak { background: var(--bad); }
.dot-none { color: var(--ink-soft); font-size: .85rem; }
.thesis-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 600px) { .progress-table th { width: auto; } .progress-table .latest { display: none; } }

/* ---------- Question pack ---------- */
.head-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.pack-empty { margin: 1rem 0; }
.pack-list { padding-left: 1.4rem; margin: .4rem 0 1.5rem; display: grid; gap: .55rem; }
.pack-q { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: .1rem .95rem; break-inside: avoid; }
.pack-q summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-family: var(--serif); font-size: 1.04rem; padding: .45rem 0; }
.pack-q[open] { padding-bottom: .8rem; }
.pack-why { color: var(--ink-soft); margin: 0 0 .5rem; }

/* ---------- Speaking feedback ---------- */
.speak-stats { list-style: none; padding: 0; margin: .5rem 0 .75rem; display: flex; flex-wrap: wrap; gap: .6rem; }
.speak-stats li { padding: .6rem .9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink-soft); }
.speak-num { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; color: var(--ink); margin-right: .15rem; }

/* ---------- Share with supervisor ---------- */
.share-panel { margin: 1.5rem 0 1rem; }
.copy-row { display: flex; gap: .5rem; }
.copy-row input { flex: 1; min-width: 0; }
.report-actions { flex-wrap: wrap; }

/* ---------- Shared (read-only) report page ---------- */
.shared-page .topbar { justify-content: flex-start; }
.shared-report h1 { margin: .25rem 0 .5rem; overflow-wrap: anywhere; }
.shared-who { margin: 0 0 .25rem; }
.shared-note { color: var(--ink-soft); font-size: .92rem; margin: 0 0 1.25rem; }
.shared-score { margin-bottom: 1.25rem; }
.shared-readiness { margin: 0 0 .5rem; color: var(--ink-soft); }
.shared-readiness-num { font-family: var(--serif); font-size: 2.2rem; font-weight: 700; color: var(--ink); margin-right: .35rem; }
.shared-transcript { max-height: none; }

@media print {
  .pack-q { border: 0; padding: 0; }
  .pack-q summary { min-height: 0; font-weight: 700; }
  #view-pack .hint, .head-actions { display: none !important; }
}

/* ---------- Research materials (setup) ---------- */
.materials { border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; margin: 0 0 1.1rem; background: var(--surface); }
.mat-title { margin: 0 0 .25rem; font-size: 1rem; }
.mat-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .6rem 0 .25rem; }
.mat-pick { position: relative; cursor: pointer; }
.mat-pick:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.mat-list { list-style: none; padding: 0; margin: .4rem 0; display: grid; gap: .4rem; }
.mat-item { display: flex; align-items: flex-start; gap: .65rem; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 10px; }
.mat-kind { flex: none; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--surface-2); color: var(--ink-soft); margin-top: .1rem; }
.mat-kind.kind-table { background: var(--accent-soft); color: var(--accent); }
.mat-kind.kind-code, .mat-kind.kind-notebook { background: color-mix(in srgb, var(--student) 15%, transparent); color: var(--student); }
.mat-main { flex: 1; min-width: 0; }
.mat-name { margin: 0; font-weight: 600; overflow-wrap: anywhere; font-size: .93rem; }
.mat-sum { margin: .1rem 0 0; color: var(--ink-soft); font-size: .88rem; }
.mat-share { display: flex; align-items: flex-start; gap: .45rem; margin-top: .35rem; font-size: .86rem; color: var(--ink-soft); cursor: pointer; }
.mat-share input { margin-top: .2rem; accent-color: var(--accent); }
.mat-notes, .mat-sent { margin-top: .6rem; }
.mat-notes summary, .mat-sent summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; font-weight: 600; font-size: .93rem; }
.mat-notes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem .9rem; margin-top: .4rem; }
@media (max-width: 600px) { .mat-notes-grid { grid-template-columns: 1fr; } }
.mat-notes textarea { width: 100%; min-height: 0; }
.mat-sent-list { margin: .3rem 0 0; padding-left: 1.2rem; color: var(--ink-soft); font-size: .88rem; display: grid; gap: .25rem; }
.focus-opt.is-off { opacity: .55; }

/* ---------- Visual board: shared chart styles ---------- */
.board, .review-fig, .calc-out, .slide-card-visual {
  --v-ink: var(--ink); --v-soft: var(--ink-soft); --v-line: var(--line); --v-accent: var(--accent);
  --v-hi: var(--bad); --v-ok: var(--ok); --v-warn: var(--warn); --v-bg: var(--surface);
}
.board { margin: 0; padding: .8rem .95rem .7rem; border: 1px solid var(--v-line); border-radius: 14px; background: var(--v-bg); }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .3rem; }
.board-title, .review-fig-title { margin: 0; font-size: .9rem; font-weight: 700; color: var(--v-soft); }
.board-body { width: 100%; }
.v-svg { width: 100%; height: auto; display: block; max-height: 340px; }
.board-notes { list-style: none; padding: 0; margin: .35rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.board-notes li { padding: .2rem .65rem; border-radius: 999px; border: 1px solid var(--v-hi); color: var(--v-hi); font-size: .85rem; font-weight: 600; }

.v-axis { stroke: var(--v-soft); stroke-width: 1; }
.v-grid { stroke: var(--v-line); stroke-width: 1; }
.v-tick { fill: var(--v-soft); font-size: 12px; font-family: var(--sans); }
.v-label { fill: var(--v-ink); font-size: 12.5px; font-family: var(--sans); }
.v-bar { fill: var(--v-accent); }
.v-bar.is-hi { fill: var(--v-hi); }
.v-grow { transform-box: fill-box; transform-origin: bottom; transform: scaleY(0); transition: transform .6s cubic-bezier(.2,.8,.2,1), fill .3s; }
.v-growx { transform-box: fill-box; transform-origin: left; transform: scaleX(0); transition: transform .6s cubic-bezier(.2,.8,.2,1), fill .3s; }
.v-grow.v-in, .v-growx.v-in { transform: none; }
.v-band { fill: var(--v-hi); fill-opacity: .13; }
.v-ring { fill: none; stroke: var(--v-hi); stroke-width: 2.5; }
.v-dot { fill: var(--v-accent); fill-opacity: .8; }
.v-dot.is-hi { fill: var(--v-hi); fill-opacity: 1; }
.v-trend, .v-line { fill: none; stroke: var(--v-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.v-line { stroke: var(--v-accent); }
.v-whisker { stroke: var(--v-accent); stroke-width: 2; }
.v-box { fill: var(--v-accent); fill-opacity: .2; stroke: var(--v-accent); stroke-width: 2; }
.v-median { stroke: var(--v-ink); stroke-width: 3; }
.v-median.is-hi { stroke: var(--v-hi); }
.v-cell-pos { fill: var(--v-accent); }
.v-cell-neg { fill: var(--v-hi); }
.v-cell-text { fill: var(--v-ink); font-size: 12px; font-family: var(--sans); font-weight: 600; }
.v-cellring { fill: none; stroke: var(--v-hi); stroke-width: 3; }
.v-node { fill: none; stroke: var(--v-ink); stroke-width: 2; stroke-linejoin: round; }
.v-node-2 { stroke-width: 1; opacity: .45; }
.v-node-text { fill: var(--v-ink); font-size: 13.5px; font-family: var(--sans); font-weight: 600; }
.v-arrow { fill: none; stroke: var(--v-ink); stroke-width: 2; stroke-linecap: round; }
.v-missing { fill: none; stroke: var(--v-hi); stroke-width: 2; stroke-dasharray: 6 5; }
.v-missing-text { fill: var(--v-hi); font-size: 13.5px; font-family: var(--sans); font-weight: 700; }
.v-fade { opacity: 0; transition: opacity .45s ease; }
.v-fade.v-in { opacity: 1; }

.v-compare { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .6rem; }
@media (max-width: 600px) { .v-compare { grid-template-columns: 1fr; } .v-cmp-vs { justify-self: center; } }
.v-cmp-card { border: 1.5px solid var(--v-accent); border-radius: 12px; padding: .7rem .85rem; }
.v-cmp-card.is-right { border-color: var(--v-hi); }
.v-cmp-label { margin: 0 0 .3rem; font-size: .8rem; font-weight: 700; color: var(--v-soft); }
.v-cmp-text { margin: 0; color: var(--v-ink); font-family: var(--serif); font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }
.v-cmp-text.is-code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .86rem; }
.v-cmp-vs { font-size: 1.6rem; font-weight: 700; color: var(--v-hi); }

.v-calc { display: grid; gap: .35rem; }
.v-calc-line, .v-calc-verdict { margin: 0; opacity: 0; transform: translateY(4px); transition: opacity .4s, transform .4s; }
.v-calc-line.is-shown, .v-calc-verdict.is-shown { opacity: 1; transform: none; }
.v-calc-label { display: block; font-size: .78rem; color: var(--v-soft); }
.v-calc-eq { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .92rem; color: var(--v-ink); overflow-wrap: anywhere; }
.v-calc-eq.st-ok, .v-calc-verdict.st-ok { color: var(--v-ok); }
.v-calc-eq.st-warn, .v-calc-verdict.st-warn { color: var(--v-warn); }
.v-calc-eq.st-bad, .v-calc-verdict.st-bad { color: var(--v-hi); }
.v-calc-verdict { font-weight: 700; padding: .35rem .6rem; border-radius: 8px; border: 1px solid currentColor; justify-self: start; }
.v-calc-src { margin: .2rem 0 0; font-size: .8rem; color: var(--v-soft); }
@media (prefers-reduced-motion: reduce) { .v-calc-line, .v-calc-verdict, .v-fade { transition: none; } }

/* ---------- Data review page ---------- */
.data-intake { margin: 1rem 0; }
.data-intake .materials { border: 0; padding: 0; margin: 0 0 .75rem; }
.issue-list { list-style: none; padding: 0; margin: .5rem 0 1.75rem; display: grid; gap: .9rem; }
.issue-item { padding: 1rem 1.1rem; border: 1px solid var(--line); border-left-width: 4px; border-radius: 12px; background: var(--surface); }
.issue-item.sev-high { border-left-color: var(--bad); }
.issue-item.sev-medium { border-left-color: var(--warn); }
.issue-item.sev-low { border-left-color: var(--line); }
.issue-item.is-clear { border-left-color: var(--ok); color: var(--ink-soft); }
.issue-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; }
.issue-title { margin: 0; font-size: 1.05rem; }
.sev-pill.sev-high { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); border-color: transparent; }
.sev-pill.sev-medium { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); border-color: transparent; }
.issue-detail { margin: .35rem 0; color: var(--ink-soft); }
.issue-q { margin: 0 0 .6rem; font-family: var(--serif); font-style: italic; font-size: 1.05rem; }
.review-fig { margin: .5rem 0; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 12px; background: var(--v-bg); }
.file-card { margin-bottom: 1rem; }
.file-title { margin: 0 0 .15rem; font-size: 1.05rem; overflow-wrap: anywhere; }
.table-scroll { overflow-x: auto; margin: .6rem 0; }
.col-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.col-table th, .col-table td { text-align: left; padding: .4rem .45rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.col-table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.col-table tbody th { font-weight: 600; white-space: nowrap; }
.mini-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .6rem; }
.mini-charts .review-fig { margin: 0; }
.code-facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem .9rem; margin: .6rem 0 0; font-size: .92rem; }
.code-facts dt { font-weight: 600; color: var(--ink-soft); }
.code-facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .code-facts { grid-template-columns: 1fr; } .code-facts dd { margin-bottom: .3rem; } }
.calc-card { margin: 1.5rem 0; }
.calc-card select { width: 100%; }
.calc-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .2rem .8rem; }
.calc-inputs input, .calc-inputs select { width: 100%; }
.err-line { min-height: 1.2rem; margin: .2rem 0; color: var(--bad); font-size: .9rem; }
.calc-out { padding: .2rem 0; }

/* ---------- Report: data findings ---------- */
.finding-list { list-style: none; padding: 0; margin: .5rem 0 1.5rem; display: grid; gap: .55rem; }
.finding { padding: .7rem .9rem; border: 1px solid var(--line); border-left-width: 4px; border-radius: 10px; background: var(--surface); break-inside: avoid; }
.finding.sev-high { border-left-color: var(--bad); }
.finding.sev-medium { border-left-color: var(--warn); }
.finding-title { margin: 0; font-weight: 700; }
.finding-detail { margin: .2rem 0 0; color: var(--ink-soft); }

/* ---- Defence presentation -------------------------------------------------------------- */
#view-present { max-width: 980px; margin: 0 auto; }
.present-setup { max-width: 680px; margin: 1rem auto 0; }
.present-tabs { margin: .75rem 0 1rem; }
.seg-btn { min-height: 44px; padding: .35rem .9rem; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.seg-btn[aria-pressed="true"] { background: var(--surface); box-shadow: var(--shadow); color: var(--accent); }
.seg-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.slide-stage { background: var(--stage); color: var(--stage-ink); border-radius: var(--radius); padding: clamp(.75rem, 2vw, 1.25rem); }
.slide-frame { aspect-ratio: 16 / 9; width: 100%; border-radius: 10px; overflow: hidden; background: #fff; display: flex; }
.slide-frame-sm { max-width: 520px; }
.slide-card { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; }
.slide-img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.slide-card.is-text { padding: clamp(1rem, 4vw, 2.5rem); background: linear-gradient(135deg, #fffdf8 0%, #f3efe4 100%); color: #1c2433; justify-content: flex-start; overflow: auto; }
.slide-card.is-text::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: linear-gradient(#ec8f9c, #5fc3b9); }
.slide-card-title { font-family: var(--serif); font-weight: 700; font-size: clamp(1.1rem, 3vw, 1.9rem); line-height: 1.2; margin: 0 0 .75rem; }
.slide-card-bullets { margin: 0; padding-left: 1.2rem; font-size: clamp(.85rem, 1.8vw, 1.15rem); line-height: 1.5; }
.slide-card.has-visual { justify-content: flex-start; gap: .5rem; }
.slide-card.has-visual .slide-card-title { margin-bottom: .25rem; font-size: clamp(1rem, 2.4vw, 1.5rem); }
.slide-card.has-visual .slide-card-bullets { font-size: clamp(.78rem, 1.5vw, .98rem); line-height: 1.4; }
.slide-card-visual { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 6px; padding: .25rem; }
.slide-card-visual .v-svg { width: 100%; height: 100%; max-height: 100%; }
.slide-card-visual.is-picture img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.slide-card-n { position: absolute; right: .9rem; bottom: .6rem; font-size: .8rem; color: #59627a; }
.slide-bar { display: flex; justify-content: space-between; gap: 1rem; margin: .6rem .1rem 0; font-size: .9rem; color: var(--stage-soft); }
.ps-caption { min-height: 4.5em; margin: .6rem 0 0; font-size: 1.05rem; line-height: 1.6; color: var(--stage-soft); }
.ps-caption .w.is-said { color: var(--stage-ink); }
#rh-script { background: var(--surface-2); color: var(--ink); border-radius: 12px; padding: .75rem 1rem; }
.slide-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: .75rem; }
@media (max-width: 480px) { .slide-controls { display: grid; grid-template-columns: auto 1fr auto; } .slide-controls .btn { padding-left: .7rem; padding-right: .7rem; } }
.slide-stage .btn-ghost { color: var(--stage-ink); border-color: var(--stage-line); }
.present-panel > .hint { margin-top: .75rem; }

.script-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.script-words { margin: 0; font-weight: 600; }
.flag-inline { display: inline-block; padding: 0 .4rem; border-radius: 6px; background: #fdf0d5; color: #6b4500; font-weight: 700; font-size: .85em; }
.script-list { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 1rem; }
.script-slide-title { margin: 0 0 .5rem; font-size: 1.05rem; }
.key-points { list-style: none; padding: 0; margin: 0 0 .6rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.key-points li { padding: .15rem .6rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .85rem; font-weight: 600; }
.script-text { width: 100%; font: inherit; font-size: 1rem; line-height: 1.55; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); resize: vertical; margin-bottom: .5rem; }
.script-text:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.script-flag { margin: 0 0 .5rem; padding: .4rem .65rem; border-left: 4px solid var(--warn); background: var(--surface-2); color: var(--ink); font-size: .92rem; }
.script-flag::before { content: "⚠ "; }

.rehearse-box { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; margin-top: .75rem; }
@media (max-width: 760px) { .rehearse-box { grid-template-columns: 1fr; } }
.rh-timer { font-size: clamp(2.2rem, 7vw, 3.4rem); font-weight: 700; font-variant-numeric: tabular-nums; margin: 0; line-height: 1; }
.rh-meter { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: .5rem 0; }
.rh-meter-fill { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s linear; }
.rh-meter-fill.is-over { background: var(--bad); }
.rehearse-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.rh-card { margin-top: 1rem; }
.rh-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin: .5rem 0 1rem; }
.rh-stat { padding: .75rem .9rem; border-radius: 12px; background: var(--surface-2); border-left: 5px solid var(--line); }
.rh-stat.is-good { border-left-color: var(--ok); }
.rh-stat.is-warn { border-left-color: var(--warn); }
.rh-stat.is-bad { border-left-color: var(--bad); }
.rh-stat-value { margin: 0; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rh-stat-label { margin: .1rem 0 0; font-size: .88rem; color: var(--ink-soft); }
.rh-advice { margin: 0 0 1rem; padding-left: 1.2rem; line-height: 1.55; }
.rh-sub { margin: 1rem 0 .4rem; font-size: 1rem; }
.rh-bars { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }
.rh-bars li { display: grid; grid-template-columns: 4.5rem 1fr 3.2rem; align-items: center; gap: .5rem; font-size: .9rem; }
.rh-bar-track { height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.rh-bar-fill { display: block; height: 100%; background: var(--internal); border-radius: 6px; }
.rh-bar-val { text-align: right; font-variant-numeric: tabular-nums; }
.rh-missed { margin: 0; padding-left: 1.2rem; line-height: 1.55; }
.rh-transcript { margin-top: 1rem; }
.rh-transcript p { white-space: pre-wrap; color: var(--ink-soft); }
.rh-history { padding-left: 1.2rem; line-height: 1.9; }

/* A slide shown on the examiners' board */
.board-body .slide-card { aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #fff; max-height: 46vh; }

@media (prefers-reduced-motion: reduce) { .rh-meter-fill { transition: none; } }
@media print { #view-present .slide-controls, #view-present .present-tabs { display: none !important; } }
.notice { padding: .75rem 1rem; border-radius: 12px; border-left: 5px solid var(--warn); background: var(--surface-2); }

/* ---- Panel style and the department's assessment form -------------------------------- */
.panel-pick { border: 0; padding: 0; margin: 0 0 1rem; }
.form-pick { margin-top: .25rem; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.form-pick summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.form-pick textarea { width: 100%; font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.criteria-list { margin: .25rem 0 0; padding-left: 1.3rem; display: grid; gap: .3rem; }
.criteria-item > span { margin-right: .5rem; }
.criteria-table td:last-child { color: var(--ink-soft); }
#report-criteria-wrap { margin-top: 1.25rem; }
.criteria-item .skip { border-color: var(--line); color: var(--ink-soft); }

/* =========================================================================================
   Product layer. Later rules refine the components above into one consistent system:
   sentence-case labels, ink primary actions, hairline structure, generous but even spacing.
   ========================================================================================= */
body { font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--sans); letter-spacing: -.015em; }
h1 { font-size: clamp(1.55rem, 2.4vw, 2rem); font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 1.12rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
.card-title { font-size: 1.05rem; font-weight: 650; }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--focus) 22%, transparent); }

.demo-banner, .alert { max-width: 1180px; margin: 1rem auto 0; width: calc(100% - 2 * clamp(1rem, 3vw, 2rem)); }
.demo-banner { border-style: solid; border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: color-mix(in srgb, var(--warn) 7%, var(--surface)); font-size: .92rem; }
main { max-width: 1180px; padding: clamp(1rem, 3vw, 2.25rem) clamp(1rem, 3vw, 2rem) 3rem; }
.view { animation: none; }
.footer { border-top: 1px solid var(--line); font-size: .82rem; padding: 1.1rem; }

/* ---- Surfaces ---- */
.card { border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.1rem, 2.4vw, 1.5rem); }
.page-head { margin: 0 0 1.5rem; }
.page-head h1 { margin: 0 0 .3rem; }
.page-sub { margin: 0; color: var(--ink-soft); font-size: 1rem; max-width: 46rem; }
.view-head { margin-bottom: 1rem; }
.view.narrow { max-width: 880px; }
.section-title { font-size: 1.02rem; font-weight: 650; margin: 2rem 0 .65rem; }
.eyebrow { text-transform: none; letter-spacing: 0; font-size: .88rem; font-weight: 600; color: var(--ink-soft); }
.hint { font-size: .86rem; line-height: 1.5; }
.hint-inline { font-size: .88em; }

/* ---- Buttons ---- */
.btn { min-height: 42px; padding: .55rem 1.05rem; border-radius: 10px; font: 600 .94rem/1 var(--sans); letter-spacing: -.005em; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover:not([disabled]) { background: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not([disabled]) { background: var(--surface-2); border-color: color-mix(in srgb, var(--ink) 18%, var(--line)); }
.btn-quiet { background: transparent; color: var(--ink-soft); border-color: transparent; padding-left: .7rem; padding-right: .7rem; }
.btn-quiet:hover:not([disabled]) { background: var(--surface-2); color: var(--ink); }
.btn-sm { min-height: 36px; padding: .4rem .8rem; font-size: .88rem; }
.btn-block { min-height: 48px; font-size: 1rem; }
.link-btn { min-height: 0; }

/* ---- Inputs ---- */
input[type="text"], input[type="email"], input[type="password"], select, textarea {
  min-height: 42px; padding: .55rem .75rem; border-radius: 10px; border-color: var(--line); background: var(--surface); font-size: .95rem;
  transition: border-color .15s, box-shadow .15s; }
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }
label, .label { font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.field { margin-bottom: 1rem; }
.check label { font-size: .93rem; }
.check input, .mode-option input, .focus-opt input { accent-color: var(--ink); }
.dropzone { min-height: 128px; border: 1.5px dashed color-mix(in srgb, var(--ink) 22%, var(--line)); background: var(--surface-2); border-radius: 12px; }
.dropzone:hover, .dropzone.is-over { border-color: var(--ink); background: var(--surface); }
.dropzone-icon, .dropzone-file { color: var(--ink); }
.dropzone.has-file { border-color: var(--ink); background: var(--surface); }
.dropzone-text { font-size: .95rem; }

.mode-options { gap: .6rem; }
.mode-option { border-radius: 12px; padding: .9rem 1rem; }
.mode-option:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--surface); }
.mode-desc { font-size: .86rem; }
.pill { font-size: .75rem; padding: .05rem .5rem; }
.pill-live { background: var(--accent-soft); color: var(--accent); }
.seg { background: var(--surface-2); border-radius: 11px; }
.seg-opt { min-height: 38px; font-size: .9rem; border-radius: 8px; }
.seg-opt:has(input:checked) { box-shadow: var(--shadow-lg); }
.panel-pick { margin-bottom: 0; }
.panel-pick > .label { display: none; }
.form-pick, .focus-pick, .materials { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: .15rem 1rem; margin: 0 0 .65rem; }
.form-pick summary, .focus-pick summary { min-height: 48px; display: flex; align-items: center; font-weight: 600; font-size: .93rem; cursor: pointer; }
.form-pick[open], .focus-pick[open] { padding-bottom: 1rem; }
.materials { padding: .95rem 1rem; }
.mat-title { font-size: .93rem; }
.criteria-list { padding-left: 1.4rem; }

/* ---- Sign in: the panel is the hero ---- */
#view-auth { grid-template-columns: minmax(0, 1.15fr) minmax(0, 420px); gap: clamp(1.5rem, 5vw, 4.5rem); align-items: center; min-height: calc(100vh - 200px); }
.auth-hero h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; letter-spacing: -.035em; margin: 0 0 .9rem; max-width: 15ch; }
.auth-hero .lede { font-size: 1.05rem; color: var(--ink-soft); max-width: 34rem; margin-bottom: 1.6rem; }
.hero-stage { background: var(--stage); color: var(--stage-ink); border-radius: 18px; padding: 1.4rem 1.5rem 1.3rem; max-width: 34rem; box-shadow: var(--shadow-lg); }
.hs-seats { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; }
.hs-seat { display: grid; justify-items: center; gap: .45rem; font-size: .76rem; color: var(--stage-soft); }
.hs-blob { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; font-weight: 700; font-size: .85rem; color: #fff; }
.hs-ex .hs-blob { background: #8a2f3c; box-shadow: 0 0 0 4px var(--stage), 0 0 0 6px rgba(236, 143, 156, .55); }
.hs-in .hs-blob { background: #1d5c5a; opacity: .6; }
.hs-ex .hs-name { color: var(--glow-external); }
.hs-wave { display: flex; align-items: center; justify-content: center; gap: 5px; height: 52px; }
.hs-wave i { width: 4px; height: 8px; border-radius: 2px; background: var(--glow-external); opacity: .85; animation: hswave 1.1s ease-in-out infinite; }
.hs-wave i:nth-child(2n) { animation-delay: .15s; } .hs-wave i:nth-child(3n) { animation-delay: .32s; } .hs-wave i:nth-child(5n) { animation-delay: .5s; }
@keyframes hswave { 0%, 100% { height: 6px; } 50% { height: 34px; } }
.hs-line { margin: 1.1rem 0 0; font-size: 1.02rem; line-height: 1.5; color: var(--stage-dim); }
.hs-said { color: var(--stage-ink); }
.trust { margin-top: 1.5rem; gap: .5rem; font-size: .9rem; }
.trust li::before { top: .35rem; width: .9rem; height: .9rem; background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
.auth-card { box-shadow: var(--shadow-lg); border-radius: 16px; padding: clamp(1.4rem, 3vw, 2rem); }
.auth-card .card-title { font-size: 1.3rem; letter-spacing: -.02em; }
@media (max-width: 900px) {
  #view-auth { grid-template-columns: 1fr; min-height: 0; }
  .auth-hero .lede, .trust { display: none; }
  .auth-hero h1 { font-size: 1.85rem; max-width: none; }
  .hero-stage { padding: 1rem 1.1rem; }
  .hs-blob { width: 40px; height: 40px; font-size: .72rem; }
  .hs-line { font-size: .93rem; }
}

.coach-area { text-transform: none; letter-spacing: 0; font-size: .85rem; }

/* ---- Report ---- */
.report { max-width: 900px; }
.readiness { width: 120px; height: 120px; border-width: 7px; border-color: var(--accent-soft); }
.readiness-num, .readiness-pct, .speak-num, .shared-readiness-num { font-family: var(--sans); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.readiness-label { text-transform: none; letter-spacing: 0; font-size: .78rem; }
.doc-title { font-family: var(--sans); font-style: normal; }
.report-overall { font-size: 1.02rem; line-height: 1.6; max-width: 46rem; }
.scorecard th { text-transform: none; letter-spacing: 0; font-size: .82rem; font-weight: 600; }
.scorecard td, .scorecard th { padding: .7rem .6rem; }
.badge { white-space: nowrap; font-size: .76rem; font-weight: 650; padding: .15rem .55rem; border-color: color-mix(in srgb, currentColor 35%, transparent); background: color-mix(in srgb, currentColor 7%, transparent); }
.coach-item, .pack-q, .speak-stats li { border-radius: 12px; }
.coach-q, .pack-q summary { font-family: var(--sans); font-weight: 550; font-size: 1rem; }
@media (max-width: 600px) {
  .scorecard th:last-child, .scorecard td:last-child { display: none; }
  .report-head .readiness { width: 96px; height: 96px; }
}

/* ---- My vivas: saved thesis cards ---- */
.thesis-card { padding: 0; overflow: hidden; }
.thesis-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.25rem .4rem; }
.thesis-head .thesis-title { font-size: 1.05rem; line-height: 1.35; }
.thesis-card .viva-item-meta { margin: .1rem 0 0; font-size: .86rem; }
.thesis-card .progress-table { margin: .5rem 0 0; }
.thesis-card .progress-table th, .thesis-card .progress-table td { padding: .5rem 1.25rem .5rem 0; font-size: .9rem; }
.thesis-card .progress-table th { padding-left: 1.25rem; font-weight: 550; }
.thesis-card .progress-table td.latest { padding-right: 1.25rem; font-size: .86rem; }
.progress-table tr.is-weak th::after { content: "Weak spot"; font-size: .7rem; padding: .05rem .45rem; }
.thesis-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .9rem 1.25rem; border-top: 1px solid var(--line); background: var(--surface-2); }
.thesis-tools { display: flex; flex-wrap: wrap; gap: .15rem; margin-left: auto; }
.viva-item { padding: 1rem 1.25rem; }
.viva-item-title { font-size: 1rem; }
@media (max-width: 640px) {
  .thesis-tools { margin-left: 0; width: 100%; }
  .thesis-actions > .btn { flex: 1 1 auto; }
}

/* ---- Presentation, pack, data, account: consistent widths and headers ---- */
#view-present { max-width: 980px; }
.present-tabs { display: flex; width: fit-content; max-width: 100%; }
.seg-btn { min-height: 38px; font-size: .9rem; border-radius: 8px; }
.seg-btn[aria-pressed="true"] { color: var(--ink); box-shadow: var(--shadow-lg); }
.slide-stage { border-radius: 16px; }
.key-points li { background: var(--surface-2); color: var(--ink); font-weight: 550; }
#view-account .card { max-width: 640px; }
.code-input { font-family: var(--sans) !important; font-variant-numeric: tabular-nums; }

/* Buttons that sit on a dark stage */
.slide-stage .btn-ghost { background: transparent; border-color: var(--stage-line); color: var(--stage-ink); }
.slide-stage .btn-ghost:hover:not([disabled]) { background: var(--stage-2); border-color: var(--stage-soft); }
.slide-stage .btn-primary { background: var(--stage-ink); color: var(--stage); }
.slide-stage .btn-primary:hover:not([disabled]) { background: #ffffff; }
/* Empty status lines should not leave gaps */
#history-status:empty, .materials .status-line:empty, #form-status:empty, #rh-status:empty { min-height: 0; margin: 0; }
.report-actions { align-items: center; }
@media (max-width: 600px) {
  .report-actions { flex-direction: column-reverse; align-items: stretch; }
  .report-actions .btn { width: 100%; }
  .view-head { align-items: flex-start; }
}
#view-data .mat-title { display: none; }
@media (prefers-color-scheme: dark) {
  .hero-stage, .slide-stage { border: 1px solid var(--stage-line); }
  .brand-mark rect { stroke: #263044; stroke-width: 2; }
}

/* ---- Splash: the two voices draw in while the app starts ---- */
.splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg);
  transition: opacity .3s ease; animation: splash-out .3s ease 12s forwards; }
.splash.is-done { opacity: 0; pointer-events: none; }
.splash-inner { display: grid; justify-items: center; gap: .9rem; }
.splash-mark { width: 64px; height: 64px; filter: drop-shadow(0 10px 24px rgba(16, 20, 28, .18)); }
.splash-mark .sp-ex, .splash-mark .sp-in { stroke-dasharray: 48; stroke-dashoffset: 48; animation: sp-draw .7s cubic-bezier(.3, .7, .2, 1) .1s forwards; }
.splash-mark .sp-in { animation-delay: .28s; }
.splash-mark .sp-dot { opacity: 0; transform-origin: 32px 50px; animation: sp-dot .35s ease .7s forwards; }
@keyframes sp-draw { to { stroke-dashoffset: 0; } }
@keyframes sp-dot { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
.splash-name { font: 700 1.35rem/1 var(--brand-serif); color: var(--ink); letter-spacing: .005em; }
.splash-bar { position: relative; width: 120px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.splash-bar i { position: absolute; inset: 0 auto 0 0; width: 40%; border-radius: 3px; background: var(--ink); animation: sp-bar 1.1s ease-in-out infinite; }
@keyframes sp-bar { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.splash-slow { font-size: .85rem; color: var(--ink-soft); }
@keyframes splash-out { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
  .splash { animation: splash-out 0s linear 12s forwards !important; }
  .splash-mark .sp-ex, .splash-mark .sp-in { stroke-dashoffset: 0; }
  .splash-mark .sp-dot { opacity: 1; }
}
.noscript { margin: 1rem auto; max-width: 40rem; padding: 1rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: center; }

/* ---- Network: a thin activity line, and a banner for slow or lost connections ---- */
.net-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 2px; overflow: hidden; opacity: 0; transition: opacity .2s; pointer-events: none; }
.net-bar i { position: absolute; inset: 0 auto 0 0; width: 30%; background: var(--focus); animation: sp-bar 1.2s ease-in-out infinite; }
body.is-net-busy .net-bar { opacity: 1; }
.net-banner { position: fixed; left: 50%; bottom: 1.25rem; z-index: 70; transform: translateX(-50%); width: max-content; max-width: calc(100% - 2rem);
  padding: .65rem 1rem; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: .9rem; font-weight: 550; box-shadow: var(--shadow-lg); }
.net-banner[data-kind="offline"] { background: var(--bad); color: #fff; }
.net-banner[data-kind="online"] { background: var(--ok); color: #fff; }
@media (prefers-reduced-motion: reduce) { .net-bar i { animation: none; width: 100%; opacity: .6; } }

/* ---- Policies ---- */
.legal-agree { text-align: center; margin-top: .75rem; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem 1.25rem; margin-top: .45rem !important; }
.footer-links a { color: var(--ink-soft); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.brand-link { color: var(--ink); text-decoration: none; }
.legal-nav { display: flex; flex-wrap: wrap; gap: .25rem; margin-left: auto; }
.legal-nav a { padding: .4rem .75rem; border-radius: 9px; color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: .9rem; }
.legal-nav a:hover { background: var(--surface-2); color: var(--ink); }
.legal-nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); border: 1px solid var(--line); }
main.legal { max-width: 760px; }
.legal h1 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); margin: .5rem 0 .4rem; }
.legal-meta { color: var(--ink-soft); font-size: .9rem; margin-bottom: 1.5rem; }
.legal-lede { font-size: 1.08rem; line-height: 1.6; }
.legal h2 { font-size: 1.15rem; margin: 2.2rem 0 .6rem; scroll-margin-top: 80px; }
.legal p, .legal li, .legal dd { line-height: 1.65; }
.legal ul { padding-left: 1.2rem; }
.legal li { margin-bottom: .35rem; }
.legal-toc { margin: 1.5rem 0; padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.legal-toc ol { margin: 0; padding-left: 1.2rem; columns: 2; column-gap: 2rem; }
.legal-toc li { margin: 0 0 .3rem; break-inside: avoid; }
@media (max-width: 600px) { .legal-toc ol { columns: 1; } .legal-nav { width: 100%; margin-left: 0; } .legal-page .topbar { flex-wrap: wrap; } }
.legal-list dt { font-weight: 650; margin-top: 1rem; }
.legal-list dd { margin: .2rem 0 0; color: var(--ink-soft); }
.table-wrap { overflow-x: auto; margin: .5rem 0 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.legal-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: .7rem .85rem; border-bottom: 1px solid var(--line); }
.legal-table tr:last-child td { border-bottom: 0; }
.legal-table th { font-weight: 650; background: var(--surface-2); }
.legal code { font-size: .88em; padding: .1rem .35rem; border-radius: 6px; background: var(--surface-2); }

/* ---- First-time policies ---- */
#view-terms { max-width: 680px; margin: 0 auto; }
.terms-card { padding: clamp(1.4rem, 3.5vw, 2.25rem); box-shadow: var(--shadow-lg); border-radius: 16px; }
.terms-card h1 { margin-bottom: .35rem; }
.terms-points { list-style: none; padding: 0; margin: 1.4rem 0 1.1rem; display: grid; gap: .85rem; }
.terms-points li { position: relative; padding-left: 1.6rem; line-height: 1.55; color: var(--ink-soft); }
.terms-points li strong { color: var(--ink); font-weight: 650; }
.terms-points li::before { content: ""; position: absolute; left: 0; top: .45rem; width: .65rem; height: .65rem; border-radius: 50%; border: 2px solid var(--ink); }
.terms-check { padding: .85rem; border-radius: 12px; background: var(--surface-2); margin: 1rem 0; }
.terms-check label { font-weight: 550; }
.terms-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
@media (max-width: 520px) { .terms-actions .btn-primary { flex: 1 1 100%; } }
#pane-signup .terms-check { margin: 0 0 1rem; padding: .7rem; }
#pane-signup .terms-check label { font-size: .86rem; font-weight: 500; }

.hs-in .hs-blob { opacity: 1; background: #173f3e; color: #d6efec; }
.hs-line { color: var(--stage-soft); }
.table-wrap:focus-visible, .table-scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* =========================================================================================
   App shell: a sidebar like ChatGPT or Claude. On phones it becomes a slide-in menu.
   ========================================================================================= */
:root { --side: #eef0f3; --composer-line: #cfd4dc; }
@media (prefers-color-scheme: dark) { :root { --side: #10141b; --composer-line: #323b4b; } }
body { display: block; }
.app { display: flex; min-height: 100vh; min-height: 100dvh; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

.side-nav.account-nav { position: sticky; top: 0; z-index: 40; flex: none; width: 272px; height: 100vh; height: 100dvh; margin: 0;
  display: flex; flex-direction: column; align-items: stretch; gap: .2rem; padding: .8rem .7rem .7rem;
  background: var(--side); border-right: 1px solid var(--line); overflow: hidden; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: .3rem .45rem .9rem; }
.side-btn { display: flex; align-items: center; gap: .65rem; width: 100%; min-height: 44px; padding: 0 .75rem; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--ink); font: 550 .93rem/1.2 var(--sans); text-align: left; cursor: pointer; }
.side-btn:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.side-btn[aria-current="page"] { background: color-mix(in srgb, var(--ink) 9%, transparent); font-weight: 650; }
.side-btn-new { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); font-weight: 650; }
.side-btn-new:hover, .side-btn-new[aria-current="page"] { background: var(--surface); border-color: color-mix(in srgb, var(--ink) 22%, var(--line)); }
.side-label { margin: 1.25rem .75rem .35rem; font-size: .78rem; font-weight: 650; color: var(--ink-soft); letter-spacing: 0; }
.recent-list { list-style: none; margin: 0; padding: 0; display: grid; align-content: start; gap: 1px; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.recent-item { display: block; width: 100%; min-height: 44px; padding: .45rem .75rem; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.recent-item:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.recent-item[aria-current="page"] { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.recent-item[disabled] { opacity: .6; }
.recent-title { display: block; font-size: .9rem; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-meta { display: block; font-size: .76rem; color: var(--ink-soft); }
.side-empty { margin: 0; padding: 0 .75rem; font-size: .86rem; color: var(--ink-soft); }
.side-foot { margin-top: auto; padding-top: .5rem; border-top: 1px solid var(--line); }
.side-foot .menu { width: 100%; }
.side-foot .menu-trigger { width: 100%; margin: 0; padding: .35rem .5rem; }
.side-foot .menu-email { display: block; flex: 1; min-width: 0; max-width: none; color: var(--ink); font-size: .88rem; }
.side-foot .menu-list { top: auto; bottom: calc(100% + .35rem); left: 0; right: 0; min-width: 0; }
a.menu-item { display: flex; align-items: center; text-decoration: none; color: var(--ink); }

.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.side-close { display: none; }
.nav-scrim { display: none; }

.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .75rem; min-height: 56px; padding: .5rem clamp(.75rem, 3vw, 2rem);
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar-tag { margin: 0; color: var(--ink-soft); font-size: .9rem; padding-left: 1rem; border-left: 1px solid var(--line); }
.nav-open, .nav-new-top { display: none; }
body.is-signed-in .topbar-tag { display: none; }
@media (max-width: 860px) { .topbar-tag { display: none; } }
@media (min-width: 900px) { body.is-signed-in .topbar { display: none; } }
@media (max-width: 899px) {
  body.is-signed-in .nav-open, body.is-signed-in .nav-new-top { display: grid; }
  body.is-signed-in .topbar { padding: .35rem .5rem; gap: .25rem; }
  body.is-signed-in .topbar .brand { margin-right: auto; }
  .side-nav.account-nav { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); visibility: hidden;
    transition: transform .22s ease, visibility 0s linear .22s; box-shadow: var(--shadow-lg); }
  body.nav-is-open .side-nav.account-nav { transform: none; visibility: visible; transition: transform .22s ease; }
  .side-close { display: grid; }
  .nav-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(10, 12, 16, .45); }
}
@media (prefers-reduced-motion: reduce) { .side-nav.account-nav { transition: none !important; } }

main { width: 100%; }
.demo-banner, .alert { width: calc(100% - 2 * clamp(1rem, 3vw, 2rem)); }

/* =========================================================================================
   Start screen: one question, one composer.
   ========================================================================================= */
body[data-view="setup"] .app-main { background: var(--surface); }
body[data-view="setup"] main { max-width: none; }
.home-inner { max-width: 660px; margin: 0 auto; padding: clamp(1rem, 8vh, 5rem) 0 2rem; }
.home-hero { display: flex; flex-direction: column; align-items: center; gap: .85rem; text-align: center; margin-bottom: 1.75rem; }
.home-faces { display: flex; }
.hf { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--surface); color: #fff; font-weight: 700; font-size: .72rem; letter-spacing: .03em; }
.hf-ex { background: #8a2f3c; }
.hf-in { background: #1d5c5a; margin-left: -10px; }
.home-title { font-size: clamp(1.75rem, 3.4vw, 2.3rem); line-height: 1.18; letter-spacing: -.02em; margin: 0; }
.home-lede { margin: 0; max-width: 34em; font-size: 1.05rem; line-height: 1.55; color: var(--ink-soft); }
.home-stack { display: grid; gap: 1.25rem; }
.home-stack .field { margin-bottom: 0; }
.home-stack .doc-source { border: 0; padding: 0; margin: 0; display: grid; gap: .75rem; min-width: 0; }
/* The one big thing on the page: where the thesis goes. */
.home-stack .dropzone-big { gap: .55rem; min-height: 0; padding: 2.4rem 1.25rem 2rem; border: 2px dashed color-mix(in srgb, var(--accent) 38%, var(--line));
  border-radius: 20px; background: var(--surface); text-align: center; }
.home-stack .dropzone-big:hover, .home-stack .dropzone-big.is-over { border-color: var(--accent); background: var(--accent-soft); }
.home-stack .dropzone-big.has-file { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.home-stack .dropzone-big .dropzone-icon { color: var(--accent); }
.dropzone-big .dropzone-text { font-size: 1.2rem; font-weight: 650; color: var(--ink); }
.dropzone-or { font-size: .92rem; color: var(--ink-soft); }
.dropzone-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.4rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.dropzone-big:hover .dropzone-btn { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
.dropzone-hint { max-width: 30em; font-size: .9rem; line-height: 1.45; color: var(--ink-soft); }
.home-stack .dropzone-big .dropzone-file { font-size: .98rem; color: var(--accent); }
.dropzone-big.has-file .dropzone-or, .dropzone-big.has-file .dropzone-hint { display: none; }
.dropzone-big.has-file .dropzone-text { font-size: 1.05rem; }
.keep-check { margin-top: .85rem; }
.keep-check label { font-size: .93rem; }
.home-who { justify-content: center; }
.home-stack .doc-source .seg { display: grid; grid-template-columns: 1fr 1fr; }
.home-stack .doc-source .seg-opt { justify-content: center; }
.viva-set > summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; cursor: pointer; list-style: none; font-size: .93rem; }
.viva-set > summary::-webkit-details-marker { display: none; }
.vs-label { color: var(--ink-soft); }
.vs-chip { display: inline-flex; align-items: center; min-height: 34px; padding: 0 .85rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); }
.vs-chip[hidden] { display: none; }
.vs-change { padding: 0 .35rem; color: var(--accent); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.viva-set > summary:hover .vs-chip { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.viva-set > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 12px; }
.viva-set[open] .vs-change { text-decoration: none; }
.vs-body { justify-content: center; margin-top: .85rem; padding: 1rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.viva-set .mode-hint { margin: .6rem .2rem 0; text-align: center; }
.opts { display: flex; flex-wrap: wrap; gap: .5rem; }
.opt { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; padding: 0 .35rem 0 .9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.opt:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }
.opt > label { margin: 0; font-size: .82rem; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.opts .opt select, .opts .opt input[type="text"] { width: auto; min-height: 40px; border: 0; padding: .3rem .4rem; background: transparent; font-weight: 550; font-size: .92rem; box-shadow: none; }
.opts .opt select:focus, .opts .opt input[type="text"]:focus { box-shadow: none; outline: none; }
.opts .opt-name input[type="text"] { width: 13.5rem; max-width: 52vw; }
.opts .opt-mode { margin: 0; padding: 3px; gap: 2px; border: 1px solid var(--line); min-width: 0; }
.opt-mode legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mode-pill { position: relative; display: inline-flex; align-items: center; min-height: 36px; margin: 0; padding: 0 .9rem; border-radius: 999px; font-size: .9rem; font-weight: 550; color: var(--ink-soft); cursor: pointer; }
.mode-pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mode-pill:has(input:checked) { background: var(--ink); color: var(--bg); }
.mode-pill:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.mode-hint { font-size: .85rem; }
.more { border-top: 1px solid var(--line); padding-top: .2rem; }
.more > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; min-height: 44px; padding-top: .6rem; font-weight: 650; font-size: .93rem; cursor: pointer; }
.more > summary .hint-inline { font-weight: 500; color: var(--ink-soft); }
.more-body { display: grid; gap: .65rem; padding: .35rem 0 .3rem; }
.more-body .form-pick, .more-body .focus-pick, .more-body .materials { margin: 0; background: var(--surface); }
.home-foot { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .9rem 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.home-foot .consent { flex: 1 1 22rem; margin: 0; }
.home-foot .consent label { font-size: .86rem; font-weight: 500; line-height: 1.45; }
.home-foot .consent .hint { font-size: .8rem; }
.btn.btn-start { min-height: 48px; padding: 0 1.75rem; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 1rem; margin-left: auto; }
.btn.btn-start:hover:not([disabled]) { background: color-mix(in srgb, var(--ink) 82%, var(--accent)); }
#start-status:empty { min-height: 0; margin: 0; }
.home-note { margin-top: .4rem; }
@media (max-width: 600px) {
  .home-inner { padding-top: .75rem; }
  .home-hero { margin-bottom: 1.25rem; }
  .home-stack .dropzone-big { padding: 1.75rem 1rem 1.5rem; }
  .vs-body { padding: .75rem; }
  .opt, .opts .opt-mode { flex: 1 1 100%; justify-content: space-between; border-radius: 12px; }
  .opts .opt select, .opts .opt-name input[type="text"] { flex: 1; width: auto; max-width: none; text-align: right; }
  .opts .opt-name input[type="text"] { text-align: left; } /* a name is typed left to right */
  .opts .opt-mode { justify-content: stretch; }
  .mode-pill { flex: 1; justify-content: center; border-radius: 9px; }
  .btn.btn-start { width: 100%; }
}

/* =========================================================================================
   Viva room: one full-page conversation.
   ========================================================================================= */
body[data-view="room"] .app-main { height: 100vh; height: 100dvh; background: var(--surface); }
body[data-view="room"] main { flex: 1; min-height: 0; max-width: none; padding: 0; display: flex; }
body[data-view="room"] .footer { display: none; }
#view-room { flex: 1; min-width: 0; display: flex; }
.chat { --speak: var(--ink-soft); flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.chat[data-mode="external"] { --speak: var(--external); }
.chat[data-mode="internal"] { --speak: var(--internal); }
.chat[data-mode="student"] { --speak: var(--student); }

.chat-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; padding: .6rem clamp(.75rem, 2.5vw, 1.5rem); border-bottom: 1px solid var(--line); }
.chat-title { flex: 1 1 220px; min-width: 0; margin: 0; font-weight: 650; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-progress { display: inline-flex; }
.mini-bar { position: relative; display: block; width: 84px; height: 6px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.mini-bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); transition: width .5s ease; }
.chat-count { font-size: .85rem; color: var(--ink-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chat-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-left: auto; }
.chat-actions .btn-primary { background: var(--ink); color: var(--bg); }

.chat-body { position: relative; flex: 1; min-height: 0; display: flex; }
.thread { flex: 1; min-width: 0; overflow-y: auto; overscroll-behavior: contain; scroll-padding-bottom: 1rem; }
.thread-inner { max-width: 780px; margin: 0 auto; padding: clamp(1.25rem, 3vh, 2rem) clamp(1rem, 3vw, 1.5rem) 1rem; display: flex; flex-direction: column; gap: 1.4rem; }
.transcript { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.6rem; max-height: none; overflow: visible; }
.msg { display: flex; gap: .85rem; align-items: flex-start; max-width: none; }
.msg.is-queued { display: none; }
.msg.from-external { --speak: var(--external); }
.msg.from-internal { --speak: var(--internal); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none; font: 700 .7rem/1 var(--sans); letter-spacing: .04em; color: #fff; }
.avatar-external { background: #8a2f3c; }
.avatar-internal { background: #1d5c5a; }
.avatar-student { background: #2b3d5c; }
.msg .bubble { flex: 1; min-width: 0; padding: .2rem 0 0; background: none; border: 0; border-radius: 0; }
.msg-who { margin: 0 0 .2rem; font-size: .86rem; font-weight: 650; color: var(--ink); letter-spacing: 0; text-transform: none; }
.msg-text { margin: 0; font-size: 1.04rem; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-text .w { color: var(--ink-soft); transition: color .18s ease; }
.msg-text .w.said { color: var(--ink); }
.msg-text .w.now { color: var(--speak); }
.msg.is-live .msg-who::after { content: "Speaking"; margin-left: .55rem; padding: .1rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 650;
  color: var(--speak); background: color-mix(in srgb, var(--speak) 11%, var(--surface)); }
.msg-meta { display: flex; flex-wrap: wrap; gap: .4rem; }
.msg-meta:not(:empty) { margin-top: .6rem; }
.msg .kind-tag { margin-bottom: .35rem; }
.replay { display: inline-flex; align-items: center; gap: .3rem; margin-top: .45rem; min-height: 32px; padding: .2rem .65rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font: 600 .78rem/1 var(--sans); cursor: pointer; }
.replay:hover { color: var(--ink); }
.msg.is-live .replay { visibility: hidden; }
.msg.from-student { justify-content: flex-end; }
.msg.from-student .avatar { display: none; }
.msg.from-student .msg-who { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.msg.from-student .bubble { flex: 0 1 auto; max-width: min(36rem, 86%); padding: .75rem 1rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px 18px 4px 18px; }
.msg.from-student .msg-text { font-size: 1rem; }

.live-note { align-self: flex-start; max-width: 36rem; padding: .7rem 1rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.caption-text { margin: 0; font-size: .98rem; line-height: 1.55; color: var(--ink); }
.caption-text .w { color: var(--ink); }
.caption-text .dots { display: inline-flex; gap: 5px; margin-left: .45rem; vertical-align: middle; }
.caption-text .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-soft); animation: hop 1.2s ease-in-out infinite; }
.caption-text .dots i:nth-child(2) { animation-delay: .15s; }
.caption-text .dots i:nth-child(3) { animation-delay: .3s; }
.caption-meta { display: flex; flex-wrap: wrap; gap: .4rem; }
.caption-meta:not(:empty) { margin-top: .5rem; }

.room-side { flex: none; width: 300px; padding: 1.1rem 1.15rem 1.5rem; overflow-y: auto; border-left: 1px solid var(--line); background: var(--surface); }
.room-side-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.room-side-head .card-title { margin: 0; font-size: 1rem; }
.room-side .icon-btn { width: 40px; height: 40px; }
.room-side .reading { margin-top: 1.6rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.room-side .reading .card-title { font-size: .95rem; }
.side-delete { margin-top: 1.25rem; font-size: .88rem; }
@media (max-width: 1099px) {
  .room-side { position: absolute; top: 0; right: 0; bottom: 0; z-index: 6; width: min(330px, 90vw); background: var(--surface); box-shadow: var(--shadow-lg); }
}

.dock { flex: none; padding: 0 clamp(.75rem, 3vw, 1.5rem) max(.8rem, env(safe-area-inset-bottom)); background: var(--surface); }
.dock > * { max-width: 780px; margin-left: auto; margin-right: auto; }
.speaker-bar { display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: .3rem 0; }
.speaker-bar .seat { --fill: #8a2f3c; --c: #d0596b; display: flex; }
.speaker-bar .seat[data-speaker="internal"] { --fill: #1d5c5a; --c: #1f9a8f; }
.presence { position: relative; width: 30px; height: 30px; display: grid; place-items: center; color: var(--c); }
.blob { position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--fill); color: #fff; font-weight: 700; font-size: .6rem; letter-spacing: .04em; transition: background-color .3s ease; }
.halo { position: absolute; inset: 0; border-radius: 50%; border: 2px solid currentColor; opacity: 0; }
.seat.is-speaking .blob { animation: swell 1.4s ease-in-out infinite; }
.seat.is-speaking .halo { animation: halo 2s ease-out infinite; }
.seat.is-speaking .halo.h2 { animation-delay: .66s; }
.seat.is-speaking .halo.h3 { animation-delay: 1.33s; }
.seat.is-thinking .blob { animation: morph 9s ease-in-out infinite; }
.seat.is-dim .blob { background: #6b7280; }
.viz-wrap { position: relative; flex: 0 1 150px; min-width: 48px; height: 26px; }
#viz { display: block; width: 100%; height: 100%; }
.focus-avatar { display: none; }
.caption-label { flex: 1; min-width: 0; margin: 0; font-size: .86rem; font-weight: 600; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat[data-mode="external"] .caption-label, .chat[data-mode="internal"] .caption-label { color: var(--speak); }
.voice-switch { margin-left: auto; flex: none; }
.voice-note { margin: 0 auto .35rem; }

.composer { display: grid; gap: .5rem; }
.composer-box { position: relative; display: flex; align-items: flex-end; gap: .4rem; padding: .35rem .35rem .35rem 1.1rem; border: 1px solid var(--composer-line);
  border-radius: 26px; background: var(--surface); box-shadow: 0 6px 24px rgba(18, 22, 31, .06); }
.composer-box:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent), 0 6px 24px rgba(18, 22, 31, .06); }
.composer-box textarea, .composer-box textarea:focus { flex: 1; min-width: 0; min-height: 44px; max-height: 220px; padding: .65rem 0; border: 0; border-radius: 0; resize: none; background: transparent; color: var(--ink); font-size: 1rem; line-height: 1.5; box-shadow: none; outline: none; }
.composer-box textarea::placeholder { color: var(--ink-soft); }
.composer-box textarea:disabled { opacity: .6; }
.mic { position: relative; display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.mic:hover:not([disabled]) { background: var(--surface-2); }
.mic[aria-pressed="true"] { background: var(--student); border-color: var(--student); color: #fff; animation: micpulse 1.6s ease-out infinite; }
.mic[disabled] { opacity: .45; cursor: not-allowed; }
.rec-timer { position: absolute; top: -1.5rem; left: 50%; transform: translateX(-50%); font: 700 .78rem/1 var(--sans); color: var(--student); white-space: nowrap; font-variant-numeric: tabular-nums; }
.btn-send { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.btn-send:hover:not([disabled]) { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
.btn-send[disabled] { opacity: .45; cursor: not-allowed; }
.composer-hint { margin: 0; text-align: center; font-size: .78rem; color: var(--ink-soft); }
@media (max-width: 640px) {
  .chat-bar { gap: .4rem .6rem; padding: .5rem .75rem; }
  .chat-title { flex-basis: 100%; font-size: .92rem; }
  .chat-progress { display: none; }
  .chat-actions { gap: .3rem; }
  .chat-actions .btn-sm { min-height: 40px; padding: .35rem .7rem; font-size: .84rem; }
  .msg { gap: .65rem; }
  .avatar { width: 30px; height: 30px; }
  .msg-text { font-size: 1rem; }
  .viz-wrap { flex-basis: 90px; }
  .composer-hint kbd, .composer-hint .kbd-tip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .seat.is-speaking .blob, .seat.is-speaking .halo, .seat.is-thinking .blob, .live-dot, .mic[aria-pressed="true"] { animation: none !important; }
}
@media print { .side-nav, .nav-scrim { display: none !important; } }

/* Diagrams the panel draws sit inside the examiner's message and stay in the conversation. */
.msg-fig { margin: .75rem 0 0; max-width: 640px; }
.msg-fig .v-svg { max-height: 360px; }
.msg-fig .board-body .slide-card { max-height: 360px; }
.fig-zoom { flex: none; }
.msg-fig.is-zoomed { position: fixed; z-index: 80; inset: 4vh 4vw; max-width: none; margin: 0; overflow: auto; padding: 1rem 1.25rem;
  box-shadow: 0 0 0 100vmax rgba(10, 12, 16, .55), var(--shadow-lg); }
.msg-fig.is-zoomed .v-svg, .msg-fig.is-zoomed .board-body .slide-card { max-height: calc(92vh - 6rem); }
@media print { .msg-fig.is-zoomed { position: static; box-shadow: none; } }

/* Collapsible sidebar (wide screens): a slim rail with the logo, new viva, my vivas and the account. */
.side-collapse { margin-left: auto; color: var(--ink-soft); }
@media (max-width: 899px) { .side-collapse { display: none; } }
@media (min-width: 900px) {
  .side-nav.account-nav { transition: width .2s ease; }
  body.side-collapsed .side-nav.account-nav { width: 64px; padding-left: .55rem; padding-right: .55rem; }
  body.side-collapsed .side-head { flex-direction: column; gap: .5rem; padding: .3rem 0 .8rem; }
  body.side-collapsed .side-head .brand-name,
  body.side-collapsed .side-text,
  body.side-collapsed .side-label,
  body.side-collapsed .recent-list,
  body.side-collapsed .side-empty,
  body.side-collapsed .side-foot .menu-email { display: none; }
  body.side-collapsed .side-collapse { margin: 0; }
  body.side-collapsed .side-btn { justify-content: center; padding: 0; }
  body.side-collapsed .side-foot .menu-trigger { justify-content: center; padding: .35rem 0; }
  body.side-collapsed .side-foot .menu-list { right: auto; width: 230px; }
}
@media (prefers-reduced-motion: reduce) { .side-nav.account-nav { transition: none; } }

/* Continue an interrupted viva */
.continue-card { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin: 0 0 1.25rem; padding: 1.1rem 1.25rem;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.continue-card > div { flex: 1 1 22rem; }
.continue-title { margin: 0 0 .3rem; font-size: 1.05rem; }
.continue-text { margin: 0 0 .35rem; }
.continue-card .hint { margin: 0; }
.continue-card .btn { flex: none; }

/* Presentation coach page */
.home-coach { margin: 1.4rem 0 0; text-align: center; font-size: .95rem; color: var(--ink-soft); }
.coach-hero { max-width: 860px; margin: 0 0 1.5rem; }
.coach-hero h1 { margin: 0 0 .5rem; }
.coach-lead { margin: 0 0 1.25rem; font-size: 1.05rem; color: var(--ink-soft); max-width: 60ch; }
.coach-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.coach-steps li { display: grid; gap: .25rem; align-content: start; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.coach-steps strong { font-size: .95rem; }
.coach-steps span:not(.coach-n) { font-size: .86rem; color: var(--ink-soft); line-height: 1.4; }
.coach-n { display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: .2rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .85rem; }
@media (max-width: 860px) { .coach-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .coach-steps { grid-template-columns: 1fr; } }
.coach-card { max-width: 860px; margin-bottom: 1.25rem; }
.coach-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.coach-list:empty { display: none; }
.coach-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 12px; }
.coach-item > div { min-width: 0; flex: 1 1 16rem; }
.coach-name { margin: 0; font-weight: 650; }
.coach-meta { margin: .1rem 0 0; font-size: .85rem; color: var(--ink-soft); }
#coach-add { display: grid; gap: .85rem; }
#coach-add .btn { justify-self: start; }
.coach-drop { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; gap: .4rem .7rem; min-height: 58px; padding: .75rem .95rem; text-align: left; border-radius: 14px; }
.coach-drop .dropzone-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.coach-drop .dropzone-file { margin-left: auto; font-size: .9rem; }
.coach-level { max-width: 16rem; margin: 0; }
#c-status:empty { display: none; }

/* An examiner interrupting the example presentation: the slide stays, the caption says who is speaking. */
.ps-who { display: inline-flex; align-items: center; gap: .45rem; margin: .6rem 0 0; padding: .3rem .75rem; border-radius: 999px;
  font-weight: 700; font-size: .85rem; background: rgba(255, 255, 255, .08); }
.ps-who::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: blink 1.2s ease-in-out infinite; }
.ps-who.who-internal { color: #5fc3b9; }
.ps-who.who-external { color: #ec8f9c; }
.slide-stage.is-interrupt { box-shadow: 0 0 0 3px rgba(95, 195, 185, .55); transition: box-shadow .2s ease; }
.slide-stage.is-interrupt.is-external { box-shadow: 0 0 0 3px rgba(236, 143, 156, .6); }
.slide-stage.is-interrupt .ps-caption { font-style: italic; }
.ps-tips { margin-top: 1rem; padding: 1rem 1.15rem; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.ps-tips .card-title { margin: 0 0 .5rem; font-size: 1rem; }
.ps-tips ul { margin: 0; padding-left: 1.2rem; display: grid; gap: .3rem; }
@media (prefers-reduced-motion: reduce) { .ps-who::before { animation: none; } }
.ps-novoice { margin: .75rem 0 0; padding: .6rem .85rem; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }