/* =====================================================================
   THEKEY · "دفتر" (Ledger) — an original design for the oral-exam prep flow.
   Metaphor: exam paper + accounting ledger. Warm paper surfaces, hairline
   rules, monospace numerals for all quantitative content, one signature
   accent (deep teal = "verified understanding"). Not a dashboard clone.
   Light/dark via data-theme; RTL/LTR via logical properties.
   ===================================================================== */
:root {
  --ink: #16191f;
  --ink-soft: #40474f;
  --paper: #faf7f0;          /* warm exam paper */
  --panel: #ffffff;          /* cards */
  --sunken: #f2eee3;         /* worksheet / recessed */
  --rule: #e6e0d1;           /* hairline rules */
  --rule-strong: #d8d1bd;
  --muted: #7c7361;

  --accent: #7c3aed;         /* THEKEY purple — the brand identity */
  --accent-soft: #ede9fe;
  --accent-ink: #5b21b6;
  --ok: #16a34a;             /* green — CORRECTNESS ONLY (semantic rule) */
  --ok-soft: #e5f5eb;
  --ok-ink: #15803d;
  --flag: #b45309;           /* amber — review / attention */
  --flag-soft: #f6ebdb;
  --bad: #b3261e;

  --shadow: 0 1px 0 var(--rule), 0 18px 40px -30px rgba(40, 33, 12, .5);
  --shadow-lift: 0 2px 0 var(--rule-strong), 0 24px 50px -28px rgba(40, 33, 12, .55);
  --radius: 14px;
  --radius-sm: 9px;
  --rail-w: 300px;

  --font: "Readex Pro", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;
}
:root[data-theme="dark"] {
  --ink: #ece7db;
  --ink-soft: #b9b3a5;
  --paper: #14161b;
  --panel: #1b1e25;
  --sunken: #101318;
  --rule: #2c2f38;
  --rule-strong: #363a45;
  --muted: #8b877a;

  --accent: #a78bfa;
  --accent-soft: #2a1b52;
  --accent-ink: #c4b5fd;
  --ok: #34d399;
  --ok-soft: #10301f;
  --ok-ink: #6ee7b7;
  --flag: #e8a13a;
  --flag-soft: #2a2113;
  --bad: #f0736b;
  --shadow: 0 1px 0 var(--rule), 0 20px 44px -30px rgba(0, 0, 0, .7);
  --shadow-lift: 0 2px 0 var(--rule-strong), 0 26px 54px -26px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
html[dir="ltr"] { direction: ltr; }
button, input, textarea { font-family: inherit; color: inherit; }
b, strong { font-weight: 600; }
/* every number / formula / code reads as a ledger entry */
.mono, .num, .sheet, .formula-input, .cell-ref, .answer-input,
.q-num, .step, .streak, .lat { font-family: var(--mono); font-feature-settings: "tnum" 1; }

/* paper grain — a faint ruled texture, the signature backdrop */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: repeating-linear-gradient(var(--rule) 0 1px, transparent 1px 30px);
  opacity: .28;
}
:root[data-theme="dark"] body::before { opacity: .16; }
.shell, .topbar { position: relative; z-index: 1; }

/* ===================================================================
   SHELL: main + right rail (rail sits on the RTL start side)
   =================================================================== */
.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail-w);
  gap: 22px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 60px;
  align-items: start;
}
@media (max-width: 900px) { .shell { grid-template-columns: 1fr; } .rail { order: -1; } }

/* ===================================================================
   TOP BAR
   =================================================================== */
