.math-main{width:min(90%,1120px);margin:0 auto;padding:clamp(28px,5vw,62px) 0 36px}
.math-back,.math-footer a{color:#4f473c;text-decoration:underline;text-underline-offset:.2em}
.math-heading{padding:15px 0 25px}
.math-heading h1{font:400 clamp(38px,6.4vw,76px)/1.05 Georgia,serif;letter-spacing:-.055em;margin:6px 0 12px}
.math-heading p,.math-muted,.math-concept{color:var(--page-muted);line-height:1.65}
.math-heading p,.math-concept{max-width:66ch}
.math-levels{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;border-block:1px solid var(--page-rule)}
.math-practice button{cursor:pointer;color:var(--page-ink);background:transparent;border:1px solid #aaa08f;padding:9px 12px;text-align:left;font:inherit}
.math-levels button{border:0;border-bottom:3px solid transparent;padding:12px clamp(6px,2vw,22px);display:grid;gap:2px}
.math-levels button[aria-current=true]{border-bottom-color:#845536;background:#eae2d3}
.math-levels small,.lesson-links small{color:#665b4e;font-size:.77rem}
.math-layout{display:grid;grid-template-columns:minmax(190px,25%) minmax(0,1fr);gap:clamp(18px,5vw,68px);padding-top:26px}
#lesson-list h2{font:400 1.35rem Georgia,serif;margin:0 0 7px}
#lesson-list p{font-size:.92rem;margin:0 0 12px}
.lesson-links button{width:100%;border:0;border-top:1px solid var(--page-rule);display:flex;justify-content:space-between;align-items:baseline;gap:8px}
.lesson-links button[aria-current=true]{background:#eae2d3;font-weight:700}
.lesson-links button:hover{background:#eee7dc}
#lesson h2{font:400 clamp(28px,4.5vw,47px)/1.12 Georgia,serif;letter-spacing:-.035em;margin:0}
.math-example,.math-quiz{border:1px solid var(--page-rule);background:#fbf8f1;padding:clamp(14px,3vw,26px);margin:20px 0}
.math-example h3,.math-quiz h3{font:400 1.45rem Georgia,serif;margin:0 0 10px}
.math-problem{font-size:clamp(16px,2vw,20px);line-height:1.55;margin:10px 0 16px}
.math-steps{padding-left:1.5rem;line-height:1.65}
.math-steps:empty,.math-feedback:empty{display:none}
.math-steps li{margin-bottom:5px}
.math-actions,.math-pagination{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.math-actions{margin-top:12px}
.math-pagination{justify-content:flex-end;margin-top:16px}
.math-practice .math-button{background:#25251f;color:#fff9ee;border-color:#25251f}
.math-practice .math-button:hover{background:#484338}
#numeric-answer{display:block;width:min(100%,360px);padding:10px 12px;margin-top:6px;border:1px solid #aaa08f;background:white;color:#25251f;font:inherit}
.math-option{display:flex;align-items:center;gap:8px;padding:5px 0}
.math-quiz fieldset{padding:6px 12px;border:1px solid var(--page-rule)}
.math-feedback,.math-hint{padding:10px 12px;border-left:3px solid #90714f;background:#efe8da;margin:12px 0 0}
.math-feedback[data-tone=correct]{border-color:#416453;background:#e9efe6}
.math-feedback[data-tone=retry]{border-color:#a5643c;background:#f3e7dc}
.math-feedback p{margin:3px 0}
.math-footer{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;border-top:1px solid var(--page-rule);padding:12px 0;background:transparent;color:var(--page-muted)}
.math-practice [hidden]{display:none!important}
@media(max-width:670px){.math-layout{grid-template-columns:1fr}.lesson-links{display:grid;grid-template-columns:1fr 1fr}.math-levels button{font-size:.9rem}}

body.math-practice{--page-paper:#f3f5fb;--page-ink:#18213c;--page-muted:#4b5672;--page-rule:#dbe0ef;background:var(--page-paper);color:var(--page-ink)}
.math-heading h1,#lesson h2,.math-example h3,.math-quiz h3,#lesson-list h2{font-family:"DM Sans",system-ui,sans-serif;font-weight:700;color:var(--page-ink)}
.math-heading{border:1px solid var(--page-rule);border-radius:20px;background:linear-gradient(120deg,#fff,#e5e2ff);padding:clamp(18px,4vw,38px);margin:14px 0 20px}
.math-levels{gap:5px;border:1px solid var(--page-rule);border-radius:13px;background:#fff;padding:5px}
.math-levels button{border-radius:8px;border-bottom:0}
.math-levels button[aria-current=true],.lesson-links button[aria-current=true]{background:#eae6ff;color:#31268b}
.lesson-links button:hover{background:#eeecfa}
.math-example,.math-quiz{background:#fff;border-radius:15px}
.math-practice .math-button{background:#4034a8;color:#fff;border-color:#4034a8;border-radius:9px}
.math-practice .math-button:hover{background:#31268b}
.math-calculator{display:flex;flex-wrap:wrap;gap:6px 16px;margin-top:14px}
.math-practice .math-calculator a{color:#31268b;font-size:.9rem;font-weight:700;text-decoration:underline;text-underline-offset:.2em}
