/*
style.css - the look of the web page (web/index.html).

- The palette has 7 colors (also listed in CLAUDE.md). Every color on the page is one of them
  or a tint of one of them; the page background and the title are solid, only buttons use a
  subtle gradient:
    Midnight #1E2350 (neutral dark: text)        Cloud #F5F6FB (neutral light: background)
    Indigo   #4F46E5 (main color: actions, focus, current step)
    Coral    #FF6B5B (recording, gaps, low scores)
    Teal     #14B8A6 (finish / success, strengths, good scores)
    Sun      #F5A524 (second accent: the second card of each setup step)
    Sky      #0EA5E9 (third accent: the first card of each setup step)
  The Practiss logo (web/brand/) uses Indigo, Midnight and Coral; dark mode shows its light-text
  version (.logo-light / .logo-dark).
  They are defined once as variables on :root and redefined for dark mode. The page follows the
  system's light or dark setting until you pick one with the theme button (top right), which
  sets data-theme="light" or "dark" on <html>.
- Two fonts: Sora (headings, buttons, step numbers, scores) and DM Sans (body text, labels,
  fields), loaded from Google Fonts in index.html; the system font is the fallback.
- Text size scales gently with the window (17.5-20px); the page uses the whole window width.
- Buttons are rounded "pills": indigo gradient = the main next step (btn-primary), coral =
  recording (talk), teal gradient = finish and get feedback (btn-success), white with an
  indigo outline on hover = secondary actions (btn-ghost).
- Scores are colored the same everywhere: 1-2 coral (low), 3 indigo (mid), 4-5 teal (high).
- Shapes borrowed from the logo: icons and numbers sit in rounded squares like the app icon
  (.card-icon, .slide-icon, .file-tile, .num, step numbers); page titles end in a coral dot
  (h2::after); the logo's sound bars (.waves) are on the record button and in the floating
  "working" pill (.busy, bottom centre). Only buttons use gradients; everything else is solid.
- Top right, once logged in: one white pill (what's left, "Your sessions", your initial). "Your
  sessions" opens a scrolling list (.account-menu #sessions-menu); the initial opens the account
  menu (.account-menu-small: your email, Delete my account, Log out); "Delete my account" is a
  modal <dialog> (.account-dialog) over a dimmed page.
- The login screens (your email, then the code or an admin's password) are one narrow white card
  in the middle of the page (.auth-card), with the app icon on top and Google's button below.
- Layout: the setup is a 3-step form shown one step at a time (.wizard). From 960px wide, the
  interview (conversation | controls) and the feedback (overview | details) use two columns.
  On a phone everything stacks in one column.
*/

:root {
  /* the palette */
  --midnight: #1e2350;
  --cloud: #f5f6fb;
  --indigo: #4f46e5;
  --coral: #ff6b5b;
  --teal: #14b8a6;
  /* the two fonts (loaded in index.html), with the system font as a fallback when offline */
  --font-heading: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sky: #0ea5e9;                   /* 7th color: the first card of each step */
  --sky-soft: #f4fafe;              /* Sky tint, very light: background of the first cards */
  --sky-line: #d9edf9;              /* Sky, light: border of the first cards */
  --sun: #f5a524;                   /* 6th color: the second card of each step, highlights */
  --sun-soft: #fffaef;              /* Sun tint, very light: background of the second cards */
  --sun-line: #f6e6c2;              /* Sun, light: border of the second cards */

  /* what each part of the page uses (light mode) */
  --bg: var(--cloud);
  --card: #ffffff;
  --text: var(--midnight);
  --muted: #5d6290;                 /* Midnight, lighter */
  --border: #dfe1f4;                /* Indigo tint */
  --field: #ffffff;                 /* form fields: white, never grey */
  --primary: var(--indigo);
  --primary-2: #7c6cf2;             /* lighter indigo: end of the button gradient */
  --primary-hover: #4338ca;
  --primary-soft: #eeedfd;          /* Indigo tint: highlighted cards, current step */
  --record: var(--coral);
  --record-soft: #ffedea;           /* Coral tint */
  --success: var(--teal);
  --success-2: #0e9f8e;             /* deeper teal: end of the button gradient */
  --success-hover: #0e9f8e;
  --warn: #e0533f;                  /* Coral, deeper, for text on light tints */
  --warn-soft: #fff1ee;
  --low: #e0533f;
  --mid: var(--indigo);
  --high: #0e9f8e;
  --you: #eeedfd;
  --error-bg: #ffedea;
  --error-text: #b4382a;
  --on-color: #ffffff;
  --page-glow: #dcd9fb;             /* Indigo glow at the top left of the page */
  --page-glow-2: #cff1ec;           /* Teal glow at the top right */
  --page-bg: #e6e4fc;               /* page background: one solid, colorful indigo tint */
  color-scheme: light; /* form controls (file pickers, selects) drawn in light colors */
}

/* Dark colors: used when the system is dark and you have not picked "light" with the
   theme button, or when you picked "dark" (app.js sets data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12152e;
    --card: #1b1f3d;
    --text: var(--cloud);
    --muted: #a5a9cc;
    --border: #2e3361;
    --field: #161a36;
    --primary: #8b85ff;
    --primary-2: #a99bff;
    --primary-hover: #a39eff;
    --primary-soft: #262a5c;
    --record: #ff8a7d;
    --record-soft: #3a2230;
    --success: #2dd4bf;
    --success-2: #14b8a6;
    --success-hover: #5eead4;
    --warn: #ff8a7d;
    --warn-soft: #36223a;
    --low: #ff8a7d;
    --mid: #8b85ff;
    --high: #2dd4bf;
    --you: #262a5c;
    --error-bg: #3a2230;
    --error-text: #ffb4aa;
    --on-color: #12152e;
    --page-glow: #23285e;
    --page-glow-2: #12363c;
    --page-bg: #181c40;
    --sun-soft: #25233a;
    --sun-line: #4a4232;
    --sky-soft: #1a2545;
    --sky-line: #2b4166;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12152e;
  --card: #1b1f3d;
  --text: var(--cloud);
  --muted: #a5a9cc;
  --border: #2e3361;
  --field: #161a36;
  --primary: #8b85ff;
  --primary-2: #a99bff;
  --primary-hover: #a39eff;
  --primary-soft: #262a5c;
  --record: #ff8a7d;
  --record-soft: #3a2230;
  --success: #2dd4bf;
  --success-2: #14b8a6;
  --success-hover: #5eead4;
  --warn: #ff8a7d;
  --warn-soft: #36223a;
  --low: #ff8a7d;
  --mid: #8b85ff;
  --high: #2dd4bf;
  --you: #262a5c;
  --error-bg: #3a2230;
  --error-text: #ffb4aa;
  --on-color: #12152e;
  --page-glow: #23285e;
  --page-glow-2: #12363c;
  --page-bg: #181c40;
  --sun-soft: #25233a;
  --sun-line: #4a4232;
  --sky-soft: #1a2545;
  --sky-line: #2b4166;
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* Text size: 17px on a laptop, growing to 19px on large screens. */
html { font-size: clamp(17.5px, 0.5vw + 11.5px, 20px); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg); /* one solid color: a colorful light indigo (no gradient) */
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
}

