/* Recall First — cobalt night. Smoked-glass panels lit by one brand blue.
   Semantics keep one meaning everywhere: green = right, amber = partly / the gap, red = wrong.
   Visual language shared with Tally (same mascot, same cobalt), adapted to studying. */
:root {
  --ink: #03060F;
  --night: #060B1A;
  --surface: #0B1430;
  --surface-hi: #13214A;
  --glass: rgba(4, 10, 28, 0.56);
  --glass-strong: rgba(3, 7, 26, 0.78);
  --glass-hi: rgba(238, 244, 255, 0.06);
  --stroke: rgba(194, 220, 255, 0.22);
  --stroke-soft: rgba(194, 220, 255, 0.08);
  --text: #EEF4FF;
  --muted: #B3C2DE;
  --faint: #7F90B5;
  --brand: #1F6BFF;
  --brand-bright: #5C9DFF;
  --brand-core: #BFDBFF;
  --brand-deep: #0A3DB8;
  --on-brand: #00102E;
  --right: #3DBD8C;
  --right-deep: #1E8A60;
  --partly: #FFB547;
  --partly-deep: #C7841C;
  --wrong: #FF6B6B;
  --wrong-deep: #C93D3D;
  --mark: #FFB547;              /* the gap between felt and knew */
  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Inter Tight", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --col: 680px;
  --gutter: 20px;
  --r-sm: 12px; --r-md: 20px; --r-lg: 28px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  /* legacy aliases used by older rules and the app map */
  --paper: var(--night); --card: var(--glass); --rule: var(--stroke); --serif: var(--display);
}
* { box-sizing: border-box; }
html { color: var(--text); font: 400 17px/1.55 var(--sans); -webkit-text-size-adjust: 100%;
  background: var(--ink); color-scheme: dark; }
body { margin: 0; min-height: 100dvh;
  background:
    radial-gradient(1100px 620px at 50% -180px, rgba(31, 107, 255, .55), transparent 70%),
    radial-gradient(700px 500px at 100% 0, rgba(92, 157, 255, .18), transparent 70%),
    linear-gradient(180deg, var(--night), var(--ink) 70%);
  background-attachment: fixed; }
::selection { background: rgba(92, 157, 255, .4); }
:focus-visible { outline: 2px solid var(--brand-bright); outline-offset: 3px; border-radius: 8px; }
button, textarea, input { font: inherit; color: inherit; }
a { color: var(--brand-core); }
em { font-style: italic; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- glass ---------- */
.glass, .correct, .study-item, .notes-view, .card, .hints, .notice, .stat, .trend, .spot-list button, textarea {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(194, 220, 255, .14);
}

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20;
  padding: 14px max(var(--gutter), calc((100% - var(--col)) / 2 + var(--gutter))) 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(180deg, rgba(3, 6, 15, .85), rgba(3, 6, 15, 0)); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none;
  font: 600 18px/1 var(--display); letter-spacing: -0.01em; }
.brand .avatar { width: 34px; height: 34px; border-radius: 11px; object-fit: cover; object-position: 50% 12%;
  background: var(--brand); box-shadow: 0 0 0 1px var(--stroke), 0 6px 18px rgba(31, 107, 255, .45); }
.brand .mark { color: var(--brand-bright); }
.hud { display: flex; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--stroke); font: 600 14px/1 var(--sans); color: var(--text);
  font-variant-numeric: tabular-nums; }
.pill svg { width: 16px; height: 16px; }
.pill.streak svg { color: var(--partly); }
.pill.xp svg { color: var(--brand-bright); }
.pill.bump { animation: bump .5s var(--spring); }
@keyframes bump { 40% { transform: scale(1.18); } }
.icon-btn { appearance: none; border: 1px solid var(--stroke); background: var(--glass); width: 34px; height: 34px;
  border-radius: 999px; display: grid; place-items: center; cursor: pointer; color: var(--muted); padding: 0; }
.icon-btn:hover { color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }
.progress-label { display: none; }
.progress { margin: 4px max(var(--gutter), calc((100% - var(--col)) / 2 + var(--gutter))) 0; height: 14px; border-radius: 999px;
  background: rgba(194, 220, 255, .1); border: 1px solid var(--stroke-soft); overflow: hidden; position: sticky; top: 60px; z-index: 19; }
