/* Equation Station SA — Learning Quality V3
   Shared layout for topic lessons, Mastery Banks and Mastery Tests.
   Goal: less reading friction, clearer visual hierarchy, smooth Learn → Practise → Test flow. */

:root{
  --lq-ink:#122235;
  --lq-blue:var(--es-blue-600,#1768b5);
  --lq-blue-2:var(--es-blue-800,#0f579d);
  --lq-teal:#18836f;
  --lq-amber:#b98512;
  --lq-red:#b94a3e;
  --lq-muted:#607181;
  --lq-line:#d9e3eb;
  --lq-soft:var(--es-gray-50,#f5f8fb);
  --lq-paper:var(--es-white,#fff);
  --lq-shadow:0 10px 28px rgba(18,34,53,.07);
  --lq-radius:var(--es-radius-panel,16px);
}

/* ──────────────────────────────────────────────────────────
   TOPIC PAGES
   ────────────────────────────────────────────────────────── */

.topic-main-col{min-width:0}
.embed-wrap{scroll-margin-top:118px}
.embed-box{border-radius:18px!important;overflow:hidden!important;border:1px solid var(--lq-line)!important;box-shadow:var(--lq-shadow)!important;background:#fff!important}
.embed-topbar{min-height:54px!important;padding:.72rem .9rem!important;background:#fff!important;border-bottom:1px solid var(--lq-line)!important}
.embed-topbar-label{font-size:.76rem!important;letter-spacing:.025em!important;color:var(--lq-ink)!important}
.embed-progress{height:4px!important;background:#edf2f6!important}
.embed-progress-fill{background:linear-gradient(90deg,var(--lq-blue),#5b9bdb)!important}
.embed-slide-area{background:#fbfcfe!important;scrollbar-gutter:stable;overscroll-behavior:contain}
.embed-controls{background:#fff!important;border-top:1px solid var(--lq-line)!important}
.embed-nav-btn,.enlarge-btn{border-radius:9px!important;font-weight:700!important}
.embed-counter{font-family:'IBM Plex Mono',ui-monospace,monospace!important;font-size:.73rem!important;color:var(--lq-muted)!important}

.slide{max-width:900px!important;margin-inline:auto!important}
.slide .sec-head{display:block!important}
.slide .sec-sub{font-size:.91rem!important;line-height:1.5!important}
.slide .card,.slide .fact-card,.slide .callout,.slide .quiz-card{box-shadow:none!important}
.slide .card+.card{margin-top:.75rem!important}
.slide .fact-grid{gap:.72rem!important}
.slide .fact-card{padding:.9rem 1rem!important}
.slide .fact-title{font-size:.84rem!important;margin-bottom:.4rem!important}
.slide .card-lbl{font-size:.67rem!important;letter-spacing:.06em!important}
.slide .card-example{background:#fff!important}

/* Long teacher-style explanation remains available, but does not dominate a slide. */
.es-long-copy{
  position:relative;
  max-height:6.6em;
  overflow:hidden;
  mask-image:linear-gradient(to bottom,#000 0%,#000 72%,transparent 100%);
  -webkit-mask-image:linear-gradient(to bottom,#000 0%,#000 72%,transparent 100%);
}
.es-long-copy.is-open{max-height:none;mask-image:none;-webkit-mask-image:none}
.es-more-toggle{
  display:inline-flex;align-items:center;gap:.35rem;
  margin:.25rem 0 .65rem;padding:.35rem .62rem;
  border:1px solid var(--lq-line);border-radius:999px;
  background:#fff;color:var(--lq-blue);font:700 .7rem/1.2 'IBM Plex Sans',system-ui,sans-serif;cursor:pointer
}
.es-more-toggle:hover{background:#eef5fb;border-color:#afc9df}

/* Compact source-backed topic map added above the guided deck. */
.es-topic-map{
  margin:0 0 1rem;
  border:1px solid var(--lq-line);border-radius:var(--lq-radius);
  background:linear-gradient(180deg,#fff,#fbfdff);box-shadow:var(--lq-shadow);overflow:hidden
}
.es-topic-map-head{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;padding:1rem 1.05rem .85rem;border-bottom:1px solid var(--lq-line)}
.es-topic-map-kicker{display:block;color:var(--lq-blue);font:800 .65rem/1.2 'IBM Plex Sans',system-ui,sans-serif;text-transform:uppercase;letter-spacing:.09em;margin-bottom:.2rem}
.es-topic-map h2{font-size:1.15rem!important;line-height:1.2!important;margin:0!important}
.es-topic-map-head p{margin:.28rem 0 0!important;color:var(--lq-muted)!important;font-size:.8rem!important}
.es-topic-map-grade{flex:none;padding:.35rem .55rem;border-radius:8px;background:#e8f2fb;color:var(--lq-blue);font:800 .68rem/1 'IBM Plex Mono',monospace}
.es-topic-map-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0}
.es-topic-map-col{padding:.9rem 1.05rem}
.es-topic-map-col:first-child{border-right:1px solid var(--lq-line)}
.es-topic-map-col h3{font-size:.76rem!important;text-transform:uppercase;letter-spacing:.065em;color:var(--lq-muted)!important;margin:0 0 .55rem!important}
.es-topic-map-list{list-style:none;padding:0;margin:0;display:grid;gap:.46rem}
.es-topic-map-list li{display:grid;grid-template-columns:18px 1fr;gap:.45rem;align-items:start;font-size:.82rem;line-height:1.43;color:var(--lq-ink)}
.es-topic-map-list li::before{content:'✓';display:grid;place-items:center;width:17px;height:17px;border-radius:50%;background:#e5f5ef;color:var(--lq-teal);font-size:.62rem;font-weight:900;margin-top:.08rem}
.es-topic-map-list.es-exam li::before{content:'→';background:#fff5d8;color:#8a650b}
.es-topic-map-source{padding:.65rem 1.05rem;border-top:1px solid var(--lq-line);background:#f8fbfd;color:var(--lq-muted);font-size:.68rem;line-height:1.4}

/* Original examples stay visible; extra source-aligned slides provide concise enrichment. */
.es-booster{margin:1.1rem 0 1.35rem;border:1px solid var(--lq-line);border-radius:var(--lq-radius);background:#fff;box-shadow:var(--lq-shadow);overflow:hidden}
.es-booster-head{display:flex;justify-content:space-between;align-items:center;gap:.8rem;padding:.8rem 1rem;border-bottom:1px solid var(--lq-line);background:#f9fbfd}
.es-booster-title{display:flex;align-items:center;gap:.55rem;font-size:.8rem;font-weight:800;color:var(--lq-ink)}
.es-booster-chip{display:inline-grid;place-items:center;width:28px;height:28px;border-radius:8px;background:var(--lq-blue);color:#fff;font:800 .62rem/1 'IBM Plex Mono',monospace}
.es-booster-count{font:700 .7rem/1 'IBM Plex Mono',monospace;color:var(--lq-muted)}
.es-booster-stage{min-height:340px;padding:1.1rem;background:linear-gradient(180deg,#fbfdff,#fff)}
.es-booster-slide{display:none;max-width:900px;margin:auto}
.es-booster-slide.is-active{display:block}
.es-booster-slide h3{font-size:1.2rem!important;margin:0 0 .35rem!important}
.es-booster-slide>.es-booster-lede{max-width:70ch;color:var(--lq-muted);font-size:.86rem;line-height:1.48;margin:0 0 .8rem}
.es-booster-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem}
.es-booster-card{padding:.78rem .82rem;border:1px solid var(--lq-line);border-radius:11px;background:#fff;font-size:.81rem;line-height:1.45}
.es-booster-card strong{display:block;color:var(--lq-ink);margin-bottom:.18rem}
.es-booster-steps{list-style:none;counter-reset:boost;margin:.5rem 0 0;padding:0;display:grid;gap:.5rem}
.es-booster-steps li{counter-increment:boost;display:grid;grid-template-columns:28px 1fr;gap:.55rem;align-items:start;font-size:.84rem;line-height:1.45}
.es-booster-steps li::before{content:counter(boost);display:grid;place-items:center;width:26px;height:26px;border-radius:8px;background:#e7f1fa;color:var(--lq-blue);font:800 .68rem/1 'IBM Plex Mono',monospace}
.es-booster-answer{margin-top:.75rem;padding:.72rem .8rem;border-left:4px solid var(--lq-teal);border-radius:0 9px 9px 0;background:#eef8f4;font-size:.84rem;line-height:1.45}
.es-booster-visual{margin-top:.7rem;border:1px solid var(--lq-line);border-radius:12px;background:#fff;padding:.7rem;overflow:hidden}
.es-booster-visual svg{display:block;width:100%;height:auto;max-width:660px;margin:auto}
.es-booster-visual figcaption{margin:.45rem auto 0!important;text-align:center;max-width:70ch;color:var(--lq-muted)!important;font-size:.74rem!important;line-height:1.4!important}
.es-booster-nav{display:flex;align-items:center;justify-content:space-between;gap:.7rem;padding:.7rem .85rem;border-top:1px solid var(--lq-line);background:#fff}
.es-booster-btn{border:1px solid var(--lq-line);border-radius:9px;background:#fff;color:var(--lq-ink);padding:.55rem .75rem;font-weight:750;font-size:.75rem;cursor:pointer}
.es-booster-btn:hover:not(:disabled){border-color:#a8c3db;background:#f1f7fb;color:var(--lq-blue)}
.es-booster-btn:disabled{opacity:.4;cursor:default}
.es-booster-dots{display:flex;gap:.35rem;align-items:center;justify-content:center}
.es-booster-dot{width:7px;height:7px;border:0;border-radius:50%;background:#c9d4de;padding:0;cursor:pointer}
.es-booster-dot.is-active{width:20px;border-radius:999px;background:var(--lq-blue)}

/* Resource bar: official/open tools, not random link dumping. */
.es-learning-tools{margin:.75rem 0 1.2rem;display:flex;align-items:center;gap:.55rem;flex-wrap:wrap}
.es-learning-tools>span{font-size:.7rem;font-weight:800;text-transform:uppercase;letter-spacing:.065em;color:var(--lq-muted)}
.es-learning-tools a{display:inline-flex;align-items:center;gap:.32rem;padding:.42rem .62rem;border:1px solid var(--lq-line);border-radius:999px;background:#fff;color:var(--lq-blue);font-size:.72rem;font-weight:700;text-decoration:none}
.es-learning-tools a:hover{background:#eef5fb;border-color:#a9c4dc}

/* ──────────────────────────────────────────────────────────
   MASTERY BANKS
   ────────────────────────────────────────────────────────── */

body:has(.level-section) .page{max-width:1020px!important;margin-inline:auto!important;padding-inline:clamp(1rem,3vw,1.6rem)!important}
body:has(.level-section) .hero-inner,
body:has(.level-section) .stats-inner{max-width:1020px!important}
body:has(.level-section) .hero{padding-top:3.2rem!important;padding-bottom:2.5rem!important}
body:has(.level-section) .hero h1{font-size:clamp(2rem,5vw,3rem)!important}
body:has(.level-section) .hero-sub{font-size:.94rem!important;line-height:1.55!important;max-width:720px!important}
body:has(.level-section) .stats{background:#102033!important}
body:has(.level-section) .stat{padding:14px 0!important}
body:has(.level-section) .stat-val{font-size:1.35rem!important}
body:has(.level-section) .stat-lbl{font-size:.66rem!important}
body:has(.level-section) .how-card{padding:1rem 1.05rem!important;border-radius:14px!important;background:#f8fbfd!important;box-shadow:none!important}
body:has(.level-section) .how-card h2{font-size:1rem!important;margin-bottom:.45rem!important}
body:has(.level-section) .how-card ol{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.45rem 1.1rem;padding-left:1.1rem!important}
body:has(.level-section) .how-card li{font-size:.78rem!important;line-height:1.42!important}
body:has(.level-section) .jump{gap:.45rem!important;margin:1rem 0 1.35rem!important}
body:has(.level-section) .jump-btn{border-radius:10px!important;padding:.65rem .75rem!important}
body:has(.level-section) .level-section{margin-bottom:2rem!important;scroll-margin-top:130px}
body:has(.level-section) .level-header{border-radius:14px!important;margin-bottom:.8rem!important;padding:1rem!important}
body:has(.level-section) .lh-title{font-size:1.15rem!important}
body:has(.level-section) .lh-sub{font-size:.78rem!important;line-height:1.42!important;max-width:70ch}
body:has(.level-section) .q-grid{display:grid!important;grid-template-columns:1fr!important;gap:.75rem!important}
body:has(.level-section) .q-card{border-radius:14px!important;border:1px solid var(--lq-line)!important;box-shadow:0 6px 20px rgba(18,34,53,.045)!important;overflow:hidden!important}
body:has(.level-section) .q-card:hover{transform:none!important;box-shadow:0 8px 24px rgba(18,34,53,.07)!important}
body:has(.level-section) .q-card-top{padding:1rem 1.05rem!important}
body:has(.level-section) .q-meta{gap:.4rem!important;margin-bottom:.45rem!important}
body:has(.level-section) .q-num{font-size:.68rem!important}
body:has(.level-section) .q-source,body:has(.level-section) .q-marks{font-size:.64rem!important}
body:has(.level-section) .q-skills{margin-bottom:.4rem!important}
body:has(.level-section) .q-skill{font-size:.62rem!important;padding:.2rem .45rem!important}
body:has(.level-section) .q-title{font-size:1rem!important;line-height:1.25!important;margin-bottom:.45rem!important}
body:has(.level-section) .q-body{font-size:.9rem!important;line-height:1.5!important;max-width:82ch}
body:has(.level-section) .q-card-bottom{border-top:1px solid #e7edf2!important;background:#fbfcfd!important}
body:has(.level-section) .ans-toggle{min-height:40px!important;padding:.55rem 1rem!important;font-size:.74rem!important}
body:has(.level-section) .ans-body{padding:.85rem 1.05rem!important;background:#fff!important}
html.es-dark body:has(.level-section) .ans-body{background:#132030!important;border-color:rgba(255,255,255,.12)!important;color:#e3ebf3}
html.es-dark body:has(.level-section) .ans-toggle{background:#172431!important;color:#eaf1f7!important;border-color:rgba(255,255,255,.2)!important}
html.es-dark body:has(.level-section) .solution-body,html.es-dark body:has(.level-section) .steps li{color:#d7e1ec!important}
html.es-dark .fg-sketch figcaption{color:#c9d6e3!important;opacity:1!important}
body:has(.level-section) .ans-body p,body:has(.level-section) .ans-body li{font-size:.82rem!important;line-height:1.5!important;max-width:82ch}
body:has(.level-section) .ans-label{font-size:.63rem!important;letter-spacing:.07em!important}

/* Make cross-navigation useful and visible without stealing screen space. */
.notes-nav{position:sticky!important;top:72px!important;z-index:88!important;background:rgba(248,251,253,.96)!important;backdrop-filter:blur(12px);border-bottom:1px solid var(--lq-line)!important;padding:.48rem .75rem!important;box-shadow:0 5px 15px rgba(18,34,53,.04)}
.notes-nav-link{border-radius:8px!important;padding:.42rem .65rem!important;font-size:.71rem!important;border-color:var(--lq-line)!important;background:#fff!important;color:var(--lq-ink)!important}
.notes-nav-link:hover{background:#eef5fb!important;color:var(--lq-blue)!important;border-color:#aac4da!important}
.notes-nav-link.active{background:var(--lq-blue)!important;color:#fff!important;border-color:var(--lq-blue)!important}
.back-to-topic{padding:.42rem .75rem!important;background:#fff!important;border-bottom:1px solid var(--lq-line)!important}
.back-to-topic a{font-size:.7rem!important;color:var(--lq-blue)!important}

/* Bank mastery tracker (in the page source; wired by JS). */
.es-bank-progress{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin:0 0 1rem;padding:.78rem .9rem;border:1px solid var(--lq-line);border-radius:12px;background:#fff;box-shadow:0 5px 16px rgba(18,34,53,.04)}
.es-bank-progress-copy strong{display:block;font-size:.82rem;color:var(--lq-ink)}
.es-bank-progress-copy span{display:block;margin-top:.12rem;font-size:.7rem;color:var(--lq-muted)}
.es-bank-progress-actions{display:flex;align-items:center;gap:.45rem;flex-wrap:wrap;justify-content:flex-end}
.es-bank-progress-value{font:800 .73rem/1 'IBM Plex Mono',monospace;color:var(--lq-blue);padding:.42rem .55rem;border-radius:8px;background:#e8f2fb}
.es-bank-filter{border:1px solid var(--lq-line);border-radius:8px;background:#fff;color:var(--lq-ink);padding:.42rem .55rem;font-weight:700;font-size:.69rem;cursor:pointer}
.es-mastered-btn{display:inline-flex;align-items:center;gap:.35rem;margin-left:auto;border:1px solid var(--lq-line);border-radius:999px;background:#fff;color:var(--lq-muted);padding:.28rem .55rem;font-size:.66rem;font-weight:800;cursor:pointer}
.es-mastered-btn:hover{border-color:#a7c8b9;color:var(--lq-teal);background:#f1f9f6}
.es-mastered-btn.is-mastered{background:#e9f7f1;border-color:#b6ddca;color:var(--lq-teal)}
.q-card.es-mastered{border-color:#b9dcca!important;background:linear-gradient(180deg,#fff,#fbfffd)!important}
.q-card.es-hidden-solved{display:none!important}
.es-bank-official-note{margin:-.2rem 0 1rem;padding:.62rem .78rem;border-left:4px solid var(--lq-amber);border-radius:0 9px 9px 0;background:#fff9e9;color:#6e591c;font-size:.7rem;line-height:1.42}
/* Spaced review (2, 7, 21 days) of mastered bank questions. The tracker controls are in the page source; badges sit on the mastered-button line. */
.es-bank-due{min-width:8.6em;text-align:center;font:700 .69rem/1 'IBM Plex Sans',system-ui,sans-serif;color:var(--lq-muted);padding:.42rem .55rem;border-radius:8px;background:#f2f5f8;font-variant-numeric:tabular-nums}
.es-bank-due.is-due{color:#7a5300;background:#fff3d6}
.es-bank-due-first{border:1px solid var(--lq-line);border-radius:8px;background:#fff;color:var(--lq-ink);padding:.42rem .55rem;font-weight:700;font-size:.69rem;cursor:pointer}
.es-bank-due-first[aria-pressed="true"]{background:#eef5fb;border-color:#aac4da;color:var(--lq-blue)}
.es-bank-due-first:disabled{opacity:.5;cursor:default}
.es-bank-filter,.es-bank-due-first,.es-review-badge,.es-review-choices button{font-family:inherit}
@media(min-width:761px){.es-bank-progress-copy{flex:1 1 0;min-width:0}.es-bank-progress-actions{flex:0 0 auto}}
.es-review-badge{display:inline-flex;align-items:center;margin-left:.35rem;border:1px solid #edd08a;border-radius:999px;background:#fff3d6;color:#7a5300;padding:.28rem .55rem;font-size:.66rem;font-weight:800;cursor:pointer;vertical-align:middle}
.es-review-badge:hover,.es-review-badge[aria-expanded="true"]{background:#ffe8b0}
.q-card.es-review-due{border-color:#edd08a!important;background:linear-gradient(180deg,#fff,#fffcf3)!important}
.es-review-panel{display:flex;flex-wrap:wrap;align-items:center;gap:.45rem .6rem;margin:.55rem 0 .2rem;padding:.55rem .65rem;border:1px solid #edd08a;border-radius:10px;background:#fffaf0;font-size:.72rem;color:var(--lq-ink)}
.es-review-panel.is-done{border-color:#b6ddca;background:#f1f9f6;color:#145c49}
.es-review-ask{flex:1 1 14rem;line-height:1.4}
.es-review-choices{display:flex;gap:.4rem;flex-wrap:wrap}
.es-review-choices button{border:1px solid var(--lq-line);border-radius:8px;background:#fff;color:var(--lq-ink);padding:.4rem .6rem;font-size:.7rem;font-weight:800;cursor:pointer}
.es-review-choices .es-review-yes{border-color:#b6ddca;color:var(--lq-teal)}
.es-review-choices .es-review-no{border-color:#e7c3bd;color:#9b3324}
.es-review-choices .es-review-yes:hover{background:#e9f7f1}.es-review-choices .es-review-no:hover{background:#fdf0ee}
.es-due-group{margin:0 0 1.2rem;padding:.8rem;border:1px solid #edd08a;border-radius:14px;background:#fffcf3}
.es-due-group-head{margin:0 0 .7rem}.es-due-group-head strong{display:block;font-size:.9rem;color:var(--lq-ink)}.es-due-group-head span{font-size:.72rem;color:var(--lq-muted)}
.es-due-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,22rem),1fr));gap:14px}
body:has(.level-section) .q-card{scroll-margin-top:140px}
.q-card.es-review-target{outline:2px solid #e2b54a;outline-offset:3px}
html.es-dark .es-bank-due{background:#1d2a37!important;color:#aebdca!important}
html.es-dark .es-bank-due.is-due,html.es-dark .es-review-badge{background:#3a2e12!important;border-color:#6e5520!important;color:#ffd98a!important}
html.es-dark .es-bank-due-first,html.es-dark .es-review-choices button{background:#172431!important;border-color:rgba(255,255,255,.14)!important;color:#e3ebf3!important}
html.es-dark .q-card.es-review-due{background:#262113!important;border-color:#6e5520!important}
html.es-dark .es-review-panel,html.es-dark .es-due-group{background:#211d12!important;border-color:#6e5520!important;color:#eaf1f7!important}
html.es-dark .es-review-panel.is-done{background:#15261f!important;border-color:#285d46!important;color:#bfe8d6!important}
html.es-dark .es-due-group-head strong{color:#f0f5fa!important}html.es-dark .es-due-group-head span{color:#aebdca!important}

/* ──────────────────────────────────────────────────────────
   MASTERY TESTS
   ────────────────────────────────────────────────────────── */

body:has(.question-card) .page{max-width:900px!important;margin-inline:auto!important;padding-inline:clamp(1rem,3vw,1.5rem)!important}
body:has(.question-card) .hero{padding-top:2.8rem!important;padding-bottom:2rem!important}
body:has(.question-card) .hero-inner{max-width:900px!important}
body:has(.question-card) .hero h1{font-size:clamp(1.9rem,5vw,2.75rem)!important}
body:has(.question-card) .question-card{border-radius:16px!important;border:1px solid var(--lq-line)!important;box-shadow:var(--lq-shadow)!important;padding:clamp(1rem,3vw,1.35rem)!important}
body:has(.question-card) .question-text,body:has(.question-card) .q-text{font-size:.94rem!important;line-height:1.52!important;max-width:78ch}
body:has(.question-card) .option{border-radius:10px!important;padding:.72rem .82rem!important;font-size:.86rem!important;line-height:1.42!important}
body:has(.question-card) .btn-nav,body:has(.question-card) .btn-primary,body:has(.question-card) .btn-outline{border-radius:10px!important;text-transform:none!important}
body:has(.question-card) .level-legend{gap:.5rem!important}
body:has(.question-card) .legend-item{border-radius:9px!important;padding:.6rem!important}
body:has(.question-card) .start-card{border-radius:16px!important;box-shadow:var(--lq-shadow)!important}
body:has(.question-card) .start-card p,body:has(.question-card) .start-card li{font-size:.82rem!important;line-height:1.48!important}
body:has(.question-card) .results-hero,body:has(.question-card) .recommendation,body:has(.question-card) .result-links{border-radius:14px!important}

.es-test-conditions{margin:0 0 1rem;padding:.78rem .9rem;border:1px solid var(--lq-line);border-radius:12px;background:#f8fbfd}
.es-test-conditions strong{display:block;font-size:.8rem;margin-bottom:.35rem;color:var(--lq-ink)}
.es-test-conditions ul{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.3rem 1rem;margin:0;padding-left:1rem}
.es-test-conditions li{font-size:.72rem;line-height:1.4;color:var(--lq-muted)}

/* ──────────────────────────────────────────────────────────
   RESPONSIVE + DARK
   ────────────────────────────────────────────────────────── */

@media(max-width:760px){
  .es-topic-map-grid,.es-booster-grid{grid-template-columns:1fr}
  .es-topic-map-col:first-child{border-right:0;border-bottom:1px solid var(--lq-line)}
  .es-booster-stage{min-height:380px;padding:.85rem}
  body:has(.level-section) .how-card ol{grid-template-columns:1fr}
  .notes-nav{top:64px!important;justify-content:flex-start!important;overflow-x:auto!important;flex-wrap:nowrap!important;scrollbar-width:none}
  .notes-nav::-webkit-scrollbar{display:none}
  .notes-nav-link{white-space:nowrap!important;flex:none}
  .es-bank-progress{align-items:flex-start;flex-direction:column}
  .es-bank-progress-actions{justify-content:flex-start}
  .es-test-conditions ul{grid-template-columns:1fr}
}

@media(max-width:520px){
  .embed-slide-area{height:min(76vh,620px)!important;padding:.85rem!important}
  .embed-topbar{align-items:flex-start!important;gap:.5rem!important}
  .enlarge-btn{padding:.45rem .55rem!important;font-size:.7rem!important}
  .es-topic-map-head{padding:.85rem}
  .es-topic-map-col{padding:.8rem .85rem}
  .es-topic-map-source{padding:.55rem .85rem}
  .es-booster-head{padding:.7rem .8rem}
  .es-booster-stage{padding:.75rem;min-height:410px}
  .es-booster-slide h3{font-size:1.05rem!important}
  .es-booster-nav{padding:.6rem .7rem}
  body:has(.level-section) .q-card-top{padding:.85rem!important}
  body:has(.level-section) .ans-body{padding:.8rem .85rem!important}
  body:has(.level-section) .stat:nth-child(n+3){display:none}
  body:has(.level-section) .stats-inner{grid-template-columns:repeat(2,1fr)!important}
}

html.es-dark .es-topic-map,
html.es-dark .es-topic-map-col,
html.es-dark .es-booster,
html.es-dark .es-booster-card,
html.es-dark .es-booster-visual,
html.es-dark .es-booster-nav,
html.es-dark .es-bank-progress,
html.es-dark .es-mastered-btn,
html.es-dark .es-test-conditions{background:#172431!important;border-color:rgba(255,255,255,.11)!important;color:#eaf1f7!important}
html.es-dark .es-topic-map h2,
html.es-dark .es-booster-slide h3,
html.es-dark .es-booster-card strong,
html.es-dark .es-bank-progress-copy strong,
html.es-dark .es-test-conditions strong{color:#f0f5fa!important}
html.es-dark .es-topic-map-head p,
html.es-dark .es-topic-map-col h3,
html.es-dark .es-topic-map-source,
html.es-dark .es-booster-lede,
html.es-dark .es-booster-visual figcaption,
html.es-dark .es-bank-progress-copy span,
html.es-dark .es-test-conditions li{color:#aebdca!important}
html.es-dark .es-topic-map-source{background:#121e29!important;border-color:rgba(255,255,255,.09)!important}
html.es-dark .es-more-toggle{background:#172431;color:#9fc9ef;border-color:rgba(255,255,255,.13)}
html.es-dark .q-card.es-mastered{background:#15261f!important;border-color:#285d46!important}

@media(prefers-reduced-motion:reduce){
  .es-booster-slide{animation:none!important}
}
/* Injected boxes must never become an extra column of the topic grid */
.topic-layout>.es-deepdive,.topic-layout>section:not(.topic-main-col){grid-column:1/-1}

/* Dark mode for the surfaces forced white above */
html.es-dark .embed-box,html.es-dark .embed-topbar,html.es-dark .embed-controls{background:#141f2b!important;border-color:rgba(255,255,255,.12)!important}
html.es-dark .slide .card-example{background:#182635!important;border-color:rgba(255,255,255,.12)!important}
html.es-dark .slide .card-example>p,html.es-dark .slide .card-lbl{color:#e3ebf3!important}
html.es-dark .notes-nav-link,html.es-dark .back-to-topic{background:#172431!important;color:#e3ebf3!important;border-color:rgba(255,255,255,.14)!important}
html.es-dark .content-block{background:#121d28!important;border-color:rgba(255,255,255,.1)!important}
/* In-slide mistake clinics: topic-styles.css also defines .mistake-card as a flex row, which squeezed the text to one word per line */
.slide .mistake-card{display:block!important}
/* Long working lines scroll inside their own box instead of pushing the slide sideways */
.slide .pbody .sb2{display:block;max-width:100%;overflow-x:auto;overflow-y:hidden}
.slide .fin-timeline-step{grid-template-columns:auto minmax(0,1fr)!important}
.slide .fin-timeline-step>*{min-width:0;overflow-x:auto;overflow-y:hidden}
/* Long inline formulas scroll inside their own width instead of pushing the slide sideways */
.slide p mjx-container[jax="CHTML"]:not([display="true"]),.slide li mjx-container[jax="CHTML"]:not([display="true"]),.slide td mjx-container[jax="CHTML"]:not([display="true"]){display:inline-block;max-width:100%;overflow-x:auto;overflow-y:hidden;vertical-align:middle}
@media(max-width:640px){.slide .checklist-grid{grid-template-columns:1fr!important}.slide .division-board{overflow-x:auto}.slide .synthetic-table{font-size:12px}}
/* Checklist lines: flex layout split text and maths into unwrappable pieces */
.slide .checkline{display:block!important}
.slide .checkline::before{float:left;margin:1px 9px 0 0;width:19px}
/* Phones: stack callout tag above its text, let tables shrink, let displayed formulas scroll in place */
@media(max-width:640px){.slide .callout{flex-direction:column!important;gap:6px}.slide .callout-body{width:100%;min-width:0}}
.slide .tw table{min-width:0!important}
.slide .math-display{max-width:100%;overflow-x:auto;overflow-y:hidden}
.slide .callout-body{flex:1 1 auto;min-width:0}
.slide .callout-body mjx-container[jax="CHTML"]:not([display="true"]){display:inline-block;max-width:100%;overflow-x:auto;overflow-y:hidden;vertical-align:middle}
/* Presentation mode: bigger slides on big screens and projectors */
@media (min-width:1200px){.embed-box:fullscreen .embed-slide-area .slide.active,.embed-box.es-fs-fallback .embed-slide-area .slide.active{zoom:1.2}}
@media (min-width:1600px){.embed-box:fullscreen .embed-slide-area .slide.active,.embed-box.es-fs-fallback .embed-slide-area .slide.active{zoom:1.35}}
.embed-box:fullscreen .embed-slide-area .slide{max-width:1100px}
/* Full screen / Minimise toggle: always visible, same look on every deck */
.embed-box .es-deck-toggle{display:inline-flex!important;align-items:center;gap:6px;padding:7px 13px!important;border-radius:999px!important;border:1px solid #145daa!important;background:#145daa!important;color:#fff!important;font-weight:700!important;font-size:12.5px!important;line-height:1!important;cursor:pointer;white-space:nowrap}
.embed-box .es-deck-toggle:hover{background:#0f4c8c!important}
.embed-box .es-deck-toggle svg{flex:0 0 auto;stroke:#fff}
.embed-box:fullscreen .es-deck-toggle,.embed-box.es-fs-fallback .es-deck-toggle{background:#1d2733!important;border-color:#1d2733!important}
html.es-dark .embed-box .es-deck-toggle{background:#68a1e7!important;border-color:#68a1e7!important;color:#0c121a!important}
html.es-dark .embed-box .es-deck-toggle svg{stroke:#0c121a}
.embed-box .es-deck-toggle{width:36px;height:36px;padding:0!important;justify-content:center;border-radius:10px!important}
.embed-box .es-deck-toggle svg{width:17px;height:17px}
.slide .routine-list li{flex-wrap:wrap}
.slide .routine-list li>*{min-width:0}
.slide .routine-list li>ul{flex:1 1 100%;margin:4px 0 0 36px;padding-left:18px}
.slide .routine-list li li{display:list-item!important;background:none!important;border:0!important;box-shadow:none!important;padding:0!important;margin:2px 0;font-size:13.5px;line-height:1.55}
.slide .routine-list li>ul{list-style:disc}
.slide .routine-list li>p{flex:1 1 0}
/* Lists inside question stems and slides */
.slide .card-example>ul,.slide .card-example>ol,.slide .sec-head+ul,.slide>ul,.slide>ol{padding-left:22px;margin:6px 0 10px}
.slide .card-example>ul li,.slide .card-example>ol li{margin:3px 0;line-height:1.55}
/* Real exam question source line */
.slide .exam-src{margin:2px 0 8px;font-size:12px;font-weight:700;letter-spacing:.02em;color:#145daa}
html.es-dark .slide .exam-src{color:#8fbcf0}
/* Mastery banks: long inline maths scrolls inside its own line on phones instead of spilling past the card */
.q-card .ans-body mjx-container[jax="CHTML"]:not([display="true"]),.q-card .q-body mjx-container[jax="CHTML"]:not([display="true"]){display:inline-block;max-width:100%;overflow-x:auto;overflow-y:hidden;vertical-align:middle}
/* Synthetic division table: fits or scrolls inside the slide on phones */
@media(max-width:640px){.slide .synthetic-table{display:block;min-width:0;max-width:100%;overflow-x:auto}.slide .synthetic-table td,.slide .synthetic-table th{padding:6px 7px;font-size:13px}}