/* Headings, buttons, step numbers and scores use the display font; everything else the body font. */
h1, h2, h3, .btn, .step-no, .slide-no, .wizard-steps li, .score-big, .num, .crit-name,
.q-divider, .label-like, .form-card h3, .talk {
  font-family: var(--font-heading);
  letter-spacing: -0.01em;
}

/* ---------- page frame: the whole window width, with side margins ---------- */

.top, main { width: 100%; padding-left: clamp(16px, 3vw, 48px); padding-right: clamp(16px, 3vw, 48px); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; }
.top-right { display: flex; align-items: center; gap: 12px; }
main { padding-top: 16px; padding-bottom: 40px; }

h1 { font-size: 1.5rem; margin: 0; color: var(--primary); }
/* the logo, top left: a link back to a new interview; the dark version shows in dark mode */
.brand { line-height: 0; }
.brand a { display: inline-block; border-radius: 10px; }
.brand a:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; }
.brand img { height: clamp(32px, 4vw, 42px); width: auto; }
.brand .logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand .logo-light { display: none; }
  :root:not([data-theme="light"]) .brand .logo-dark { display: inline; }
}
:root[data-theme="dark"] .brand .logo-light { display: none; }
:root[data-theme="dark"] .brand .logo-dark { display: inline; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 0 0 8px; }

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px 28px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
}
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h2 { margin: 0; }

/* the login screen: one narrow card, centred, a little below the title */
.auth-card { max-width: 440px; margin: clamp(24px, 8vh, 80px) auto 0; }
.auth-card h2 { font-size: 1.4rem; margin-bottom: 4px; }
.auth-card > .hint { margin: 0 0 20px; }
.auth-card .btn-large { margin-top: 6px; }
.auth-card .auth-note { margin-top: 18px; text-align: center; }
.auth-card .auth-icon { display: block; width: 56px; height: 56px; margin: 0 0 14px; }
.auth-card .google-button { display: flex; justify-content: center; min-height: 44px; }
/* Cloudflare Turnstile's widget under the login card (AWS only); takes no room while empty */
.turnstile-box { display: flex; justify-content: center; margin-top: 16px; }
.turnstile-box:empty { display: none; }
/* what's left (a user) or the month's budget (an admin) in the header; Sun tint when a budget is at 80% or more */
.spend { color: var(--muted); padding: 4px 12px; border-radius: 999px; background: var(--primary-soft); white-space: nowrap; }
/* Once logged in, the top right holds one white pill: what's left, "Your sessions" (opens the
   list of your sessions) and your initial in an indigo circle (opens the account menu). Both
   menus hang under the pill. The pill disappears when everything in it is hidden (logged out). */
.account-bar {
  position: relative; /* the menu is placed under it */
  display: flex; align-items: center; gap: 8px; padding: 4px;
  border-radius: 999px; background: var(--card); border: 1px solid var(--border);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--indigo) 8%, transparent);
}
.account-bar:not(:has(> :not([hidden]))) { display: none; }
.account-bar [hidden] { display: none !important; }
.account-bar > .spend { margin-left: 2px; }
/* "Your sessions": a clock icon, the label and a chevron that turns when the list is open */
.bar-button {
  display: flex; align-items: center; gap: 6px; padding: 5px 10px 5px 10px;
  border: 0; border-radius: 999px; background: transparent; color: var(--text);
  font: inherit; font-size: 0.9rem; font-weight: 500; white-space: nowrap; cursor: pointer; transition: background 0.15s;
}
.bar-button svg { width: 18px; height: 18px; fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bar-button .chevron { width: 15px; height: 15px; stroke-width: 2.5; transition: transform 0.2s; }
.bar-button[aria-expanded="true"] .chevron { transform: rotate(180deg); }
/* your initial: just the indigo circle, with a soft ring on hover and while its menu is open */
.account-button { display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.account-button .avatar { transition: box-shadow 0.15s; }
.account-button:hover .avatar, .account-button[aria-expanded="true"] .avatar { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 22%, transparent); }
.bar-button:hover, .bar-button[aria-expanded="true"] { background: var(--primary-soft); }
.bar-button:focus-visible, .account-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 40%, transparent); outline-offset: 2px; }
.avatar {
  display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-family: var(--font-heading); font-weight: 700; font-size: 0.85rem; text-transform: uppercase;
}
@media (max-width: 760px) { .bar-label { display: none; } } /* the clock icon is enough on a phone */
@media (max-width: 560px) { .account-bar > .spend { display: none; } } /* it's in the menu too */
.spend.spend-warn { background: color-mix(in srgb, var(--sun) 22%, var(--card)); color: var(--text); }

/* The account menu: a white card under the pill, right-aligned. Top: your initial, email and
   what's left; then your latest sessions; then "Delete my account..." and Log out. */
.account-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 30;
  width: min(380px, calc(100vw - 32px)); padding: 8px;
  border-radius: 16px; background: var(--card); border: 1px solid var(--border);
  box-shadow: 0 16px 40px color-mix(in srgb, var(--indigo) 22%, transparent);
  animation: menu-in 0.15s ease-out;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } }
/* on a phone the pill is small, so the menu spans the screen (16px from each edge) instead */
@media (max-width: 560px) { .account-menu { position: fixed; top: 64px; left: 16px; right: 16px; width: auto; } }
.menu-head { display: flex; align-items: center; gap: 12px; padding: 8px 10px 12px; border-bottom: 1px solid var(--border); }
.menu-head .avatar { width: 40px; height: 40px; font-size: 1rem; }
.menu-head > span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.menu-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-label {
  margin: 12px 10px 6px; color: var(--muted); font-family: var(--font-heading);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.session-list { max-height: min(340px, 50vh); overflow-y: auto; }
.session-list > p { margin: 4px 10px 10px; }
/* one session: "Company · Role", then practice or interview, a status pill and the day */
.session-row {
  display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 9px 10px;
  border: 0; border-radius: 10px; background: transparent; color: var(--text);
  font: inherit; text-align: left; cursor: pointer; transition: background 0.15s;
}
.session-row:hover, .session-row:focus-visible { background: var(--primary-soft); outline: none; }
.session-row.current { box-shadow: inset 3px 0 0 var(--primary); }
.session-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.95rem; }
.session-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.82rem; }
/* the status, in the palette: brief = Sky, interview = Indigo, feedback ready = Teal */
.status-pill { padding: 0 8px; border-radius: 999px; font-weight: 600; }
.status-pill.brief { background: color-mix(in srgb, var(--sky) 16%, var(--card)); color: color-mix(in srgb, var(--sky) 70%, var(--text)); }
.status-pill.interview { background: var(--primary-soft); color: var(--primary); }
.status-pill.done { background: color-mix(in srgb, var(--high) 16%, var(--card)); color: var(--high); }
.menu-foot { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
.account-menu-small { width: min(300px, calc(100vw - 32px)); } /* the account menu: email, delete, log out */
.account-menu-small .menu-foot { border-top: 0; margin-top: 0; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px;
  border: 0; border-radius: 10px; background: transparent; color: var(--text);
  font: inherit; font-weight: 500; text-align: left; cursor: pointer; transition: background 0.15s;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--primary-soft); outline: none; }
.menu-item svg { width: 18px; height: 18px; fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.menu-item:disabled { opacity: 0.5; cursor: default; }

/* "Delete my account" dialog: a white card in the middle of the window over a dimmed page
   (::backdrop), with a coral icon tile; the code field and the buttons stacked */
.account-dialog {
  width: min(460px, calc(100vw - 32px)); padding: 22px 24px; border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--coral) 30%, var(--border));
  background: var(--card); color: var(--text);
  box-shadow: 0 24px 60px color-mix(in srgb, var(--midnight) 35%, transparent);
}
.account-dialog::backdrop { background: color-mix(in srgb, var(--midnight) 45%, transparent); }
.account-dialog .card-icon { background: var(--coral); box-shadow: 0 4px 12px color-mix(in srgb, var(--coral) 30%, transparent); }
.account-dialog h3 { margin: 0; font-size: 1.15rem; }
.account-dialog .error { position: static; }
.account-form { display: flex; flex-direction: column; gap: 12px; }
.account-form .card-head { margin-bottom: 4px; }
.account-form input { margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.auth-card input[name="code"] { font-family: var(--font-heading); font-size: 1.4rem; letter-spacing: 0.3em; text-align: center; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: 0.9rem; }
/* a short explanation under a field's name */
.hint { display: block; margin-top: 2px; color: var(--muted); font-weight: 400; font-size: 0.9rem; }
.label-like { display: block; margin-bottom: 6px; font-weight: 650; font-size: 1.05rem; }

/* Every setup step: two cards side by side (stacked on a phone). The first uses the Sky tint, the
   second the Sun tint, so the two halves of a step are easy to tell apart from the indigo page. */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 900px) { .card-grid { grid-template-columns: 1fr 1fr; } }
/* first card of a step: Sky tint; the second (.card-sun) overrides it with the Sun tint */
.form-card {
  border: 1px solid var(--sky-line);
  border-top: 3px solid color-mix(in srgb, var(--sky) 70%, var(--card)); /* a thin, softened stripe */
  border-radius: 16px; padding: 18px 20px; background: var(--sky-soft);
}
.form-card h3 { margin: 0; font-size: 1.15rem; }
.form-card > .hint { margin: 2px 0 14px; }
.form-card label:last-child { margin-bottom: 0; }
.card-sun { background: var(--sun-soft); border-color: var(--sun-line); border-top: 3px solid color-mix(in srgb, var(--sun) 70%, var(--card)); }
.card-sun textarea { margin-top: 0; }
.card-sun .check { margin: 12px 0 0; }
.form-card.fill { display: flex; flex-direction: column; }
.form-card.fill textarea { flex: 1; min-height: 12em; }
.my-cv .empty { margin: 0; padding: 22px 14px; border: 2px dashed color-mix(in srgb, var(--sky) 35%, var(--border)); border-radius: 14px; color: var(--muted); text-align: center; }
/* "or" between uploading and pasting: a line with the word in the middle */
.or { display: flex; align-items: center; gap: 12px; margin: 12px 0; color: var(--muted); font-size: 0.9rem; }
.or span { padding: 1px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); font-family: var(--font-heading); font-weight: 600; font-size: 0.8rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* two columns on a wide screen, one on a phone */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 28px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
/* a field that stretches to the height of its column (the job post next to the other fields) */
.fill { display: flex; flex-direction: column; }
.fill textarea { flex: 1; min-height: 12em; }
.center { display: flex; justify-content: center; margin-top: 20px; }

/* ---------- forms ---------- */

label { display: block; margin: 0 0 14px; font-weight: 650; font-size: 1.05rem; }
input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 1.08rem;
  font-weight: 400;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 56px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='14' fill='%235b54e8'/%3E%3Cpath d='M9 12l5 5 5-5' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 28px 28px;
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
input[type="file"] { padding: 8px; border-style: dashed; cursor: pointer; color: var(--muted); }
input[type="file"]::file-selector-button {
  margin-right: 14px; padding: 8px 18px;
  border: 0; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  font: inherit; font-weight: 650; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
input[type="file"]::file-selector-button:hover { background: var(--primary); color: #fff; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); background-color: var(--card); /* -color only: keeps the select arrow */
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.inline { display: flex; gap: 8px; margin-top: 10px; }
.inline input { margin-top: 0; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; margin: 0; }
.check[hidden] { display: none; } /* display: flex would otherwise beat `hidden` */

/* ---------- buttons ---------- */

/* Rounded "pill" buttons. Main actions use a soft gradient and lift slightly on hover. */
.btn {
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 650;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.12s, filter 0.15s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 35%, transparent);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 45%, transparent); }
.btn-success {
  background: linear-gradient(135deg, var(--success), var(--success-2));
  color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--success) 35%, transparent);
}
.btn-success:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost { background: var(--card); color: var(--text); border-color: var(--border); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }
.btn-ghost:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-danger { background: transparent; color: var(--record); border-color: color-mix(in srgb, var(--record) 60%, transparent); }
.btn-danger:hover:not(:disabled) { background: var(--record-soft); }
.btn-small { padding: 6px 14px; font-size: 0.85rem; }
.btn-cta { min-width: 220px; padding: 14px 34px; font-size: 1.12rem; } /* the last big step: "Practise again" */
.btn-large { padding: 14px 30px; font-size: 1.1rem; width: 100%; }