.progress-fill { height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(180deg, var(--brand-core) 0 22%, var(--brand-bright) 23%, var(--brand) 100%);
  box-shadow: 0 0 18px rgba(92, 157, 255, .6); transition: width .5s var(--spring); }

/* ---------- screens ---------- */
main { max-width: var(--col); margin: 0 auto; padding: 0 var(--gutter) 140px; }
.screen { padding-top: 34px; animation: rise .32s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.screen > * { animation: rise .45s var(--ease) both; }
.screen > *:nth-child(2) { animation-delay: .04s; } .screen > *:nth-child(3) { animation-delay: .08s; }
.screen > *:nth-child(4) { animation-delay: .12s; } .screen > *:nth-child(5) { animation-delay: .16s; }
.screen > *:nth-child(n+6) { animation-delay: .2s; }

/* ---------- type ---------- */
.headline { font: 300 clamp(32px, 6vw, 46px)/1.08 var(--display); letter-spacing: -0.03em; margin: 0 0 14px;
  max-width: 18ch; text-wrap: balance; }
.lede { margin: 0 0 26px; max-width: 54ch; color: var(--muted); font-size: 17px; }
.meta { margin: 0; font-size: 14px; color: var(--faint); }
.fineprint { margin: 22px 0 0; font-size: 14px; color: var(--faint); max-width: 54ch; }
.eyebrow-line { margin: 0 0 10px; color: var(--brand-bright); font: 600 14px/1.3 var(--sans); }
.notice { margin: 14px 0 0; padding: 12px 16px; font-size: 15px; color: var(--text); border-color: rgba(92, 157, 255, .4); }
.notice.error { border-color: rgba(255, 107, 107, .55); background: rgba(255, 107, 107, .1); }

/* ---------- mascot ---------- */
.coach { display: flex; align-items: flex-end; gap: 14px; margin: 0 0 22px; }
.coach img { width: 92px; height: auto; flex: none; filter: drop-shadow(0 12px 24px rgba(31, 107, 255, .45));
  animation: idle 3.4s ease-in-out infinite; transform-origin: 50% 100%; }
.coach.big img { width: 132px; }
@keyframes idle { 50% { transform: translateY(-5px) rotate(-1.5deg); } }
.bubble { position: relative; padding: 12px 16px; border-radius: 18px 18px 18px 6px; background: var(--glass-strong);
  border: 1px solid var(--stroke); font: 500 16px/1.4 var(--sans); color: var(--text); max-width: 40ch;
  box-shadow: inset 0 1px 0 rgba(194, 220, 255, .14); margin-bottom: 18px; }
.bubble::before { content: ""; position: absolute; left: -7px; bottom: 10px; width: 12px; height: 12px; background: var(--glass-strong);
  border-left: 1px solid var(--stroke); border-bottom: 1px solid var(--stroke); transform: rotate(45deg); }
.pop { animation: pop .5s var(--spring) both; }
@keyframes pop { from { opacity: 0; transform: scale(.6) translateY(16px); } }

/* ---------- inputs ---------- */
textarea { display: block; width: 100%; min-height: 220px; resize: vertical; padding: 18px 20px; line-height: 1.6;
  color: var(--text); border-radius: var(--r-md); transition: border-color .2s, box-shadow .2s; }
textarea::placeholder { color: var(--faint); }
textarea:focus-visible { outline: none; border-color: var(--brand-bright); box-shadow: 0 0 0 4px rgba(31, 107, 255, .25), inset 0 1px 0 rgba(194, 220, 255, .14); }
.intake-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.field-label { display: block; margin: 24px 0 10px; font: 600 15px/1.3 var(--sans); color: var(--muted); }
.options { margin-top: 14px; display: grid; gap: 10px; justify-items: start; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--muted); cursor: pointer; max-width: 58ch;
  padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--stroke-soft); background: rgba(4, 10, 28, .3); }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brand); }

