/* CloudTern Interviewer — shared styles for the recruiter workspace and the candidate interview.
   Tokens first; every colour below comes from them so light and dark themes stay in step. */
/* Brand system taken from cloudtern.com: violet #6254e7 for interaction, orange #ff7426 / #f0ac0e
   for calls to action (and the logo), deep indigo #3b3663 for headings, #696687 for body copy.
   Type: Nunito (headings, 800) and Rubik (UI and body), as on the website. */
:root {
  --bg: #faf9f5;
  --surface: #ffffff;
  --surface-2: #fcfbff;
  --surface-hover: #f6f4fd;
  --ink: #3b3663;
  --ink-2: #696687;
  --muted: #8784a3;
  --line: #eceaf2;
  --line-soft: #f3f1f8;
  --line-strong: #ddd8f9;

  --brand: #6254e7;
  --brand-hover: #5747e4;
  --brand-soft: #f1effd;
  --brand-ink: #4a3fc4;
  --on-brand: #ffffff;
  --brand-glow: 0 6px 18px rgba(98, 84, 231, 0.3);

  --accent: #ffa500;
  --accent-2: #ff7a3d;
  --accent-ink: #d9730d;
  --accent-soft: #fff4e0;
  --cta: linear-gradient(135deg, #ffa500, #ff7a3d);
  --cta-hover: linear-gradient(135deg, #ff9500, #ff6a2a);
  --sky: #0693e3;
  --sky-soft: #e8f5fd;

  --good: #1f9d60;
  --good-soft: #e9f8f0;
  --warn: #b45309;
  --warn-soft: #fff8eb;
  --bad: #c0392b;
  --bad-soft: #fdf1ef;
  --info: #0e7ab8;
  --info-soft: var(--sky-soft);

  --focus: #6254e7;
  --shadow-sm: 0 2px 10px rgba(59, 54, 99, 0.05);
  --shadow-md: 0 4px 18px rgba(59, 54, 99, 0.06);
  --shadow-lg: 0 8px 40px rgba(59, 54, 99, 0.1);

  --font: "Rubik", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-head: "Nunito", "Rubik", "Segoe UI", system-ui, sans-serif;
  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 99px;
  --topbar-h: 4rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121026;
    --surface: #1a1735;
    --surface-2: #1f1c3d;
    --surface-hover: #262248;
    --ink: #f1effc;
    --ink-2: #c9c5e3;
    --muted: #9a97b3;
    --line: #2e2a52;
    --line-soft: #26224a;
    --line-strong: #3d3866;
    --brand: #8f85f2;
    --brand-hover: #a79ff6;
    --brand-soft: #27224f;
    --brand-ink: #c9c3fb;
    --on-brand: #121026;
    --accent: #ffb431;
    --accent-ink: #ffbe5c;
    --accent-soft: #33240f;
    --sky-soft: #10283a;
    --good: #4fd394;
    --good-soft: #0f2a1b;
    --brand-glow: 0 6px 18px rgba(0, 0, 0, 0.4);
    --warn: #fbbf24;
    --warn-soft: #2b2110;
    --bad: #f87171;
    --bad-soft: #2d1416;
    --info: #7dd3f5;
    --focus: #a79ff6;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink-2);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.25; font-family: var(--font-head); color: var(--ink); }
h1 { font-size: 1.5rem; font-weight: 800; }
h2 { font-size: 1.125rem; font-weight: 800; }
h3 { font-size: 0.9375rem; font-weight: 700; }
p { margin: 0 0 0.75rem; }
a { color: var(--brand); }
svg { flex-shrink: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.8125rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ================================================================ controls */
label { display: block; font-family: var(--font-head); font-weight: 800; font-size: 0.8125rem; color: var(--ink); margin: 0 0 0.375rem; }
input[type="text"], input[type="password"], input[type="search"], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 0.875rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.625rem 0.875rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.8; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}
input[readonly], textarea[readonly] { background: var(--surface-2); color: var(--ink-2); }
textarea { resize: vertical; min-height: 4.5rem; line-height: 1.5; }
select {
  appearance: none;
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath d='M5.3 7.3a1 1 0 0 1 1.4 0L10 10.6l3.3-3.3a1 1 0 1 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 0-1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  background-size: 1.125rem;
}
.field { margin-bottom: 1.125rem; }
.hint { font-size: 0.75rem; color: var(--muted); margin: 0.375rem 0 0; }

button {
  font-family: var(--font-head);
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.25rem;
  border-radius: var(--r-pill);
  padding: 0.5625rem 1.25rem;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: var(--on-brand);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4375rem;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
button:hover:not(:disabled) { background: var(--brand-hover); border-color: var(--brand-hover); box-shadow: var(--brand-glow); }
button.secondary { background: var(--surface); color: var(--brand); border-color: var(--line-strong); }
button.secondary:hover:not(:disabled) { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); box-shadow: none; }
button.quiet { background: none; border-color: transparent; box-shadow: none; color: var(--muted); padding: 0.25rem 0.75rem; font-weight: 700; }
button.quiet:hover:not(:disabled) { background: var(--surface-hover); border-color: transparent; color: var(--ink); box-shadow: none; }
button.danger-quiet:hover:not(:disabled) { color: var(--bad); background: var(--bad-soft); }
button.icon-btn { background: none; border-color: transparent; box-shadow: none; color: var(--muted); padding: 0.375rem; }
button.icon-btn:hover:not(:disabled) { background: var(--surface-hover); border-color: transparent; color: var(--ink); box-shadow: none; }
button.btn-lg { padding: 0.8125rem 1.75rem; font-size: 0.9375rem; }
button.cta { background: var(--cta); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(255, 122, 61, 0.3); }
button.cta:hover:not(:disabled) { background: var(--cta-hover); border-color: transparent; box-shadow: 0 6px 20px rgba(255, 122, 61, 0.4); }
button.cta:disabled { background: var(--cta); }
button:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

.notice {
  display: block;
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  background: var(--warn-soft);
  color: var(--ink);
  padding: 0.75rem 1rem 0.75rem 2.625rem;
  border-radius: var(--r-md);
  margin: 0 0 1rem;
  font-size: 0.875rem;
  position: relative;
}
.notice::before {
  content: "!";
  position: absolute; left: 0.875rem; top: 0.8125rem;
  width: 1.125rem; height: 1.125rem; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.6875rem; font-weight: 800;
  background: var(--warn); color: var(--surface);
}
.notice.error { border-color: color-mix(in srgb, var(--bad) 30%, transparent); background: var(--bad-soft); }
.notice.error::before { background: var(--bad); }
.notice.info { border-color: color-mix(in srgb, var(--info) 30%, transparent); background: var(--info-soft); }
.notice.info::before { content: "i"; background: var(--info); font-family: Georgia, serif; font-style: italic; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.125rem;
  padding: 0.1875rem 0.6875rem;
  border-radius: var(--r-pill);
  white-space: nowrap;
  background: var(--surface-hover);
  color: var(--ink-2);
  border: 1px solid transparent;
}
.pill::before { content: ""; width: 0.375rem; height: 0.375rem; border-radius: 50%; background: currentColor; }
.pill.advance, .pill.proceed, .pill.matched { color: var(--good); background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 22%, transparent); }
.pill.hold, .pill.review, .pill.partial { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.pill.reject, .pill.not_recommended, .pill.missing { color: var(--bad); background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 22%, transparent); }
.pill.neutral { color: var(--muted); }
.pill.score::before { display: none; }

.avatar {
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-head); font-size: 0.8125rem; font-weight: 800; letter-spacing: 0.02em;
  color: var(--brand); background: var(--brand-soft);
  flex-shrink: 0;
}
.avatar.lg { width: 3.5rem; height: 3.5rem; font-size: 1.125rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 0.625rem; text-decoration: none; color: inherit; min-width: 0; }
.logo { height: 2.25rem; width: auto; display: block; }
.brand-name { font-family: var(--font-head); font-size: 1rem; font-weight: 800; color: var(--ink); white-space: nowrap; padding-left: 0.75rem; border-left: 1px solid var(--line); }
.brand-tag {
  font-family: var(--font-head); font-size: 0.6875rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--accent-ink); background: var(--accent-soft); border: 1px solid #ffe2b0; border-radius: var(--r-pill); padding: 0.125rem 0.625rem;
}