/* ---------- messages ---------- */

/* Pinned at the top of the window, so they are seen even when scrolled down. */
.error { position: sticky; top: 8px; z-index: 10; margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; }
.error { background: var(--error-bg); color: var(--error-text); }
/* "Working" (Listening and thinking..., Preparing your brief...): a white pill floating at the
   bottom centre of the window, over the page (so nothing moves, and the header stays clear), with
   the logo's sound bars moving in indigo. */
.busy {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 20;
  display: flex; align-items: center; gap: 12px; margin: 0; padding: 10px 22px 10px 16px;
  border-radius: 999px; background: var(--card); border: 1px solid var(--border);
  font-family: var(--font-heading); font-weight: 600; white-space: nowrap;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--indigo) 22%, transparent);
  animation: drop-in 0.25s ease-out;
}
@keyframes drop-in { from { opacity: 0; transform: translate(-50%, 10px); } }
.busy[hidden], .error[hidden] { display: none; }
.waves.mini { height: 20px; gap: 3px; }
.waves.mini i { width: 3px; background: var(--primary); animation: level 0.9s ease-in-out infinite; }
.waves.mini i:nth-child(1) { height: 9px; }
.waves.mini i:nth-child(2) { height: 18px; animation-delay: 0.15s; }
.waves.mini i:nth-child(3) { height: 13px; animation-delay: 0.3s; }
.waves.mini i:nth-child(4) { height: 7px; animation-delay: 0.45s; }
.waves.mini b { width: 6px; height: 6px; background: var(--coral); }

/* ---------- setup ---------- */

/* The setup is a 3-step form: the steps sit side by side in a track that shows one at a time.
   Next / Back (or a swipe, or a click on the step bar) scrolls it to the next step. */
.wizard { display: flex; flex-direction: column; gap: 14px; }
.wizard-steps { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0; padding: 0; }
/* The step bar: three pills joined by a short line. The number sits in a rounded square, like
   the app icon. The current step is solid indigo; a step already done shows a tick, and the line
   after it turns indigo, so the bar fills up as you go. */
.wizard-steps { gap: 0; align-items: center; }
.wizard-steps li {
  position: relative;
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 7px 20px 7px 7px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted); font-weight: 600; font-size: 1.02rem; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.wizard-steps li + li { margin-left: 44px; }
.wizard-steps li + li::before { /* the line between two pills */
  content: ""; position: absolute; left: -38px; top: 50%; width: 32px; height: 3px; margin-top: -1.5px;
  border-radius: 3px; background: var(--border); transition: background 0.2s;
}
.wizard-steps li.done + li::before { background: var(--primary); }
.wizard-steps li .step-no { width: 32px; height: 32px; margin: 0; font-size: 0.95rem; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.wizard-steps li:hover { border-color: var(--primary); color: var(--text); }
.wizard-steps li.active {
  border-color: transparent; background: var(--primary); color: var(--on-color);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 35%, transparent);
}
.wizard-steps li.active .step-no { background: var(--on-color); color: var(--primary); }
.wizard-steps li.done { color: var(--text); }
.wizard-steps li.done .step-no { background: var(--primary); color: transparent; position: relative; }
.wizard-steps li.done .step-no::after { /* a tick in place of the number */
  content: ""; position: absolute; left: 11px; top: 7px; width: 7px; height: 13px;
  border: solid var(--on-color); border-width: 0 3px 3px 0; transform: rotate(45deg);
}
/* The track is a window that clips; the rail inside it holds the three steps side by side and
   slides (transform) so exactly one step shows. Steps off screen are made `inert` by app.js, so
   Tab or a click can never pull a half-hidden field into view and shift the steps. */
.wizard-track {
  overflow: hidden;
  transition: height 0.25s ease; /* app.js sets the height to the current step's */
}
.wizard-rail { display: flex; align-items: flex-start; transition: transform 0.35s ease; }
.wizard-rail > .step { flex: 0 0 100%; min-width: 0; padding: 4px 6px 2px; }
/* Step titles ("The interview", "The company and the job", "Your CV"): large and bold, ending in a
   coral dot, like the dot in the logo's speech bubble (the step bar already gives the number). */
.wizard-track .step h2 { font-size: 1.6rem; font-weight: 700; margin: 6px 0 16px; }
.wizard-track .step h2::after {
  content: ""; display: inline-block; width: 0.26em; height: 0.26em; margin-left: 0.12em;
  border-radius: 50%; background: var(--coral);
}

/* The top of each setup card: an icon in a rounded square (Sky on the first card, Sun on the
   second, the shape of the app icon), then the card's title and its hint. */
