/* =====================================================================
   SAT Workbench — Math Lab. One stylesheet, no framework.
   1 tokens · 2 base · 3 layout chrome · 4 controls · 5 cards
   6 question card · 7 maths · 8 stats · 9 overlays · 10 responsive
   ===================================================================== */

/* ---------------------------------------------------------------- 1 tokens */
:root {
  --ink: #14213b;
  --ink-2: #46536f;
  --muted: #71809a;
  --line: #e7ebf3;
  --line-2: #d7deeb;
  --canvas: #f4f6fb;
  --card: #ffffff;
  --card-2: #fafbfe;
  --navy: #101b35;
  --navy-2: #17233f;
  --navy-line: #26334f;
  --navy-txt: #aeb9d4;

  --blue: #536bed;
  --blue-dark: #3e53d5;
  --blue-soft: #eef1fe;
  --violet: #8667e8;
  --violet-soft: #f2eefe;
  --mint: #40bda5;
  --mint-soft: #e9f8f4;
  --gold: #e5aa45;
  --gold-soft: #fdf4e6;
  --danger: #df6f72;
  --danger-soft: #fdefef;

  --shadow: 0 1px 2px rgba(23, 36, 66, 0.05), 0 14px 32px rgba(33, 47, 81, 0.09);
  --shadow-sm: 0 1px 2px rgba(23, 36, 66, 0.05), 0 3px 10px rgba(33, 47, 81, 0.05);
  --shadow-lg: 0 2px 6px rgba(23, 36, 66, 0.07), 0 30px 62px rgba(23, 36, 66, 0.2);
  --sheen: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  --grid: rgba(20, 33, 59, 0.055);
  --hairline: rgba(20, 33, 59, 0.08);
  --r: 16px;
  --r-lg: 22px;
  --r-sm: 11px;
  --dur: 180ms;
  --ease: cubic-bezier(0.3, 0.7, 0.3, 1);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --math: "Iowan Old Style", Georgia, "Times New Roman", serif;
  --side: 258px;
}

[data-theme="dark"] {
  --ink: #e8ecf8;
  --ink-2: #b6c1d8;
  --muted: #8b98b4;
  --line: #26314c;
  --line-2: #303d5c;
  --canvas: #0a1122;
  --card: #121c31;
  --card-2: #16223a;
  --navy: #0b1424;
  --navy-2: #16223a;
  --navy-line: #24334f;
  --navy-txt: #9fadc9;

  --blue: #7f95ff;
  --blue-dark: #a9b9ff;
  --blue-soft: #1b2547;
  --violet: #a68dff;
  --violet-soft: #241d43;
  --mint: #5fd6bc;
  --mint-soft: #12312b;
  --gold: #f0bc63;
  --gold-soft: #34280f;
  --danger: #f2908f;
  --danger-soft: #3a1e21;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 40px rgba(0, 0, 0, 0.42);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 3px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.55);
  --sheen: inset 0 1px 0 rgba(255, 255, 255, 0.055);
  --grid: rgba(174, 190, 233, 0.05);
  --hairline: rgba(255, 255, 255, 0.07);
}

/* ------------------------------------------------------------------ 2 base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--canvas);
  background-image:
    radial-gradient(1100px 540px at 6% -14%, rgba(83, 107, 237, 0.14), transparent 62%),
    radial-gradient(760px 460px at 97% -8%, rgba(134, 103, 232, 0.11), transparent 60%),
    radial-gradient(700px 440px at 80% 106%, rgba(64, 189, 165, 0.09), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  transition: background var(--dur), color var(--dur);
}
h1, h2, h3, p, figure { margin: 0; }
h1 { font-size: clamp(1.66rem, 1.14rem + 2vw, 2.44rem); line-height: 1.11; letter-spacing: -0.95px; font-weight: 800; text-wrap: balance; }
h2 { font-size: clamp(1.12rem, 0.96rem + 0.7vw, 1.46rem); line-height: 1.22; letter-spacing: -0.55px; font-weight: 800; text-wrap: balance; }
h3 { font-size: 1.02rem; letter-spacing: -0.3px; font-weight: 700; }
button { font: inherit; color: inherit; }
button:not(:disabled) { cursor: pointer; }
a { color: var(--blue-dark); text-decoration: none; }
small { font-size: 0.84em; }
:focus-visible { outline: 3px solid rgba(83, 107, 237, 0.42); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(83, 107, 237, 0.22); }

.view { display: grid; gap: 19px; align-content: start; }
.view-anim { animation: fade 220ms var(--ease) both; }
/* a fresh view arrives panel by panel; re-rendering the same view (picking an
   answer, checking) must not replay the entrance or the whole card flickers */
#view:not([data-rerender]) .view-anim > * { animation: rise 340ms var(--ease) both; }
#view:not([data-rerender]) .view-anim > *:nth-child(2) { animation-delay: 45ms; }
#view:not([data-rerender]) .view-anim > *:nth-child(3) { animation-delay: 90ms; }
#view:not([data-rerender]) .view-anim > *:nth-child(4) { animation-delay: 130ms; }
#view:not([data-rerender]) .view-anim > *:nth-child(n + 5) { animation-delay: 165ms; }
#view[data-rerender] .view-anim, #view[data-rerender] .question-card { animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { 0% { transform: scale(0.94); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }

.grid { display: grid; gap: 18px; }
.setup-view { gap: 16px; }
.g-side { grid-template-columns: minmax(0, 1.55fr) minmax(272px, 1fr); align-items: start; }
.stack { display: grid; gap: 18px; align-content: start; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.dim { color: var(--ink-2); }
.mute { color: var(--muted); font-size: 0.86rem; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed; top: 8px; left: -300px; z-index: 99; padding: 9px 14px;
  background: var(--card); color: var(--ink); border-radius: 10px; box-shadow: var(--shadow);
  transition: left var(--dur); font-weight: 700;
}
.skip-link:focus { left: 8px; }

.eyebrow, .card-kicker, .overline {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; color: var(--muted);
}
.sub { color: var(--ink-2); max-width: 66ch; }
.topline { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; justify-content: space-between; }
.topline-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.twinkle { color: var(--gold); font-size: 0.6em; vertical-align: 0.6em; }

/* ------------------------------------------------------------ 3 chrome */
.app { display: flex; min-height: 100vh; }
.main {
  flex: 1; min-width: 0; width: 100%; max-width: 1240px; margin: 0 auto; padding: 32px clamp(16px, 3vw, 38px) 68px;
  background-image: radial-gradient(circle at 1px 1px, var(--grid) 1px, transparent 0); background-size: 23px 23px;
}

.sidebar {
  position: sticky; top: 0; align-self: flex-start; height: 100vh; flex: 0 0 var(--side); width: var(--side);
  display: flex; flex-direction: column; gap: 4px; padding: 26px 15px 16px; overflow-y: auto; isolation: isolate;
  background: linear-gradient(170deg, var(--navy), var(--navy-2) 78%); color: #e9edff;
  box-shadow: inset -1px 0 0 var(--hairline);
}
.sidebar::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(130% 42% at 18% -4%, rgba(83, 107, 237, 0.4), transparent 58%);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: #fff; font-weight: 800; font-size: 1.22rem; letter-spacing: -0.6px; }
.brand-text { display: grid; line-height: 1.1; }
.brand-text small { color: #7f8db1; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border-radius: 9px;
  background: linear-gradient(150deg, #e2e7ff, #9fb0ff); color: var(--navy); font-family: var(--math); font-size: 21px; line-height: 1;
  box-shadow: 0 8px 18px rgba(6, 12, 28, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.sidebar-label { margin: 34px 11px 8px; color: #7f8db1; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.primary-nav { display: grid; gap: 3px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--navy-txt); font-size: 0.9rem; font-weight: 700; text-align: left;
  transition: background var(--dur), color var(--dur), transform var(--dur);
}
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.07); transform: translateX(2px); }
.nav-link.active, .nav-link[aria-current="page"] {
  color: #fff; background: linear-gradient(120deg, var(--blue), #6f83f4);
  box-shadow: 0 8px 22px rgba(18, 30, 62, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}
.nav-link .icon { opacity: 0.9; }
.nav-count {
  margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--danger); color: #fff;
  font-size: 0.68rem; font-weight: 800; line-height: 19px; text-align: center; font-variant-numeric: tabular-nums;
}
.nav-close { display: none; }

.sidebar-bottom { margin-top: auto; display: grid; gap: 11px; padding-top: 16px; }
.support-card { padding: 14px; border-radius: 13px; background: #1a294b; border: 1px solid rgba(174, 190, 233, 0.11); }
[data-theme="dark"] .support-card { background: #16223a; }
.support-icon { display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 8px; border-radius: 8px; color: #a7b5ff; background: #293b68; }
.support-card strong { font-size: 0.78rem; }
.support-card p { margin: 3px 0 9px; color: #a7b3d1; font-size: 0.72rem; font-variant-numeric: tabular-nums; }
.mini-progress { height: 5px; border-radius: 99px; overflow: hidden; background: #2a3a5b; }
.mini-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #bfc8ff, #8ee7d3); transition: width 400ms var(--ease); }

.resume {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px dashed rgba(174, 190, 233, 0.34);
  border-radius: 11px; background: rgba(83, 107, 237, 0.16); color: #dfe5ff; font-size: 0.76rem; font-weight: 700; text-align: left;
}
.resume b { margin-left: auto; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.resume:hover { border-style: solid; background: rgba(83, 107, 237, 0.3); }

.row-tools { display: flex; gap: 7px; }
.tool {
  flex: 1; min-width: 34px; height: 32px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--navy-line);
  background: rgba(255, 255, 255, 0.04); color: #c4cdec; font-size: 0.76rem; font-weight: 700; transition: all var(--dur);
}
.tool:hover { color: #fff; border-color: #4c5f8c; background: rgba(255, 255, 255, 0.1); }
.student-chip {
  display: flex; align-items: center; gap: 9px; padding: 10px 8px 2px; border: 0; border-top: 1px solid rgba(230, 236, 255, 0.11);
  border-radius: 0 0 9px 9px; background: transparent; text-align: left; transition: background var(--dur);
}
.student-chip:hover { background: rgba(255, 255, 255, 0.05); }
.student-chip .who { display: grid; min-width: 0; }
.student-chip strong { color: #eff2ff; font-size: 0.74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-chip small { color: #7f8db1; font-size: 0.66rem; }
.student-chip .chev { margin-left: auto; color: #74839f; }
.avatar {
  display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border-radius: 9px;
  background: linear-gradient(140deg, #f2c0a4, #e5aa45); color: #17213e; font-size: 0.62rem; font-weight: 800;
}
.sidebar-note { padding: 0 8px 6px; color: #6f7d9d; font-size: 0.66rem; line-height: 1.5; }
.sidebar-note b { color: #a7b5ff; font-variant-numeric: tabular-nums; }

.mobile-header {
  display: none; position: sticky; top: 0; z-index: 45; align-items: center; gap: 10px; padding: 9px 14px;
  background: var(--navy); color: #fff; box-shadow: var(--shadow-sm);
}
.mobile-title { font-size: 1.05rem; letter-spacing: -0.4px; }
.mobile-header .btn { margin-left: auto; }
.nav-backdrop {
  position: fixed; inset: 0; z-index: 44; background: rgba(10, 17, 34, 0.5); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity var(--dur);
}
body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }

/* -------------------------------------------------------------- 4 controls */
.btn {
  --bg: var(--card); --fg: var(--ink); --bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px;
  border: 1px solid var(--bd); border-radius: 99px; background: var(--bg); color: var(--fg);
  font-size: 0.9rem; font-weight: 700; letter-spacing: -0.15px; box-shadow: var(--shadow-sm), var(--sheen);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur), background var(--dur), border-color var(--dur);
}
.btn:hover { transform: translateY(-1.5px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.primary { --bg: linear-gradient(180deg, #6479f0, var(--blue)); --fg: #fff; --bd: transparent; }
.btn.primary { box-shadow: 0 8px 20px -6px rgba(83, 107, 237, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.btn.primary:hover { --bg: linear-gradient(180deg, #5b70ec, var(--blue-dark)); box-shadow: 0 14px 28px -8px rgba(83, 107, 237, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.34); }
[data-theme="dark"] .btn.primary { --bg: linear-gradient(180deg, #7f95ff, #5a70e8); --fg: #0a1122; }
.btn.ghost { --bg: transparent; --fg: var(--ink-2); --bd: var(--line-2); box-shadow: none; }
.btn.ghost:hover { --fg: var(--ink); --bd: var(--blue); }
.btn.dark { --bg: var(--navy); --fg: #fff; --bd: transparent; }
.btn.dark:hover { --bg: #1c2b4d; }
[data-theme="dark"] .btn.dark { --bg: #223150; --fg: #eaf0ff; }
.btn.danger { --bg: var(--danger-soft); --fg: var(--danger); --bd: color-mix(in srgb, var(--danger) 32%, transparent); }
.btn.btn-sm { padding: 6px 12px; font-size: 0.82rem; border-radius: 9px; }
.btn.btn-lg { padding: 13px 22px; font-size: 1rem; }
.btn.btn-block { width: 100%; }

.icon-btn {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--card); color: var(--ink-2); transition: all var(--dur);
}
.icon-btn:hover { color: var(--blue-dark); border-color: var(--blue); transform: translateY(-1px); }

.text-btn { border: 0; background: none; padding: 2px 0; color: var(--blue-dark); font-size: 0.8rem; font-weight: 800; }
.text-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-btn.right { margin-left: auto; }
.back { font-size: 0.84rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 99px;
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); font-size: 0.86rem; font-weight: 700;
  box-shadow: var(--shadow-sm); transition: all var(--dur) var(--ease);
}
.chip:hover { color: var(--ink); border-color: var(--blue); transform: translateY(-1px); }
.chip[aria-pressed="true"] { color: var(--blue-dark); background: linear-gradient(180deg, var(--blue-soft), color-mix(in srgb, var(--blue) 16%, var(--card))); border-color: var(--blue); box-shadow: var(--shadow-sm), 0 0 0 1px rgba(83, 107, 237, 0.14); }
.chip .tick {
  display: grid; place-items: center; width: 15px; height: 15px; border-radius: 5px; border: 1.5px solid var(--line-2);
  background: var(--card); color: transparent; font-size: 0.6rem; transition: all var(--dur);
}
.chip[aria-pressed="true"] .tick { background: var(--blue); border-color: var(--blue); color: #fff; animation: pop 220ms var(--ease); }
.chip-meta { color: var(--muted); font-size: 0.7rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] .chip-meta { color: var(--blue); }
.chip-cat { border-style: solid; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--line); }
.seg button { padding: 7px 14px; border: 0; border-radius: 99px; background: transparent; color: var(--muted); font-size: 0.84rem; font-weight: 700; transition: all var(--dur); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--blue-dark); box-shadow: var(--shadow-sm); }

input[type="text"], input[type="search"] {
  padding: 10px 13px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--card); color: var(--ink); min-width: 0;
  transition: border-color var(--dur), box-shadow var(--dur);
}
input[type="text"]:focus, input[type="search"]:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3.5px rgba(83, 107, 237, 0.2), var(--sheen); }
.search { min-width: 220px; }

input[type="range"] { -webkit-appearance: none; appearance: none; flex: 1; height: 24px; background: transparent; min-width: 130px; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--blue) var(--fill, 30%), var(--line) var(--fill, 30%)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border: 3px solid var(--blue); border-radius: 50%; background: var(--card); box-shadow: var(--shadow-sm); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 99px; background: var(--line); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--blue); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border: 3px solid var(--blue); border-radius: 50%; background: var(--card); }
.len-field output { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 22px; text-align: right; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--card-2); color: var(--ink-2); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.01em; white-space: nowrap;
}
.difficulty.easy { background: var(--gold-soft); color: #a1701d; border-color: color-mix(in srgb, var(--gold) 40%, transparent); }
.difficulty.medium { background: var(--violet-soft); color: var(--violet); border-color: color-mix(in srgb, var(--violet) 38%, transparent); }
.difficulty.hard { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 38%, transparent); }
[data-theme="dark"] .difficulty.easy { color: var(--gold); }
.tag-topic { background: var(--blue-soft); color: var(--blue-dark); border-color: color-mix(in srgb, var(--blue) 30%, transparent); }
.tag-soft { color: var(--muted); }
.tag-time { font-variant-numeric: tabular-nums; background: var(--card-2); }
.tag-time[data-warn="1"] { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.55; } }

kbd {
  display: inline-block; min-width: 20px; padding: 1px 6px; border: 1px solid var(--line-2); border-bottom-width: 2.5px;
  border-radius: 6px; background: var(--card-2); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.72rem; text-align: center;
}
mark { background: color-mix(in srgb, var(--gold) 46%, transparent); color: inherit; border-radius: 4px; padding: 0 3px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 30%, transparent); }

/* ----------------------------------------------------------------- 5 cards */
.welcome, .readiness, .panel, .focus-panel, .question-card, .results-top, .assessment-intro, .miss, .launch {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow), var(--sheen); padding: clamp(18px, 2.1vw, 26px);
}
.quick-card, .mastery, .plan-step, .stat-card, .rev, .acc, .session-bar { box-shadow: var(--shadow-sm), var(--sheen); }
.card { min-width: 0; }
.card-flat { background: var(--card-2); box-shadow: none; }
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel-head h3, .card > p + h3 { margin-top: 2px; }
.foot-note { display: flex; align-items: center; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 0.8rem; }
.foot-note b { color: var(--ink-2); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(258px, 1fr); gap: 18px; align-items: stretch; }
.welcome { position: relative; overflow: hidden; display: flex; align-items: center; gap: 20px; }
.welcome::before {
  content: ""; position: absolute; inset: -34% -12% auto auto; width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(83, 107, 237, 0.2), transparent 62%); pointer-events: none;
}
.welcome > * { position: relative; z-index: 1; }
.welcome h2 { margin: 8px 0 6px; }
.welcome p { color: var(--ink-2); max-width: 52ch; }

.math-orbit { position: relative; flex: 0 0 132px; width: 132px; height: 132px; margin-left: auto; }
.orbit-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed rgba(83, 107, 237, 0.4); }
.orbit-ring.r2 { inset: 22px; border-style: solid; border-color: rgba(134, 103, 232, 0.28); animation: spin 22s linear infinite; }
.orbit-ring.r1 { animation: spin 34s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.math-core {
  position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--math); font-size: 2.1rem; font-weight: 700;
  color: var(--blue-dark); background: linear-gradient(150deg, var(--blue-soft), var(--violet-soft)); border-radius: 50%;
}
.float-symbol { position: absolute; font-family: var(--math); font-size: 1.05rem; color: var(--violet); animation: bob 5.5s ease-in-out infinite; }
.float-symbol.s1 { top: -2px; left: 46%; }
.float-symbol.s2 { bottom: 8px; right: 2px; color: var(--mint); animation-delay: -1.8s; }
.float-symbol.s3 { top: 44%; left: -6px; color: var(--gold); animation-delay: -3.4s; }
@keyframes bob { 50% { transform: translateY(-7px); } }

.readiness { display: grid; gap: 8px; align-content: start; }
.readiness .ring { margin: 4px auto 2px; }
.readiness-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 0.78rem; }
.level-pill { padding: 3px 10px; border-radius: 99px; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.level-pill.new, .level-pill.beginner { background: var(--gold-soft); color: #a1701d; }
.level-pill.intermediate { background: var(--violet-soft); color: var(--violet); }
.level-pill.advanced { background: var(--mint-soft); color: #1c8e75; }
[data-theme="dark"] .level-pill.beginner { color: var(--gold); }
[data-theme="dark"] .level-pill.advanced { color: var(--mint); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 14px; }
.stat-card {
  padding: 15px 17px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat-card::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(180deg, var(--blue), rgba(83, 107, 237, 0.25)); }
.stat-card:nth-child(2)::after { background: linear-gradient(180deg, var(--mint), rgba(64, 189, 165, 0.25)); }
.stat-card:nth-child(3)::after { background: linear-gradient(180deg, var(--violet), rgba(134, 103, 232, 0.25)); }
.stat-card:nth-child(4)::after { background: linear-gradient(180deg, var(--gold), rgba(229, 170, 69, 0.28)); }
.stat-card { transition: transform var(--dur) var(--ease), box-shadow var(--dur); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow), var(--sheen); }
.stat-card p { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.stat-card strong { display: block; margin: 2px 0 1px; font-size: 1.72rem; letter-spacing: -1.2px; line-height: 1.1; }
.stat-card span { color: var(--ink-2); font-size: 0.78rem; }

.lower-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(272px, 1fr); gap: 18px; align-items: start; }
.side-stack { display: grid; gap: 18px; }
.topic-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2px 22px; }
.topic-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 96px 62px; align-items: center; gap: 12px; width: 100%;
  padding: 9px 8px; border: 0; border-radius: 10px; background: transparent; text-align: left; transition: background var(--dur);
}
.topic-row:hover { background: var(--blue-soft); }
.topic-title { display: grid; min-width: 0; }
.topic-title b { font-size: 0.9rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-title small { color: var(--muted); font-size: 0.7rem; }
.topic-track { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.topic-track i { display: block; height: 100%; border-radius: inherit; background: var(--blue); transition: width 500ms var(--ease); }
.topic-track i[data-tone="mint"] { background: var(--mint); }
.topic-track i[data-tone="gold"] { background: var(--gold); }
.topic-track i[data-tone="danger"] { background: var(--danger); }
.topic-track i[data-tone="line"] { background: var(--line-2); }
.topic-metric { display: grid; justify-items: end; font-size: 0.82rem; font-weight: 800; }
.topic-metric small { color: var(--muted); font-weight: 600; font-size: 0.66rem; }

.focus-panel, .review-panel { display: grid; gap: 6px; align-content: start; }
.focus-badge { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--blue-soft); color: var(--blue-dark); }
.review-panel {
  background: linear-gradient(150deg, var(--card), color-mix(in srgb, var(--violet-soft) 58%, var(--card)));
  overflow: hidden;
  position: relative;
}
.review-panel::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -72px;
  top: -76px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--violet) 24%, transparent), transparent 64%);
  pointer-events: none;
}
.focus-panel p.dim, .focus-panel > p, .review-panel > p { color: var(--ink-2); font-size: 0.86rem; }
.focus-panel .btn, .review-panel .btn { margin-top: 8px; }
.activity-list { display: grid; gap: 9px; }
.activity { display: flex; gap: 10px; align-items: flex-start; }
.activity-dot { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto; margin-top: 1px; border-radius: 50%; color: #fff; }
.activity-dot.success { background: var(--mint); }
.activity-dot.focus { background: var(--gold); }
.activity-dot.neutral { background: var(--blue); }
.activity p { font-size: 0.82rem; font-weight: 600; }
.activity p small { display: block; color: var(--muted); font-weight: 500; font-size: 0.7rem; }

.empty { display: grid; justify-items: center; gap: 10px; padding: 40px 18px; text-align: center; color: var(--ink-2); }
.empty-mark { font-family: var(--math); font-size: 1.9rem; color: var(--blue); }
.empty p small { display: block; color: var(--muted); font-size: 0.8rem; }

/* ------------------------------------------------- 6 practice builder */
.quick-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; }
.quick-card {
  display: grid; gap: 3px; padding: 14px 15px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card);
  box-shadow: var(--shadow-sm); text-align: left; transition: all var(--dur) var(--ease);
}
.quick-card:hover:not(:disabled) { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--blue); }
.quick-card:disabled { opacity: 0.62; cursor: not-allowed; filter: saturate(0.82); }
.quick-card > span { display: grid; place-items: center; width: 34px; height: 30px; margin-bottom: 4px; border-radius: 9px; font-family: var(--math); font-size: 1.05rem; font-weight: 700; background: var(--blue-soft); color: var(--blue-dark); }
.quick-card b { font-size: 0.94rem; letter-spacing: -0.2px; }
.quick-card small { color: var(--muted); font-size: 0.74rem; }

.topic-group { padding-top: 14px; border-top: 1px dashed var(--line); }
.topic-group:first-of-type { border-top: 0; padding-top: 4px; }
.group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 9px; }
.group-head b { font-size: 0.9rem; }
.group-head small { color: var(--muted); font-size: 0.76rem; flex: 1 1 220px; min-width: 0; }
.group-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; font-family: var(--math); font-weight: 700; background: var(--blue-soft); color: var(--blue-dark); }
.group-icon.tone-blue { background: var(--blue-soft); color: var(--blue-dark); }
.group-icon.tone-violet { background: var(--violet-soft); color: var(--violet); }
.group-icon.tone-mint { background: var(--mint-soft); color: #1c8e75; }
.group-icon.tone-gold { background: var(--gold-soft); color: #a1701d; }
[data-theme="dark"] .group-icon.tone-gold, [data-theme="dark"] .group-icon.tone-mint { color: var(--gold); }
[data-theme="dark"] .group-icon.tone-mint { color: var(--mint); }

.setting-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-top: 1px dashed var(--line); }
.setting-row:first-of-type { border-top: 0; }
.setting-row > div { display: grid; gap: 2px; max-width: 52ch; }
.setting-row b { font-size: 0.92rem; }
.setting-row small { color: var(--muted); font-size: 0.78rem; }
.setting-row .field { flex: 1 1 200px; max-width: 300px; }
.calibration { display: flex; gap: 7px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--gold-soft); color: #8a5c10; font-size: 0.8rem; }
[data-theme="dark"] .calibration { color: var(--gold); }
.calibration b { font-weight: 800; }

.launch { display: grid; gap: 8px; align-content: start; background: linear-gradient(165deg, var(--navy), var(--navy-2)); border-color: transparent; color: #eaf0ff; }
.launch .card-kicker { color: #8fa0c6; }
.launch-count { font-size: 2.6rem; font-weight: 800; letter-spacing: -2px; line-height: 1; }
.launch-count small { display: block; margin-top: 5px; font-size: 0.84rem; font-weight: 600; color: #8fa0c6; letter-spacing: -0.2px; }
.launch .dim { color: #a9b6d6; font-size: 0.82rem; }
.launch .btn.primary { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3); }
.warn-line { margin: 0; color: #ffd8a8; font-size: 0.8rem; }
.last-set { display: grid; gap: 3px; margin-top: 4px; padding-top: 14px; border-top: 1px solid rgba(174, 190, 233, 0.16); font-size: 0.82rem; }
.last-set b { font-size: 0.9rem; }
.last-set span { color: #a9b6d6; }
.last-set .text-btn { color: #b6c4ff; justify-self: start; margin-top: 4px; }
.kbd-list { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 0.8rem; color: var(--ink-2); }

/* ------------------------------------------------- 7 question + session */
.session-view { gap: 14px; }
.session-bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 11px 14px; background: color-mix(in srgb, var(--card) 86%, transparent); backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid var(--line); border-radius: var(--r);
}
[data-theme="dark"] .session-bar { background: color-mix(in srgb, var(--card) 94%, transparent); }
.session-meta { display: flex; align-items: center; gap: 10px; min-width: 0; }
.session-meta b { font-size: 0.9rem; letter-spacing: -0.2px; }
.session-meta span { color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.session-score { font-size: 0.82rem; font-weight: 800; color: var(--ink-2); white-space: nowrap; }
.progress { position: relative; flex: 1 1 150px; height: 9px; min-width: 110px; border-radius: 99px; background: var(--line); overflow: hidden; box-shadow: inset 0 1px 2px rgba(23, 36, 66, 0.14); }
.progress-fill, .progress i { position: absolute; inset: 0 auto 0 0; display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--mint)); transition: width 420ms var(--ease); }

.question-card { display: grid; gap: 4px; animation: rise 260ms var(--ease) both; }
.question-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.question-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.question-progress { display: grid; gap: 5px; justify-items: end; font-size: 0.74rem; font-weight: 800; color: var(--muted); }
.question-progress i { width: 128px; height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; }
.question-progress b { display: block; height: 5px; border-radius: 99px; background: var(--blue); transition: width 400ms var(--ease); }
.q-text { margin: 15px 0 4px; font-family: var(--math); font-size: clamp(1.14rem, 1.02rem + 0.6vw, 1.48rem); line-height: 1.52; font-weight: 400; letter-spacing: 0; text-wrap: pretty; }

.option-list { display: grid; gap: 10px; margin-top: 18px; }
.answer-option {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 15px;
  border: 1.5px solid var(--line); border-radius: var(--r); text-align: left;
  background: linear-gradient(180deg, var(--card), var(--card-2)); box-shadow: var(--shadow-sm), var(--sheen);
  transition: all var(--dur) var(--ease);
}
.answer-option > span:first-child {
  display: grid; place-items: center; width: 29px; height: 29px; flex: 0 0 auto; border: 1px solid var(--line-2);
  border-radius: 50%; background: var(--card); color: var(--ink-2); font-family: var(--math);
  font-size: 0.86rem; font-weight: 700; box-shadow: var(--sheen); transition: all var(--dur) var(--ease);
}
.answer-option p { flex: 1; margin: 0; font-size: 1rem; }
.answer-option .icon { color: var(--mint); flex: 0 0 auto; }
.answer-option:hover:not(:disabled) { border-color: var(--blue); background: linear-gradient(90deg, var(--blue-soft), var(--card) 68%); transform: translateX(4px); }
.answer-option:hover:not(:disabled) > span:first-child { border-color: var(--blue); color: var(--blue-dark); transform: scale(1.06); }
.answer-option:active:not(:disabled) { transform: translateX(4px) scale(0.995); }
.answer-option.is-selected { border-color: var(--blue); background: linear-gradient(90deg, var(--blue-soft), var(--card) 72%); box-shadow: 0 0 0 3.5px rgba(83, 107, 237, 0.2), var(--sheen); }
.answer-option.is-selected > span:first-child { background: linear-gradient(160deg, #6d81f4, var(--blue)); border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgba(83, 107, 237, 0.45); }
.answer-option.is-correct { border-color: var(--mint); background: linear-gradient(90deg, var(--mint-soft), var(--card) 72%); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--mint) 22%, transparent); }
.answer-option.is-correct > span:first-child { background: linear-gradient(160deg, #5ccfb5, var(--mint)); border-color: transparent; color: #04352b; animation: pop 300ms var(--ease); }
.answer-option.is-wrong { border-color: var(--danger); background: linear-gradient(90deg, var(--danger-soft), var(--card) 72%); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--danger) 20%, transparent); animation: nudge 340ms var(--ease); }
.answer-option.is-wrong > span:first-child { background: var(--danger); border-color: transparent; color: #fff; }
.answer-option:disabled { cursor: default; }
@keyframes nudge { 25% { transform: translateX(-5px); } 62% { transform: translateX(4px); } }

.feedback {
  display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; padding: 14px 16px; border-radius: var(--r);
  border: 1px solid transparent; animation: rise 240ms var(--ease) both;
}
.feedback.good { background: var(--mint-soft); border-color: color-mix(in srgb, var(--mint) 34%, transparent); }
.feedback.bad { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 38%, transparent); }
.feedback-mark { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%; color: #fff; box-shadow: 0 6px 14px rgba(23, 36, 66, 0.2); }
.feedback.good .feedback-mark { background: var(--mint); }
.feedback.bad .feedback-mark { background: var(--gold); }
.feedback strong { display: block; font-size: 0.9rem; }
.feedback p { margin: 2px 0 0; font-size: 0.92rem; color: var(--ink-2); }
.feedback .m { font-size: 1.05em; }
.question-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.question-actions > p { color: var(--muted); font-size: 0.8rem; }

.navigator { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0; }
.nav-dot {
  display: grid; place-items: center; width: 30px; height: 30px; border: 1.5px solid var(--line-2); border-radius: 10px;
  background: var(--card); color: var(--muted); font-size: 0.76rem; font-weight: 800; font-variant-numeric: tabular-nums; transition: all var(--dur);
}
.nav-dot:hover { transform: translateY(-1.5px); border-color: var(--blue); }
.nav-dot[data-state="answered"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.nav-dot[data-state="flagged"] { background: var(--gold-soft); border-color: var(--gold); color: #8a5c10; }
.nav-dot[data-state="current"] { border-color: var(--blue); color: var(--blue-dark); background: var(--blue-soft); box-shadow: 0 0 0 3.5px rgba(83, 107, 237, 0.22); }

/* ------------------------------------------------------------- 8 maths */
.m { font-family: var(--math); font-size: 1.04em; letter-spacing: 0.1px; white-space: normal; }
.m sup, .m sub { font-size: 0.66em; }
.frac { display: inline-grid; grid-template-rows: auto auto; align-items: center; justify-items: center; vertical-align: -0.45em; margin: 0 2px; line-height: 1.12; }
.frac > .fn { padding: 0 5px 1px; border-bottom: 1.4px solid currentColor; }
.frac > .fd { padding: 1px 5px 0; }
/* Radical rendering: a real, always-visible √ glyph plus an overlined radicand,
   all in plain inline flow on one baseline. No flexbox, transforms or SVG hooks —
   those are exactly what used to collapse in some browsers and leave a bare
   horizontal line on screen. The slight overhang (negative right margin) welds
   the glyph's own top bar to the vinculum so they read as one mark. */
.sqrt {
  display: inline;
  font-family: var(--math);
  white-space: nowrap;
}
.sqrt .radical-sign {
  display: inline;
  font-size: 1.1em;
  line-height: 1;
  margin-right: -0.06em;
  text-decoration: none;
}
.sqrt > .vin {
  display: inline;
  min-width: 0.42em;
  padding: 0.03em 0.06em 0 0.02em;
  border-top: max(1.3px, 0.07em) solid currentColor;
}


/* ------------------------------------------------------------- 9 stats */
.ring {
  --p: 0; position: relative; display: grid; place-items: center; width: 108px; height: 108px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--blue), var(--mint) calc(var(--p) * 1%), var(--line) 0);
  filter: drop-shadow(0 10px 22px rgba(83, 107, 237, 0.22));
}
.ring::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.ring span { position: relative; z-index: 1; font-size: 1.5rem; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.ring.ring-sm { width: 46px; height: 46px; }
.ring.ring-sm::after { inset: 5px; }
.ring.ring-sm span { font-size: 0.72rem; letter-spacing: -0.3px; }

.results-top { display: grid; gap: 16px; }
.results-top .ring { justify-self: end; }
.results-top .stats-grid { margin-top: 4px; }
.breakdown { display: grid; gap: 12px; }
.bd-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 0.88rem; }
.bd-row b { color: var(--ink-2); font-size: 0.82rem; }
.bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--blue); transition: width 600ms var(--ease); }
.bar-fill.bar-mint { background: var(--mint); }
.bar-fill.bar-gold { background: var(--gold); }
.bar-fill.bar-danger { background: var(--danger); }
.bar-fill.bar-blue { background: linear-gradient(90deg, var(--blue), var(--violet)); }

.rev-list { display: grid; gap: 8px; }
.rev { border: 1px solid var(--line); border-radius: var(--r); background: var(--card-2); overflow: hidden; }
.rev summary { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; list-style: none; font-size: 0.88rem; }
.rev summary::-webkit-details-marker { display: none; }
.rev summary b { font-weight: 700; }
.rev summary::after { content: "＋"; margin-left: auto; color: var(--muted); font-size: 0.9rem; }
.rev[open] summary::after { content: "−"; }
.rev[open] summary { border-bottom: 1px solid var(--line); background: var(--card); }
.rev-dot { display: grid; place-items: center; width: 21px; height: 21px; flex: 0 0 auto; border-radius: 50%; color: #fff; font-size: 0.7rem; }
.rev-dot.good { background: var(--mint); }
.rev-dot.bad { background: var(--danger); }
.rev-tags { display: flex; gap: 6px; margin-left: auto; padding-left: 10px; }
.rev-body { padding: 14px; display: grid; gap: 12px; background: var(--card); }
.rev-body .q-text { margin: 0; font-size: 1.06rem; }
.rev-answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.ans { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: var(--r-sm); background: var(--card-2); border: 1px solid var(--line); font-size: 0.92rem; }
.ans span { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ans.good { border-color: color-mix(in srgb, var(--mint) 44%, transparent); background: var(--mint-soft); }
.ans.bad { border-color: color-mix(in srgb, var(--danger) 44%, transparent); background: var(--danger-soft); }
.ans em { color: var(--muted); font-style: normal; }
.explain { padding: 11px 13px; border-left: 3px solid var(--blue); border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--blue-soft); color: var(--ink-2); font-size: 0.9rem; font-family: var(--math); }
.recommend { display: flex; gap: 13px; align-items: flex-start; background: linear-gradient(150deg, var(--blue-soft), var(--card)); }
.recommend > span { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 11px; background: var(--card); color: var(--blue-dark); box-shadow: var(--shadow-sm); }
.recommend b { display: block; font-size: 0.94rem; }
.recommend p { margin: 2px 0 10px; color: var(--ink-2); font-size: 0.86rem; }

.spark { display: flex; align-items: flex-end; gap: 5px; height: 76px; margin-bottom: 16px; }
.spark i {
  flex: 1; min-width: 7px; border-radius: 6px 6px 3px 3px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  background: linear-gradient(180deg, var(--blue), rgba(83, 107, 237, 0.3)); transition: filter var(--dur);
}
.spark:hover i { filter: saturate(1.25); }
.spark i.is-best { background: linear-gradient(180deg, var(--mint), rgba(64, 189, 165, 0.4)); }
.table-wrap { overflow-x: auto; }
.log { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.log th, .log td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.log th { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.log tbody tr:hover { background: var(--card-2); }
.mastery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.mastery { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card-2); text-align: left; transition: all var(--dur) var(--ease); }
.mastery:hover { transform: translateY(-2px); background: var(--card); box-shadow: var(--shadow); border-color: var(--blue); }
.mastery span { display: grid; min-width: 0; }
.mastery b { font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mastery small { color: var(--muted); font-size: 0.72rem; }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.plan-step { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card-2); text-align: left; transition: all var(--dur) var(--ease); }
.plan-step:hover { border-color: var(--blue); background: var(--card); transform: translateY(-2px); box-shadow: var(--shadow); }
.plan-step > span { font-family: var(--math); font-size: 1.15rem; font-weight: 700; color: var(--blue); }
.plan-step p { display: grid; flex: 1; }
.plan-step small { color: var(--muted); font-size: 0.76rem; }

.assessment-intro { display: grid; justify-items: center; gap: 12px; text-align: center; padding: clamp(26px, 5vw, 52px); }
.assessment-intro .sub { text-align: left; }
.assessment-intro p.sub { text-align: center; }
.large-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 17px; background: linear-gradient(150deg, var(--blue), var(--violet)); color: #fff; box-shadow: 0 12px 26px rgba(83, 107, 237, 0.3); }
.assessment-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.assessment-meta span { padding: 7px 14px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--line); font-size: 0.82rem; color: var(--ink-2); }
.assessment-meta b { color: var(--ink); }
.learning-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bank-note { color: var(--muted); font-size: 0.78rem; }

.miss-list { display: grid; gap: 14px; }
.miss { display: grid; gap: 8px; }
.q-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.opt-echo { display: flex; flex-wrap: wrap; gap: 8px; }
.echo { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); font-size: 0.9rem; }
.echo.good { border-color: var(--mint); background: var(--mint-soft); font-weight: 700; }
.miss .explain { margin-top: 2px; }

.acc { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); overflow: hidden; }
.acc > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; cursor: pointer; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary span { display: grid; gap: 2px; }
.acc > summary b { font-size: 0.98rem; }
.acc > summary small { font-size: 0.78rem; }
.acc > summary::after { content: "＋"; color: var(--muted); transition: transform var(--dur); }
.acc[open] > summary { border-bottom: 1px solid var(--line); background: var(--card-2); }
.acc[open] > summary::after { transform: rotate(45deg); }
.f-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; padding: 14px 16px; }
.f-item { padding: 10px 12px; border-radius: var(--r-sm); background: var(--card-2); border: 1px solid var(--line); }
.f-item b { display: block; margin-bottom: 3px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.f-item span { font-size: 1rem; }

/* --------------------------------------------------- 9b spaced review */
.nav-count.soft { background: var(--blue); }
.review-peek {
  display: flex; align-items: center; gap: 6px; margin: 2px 0 0; padding: 7px 10px;
  border-radius: var(--r-sm); background: color-mix(in srgb, var(--violet-soft) 70%, var(--card));
  color: var(--violet); font-size: 0.78rem; font-weight: 700;
}
.review-panel .text-btn { justify-self: start; }

.srs-note {
  display: flex; align-items: flex-start; gap: 7px; margin-top: 9px; padding-top: 9px;
  border-top: 1px dashed color-mix(in srgb, currentColor 22%, transparent);
  color: var(--ink-2); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.01em;
}
.srs-note .icon { flex: 0 0 auto; margin-top: 1px; color: var(--violet); }

.forecast { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; }
.fc-col { display: grid; gap: 7px; justify-items: center; min-width: 0; }
.fc-col > b { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.fc-n { font-size: 0.76rem; font-weight: 800; color: var(--ink-2); min-height: 1.1em; }
.fc-track {
  display: flex; align-items: flex-end; justify-content: center; width: 100%; max-width: 44px; height: 96px;
  border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); overflow: hidden;
}
.fc-track i {
  display: block; width: 100%; min-height: 4px; border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, var(--violet), color-mix(in srgb, var(--violet) 55%, var(--blue)));
  opacity: 0.55; transition: height 500ms var(--ease);
}
.fc-track i.fc-today { opacity: 1; background: linear-gradient(180deg, var(--blue), var(--violet)); box-shadow: 0 -2px 12px color-mix(in srgb, var(--blue) 45%, transparent); }

.ladder { display: grid; gap: 9px; }
.box-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.box-chip {
  flex: 0 0 auto; padding: 2px 9px; border-radius: 99px; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--blue-soft); color: var(--blue-dark); border: 1px solid color-mix(in srgb, var(--blue) 28%, transparent); white-space: nowrap;
}
.box-every { flex: 0 0 auto; min-width: 96px; color: var(--muted); font-size: 0.76rem; font-weight: 700; }
.box-track { flex: 1; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; min-width: 40px; }
.box-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--violet)); transition: width 520ms var(--ease); }
.box-n { flex: 0 0 auto; min-width: 26px; text-align: right; font-weight: 800; color: var(--ink-2); font-size: 0.82rem; }

.deck-list { display: grid; gap: 12px; }
.deck-card {
  display: flex; align-items: center; gap: 14px; padding: 13px 15px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--card-2);
  transition: border-color var(--dur), transform var(--dur) var(--ease), box-shadow var(--dur);
}
.deck-card:hover { border-color: var(--blue); transform: translateY(-1.5px); box-shadow: var(--shadow-sm); }
.deck-body { flex: 1; min-width: 0; display: grid; gap: 7px; }
.deck-q {
  margin: 0; font-family: var(--math); font-size: 0.99rem; line-height: 1.45; color: var(--ink);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.deck-go { flex: 0 0 auto; }
.due-pill {
  padding: 2px 9px; border-radius: 99px; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.05em;
  background: var(--card); color: var(--muted); border: 1px solid var(--line); text-transform: capitalize; white-space: nowrap;
}
.due-pill.now { background: var(--gold-soft); color: #a1701d; border-color: color-mix(in srgb, var(--gold) 40%, transparent); }
[data-theme="dark"] .due-pill.now { color: var(--gold); }
@media (max-width: 640px) {
  .deck-card { align-items: flex-start; flex-direction: column; }
  .deck-go { align-self: flex-end; }
  .box-every { width: auto; min-width: 64px; }
}

/* ------------------------------------------------------------ 10 overlays */
.scrim { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 18px; background: rgba(9, 15, 30, 0.58); backdrop-filter: blur(7px) saturate(1.15); animation: fade 160ms var(--ease) both; }
.modal { width: min(620px, 100%); max-height: 86vh; overflow: auto; padding: 26px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg), var(--sheen); animation: pop 220ms var(--ease) both; }
.modal h2 { margin-bottom: 6px; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 16px; margin-top: 16px; }
.help-grid p { font-size: 0.85rem; color: var(--ink-2); margin-bottom: 5px; }
.help-grid .card-kicker { display: block; margin-bottom: 7px; }
.onboard { display: grid; justify-items: center; gap: 8px; text-align: center; }
.onboard-mark { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 6px; border-radius: 17px; background: linear-gradient(140deg, #6479f0, var(--violet)); color: #fff; font-family: var(--math); font-size: 27px; box-shadow: 0 14px 30px rgba(83, 107, 237, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.onboard form { width: 100%; margin-top: 10px; }
.onboard input { width: 100%; padding: 12px 14px; font-size: 1rem; text-align: center; }
.onboard .hint { margin-top: 8px; color: var(--muted); font-size: 0.74rem; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 70; transform: translate(-50%, 150%); max-width: min(440px, 92vw);
  padding: 11px 18px; border-radius: 99px; background: linear-gradient(150deg, #1b2947, var(--navy)); color: #eef2ff;
  border: 1px solid rgba(174, 190, 233, 0.16); box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 0.88rem; font-weight: 700; pointer-events: none; transition: transform 320ms var(--ease);
}
.toast.show { transform: translate(-50%, 0); }

.confetti { position: fixed; inset: 0; z-index: 80; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; top: -14px; width: 8px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(106vh) rotate(720deg); opacity: 0.1; } }

/* --------------------------------------------------------- 11 responsive */
@media (max-width: 1040px) {
  .dash-grid, .lower-grid, .g-side { grid-template-columns: minmax(0, 1fr); }
  .welcome { align-items: flex-start; }
  .math-orbit { display: none; }
}
@media (max-width: 900px) {
  .mobile-header { display: flex; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 46; height: 100vh; transform: translateX(-102%);
    transition: transform 260ms var(--ease); box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .nav-close { display: grid; margin-left: auto; border-color: var(--navy-line); background: rgba(255, 255, 255, 0.06); color: #cdd6ee; }
  .main { padding-top: 20px; }
  .session-bar { position: static; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .question-actions > p { display: none; }
  .answer-option { padding: 11px 12px; }
  .topline { align-items: flex-start; }
  .rev-tags { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .sidebar, .mobile-header, .session-bar, .question-actions, .navigator, .toast, .topline-actions { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .question-card { box-shadow: none; break-inside: avoid; }
}
