/* Approved MATH-SECTION-TEMPLATE/r1, scoped to the math route.
   The production header, font and scenery are shared with the main site. */
.math-section { --ink:#25324b; --muted:#536175; --teal:#176e64; --paper:#fff9ef; --line:#d9e1dd; --blue:#e7f2f9; font:18px/1.5 var(--font-ui); color:var(--ink); padding-block:0 0; }
.math-section .hero { max-width:none; padding:0; }
.math-section p + p { margin-top:0; }
.math-section .search-form label { margin:0; }
.math-section .small-note { margin-top:0; }
.page-math .site-footer { margin-top:56px; }
/* Keep the approved single navigation row below the logo on tablets. */
@media (max-width:900px) {
  .page-shell.page-math header.site-header { flex-wrap:wrap; }
  .page-math .site-header .main-nav { order:3; flex-basis:100%; margin-left:0; gap:25px; }
}
.math-section * {box-sizing:border-box}
.math-section button, .math-section input, .math-section select {font:inherit}
.math-section button, .math-section a, .math-section input, .math-section select {-webkit-tap-highlight-color:transparent}
.math-section button, .math-section a {touch-action:manipulation}
.math-section a {color:inherit;text-decoration:none}
.math-section button {cursor:pointer;color:inherit}
.math-section button:disabled {cursor:default}
.math-section img, .math-section svg {max-width:100%;display:block}
.math-section button {border:0}
.math-section p, .math-section h1, .math-section h2, .math-section h3 {margin:0}
.math-section h1, .math-section h2, .math-section h3 {line-height:1.16}
.math-section h1 {font-size:clamp(34px,4vw,50px);font-weight:900;letter-spacing:-.025em}
.math-section h2 {font-size:30px;font-weight:900}
.math-section h3 {font-size:23px;font-weight:850}
.math-section p {color:var(--muted)}
.math-section {width:min(1120px,calc(100% - 48px));margin-inline:auto}
.math-section :focus-visible {outline:3px solid #c5842b;outline-offset:5px;border-radius:10px}
.math-section .crumbs {display:flex;align-items:center;flex-wrap:wrap;gap:10px;font-size:15px;color:#637266;margin:8px 0 24px}
.math-section .crumbs a {font-weight:800;color:var(--teal)}
.math-section .crumbs span[aria-hidden] {color:#9daaa0}
.math-section .hero {display:grid;grid-template-columns:1fr 260px;gap:40px;align-items:center;margin:0 0 26px}
.math-section .eyebrow {display:inline-flex;align-items:center;gap:8px;font-size:15px;font-weight:850;color:#426b76;letter-spacing:.02em;margin-bottom:10px}
.math-section .eyebrow::before {content:"";width:8px;height:8px;border-radius:100%;background:#dfad51}
.math-section .hero h1 {margin-bottom:14px}
.math-section .hero p {max-width:640px;font-size:20px;line-height:1.5}
.math-section .hero-art {position:relative;height:184px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:radial-gradient(ellipse,#dfeef6 0%,#eaf2ee77 45%,transparent 72%)}
.math-section .hero-art img {width:245px;height:176px;object-fit:contain}
.math-section .grade {display:inline-block;padding:6px 13px;background:#dfebef;border:1px solid #d3e1e7;border-radius:12px;font-weight:850;font-size:16px;color:#385d71;margin-left:10px;vertical-align:middle}
.math-section .search-form {display:flex;align-items:center;gap:12px;background:#fffdfa;border:1.5px solid #cad9dc;border-radius:22px;padding:9px;box-shadow:0 8px 25px #394d6310;margin:25px 0 13px;max-width:820px}
.math-section .search-icon {width:23px;height:23px;margin-left:12px;border:2.5px solid #5c7081;border-radius:50%;position:relative;flex:none}
.math-section .search-icon::after {content:"";position:absolute;width:10px;height:2.5px;background:#5c7081;transform:rotate(45deg);right:-7px;bottom:-3px}
.math-section .search-form input {border:0;background:transparent;min-width:0;width:100%;padding:10px 13px;color:var(--ink);font-size:18px}
.math-section .search-form input:focus-visible {outline:0}
.math-section .search-form:focus-within {outline:3px solid #bcdaa9;outline-offset:3px}
.math-section .search-form button, .math-section .button {display:inline-flex;align-items:center;justify-content:center;gap:12px;background:var(--teal);color:white;padding:13px 24px;border-radius:15px;font-weight:850;min-height:50px;line-height:1.3}
.math-section .button.secondary {background:#edf3ed;color:var(--teal);border:1px solid #d4e1d2}
.math-section .button.soft {background:white;color:var(--teal);border:1px solid #d4ded6}
.math-section .search-examples {display:flex;flex-wrap:wrap;gap:9px;align-items:center;font-size:15px;margin-bottom:30px;color:var(--muted)}
.math-section .search-examples a {border-bottom:1px dashed #8da39a;color:var(--teal)}
.math-section .section-heading {display:flex;justify-content:space-between;gap:20px;align-items:baseline;margin:29px 0 20px}
.math-section .section-heading>p {font-size:16px}
.math-section .category-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
.math-section .topic-card {position:relative;border:1px solid #dde5df;border-radius:27px;background:#fffdfa;box-shadow:0 5px 15px #34445405;display:flex;flex-direction:column;overflow:hidden;isolation:isolate;transition:box-shadow .18s,border-color .18s}
.math-section .category-card {padding:15px 25px 23px;min-height:288px}
.math-section .topic-card::before {content:"";position:absolute;inset:0;background:linear-gradient(145deg,var(--tint,#e7f2f9),#fffefa 75%);z-index:-1}
.math-section .topic-card:focus-visible {border-color:#76a49e;box-shadow:0 0 0 2px #a6c7ba55,0 12px 30px #34526020}
.math-section .topic-card:focus-visible {outline:3px solid #c5842b;outline-offset:4px}
.math-section .card-art {height:132px;display:flex;justify-content:center;align-items:center;position:relative;flex:none}
.math-section .card-art::before {content:"";position:absolute;width:180px;height:100px;border-radius:50%;background:radial-gradient(ellipse,#fff9 0%,transparent 70%)}
.math-section .card-art :is(img,svg) {width:220px;height:146px;object-fit:contain;position:relative;transform-origin:50% 80%}
.math-section .category-card h2 {font-size:24px;line-height:1.18;font-weight:900;margin-top:9px;max-width:100%}
.math-section .card-foot {display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:16px;color:#58706d;margin-top:auto;padding-top:15px}
.math-section .arrow {width:35px;height:35px;display:flex;align-items:center;justify-content:center;flex:none;background:#fff8;border:1px solid #ccdcd277;border-radius:50%;font-size:23px;color:var(--teal)}
.math-section .small-note {font-size:16px;line-height:1.55}
.math-section .companion-note {display:flex;gap:22px;align-items:center;background:#edf2e6a3;border-radius:24px;padding:22px 30px;margin-top:27px;border:1px solid #e1e6d6}
.math-section .companion-note h3 {font-size:21px;margin-bottom:5px}
.math-section .companion-note .pair {display:flex;width:125px;height:105px;flex:none;align-items:end;justify-content:center}
.math-section .pair img {object-fit:contain;height:108px;width:62px;object-position:bottom}
.math-section .companion-note p {font-size:17px}
.math-section .section-switch {display:flex;gap:10px;flex-wrap:wrap;margin:22px 0 26px}
.math-section .section-switch a {border:1px solid #d7e1dd;border-radius:13px;padding:10px 14px;font-weight:750;font-size:15px;background:#fffaf4}
.math-section .section-switch a[aria-current] {background:#e1edf3;border-color:#b6ccdc;color:#325e78}
.math-section .material-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.math-section .material-card {padding:23px;display:grid;grid-template-columns:115px 1fr;column-gap:20px;min-height:210px;align-items:center}
.math-section .material-card .card-art {height:135px;grid-row:1/4}
.math-section .material-card .card-art :is(img,svg) {width:140px;height:140px}
.math-section .material-card .card-art::before {width:100px}
.math-section .format {display:block;font-size:14px;color:#667987;font-weight:800;margin-bottom:6px}
.math-section .material-card h2 {font-size:23px;line-height:1.25}
.math-section .material-card .card-foot {padding-top:13px;font-size:16px;color:var(--teal);font-weight:850}
.math-section .search-summary {margin:21px 0;font-size:18px}
.math-section .search-list {display:grid;gap:12px;max-width:900px}
.math-section .search-result {background:#fffdf9;border:1px solid #d8e2dc;border-radius:20px;padding:20px 23px;display:grid;grid-template-columns:1fr 34px;gap:7px 20px}
.math-section .search-result h2 {font-size:22px}
.math-section .search-result p {font-size:16px;grid-column:1}
.math-section .search-result .arrow {grid-column:2;grid-row:1/3;align-self:center}
.math-section .search-result .match {color:#426e7d}
.math-section .empty-state {padding:48px 30px;text-align:center;border:1px solid #dce5df;border-radius:28px;background:#fffdf8}
.math-section .empty-state img {width:160px;height:110px;object-fit:contain;margin:0 auto 18px}
.math-section .empty-state h2 {margin-bottom:13px}
.math-section .empty-state p {max-width:560px;margin:0 auto 23px}
.math-section .material-head {display:flex;align-items:start;justify-content:space-between;gap:25px;margin-bottom:26px}
.math-section .material-head .title-block {max-width:790px}
.math-section .material-head h1 {font-size:clamp(30px,3.5vw,44px);margin-top:5px}
.math-section .material-head .small-note {margin-top:13px}
.math-section .material-back {margin-bottom:18px;display:inline-flex;gap:10px;font-size:16px;font-weight:850;color:var(--teal)}
.math-section .workbench {border:1px solid #d5e0df;border-radius:30px;background:#fffefa;box-shadow:0 10px 35px #334b5f08;overflow:hidden}
.math-section .entry-nav {display:flex;flex-wrap:wrap;gap:10px;padding:20px 25px;background:#f0f5f5;border-bottom:1px solid #dbe5e4}
.math-section .entry-nav a {padding:10px 15px;border:1px solid transparent;border-radius:13px;font-size:16px;line-height:1.3;font-weight:850;min-height:44px;display:flex;align-items:center}
.math-section .entry-nav a[aria-current] {background:white;border-color:#c4d9de;color:#176e64;box-shadow:0 3px 7px #30556908}
.math-section .scene {padding:30px}
.math-section .scene-title {font-size:25px;margin-bottom:8px}
.math-section .scene-intro {max-width:760px;font-size:18px}
.math-section .stage-area {background:linear-gradient(#eaf3f8,#f3f6ee);border:1px solid #dce7e8;border-radius:25px;min-height:250px;position:relative;margin:23px 0;padding:28px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:22px}
.math-section .stage-actions {display:flex;flex-wrap:wrap;justify-content:center;gap:12px}
.math-section .scene-status {text-align:center;min-height:27px;color:#3a685e;font-weight:800}
.math-section .count-objects {display:flex;gap:25px;align-items:end;justify-content:center;flex-wrap:wrap;max-width:650px;padding:18px 0}
.math-section .count-object {width:76px;height:80px;border-radius:17px;background:linear-gradient(140deg,var(--object,#f7c671),color-mix(in srgb,var(--object,#f7c671),#a77744 23%));box-shadow:inset 4px 4px 1px #fff8,inset -5px -5px 3px #43516218,0 8px 2px #4a648312;position:relative;border:1px solid #fff9;transform:rotate(var(--tilt,-4deg));color:#374a63;font-size:28px;font-weight:900}
.math-section .count-object .count-sticker {display:flex;align-items:center;justify-content:center;border-radius:50%;height:37px;width:37px;background:#fffc;margin:auto;opacity:0}
.math-section .count-object[aria-pressed=true] {outline:3px solid #75a58e;outline-offset:5px}
.math-section .count-object[aria-pressed=true] .count-sticker {opacity:1}
.math-section .count-group {border:2px solid #c6d9c8;border-radius:25px;padding:20px;display:flex;gap:14px;background:#fff8;position:relative}
.math-section .count-group:after {content:"";position:absolute;width:25px;height:12px;border-radius:8px;background:#9aa9bd;left:calc(50% - 13px);top:-7px}
.math-section .count-group .count-object {width:48px;height:54px;border-radius:12px}
.math-section .fragment-callout {background:#fff3d8;border:1px solid #eadbb5;border-radius:18px;padding:17px 20px;margin-bottom:20px}
.math-section .fragment-callout .eyebrow {margin-bottom:5px;color:#957138;font-size:13px}
.math-section .fragment-callout p {color:#68583b;font-size:19px;font-weight:800}
.math-section .fragments {margin-top:25px;border:1px solid #dbe3d9;border-radius:23px;background:#fffdf8}
.math-section .fragments>summary {cursor:pointer;font-size:20px;font-weight:850;padding:20px 24px;min-height:60px}
.math-section .fragment-group {padding:0 24px 22px}
.math-section .fragment-group h3 {font-size:18px;color:#536c7c;margin:12px 0}
.math-section .fragment-group a {display:block;padding:12px 0;border-top:1px solid #e4e9df;font-size:17px;line-height:1.4;color:var(--teal)}
.math-section .fragment-group a[aria-current] {font-weight:900}
.math-section .optional-help {margin-top:24px;display:flex;gap:12px;flex-wrap:wrap;align-items:center;font-size:16px}
.math-section .optional-help a {color:var(--teal);text-decoration:underline;text-underline-offset:4px}
.math-section .ten-frame {display:grid;grid-template-columns:repeat(5,1fr);width:285px;border:2px solid #8da8b3;border-radius:18px;overflow:hidden;background:#fffffb}
.math-section .ten-cell {height:46px;border-right:1px solid #c4d7d9;border-bottom:1px solid #c4d7d9;display:flex;align-items:center;justify-content:center}
.math-section .ten-cell:nth-child(5n) {border-right:0}
.math-section .ten-cell:nth-child(n+6) {border-bottom:0}
.math-section .counter {width:30px;height:30px;border-radius:50%;background:linear-gradient(140deg,#91bed1,#6192af);box-shadow:inset 2px 3px 2px #fff7,0 3px 1px #5e729722}
.math-section .counter.gold {background:linear-gradient(140deg,#f7d483,#e4a744)}
.math-section .model-row {display:flex;align-items:center;gap:26px;justify-content:center;flex-wrap:wrap}
.math-section .loose-counters {display:flex;gap:12px;padding:10px;min-width:115px;max-width:350px;justify-content:center;flex-wrap:wrap}
.math-section .equation {font-size:clamp(24px,3vw,34px);font-weight:900;line-height:1.4;text-align:center;color:#355d78}
.math-section .equation .gold {color:#9e6c20}
.math-section .model-note {font-size:17px;text-align:center;max-width:600px}
.math-section .step-buttons {display:flex;gap:10px;flex-wrap:wrap;justify-content:center}
.math-section .step-buttons button {background:#fffdf7;border:1px solid #cbdcd9;border-radius:13px;padding:10px 16px;font-size:16px;font-weight:850}
.math-section .step-buttons button[aria-pressed=true] {background:#dcece6;border-color:#8eb4a4;color:#176e64}
.math-section .number-choice {display:flex;gap:12px;align-items:center;justify-content:center;flex-wrap:wrap;font-size:22px;font-weight:900}
.math-section .number-choice select {background:white;border:1px solid #bdcfd5;border-radius:12px;padding:8px 14px;min-height:48px;color:var(--ink)}
.math-section .ruler-svg {width:100%;max-width:760px;height:auto;overflow:visible}
.math-section .ruler-control {display:flex;flex-wrap:wrap;gap:15px;align-items:center;justify-content:center;width:100%}
.math-section .ruler-control input {accent-color:#176e64;width:min(280px,75%);height:44px}
.math-section .ruler-control output {font-weight:900;font-size:21px}
.math-section .ruler-note {font-size:15px;max-width:650px;text-align:center}
.math-section .coming {padding:40px 30px;text-align:center;background:linear-gradient(145deg,#edf3f5,#fcf8ed);border-radius:25px}
.math-section .coming img {width:210px;height:140px;margin:auto auto 18px}
.math-section .coming p {max-width:620px;margin:12px auto 23px}
.math-section .coming h2 {font-size:27px}
.math-section .support-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:25px}
.math-section .section-subtitle {max-width:670px}
.math-section .status-chip {display:inline-block;font-size:14px;background:#f7eedc;color:#7c663b;padding:5px 11px;border-radius:9px;margin-top:12px}
.math-section .sr-only {position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.math-section .math-card-illustration {overflow:visible;pointer-events:none}
.math-section .topic-card .arrow {transition:background-color .18s,color .18s,transform .18s}
.math-section .topic-card:focus-visible .arrow {background:var(--teal);color:#fff;transform:translate(2px,-2px)}
@media (hover:hover) and (pointer:fine) {
  .math-section .topic-card:hover {border-color:#76a49e;box-shadow:0 0 0 2px #a6c7ba55,0 12px 30px #34526020}
  .math-section .topic-card:hover .arrow {background:var(--teal);color:#fff;transform:translate(2px,-2px)}
}
@media(max-width:900px) {
.math-section .category-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
.math-section .material-card {grid-template-columns:85px 1fr;column-gap:15px;padding:21px}
.math-section .material-card h2 {font-size:21px}
.math-section .material-card .card-art :is(img,svg) {height:105px}
.math-section .hero {grid-template-columns:1fr 200px;gap:20px}
.math-section .hero-art img {width:205px}
.math-section .hero p {font-size:18px}
.math-section .grade {display:table;margin:10px 0 0}
.math-section .section-switch a {font-size:14px}
}
@media(max-width:650px) {
.math-section {width:calc(100% - 32px)}
.math-section .crumbs {margin:3px 0 21px;font-size:14px}
.math-section .hero {grid-template-columns:1fr 110px;gap:5px;align-items:start}
.math-section .hero-art {height:125px;margin-top:10px}
.math-section .hero-art img {height:118px;width:135px;max-width:none}
.math-section .hero h1 {font-size:35px}
.math-section .hero p {font-size:17px;grid-column:1/-1}
.math-section .hero .hero-copy {display:contents}
.math-section .hero .eyebrow, .math-section .hero h1 {grid-column:1}
.math-section .hero .eyebrow {align-self:end;margin-bottom:-2px}
.math-section .hero h1 {grid-row:2}
.math-section .hero-art {grid-row:1/3;grid-column:2}
.math-section .hero p {margin-top:10px}
.math-section .grade {font-size:14px;margin-top:8px;padding:5px 10px}
.math-section .search-form {margin:20px 0 12px;padding:7px;border-radius:18px;gap:7px}
.math-section .search-form input {font-size:16px;padding:9px 5px}
.math-section .search-icon {width:18px;height:18px;margin-left:6px;border-width:2px}
.math-section .search-icon::after {height:2px;width:7px;right:-5px}
.math-section .search-form button {font-size:16px;padding:12px 15px;border-radius:12px;min-height:46px}
.math-section .search-examples {font-size:14px;gap:8px;margin-bottom:24px}
.math-section .section-heading {margin:25px 0 17px;display:block}
.math-section .section-heading h2 {font-size:25px}
.math-section .section-heading p {font-size:15px;margin-top:5px}
.math-section .category-grid {gap:13px}
.math-section .category-card {padding:10px 16px 17px;border-radius:22px;min-height:260px}
.math-section .category-card h2 {font-size:20px;line-height:1.2}
.math-section .card-art {height:110px}
.math-section .card-art :is(img,svg) {width:180px;height:120px}
.math-section .card-art::before {width:130px}
.math-section .card-foot {font-size:14px;padding-top:15px}
.math-section .arrow {width:30px;height:30px;font-size:20px}
.math-section .companion-note {padding:18px;gap:13px;align-items:start}
.math-section .companion-note .pair {width:78px;height:85px;margin-top:4px}
.math-section .pair img {width:39px;height:85px}
.math-section .companion-note h3 {font-size:19px}
.math-section .companion-note p {font-size:16px}
.math-section .section-switch {gap:7px;margin:20px 0}
.math-section .section-switch a {padding:8px 10px;font-size:13px}
.math-section .material-grid {grid-template-columns:1fr;gap:13px}
.math-section .material-card {grid-template-columns:85px 1fr;padding:19px;min-height:168px;gap:0 16px;border-radius:23px}
.math-section .material-card h2 {font-size:22px}
.math-section .material-card .card-art {height:110px}
.math-section .material-card .card-foot {padding-top:9px}
.math-section .search-result {padding:18px;gap:8px 12px}
.math-section .search-result h2 {font-size:20px}
.math-section .search-result p {font-size:15px}
.math-section .empty-state {padding:32px 20px}
.math-section .empty-state h2 {font-size:25px}
.math-section .material-head {margin-bottom:20px}
.math-section .material-head h1 {font-size:31px}
.math-section .material-back {font-size:15px;margin-bottom:15px}
.math-section .workbench {border-radius:24px}
.math-section .entry-nav {padding:14px;gap:6px}
.math-section .entry-nav a {font-size:15px;padding:10px 12px;background:#fff9;border-color:#e0e6e0}
.math-section .entry-nav a[aria-current] {border-color:#9abdae}
.math-section .scene {padding:20px 16px}
.math-section .scene-title {font-size:23px}
.math-section .scene-intro {font-size:17px}
.math-section .stage-area {padding:20px 12px;border-radius:21px;margin:20px 0;min-height:240px}
.math-section .count-objects {gap:17px;max-width:360px}
.math-section .count-object {width:59px;height:64px;border-radius:14px}
.math-section .count-group {gap:8px;padding:15px}
.math-section .count-group .count-object {width:35px;height:43px}
.math-section .button {font-size:16px;min-height:48px;padding:12px 18px}
.math-section .scene-status {font-size:17px}
.math-section .fragment-callout {padding:14px 17px}
.math-section .fragment-callout p {font-size:18px}
.math-section .fragments>summary {font-size:18px;padding:18px}
.math-section .fragment-group {padding:0 18px 18px}
.math-section .fragment-group a {font-size:16px}
.math-section .support-grid {grid-template-columns:1fr}
.math-section .model-row {gap:13px}
.math-section .ten-frame {width:240px}
.math-section .ten-cell {height:40px}
.math-section .counter {width:27px;height:27px}
.math-section .loose-counters {gap:9px;min-width:100px}
.math-section .model-note {font-size:16px}
.math-section .step-buttons {gap:7px}
.math-section .step-buttons button {padding:9px 11px;font-size:15px}
.math-section .ruler-note {font-size:14px}
.math-section .coming {padding:25px 17px}
.math-section .coming h2 {font-size:25px}
.math-section .coming p {font-size:17px}
}
@media(max-width:380px) {
.math-section {width:calc(100% - 26px)}
.math-section .category-grid {grid-template-columns:1fr}
.math-section .category-card {display:grid;grid-template-columns:108px 1fr;gap:0 13px;padding:18px;min-height:158px}
.math-section .category-card .card-art {grid-row:1/3;height:115px}
.math-section .category-card .card-art :is(img,svg) {width:140px;height:115px;max-width:none}
.math-section .category-card h2 {margin-top:5px;font-size:22px;align-self:end}
.math-section .category-card .card-foot {padding-top:12px}
.math-section .hero h1 {font-size:32px}
.math-section .hero {grid-template-columns:1fr 93px}
.math-section .hero-art img {width:114px}
.math-section .hero p {font-size:16px}
.math-section .hero .eyebrow {font-size:14px}
.math-section .material-card {grid-template-columns:72px 1fr;padding:16px;column-gap:12px}
.math-section .material-card h2 {font-size:20px}
.math-section .material-card .card-art :is(img,svg) {width:99px;height:99px;max-width:none}
.math-section .search-form {gap:4px}
.math-section .search-form button {padding:12px 11px}
.math-section .count-group {gap:6px;padding:12px}
.math-section .count-group .count-object {width:31px;height:39px}
}
@media(prefers-reduced-motion:reduce) {
.math-section *, .math-section *::before, .math-section *::after {scroll-behavior:auto!important;animation:none!important;transition:none!important}
}
.math-section .ruler-svg text {font-weight:800}
@media(max-width:650px) {
.math-section .hero-art img {max-width:100%}
.math-section .ruler-svg text {font-size:36px}
.math-section .ruler-svg {margin-bottom:8px}
}
@media(max-width:380px) {
.math-section .category-card {grid-template-columns:86px minmax(0,1fr)}
.math-section .category-card h2 {font-size:20px;overflow-wrap:anywhere}
.math-section .category-card .card-art :is(img,svg) {width:116px;max-width:130%}
.math-section .category-card .card-foot {gap:6px;font-size:13px}
.math-section .category-card .arrow {width:27px;height:27px}
}
.math-section h1:focus-visible {outline:none}
@media(max-width:650px) {
.math-section .ruler-svg text {font-size:44px}
.math-section .ruler-svg text.odd-tick:not([data-active=true]) {display:none}
}
@media(max-width:650px) {
.math-section .hero-long {grid-template-columns:minmax(0,1fr) 85px}
.math-section .hero-long .eyebrow {grid-column:1;grid-row:1;font-size:14px;max-width:175px}
.math-section .hero-long .hero-art {grid-row:1;grid-column:2;height:80px;margin-top:0}
.math-section .hero-long .hero-art img {height:90px;width:110px;max-width:100%}
.math-section .hero-long h1 {grid-column:1/-1;grid-row:2;overflow-wrap:anywhere;margin-top:7px;font-size:32px}
.math-section .hero-long p {grid-row:3}
}
.math-section .search-form input {min-height:46px}
@media(max-width:650px) {
.math-section .category-grid {grid-template-columns:1fr}
.math-section .category-card {display:grid;grid-template-columns:100px minmax(0,1fr);gap:0 17px;min-height:163px;padding:18px 20px}
.math-section .category-card .card-art {grid-row:1/3;height:118px}
.math-section .category-card .card-art :is(img,svg) {width:140px;height:120px;max-width:135%}
.math-section .category-card h2 {font-size:23px;align-self:end;margin-top:0;overflow-wrap:anywhere;hyphens:auto}
.math-section .category-card .card-foot {padding-top:13px;font-size:15px;gap:8px}
}
@media(max-width:380px) {
.math-section .category-card {grid-template-columns:82px minmax(0,1fr);gap:0 13px;padding:17px 16px}
.math-section .category-card h2 {font-size:20px}
.math-section .category-card .card-art :is(img,svg) {width:113px;height:110px}
.math-section .category-card .card-foot {font-size:13px;gap:6px}
.math-section .category-card .arrow {width:27px;height:27px}
}
.math-section .step-buttons button {min-height:44px}
.math-section .material-back {min-height:44px;align-items:center}
@media(max-width:650px) {
.math-section .category-card h2 {font-size:22px;hyphens:none;overflow-wrap:anywhere}
}
@media(max-width:380px) {
.math-section .category-card {grid-template-columns:68px minmax(0,1fr);gap:0 12px;padding:17px 14px}
.math-section .category-card h2 {font-size:20px}
.math-section .category-card .card-art :is(img,svg) {width:94px;max-width:138%}
}
.math-section .workbench {scroll-margin-top:18px}
.math-section .model-note {min-height:54px}
.math-section .decomposition {min-height:42px}

/* Class selection is a separate entry, before the subject-specific catalog. */
.math-section .grade-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}
.math-section .grade-card {padding:24px;min-height:236px}
.math-section .grade-card h3 {display:flex;flex-direction:column;align-items:flex-start;gap:8px;font-size:25px}
.math-section .grade-number {font-size:82px;line-height:1;font-weight:900;color:var(--grade-ink);text-shadow:0 3px 0 #fff9}
.math-section .grade-card-art {position:absolute;top:36px;right:20px;width:96px;pointer-events:none}
.math-section .grade-card-art img {width:100%;height:auto}
.math-section .grade-card .card-foot {font-size:16px;gap:8px;padding-top:26px}
.math-section .grade-picker-note {margin-top:24px;max-width:700px;font-size:17px}
.math-section .grade-search-note {margin-bottom:18px}
.math-section .grade-switch {display:flex;align-items:center;gap:16px;margin:0 0 25px;color:#536b69;font-size:16px;font-weight:800}
.math-section .grade-switch > div {display:flex;gap:6px;padding:5px;background:#fffdf8;border:1px solid var(--line);border-radius:18px}
.math-section .grade-switch a {display:flex;align-items:center;justify-content:center;width:46px;min-height:44px;border-radius:12px;color:var(--teal)}
.math-section .grade-switch a[aria-current="page"] {background:var(--teal);color:#fff;box-shadow:0 3px 7px #176e6418}
.math-section .grade-switch a:hover:not([aria-current]) {background:#e9f1eb}
.math-section .grade-pending {padding:36px;border:1px solid #dce5d8;background:linear-gradient(120deg,#eff3e6,#fffdf6);border-radius:28px;max-width:900px}
.math-section .grade-pending p {margin-top:16px;max-width:630px;font-size:19px}
.math-section .grade-pending-actions {display:flex;align-items:center;gap:24px;flex-wrap:wrap;margin-top:26px}
.math-section .grade-pending .material-back {margin:0}
@media(max-width:900px) {
  .math-section .grade-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
  .math-section .grade-card {min-height:204px}
}
@media(max-width:650px) {
  .math-section .grade-grid {gap:12px}
  .math-section .grade-card {padding:20px;min-height:195px}
  .math-section .grade-card h3 {font-size:23px}
  .math-section .grade-number {font-size:64px}
  .math-section .grade-card-art {width:60px;top:32px;right:16px}
  .math-section .grade-card .card-foot {font-size:15px;padding-top:20px}
  .math-section .grade-card .arrow {width:28px;height:28px;font-size:20px}
  .math-section .grade-pending {padding:25px 22px}
  .math-section .grade-pending h2 {font-size:27px}
  .math-section .grade-pending p {font-size:18px}
  .math-section .grade-pending-actions {gap:15px}
  .math-section .grade-pending .button {white-space:normal;text-align:center}
}
@media(max-width:380px) {
  .math-section .grade-grid {grid-template-columns:1fr}
  .math-section .grade-card {min-height:132px;display:grid;grid-template-columns:72px 40px minmax(0,1fr);align-items:center;gap:10px}
  .math-section .grade-card-art {position:static;width:40px}
  .math-section .grade-card h3 {align-items:center;gap:3px;font-size:20px}
  .math-section .grade-number {font-size:52px}
  .math-section .grade-card .card-foot {padding-top:0;font-size:16px;margin-top:0}
  .math-section .grade-switch {gap:10px}
}

/* N1: one public entrance to the versioned stories in the account. */
.math-section .scene[data-material="N1"]{padding:clamp(18px,3vw,36px)}

/* Compact subject heading and subject navigation. */
.math-section .hero {display:block;margin:0 0 24px;}
.math-section .hero .hero-copy {display:block;}
.math-section .hero h1 {margin:0 0 12px;overflow-wrap:anywhere;}
.math-section .hero p {max-width:780px;margin-top:0;}
.math-section .subject-picker {position:static;max-width:100%;}
.math-section .subject-picker summary {list-style:none;cursor:pointer;font-weight:850;color:var(--teal);min-height:44px;display:flex;align-items:center;gap:7px;}
.math-section .subject-picker summary::-webkit-details-marker {display:none;}
.math-section .subject-picker summary span {font-size:18px;}
.math-section .subject-picker-menu {position:absolute;top:calc(100% + 4px);left:0;z-index:20;width:260px;max-width:calc(100vw - 48px);padding:8px;background:#fffdf8;border:1px solid var(--line);border-radius:18px;box-shadow:0 14px 35px #25324b20;}
.math-section .subject-picker-menu a {display:block;min-height:44px;padding:10px 12px;border-radius:11px;white-space:normal;}
.math-section .subject-picker-menu a:hover,.math-section .subject-picker-menu a[aria-current] {background:#e8f1e5;}
.math-section .crumbs {position:relative;margin-bottom:14px;}

/* The chosen class lives in the right-hand illustration, once per heading. */
.math-section .hero-with-class {display:grid;grid-template-columns:minmax(0,1fr) 180px;gap:28px;align-items:center;}
.math-section .class-illustration {display:grid;place-items:center;width:180px;height:165px;isolation:isolate;background:radial-gradient(ellipse at 50% 72%,#dfebdfaa,transparent 69%);}
.math-section .class-paper {display:flex;flex-direction:column;align-items:center;justify-content:center;width:128px;height:145px;transform:rotate(-5deg);border-radius:24px 28px 25px 20px;background:linear-gradient(145deg,#fffef8,#f5eddc);border:1px solid #e2d9c5;box-shadow:3px 5px 0 #e9dfcc,8px 12px 18px #54716b14;}
.math-section .class-art-number {font-size:100px;font-weight:900;line-height:.95;color:#24796f;text-shadow:2px 3px 0 #b4d0bd;}
.math-section .class-art-word {font-size:21px;font-weight:900;color:#536d65;line-height:1.3;margin-top:5px;}
@media(max-width:650px){
 .math-section .hero-with-class {grid-template-columns:minmax(0,1fr) 88px;gap:12px 14px;}
 .math-section .hero-with-class .hero-copy {display:contents;}
 .math-section .hero-with-class h1 {grid-column:1;grid-row:1;margin:0;align-self:center;}
 .math-section .hero-with-class p {grid-column:1/-1;grid-row:2;}
 .math-section .class-illustration {grid-column:2;grid-row:1;width:88px;height:110px;}
 .math-section .class-paper {width:76px;height:94px;border-radius:16px;box-shadow:2px 3px 0 #e9dfcc,4px 7px 12px #54716b14;}
 .math-section .class-art-number {font-size:64px;}
 .math-section .class-art-word {font-size:15px;margin-top:1px;}
}
@media(max-width:380px){
 .math-section .hero-with-class {grid-template-columns:minmax(0,1fr) 70px;column-gap:10px;}
 .math-section .hero-with-class h1 {font-size:26px;}
 .math-section .class-illustration {width:70px;height:98px;}
 .math-section .class-paper {width:62px;height:82px;}
 .math-section .class-art-number {font-size:54px;}
 .math-section .class-art-word {font-size:14px;}
}

@media(max-width:650px){
 .math-section .hero-with-class.hero-long h1 {grid-column:1/-1;grid-row:1;overflow-wrap:normal;}
 .math-section .hero-with-class.hero-long p {grid-column:1;grid-row:2;}
 .math-section .hero-with-class.hero-long .class-illustration {grid-column:2;grid-row:2;}
}

/* The original shapes identify mathematics on the initial class-choice page. */
.math-section .hero-with-intro-art {display:grid;grid-template-columns:minmax(0,1fr) 240px;gap:28px;align-items:center;}
.math-section .hero-with-intro-art .hero-art {height:165px;}
@media(max-width:650px){
 .math-section .hero-with-intro-art {grid-template-columns:minmax(0,1fr) 88px;gap:12px 14px;}
 .math-section .hero-with-intro-art .hero-copy {display:contents;}
 .math-section .hero-with-intro-art h1 {grid-column:1;grid-row:1;margin:0;align-self:center;}
 .math-section .hero-with-intro-art p {grid-column:1/-1;grid-row:2;}
 .math-section .hero-with-intro-art .hero-art {grid-column:2;grid-row:1;width:88px;height:110px;margin:0;}
 .math-section .hero-with-intro-art .hero-art img {width:88px;height:110px;max-width:100%;}
}
@media(max-width:380px){
 .math-section .hero-with-intro-art {grid-template-columns:minmax(0,1fr) 70px;column-gap:10px;}
 .math-section .hero-with-intro-art h1 {font-size:26px;}
 .math-section .hero-with-intro-art .hero-art,.math-section .hero-with-intro-art .hero-art img {width:70px;height:98px;}
}

.math-section .counting-card {
  grid-template-columns: clamp(140px, 15vw, 185px) minmax(0, 1fr);
  column-gap: 15px;
}
.math-section .counting-card .card-art svg {
  width: 100%;
  height: auto;
  max-width: 100%;
  overflow: visible;
}
@media (max-width: 900px) {
  .math-section .counting-card {
    grid-template-columns: clamp(95px, 14vw, 125px) minmax(0, 1fr);
  }
}
@media (max-width: 650px) {
  .math-section .counting-card {
    grid-template-columns: clamp(102px, 28vw, 126px) minmax(0, 1fr);
  }
}
@media (max-width: 380px) {
  .math-section .counting-card {
    grid-template-columns: 88px minmax(0, 1fr);
    column-gap: 10px;
  }
}

.math-section [data-counting-material="N1"] { --counting-tint: #e9f2f5; }
.math-section [data-counting-material="N2"] { --counting-tint: #f0ebf7; }
.math-section [data-counting-material="N3"] { --counting-tint: #edf3e5; }
.math-section [data-counting-material="N4"] { --counting-tint: #faf0de; }
.math-section [data-counting-material="N5"] { --counting-tint: #ebf0f6; }
.math-section .counting-card::before {
  background: linear-gradient(145deg, var(--counting-tint, var(--tint)), #fffefa 84%);
}
.math-section .counting-card .card-art::before {
  width: 100%;
  height: 96%;
  background: radial-gradient(ellipse, #fff9, transparent 72%);
}
