/* Scoped school arithmetic. Cell sizing remains tactile; large operations scroll. */
.lg-shell .lga-workpad{--lga-cell:clamp(2.3rem,3.1vw,3.15rem);--lga-ink:#172b42;color:var(--lga-ink);background:#fcfcf8;border:2px solid #c9d5dd;border-radius:18px;padding:12px;min-width:0;box-sizing:border-box;font-family:Arial,sans-serif}
.lg-shell .lga-workpad *{box-sizing:border-box}
.lg-shell .lga-toolbar,.lg-shell .lga-numbers,.lg-shell .lga-bottom{display:flex;align-items:center;justify-content:space-between;gap:10px}
.lg-shell .lga-toolbar{margin-bottom:10px}
.lg-shell .lga-operation-types{display:flex;gap:5px}
.lg-shell .lga-button{appearance:none;display:inline-flex;justify-content:center;align-items:center;min-width:44px;min-height:44px;padding:7px 11px;background:#e8eff3;color:#24405b;border:2px solid #c4d1da;border-radius:10px;font-family:inherit;font-size:1.15rem;font-weight:800;line-height:1;cursor:pointer;touch-action:manipulation}
.lg-shell .lga-operation-types .lga-button{font-size:1.65rem}
.lg-shell .lga-button.is-active{background:#255b76;color:#fff;border-color:#163c54;box-shadow:0 2px 0 #122d40}
.lg-shell .lga-reset{color:#6e4b49;background:#f5eeeb;border-color:#e4d4cd}
.lg-shell .lga-operand{appearance:none;display:grid;gap:4px;flex:1;min-width:0;min-height:69px;padding:7px 10px;text-align:center;border:2px solid #c9d6dc;border-radius:10px;background:#fff;color:var(--lga-ink);font-family:inherit;cursor:pointer;touch-action:manipulation}
.lg-shell .lga-operand small{font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.035em;color:#5b6e7d}
.lg-shell .lga-operand strong{display:block;overflow-wrap:anywhere;font:800 clamp(1.4rem,2.7vw,2rem)/1.2 ui-monospace,monospace}
.lg-shell .lga-workpad.is-prepared .lga-operand{min-height:54px;padding:5px 9px;gap:2px}
.lg-shell .lga-workpad.is-prepared .lga-operand strong{font-size:1.4rem}
.lg-shell .lga-selected-sign{font-size:1.8rem;font-weight:800}
.lg-shell .lga-operand.is-selected,.lg-shell .lga-entry.is-selected{background:#fff5cf;border-color:#b57a16;outline:3px solid #e5bb4e;outline-offset:1px;z-index:1}
.lg-shell .lga-prepare{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;padding:17px 0 6px}
.lg-shell .lga-prepare span,.lg-shell .lga-bottom>span{font-size:.78rem;color:#5f7180}
.lg-shell .lga-prepare-button,.lg-shell .lga-check{background:#e4f1e7;color:#22543b;border-color:#b7d0be}
.lg-shell .lga-sheet-scroll{overflow:auto;max-height:440px;padding:12px 5px 9px;margin:6px -3px 3px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.lg-shell .lga-sheet{width:max-content;min-width:min(100%,180px);margin:0 auto;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;background:#fff;border-radius:10px;padding:10px 6px}
.lg-shell .lga-row{display:flex;justify-content:flex-end;align-items:center;min-height:var(--lga-cell);gap:3px;position:relative}
.lg-shell .lga-cell{display:inline-flex;align-items:center;justify-content:center;flex:0 0 var(--lga-cell);width:var(--lga-cell);min-width:var(--lga-cell);height:var(--lga-cell);min-height:var(--lga-cell);font:700 calc(var(--lga-cell)*.65)/1 ui-monospace,monospace;color:var(--lga-ink);padding:0;border:2px solid transparent;background:transparent;vertical-align:middle}
.lg-shell .lga-entry{appearance:none;border:1px solid #b9ccd8;border-radius:5px;cursor:pointer;background:#f1f7fc;touch-action:manipulation}
.lg-shell .lga-entry>span{opacity:.25}
.lg-shell .lga-sign{display:inline-flex;align-items:center;justify-content:center;width:1.7rem;flex:0 0 1.7rem;font-size:1.8rem;font-weight:700}
.lg-shell .lga-comma{position:absolute;bottom:0;width:.5rem;height:calc(var(--lga-cell)*.8);display:flex;align-items:flex-end;justify-content:center;font-size:calc(var(--lga-cell)*.65);line-height:.8;pointer-events:none;z-index:2}
.lg-shell .lga-second{border-bottom:3px solid #233f55;padding-bottom:6px;margin-bottom:5px}
.lg-shell .lga-notes-caption{font:700 .65rem/1.3 Arial,sans-serif;color:#657886;margin-left:2rem;margin-bottom:4px}
.lg-shell .lga-notes-caption small{font-size:.6rem;font-weight:400}
.lg-shell .lga-notes{margin-bottom:5px}
.lg-shell .lga-note{height:28px;min-height:28px;font-size:1rem;color:#3d7b7b;background:#eff8f4;border:1px dashed #9fbfb4}
.lg-shell .lga-notes .lga-comma{height:28px;opacity:0}
.lg-shell .lga-notes .lga-sign{height:28px}
.lg-shell .lga-partial{margin-bottom:4px}
.lg-shell .lga-partial .lga-entry{background:#f5f7f0}
.lg-shell .lga-partial+.lga-answer{border-top:3px solid #233f55;padding-top:6px;margin-top:5px}
.lg-shell .lga-answer .lga-entry{background:#eaf4ff;border-color:#9dbbcd}
.lg-shell .lga-shift{color:#a4b1ba;font-size:1.5rem}
.lg-shell .lga-bottom{margin-top:8px;flex-wrap:wrap}
.lg-shell .lga-check{font-size:.9rem}
.lg-shell .lga-message{font:700 .9rem/1.4 Arial,sans-serif;margin:10px 0 0;color:#88412e;text-align:center}
.lg-shell .lga-message.is-success{color:#276146}
.lg-shell .lga-entry.is-incorrect{border:2px solid #b55442;background:#fff0e8;color:#832f26}
.lg-shell .lga-entry.is-correct{border:2px solid #4a9671;background:#e8f7ed;color:#21543d}
.lg-shell .lga-division-sheet{display:grid;grid-template-columns:max-content max-content;gap:0;align-items:start;padding:10px}
.lg-shell .lga-dividend{padding-right:10px}
.lg-shell .lga-division-row{display:flex;gap:3px;margin-bottom:4px}
.lg-shell .lga-divisor{min-width:calc(var(--lga-cell)*2 + 18px);border-left:3px solid #233f55;padding-left:8px}
.lg-shell .lga-divisor-top{display:flex;border-bottom:3px solid #233f55;padding-bottom:6px;margin-bottom:6px}
.lg-shell .lga-quotient{display:flex;gap:3px}
.lg-shell .lga-div-product{border-bottom:2px solid #98a8b5;padding-bottom:4px;position:relative}
.lg-shell .lga-div-product:before{content:'−';position:absolute;left:-11px;top:10px;font-size:1.2rem}
.lg-shell .lga-dividend-top{margin-bottom:7px}
.lg-shell .lga-remainder{display:grid;gap:5px;margin-top:14px}
.lg-shell .lga-remainder>small{font:700 .72rem/1 Arial,sans-serif;color:#657886}
.lg-shell .lga-remainder>div{display:flex;gap:3px}
.lg-shell .lga-button:focus-visible,.lg-shell .lga-cell:focus-visible,.lg-shell .lga-operand:focus-visible{outline:3px solid #cd971c;outline-offset:2px}
.lg-shell .lg-high-contrast .lga-workpad{border-color:#fff;color:#121212;background:#fff}
@media(max-width:600px){.lg-shell .lga-workpad{--lga-cell:2.6rem;padding:9px}.lg-shell .lga-operation-types{gap:4px}.lg-shell .lga-button{padding:6px 9px}.lg-shell .lga-operand strong{font-size:1.55rem}.lg-shell .lga-sheet-scroll{max-height:400px}.lg-shell .lga-bottom>span{font-size:.7rem}}
@media(pointer:coarse){.lg-shell .lga-workpad{--lga-cell:2.75rem}.lg-shell .lga-note{height:44px;min-height:44px}.lg-shell .lga-notes .lga-comma,.lg-shell .lga-notes .lga-sign{height:44px}}
