.math-lesson [data-math-solver] [hidden],.math-lesson .solver-answer[hidden],.math-lesson .solver-steps[hidden]{display:none!important}
.math-lesson .solver-input-tabs{display:flex;gap:6px;margin:14px 22px 20px;padding:5px;background:#edf3f0;border-radius:12px}
.math-lesson .solver-input-tabs button{flex:1;border:0;background:transparent;color:#526a60;border-radius:8px;padding:12px;font-size:.9rem;font-weight:700}
.math-lesson .solver-input-tabs button[aria-selected=true]{background:#fff;color:#183c38;box-shadow:0 2px 8px #16392c12}
.math-lesson .solver-math-field{padding:4px 22px 24px;min-height:110px;min-width:0}
.math-lesson .solver-math-field math-field{display:block;width:100%;min-width:0;min-height:70px;font-size:1.65rem;border:1px solid #cfddd5;border-radius:12px;padding:14px;color:#183c38;background:white;--caret-color:#266c58;--selection-background-color:#b7d9c9}
.math-lesson [data-input-panel=normal]{padding:0 22px 20px}
.math-lesson [data-input-panel=normal] label{display:block;font-weight:700;margin-bottom:8px}
.math-lesson #solver-question{display:block;width:100%;max-width:100%;resize:vertical;box-sizing:border-box;font:inherit;font-size:16px;line-height:1.7;padding:16px;border:1px solid #bbcfc3;border-radius:12px;background:#fff;color:#183c38;min-height:160px}
.math-lesson #solver-question:focus-visible,.math-lesson .solver-step-link:focus-visible{outline:3px solid #85bca5;outline-offset:3px}
.math-lesson .solver-bottom{padding:20px 22px 14px;border-top:1px solid #cfddd5}
.math-lesson .solver-angle{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:.78rem;color:#526a60}
.math-lesson .solver-angle button{border:1px solid #cfddd5;padding:8px 12px;border-radius:7px;background:#f4f8f5;color:#183c38}
.math-lesson .solver-angle button[aria-pressed=true]{background:#266c58;color:#fff;border-color:#266c58}
.math-lesson .solver-examples{display:flex;flex-wrap:wrap;gap:8px;align-items:center;font-size:.78rem;margin:18px 0}
.math-lesson .solver-examples button{padding:8px 11px;border:1px solid #cfddd5;border-radius:20px;background:#f5f8f6;color:#266c58}
.math-lesson .solver-submit{display:flex;align-items:center;justify-content:center;gap:24px;width:100%;background:#266c58;color:#fff;border:0;border-radius:12px;padding:16px;font-size:1rem!important;font-weight:750!important;min-height:52px}
.math-lesson .solver-submit:hover{background:#1d5544}.math-lesson .solver-help{font-size:.76rem;line-height:1.65;color:#64766e;margin:12px 0 0}
.math-lesson .solver-message{font-size:.85rem;line-height:1.6;color:#9c3636;margin:14px 0 0}.math-lesson .solver-message:empty{display:none}
.math-lesson .solver-answer{border:1px solid #c9dfd1;background:linear-gradient(135deg,#f0f9f3,#fff);border-radius:20px;padding:28px;margin:30px 0;text-align:center;scroll-margin-top:100px}
.math-lesson .solver-eyebrow{display:block;font-size:.72rem;font-weight:750;text-transform:uppercase;letter-spacing:.12em;color:#527165;margin-bottom:10px}
.math-lesson .solver-answer-text{font-size:1.3rem;line-height:1.9;white-space:pre-wrap;overflow-wrap:anywhere;margin:14px 0 24px}
.math-lesson .solver-step-link{display:inline-flex;align-items:center;justify-content:center;gap:18px;color:#fff!important;background:#266c58;border-radius:12px;padding:15px 22px;text-decoration:none;font-weight:700;font-size:.9rem;box-shadow:0 6px 16px #266c5820}
.math-lesson .solver-step-link:hover{background:#1d5544}
.math-lesson .solver-steps{margin:36px 0;scroll-margin-top:100px}.math-lesson .solver-steps header{padding:4px 0 18px}.math-lesson .solver-steps header h2{margin:8px 0}.math-lesson .solver-steps header p{margin:8px 0;color:#64766e}
.math-lesson .solver-steps ol{list-style:none;counter-reset:solver;padding:0;display:grid;gap:16px}.math-lesson .solver-steps li{counter-increment:solver;position:relative;padding:22px 24px 22px 68px;border:1px solid #dce5de;border-radius:16px;background:#fff;min-width:0;margin:0}
.math-lesson .solver-steps li::before{content:counter(solver);position:absolute;left:20px;top:23px;width:30px;height:30px;border-radius:50%;background:#e5f3e9;color:#266c58;display:grid;place-items:center;font-weight:750;font-size:.85rem}
.math-lesson .solver-steps h3{font-size:1rem;margin:0 0 10px;color:#183c38}.math-lesson .solver-steps p{white-space:pre-wrap;overflow-wrap:anywhere;font-size:.9rem;line-height:1.85;margin:0;color:#42564d}
.math-lesson .solver-equation{background:#f5f8f6;border-radius:10px;margin-top:16px;padding:12px;font-size:1.1rem;overflow-x:auto;overflow-y:hidden;max-width:100%}
.math-lesson .solver-answer mjx-container[display=true]{max-width:100%;overflow-x:auto;overflow-y:hidden;padding:8px 0}
@media(max-width:650px){.math-lesson .solver-input-tabs{margin-left:12px;margin-right:12px}.math-lesson .solver-math-field{padding:0 12px 18px}.math-lesson .solver-math-field math-field{font-size:1.3rem;padding:12px}.math-lesson .solver-bottom,.math-lesson [data-input-panel=normal]{padding-left:14px;padding-right:14px}.math-lesson .solver-answer{padding:22px 14px}.math-lesson .solver-answer-text{font-size:1.1rem}.math-lesson .solver-step-link{font-size:.82rem;padding:14px;gap:10px}.math-lesson .solver-steps li{padding:20px 14px 20px 50px}.math-lesson .solver-steps li::before{left:12px;width:26px;height:26px;top:20px}.math-lesson .solver-equation{font-size:1rem;padding:8px}.math-lesson .solver-angle{font-size:.72rem}.math-lesson .solver-examples{font-size:.72rem;gap:6px}}
.math-lesson [data-step-link][hidden]{display:none!important}
.math-lesson .solver-upload{margin:14px 22px 20px;padding:18px;border:1px dashed #a8c6b5;border-radius:14px;background:#f6faf7}
.math-lesson .solver-upload-heading{display:flex;justify-content:space-between;align-items:center;gap:20px}.math-lesson .solver-upload-heading strong{font-size:.9rem}.math-lesson .solver-upload-heading p{font-size:.78rem;line-height:1.65;color:#64766e;margin:5px 0 0}
.math-lesson .solver-upload-button,.math-lesson .solver-image-actions button{padding:11px 14px;border:1px solid #b7d1c0;border-radius:9px;color:#266c58;background:#fff;font-weight:700!important;font-size:.8rem!important;white-space:nowrap}
.math-lesson .solver-image-preview{display:grid;grid-template-columns:88px minmax(0,1fr);align-items:start;gap:14px;margin-top:18px;padding-top:16px;border-top:1px solid #d8e5dd}.math-lesson .solver-image-preview img{width:88px;height:88px;object-fit:contain;background:white;border:1px solid #d8e5dd;border-radius:10px}.math-lesson [data-image-name]{display:block;overflow-wrap:anywhere;font-size:.8rem;font-weight:700}.math-lesson .solver-image-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.math-lesson [data-extract-image]{color:#fff!important;background:#266c58!important}.math-lesson .solver-image-status{font-size:.8rem;line-height:1.65;color:#425e4f;margin:12px 0 0}.math-lesson .solver-image-status:empty{display:none}
@media(max-width:650px){.math-lesson .solver-upload{margin:12px;padding:14px}.math-lesson .solver-upload-heading{align-items:start;flex-direction:column;gap:12px}.math-lesson .solver-image-preview{grid-template-columns:64px minmax(0,1fr);gap:10px}.math-lesson .solver-image-preview img{width:64px;height:64px}.math-lesson .solver-image-actions button{white-space:normal;text-align:center}.math-lesson .solver-upload-button{width:100%}}
.math-lesson .solver-image-formats{margin:10px 0 0;color:#64766e;font-size:.74rem;line-height:1.65}.math-lesson .solver-image-formats summary{cursor:pointer}.math-lesson .solver-image-formats p{font-size:inherit;margin:8px 0 0}
.solver-loading{display:flex;justify-content:center;align-items:center;gap:2px;margin:-20px 0 30px;padding:16px;border:1px solid #c9dfd1;border-radius:12px;background:#edf7f0;color:#20503d;font-weight:750;font-size:1rem}
.solver-loading-dots{display:inline-flex;width:24px}.solver-loading-dots i{font-style:normal;animation:solver-dot 1.2s ease-in-out infinite}.solver-loading-dots i:nth-child(2){animation-delay:.2s}.solver-loading-dots i:nth-child(3){animation-delay:.4s}@keyframes solver-dot{0%,70%,100%{opacity:.2}35%{opacity:1}}
.math-lesson [data-solving=true]{opacity:.7}.math-lesson [data-solving=true] math-field{background:#edf2ee;color:#536b5f;cursor:wait}
@media(prefers-reduced-motion:reduce){.solver-loading-dots i{animation:none;opacity:1}}
.math-lesson .specialist-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:0 22px 20px}.math-lesson .specialist-options label{display:flex;flex-direction:column;gap:8px;font-size:.8rem;font-weight:700;min-width:0}.math-lesson .specialist-options input,.math-lesson .specialist-options select,.math-lesson .specialist-options math-field{width:100%;box-sizing:border-box;min-width:0;min-height:48px;border:1px solid #c8d8ce;border-radius:10px;background:white;color:#183c38;font:inherit;font-size:16px;padding:10px}.math-lesson .specialist-options [hidden]{display:none!important}.math-lesson .specialist-options .specialist-bounds{display:grid;grid-template-columns:1fr 1fr;gap:12px;grid-column:1/-1}.math-lesson .specialist-options .specialist-help{grid-column:1/-1;margin:0;font-size:.78rem;font-weight:400;color:#64766e}
@media(max-width:500px){.math-lesson .specialist-options{margin-inline:14px;gap:12px}}
.math-lesson .bound-shortcuts{display:flex;gap:5px;flex-wrap:wrap}.math-lesson .bound-shortcuts button{font-size:.75rem!important;padding:5px 8px;border:1px solid #ceddd3;border-radius:6px;background:#fff;color:#266c58}
.math-lesson .solver-input-surface{position:relative}
.math-lesson .solver-input-overlay{position:absolute;inset:0;z-index:5;display:flex;align-items:center;justify-content:center;gap:3px;border:1px solid #bdd4c6;border-radius:12px;background:rgba(240,248,243,.94);backdrop-filter:blur(2px);color:#174a35;font-size:1.1rem;font-weight:750;box-shadow:inset 0 0 25px #ffffff80}
.math-lesson .solver-math-field>.solver-input-overlay{inset:0 22px 24px}
.math-lesson [data-solving=true]{opacity:1}.math-lesson [data-solving=true] math-field,.math-lesson [data-solving=true] textarea{opacity:.45}
.math-lesson .solver-section-divider{height:4px;margin:48px 0 32px;border:0;border-radius:4px;background:repeating-linear-gradient(90deg,#8bae9b 0 16px,transparent 16px 26px)}
.math-lesson .solver-upload{padding:22px;border:2px dashed #93bca5;background:linear-gradient(120deg,#e6f4ea,#f7fbf8);box-shadow:0 5px 20px #245c3c09}
.math-lesson .solver-upload-heading strong{font-size:1rem;color:#1c4b36}
.math-lesson .solver-workspace .solver-upload-button{display:inline-flex;align-items:center;justify-content:center;gap:12px;min-height:56px;padding:14px 18px;background:#266c58;color:#fff;border:1px solid #205d4b;box-shadow:0 4px 0 #1c5141,0 8px 16px #266c5820;font-size:.86rem!important;font-weight:750!important}
.math-lesson .solver-upload-button svg{width:26px;height:26px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.math-lesson .solver-workspace .solver-upload-button:hover{background:#1c5745}
@media(max-width:650px){.math-lesson .solver-upload{padding:16px}.math-lesson .solver-math-field>.solver-input-overlay{inset:0 12px 18px}.math-lesson .solver-section-divider{margin:34px 0 26px}.math-lesson .solver-input-overlay{font-size:1rem}}

.solver-missing-dialog{box-sizing:border-box;width:min(460px,calc(100vw - 32px));padding:26px;border:2px solid #bdd5c8;border-radius:20px;background:#fff;color:#193f34;box-shadow:0 20px 80px #102b3050;font-family:inherit}.solver-missing-dialog::backdrop{background:#0c252c80;backdrop-filter:blur(3px)}.solver-missing-dialog h2{font-size:1.3rem;margin:0 0 12px}.solver-missing-dialog p{font-size:1rem;line-height:1.65;margin:0 0 22px}.solver-missing-actions{display:flex;gap:12px;flex-wrap:wrap}.solver-missing-actions button{flex:1;min-width:140px;min-height:48px;padding:12px;border:1px solid #266c58;border-radius:10px;background:#fff;color:#194e3b;font:inherit;font-weight:700;cursor:pointer}.solver-missing-actions button:last-child{background:#266c58;color:#fff}.solver-missing-actions button:focus-visible{outline:3px solid #8dbea8;outline-offset:3px}

.solver-input-overlay>span:first-child{max-width:100%;text-align:center;line-height:1.55;overflow-wrap:anywhere}.solver-input-overlay{box-sizing:border-box;padding:20px;flex-wrap:wrap;align-content:center}.solver-loading{flex-wrap:wrap;text-align:center;line-height:1.6}.solver-loading>span:first-child{max-width:100%;overflow-wrap:anywhere}

.math-lesson [data-solving="true"] .solver-message{display:none}

.math-lesson.integer-solver .solver-steps li{padding-top:26px;padding-bottom:26px}.math-lesson.integer-solver .solver-steps li::before{top:27px;background:#266c58;color:white}.math-lesson.integer-solver .solver-equation{background:#f7faf7;margin-top:12px;padding:12px 16px;font-size:1.2rem}.math-lesson.integer-solver .solver-equation mjx-container[display=true]{text-align:left!important;margin:.35em 0!important}.math-lesson.integer-solver .solver-steps li[data-step-kind="answer"]{background:#edf7f0;border:2px solid #a9cdb9}.math-lesson.integer-solver .solver-steps li[data-step-kind="answer"]::before{content:'✓'}.math-lesson.integer-solver .solver-steps li[data-step-kind="answer"] h3{font-size:1.1rem}@media(max-width:650px){.math-lesson.integer-solver .solver-equation{padding:12px;font-size:1.05rem}.math-lesson.integer-solver .solver-steps li{padding-top:20px;padding-bottom:20px}.math-lesson.integer-solver .solver-steps li::before{top:21px}}

.math-lesson .solver-equation.solver-equation-mixed{font-family:inherit;font-size:.95rem;line-height:1.9;white-space:pre-wrap;overflow-wrap:anywhere}.math-lesson .solver-equation-mixed mjx-container[display=true]{max-width:100%;overflow-x:auto;overflow-y:hidden}
/* Keep every edge of a long formula reachable; do not shrink or clip its SVG. */
.math-lesson .solver-steps,.math-lesson .solver-steps li,.math-lesson .solver-answer{min-width:0;max-width:100%;box-sizing:border-box}
.math-lesson .solver-equation,.math-lesson .solver-answer-text{min-width:0;max-width:100%;box-sizing:border-box;overflow:auto;overscroll-behavior-x:contain;scrollbar-width:auto}
.math-lesson .solver-equation>mjx-container[display=true],.math-lesson .solver-answer-text>mjx-container[display=true]{width:max-content!important;min-width:100%;max-width:none!important;overflow:visible!important;box-sizing:content-box}
.math-lesson .solver-equation mjx-container svg,.math-lesson .solver-answer-text mjx-container svg,.math-lesson .solver-steps :is(p,h3) mjx-container svg{max-width:none!important}
.math-lesson .solver-steps :is(p,h3){min-width:0;max-width:100%;overflow-x:auto;overflow-y:visible}
.math-lesson .solver-equation:focus-visible{outline:2px solid #3a8c75;outline-offset:2px}
