:root {
  --navy: #172554;
  --navy-2: #1e3a8a;
  --teal: #0f8f8a;
  --teal-light: #ccfbf1;
  --gold: #f4b942;
  --gold-light: #fff6d8;
  --ink: #17213d;
  --muted: #5e6b86;
  --line: #d8e2f0;
  --paper: #ffffff;
  --canvas: #f4f7fb;
  --success: #087857;
  --success-bg: #e9fbf3;
  --error: #b4233c;
  --error-bg: #fff0f2;
  --shadow: 0 18px 44px rgba(23, 37, 84, .09);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
button, input, select { font: inherit; }
button { cursor: pointer; }

.skip-link {
  position: fixed;
  top: .5rem;
  left: .5rem;
  z-index: 100;
  transform: translateY(-160%);
  padding: .65rem 1rem;
  border-radius: .5rem;
  color: white;
  background: var(--navy);
}
.skip-link:focus { transform: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(300px, 520px) auto;
  gap: 2rem;
  align-items: center;
  min-height: 92px;
  padding: 1rem 2rem;
  color: white;
  background: var(--navy);
  box-shadow: 0 8px 30px rgba(14, 27, 67, .18);
}
.brand { display: flex; align-items: center; gap: .9rem; }
.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 16px;
  color: var(--navy);
  background: var(--gold);
  font: 800 1.75rem/1 Georgia, serif;
  transform: rotate(-3deg);
}
.brand h1 { margin: .05rem 0 0; font-size: 1.25rem; line-height: 1.2; }
.eyebrow { margin: 0; color: #99f6e4; font-size: .75rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.progress-copy { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .45rem; color: #e0e7ff; font-size: .875rem; }
.progress-copy strong { color: white; }
.progress-track { height: 10px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.18); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2dd4bf, #fbbf24); transition: width .45s ease; }

.outline-button, .primary-button, .danger-button, .next-button, .text-button {
  min-height: 46px;
  padding: .68rem 1rem;
  border-radius: 12px;
  border: 1px solid #bccbe0;
  font-weight: 750;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}
.outline-button { color: var(--navy); background: white; }
.topbar .outline-button { border-color: rgba(255,255,255,.38); color: white; background: rgba(255,255,255,.08); }
.primary-button, .next-button { border-color: var(--navy); color: white; background: var(--navy); }
.danger-button { border-color: #d83854; color: white; background: #b4233c; }
.text-button { border-color: transparent; color: var(--teal); background: transparent; }
button:hover { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(23,37,84,.12); }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #f4b942; outline-offset: 3px; }

.app-shell { display: grid; grid-template-columns: 310px minmax(0, 1fr); min-height: calc(100vh - 92px); }
.course-rail {
  position: sticky;
  top: 92px;
  height: calc(100vh - 92px);
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #edf3fa;
}
.rail-heading { padding: 1.35rem 1.25rem .9rem; border-bottom: 1px solid var(--line); }
.rail-heading span { display: block; color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.rail-heading strong { font-size: 1.05rem; }
.nav-group-title { margin: 1.1rem 1rem .4rem; color: var(--teal); font-size: .72rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.checkpoint-link {
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) 20px;
  gap: .7rem;
  align-items: center;
  width: 100%;
  padding: .7rem 1rem;
  border: 0;
  border-left: 4px solid transparent;
  text-align: left;
  color: var(--ink);
  background: transparent;
}
.checkpoint-link:hover { background: white; box-shadow: none; transform: none; }
.checkpoint-link.active { border-left-color: var(--gold); background: white; }
.checkpoint-link .nav-number { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid #b9c8dc; border-radius: 10px; color: var(--navy); background: white; font-weight: 800; }
.checkpoint-link.active .nav-number { border-color: var(--navy); color: white; background: var(--navy); }
.checkpoint-link .nav-copy { min-width: 0; font-size: .9rem; font-weight: 680; line-height: 1.25; }
.nav-check { color: var(--success); font-weight: 900; opacity: 0; }
.checkpoint-link.complete .nav-check { opacity: 1; }
.mobile-course-nav { display: none; }

main { width: min(1100px, calc(100% - 3rem)); margin: 0 auto; padding: 2.6rem 0 4rem; }
.lesson-heading { display: flex; justify-content: space-between; gap: 2rem; align-items: flex-start; margin-bottom: 1.25rem; }
.lesson-kicker { margin: 0 0 .3rem; color: var(--teal); font-size: .78rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.lesson-heading h2 { margin: 0; color: var(--navy); font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.12; letter-spacing: -.035em; }
.lesson-goal { max-width: 760px; margin: .65rem 0 0; color: var(--muted); font-size: 1.05rem; }
.lesson-status { flex: 0 0 auto; padding: .38rem .75rem; border: 1px solid #cbd7e7; border-radius: 999px; color: var(--muted); background: white; font-size: .82rem; font-weight: 800; }
.lesson-status.complete { border-color: #9fdcc5; color: var(--success); background: var(--success-bg); }

.sandwich-map { display: grid; grid-template-columns: 1fr 60px 1fr 60px 1fr; align-items: center; margin: 1.6rem 0; }
.map-step { display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; column-gap: .7rem; padding: .8rem; border: 1px solid var(--line); border-radius: 16px; text-align: left; color: var(--ink); background: white; }
.map-step span { grid-row: 1 / 3; display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; color: white; background: var(--teal); font-weight: 900; }
.map-step strong { line-height: 1.2; }
.map-step small { color: var(--muted); }
.map-step.active { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(244,185,66,.16); }
.map-line { height: 2px; background: #cbd7e7; }

.learning-card { scroll-margin-top: 112px; margin: 1.25rem 0; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); }
.demo-card { border-top: 5px solid var(--gold); }
.guided-card { border-top: 5px solid var(--teal); }
.solo-card { border-top: 5px solid var(--navy); }
.card-label { display: flex; gap: .85rem; align-items: center; padding: 1.2rem 1.4rem; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, #f8fbff, white); }
.card-label p { margin: 0; color: var(--teal); font-size: .74rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.card-label h3 { margin: .05rem 0 0; color: var(--navy); font-size: 1.12rem; }
.step-badge { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; color: white; background: var(--navy); font-weight: 900; }
.demo-card .step-badge { color: var(--navy); background: var(--gold); }
.guided-card .step-badge { background: var(--teal); }
.demo-content, #guidedContent, #soloContent { padding: 1.55rem; }

.example-stage { display: grid; grid-template-columns: minmax(240px, .9fr) minmax(0, 1.4fr); gap: 1.5rem; align-items: center; }
.visual-panel { display: grid; place-items: center; min-height: 210px; padding: 1.25rem; border-radius: 18px; background-color: #f7faff; background-image: linear-gradient(#e4ebf5 1px, transparent 1px), linear-gradient(90deg, #e4ebf5 1px, transparent 1px); background-size: 28px 28px; }
.thinking-panel h4 { margin: 0 0 .7rem; color: var(--navy); font-size: 1.2rem; }
.thinking-panel p { margin: .55rem 0; }
.rule-box { margin-top: 1rem; padding: .9rem 1rem; border-left: 5px solid var(--gold); border-radius: 0 14px 14px 0; background: var(--gold-light); }
.rule-box strong { color: var(--navy); }
.reason-box { margin-top: 1rem; padding: .85rem 1rem; border: 1px solid #b8e4dd; border-radius: 14px; color: #075e59; background: #effcf9; }
.steps { counter-reset: step; display: grid; gap: .65rem; margin: .9rem 0 0; padding: 0; list-style: none; }
.steps li { position: relative; min-height: 34px; padding-left: 44px; }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; color: white; background: var(--teal); font-weight: 850; }

.hundred-grid { display: grid; grid-template-columns: repeat(10, 18px); gap: 3px; padding: 10px; border: 2px solid var(--navy); border-radius: 10px; background: white; }
.hundred-grid span { width: 18px; height: 18px; border-radius: 3px; background: #e6ecf5; }
.hundred-grid span.filled { background: var(--gold); }
.hundred-grid span.half-filled { background: linear-gradient(90deg, var(--gold) 0 50%, #e6ecf5 50% 100%); }
.grid-caption { margin-top: .65rem; text-align: center; color: var(--navy); font-weight: 850; }
.make-percentage { margin-top: 1.5rem; padding: 1.25rem; border: 2px solid #b8e4dd; border-radius: 18px; background: #f3fffc; }
.make-percentage-copy { text-align: center; }
.make-percentage-copy h4 { margin: .15rem 0 .25rem; color: var(--navy); font-size: 1.2rem; }
.make-percentage-copy p:last-child { margin: .25rem 0 1rem; color: var(--muted); }
.mini-label { margin: 0; color: var(--teal); font-size: .74rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.make-percentage-workspace { display: grid; grid-template-columns: auto minmax(220px, 1fr); gap: 1.5rem; align-items: center; justify-content: center; max-width: 680px; margin: 0 auto; }
.interactive-hundred-grid { display: grid; grid-template-columns: repeat(10, 22px); gap: 4px; padding: 12px; border: 2px solid var(--navy); border-radius: 12px; background: white; }
.interactive-grid-cell { width: 22px; height: 22px; padding: 0; border: 1px solid #c8d3e3; border-radius: 4px; background: #e6ecf5; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.interactive-grid-cell:hover { transform: scale(1.08); border-color: var(--teal); box-shadow: none; }
.interactive-grid-cell:focus-visible { position: relative; z-index: 1; outline-width: 2px; outline-offset: 1px; }
.interactive-grid-cell.selected { border-color: #d99a20; background: var(--gold); }
.live-percentage-result { display: grid; justify-items: center; gap: .65rem; padding: 1rem; border: 1px solid var(--line); border-radius: 16px; text-align: center; background: white; }
.selected-count { color: var(--teal); font-weight: 800; }
.live-equation { display: flex; align-items: center; gap: .7rem; color: var(--navy); font-size: 1.7rem; font-weight: 900; }
.live-percentage-result p { max-width: 310px; margin: 0; color: var(--muted); font-size: .9rem; }
.clear-grid-button { min-height: 42px; padding: .45rem .85rem; }
.clear-grid-button:disabled { cursor: default; opacity: .45; transform: none; box-shadow: none; }
.percent-grid-visual { display: grid; justify-items: center; }
.grid-legend, .grid-key { display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem 1rem; margin-top: .65rem; color: var(--muted); font-size: .88rem; font-weight: 700; }
.grid-legend span, .grid-key i { display: inline-block; width: 18px; height: 18px; margin-right: .3rem; border-radius: 4px; vertical-align: -3px; }
.legend-full, .known-key { background: var(--gold); }
.legend-half { background: linear-gradient(90deg, var(--gold) 0 50%, #e6ecf5 50% 100%); }
.unknown-key { border: 1px solid #c8d3e3; background: #e6ecf5; }
.complement-grid-wrap { display: grid; justify-items: center; margin-bottom: 1rem; }
.interactive-reduction { display: grid; justify-items: center; gap: 1rem; width: 100%; }
.reduce-button { min-height: 48px; padding: .7rem 1rem; border: 0; border-radius: 12px; color: white; background: var(--teal); font-weight: 800; }
.reduce-button:disabled { cursor: default; opacity: .78; }
.reducible-fraction { position: relative; transition: opacity .25s ease; }
.reducible-fraction.cancelled { opacity: .55; }
.reducible-fraction.cancelled .fraction > span { text-decoration: line-through 3px #c52b47; text-decoration-skip-ink: none; }
.reduced-result { padding: .8rem 1rem; border: 1px solid #9edbc7; border-radius: 13px; color: var(--success); background: var(--success-bg); font-size: 1.35rem; font-weight: 800; animation: result-pop .3s ease both; }
@keyframes result-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.deduction-demo { display: grid; justify-items: center; gap: .8rem; }
.deduction-label { color: var(--navy); font-weight: 850; }
.deduction-equation { font-size: clamp(1.3rem, 3vw, 2rem); }
#deductionGrid span.deducted { animation: deduct-square .36s ease var(--delay) forwards; }
@keyframes deduct-square { to { opacity: .18; transform: scale(.55); background: #d8e1ee; } }
.percentage-proof-chain { display: grid; gap: .7rem; justify-items: center; color: var(--navy); font-size: clamp(1.25rem, 3vw, 2rem); font-weight: 900; }
.percentage-proof-chain > div { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; justify-content: center; }
.identity-proof { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; margin-top: 1rem; padding: .8rem 1rem; border: 1px solid #b8e4dd; border-radius: 14px; color: #075e59; background: #effcf9; font-weight: 800; }
.cancel-operation { text-decoration: line-through 3px #c52b47; text-decoration-skip-ink: none; }
.battery { position: relative; width: min(300px, 85%); height: 100px; padding: 8px; border: 6px solid var(--navy); border-radius: 15px; background: white; }
.battery::after { content: ""; position: absolute; right: -19px; top: 28px; width: 13px; height: 34px; border-radius: 0 6px 6px 0; background: var(--navy); }
.battery-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #2dd4bf, #0f8f8a); }
.battery-label { margin-top: .6rem; color: var(--navy); font-size: 1.35rem; font-weight: 900; }
.fraction { display: inline-grid; grid-template-rows: auto auto; min-width: 2.25em; vertical-align: middle; text-align: center; line-height: 1.15; }
.fraction > span:first-child { padding: 0 .2em .12em; border-bottom: 2px solid currentColor; }
.fraction > span:last-child { padding: .12em .2em 0; }
.math-display { color: var(--navy); font-family: "Trebuchet MS", ui-sans-serif, sans-serif; font-size: clamp(1.65rem, 4vw, 2.7rem); font-weight: 900; letter-spacing: .01em; }
.math-chain { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; justify-content: center; }
.math-chip { padding: .45rem .65rem; border: 1px solid #cbd7e7; border-radius: 12px; background: white; }
.move-demo { display: grid; grid-template-columns: repeat(5, 44px); justify-content: center; gap: 4px; }
.digit-cell { display: grid; min-height: 58px; place-items: center; border-bottom: 3px solid #cad6e7; color: var(--navy); font-size: 2rem; font-weight: 900; }
.digit-cell.point { color: var(--gold); }
.arrow-note { margin-top: .7rem; color: var(--teal); text-align: center; font-weight: 800; }

.question-title { margin: 0 0 .8rem; color: var(--navy); font-size: 1.18rem; }
.question-note { margin: -.4rem 0 1rem; color: var(--muted); }
.guided-question-block + .guided-question-block { margin-top: 1.4rem; padding-top: 1.35rem; border-top: 2px dashed #cbd7e7; }
.guided-count { margin: 0 0 .45rem; color: var(--teal); font-size: .74rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.question-workspace { padding: 1.1rem; border: 1px solid #dfe7f2; border-radius: 17px; background-color: #f8fbff; background-image: linear-gradient(#e9eef6 1px, transparent 1px), linear-gradient(90deg, #e9eef6 1px, transparent 1px); background-size: 30px 30px; }
.equation-line { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: center; margin: .55rem 0; color: var(--navy); font-family: "Trebuchet MS", ui-sans-serif, sans-serif; font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 850; }
.fraction-equation { flex-wrap: nowrap; justify-content: flex-start; min-width: min-content; overflow-x: auto; padding: .4rem .2rem .8rem; }
.fraction-equation > span { flex: 0 0 auto; }
.fraction-equation .fraction { align-self: center; }
.answer-input { width: 98px; min-height: 54px; padding: .55rem .7rem; border: 2px solid #9fb0c8; border-bottom-color: var(--teal); border-radius: 11px; text-align: center; color: var(--navy); background: white; font-weight: 850; }
.answer-input.wide { width: 150px; }
.answer-input.correct { border-color: #15956e; color: #087857; background: #effaf6; }
.answer-input.incorrect { border-color: #d83854; color: #a61431; background: #fff4f5; }
.fraction-input { display: inline-grid; grid-template-rows: auto auto; gap: 5px; vertical-align: middle; }
.fraction-input .answer-input { width: 92px; min-height: 48px; }
.fraction-input .answer-input:first-child { border-bottom: 2px solid var(--navy); border-radius: 10px 10px 2px 2px; }
.fraction-input .answer-input:last-child { border-radius: 2px 2px 10px 10px; }
.button-row { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .75rem; padding: 0 1.55rem 1.35rem; }
.feedback { display: none; margin: 0 1.55rem 1.5rem; padding: .9rem 1rem; border-radius: 13px; font-weight: 650; }
.feedback.show { display: block; }
.feedback.success { color: var(--success); background: var(--success-bg); }
.feedback.error { color: var(--error); background: var(--error-bg); }
.feedback.hint { color: #725006; background: var(--gold-light); }

.checkpoint-complete { display: flex; gap: 1rem; align-items: center; margin: 1.4rem 0; padding: 1.2rem 1.4rem; border: 1px solid #9fdcc5; border-radius: 18px; background: var(--success-bg); }
.complete-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 50%; color: white; background: var(--success); font-size: 1.45rem; font-weight: 900; }
.checkpoint-complete p { margin: 0; color: var(--success); font-size: .76rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.checkpoint-complete h3 { margin: .05rem 0 0; color: #075f47; }
.consolidation-card { border-top: 5px solid var(--gold); }
.consolidation-card .step-badge { color: var(--navy); background: var(--gold); }
.consolidation-intro { display: flex; flex-wrap: wrap; gap: .45rem 1rem; align-items: center; margin: 1.25rem; padding: .9rem 1rem; border-radius: 14px; color: #604409; background: var(--gold-light); }
.consolidation-intro strong { color: var(--navy); }
.quiz-list { display: grid; gap: .75rem; padding: 0 1.25rem 1.25rem; }
.quiz-question { display: grid; grid-template-columns: 76px minmax(0,1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; }
.quiz-question.question-correct { border-color: #9fdcc5; }
.quiz-number { display: grid; align-content: center; justify-items: center; padding: .8rem .4rem; color: white; background: var(--navy); }
.quiz-question.question-correct .quiz-number { background: var(--success); }
.quiz-number span { font-size: 1.15rem; font-weight: 900; }
.quiz-number small { color: #c7d2fe; font-size: .68rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.quiz-question.question-correct .quiz-number small { color: #d6f7e9; }
.quiz-work { min-width: 0; padding: .7rem 1rem; background-color: #fbfdff; background-image: linear-gradient(#eef2f7 1px, transparent 1px), linear-gradient(90deg, #eef2f7 1px, transparent 1px); background-size: 28px 28px; }
.quiz-work .equation-line { justify-content: flex-start; margin: 0; }
.lesson-controls { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }

dialog { width: min(480px, calc(100% - 2rem)); padding: 0; border: 0; border-radius: 20px; box-shadow: 0 24px 80px rgba(23,37,84,.25); }
dialog::backdrop { background: rgba(16,24,56,.55); backdrop-filter: blur(3px); }
.dialog-card { padding: 1.5rem; }
.dialog-card h2 { margin-top: 0; color: var(--navy); }
.dialog-card .button-row { padding: .5rem 0 0; }

@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr minmax(260px, 380px); gap: 1rem; padding: .8rem 1rem; }
  .reset-button { display: none; }
  .app-shell { grid-template-columns: 240px minmax(0, 1fr); }
  .example-stage { grid-template-columns: 1fr; }
  .visual-panel { min-height: 190px; }
}

@media (max-width: 740px) {
  .topbar { position: relative; grid-template-columns: 1fr; min-height: 0; }
  .brand-mark { width: 44px; height: 44px; border-radius: 13px; }
  .brand h1 { font-size: 1.08rem; }
  .course-rail { display: none; }
  .mobile-course-nav { display: grid; gap: .35rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); background: white; }
  .mobile-course-nav label { color: var(--teal); font-size: .76rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
  .mobile-course-nav select { min-height: 46px; padding: .5rem .75rem; border: 1px solid #b8c7dc; border-radius: 11px; color: var(--navy); background: white; font-weight: 700; }
  .app-shell { display: block; min-height: 0; }
  main { width: min(100% - 1.2rem, 700px); padding: 1.4rem 0 3rem; }
  .lesson-heading { display: block; }
  .lesson-status { display: inline-block; margin-top: .8rem; }
  .sandwich-map { grid-template-columns: 1fr; gap: .5rem; }
  .map-line { display: none; }
  .map-step { min-height: 64px; }
  .card-label, .demo-content, #guidedContent, #soloContent { padding: 1rem; }
  .button-row { padding: 0 1rem 1rem; }
  .feedback { margin: 0 1rem 1.1rem; }
  .hundred-grid { grid-template-columns: repeat(10, 14px); }
  .hundred-grid span { width: 14px; height: 14px; }
  .make-percentage { padding: 1rem .65rem; }
  .make-percentage-workspace { grid-template-columns: 1fr; justify-items: center; gap: 1rem; }
  .interactive-hundred-grid { grid-template-columns: repeat(10, 19px); gap: 3px; padding: 9px; }
  .interactive-grid-cell { width: 19px; height: 19px; }
  .live-percentage-result { width: min(100%, 320px); }
  .quiz-question { grid-template-columns: 58px minmax(0,1fr); }
  .quiz-work { padding: .6rem; }
  .quiz-work .equation-line { font-size: 1.08rem; }
  .lesson-controls { align-items: stretch; }
  .lesson-controls button { flex: 1; padding-inline: .55rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