/* ================================================================ recruiter workspace */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
}
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }
.topbar .key { display: flex; gap: 0.5rem; align-items: center; }
.input-icon { position: relative; display: block; }
.input-icon > svg { position: absolute; left: 0.6875rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon > input { padding-left: 2.25rem; }
.topbar .key input { width: 13rem; }
.topbar .key.connected .input-icon, .topbar .key.connected button[type="submit"] { display: none; }
.topbar .key.connected .key-status { cursor: pointer; }
.topbar .key.connected .key-status:hover { box-shadow: 0 0 0 1px var(--good); }
.key-status { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; font-weight: 500; color: var(--muted); background: var(--surface-hover); padding: 0.25rem 0.75rem; border-radius: var(--r-pill); white-space: nowrap; }
.key-status .dot { width: 0.375rem; height: 0.375rem; border-radius: 50%; background: var(--line-strong); }
.key-status[data-state="ok"] { color: var(--good); background: var(--good-soft); }
.key-status[data-state="ok"] .dot { background: var(--good); }
.key-status[data-state="bad"] { color: var(--bad); background: var(--bad-soft); }
.key-status[data-state="bad"] .dot { background: var(--bad); }
.topbar-divider { width: 1px; height: 1.75rem; background: var(--line); }

.layout { display: grid; grid-template-columns: 20rem minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); }
.sidebar {
  position: sticky; top: var(--topbar-h); align-self: start;
  height: calc(100vh - var(--topbar-h));
  border-right: 1px solid var(--line); background: var(--surface);
  padding: 1rem 0.75rem; overflow-y: auto;
  display: flex; flex-direction: column;
}
.main { padding: 2rem 2.5rem 5rem; width: 100%; max-width: 68rem; min-width: 0; }

.meeting-search { padding: 0 0.25rem; margin-bottom: 1rem; }
.meeting-search .hint { padding: 0 0.125rem; }
.meeting-search .hint:empty { display: none; }
.search-results { max-height: 22rem; overflow-y: auto; margin-top: 0.5rem; }
.search-results:empty { display: none; }
.search-results li + li { border-top: 1px solid var(--line); }