/* ---------- buttons: chunky, pressable ---------- */
a.btn { text-decoration: none; display: inline-block; }
.btn { appearance: none; border: 0; border-radius: 16px; padding: 14px 24px; cursor: pointer;
  font: 700 16px/1.2 var(--sans); letter-spacing: .01em; color: var(--text); background: var(--surface-hi);
  box-shadow: 0 4px 0 #070E24, inset 0 1px 0 rgba(194, 220, 255, .18);
  transition: transform .08s, box-shadow .08s, filter .15s, opacity .15s; position: relative; }
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 #070E24, inset 0 1px 0 rgba(194, 220, 255, .18); }
.btn.primary { color: #fff; background: linear-gradient(180deg, var(--brand-bright), var(--brand) 60%, #1659F0);
  box-shadow: 0 4px 0 var(--brand-deep), 0 10px 26px rgba(31, 107, 255, .45), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn.primary:active:not(:disabled) { box-shadow: 0 0 0 var(--brand-deep), 0 4px 14px rgba(31, 107, 255, .35), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn.go-right { background: linear-gradient(180deg, #5FD6A8, var(--right)); color: #03201A; box-shadow: 0 4px 0 var(--right-deep); }
.btn.go-partly { background: linear-gradient(180deg, #FFCB78, var(--partly)); color: #2A1800; box-shadow: 0 4px 0 var(--partly-deep); }
.btn.go-wrong { background: linear-gradient(180deg, #FF8C8C, var(--wrong)); color: #2B0505; box-shadow: 0 4px 0 var(--wrong-deep); }
.btn:disabled { opacity: .38; cursor: not-allowed; filter: grayscale(.4); }
.btn.quiet { background: transparent; box-shadow: none; color: var(--brand-core); padding: 12px 8px;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; font-weight: 600; }
.btn.quiet:active:not(:disabled) { transform: none; }
.btn.small { padding: 10px 16px; font-size: 15px; border-radius: 13px; }
.btn.quiet.small { padding: 8px 4px; }
.btn.wide { width: 100%; }
.btn.busy { color: transparent !important; }
.btn.busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px;
  border: 2.5px solid #fff; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
.actions { display: flex; align-items: center; gap: 16px; margin-top: 26px; flex-wrap: wrap; }
.small-actions { margin-top: 12px; gap: 10px; }

/* ---------- question ---------- */
.question { font: 400 clamp(25px, 4.6vw, 32px)/1.22 var(--display); letter-spacing: -0.02em; margin: 0 0 22px; text-wrap: pretty; }
.practice-tag { display: inline-block; margin: 0 0 12px; padding: 4px 10px; border-radius: 999px; font: 600 12px/1.4 var(--sans);
  color: var(--partly); background: rgba(255, 181, 71, .12); border: 1px solid rgba(255, 181, 71, .35); }
.answer-wrap { position: relative; }
#answer { min-height: 130px; font-size: 18px; }
.voice { margin-top: 6px; }
.confidence { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.confidence button { appearance: none; cursor: pointer; padding: 14px 6px 12px; border-radius: 16px;
  background: var(--glass); border: 2px solid var(--stroke); color: var(--text); font: 700 15px/1.2 var(--sans);
  box-shadow: 0 4px 0 #070E24; display: grid; justify-items: center; gap: 8px;
  transition: transform .08s, box-shadow .08s, border-color .15s, background .15s; }
.confidence button:active { transform: translateY(4px); box-shadow: 0 0 0 #070E24; }
.confidence .sig { display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.confidence .sig i { width: 5px; border-radius: 2px; background: rgba(194, 220, 255, .22); }
.confidence .sig i:nth-child(1) { height: 25%; } .confidence .sig i:nth-child(2) { height: 50%; }
.confidence .sig i:nth-child(3) { height: 75%; } .confidence .sig i:nth-child(4) { height: 100%; }
.confidence .sig i.on { background: var(--brand-bright); }
.confidence button[aria-pressed="true"] { border-color: var(--brand-bright); background: rgba(31, 107, 255, .22);
  box-shadow: 0 4px 0 var(--brand-deep), 0 0 24px rgba(31, 107, 255, .35); }
.confidence button[data-level="certain"][aria-pressed="true"] { border-color: var(--partly); background: rgba(255, 181, 71, .16); box-shadow: 0 4px 0 var(--partly-deep); }
.confidence button[data-level="certain"][aria-pressed="true"] .sig i.on { background: var(--partly); }
.stakes { margin: 10px 0 0; min-height: 20px; font-size: 14px; color: var(--faint); }
.stakes b { color: var(--text); font-weight: 600; }
.hints { margin: 14px 0 0; padding: 12px 16px; border-color: rgba(92, 157, 255, .4); }
.hints p { margin: 4px 0; font-size: 15px; }
.hints p span { display: inline-block; min-width: 58px; color: var(--brand-bright); font-weight: 600; }

/* ---------- feedback sheet (slides up over the question) ---------- */
#screen-feedback.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 0; animation: none; }
#screen-feedback.sheet > * { animation: none; }
.sheet-inner { max-width: var(--col); margin: 0 auto; padding: 18px var(--gutter) calc(20px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0; border: 1px solid var(--stroke); border-bottom: 0;
  background: linear-gradient(180deg, rgba(11, 20, 48, .97), rgba(3, 6, 15, .99)); box-shadow: 0 -20px 60px rgba(0, 0, 0, .55);
  animation: sheet .42s var(--spring) both; max-height: 78dvh; overflow: auto; }
.sheet-inner.right { border-top: 3px solid var(--right); }
.sheet-inner.partly { border-top: 3px solid var(--partly); }
.sheet-inner.wrong { border-top: 3px solid var(--wrong); }
@keyframes sheet { from { transform: translateY(100%); } }
.sheet-head { display: flex; align-items: center; gap: 14px; }
.sheet-head img { width: 76px; flex: none; filter: drop-shadow(0 10px 20px rgba(31, 107, 255, .4)); animation: pop .55s var(--spring) both; }
.sheet-head .verdict { margin: 0; }
.xp-delta { margin-left: auto; font: 800 20px/1 var(--sans); padding: 8px 12px; border-radius: 12px; animation: pop .6s var(--spring) .15s both; font-variant-numeric: tabular-nums; }
.xp-delta.up { color: var(--right); background: rgba(61, 189, 140, .14); }
.xp-delta.down { color: var(--wrong); background: rgba(255, 107, 107, .14); }
.xp-delta.zero { color: var(--muted); background: rgba(194, 220, 255, .08); }
.scrim { position: fixed; inset: 0; z-index: 25; background: rgba(3, 6, 15, .45); animation: fade .25s both; }
@keyframes fade { from { opacity: 0; } }
.screen.dim { filter: saturate(.6) brightness(.8); pointer-events: none; }

.verdict { font: 700 clamp(26px, 5vw, 32px)/1.1 var(--display); letter-spacing: -0.02em; margin: 0 0 10px; }
.verdict.right { color: var(--right); } .verdict.partly { color: var(--partly); } .verdict.wrong { color: var(--wrong); }
.verdict-note { display: block; font: 500 14px/1.4 var(--sans); color: var(--muted); margin-top: 4px; }
.feedback-text { margin: 12px 0 14px; max-width: 60ch; color: var(--text); }
.correct { margin: 0 0 14px; padding: 14px 18px; }
.correct-label { display: block; font: 600 13px/1.3 var(--sans); color: var(--brand-bright); margin-bottom: 4px; }
.correct p { margin: 0; font-size: 17px; line-height: 1.5; }
q { quotes: "“" "”"; font-style: italic; }
.sheet-inner .actions { margin-top: 16px; }

/* ---------- results ---------- */
.results-top { display: flex; align-items: flex-end; gap: 18px; }
.results-top img { width: 110px; flex: none; filter: drop-shadow(0 14px 28px rgba(31, 107, 255, .5)); animation: pop .6s var(--spring) both; }
.score { margin: 0 0 6px; line-height: 1; }
.score-num { font: 300 clamp(76px, 14vw, 104px)/1 var(--display); letter-spacing: -0.05em; }
.score-of { font: 400 22px/1 var(--sans); color: var(--muted); }
.score-before { display: block; font: 500 15px/1.4 var(--sans); color: var(--right); margin-top: 8px; }
.results-headline { font-size: clamp(26px, 4.8vw, 36px); max-width: 24ch; margin: 14px 0 26px; }
.xp-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 30px; }
.xp-row .pill { padding: 9px 14px; font-size: 15px; }
.scale { margin: 0 0 8px; padding: 36px 18px 30px; border-radius: var(--r-lg); background: var(--glass); border: 1px solid var(--stroke);
  box-shadow: inset 0 1px 0 rgba(194, 220, 255, .14); }
.track { position: relative; height: 8px; background: rgba(194, 220, 255, .14); border-radius: 999px; }
.gap { position: absolute; top: -7px; height: 22px; border-radius: 999px; background: linear-gradient(90deg, rgba(255, 181, 71, .55), var(--mark));
  box-shadow: 0 0 22px rgba(255, 181, 71, .45); }
.marker { position: absolute; top: 50%; translate: -50% -50%; width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand-bright); border: 3px solid var(--night); box-shadow: 0 0 0 2px var(--brand-bright); }
.marker span { position: absolute; left: 50%; translate: -50% 0; white-space: nowrap; font: 600 14px/1 var(--sans); color: var(--text); }
.marker.felt span { bottom: 26px; }
.marker.knew span { top: 26px; }
.marker.knew { background: var(--night); }
.scale-ends { display: flex; justify-content: space-between; margin-top: 30px; font-size: 12px; color: var(--faint); }
.scale-note { margin: 8px 0 34px; }
.section-title { font: 500 23px/1.25 var(--display); letter-spacing: -0.01em; margin: 40px 0 8px; }
.empty { color: var(--muted); margin: 8px 0 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 0; }
.stat { padding: 16px 18px; }
.stat-num { display: block; font: 300 34px/1.05 var(--display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-label { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }
.stat .meta { margin-top: 8px; }
.spots { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.spot { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--glass); border: 1px solid var(--stroke-soft); font-weight: 500; }
.spot .meta { margin-left: auto; }
.spot-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--faint); flex: none; }
.spot.right .spot-dot { background: var(--right); border-color: var(--right); }
.spot.missed .spot-dot { background: var(--wrong); border-color: var(--wrong); }
.spot.sure-wrong { border-color: rgba(255, 181, 71, .45); }
.spot.sure-wrong .spot-dot { background: var(--mark); border-color: var(--mark); box-shadow: 0 0 10px var(--mark); }
.spot.untested { color: var(--faint); }
.study { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.study-item { padding: 18px 20px; border-color: rgba(255, 181, 71, .35); }
.badge { display: inline-block; padding: 4px 10px; background: rgba(255, 181, 71, .16); color: var(--partly);
  border: 1px solid rgba(255, 181, 71, .4); font: 700 12px/1.3 var(--sans); border-radius: 999px; margin-bottom: 10px; }
.badge.trap { color: var(--wrong); background: rgba(255, 107, 107, .12); border-color: rgba(255, 107, 107, .45); margin-left: 6px; }
.study-q { margin: 0 0 10px; font: 500 18px/1.4 var(--display); }
.study-line { margin: 6px 0 0; font-size: 15px; color: var(--muted); }
.study-line span { display: inline-block; min-width: 84px; color: var(--faint); font-weight: 600; }
.fix-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 16px 0 6px; }
.teach { margin-top: 12px; border-top: 1px solid var(--stroke-soft); padding-top: 10px; }
.teach summary { cursor: pointer; font-size: 14px; color: var(--brand-core); font-weight: 600; }
.teach textarea { min-height: 64px; margin-top: 10px; font-size: 15px; }
.all { margin-top: 36px; border-top: 1px solid var(--stroke-soft); padding-top: 18px; }
.all summary { cursor: pointer; font-weight: 600; }
.all-list { margin: 14px 0 0; padding-left: 22px; display: grid; gap: 12px; }
.all-list p { margin: 2px 0 0; font-size: 15px; color: var(--muted); }
.v { font-weight: 700; }
.v.right { color: var(--right); } .v.partly { color: var(--partly); } .v.wrong { color: var(--wrong); }
#screen-results > .actions { margin-top: 40px; }
.card { font: 14px/1.6 var(--mono); padding: 14px 16px; white-space: pre-wrap; margin: 10px 0 0; color: var(--text); }

/* ---------- start extras ---------- */
.trend { margin-top: 30px; padding: 16px 18px; }
.bars { display: flex; gap: 8px; align-items: flex-end; height: 64px; margin: 12px 0 8px; }
.bar { position: relative; width: 22px; height: 100%; border-bottom: 1px solid var(--stroke); }
.bar i { position: absolute; bottom: 0; width: 9px; border-radius: 3px 3px 0 0; }
.bar .felt { left: 1px; background: var(--brand-bright); }
.bar .knew { right: 1px; background: var(--mark); }

/* ---------- read & spot ---------- */
.notes-view { padding: 22px 24px; font-size: 17px; line-height: 1.75; max-height: 60vh; overflow: auto; }
.notes-view hr { border: 0; border-top: 1px solid var(--stroke); margin: 18px 0; }
.spot-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: s; }
.spot-list li { counter-increment: s; }
.spot-list button { width: 100%; text-align: left; padding: 16px 18px 16px 56px; position: relative; cursor: pointer;
  font: 400 17px/1.5 var(--sans); color: var(--text); box-shadow: 0 4px 0 #070E24; transition: transform .08s, box-shadow .08s, border-color .15s; }
.spot-list button::before { content: counter(s); position: absolute; left: 16px; top: 14px; width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; background: var(--surface-hi); color: var(--brand-core); font: 700 14px/1 var(--sans); }
.spot-list button:hover:not(:disabled) { border-color: var(--brand-bright); }
.spot-list button:active:not(:disabled) { transform: translateY(4px); box-shadow: none; }
.spot-list button:disabled { cursor: default; }
.spot-list button.is-wrong-sentence { border-color: var(--mark); background: rgba(255, 181, 71, .14); }
.spot-list button.is-picked { border-color: var(--wrong); }
#spot-result { margin-top: 24px; }

/* ---------- confetti ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate3d(var(--dx), 110vh, 0) rotate(var(--rot)); opacity: .9; } }

@media (max-width: 520px) {
  .confidence { grid-template-columns: 1fr 1fr; }
  .coach img { width: 76px; } .coach.big img { width: 100px; }
  .results-top img { width: 84px; }
  .hud .pill.xp span.lbl { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- sources (upload) ---------- */
.drop { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 26px 20px; cursor: pointer;
  border: 2px dashed rgba(92, 157, 255, .45); border-radius: var(--r-md); background: rgba(31, 107, 255, .07); color: var(--brand-core);
  transition: background .15s, border-color .15s, transform .15s; }
.drop:hover, .drop.over { background: rgba(31, 107, 255, .16); border-color: var(--brand-bright); }
.drop.over { transform: scale(1.01); }
.drop p { margin: 0; color: var(--text); }
.drop .meta { color: var(--faint); }
.link-btn { appearance: none; border: 0; background: none; padding: 0; color: var(--brand-bright); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.sources { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.source { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--glass); border: 1px solid var(--stroke);
  animation: pop .4s var(--spring) both; }
.source.off { opacity: .55; }
.source.bad { border-color: rgba(255, 107, 107, .5); }
.src-kind { flex: none; width: 46px; height: 34px; display: grid; place-items: center; border-radius: 10px; font: 800 12px/1 var(--sans);
  color: #fff; background: linear-gradient(180deg, var(--brand-bright), var(--brand)); box-shadow: 0 3px 0 var(--brand-deep); }
.source.bad .src-kind { background: var(--wrong); box-shadow: 0 3px 0 var(--wrong-deep); }
.src-main { display: grid; min-width: 0; flex: 1; }
.src-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-meta { font-size: 13px; color: var(--faint); }
.switch { position: relative; width: 42px; height: 24px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: rgba(194, 220, 255, .18); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s var(--spring); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand-bright); outline-offset: 2px; }
#notes { min-height: 150px; }

/* ---------- voice ---------- */
.icon-btn.off { opacity: .5; }
.bubble { padding-right: 52px; }
.replay { position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--stroke);
  background: rgba(31, 107, 255, .18); color: var(--brand-core); display: grid; place-items: center; cursor: pointer; }
.replay svg { width: 18px; height: 18px; }
.replay:hover { background: rgba(31, 107, 255, .32); }
.speaking { box-shadow: 0 0 0 2px rgba(92, 157, 255, .55), 0 0 30px rgba(31, 107, 255, .35); }
.speaking .replay { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.12); background: rgba(31, 107, 255, .45); } }
.mic { appearance: none; display: inline-flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 14px 8px 8px; cursor: pointer;
  border-radius: 999px; border: 1px solid var(--stroke); background: var(--glass); color: var(--text); font: 600 15px/1 var(--sans); position: relative; }
.mic-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: linear-gradient(180deg, var(--brand-bright), var(--brand)); box-shadow: 0 3px 0 var(--brand-deep); }
.mic-dot svg { width: 18px; height: 18px; }
.mic-meter { position: absolute; left: 8px; top: 8px; width: 34px; height: 34px; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 calc(var(--lvl, 0) * 12px) rgba(255, 107, 107, .35); transition: box-shadow .08s; }
.mic.rec { border-color: rgba(255, 107, 107, .6); }
.mic.rec .mic-dot { background: linear-gradient(180deg, #FF8C8C, var(--wrong)); box-shadow: 0 3px 0 var(--wrong-deep); animation: pulse 1.2s ease-in-out infinite; }
.mic.busy .mic-dot { opacity: .6; }
.mic-label:empty { display: none; }
.ask .mic { margin: 0; padding: 4px; }

/* ---------- difficulty ---------- */
.level { border: 0; padding: 0; margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.level legend { float: left; margin-right: 6px; font: 600 15px/2 var(--sans); color: var(--muted); }
.level label { cursor: pointer; }
.level input { position: absolute; opacity: 0; }
.level span { display: inline-block; padding: 9px 16px; border-radius: 12px; border: 2px solid var(--stroke); background: var(--glass); font: 700 14px/1 var(--sans); box-shadow: 0 3px 0 #070E24; }
.level input:checked + span { border-color: var(--brand-bright); background: rgba(31, 107, 255, .22); box-shadow: 0 3px 0 var(--brand-deep); }
.level input:focus-visible + span { outline: 2px solid var(--brand-bright); outline-offset: 2px; }

/* ---------- why ---------- */
.why { margin: 4px 0 0; }
.why-text { margin: 0 0 10px; }
.why-hook { margin: 0; padding: 10px 14px; border-radius: 12px; background: rgba(255, 181, 71, .12); border: 1px solid rgba(255, 181, 71, .35); }
.why-hook span { display: block; font: 700 12px/1.4 var(--sans); color: var(--partly); }

/* ---------- calibration strip + coach ---------- */
.calib { margin: 26px 0 0; padding: 18px 20px; border-radius: var(--r-lg); background: var(--glass); border: 1px solid var(--stroke); }
.calib-head { display: flex; align-items: baseline; gap: 12px; }
.rel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0 8px; }
.rel-col { display: grid; justify-items: center; gap: 6px; text-align: center; }
.rel-col span { font: 600 13px/1.2 var(--sans); }
.rel-col em { font-style: normal; font-size: 12px; color: var(--faint); }
.rel-col.empty { opacity: .45; }
.rel-bar { position: relative; width: 38px; height: 90px; border-radius: 10px; background: rgba(194, 220, 255, .08); overflow: visible; }
.rel-bar i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 10px; background: linear-gradient(180deg, var(--brand-bright), var(--brand)); }
.rel-bar b { position: absolute; left: -6px; right: -6px; height: 3px; border-radius: 2px; background: var(--mark); box-shadow: 0 0 8px var(--mark); }
.calib-coach { margin: 10px 0 0; font-weight: 500; }
.coach-card { display: flex; gap: 14px; align-items: flex-start; margin: 16px 0 26px; padding: 16px 18px; border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(31, 107, 255, .16), rgba(4, 10, 28, .6)); border: 1px solid rgba(92, 157, 255, .4); }
.coach-card img { width: 70px; flex: none; }
.coach-msg { margin: 0 0 8px; font-size: 17px; }
.coach-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); }

/* ---------- ask your notes ---------- */
.ask { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.ask input { flex: 1; min-width: 0; padding: 13px 16px; border-radius: 14px; border: 1px solid var(--stroke); background: var(--glass); color: var(--text); }
.ask input:focus-visible { outline: none; border-color: var(--brand-bright); box-shadow: 0 0 0 4px rgba(31, 107, 255, .25); }
.ask-out { display: grid; gap: 10px; margin-top: 12px; }
.ask-item { padding: 14px 16px; border-radius: 16px; background: var(--glass); border: 1px solid var(--stroke); animation: pop .4s var(--spring) both; }
.ask-item.nf { border-color: rgba(255, 181, 71, .4); }
.ask-item p { margin: 0 0 6px; }
.ask-q { font-weight: 700; color: var(--brand-core); }
.ask-item blockquote { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid var(--mark); color: var(--muted); font-style: italic; }
@media (max-width: 520px) { .rel-bar { width: 30px; } .coach-card img { width: 52px; } }
.sample-btn { margin-top: 12px; }
