/* Mock Interview Room - a quiet meeting room: warm paper, slate ink, a teal interviewer and
 * an amber candidate. Light and dark. */
:root {
  --page: #f3f1ec;
  --card: #ffffff;
  --card-2: #f8f6f1;
  --ink: #1f2933;
  --ink-2: #4b5563;
  --ink-3: #7b8490;
  --rule: #e3dfd6;
  --rule-2: #cfc9bc;
  --teal: #0f766e;
  --teal-ink: #0b5d57;
  --teal-soft: #e0f2ef;
  --amber: #b45309;
  --amber-soft: #fdf0dc;
  --rose: #b42318;
  --rose-soft: #fde8e6;
  --green: #2f7d32;
  --green-soft: #e4f3e4;
  --sky: #2f5f8a;
  --sky-soft: #e3edf6;
  --shadow: 0 1px 2px rgba(30, 30, 20, 0.05), 0 8px 24px rgba(30, 30, 20, 0.06);
  --radius: 14px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Charter", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --page: #14181d;
  --card: #1c2128;
  --card-2: #222830;
  --ink: #e8eaed;
  --ink-2: #b4bac3;
  --ink-3: #868d97;
  --rule: #2e353e;
  --rule-2: #3d4550;
  --teal: #4fc3b5;
  --teal-ink: #7fd8cc;
  --teal-soft: #173430;
  --amber: #f0b45f;
  --amber-soft: #3a2c17;
  --rose: #f2877c;
  --rose-soft: #3d1f1c;
  --green: #79c47c;
  --green-soft: #1d3320;
  --sky: #8db8e0;
  --sky-soft: #1d2b3a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--teal-ink); }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.tiny { font-size: 12px; }
.grow { flex: 1; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 6px; }

/* --- header --------------------------------------------------------------------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 28px; border-bottom: 1px solid var(--rule); background: var(--page); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mark { width: 36px; height: 36px; color: var(--teal); flex: none; }
.brand-text { min-width: 0; }
.brand-text h1 { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: 0.1px; }
.role-line { margin: 0; color: var(--ink-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50vw; }
.session { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chip-link { font-size: 13px; text-decoration: none; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--rule-2); color: var(--ink-2); }
.chip-link:hover { border-color: var(--teal); color: var(--ink); }
.credits { font-size: 13px; padding: 5px 10px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-ink); font-variant-numeric: tabular-nums; }

/* --- buttons -------------------------------------------------------------------- */
.btn { appearance: none; border: 1px solid var(--rule-2); background: var(--card); color: var(--ink); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-size: 14px; line-height: 1.2; transition: background 0.15s, border-color 0.15s; }
.btn:hover:not(:disabled) { border-color: var(--teal); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--teal-ink); border-color: var(--teal-ink); color: #fff; }
:root[data-theme="dark"] .btn.primary, :root[data-theme="dark"] .btn.primary:hover:not(:disabled) { color: #0c1a18; }
.btn.quiet { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.big { padding: 11px 20px; font-size: 15px; }
.btn.icon { width: 34px; height: 34px; padding: 0; border-radius: 999px; }
.btn.mic.live { background: var(--rose); border-color: var(--rose); color: #fff; }
a.btn { text-decoration: none; display: inline-block; }

/* --- layout ----------------------------------------------------------------------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; max-width: 1200px; margin: 0 auto; padding: 24px 28px 8px; }
.room { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.side { position: sticky; top: 16px; align-self: start; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 32px); overflow-y: auto; }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; }
.panel h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }

/* --- intake ----------------------------------------------------------------------- */
.intake { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.intake-head h2 { margin: 0; font-family: var(--serif); font-size: 25px; font-weight: 700; }
.intake-head .sub { margin: 4px 0 0; color: var(--ink-2); }
.templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.tpl { text-align: left; border: 1px solid var(--rule); background: var(--card-2); border-radius: 12px; padding: 11px 13px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.tpl:hover { border-color: var(--teal); }
.tpl.on { border-color: var(--teal); background: var(--teal-soft); }
.tpl-title { font-weight: 650; font-size: 15px; }
.tpl-blurb { font-size: 12.5px; color: var(--ink-2); line-height: 1.35; }
.tpl-free { font-size: 12px; color: var(--teal-ink); font-weight: 600; margin-top: 2px; }
.label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 4px; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.label-row .label { margin: 0; }
input[type="text"], select, textarea { width: 100%; border: 1px solid var(--rule-2); background: var(--card); border-radius: 10px; padding: 9px 12px; color: var(--ink); }
textarea { resize: vertical; line-height: 1.5; }
textarea:disabled { background: var(--card-2); color: var(--ink-3); }
.drop-wrap.drag textarea { border-color: var(--teal); background: var(--teal-soft); }
.note { margin: 4px 0 0; font-size: 13px; color: var(--ink-3); }
.resume-box summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.resume-box summary .muted { font-weight: 400; font-size: 13px; }
.resume-box[open] summary { margin-bottom: 8px; }
.match { border: 1px solid var(--rule); border-radius: 12px; padding: 10px 12px; background: var(--card-2); }
.match-head { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.match-pct { font-size: 22px; font-weight: 700; color: var(--teal-ink); font-variant-numeric: tabular-nums; }
.kw-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.kw { font-size: 12.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--rule-2); }
.kw.hit { background: var(--green-soft); border-color: transparent; color: var(--green); }
.kw.miss { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
.opts { display: flex; flex-direction: column; gap: 12px; }
.types { border: 0; padding: 0; margin: 0; }
.types legend { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 6px; padding: 0; }
.type-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.type { position: relative; }
.type input { position: absolute; opacity: 0; pointer-events: none; }
.type-box { display: flex; flex-direction: column; gap: 1px; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--rule-2); cursor: pointer; height: 100%; }
.type-name { font-weight: 600; font-size: 14px; }
.type-sub { font-size: 12px; color: var(--ink-3); line-height: 1.3; }
.type input:checked + .type-box { border-color: var(--teal); background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--teal); }
.type input:focus-visible + .type-box { outline: 2px solid var(--teal); outline-offset: 2px; }
.opt-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 480px; }
.comp-chips { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-ink); font-size: 13.5px; }
.cchip.beh { background: var(--sky-soft); color: var(--sky); }
.cchip .cid { font-size: 11px; font-weight: 700; opacity: 0.7; }
.cchip button { border: 0; background: transparent; cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px; color: inherit; opacity: 0.7; }
.cchip button:hover { opacity: 1; }
.add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.add-row input { flex: 1 1 220px; width: auto; }
.intake-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.meter { margin: 0; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; min-height: 1em; }

/* --- gate ------------------------------------------------------------------------- */
.gate { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--amber-soft); color: var(--ink); font-size: 13.5px; }
.gate span { flex: 1 1 220px; }

/* --- strip and coverage --------------------------------------------------------------- */
.strip { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; z-index: 3; }
.strip-main { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.strip-role { font-family: var(--serif); font-size: 19px; font-weight: 700; }
.strip-meta { font-size: 13px; color: var(--ink-2); }
.coverage { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cov { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--rule-2); color: var(--ink-3); }
.cov-dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; }
.cov.hit { color: var(--teal-ink); border-color: var(--teal); }
.cov.hit .cov-dot { background: currentColor; }
.cov.now { background: var(--teal-soft); }
.cov-n { font-size: 11px; font-weight: 700; }
.strip-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }

/* --- thread ------------------------------------------------------------------------- */
.thread { display: flex; flex-direction: column; gap: 12px; }
.thread:empty { display: none; }
.turn { border-radius: 16px; padding: 12px 16px; max-width: 88%; border: 1px solid var(--rule); background: var(--card); box-shadow: var(--shadow); }
.turn.iv { align-self: flex-start; border-left: 4px solid var(--teal); }
.turn.iv.followup { border-left-color: var(--sky); }
.turn.iv.close { border-left-color: var(--ink-3); }
.turn.you { align-self: flex-end; background: var(--amber-soft); border-color: transparent; }
.turn.you.skipped { opacity: 0.75; font-style: italic; }
.turn-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.turn-head .who { font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.comp-tag { padding: 1px 8px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-ink); }
.turn-head .play { margin-left: auto; padding: 2px 9px; }
.turn .say { margin: 0; white-space: pre-wrap; font-size: 15.5px; }
.turn.iv .say { font-family: var(--serif); font-size: 17px; line-height: 1.5; }
.receipt { margin: 6px 0 0; font-size: 12px; color: var(--ink-3); }
.partial { margin: 6px 0 0; font-size: 13px; color: var(--amber); }
.gap { text-align: center; font-size: 12.5px; color: var(--ink-3); margin: 0; }
.flags { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.flag { font-size: 12.5px; padding: 4px 8px; border-radius: 8px; background: var(--sky-soft); color: var(--sky); }
.flag.warn { background: var(--amber-soft); color: var(--amber); }
.note-box { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--rule-2); }
.note-box.hidden-note { display: none; }
.iv-note { display: flex; gap: 10px; align-items: flex-start; }
.sig { flex: none; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; }
.sig.strong { background: var(--green-soft); color: var(--green); }
.sig.solid { background: var(--teal-soft); color: var(--teal-ink); }
.sig.thin { background: var(--amber-soft); color: var(--amber); }
.sig.missing { background: var(--rose-soft); color: var(--rose); }
.iv-note-body { font-size: 13.5px; }
.iv-note-body .tip { margin: 2px 0 0; }
q.evidence { display: block; font-style: italic; color: var(--ink-2); quotes: "\201C" "\201D"; }
.turn .reveal { margin-top: 6px; }

/* --- replay, progress, composer --------------------------------------------------------- */
.replay-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; background: var(--sky-soft); border-color: transparent; }
.replay-note { flex: 1 1 260px; font-size: 13.5px; color: var(--sky); }
.progress { padding: 12px 16px; }
.pg-head { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; }
.pg-clock { font-variant-numeric: tabular-nums; color: var(--ink-3); font-weight: 400; }
.pg-steps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.pg-steps li { font-size: 12.5px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--rule-2); color: var(--ink-3); }
.pg-steps li.done { background: var(--teal-soft); color: var(--teal-ink); border-color: transparent; }
.pg-steps li.now { border-color: var(--teal); color: var(--ink); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px var(--teal-soft); } }
.composer { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; position: sticky; bottom: 8px; z-index: 2; }
.answer-clock { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.answer-clock.long { color: var(--amber); }
.composer-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
body.speaking .turn.iv:last-of-type { box-shadow: 0 0 0 3px var(--teal-soft), var(--shadow); }

/* --- debrief ------------------------------------------------------------------------- */
.debrief { padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; }
.db-head { display: flex; gap: 18px; align-items: flex-start; }
.ring { --p: 0; flex: none; width: 92px; height: 92px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, var(--card) 78%, transparent 79%), conic-gradient(var(--teal) calc(var(--p) * 1%), var(--rule) 0); }
.ring-n { font-size: 26px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-of { font-size: 11px; color: var(--ink-3); }
.db-title h2 { margin: 0; font-family: var(--serif); font-size: 24px; display: inline; margin-right: 10px; }
.verdict { display: inline-block; vertical-align: middle; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: capitalize; }
.verdict.v5, .verdict.v4 { background: var(--green-soft); color: var(--green); }
.verdict.v3 { background: var(--teal-soft); color: var(--teal-ink); }
.verdict.v2 { background: var(--amber-soft); color: var(--amber); }
.verdict.v1 { background: var(--rose-soft); color: var(--rose); }
.db-say { margin: 8px 0 0; font-size: 15.5px; }
.db-flags .label { margin-bottom: 2px; }
.debrief h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.scores { display: flex; flex-direction: column; gap: 10px; }
.score-row { border: 1px solid var(--rule); border-radius: 12px; padding: 10px 12px; }
.score-row.uncovered { background: var(--card-2); }
.score-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.score-label { font-weight: 650; flex: 1 1 200px; }
.score-n { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; min-width: 3em; text-align: right; }
.sbar { display: flex; gap: 3px; }
.sbar span { width: 22px; height: 8px; border-radius: 3px; background: var(--rule); }
.sbar span.on.s5, .sbar span.on.s4 { background: var(--green); }
.sbar span.on.s3 { background: var(--teal); }
.sbar span.on.s2 { background: var(--amber); }
.sbar span.on.s1 { background: var(--rose); }
.score-row .why, .score-row .improve { margin: 4px 0 0; font-size: 14px; }
.score-row .improve { color: var(--ink-2); }
.score-row q.evidence { margin-top: 4px; font-size: 13.5px; }
.db-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.db-list { border-radius: 12px; padding: 12px 14px; }
.db-list.pos { background: var(--green-soft); }
.db-list.neg { background: var(--amber-soft); }
.since { border: 1px solid var(--rule); border-radius: 12px; padding: 10px 12px; margin-top: 12px; }
.since h3 { margin: 0 0 4px; }
.since .muted { margin: 0 0 6px; font-size: 13.5px; }
.since-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.since-list li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 8px; border-radius: 8px; font-size: 14px; }
.since-list li.up { background: var(--green-soft); }
.since-list li.down { background: var(--amber-soft); }
.since-n { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.db-list ul, .practice ul, .rewrite ol { margin: 0; padding-left: 20px; }
.db-list li, .practice li, .rewrite li { margin: 3px 0; }
.rewrite { border: 1px solid var(--rule); border-left: 4px solid var(--teal); border-radius: 12px; padding: 12px 14px; }
.rewrite .btn { margin-top: 8px; }
.again { margin-top: 10px; }
.again .btn { border-color: var(--teal); color: var(--teal-ink); }

/* --- side ---------------------------------------------------------------------------- */
.seg { display: flex; border: 1px solid var(--rule-2); border-radius: 10px; overflow: hidden; }
.seg label { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 6px 4px; font-size: 13px; cursor: pointer; }
.seg input:checked + span { background: var(--teal); color: #fff; }
:root[data-theme="dark"] .seg input:checked + span { color: #0c1a18; }
.seg input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: -2px; }
.natural { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.nat-actions, .voice-test, .export-row { display: flex; gap: 6px; flex-wrap: wrap; }
.voice-test { margin-top: 8px; }
.bar { height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--teal); transition: width 0.2s; }
.history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.h-item { display: flex; align-items: stretch; gap: 4px; }
.h-open { flex: 1; text-align: left; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 6px 8px; cursor: pointer; display: flex; flex-direction: column; min-width: 0; }
.h-open:hover, .h-open.cur { border-color: var(--rule-2); background: var(--card-2); }
.h-title { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-sub { font-size: 12px; color: var(--ink-3); }
.h-del { border: 0; background: transparent; cursor: pointer; color: var(--ink-3); font-size: 16px; padding: 0 8px; border-radius: 8px; }
.h-del:hover { color: var(--rose); background: var(--rose-soft); }

/* --- footer and toasts --------------------------------------------------------------- */
.foot { max-width: 1200px; margin: 18px auto 30px; padding: 0 28px; font-size: 13px; color: var(--ink-3); }
.foot p { margin: 4px 0; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 20; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--card); border: 1px solid var(--rule-2); border-left: 4px solid var(--teal); border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow); font-size: 13.5px; transition: opacity 0.5s; }
.toast.warn { border-left-color: var(--amber); }
.toast.err { border-left-color: var(--rose); }
.toast.gone { opacity: 0; }
.toast a { margin-left: 8px; font-weight: 600; }

/* --- small screens ------------------------------------------------------------------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 16px 16px 8px; gap: 16px; }
  .side { position: static; max-height: none; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .foot { padding: 0 16px; }
}
@media (max-width: 600px) {
  .intake, .debrief { padding: 16px; }
  .turn { max-width: 100%; }
  .db-cols, .opt-row { grid-template-columns: 1fr; }
  .db-head { flex-direction: column; }
  .role-line { max-width: 80vw; }
  .composer { bottom: 0; border-radius: 14px 14px 0 0; }
  .strip { position: static; }
  #home { display: none; }
}