.side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 0.5rem 0.375rem; margin-top: 0.25rem; border-top: 1px solid var(--line);
}
.side-head h2 { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink); }
.count { font-family: var(--font-head); font-size: 0.6875rem; font-weight: 800; color: var(--brand); background: var(--brand-soft); border-radius: 999px; padding: 0 0.5rem; min-width: 1.5rem; text-align: center; }
.count:empty { display: none; }

.list { list-style: none; padding: 0; margin: 0; }
.list > li.muted { padding: 0.75rem 0.5rem; }
.list button {
  width: 100%; text-align: left; background: none; color: inherit; border: 1px solid transparent; box-shadow: none;
  border-radius: var(--r-md); padding: 0.625rem 0.75rem; font-family: var(--font); font-weight: 400; letter-spacing: 0; white-space: normal;
  display: grid; grid-template-columns: auto 1fr auto; gap: 0 0.75rem; align-items: center; justify-content: stretch;
}
.list button:hover:not(:disabled) { background: var(--surface-hover); border-color: transparent; box-shadow: none; }
.list button[aria-current="true"] { background: var(--brand-soft); border-color: var(--line-strong); box-shadow: inset 3px 0 0 var(--brand); }
.list .avatar { grid-row: span 2; width: 2.125rem; height: 2.125rem; font-size: 0.75rem; }
.list .name { font-family: var(--font-head); font-weight: 800; color: var(--ink); font-size: 0.9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .meta { grid-column: 2 / -1; font-size: 0.75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results button { grid-template-columns: 1fr auto; padding: 0.625rem 0.5rem; border-radius: var(--r-sm); }
.search-results .meta { grid-column: 1 / -1; }
.search-results .match-snippet {
  grid-column: 1 / -1; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; color: var(--muted); font-size: 0.75rem; line-height: 1.4; margin-top: 0.25rem;
}
.search-results .match-snippet strong { color: var(--ink-2); text-transform: capitalize; }

/* ---------- empty state ---------- */
.empty { text-align: center; padding: 4rem 1rem 2rem; max-width: 56rem; margin: 0 auto; }
.empty-icon {
  width: 4rem; height: 4rem; margin: 0 auto 1.25rem; border-radius: 1.125rem;
  display: grid; place-items: center; color: #fff; background: var(--cta); box-shadow: 0 6px 20px rgba(255, 122, 61, 0.3);
}
.empty h2 { font-size: 1.75rem; margin-bottom: 0.5rem; }
.empty > p { color: var(--muted); max-width: 34rem; margin: 0 auto 1.75rem; }
.how { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; text-align: left; counter-reset: how; }
.how li { counter-increment: how; padding: 1.25rem; font-size: 0.8125rem; color: var(--ink-2); box-shadow: var(--shadow-md); }
.how li::before {
  content: counter(how); display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--brand); color: #fff; font-family: var(--font-head); font-weight: 800; font-size: 0.75rem; margin-bottom: 0.75rem; box-shadow: var(--brand-glow);
}
.how strong { display: block; color: var(--ink); font-family: var(--font-head); font-weight: 800; font-size: 0.9375rem; margin-bottom: 0.375rem; }

/* ---------- candidate profile header ---------- */
.profile { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.profile-info { flex: 1; min-width: 12rem; }
.profile-info h2 { font-size: 1.625rem; font-weight: 800; }
.profile-info p { margin: 0.125rem 0 0; color: var(--muted); font-size: 0.875rem; }
.status-chip {
  font-size: 0.75rem; font-weight: 500; padding: 0.3125rem 0.875rem; border-radius: var(--r-pill);
  background: var(--brand-soft); color: var(--brand-ink); border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
}
.status-chip.s-evaluated { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 22%, transparent); }
.status-chip.s-evaluation_failed { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 22%, transparent); }
.status-chip.s-in_progress, .status-chip.s-completed { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }

/* ---------- stepper ---------- */
.stages {
  display: flex; list-style: none; padding: 1.125rem 1.25rem; margin: 0 0 1.5rem; counter-reset: s;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.stages li {
  flex: 1; position: relative; display: flex; align-items: center; gap: 0.625rem;
  font-family: var(--font-head); font-size: 0.8125rem; font-weight: 700; color: var(--muted); counter-increment: s; padding-right: 0.75rem;
}
.stages li::before {
  content: counter(s); width: 1.75rem; height: 1.75rem; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--line-strong); background: var(--surface);
  display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; color: var(--muted);
}
.stages li::after { content: ""; flex: 1; height: 2px; border-radius: 2px; background: var(--line); min-width: 1rem; }
.stages li:last-child { flex: 0 0 auto; padding-right: 0; }
.stages li:last-child::after { display: none; }
.stages li.done { color: var(--ink-2); }
.stages li.done::before {
  content: ""; background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath d='M16.7 5.3a1 1 0 0 1 0 1.4l-8 8a1 1 0 0 1-1.4 0l-4-4a1 1 0 1 1 1.4-1.4L8 12.6l7.3-7.3a1 1 0 0 1 1.4 0z'/%3E%3C/svg%3E") center / 0.875rem no-repeat;
  border-color: var(--brand);
}
.stages li.done::after { background: var(--brand); }
.stages li.current { color: var(--ink); font-weight: 800; }
.stages li.current::before { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }

/* ---------- section cards ---------- */
section.block {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-md);
  padding: 1.25rem 1.5rem 1.5rem; margin-bottom: 1.5rem;
}
section.block > header {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin: -1.25rem -1.5rem 1.25rem; padding: 1rem 1.5rem; border-bottom: 1px solid var(--line-soft);
}
section.block > header h2 { font-size: 1.0625rem; }
section.block > p { color: var(--ink-2); }
.section-sub { font-size: 0.75rem; color: var(--muted); font-weight: 500; }

/* score headline with ring gauge */
.headline { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.headline-text { display: flex; flex-direction: column; align-items: flex-start; gap: 0.375rem; flex: 1; min-width: 14rem; }
.headline-text p { margin: 0; color: var(--muted); font-size: 0.875rem; }
.ring { position: relative; width: 5.5rem; height: 5.5rem; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring .track { stroke: var(--line); }
.ring .bar { stroke: var(--brand); stroke-linecap: round; }
.ring.good .bar { stroke: var(--good); }
.ring.warn .bar { stroke: var(--warn); }
.ring.bad .bar { stroke: var(--bad); }
.ring > span { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1; }
.ring strong { font-family: var(--font-head); font-size: 1.625rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ring small { font-size: 0.6875rem; color: var(--muted); margin-top: 0.125rem; }
@media (prefers-reduced-motion: no-preference) { .ring .bar { transition: stroke-dashoffset 0.9s cubic-bezier(.2,.7,.2,1); } }

.prose { font-size: 0.9375rem; line-height: 1.65; color: var(--ink-2); max-width: 72ch; }

table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.875rem; }
th, td { text-align: left; vertical-align: top; padding: 0.75rem 0.875rem; border-bottom: 1px solid var(--line); }
th { font-family: var(--font-head); font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink); font-weight: 800; background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
q { font-style: italic; color: var(--ink-2); quotes: "\201C" "\201D"; }
.unverified { color: var(--bad); font-size: 0.75rem; font-weight: 500; }

/* ---------- question editor ---------- */
#q-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.25rem; }
.q-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1rem 1.125rem; transition: border-color 0.15s; }
.q-card:focus-within { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.q-card .q-head { display: flex; gap: 0.625rem; align-items: center; margin-bottom: 0.625rem; flex-wrap: wrap; }
.q-card .q-head strong { font-size: 0.8125rem; }
.q-card .q-head .kind { flex: 1; }
.q-card textarea.q-text { font-size: 0.9375rem; min-height: 3.5rem; }
.q-card details { margin-top: 0.625rem; font-size: 0.875rem; }
.q-card details summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 0.8125rem; list-style: none; display: inline-flex; align-items: center; gap: 0.25rem; }
.q-card details summary::-webkit-details-marker { display: none; }
.q-card details summary::before { content: "›"; display: inline-block; font-size: 1rem; line-height: 1; transition: transform 0.15s; }
.q-card details[open] summary::before { transform: rotate(90deg); }
.q-card .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.75rem; }
.q-card .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-top: 0.75rem; }
.q-card .q-head .kind { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0.25rem; }
.q-card .q-competency { width: auto; min-width: 12rem; margin: 0; padding: 0.3rem 0.5rem; font-size: 0.75rem; }
.q-add-panel { display: grid; gap: 0.75rem; margin: 1rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.q-add-panel[hidden] { display: none; }
.q-add-panel h3, .q-add-panel p { margin: 0; }
.q-add-panel > label { margin: 0; }
.q-add-panel #add-q-count { max-width: 8rem; }
.q-add-topic { display: grid; grid-template-columns: minmax(9rem, 0.35fr) minmax(12rem, 1fr); align-items: center; gap: 0.75rem; margin: 0.25rem 0; }
.q-add-topic select { max-width: 28rem; }
.kind { font-size: 0.75rem; color: var(--muted); }
.kind-tag {
  display: inline-block; font-size: 0.6875rem; font-weight: 500; color: var(--brand); background: var(--brand-soft);
  border-radius: var(--r-pill); padding: 0.125rem 0.625rem; margin-right: 0.375rem;
}

.link-box { display: flex; gap: 0.5rem; }
.link-box input { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.8125rem; }

.modes { border: 0; padding: 0; margin: 0 0 1.25rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.modes legend { padding: 0; margin-bottom: 0.625rem; font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); }
.modes label {
  display: flex; gap: 0.75rem; align-items: flex-start; font-weight: 400; font-size: 0.8125rem; color: var(--muted); margin: 0;
  border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 0.875rem 1rem; cursor: pointer;
  background: var(--surface); transition: border-color 0.15s, background-color 0.15s;
}
.modes label strong { display: block; color: var(--ink); font-size: 0.875rem; margin-bottom: 0.125rem; }
.modes label:hover { border-color: var(--brand); }
.modes label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.modes input { margin-top: 0.1875rem; accent-color: var(--brand); }

/* rubric strip: five marks, filled to the score */
.sub-head { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; color: var(--accent-ink); margin: 1.75rem 0 0.875rem; }
.rubric { display: grid; grid-template-columns: minmax(10rem, 16rem) auto 2.5rem; justify-content: start; gap: 0.75rem 1.25rem; align-items: center; }
.rubric .label { font-size: 0.875rem; color: var(--ink-2); }
.rubric .label::first-letter { text-transform: uppercase; }
.marks { display: flex; gap: 4px; }
.marks span { width: 2.5rem; height: 0.5rem; border-radius: 999px; background: var(--line); position: relative; overflow: hidden; }
.marks span i { position: absolute; inset: 0; background: var(--brand); transform-origin: left; border-radius: inherit; }
@media (prefers-reduced-motion: no-preference) { .marks span i { transition: transform 0.6s ease-out; } }
.rubric .num { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; font-size: 0.875rem; }

.sg { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 1.5rem; }
.sg > div { border: 1px solid var(--line); border-radius: var(--r-md); padding: 1rem 1.125rem; }
.sg h3 { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.sg h3::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; }
.sg .strengths { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 20%, transparent); }
.sg .strengths h3::before { background: var(--good); }
.sg .gaps { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 20%, transparent); }
.sg .gaps h3::before { background: var(--warn); }
.sg ul { margin: 0; padding-left: 1.125rem; font-size: 0.875rem; color: var(--ink-2); }
.sg li + li { margin-top: 0.25rem; }