.topbar {
  max-width: 1180px; margin: 0 auto; padding: 18px 24px 16px;
  display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--ink); color: var(--paper); font-size: 17px;
}
.brand-name { font-weight: 600; font-size: 17px; letter-spacing: -.2px; }
.brand-name b { color: var(--accent); font-weight: 700; }
.brand-tag {
  font-size: 11px; color: var(--muted); border: 1px solid var(--rule);
  padding: 2px 8px; border-radius: 999px; margin-inline-start: 4px;
}
.topbar-spacer { flex: 1; }
.chip {
  border: 1px solid var(--rule); background: var(--panel); color: var(--ink);
  border-radius: 999px; padding: 7px 13px; font-size: 13px; cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.chip:hover { border-color: var(--accent); }
.chip:active { transform: translateY(1px); }
.chip.small { padding: 4px 10px; font-size: 12px; }

/* ===================================================================
   CARDS + generic
   =================================================================== */
.card {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.eyebrow {
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.4px; margin: 0 0 6px; }
.section-h { font-size: 14px; font-weight: 600; margin: 22px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-h::before { content: ""; width: 7px; height: 7px; background: var(--accent); border-radius: 2px; }

.field { margin: 16px 0; display: flex; flex-direction: column; gap: 8px; }
.field > label { font-weight: 600; font-size: 13px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row .field { flex: 1; min-width: 190px; }

/* buttons */
.btn { border: 1px solid transparent; border-radius: 11px; padding: 12px 18px; font: inherit; font-weight: 600; cursor: pointer; transition: .15s; width: 100%; }
.btn-primary { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #22124d; }
.btn-primary:hover { filter: brightness(1.07); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; filter: none; }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--accent); color: var(--ink); }
.btn-ghost:disabled { opacity: .4; cursor: not-allowed; }
.btn.small { width: auto; padding: 9px 15px; font-size: 13px; }

/* ===================================================================
   RIGHT RAIL — the objective "ledger" (purposeful, not fake nav)
   =================================================================== */
.rail { position: sticky; top: 18px; display: flex; flex-direction: column; gap: 16px; }
.rail-card { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.obj-chip { font-family: var(--mono); font-size: 11px; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 6px; font-weight: 600; }
.obj-title { font-size: 16px; font-weight: 700; line-height: 1.5; margin: 12px 0 14px; }
.obj-ring-row { display: flex; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--rule); }
.ring {
  --pct: 0%;
  width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--accent) var(--pct), var(--sunken) 0);
  transition: background .5s ease;
}
.ring span { width: 40px; height: 40px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-family: var(--mono); font-size: 12px; font-weight: 600; }
.ring-label { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* idea ledger lines */
.ledger { list-style: none; margin: 14px 0 0; padding: 0; }
.ledger li {
  display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-top: 1px solid var(--rule); font-size: 13px; color: var(--ink-soft);
}
.ledger li:first-child { border-top: 0; }
.ledger .tick {
  flex: none; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--rule-strong);
  display: grid; place-items: center; font-family: var(--mono); font-size: 11px; color: var(--muted); transition: .18s;
}
.ledger .l-done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.ledger .l-attempted .tick { background: var(--flag-soft); border-color: var(--flag); color: var(--flag); }
.ledger .l-current .tick { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); color: var(--accent); }
.ledger .l-current { color: var(--ink); font-weight: 600; }

.rail-step { display: flex; align-items: center; gap: 11px; }
.picker { display: flex; flex-direction: column; gap: 6px; }
.pick { display: flex; align-items: center; gap: 9px; text-align: start; border: 1px solid var(--rule); background: var(--panel); border-radius: 9px; padding: 9px 11px; cursor: pointer; font: inherit; color: var(--ink-soft); transition: .15s; }
.pick:hover { border-color: var(--accent); color: var(--ink); }
.pick-on { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); font-weight: 600; }
.pick-ch { font-family: var(--mono); font-size: 11px; color: var(--accent); background: var(--sunken); padding: 2px 7px; border-radius: 5px; flex: none; }
.pick > span:last-child { font-size: 13px; }

.rail-step .rs-num { font-family: var(--mono); width: 26px; height: 26px; border-radius: 7px; background: var(--sunken); display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.rail-step.next .rs-num { background: var(--ink); color: var(--paper); }
.rs-text { font-size: 13px; } .rs-text b { display: block; font-size: 13.5px; } .rs-text span { color: var(--muted); font-size: 12px; }

/* ===================================================================
   PROGRESS LEDGER LINE (top of the solving surface)
   =================================================================== */
.progress-wrap { margin-bottom: 16px; }
.progress-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.progress-label { font-weight: 600; font-size: 14px; }
.progress-label .mono { color: var(--accent); }
.stepper { display: flex; gap: 6px; }
.step {
  flex: 1; min-width: 30px; height: 8px; border-radius: 3px; border: 0; padding: 0; cursor: pointer;
  background: var(--rule); position: relative; transition: background .2s, transform .1s; font-size: 0;
}
.step:hover { transform: scaleY(1.35); }
.step.active { background: var(--accent); }
.step.done { background: var(--ok); opacity: .75; }
.step.attempted { background: var(--flag); opacity: .6; }

/* ===================================================================
   SOLVE SURFACE
   =================================================================== */
.solve-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 780px) { .solve-grid { grid-template-columns: 1fr; } }

