:root {
  --navy: #101b38;
  --navy-2: #19284e;
  --ink: #172039;
  --muted: #667089;
  --line: #dce2ee;
  --paper: #fff;
  --canvas: #f3f6fb;
  --lime: #b9f532;
  --blue: #2864dc;
  --blue-soft: #eaf1ff;
  --green: #177b58;
  --green-soft: #e9f8f1;
  --red: #bd3e54;
  --red-soft: #fff0f2;
  --amber-soft: #fff8e7;
  --shadow: 0 20px 55px rgba(16, 27, 56, .1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(circle at 88% 8%, rgba(185, 245, 50, .13), transparent 28rem), var(--canvas);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.topbar {
  min-height: 72px;
  padding: 0 max(22px, 5vw);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #fff;
  background: var(--navy);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 850;
  letter-spacing: -.035em;
}
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--navy);
  background: var(--lime);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.1);
}
.top-meta { display: flex; align-items: center; gap: 14px; font-size: .88rem; font-weight: 720; }
.coverage { padding: 7px 11px; border-radius: 999px; color: var(--navy); background: var(--lime); }
.topic-total { color: #c8d1e5; }
.dashboard-link {
  min-height: 38px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 800;
}
.dashboard-link:hover { background: rgba(255,255,255,.1); }
main { width: min(1240px, calc(100% - 32px)); margin: 0 auto; padding: 38px 0 70px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: .76rem; line-height: 1; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2.05rem, 5vw, 3.6rem); line-height: .98; letter-spacing: -.055em; }
.intro { max-width: 690px; margin: 13px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.55; }
.new-set {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid #c7cfde;
  border-radius: 12px;
  color: var(--navy);
  background: #fff;
  font-weight: 790;
  white-space: nowrap;
}
.new-set:hover { color: var(--blue); border-color: var(--blue); }
.mobile-settings { display: none; }
.app-shell { display: grid; grid-template-columns: 284px minmax(0, 1fr); gap: 18px; align-items: start; }
.curriculum {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(16,27,56,.06);
}
.curriculum-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 2px 16px; }
.curriculum-head h2 { margin: 0; font-size: 1.15rem; letter-spacing: -.025em; }
.mini-label { margin: 0 0 4px; color: var(--muted); font-size: .7rem; font-weight: 830; letter-spacing: .1em; text-transform: uppercase; }
.count-badge {
  min-width: 35px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: .78rem;
  font-weight: 850;
}
.topic-button {
  width: 100%;
  min-height: 49px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}