.integrity { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.stat { border: 1px solid var(--line); border-radius: var(--r-md); padding: 0.625rem 1rem; min-width: 9rem; background: var(--surface-2); }
.stat strong { display: block; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.75rem; color: var(--muted); }

.qa { border: 1px solid var(--line); border-radius: var(--r-md); padding: 1rem 1.125rem; margin-bottom: 0.75rem; }
.qa h3 { font-weight: 600; font-size: 0.9375rem; margin: 0.375rem 0 0.5rem; }
.qa .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; font-size: 0.8125rem; margin-top: 0.75rem; }
.qa .cols strong { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.qa ul { margin: 0.25rem 0 0; padding-left: 1.125rem; color: var(--ink-2); }
.qa-score { font-variant-numeric: tabular-nums; font-size: 0.875rem; }
.qa-score strong { font-size: 1.0625rem; }
.qa .evidence { border-left: 3px solid var(--line-strong); padding-left: 0.75rem; margin: 0.5rem 0; }
.qa .evidence p { margin: 0 0 0.25rem; }

details.transcript-box { margin-top: 1.5rem; border: 1px solid var(--line); border-radius: var(--r-md); }
details.transcript-box > summary { cursor: pointer; padding: 0.875rem 1.125rem; font-weight: 600; font-size: 0.875rem; }
details.transcript-box[open] > summary { border-bottom: 1px solid var(--line); }
.transcript { font-size: 0.875rem; padding: 0.5rem 1.125rem 1rem; max-height: 36rem; overflow-y: auto; }
.transcript .t { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.transcript .t:last-child { border-bottom: 0; }
.transcript .who { font-weight: 700; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; }
.transcript .interviewer .who { color: var(--brand); }
.transcript .text { white-space: pre-wrap; color: var(--ink-2); }

.media { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 1rem 0 0; padding: 0.875rem 1rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.media audio { width: 100%; }
.media .rec-video { width: 100%; max-height: 28rem; border-radius: var(--r-md); background: #1a1735; }
.modes { grid-template-columns: repeat(3, 1fr); }

/* ---------- new-screening drawer ---------- */
dialog.drawer {
  margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(32rem, 100vw); max-width: 100vw;
  padding: 0; border: 0; border-left: 1px solid var(--line); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-lg);
}
dialog.drawer[open] { display: flex; }
dialog.drawer::backdrop { background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(2px); }
@media (prefers-reduced-motion: no-preference) {
  dialog.drawer[open] { animation: slide-in 0.22s cubic-bezier(.2,.7,.2,1); }
  @keyframes slide-in { from { transform: translateX(2rem); opacity: 0; } }
}
dialog.drawer form { display: flex; flex-direction: column; width: 100%; height: 100%; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 1.125rem; }
.drawer-head p { margin: 0.25rem 0 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem; }
.drawer-foot { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 1rem 1.5rem; border-top: 1px solid var(--line); background: var(--surface-2); }

.drop {
  position: relative; display: flex; align-items: center; gap: 0.75rem;
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); padding: 0.875rem 1rem;
  background: var(--surface-2); color: var(--muted); font-weight: 400; font-size: 0.8125rem; cursor: pointer; margin: 0;
  transition: border-color 0.15s, background-color 0.15s;
}
.drop:hover, .drop:focus-within, .drop.dragging { border-color: var(--brand); background: var(--brand-soft); }
.drop .drop-ic { width: 2.25rem; height: 2.25rem; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--brand); }
.drop strong { color: var(--brand); font-weight: 600; }
.drop .drop-text { display: flex; flex-direction: column; min-width: 0; }
.drop .drop-file { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop.has-file { border-style: solid; border-color: color-mix(in srgb, var(--good) 50%, var(--line)); background: var(--good-soft); }
.drop.has-file .drop-ic { color: var(--good); }
.drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.or { display: flex; align-items: center; gap: 0.75rem; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0.625rem 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 100; display: flex; flex-direction: column; gap: 0.5rem; width: min(24rem, calc(100vw - 2.5rem)); }
.toast {
  display: flex; gap: 0.75rem; align-items: flex-start;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--bad);
  border-radius: var(--r-md); padding: 0.75rem 0.875rem; box-shadow: var(--shadow-lg); font-size: 0.875rem;
}
.toast.ok { border-left-color: var(--good); }
.toast .toast-msg { flex: 1; }
.toast button { padding: 0 0.25rem; }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in 0.2s ease-out; }
  @keyframes toast-in { from { transform: translateY(0.5rem); opacity: 0; } }
}