.q-panel { position: relative; overflow: hidden; }
.q-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.q-num { font-size: 30px; font-weight: 600; color: var(--accent); line-height: 1; }
.q-of { font-size: 12px; color: var(--muted); }
.q-title { font-size: 19px; font-weight: 700; letter-spacing: -.3px; margin: 0 0 10px; }
.q-text { font-size: 16px; line-height: 1.85; margin: 0 0 16px; color: var(--ink); }
.instructions {
  display: flex; gap: 9px; align-items: flex-start; background: var(--sunken);
  border-radius: var(--radius-sm); padding: 11px 13px; font-size: 13px; line-height: 1.6;
  color: var(--ink-soft); margin-bottom: 18px; border: 1px solid var(--rule);
}
.instructions .ins-icon { flex: none; color: var(--accent); font-weight: 700; font-family: var(--mono); }

.answer-row { border-top: 1px solid var(--rule); padding-top: 16px; }
.answer-row > label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 9px; }
.answer-field { display: flex; gap: 8px; align-items: stretch; }
.answer-input {
  flex: 1; border: 1px solid var(--rule-strong); border-radius: 10px; padding: 12px 14px;
  font-size: 17px; background: var(--sunken); text-align: start; letter-spacing: .5px;
  transition: border-color .15s, box-shadow .15s;
}
.answer-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.unit { display: grid; place-items: center; padding: 0 12px; font-family: var(--mono); font-size: 13px; color: var(--muted); border: 1px dashed var(--rule-strong); border-radius: 10px; }
.feedback { margin-top: 11px; font-size: 14px; font-weight: 600; min-height: 20px; display: flex; align-items: center; gap: 7px; }
.feedback.ok { color: var(--ok-ink); }
.feedback.warn { color: var(--flag); }
.feedback.bad { color: var(--bad); }
/* verified stamp */
.stamp {
  position: absolute; inset-block-start: 16px; inset-inline-end: 18px;
  font-family: var(--mono); font-size: 12px; color: var(--ok); border: 2px solid var(--ok);
  padding: 4px 9px; border-radius: 8px; transform: rotate(-8deg); opacity: 0; letter-spacing: 1px;
}
.q-panel.verified .stamp { animation: stampIn .35s cubic-bezier(.2,1.3,.4,1) forwards; }
@keyframes stampIn { from { opacity: 0; transform: rotate(-8deg) scale(1.5); } to { opacity: 1; transform: rotate(-8deg) scale(1); } }

/* ===================================================================
   WORKSHEET — the signature: real accounting-ledger paper
   =================================================================== */