.topic-button:hover { background: #f3f6fb; }
.topic-button.active { border-color: #bfd0f6; color: var(--blue); background: var(--blue-soft); }
.topic-button.exam-pilot {
  margin: 10px 0 12px;
  border-color: #d8c7ff;
  background: linear-gradient(135deg, #f7f2ff, #eef3ff);
}
.topic-button.exam-pilot:hover { border-color: #9b78e9; background: #f2ebff; }
.topic-button.exam-pilot.active { border-color: #7653c9; color: #6542b7; background: #eee7ff; box-shadow: 0 0 0 3px rgba(118,83,201,.1); }
.topic-button.exam-pilot small { color: #735f9f; }
.exam-icon {
  width: 35px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: #7653c9;
  font-size: .58rem;
  letter-spacing: .04em;
}
.topic-button strong, .topic-button small { display: block; }
.topic-button strong { font-size: .88rem; line-height: 1.25; }
.topic-button small { margin-top: 2px; color: var(--muted); font-size: .73rem; }
.topic-icon { width: 25px; color: var(--blue); text-align: center; font-size: 1.05rem; }
.strand-group { border-top: 1px solid var(--line); }
.strand-group:first-child { margin-top: 12px; }
.strand-group summary {
  padding: 14px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  color: var(--navy);
  font-size: .82rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .07em;
  cursor: pointer;
}
.strand-group summary::-webkit-details-marker { display: none; }
.strand-group summary::after { content: "+"; color: var(--blue); font-size: 1rem; }
.strand-group[open] summary::after { content: "−"; }
.strand-topics { padding: 0 0 10px; }
.practice-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}
.practice-toolbar {
  min-height: 86px;
  padding: 19px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: #fbfcff;
}
.practice-toolbar h2 { margin: 3px 0 0; font-size: 1.25rem; letter-spacing: -.025em; }
.crumb { margin: 0; color: var(--blue); font-size: .76rem; font-weight: 820; letter-spacing: .08em; text-transform: uppercase; }
.tier-control { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .84rem; font-weight: 750; }
select {
  min-height: 40px;
  padding: 0 34px 0 11px;
  border: 1px solid #c8d0df;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  font-weight: 720;
}
.progress-row {
  padding: 13px 28px;
  display: grid;
  grid-template-columns: auto minmax(100px, 1fr) auto;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 720;
}
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: #e4e9f2; }
.progress-bar { width: 10%; height: 100%; border-radius: inherit; background: var(--blue); transition: width .3s ease; }
.question-area { min-height: 462px; padding: 36px clamp(26px, 5vw, 64px); }
.question-topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.skill-pill {
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: .75rem;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.status-mark {
  min-width: 84px;
  min-height: 31px;
  padding: 0 10px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  color: var(--muted);
  background: #f1f3f7;
  font-size: .75rem;
  font-weight: 780;
}
.question-text { max-width: 780px; margin: 38px 0 10px; font-size: clamp(1.35rem, 2.8vw, 2rem); line-height: 1.34; letter-spacing: -.028em; }
.question-visual {
  width: min(100%, 470px);
  margin: 22px 0 24px;
  padding: 16px;
  border: 1px solid #d7dfec;
  border-radius: 16px;
  background: #fbfcff;
}
.question-visual[hidden] { display: none; }
.question-visual svg { display: block; width: 100%; height: auto; margin-top: 12px; }
.visual-heading { display: grid; gap: 3px; }
.visual-heading strong { color: var(--navy); font-size: .95rem; }
.visual-heading span { color: var(--muted); font-size: .82rem; line-height: 1.4; }
.grid-bg { fill: #fff; stroke: #cbd5e5; }
.grid-line { stroke: #e3e8f1; stroke-width: 1; }
.axis { stroke: #52627d; stroke-width: 1.8; }
.axis-label { fill: #6a768b; font-size: 9px; font-weight: 650; }
.plot-point { fill: #e07b2d; stroke: #fff; stroke-width: 3; }
.point-label { fill: #9b4b0d; font-size: 12px; font-weight: 850; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.instruction { margin: 0 0 25px; color: var(--muted); line-height: 1.5; }
.answer-row { display: grid; grid-template-columns: minmax(0, 280px) auto; align-items: center; gap: 12px; }
.answer-input {
  width: 100%;
  height: 54px;
  padding: 0 17px;
  border: 2px solid #c8d1e1;
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 750;
  transition: border-color .17s, box-shadow .17s;
}
.answer-input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(40,100,220,.12); }
.answer-input[aria-invalid="true"] { border-color: var(--red); }
.extended-answer {
  min-height: 168px;
  height: auto;
  padding: 15px 17px;
  resize: vertical;
  line-height: 1.55;
  font-size: 1rem;
  font-weight: 600;
}
.answer-row:has(.extended-answer:not([hidden])) { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
.answer-row:has(.extended-answer:not([hidden])) .primary { justify-self: start; }
.primary {
  min-height: 54px;
  padding: 0 23px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--navy);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.18);
  font-weight: 820;
}
.primary:hover { background: var(--navy-2); }
.primary:disabled { cursor: default; opacity: .5; }
.feedback, .hint, .solution { display: none; margin-top: 15px; padding: 15px 17px; border-radius: 12px; line-height: 1.55; }
.feedback.show, .hint.show, .solution.show { display: block; }
.feedback.correct { color: #126143; background: var(--green-soft); }
.feedback.incorrect { color: #982d41; background: var(--red-soft); }
.hint { border-left: 4px solid #efb02d; border-radius: 0 10px 10px 0; color: #6e4c14; background: var(--amber-soft); }
.solution { padding: 20px; border: 1px solid #ccd8ef; color: var(--ink); background: #f7f9fe; animation: reveal .22s ease-out; }
.solution h4 { margin: 0 0 10px; font-size: 1rem; }
.solution p { margin: 7px 0; }
.solution .result-line { margin-top: 12px; color: var(--green); font-weight: 830; }
.mark-scheme { margin: 12px 0 16px; padding-left: 22px; }
.mark-scheme li { margin: 8px 0; }
.model-answer { padding: 13px 15px; border-radius: 10px; background: #fff; }
.self-mark-panel { margin-top: 17px; padding-top: 16px; border-top: 1px solid #d8dfed; }
.self-mark-panel > p { margin: 0 0 11px; font-weight: 780; }
.mark-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.mark-button {
  min-width: 44px;
  min-height: 41px;
  border: 1px solid #9eadd0;
  border-radius: 10px;
  color: var(--navy);
  background: #fff;
  font-weight: 820;
}
.mark-button:hover { border-color: var(--blue); color: var(--blue); }
.mark-button.selected { border-color: var(--green); color: #fff; background: var(--green); }
.mark-button:disabled:not(.selected) { opacity: .5; cursor: default; }
.challenge-zone { margin-top: 17px; display: flex; flex-wrap: wrap; align-items: center; gap: 11px; }
.challenge-zone[hidden] { display: none; }
.challenge-zone span { color: var(--muted); font-size: .82rem; line-height: 1.45; }
.challenge-button { min-height: 42px; padding: 0 15px; border: 1px solid var(--blue); border-radius: 10px; color: var(--blue); background: #fff; font-weight: 820; }
.challenge-button:hover { color: #fff; background: var(--blue); }
.challenge-button:disabled { cursor: default; opacity: .65; }
.challenge-dialog { width: min(620px, calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 0; overflow: auto; border: 0; border-radius: 18px; color: var(--ink); background: #fff; box-shadow: 0 24px 80px rgba(10,22,48,.28); }
.challenge-dialog::backdrop { background: rgba(7,15,32,.62); backdrop-filter: blur(3px); }
.challenge-dialog form { padding: 24px; }
.challenge-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.challenge-dialog h2 { margin: 3px 0 0; font-size: 1.45rem; }
.dialog-close { width: 40px; height: 40px; border: 0; border-radius: 10px; color: var(--muted); background: #f1f4f8; font-size: 1.45rem; }
.challenge-summary { margin: 18px 0; padding: 13px 15px; border-left: 4px solid var(--blue); border-radius: 0 10px 10px 0; background: var(--blue-soft); font-size: .9rem; line-height: 1.5; }
.challenge-field { margin-top: 16px; display: grid; gap: 8px; color: var(--navy); font-size: .86rem; font-weight: 780; }
.challenge-field select, .challenge-field textarea { width: 100%; padding: 12px 13px; border: 1px solid #c8d1e1; border-radius: 10px; color: var(--ink); background: #fff; font: inherit; font-weight: 600; }
.challenge-field textarea { min-height: 132px; resize: vertical; line-height: 1.5; }
.challenge-field select:focus, .challenge-field textarea:focus { border-color: var(--blue); outline: 3px solid rgba(40,100,220,.12); }
.challenge-error { min-height: 22px; margin: 12px 0 0; color: var(--red); font-size: .84rem; font-weight: 700; }
.challenge-error a { color: inherit; }
.challenge-actions { margin-top: 12px; display: flex; justify-content: flex-end; gap: 10px; }
.exam-note { color: #6542b7; font-weight: 780; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.practice-footer {
  min-height: 76px;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  background: #fbfcff;
}
.live-stats { display: flex; gap: 18px; color: var(--muted); font-size: .82rem; }
.live-stats strong { margin-left: 5px; color: var(--navy); font-size: 1rem; }
.action-buttons { display: flex; align-items: center; gap: 14px; }
.text-button { min-height: 42px; padding: 0 4px; border: 0; color: var(--blue); background: transparent; font-weight: 770; }
.text-button:hover { text-decoration: underline; text-underline-offset: 4px; }
.next-button { min-height: 45px; padding: 0 18px; border: 1px solid var(--navy); border-radius: 11px; color: var(--navy); background: #fff; font-weight: 810; }
.next-button:hover { color: #fff; background: var(--navy); }
.completion { display: none; min-height: 390px; place-items: center; text-align: center; }
.completion.show { display: grid; }
.completion-icon { width: 70px; height: 70px; margin: 0 auto 22px; display: grid; place-items: center; border-radius: 21px; color: var(--navy); background: var(--lime); font-size: 1.8rem; font-weight: 900; transform: rotate(-4deg); }
.completion h3 { margin: 0; font-size: 2rem; letter-spacing: -.04em; }
.completion > div > p:not(.eyebrow) { color: var(--muted); }
.result-stats { margin: 21px 0; display: flex; justify-content: center; gap: 12px; }
.result-stats div { min-width: 110px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8faff; }
.result-stats strong, .result-stats span { display: block; }
.result-stats strong { font-size: 1.35rem; }
.result-stats span { margin-top: 3px; color: var(--muted); font-size: .75rem; }
.coverage-panel {
  margin-top: 22px;
  padding: 24px 26px;
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}
.coverage-panel h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.025em; }
.coverage-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.coverage-card { padding: 13px; border-radius: 12px; color: var(--navy); background: #f4f7fc; }
.coverage-card strong, .coverage-card span { display: block; }
.coverage-card strong { font-size: .84rem; }
.coverage-card span { margin-top: 4px; color: var(--muted); font-size: .73rem; }
.coverage-card::before { content: ""; width: 22px; height: 4px; margin-bottom: 10px; display: block; border-radius: 99px; background: var(--strand-color, var(--blue)); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid rgba(40,100,220,.35); outline-offset: 3px; }
@media (max-width: 940px) {
  .app-shell { grid-template-columns: 236px minmax(0,1fr); }
  .curriculum { padding: 15px; }
  .coverage-panel { grid-template-columns: 1fr; }
  .coverage-grid { grid-template-columns: repeat(5, minmax(105px, 1fr)); overflow-x: auto; padding-bottom: 4px; }
}
@media (max-width: 740px) {
  .topbar { min-height: 66px; padding: 0 18px; }
  .topic-total { display: none; }
  main { width: min(100% - 20px, 680px); padding-top: 27px; }
  .page-head { align-items: flex-start; }
  .intro { font-size: .93rem; }
  .new-set { min-height: 42px; padding: 0 12px; font-size: .82rem; }
  .curriculum { display: none; }
  .mobile-settings { margin-bottom: 13px; padding: 12px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
  .mobile-settings label { display: grid; gap: 5px; color: var(--muted); font-size: .72rem; font-weight: 770; }
  .mobile-settings select { max-width: 100%; }
  .app-shell { display: block; }
  .tier-control { display: none; }
  .practice-toolbar { min-height: 73px; padding: 16px 20px; }
  .progress-row { padding: 12px 20px; grid-template-columns: auto 1fr; }
  .progress-row #attempts { grid-column: 1 / -1; }
  .question-area { min-height: 480px; padding: 27px 21px; }
  .question-text { margin-top: 30px; }
  .practice-footer { padding: 13px 20px; flex-wrap: wrap; }
  .action-buttons { width: 100%; justify-content: space-between; }
  .coverage-panel { padding: 20px; }
}
@media (max-width: 500px) {
  .topbar { padding: 0 12px; }
  .brand { font-size: 1.08rem; }
  .coverage { display: none; }
  .top-meta { gap: 6px; }
  .dashboard-link { min-height: 34px; padding: 0 9px; font-size: .72rem; }
  .page-head { display: block; }
  .new-set { margin-top: 17px; }
  .mobile-settings { grid-template-columns: 1fr; }
  .answer-row { grid-template-columns: 1fr; }
  .primary { width: 100%; }
  .question-topline { align-items: flex-start; }
  .live-stats { width: 100%; justify-content: space-between; }
  .next-button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.worked-example { margin-top: 1.25rem; padding: 1.25rem; border: 1px solid #b4c9ed; border-radius: 14px; background: #f0f5ff; color: #172d50; font-size: 1rem; line-height: 1.65; }
.worked-example[hidden] { display: none; }
.worked-example h4 { margin: 0 0 .5rem; font-size: 1.1rem; }
.worked-example ol { padding-left: 1.5rem; }
.worked-example li { padding-left: .25rem; margin-bottom: .75rem; overflow-wrap: anywhere; }
.action-buttons { flex-wrap: wrap; }

#exampleButton:disabled { opacity: .65; cursor: not-allowed; }

.adaptive-settings { margin: 0 0 1.25rem; padding: 1rem 1.25rem; background: #eef5ff; border: 1px solid #bed2ee; border-radius: 12px; font-size: 1rem; }
.adaptive-settings label { font-weight: 700; display: flex; gap: .6rem; align-items: center; }
.adaptive-settings p { margin: .5rem 0; }
.adaptive-settings small { font-size: .875rem; line-height: 1.5; }

.learning-buttons, .exam-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin: .75rem 0; }
.learning-buttons button, .exam-tools button, .learning-progress button { padding: .65rem .9rem; border: 1px solid #b4c9ed; border-radius: 8px; background: #f1f6ff; color: #172d50; font: inherit; cursor: pointer; }
.learning-buttons button:disabled { opacity: .55; cursor: not-allowed; }
.learning-panel, .learning-progress { padding: 1.1rem; margin: 1rem 0; border: 1px solid #b4c9ed; border-radius: 12px; background: #f5f8ff; font-size: 1rem; line-height: 1.6; }
.learning-panel[hidden], .learning-buttons button[hidden], .exam-tools button[hidden] { display: none; }
.learning-panel h4 { font-size: 1.1rem; margin: 0 0 .5rem; }
.flashcard { display: block; width: 100%; min-height: 130px; padding: 1.5rem; border: 2px solid #2864dc; border-radius: 12px; background: white; color: #172d50; font: inherit; text-align: left; cursor: pointer; }
.learning-progress summary { cursor: pointer; font-weight: 700; }
.learning-table-wrap { overflow-x: auto; }
.learning-progress table { width: 100%; border-collapse: collapse; text-align: left; }
.learning-progress th, .learning-progress td { padding: .7rem; border-bottom: 1px solid #d5dfec; font-size: .875rem; }
.diagram-inputs { display: flex; flex-wrap: wrap; gap: 1rem; }
.diagram-inputs label { display: grid; gap: .35rem; }
#diagramCanvas svg { display: block; width: min(100%, 360px); margin: 1rem auto; }
#examClock { font-weight: 700; font-variant-numeric: tabular-nums; }

.site-contact-footer { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; max-width: 1400px; margin: 2rem auto 0; padding: 2rem 1.5rem; border-top: 1px solid #d5dfec; color: #172d50; font-size: 1rem; line-height: 1.6; }
.site-contact-footer h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
.site-contact-footer p { margin: .5rem 0; }
.site-contact-footer a { color: #2054be; text-decoration: underline; overflow-wrap: anywhere; }
.site-contact-footer .operator { font-size: .875rem; }
@media (max-width: 760px) { .site-contact-footer { grid-template-columns: 1fr; gap: 1.25rem; } }