/* ---------- skeleton ---------- */
.skeleton { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.25rem 0.5rem; }
.skeleton span { height: 2.75rem; border-radius: var(--r-md); background: linear-gradient(90deg, var(--surface-hover), var(--surface-2), var(--surface-hover)); background-size: 200% 100%; }
@media (prefers-reduced-motion: no-preference) {
  .skeleton span { animation: shimmer 1.4s linear infinite; }
  @keyframes shimmer { to { background-position: -200% 0; } }
}

/* ================================================================ candidate interview */
.iv-bar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line); }
.iv-bar-inner { max-width: 48rem; margin: 0 auto; height: 3.75rem; padding: 0 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.iv-bar-meta { display: flex; align-items: center; gap: 0.5rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; font-weight: 500; color: var(--brand);
  background: var(--brand-soft); border-radius: var(--r-pill); padding: 0.25rem 0.75rem; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chip:empty { display: none; }
.chip.low { background: var(--bad-soft); color: var(--bad); }
.progress-track { height: 3px; background: var(--line); }
.progress-track span { display: block; height: 100%; width: 0; background: var(--cta); border-radius: 0 3px 3px 0; transition: width 0.4s ease; }

.iv { max-width: 48rem; margin: 0 auto; padding: 2rem 1.25rem 14rem; }
.iv-head { margin-bottom: 1.5rem; }
.eyebrow { font-family: var(--font-head); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-ink); margin: 0 0 0.375rem; }
.iv-head h1 { font-size: 2rem; }

.iv-intro { padding: 2rem; box-shadow: var(--shadow-lg); }
.iv-intro h2 { font-size: 1.125rem; margin: 0 0 1rem; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-bottom: 1.75rem; }
.fact { display: flex; align-items: center; gap: 0.875rem; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1rem; background: var(--surface); box-shadow: var(--shadow-sm); }
.fact .fact-ic { width: 2.75rem; height: 2.75rem; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.fact strong { display: block; font-family: var(--font-head); font-weight: 800; color: var(--ink); font-size: 1.0625rem; }
.fact span.lbl { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.checklist { list-style: none; padding: 0; margin: 0 0 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
.checklist li { position: relative; padding-left: 2rem; font-size: 0.9375rem; color: var(--ink-2); }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 0.125rem; width: 1.25rem; height: 1.25rem; border-radius: 50%;
  background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236254e7'%3E%3Cpath d='M16.7 5.3a1 1 0 0 1 0 1.4l-8 8a1 1 0 0 1-1.4 0l-4-4a1 1 0 1 1 1.4-1.4L8 12.6l7.3-7.3a1 1 0 0 1 1.4 0z'/%3E%3C/svg%3E") center / 0.75rem no-repeat;
}
.voice-box { border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent); background: var(--brand-soft); border-radius: var(--r-md); padding: 1rem 1.125rem; margin-bottom: 1.5rem; }
.voice-box h3 { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; color: var(--brand-ink); }
.voice-box .checklist { margin: 0; }
.voice-box .checklist li::before { background-color: var(--surface); }
.consents { border-top: 1px solid var(--line); padding-top: 1.25rem; margin-bottom: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; }
.consent {
  display: flex; gap: 0.75rem; align-items: flex-start; font-weight: 400; font-size: 0.875rem; color: var(--ink-2); margin: 0;
  padding: 0.75rem 0.875rem; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; background: var(--surface);
}
.consent:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.consent input { margin: 0.125rem 0 0; width: 1.125rem; height: 1.125rem; accent-color: var(--brand); flex-shrink: 0; }
.iv-intro #start { width: 100%; }

/* conversation */
.msgs { display: flex; flex-direction: column; gap: 1.25rem; }
.msg { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.interviewer { position: relative; padding-left: 3rem; font-size: 1rem; line-height: 1.65; max-width: 40rem; color: var(--ink); }
.msg.interviewer::before {
  content: ""; position: absolute; left: 0; top: 0; width: 2rem; height: 2rem; border-radius: 50%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.1 6.6L21 11l-6.9 2.4L12 20l-2.1-6.6L3 11l6.9-2.4L12 2z' fill='white'/%3E%3C/svg%3E") center / 0.9375rem no-repeat, var(--cta);
  box-shadow: 0 2px 8px rgba(255, 122, 61, 0.3);
}
.msg.interviewer.question, .msg.interviewer.follow_up {
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px 18px 18px 18px;
  padding: 0.9375rem 1.25rem; margin-left: 3rem; box-shadow: var(--shadow-md); font-weight: 500;
}
.msg.interviewer.question::before, .msg.interviewer.follow_up::before { left: -3rem; }
.msg.interviewer.follow_up { border-style: dashed; }
.msg.interviewer.follow_up::after {
  content: "Follow-up"; position: absolute; top: -0.5625rem; left: 0.875rem; padding: 0 0.375rem; background: var(--bg);
  font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand); line-height: 1rem;
}
.msg.interviewer.greeting, .msg.interviewer.closing { color: var(--ink-2); padding-top: 0.375rem; }
.msg.candidate {
  align-self: flex-end; max-width: 80%;
  background: var(--brand-soft); color: var(--ink);
  border-radius: 18px 18px 6px 18px; padding: 0.6875rem 1rem; font-size: 0.9375rem; line-height: 1.5;
}
.msg.candidate .heard { display: block; font-size: 0.75rem; color: var(--muted); margin-bottom: 0.25rem; }
.typing { display: flex; align-items: center; gap: 0.625rem; color: var(--muted); font-size: 0.875rem; padding-left: 3rem; }
.typing::before { content: ""; width: 2rem; height: 0.5rem; background: radial-gradient(circle, var(--muted) 45%, transparent 50%) 0 50% / 0.6667rem 0.5rem repeat-x; opacity: 0.6; }
@media (prefers-reduced-motion: no-preference) {
  .typing::before { animation: dots 1s steps(3) infinite; }
  @keyframes dots { from { width: 0.6667rem; } to { width: 2.6667rem; } }
}
.done-card { display: flex; gap: 1rem; align-items: center; padding: 1.25rem 1.5rem; margin-top: 0.5rem; }
.done-card .done-ic { width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center; background: var(--good-soft); color: var(--good); }
.done-card h2 { font-size: 1rem; margin-bottom: 0.125rem; }
.done-card p { margin: 0; color: var(--muted); font-size: 0.875rem; }

/* composer */
.composer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 0 1rem 1rem; background: linear-gradient(to top, var(--bg) 70%, transparent); pointer-events: none; }
.composer .inner {
  max-width: 46rem; margin: 0 auto; pointer-events: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg);
  padding: 0.625rem 0.625rem 0.625rem 0.75rem; transition: border-color 0.15s, box-shadow 0.15s;
}
.composer .inner:focus-within { border-color: var(--brand); box-shadow: var(--shadow-lg), 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.composer textarea { min-height: 6rem; max-height: 40vh; border: 0; box-shadow: none; padding: 0.5rem 0.625rem; font-size: 0.9375rem; resize: none; }
.composer textarea:focus { box-shadow: none; }
.composer .row { justify-content: space-between; padding: 0.25rem 0.25rem 0 0.625rem; }
.kbd { font-family: inherit; font-size: 0.6875rem; font-weight: 600; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 0.3125rem; color: var(--ink-2); background: var(--surface-2); }
.composer.over-console { bottom: 11rem; }

/* voice console */
.console { position: fixed; left: 0; right: 0; bottom: 0; z-index: 16; padding: 0 1rem 1rem; pointer-events: none; }
.console .inner {
  max-width: 46rem; margin: 0 auto; pointer-events: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg);
  padding: 1rem 1.25rem;
}
.console-top { display: flex; gap: 0.875rem; align-items: center; flex-wrap: wrap; }
#voice-status { font-family: var(--font-head); font-size: 1rem; font-weight: 800; color: var(--ink); flex: 1; min-width: 12rem; }
.rec {
  display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--bad); background: var(--bad-soft); border-radius: 999px; padding: 0.25rem 0.625rem;
}
.rec .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--bad); }
.rec.off { color: var(--muted); background: var(--surface-hover); }
.rec.off .dot { background: var(--muted); }
@media (prefers-reduced-motion: no-preference) { .rec:not(.off) .dot { animation: pulse 1.6s ease-in-out infinite; } }
@keyframes pulse { 50% { opacity: 0.3; } }