.card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.card-head h3 { margin: 0; }
.card-head .hint { margin: 1px 0 0; }
.card-icon {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px;
  background: var(--sky); color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--sky) 30%, transparent);
}
.card-sun .card-icon { background: var(--sun); box-shadow: 0 4px 12px color-mix(in srgb, var(--sun) 30%, transparent); }
.card-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* A field with an indigo icon inside, on the left (the link to the job post) */
.with-icon { position: relative; display: block; }
.with-icon svg {
  position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; margin-top: -7px; pointer-events: none;
  fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.with-icon input { padding-left: 44px; }

/* Drop zone for files: a dashed box with an upload icon. The real file input covers the whole box,
   invisible, so a click opens the file picker and a file dropped on it is taken as chosen.
   app.js adds .over while a file is dragged above it. */
.dropzone {
  position: relative; display: flex; align-items: center; gap: 14px; margin-top: 6px; padding: 14px 16px;
  border: 2px dashed color-mix(in srgb, var(--primary) 30%, var(--border)); border-radius: 14px;
  background: var(--field); font-weight: 400; transition: border-color 0.15s, background 0.15s;
}
.dropzone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.dropzone svg {
  flex: none; width: 42px; height: 42px; padding: 9px; border-radius: 12px; background: var(--primary-soft);
  fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.dropzone strong { color: var(--primary); }
.dropzone .hint { font-size: 0.85rem; }
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone:has(input:focus-visible) { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
/* the chosen files, under the drop zone: one pill each, with a small indigo square */
.chips li { padding: 4px 12px; border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); color: var(--text); font-weight: 500; }
.chips li::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 2px; background: var(--primary); vertical-align: 1px; }

/* "Questions": a number between a − and a + button (indigo circles, like the dropdown arrows) */
.field { margin: 0 0 14px; }
.field > label { margin: 0; }
.stepper {
  display: flex; align-items: center; margin-top: 6px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--field);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.stepper:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.stepper:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.stepper input {
  flex: 1; min-width: 0; margin: 0; padding: 12px 4px; border: 0; background: transparent; box-shadow: none;
  text-align: center; font-family: var(--font-heading); font-weight: 600; -moz-appearance: textfield;
}
.stepper input:focus { box-shadow: none; background: transparent; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.step-btn {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; padding: 0 0 2px;
  border: 0; border-radius: 50%; background: #5b54e8; color: #fff; /* same indigo as the select arrow */
  font: 700 1.1rem/1 var(--font-heading); cursor: pointer; transition: transform 0.12s, filter 0.15s;
}
.step-btn:hover { filter: brightness(1.12); transform: scale(1.08); }
.step-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 40%, transparent); outline-offset: 2px; }

/* Back / Next bar: "sticky" pins it to the bottom of the window whenever the form is taller than
   the screen, so the buttons are always visible without scrolling. On a large screen it simply
   sits under the form. The negative margins let its white background cover the form's edges. */
.wizard-nav {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: 16px;
  margin: 0 -28px -24px; padding: 14px 28px 16px;
  background: var(--card); border-top: 1px solid var(--border);
  border-radius: 0 0 18px 18px;
  box-shadow: 0 -8px 18px -12px color-mix(in srgb, var(--midnight) 35%, transparent);
}
.wizard-nav p { flex: 1; margin: 0; text-align: center; font-size: 1rem; }
.wizard-nav .btn { min-width: 190px; padding: 14px 30px; font-size: 1.12rem; }
.editing {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; border-radius: 10px; background: var(--primary-soft); border: 1px solid var(--primary);
}
.editing[hidden] { display: none; }
/* above the setup form: "your first session is a practice", or "Request more" (Sky tint, a
   Sun stripe when nothing is left) */
.quota-note { margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; background: var(--sky-soft); border: 1px solid var(--sky-line); }
.quota-note[hidden] { display: none; }
.quota-note p { margin: 0 0 4px; }
.quota-empty { background: var(--sun-soft); border-color: var(--sun-line); border-left: 4px solid var(--sun); }
.quota-empty .inline { flex-wrap: wrap; }
.quota-empty .inline input { flex: 1 1 260px; }
.existing-docs:empty { display: none; }
.existing-docs { margin-top: 12px; }
@media (max-width: 640px) {
  .wizard-steps li { font-size: 0.8rem; padding: 5px 10px 5px 5px; gap: 6px; }
  .wizard-steps li .step-no { width: 26px; height: 26px; border-radius: 8px; }
  .wizard-steps li.done .step-no::after { left: 8px; top: 4px; }
  .wizard-steps li + li { margin-left: 16px; }
  .wizard-steps li + li::before { left: -14px; width: 12px; }
  .wizard-nav .btn { min-width: 0; padding: 12px 18px; font-size: 1rem; }
  .wizard-nav p { display: none; } /* the hint needs room the phone does not have */
  .wizard-track .step h2 { font-size: 1.25rem; }
}
.step-no {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; margin-right: 6px;
  border-radius: 50%; background: var(--primary); color: #fff;
  font-size: 0.85rem;
}
.submit-step { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.submit-step p { margin: 0; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; }
.chips:empty { display: none; }
.chips li { padding: 3px 10px; border-radius: 999px; background: var(--primary-soft); font-size: 0.85rem; }
.my-cv { margin-bottom: 12px; }
/* A stored document (your CV, or a company document already added): a white row with a tile
   showing its file type (PDF, DOCX...) in an indigo rounded square, its name and a note, and Delete. */
.stored {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--field);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--indigo) 6%, transparent);
}
.file-tile {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  background: var(--primary); color: var(--on-color);
  font-family: var(--font-heading); font-weight: 700; font-size: 0.66rem; letter-spacing: 0.04em;
}
.stored-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.stored-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* checkboxes in the palette's indigo */
input[type="checkbox"] { accent-color: var(--primary); width: 18px; height: 18px; }

/* ---------- brief ---------- */

.brief-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.card { border: 1px solid var(--border); border-left-width: 4px; border-radius: 10px; padding: 12px 16px; background: var(--card); }
.card h3 { color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.78rem; }
.card p { margin: 0 0 6px; }
.card ul { margin: 0; padding-left: 20px; }
.card.wide { grid-column: 1 / -1; }
.card.accent { border-left-color: var(--primary); background: var(--primary-soft); }
.card.warn { border-left-color: var(--warn); background: var(--warn-soft); }
details.card summary { cursor: pointer; font-weight: 600; }
/* The brief's header: Back on the left, the title (with the coral dot, like the setup steps) in
   the middle, the keyboard hint on the right. */
.brief-head h2 { font-size: 1.5rem; font-weight: 700; }
.brief-head h2::after {
  content: ""; display: inline-block; width: 0.26em; height: 0.26em; margin-left: 0.12em;
  border-radius: 50%; background: var(--coral);
}

/* "Something to change?": always open, a light coral card with a pencil in a coral tile; the
   text box and its button sit side by side on a wide screen */
.ask-changes {
  margin-top: 22px; padding: 18px 20px; border-radius: 16px;
  background: var(--record-soft); border: 1px solid color-mix(in srgb, var(--coral) 30%, transparent);
}
.ask-changes h3 { margin: 0; font-size: 1.1rem; }
.ask-changes .card-head { margin-bottom: 12px; }
.ask-changes .card-icon { background: var(--coral); box-shadow: 0 4px 12px color-mix(in srgb, var(--coral) 30%, transparent); }
.ask-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.ask-row textarea { flex: 1 1 320px; margin: 0; background: var(--field); }
.ask-row .btn { flex: none; padding: 12px 24px; }