.sheet-panel { padding: 18px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.sheet-head .eyebrow { margin: 0; }
.formula-bar { display: flex; border: 1px solid var(--rule-strong); border-radius: 9px; overflow: hidden; margin-bottom: 10px; background: var(--panel); }
.cell-ref { background: var(--sunken); border-inline-end: 1px solid var(--rule-strong); padding: 9px 12px; font-size: 12px; font-weight: 600; color: var(--accent); min-width: 44px; text-align: center; }
.formula-input { flex: 1; border: 0; padding: 9px 11px; font-size: 13px; background: transparent; direction: ltr; }
.formula-input:focus { outline: none; }
.sheet-scroll { overflow-x: auto; border: 1px solid var(--rule-strong); border-radius: 9px; }
.sheet { border-collapse: collapse; width: 100%; direction: ltr; background: var(--panel); }
.sheet th {
  background: var(--sunken); color: var(--muted); font-size: 11px; font-weight: 600;
  padding: 5px; border: 1px solid var(--rule); position: sticky; min-width: 40px;
}
.sheet thead th { border-bottom: 2px solid var(--rule-strong); }   /* ledger double-rule */
.sheet tbody th { border-inline-end: 2px solid var(--rule-strong); }
.sheet td { border: 1px solid var(--rule); padding: 0; }
.sheet .cell { width: 100%; border: 0; padding: 8px 9px; font-size: 13px; background: transparent; text-align: right; letter-spacing: .3px; }
.sheet .cell:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.sheet .cell.sel { background: var(--accent-soft); }
.sheet-hint { margin-top: 9px; font-size: 12px; color: var(--muted); direction: ltr; text-align: start; line-height: 1.5; }
.sheet-hint code { font-family: var(--mono); color: var(--accent); }

/* ===================================================================
   NAV
   =================================================================== */
.nav-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.nav-row .btn { width: auto; min-width: 140px; }

/* ===================================================================
   DONE VIEW
   =================================================================== */
#doneView { text-align: center; }
.done-seal {
  width: 66px; height: 66px; border-radius: 50%; margin: 4px auto 16px; display: grid; place-items: center;
  background: var(--ok); color: #fff; font-size: 30px; box-shadow: 0 0 0 6px var(--ok-soft);
}
:root[data-theme="dark"] .done-seal { color: #06231a; }
.note { background: var(--sunken); border-inline-start: 3px solid var(--accent); padding: 12px 15px; border-radius: 9px; font-size: 13.5px; color: var(--ink-soft); text-align: start; line-height: 1.7; }

/* ===================================================================
   ORAL EXAM PAGE
   =================================================================== */
.stage { max-width: 760px; margin: 0 auto; padding: 0 24px 60px; position: relative; z-index: 1; }
.exercise-list { display: grid; gap: 10px; }
.exercise-item {
  text-align: start; border: 1px solid var(--rule); background: var(--panel); border-radius: var(--radius-sm);
  padding: 14px 16px; cursor: pointer; transition: .15s; color: var(--ink); box-shadow: var(--shadow);
}
.exercise-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.exercise-item.active { border-color: var(--accent); box-shadow: var(--shadow-lift), inset 0 0 0 1px var(--accent); }
.exercise-item .tag { font-family: var(--mono); display: inline-block; font-size: 11px; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 6px; margin-bottom: 7px; }
.exercise-item .q { font-size: 14px; line-height: 1.6; }
.exercise-item .q b { font-weight: 700; }

.seg { display: flex; border: 1px solid var(--rule-strong); border-radius: 11px; overflow: hidden; }
.seg button { flex: 1; border: 0; background: var(--panel); color: var(--muted); padding: 11px; font: inherit; cursor: pointer; transition: .15s; }
.seg button.active { background: var(--accent); color: #fff; font-weight: 600; }
:root[data-theme="dark"] .seg button.active { color: #22124d; }

.consent { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0; font-size: 13px; color: var(--muted); line-height: 1.7; }
.consent input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); }
.error { color: var(--bad); font-size: 14px; margin-top: 10px; }

.exam-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.persona { font-family: var(--mono); background: var(--ink); color: var(--paper); padding: 5px 12px; border-radius: 999px; font-size: 12px; }
.turn-counter { color: var(--muted); font-size: 12px; margin-inline-start: 10px; font-family: var(--mono); }

.conversation { display: flex; flex-direction: column; gap: 12px; min-height: 200px; margin-bottom: 16px; }
.bubble { max-width: 88%; padding: 12px 15px; border-radius: 14px; line-height: 1.7; font-size: 15px; animation: rise .22s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.bubble.examiner { align-self: flex-start; background: var(--sunken); border: 1px solid var(--rule); border-start-start-radius: 4px; }
.bubble.student { align-self: flex-end; background: var(--accent-soft); border: 1px solid transparent; border-start-end-radius: 4px; }
.bubble.student.interim { opacity: .55; font-style: italic; }
.bubble .who { display: block; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }

.mic-zone { display: flex; flex-direction: column; align-items: center; gap: 12px; border-top: 1px solid var(--rule); padding-top: 18px; }
.status { color: var(--muted); font-size: 14px; min-height: 20px; text-align: center; }
.status.listening { color: var(--accent); font-weight: 600; }
.status.speaking { color: var(--ink); font-weight: 600; }
.mic { width: 72px; height: 72px; border-radius: 50%; border: 0; cursor: pointer; font-size: 28px; background: var(--accent); color: #fff; transition: .15s; box-shadow: 0 10px 26px -10px var(--accent); }
.mic:hover { transform: scale(1.05); }
.mic.recording { background: var(--bad); animation: pulse 1.3s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(179,38,30,.5); } 50% { box-shadow: 0 0 0 15px rgba(179,38,30,0); } }
.text-input { display: flex; gap: 10px; width: 100%; }
.text-input textarea { flex: 1; resize: vertical; border: 1px solid var(--rule-strong); border-radius: 10px; padding: 11px; font: inherit; background: var(--sunken); }
.text-input .btn { width: auto; }

/* report */
.verdict { border-radius: 12px; padding: 16px; font-weight: 700; font-size: 16px; text-align: center; margin-bottom: 14px; border: 1px solid; }
.verdict.pass { background: var(--ok-soft); color: var(--ok-ink); border-color: var(--ok); }
.verdict.incomplete { background: var(--sunken); color: var(--ink-soft); border-color: var(--rule-strong); }
.verdict.remediate { background: var(--flag-soft); color: var(--flag); border-color: var(--flag); }
.report-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; margin: 16px 0; }
@media (max-width: 560px) { .report-grid { grid-template-columns: 1fr; } }
.score-card { text-align: center; background: var(--sunken); border: 1px solid var(--rule); border-radius: 12px; padding: 20px; }
.score-card .ring { width: 120px; height: 120px; margin: 0 auto 10px; }
.score-card .ring span { width: 92px; height: 92px; font-size: 24px; background: var(--sunken); }
.score-label { font-weight: 600; }
.integrity-card { background: var(--sunken); border: 1px solid var(--rule); border-radius: 12px; padding: 18px; }
.integrity-head { font-weight: 700; margin-bottom: 10px; }
.integrity-head.clear { color: var(--ok-ink); }
.integrity-head.flagged { color: var(--flag); }
.reasons { margin: 0; padding-inline-start: 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.lat { color: var(--muted); font-size: 12px; margin-top: 8px; }
.idea-map { display: flex; flex-direction: column; gap: 12px; }
.idea-row .idea-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 5px; }
.idea-row .idea-top span:last-child { font-family: var(--mono); color: var(--muted); }
.bar { height: 8px; border-radius: 5px; background: var(--rule); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 5px; transition: width .5s ease; }
.bar-fill.ok { background: var(--ok); }
.bar-fill.weak { background: var(--flag); }
.bar-fill.uncovered { background: var(--muted); }
.remediation { margin-top: 8px; }
.rem-item { background: var(--flag-soft); border: 1px solid var(--flag); border-radius: 11px; padding: 12px 14px; margin-bottom: 10px; }
.rem-item b { display: block; color: var(--flag); margin-bottom: 4px; font-size: 14px; }
.rem-item span { font-size: 13px; line-height: 1.7; }
.transcript { margin: 16px 0; }
.transcript summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.t-turn { border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; margin: 8px 0; font-size: 13px; }
.t-turn .t-probe { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.t-turn .t-meta { color: var(--muted); font-size: 12px; margin-top: 5px; font-family: var(--mono); }

/* ===================================================================
   MOTION — tasteful, brand-purple, disabled under prefers-reduced-motion
   =================================================================== */
@keyframes riseIn { from { opacity: 0; transform: translateY(10px); } }
.card, .rail-card { animation: riseIn .45s cubic-bezier(.2, .7, .3, 1) backwards; }
.solve-grid > .card:nth-child(2) { animation-delay: .07s; }
.rail > .rail-card:nth-child(2) { animation-delay: .12s; }
.rail > .rail-card:nth-child(3) { animation-delay: .18s; }

/* smooth conic progress ring (Chromium supports @property; fallback = instant) */
@property --pct { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
.ring { transition: --pct .9s ease; }

@keyframes popIn { from { opacity: 0; transform: scale(.96); } }
.verdict { animation: popIn .3s ease backwards; }

/* the call stage: advisor avatar that visibly speaks / listens + call timer */
.call-stage { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 4px 0 14px; }
.call-avatar {
  position: relative; width: 86px; height: 86px; border-radius: 50%;
  display: grid; place-items: center; font-size: 38px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-ink));
  box-shadow: 0 14px 30px -14px var(--accent);
}
.call-avatar::before, .call-avatar::after {
  content: ""; position: absolute; inset: -7px; border-radius: 50%;
  border: 2px solid var(--accent); opacity: 0;
}
.call-avatar.speaking::before { animation: ripple 1.6s ease-out infinite; }
.call-avatar.speaking::after { animation: ripple 1.6s ease-out .55s infinite; }
.call-avatar.listening { box-shadow: 0 0 0 5px var(--accent-soft); }
@keyframes ripple { 0% { opacity: .65; transform: scale(1); } 100% { opacity: 0; transform: scale(1.4); } }
.call-timer { font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* live mic level — visible proof the student's voice is being captured */
.mic-meter { display: flex; align-items: center; gap: 8px; width: 200px; }
.mic-ico { font-size: 14px; }
.meter-track { flex: 1; height: 6px; border-radius: 4px; background: var(--rule); overflow: hidden; }
.meter-fill {
  height: 100%; width: 0%; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-ink));
  transition: width .12s linear;
}

/* grounded summary chip (collapsed objective picker after practice) */
.grounded-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--accent-soft); border: 1px solid var(--accent);
  border-radius: 10px; padding: 10px 13px; font-size: 13.5px; color: var(--accent-ink);
}

/* next-step CTA in the report */
.report-cta { display: flex; gap: 10px; margin: 8px 0 12px; }
.report-cta .btn { display: block; text-align: center; text-decoration: none; }

/* keyboard accessibility — visible focus on every interactive control */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