.meter { display: flex; gap: 3px; height: 2.25rem; align-items: center; margin: 0.875rem 0; padding: 0 0.25rem; }
.meter span { flex: 1; height: 14%; min-height: 3px; background: var(--line-strong); border-radius: 999px; transition: height 0.08s; }
.meter span.on { background: var(--brand); }
.meter.idle span { background: var(--line); height: 14%; }
.console-actions { justify-content: flex-start; }
.console-actions #finish { min-width: 11rem; }
.console-actions #type-instead { margin-left: auto; }

/* ================================================================ video interview */
/* camera + microphone check on the intro card */
.cam-check { display: grid; grid-template-columns: 15rem 1fr; gap: 1.25rem; align-items: center; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1rem; margin-bottom: 1.5rem; background: var(--surface-2); }
.cam-preview { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden; background: #1a1735; }
.cam-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.cam-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #9a97b3; }
.cam-check.live .cam-placeholder { display: none; }
.cam-side h3 { margin-bottom: 0.25rem; }
.cam-side p { margin-bottom: 0.75rem; }
.cam-ok { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.level { width: 8rem; height: 0.5rem; border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.level span { display: block; height: 100%; width: 0; background: var(--good); border-radius: inherit; transition: width 0.08s; }

/* the call: AI interviewer tile + your camera, pinned under the header */
.stage {
  position: sticky; top: calc(3.75rem + 3px); z-index: 10;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
  padding: 0.75rem 0 1rem; margin-bottom: 0.5rem; background: var(--bg);
}
.tile {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); border: 2px solid transparent; transition: border-color 0.2s, box-shadow 0.2s;
}
.tile-ai { display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #4a3fc4 0%, #2a2459 55%, #1a1735 100%); }
.tile-self { background: #1a1735; }
.tile-self video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.ai-orb {
  width: 4.5rem; height: 4.5rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--cta); box-shadow: 0 0 0 0 rgba(255, 165, 0, 0.5), 0 8px 24px rgba(255, 122, 61, 0.35);
}
.tile-name {
  position: absolute; left: 0.75rem; bottom: 0.75rem; display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-head); font-size: 0.75rem; font-weight: 800; color: #fff;
  background: rgba(20, 18, 40, 0.6); backdrop-filter: blur(6px); border-radius: var(--r-pill); padding: 0.25rem 0.75rem;
}
.tile-rec {
  position: absolute; right: 0.75rem; top: 0.75rem; display: inline-flex; align-items: center; gap: 0.375rem;
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; color: #fff; background: rgba(192, 57, 43, 0.85);
  border-radius: var(--r-pill); padding: 0.1875rem 0.625rem;
}
.tile-rec .dot { width: 0.4375rem; height: 0.4375rem; border-radius: 50%; background: #fff; }
.talking { display: none; align-items: flex-end; gap: 2px; height: 0.75rem; }
.talking i { width: 3px; height: 40%; background: var(--accent); border-radius: 2px; }
body[data-stage="speaking"] .tile-ai { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 165, 0, 0.18), var(--shadow-lg); }
body[data-stage="speaking"] .talking { display: inline-flex; }
body[data-stage="listening"] .tile-self { border-color: var(--good); box-shadow: 0 0 0 4px rgba(43, 182, 115, 0.18), var(--shadow-lg); }
body.cam-off .tile-self video, body.cam-off .tile-rec { visibility: hidden; }
@media (prefers-reduced-motion: no-preference) {
  body[data-stage="speaking"] .ai-orb { animation: orb 1.6s ease-in-out infinite; }
  .talking i { animation: talk 0.9s ease-in-out infinite; }
  .talking i:nth-child(2) { animation-delay: 0.15s; }
  .talking i:nth-child(3) { animation-delay: 0.3s; }
  .tile-rec .dot { animation: pulse 1.6s ease-in-out infinite; }
  @keyframes orb { 50% { transform: scale(1.06); box-shadow: 0 0 0 14px rgba(255, 165, 0, 0), 0 8px 24px rgba(255, 122, 61, 0.35); } }
  @keyframes talk { 50% { height: 100%; } }
}
/* in a video call the chat is a running transcript, so it reads a little quieter */
body[data-mode="video"] .msgs { gap: 1rem; }

/* ================================================================ responsive */
@media (max-width: 1100px) {
  .how { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .profile .status-chip { order: 3; }
  .headline-text { min-width: 0; }
  .sidebar { position: static; height: auto; max-height: 22rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .main { padding: 1.25rem 1rem 4rem; }
  .topbar { padding: 0 1rem; }
  .topbar .key-status, .topbar-divider, .brand-tag { display: none; }
  .topbar .key input { width: 9rem; }
  .rubric { grid-template-columns: 1fr auto; }
  .rubric .label { grid-column: 1 / -1; margin-bottom: -0.375rem; }
  .qa .cols, .q-card .grid2, .q-card .grid3, .sg, .modes { grid-template-columns: 1fr; }
  .marks span { width: 1.75rem; }
  .stages { padding: 0.875rem; }
  .stages li { font-size: 0; gap: 0.375rem; }
  .stages li.current { font-size: 0.75rem; }
  section.block { padding: 1rem 1rem 1.25rem; }
  section.block > header { margin: -1rem -1rem 1rem; padding: 0.875rem 1rem; }
}
@media (max-width: 640px) {
  .topbar .brand-name { display: none; }
  .topbar .key { display: none; }
  .topbar .key.show { display: flex; }
  .topbar .btn-label { display: none; }
  .link-box { flex-direction: column; }
  .how { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .iv-bar .brand-name { display: none; }
  .iv-head h1 { font-size: 1.375rem; }
  .iv-intro { padding: 1.25rem; }
  .msg.candidate { max-width: 92%; }
  .msg.interviewer.question, .msg.interviewer.follow_up { margin-left: 0; }
  .msg.interviewer.question::before, .msg.interviewer.follow_up::before { display: none; }
  .console-actions #type-instead { margin-left: 0; }
  .composer.over-console { bottom: 13.5rem; }
  .cam-check { grid-template-columns: 1fr; }
  .stage { gap: 0.5rem; padding-top: 0.5rem; }
  .ai-orb { width: 3rem; height: 3rem; }
  .ai-orb svg { width: 20px; height: 20px; }
}