/* Approve: locked (soft and not clickable) until the last card has been seen, then teal */
.btn-locked { background: var(--primary-soft); color: var(--muted); cursor: not-allowed; box-shadow: none; }
.btn-locked:hover { transform: none !important; }
.btn-ready { background: var(--success); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--success) 40%, transparent); }
.btn-ready:hover:not(:disabled) { background: var(--success-hover); }
.approve-hint { margin: 6px 0 0; text-align: center; color: var(--muted); font-size: 0.92rem; }
.btn-coral { background: var(--coral); color: #fff; }
.btn-coral:hover:not(:disabled) { filter: brightness(1.05); }

/* Light / dark switch: a pill with a sun and a moon, and a knob that slides between them */
.theme-switch {
  position: relative; display: inline-flex; align-items: center; justify-content: space-between;
  width: 68px; height: 34px; padding: 0 8px; border-radius: 999px; cursor: pointer;
  background: var(--primary-soft); border: 1px solid var(--border);
}
.theme-switch .icon { width: 18px; height: 18px; z-index: 1; display: grid; place-items: center; }
.theme-switch svg { width: 18px; height: 18px; fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; }
.theme-switch .moon svg { fill: var(--primary); stroke: none; }
.theme-switch .knob {
  position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--card); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); transition: transform 0.25s ease;
}
.theme-switch[aria-checked="true"] .knob { transform: translateX(34px); }

/* ---------- carousel: cards scrolled (or swiped) from left to right ---------- */

/* The current card is large and centered; the previous and next cards peek out on each side,
   smaller and faded, and the track fades out at both edges (mask-image), so it is clear you can
   move left and right. No scrollbar: the arrows, the keyboard arrows, a swipe, or a click on a
   peeking card move between cards. app.js marks the centered card with .current. */
.carousel-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
.carousel-track {
  position: relative; /* so each card's offsetLeft is measured from the track */
  display: flex; gap: 24px; flex: 1 1 auto; min-width: 0; max-width: 1400px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 16px 0;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
}
.carousel-track::-webkit-scrollbar { display: none; }
/* Empty spacers before the first card and after the last, so those can also sit in the middle:
   spacer + gap = (100% - card width) / 2. */
.carousel-track::before, .carousel-track::after { content: ""; flex: 0 0 calc(18% - 24px); }
.slide {
  flex: 0 0 64%;
  scroll-snap-align: center;
  min-height: 420px;
  border: 1px solid var(--border); border-top: 6px solid color-mix(in srgb, var(--primary) 35%, var(--border));
  border-radius: 20px; padding: 32px 44px; background: var(--card);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--indigo) 12%, transparent);
  font-size: 1.3rem;
  opacity: 0.4; transform: scale(0.92);
  transition: opacity 0.3s, transform 0.3s;
  cursor: pointer;
}
.slide.current { opacity: 1; transform: none; cursor: default; }
.slide h3 { display: flex; align-items: center; gap: 12px; font-size: 1.45rem; margin-bottom: 18px; }
.slide li { line-height: 1.5; }

/* feedback overview: a narrower column, so smaller cards with a smaller peek */
.overview .carousel-track::before, .overview .carousel-track::after { flex-basis: calc(8% - 14px); }
.overview .carousel-track { padding: 10px 0; gap: 14px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent); }
.overview .slide { flex-basis: 84%; min-height: 0; padding: 18px 22px; font-size: 1.08rem; border-top-width: 6px; }
.overview .slide h3 { font-size: 1.1rem; }

@media (max-width: 760px) {
  .carousel-track { padding: 12px 0; gap: 12px; }
  .carousel-track::before, .carousel-track::after { flex-basis: calc(6% - 12px); }
  .slide { flex-basis: 88%; min-height: 0; padding: 20px 22px; font-size: 1.1rem; }
}
.slide-no {
  display: inline-grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--primary-soft); color: var(--primary); font-size: 0.85rem;
}
/* a card's icon: a rounded square like the app icon, in the card's color (indigo by default) */
.slide-icon {
  display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 13px;
  background: var(--primary-soft); color: var(--primary);
}
.slide-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.slide.accent .slide-icon { background: var(--primary); color: var(--on-color); }
.slide.warn .slide-icon { background: var(--warn); color: var(--on-color); }
.slide.good .slide-icon { background: var(--high); color: var(--on-color); }
.overview .slide-icon { width: 36px; height: 36px; border-radius: 11px; }
.overview .slide-icon svg { width: 20px; height: 20px; }
.slide p { margin: 0 0 8px; }
.slide ul, .slide ol { margin: 0; padding-left: 22px; }
.slide li + li { margin-top: 6px; }
.slide.accent { border-top-color: var(--primary); background: var(--primary-soft); }
.slide.accent .slide-no { background: var(--primary); color: var(--on-color); }
.slide.warn { border-top-color: var(--warn); background: var(--warn-soft); }
.slide.warn .slide-no { background: var(--warn); color: var(--on-color); }
.slide.good { border-top-color: var(--high); background: color-mix(in srgb, var(--high) 12%, var(--card)); }
.slide.good .slide-no { background: var(--high); color: var(--on-color); }
/* the round arrows on each side: an indigo circle with a white chevron (an SVG, so it is centred) */
.carousel .arrow {
  flex: none; display: grid; place-items: center; width: 54px; height: 54px; padding: 0;
  border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--on-color); border: 0;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 40%, transparent);
}
.carousel .arrow svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.carousel .arrow:hover:not(:disabled) { filter: brightness(1.08); }
.carousel .arrow.off { visibility: hidden; } /* no arrow before the first card or after the last */
.overview .arrow { width: 40px; height: 40px; }
.overview .arrow svg { width: 18px; height: 18px; }
/* where you are: a short bar per card; the current one is long and indigo, the ones already seen
   a lighter indigo */
