/* Step-by-step math tools: input panel, worked solution, matrices.
   Colours follow the site palette; the build appends dark-theme variants. */
.steps-app{margin:8px 0 28px}
.steps-app .lead{max-width:780px}
.steps-layout{display:grid;grid-template-columns:minmax(0,380px) minmax(0,1fr);gap:20px;align-items:start}
.steps-panel{border:1px solid #cfded5;border-radius:12px;background:#f7faf8;padding:16px;position:sticky;top:12px}
.steps-panel label,.steps-panel legend{display:block;color:#335c45;font-size:13px;font-weight:650;margin:12px 0 6px}
.steps-panel label:first-child{margin-top:0}
.steps-panel fieldset{border:0;margin:0;padding:0;min-width:0}
.steps-panel input,.steps-panel select,.steps-panel textarea{display:block;width:100%;box-sizing:border-box;min-height:44px;border:1px solid #c3d7c8;border-radius:8px;padding:9px 10px;background:#fff;color:#183d2c;font:400 15px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif}
.steps-panel .steps-expression,.steps-panel textarea{font:500 20px/1.45 'Cambria Math',Cambria,Georgia,serif}
.steps-panel textarea{resize:vertical;min-height:96px}
.steps-panel input:focus-visible,.steps-panel select:focus-visible,.steps-panel textarea:focus-visible{outline:3px solid #087e68;outline-offset:1px}
.steps-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(96px,1fr));gap:10px}
.steps-row label{margin-top:12px}
.steps-help{margin:6px 0 0;font-size:12px;line-height:1.6;color:#5d7064}
.steps-preview{min-height:28px;margin:8px 0 0;padding:6px 10px;border-radius:8px;background:#fff;border:1px dashed #cadbd0;font-size:15px;color:#24473a;overflow-x:auto}
.steps-preview[data-state=error]{color:#a23124;border-color:#e5b9b1;background:#fff7f5;font-size:13px}
.steps-keys{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}
.steps-keys button{min-width:44px;min-height:40px;border:1px solid #d5e1d8;border-radius:8px;background:#fff;color:#1f3a2c;font:500 15px/1 'Cambria Math',Cambria,Georgia,serif;cursor:pointer;padding:0 8px}
.steps-keys button:hover{background:#eef6f1}
.steps-keys button:focus-visible,.steps-examples button:focus-visible,.steps-submit:focus-visible{outline:3px solid #087e68;outline-offset:2px}
.steps-actions{display:flex;gap:8px;margin-top:16px}
.steps-submit{flex:1;min-height:48px;border:0;border-radius:9px;background:#087e68;color:#fff;font:650 15px/1 system-ui,-apple-system,"Segoe UI",sans-serif;cursor:pointer}
.steps-submit:hover{background:#066d5a}
.steps-submit:disabled{opacity:.6;cursor:progress}
.steps-examples{margin-top:14px;font-size:13px;color:#42634c}
.steps-examples p{margin:0 0 6px;font-weight:650}
.steps-examples button{display:inline-flex;align-items:center;min-height:40px;margin:0 4px 6px 0;padding:6px 10px;border:1px solid #cfe0d5;border-radius:20px;background:#fff;color:#1f4b37;font:500 14px/1.2 'Cambria Math',Cambria,Georgia,serif;cursor:pointer}
.steps-examples button:hover{background:#eef6f1}
.steps-status{min-height:20px;margin:10px 0 0;font-size:13px;color:#4f6a5a}
.steps-status[data-state=error]{color:#a23124}
.steps-output{min-width:0}
.steps-output[aria-busy=true]{opacity:.55}
.step-answer{border:1px solid #bfdccc;border-radius:12px;background:linear-gradient(135deg,#f1faf5,#fff);padding:16px 18px;margin:0 0 18px}
.step-answer-label{display:block;font-size:12px;letter-spacing:.7px;text-transform:uppercase;color:#4f705c;font-weight:700;margin-bottom:6px}
.step-answer-math{font:500 clamp(19px,2.4vw,25px)/1.7 'Cambria Math',Cambria,Georgia,serif;color:#123827;overflow-x:auto;overflow-y:hidden}
.step-answer-extra{margin:8px 0 0;font-size:15px;color:#36584a}
.steps-title{font-size:18px;margin:22px 0 10px;color:#173c2c}
.steps-subtitle{font-size:15px;margin:16px 0 8px;color:#2d5442}
.step-list,.step-sub{list-style:none;margin:0;padding:0}
.step-list>.step{position:relative;margin:0 0 12px;padding:12px 14px 12px 16px;border:1px solid #dbe7df;border-left:4px solid #0a8a71;border-radius:10px;background:#fff}
.step-sub{margin:8px 0 6px;padding-left:14px;border-left:2px solid #d7e6dc}
.step-sub>.step,.step-sub>.step-group{margin:8px 0;padding:6px 0 6px 6px}
.step-rule{margin:0 0 6px;font-size:14px;color:#21483a;line-height:1.6}
.step-rule strong{color:#0a6f5b}
.step-formula{display:inline;margin-left:6px;padding:1px 8px;border-radius:12px;-webkit-box-decoration-break:clone;box-decoration-break:clone;background:#eef6f1;color:#2b4d3d;font:400 14px/1.7 'Cambria Math',Cambria,Georgia,serif}
.step-math{margin:4px 0;font:400 18px/1.9 'Cambria Math',Cambria,Georgia,serif;color:#16362a;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:#9bb5a8 transparent}
.step-note{margin:4px 0;font-size:14px;line-height:1.7;color:#3c5c4c}
.step-note .mx{font-size:16px}
.step-ops{display:flex;flex-wrap:wrap;gap:6px 14px;margin:0 0 8px;font:500 15px/1.6 'Cambria Math',Cambria,Georgia,serif;color:#0a6f5b}
.step-warning{border:1px solid #ecd9b0;background:#fff8e9;color:#6e4a12;border-radius:10px;padding:12px 14px;font-size:14px;line-height:1.7}
.step-checks{margin:6px 0;padding-left:20px;font:400 16px/1.9 'Cambria Math',Cambria,Georgia,serif;color:#16362a}
.step-block{border:1px solid #dbe7df;border-radius:10px;background:#fff;padding:12px 14px;overflow-x:auto}
.step-tables{display:flex;flex-wrap:wrap;gap:14px}
.step-table{border-collapse:collapse;font-size:13px;font-variant-numeric:tabular-nums;min-width:200px}
.step-table caption{text-align:left;font-weight:650;color:#2d5442;padding:0 0 4px}
.step-table th,.step-table td{border-bottom:1px solid #e1ebe5;padding:4px 10px;text-align:right}
.step-table th{color:#456555;font-weight:600}
.approx{color:#5d7064;font-size:.82em;white-space:nowrap}
/* math typesetting */
.mx{font-family:'Cambria Math',Cambria,Georgia,serif;white-space:nowrap}
.mx i,.step-formula i,.step-rule i,.step-note i,.step-answer-math i{font-style:italic;padding-right:.06em}
.mf{display:inline-flex;flex-direction:column;vertical-align:middle;text-align:center;margin:0 2px;line-height:1.15}
.mfn-top{padding:0 3px 1px;border-bottom:1px solid currentColor}
.mfn-bottom{padding:1px 3px 0}
.mf .mf{font-size:.92em}
.mroot{display:inline-flex;align-items:flex-start;white-space:nowrap}
.mrad{border-top:1px solid currentColor;padding:0 2px;margin-top:.12em}
.mp{font-weight:300}
.mfn{font-style:normal}
.mlim{display:inline-flex;flex-direction:column;align-items:center;vertical-align:middle;line-height:1.1;margin-right:4px}
.mlim sub{font-size:.62em;white-space:nowrap}
.md-op{font-style:normal;margin-right:1px}
.mi-op{font-size:1.25em;margin-right:2px}
.steps-app sup,.steps-guide sup{vertical-align:super;font-size:.72em;line-height:0}
.steps-app sub,.steps-guide sub{vertical-align:sub;font-size:.72em;line-height:0}
/* matrices */
.mat{display:inline-table;vertical-align:middle;border-collapse:separate;border-spacing:0;margin:4px 2px;position:relative;border-left:2px solid #2d5442;border-right:2px solid #2d5442;border-radius:6px;padding:0 4px}
.mat td{padding:3px 10px;text-align:center;font:400 16px/1.5 'Cambria Math',Cambria,Georgia,serif;min-width:28px}
.mat td.mat-split{border-left:1px solid #7c978a}
.mat-eq{display:flex;flex-wrap:wrap;align-items:center;gap:6px;overflow-x:auto}
/* matrix input grid */
.matrix-input{margin:6px 0 0}
.matrix-size{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.matrix-size select{width:auto;min-width:64px}
.matrix-grid{display:grid;gap:5px;margin-top:8px;overflow-x:auto;padding-bottom:2px}
.matrix-grid input{min-width:46px;min-height:40px;padding:6px 4px;text-align:center;font:500 16px/1.2 'Cambria Math',Cambria,Georgia,serif}
.steps-guide{margin-top:32px}
.steps-related{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0 0;padding:0;list-style:none}
.steps-related a{display:inline-flex;align-items:center;min-height:40px;padding:6px 12px;border:1px solid #cfe0d5;border-radius:20px;color:#0a6f5b;text-decoration:none;font-size:14px;background:#fff}
.steps-related a:hover{background:#eef6f1}
.steps-faq{border-bottom:1px solid #dfe9e3;padding:4px 0}
.steps-faq summary{min-height:44px;display:flex;align-items:center;font-weight:600;cursor:pointer}
.steps-examples-list li{margin:6px 0;line-height:1.8}
.steps-examples-list code{font:500 15px/1.6 'Cambria Math',Cambria,Georgia,serif;background:#f1f6f3;border-radius:5px;padding:1px 6px}
[hidden]{display:none!important}
@media(max-width:860px){
 .steps-layout{grid-template-columns:minmax(0,1fr)}
 .steps-panel{position:static}
 .step-math{font-size:17px}
 .step-list>.step{padding:10px 10px 10px 12px}
 .step-sub{padding-left:8px}
}

:root[data-theme=dark]{color-scheme:dark;--bg:#0b1311;--surface:#121c1a;--text:#e4ece9;--muted:#a3b5b0;--line:#26342f;--green:#087e68;--mint:#16302a;--dark:#0e2b25}:root[data-theme=dark] .steps-panel{border:1px solid #385243;background:#111c15}:root[data-theme=dark] .steps-panel label,:root[data-theme=dark] .steps-panel legend{color:#b5d6c4}:root[data-theme=dark] .steps-panel input,:root[data-theme=dark] .steps-panel select,:root[data-theme=dark] .steps-panel textarea{border:1px solid #3b5842;background:#101715;color:#c4e8d7}:root[data-theme=dark] .steps-help{color:#aebcb3}:root[data-theme=dark] .steps-preview{background:#101715;border:1px dashed #395543;color:#c0dfd4}:root[data-theme=dark] .steps-preview[data-state=error]{color:#dd9188;border-color:#613b34;background:#1e110e}:root[data-theme=dark] .steps-keys button{border:1px solid #384e3e;background:#101715;color:#c8e2d4}:root[data-theme=dark] .steps-keys button:hover{background:#122218}:root[data-theme=dark] .steps-examples{color:#b3ccbb}:root[data-theme=dark] .steps-examples button{border:1px solid #365440;background:#101715;color:#93d2b5}:root[data-theme=dark] .steps-examples button:hover{background:#122218}:root[data-theme=dark] .steps-status{color:#b0c4b8}:root[data-theme=dark] .steps-status[data-state=error]{color:#dd9188}:root[data-theme=dark] .step-answer{border:1px solid #345f47;background:linear-gradient(135deg,#0f2217,#101715)}:root[data-theme=dark] .step-answer-label{color:#acc5b6}:root[data-theme=dark] .step-answer-math{color:#c5ecdb}:root[data-theme=dark] .step-answer-extra{color:#b8d4c9}:root[data-theme=dark] .steps-title{color:#c4e8d9}:root[data-theme=dark] .steps-subtitle{color:#badacb}:root[data-theme=dark] .step-list>.step{border:1px solid #344d3c;background:#101715}:root[data-theme=dark] .step-sub{border-left:2px solid #32513d}:root[data-theme=dark] .step-rule{color:#96cfbb}:root[data-theme=dark] .step-rule strong{color:#88ddcc}:root[data-theme=dark] .step-formula{background:#122218;color:#bedbcd}:root[data-theme=dark] .step-math{color:#c8e9dc}:root[data-theme=dark] .step-note{color:#b7d0c3}:root[data-theme=dark] .step-ops{color:#88ddcc}:root[data-theme=dark] .step-warning{border:1px solid #5f5133;background:#231d10;color:#ddbc88}:root[data-theme=dark] .step-checks{color:#c8e9dc}:root[data-theme=dark] .step-block{border:1px solid #344d3c;background:#101715}:root[data-theme=dark] .step-table caption{color:#badacb}:root[data-theme=dark] .step-table th,:root[data-theme=dark] .step-table td{border-bottom:1px solid #324b3c}:root[data-theme=dark] .step-table th{color:#b2cbbe}:root[data-theme=dark] .approx{color:#aebcb3}:root[data-theme=dark] .steps-related a{border:1px solid #365440;color:#88ddcc;background:#101715}:root[data-theme=dark] .steps-related a:hover{background:#122218}:root[data-theme=dark] .steps-faq{border-bottom:1px solid #334b3d}:root[data-theme=dark] .steps-examples-list code{background:#141f18}