.carousel-dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.btn-wide { min-width: 320px; padding: 12px 24px; font-size: 1.05rem; margin-top: 16px; }
.carousel-dots span { width: 12px; height: 6px; border-radius: 3px; background: var(--border); transition: background 0.2s, width 0.25s; }
.carousel-dots span.seen { background: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.carousel-dots span.on { width: 28px; background: var(--primary); }

/* ---------- interview ---------- */

.interview-layout { display: grid; grid-template-columns: 1fr; gap: 16px; }
.transcript { display: flex; flex-direction: column; gap: 10px; }
/* "Question 1": a small indigo pill on a line across the conversation */
.q-divider {
  display: flex; align-items: center; gap: 10px; margin-top: 8px;
  color: var(--primary); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
}
.q-divider::before { content: ""; width: 14px; border-top: 1px solid var(--border); }
.q-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
/* One message: an avatar next to a bubble. The interviewer (the app icon) is on the left in a
   white bubble; you (your initial) are on the right in an indigo-tinted bubble. The corner next
   to the avatar is less rounded, so the bubble points at who speaks. */
.line { display: flex; align-items: flex-start; gap: 12px; max-width: 88%; }
.line-avatar { flex: none; width: 38px; height: 38px; border-radius: 11px; }
.line-avatar.you {
  display: grid; place-items: center; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-family: var(--font-heading); font-weight: 700; font-size: 0.9rem; text-transform: uppercase;
}
.bubble {
  min-width: 0; padding: 12px 18px; border-radius: 4px 18px 18px 18px;
  border: 1px solid var(--border); background: var(--card);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--indigo) 6%, transparent);
}
.line .who { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 700; color: var(--primary); }
.line p { margin: 4px 0 0; font-size: 1.2rem; line-height: 1.55; }
.line.interviewer { align-self: flex-start; }
.line.candidate { align-self: flex-end; flex-direction: row-reverse; }
.line.candidate .bubble { background: var(--you); border-color: transparent; border-radius: 18px 4px 18px 18px; box-shadow: none; }
.line.candidate .who { color: var(--muted); }
.tag { padding: 0 6px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); font-size: 0.72rem; }
.sources { margin-top: 6px; font-size: 0.8rem; color: var(--muted); }
.sources summary { cursor: pointer; }
.sources ul { margin: 4px 0 0; padding-left: 18px; }

.side { display: flex; flex-direction: column; gap: 14px; }
.progress-block h2 { margin: 0 0 6px; }
.progress-bar { height: 8px; border-radius: 99px; background: var(--primary-soft); overflow: hidden; }
#progress-fill { height: 100%; width: 0; border-radius: 99px; background: var(--primary); transition: width 0.3s; }
/* "Answer by voice": a checkbox drawn as a switch (a knob that slides right and turns the track
   indigo when on) */
.toggle { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 500; cursor: pointer; }
.toggle input {
  appearance: none; -webkit-appearance: none; position: relative; flex: none;
  width: 44px; height: 24px; margin: 0; padding: 0; border: 0; border-radius: 999px;
  background: var(--border); cursor: pointer; transition: background 0.2s;
}
.toggle input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s;
}
.toggle input:checked { background: var(--primary); }
.toggle input:checked::after { transform: translateX(20px); }
.toggle input:focus-visible { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent); }

.controls { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.controls[hidden] { display: none; } /* display: flex would otherwise beat `hidden` */
.controls textarea { width: 100%; }
.controls p { margin: 0; }
/* The record button: a coral disc with a soft coral ring around it, the logo's sound bars (four
   bars and a dot) above the label. While recording the bars move like a level meter and the
   ring pulses outwards. */
.talk {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  width: 156px; height: 156px; margin: 8px 0 4px; padding: 0 18px;
  border-radius: 50%; border: 0;
  background: linear-gradient(135deg, var(--record), color-mix(in srgb, var(--record) 82%, var(--midnight)));
  color: #fff; font-size: 0.98rem; line-height: 1.2;
  box-shadow: 0 0 0 10px var(--record-soft), 0 10px 24px color-mix(in srgb, var(--record) 35%, transparent);
  user-select: none;
}
.talk:hover:not(:disabled) { filter: brightness(1.06); transform: scale(1.03); }
.talk.recording { animation: ring 1.4s ease-out infinite; }
@keyframes ring {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--record) 45%, transparent), 0 10px 24px color-mix(in srgb, var(--record) 35%, transparent); }
  100% { box-shadow: 0 0 0 22px transparent, 0 10px 24px color-mix(in srgb, var(--record) 35%, transparent); }
}
@keyframes pulse { 50% { transform: scale(1.05); box-shadow: 0 0 0 10px var(--record-soft); } }
.waves { display: flex; align-items: center; gap: 5px; height: 30px; }
.waves i { display: block; width: 5px; border-radius: 3px; background: #fff; }
.waves i:nth-child(1) { height: 14px; }
.waves i:nth-child(2) { height: 28px; }
.waves i:nth-child(3) { height: 20px; }
.waves i:nth-child(4) { height: 10px; }
.waves b { display: block; width: 8px; height: 8px; margin-left: 1px; border-radius: 50%; background: #fff; }
.talk.recording .waves i { animation: level 0.9s ease-in-out infinite; }
.talk.recording .waves i:nth-child(2) { animation-delay: 0.15s; }
.talk.recording .waves i:nth-child(3) { animation-delay: 0.3s; }
.talk.recording .waves i:nth-child(4) { animation-delay: 0.45s; }
@keyframes level { 50% { transform: scaleY(0.4); } }
/* While the server works (all buttons are disabled), the record button turns into a calm indigo
   "One moment" with its bars moving slowly, instead of a faded coral button. */
.talk:disabled {
  opacity: 1; background: var(--primary-soft); color: var(--primary);
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--primary-soft) 50%, transparent);
}
.talk:disabled .waves i, .talk:disabled .waves b { background: var(--primary); }
.talk:disabled .waves i { animation: level 1.6s ease-in-out infinite; }
.talk:disabled .waves i:nth-child(2) { animation-delay: 0.2s; }
.talk:disabled .waves i:nth-child(3) { animation-delay: 0.4s; }
.talk:disabled .waves i:nth-child(4) { animation-delay: 0.6s; }
.talk:disabled #talk-label { display: none; }
.talk:disabled::after { content: "One moment"; }
/* a button with a small icon before its text (Replay the question) */
.btn-icon { display: inline-flex; align-items: center; gap: 8px; }
.btn-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.end-row { display: flex; justify-content: center; padding-top: 14px; border-top: 1px solid var(--border); }
.end-row .btn { width: 100%; }
#timings { margin: 0; text-align: center; }
kbd { border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; font-size: 0.85em; }

/* "..." while you speak or the interviewer prepares the next question */
.line.pending { opacity: 0.85; }
.dots { display: inline-flex; gap: 5px; padding: 6px 2px 2px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); animation: dot 1.2s infinite ease-in-out; }
.line.candidate .dots i { background: var(--record); }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

/* answer timer under the record button: "1:23 / 5:00", coral in the last 30 seconds */
.rec-timer { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 600; color: var(--record); font-variant-numeric: tabular-nums; }
.rec-timer[hidden] { display: none; }
.rec-timer.late { animation: pulse-text 1s infinite; }
@keyframes pulse-text { 50% { opacity: 0.45; } }

/* interview countdown in the side panel */
.clock { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--primary-soft); }
.clock[hidden] { display: none; }
.clock-row { display: flex; align-items: baseline; justify-content: space-between; }
.clock-label { color: var(--muted); font-size: 0.92rem; }
.clock strong { font-family: var(--font-heading); font-size: 1.35rem; font-variant-numeric: tabular-nums; color: var(--primary); }
#clock-fill { height: 100%; width: 100%; background: var(--primary); transition: width 1s linear; }
.clock.low { background: var(--record-soft); }
.clock.low strong { color: var(--record); }
.clock.low #clock-fill { background: var(--record); }
.clock-note { margin: 2px 0 0; font-size: 0.92rem; color: var(--warn); }
.clock-note[hidden] { display: none; }
#end-interview.urgent { animation: pulse 1.2s ease-in-out infinite; }
.go-back { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }

/* ---------- feedback ---------- */

.feedback-layout { display: grid; grid-template-columns: 1fr; gap: 16px; }
.overview { display: flex; flex-direction: column; gap: 14px; }
.overview p { margin: 0; }
.score-head { display: flex; align-items: center; gap: 18px; }
.score-head h2 { margin: 0 0 4px; font-size: 1.45rem; font-weight: 700; }
/* "Your feedback", "Rubric", "Question by question": bold, ending in the logo's coral dot */
.score-head h2::after, .details h2::after {
  content: ""; display: inline-block; width: 0.26em; height: 0.26em; margin-left: 0.12em;
  border-radius: 50%; background: var(--coral);
}
/* The overall score: a ring (an SVG circle) filled round by score / 5, in the score's color, on a
   light track; the number in the middle. */
.score-big {
  position: relative; display: grid; place-items: center; flex: none;
  width: 96px; height: 96px; font-size: 2rem; font-weight: 700;
}
.score-big svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.score-big circle { fill: none; stroke-width: 8; }
.score-big .track { stroke: color-mix(in srgb, currentColor 14%, transparent); }
.score-big .arc { stroke: currentColor; stroke-linecap: round; }
.score-big span { line-height: 1; text-align: center; }
.score-big small { display: block; font-size: 0.75rem; font-weight: 600; margin-top: 2px; color: var(--muted); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 0.8rem; font-weight: 600; }
.overview ol, .overview ul { margin: 0; padding-left: 20px; }
.overview li + li { margin-top: 4px; }
.box { border-radius: 10px; padding: 12px 16px; }
.box.fixes { background: var(--primary-soft); }
.box.strengths { background: color-mix(in srgb, var(--high) 12%, transparent); }
.box h3 { margin-bottom: 6px; }

/* The details: two white panels, the rubric then the questions */
.details { display: flex; flex-direction: column; gap: 16px; }
.details h2 { margin: 2px 0 0; font-size: 1.3rem; font-weight: 700; }
.details h2 + .hint { margin: 2px 0 14px; }
/* One criterion or question: a row you click open. Its left edge takes the score's color; the
   chevron on the right turns when it is open. */
.item {
  border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: 12px;
  margin-bottom: 8px; background: var(--card); transition: box-shadow 0.15s, border-color 0.15s;
}
.item:has(.num.low) { border-left-color: var(--low); }
.item:has(.num.mid) { border-left-color: var(--mid); }
.item:has(.num.high) { border-left-color: var(--high); }
.item:hover, .item[open] { box-shadow: 0 4px 16px color-mix(in srgb, var(--indigo) 10%, transparent); }
.item summary {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; cursor: pointer; list-style: none;
}
.item summary::-webkit-details-marker { display: none; }
.item summary::after { /* a chevron drawn with two borders */
  content: ""; flex: none; width: 8px; height: 8px; margin: 0 4px 4px auto;
  border: solid var(--primary); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); transition: transform 0.2s;
}
.item[open] summary::after { transform: rotate(-135deg); margin-bottom: -2px; }
.item summary { font-size: 1.08rem; }
.item summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent); outline-offset: 2px; border-radius: 10px; }
.item .body { padding: 2px 16px 14px; font-size: 1.08rem; }
.item .body p { margin: 0 0 10px; }
.improve { border-radius: 10px; padding: 10px 14px; background: var(--primary-soft); }
.improve ul { margin: 4px 0 0; padding-left: 20px; }
.improve li + li { margin-top: 4px; }
.item .label { display: block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: 0.04em; }
.crit-name { min-width: 190px; font-weight: 600; }
.bar { display: flex; gap: 4px; }
.bar span { width: 26px; height: 8px; border-radius: 4px; background: var(--primary-soft); }
/* the score: a number in a rounded square of its color, like the app icon */
.num { display: inline-grid; place-items: center; flex: none; font-weight: 700; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 9px; color: var(--on-color); }
.q-text { font-weight: 600; }
.exchange { border-left: 3px solid var(--border); padding-left: 10px; font-size: 0.9rem; color: var(--muted); }

.low { color: var(--low); }   .bar.low span.on { background: var(--low); }   .num.low { background: var(--low); }
.mid { color: var(--mid); }   .bar.mid span.on { background: var(--mid); }   .num.mid { background: var(--mid); }
.high { color: var(--high); } .bar.high span.on { background: var(--high); } .num.high { background: var(--high); }
/* the number inside a colored badge stays readable (the rules above would make it the same color) */
.num.low, .num.mid, .num.high { color: var(--on-color); }

/* ---------- wide screens: two columns ---------- */

@media (min-width: 960px) {
  .brief-grid { grid-template-columns: repeat(3, 1fr); }

  .interview-layout { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
  .conversation { max-height: calc(100vh - 150px); overflow-y: auto; }
  .side { position: sticky; top: 16px; }

  .feedback-layout { grid-template-columns: minmax(420px, 40%) minmax(0, 1fr); align-items: start; }
  .overview { position: sticky; top: 16px; }
}

/* Large screens */
@media (min-width: 1400px) {
  .brief-grid { grid-template-columns: repeat(4, 1fr); }
  .interview-layout { grid-template-columns: minmax(0, 1fr) 420px; }
}

.theme-toggle { min-width: 2.6em; }
