:root{--bg:#f5f8fc;--panel:#fff;--muted:#6a768b;--text:#1b2940;--stroke:#e0e6f0;--subtle:#f0f4fa;--accent:#5b5ce2;--accent-hover:#4c4ed4;--input:#fff;--shadow:0 12px 35px rgba(23,39,70,.10);font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color-scheme:light}
html[data-theme="dark"]{--bg:#091524;--panel:#111e30;--muted:#9baaC1;--text:#eef3fa;--stroke:#26364a;--subtle:#1d2d42;--accent:#7777fc;--accent-hover:#9191ff;--input:#15263b;--shadow:0 12px 40px rgba(0,0,0,.35);color-scheme:dark}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden}body{background:var(--bg);color:var(--text)}button,input,textarea,select{font:inherit}button{cursor:pointer}button:focus-visible,a:focus-visible,textarea:focus-visible,select:focus-visible,input:focus-visible,canvas:focus-visible{outline:3px solid #a6b3fc;outline-offset:2px}button:disabled{opacity:.45;cursor:not-allowed}[hidden]{display:none!important}
.studio{display:grid;grid-template-columns:365px minmax(0,1fr);grid-template-rows:68px minmax(0,1fr);height:100dvh;width:100%}
.topbar{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:0 20px 0 17px;z-index:20;background:var(--panel);border-bottom:1px solid var(--stroke)}
.brand{display:flex;align-items:center;gap:10px;min-width:190px}.home-icon{display:grid;place-items:center;width:37px;height:37px;border:1px solid var(--stroke);border-radius:11px;text-decoration:none;color:var(--text);font-size:30px;line-height:1}.brand-words small{display:block;font-size:10px;letter-spacing:1.2px;color:var(--muted);font-weight:700;text-transform:uppercase}.brand-words h1{font-size:17px;font-weight:740;letter-spacing:-.5px;margin:2px 0 0}.dimension-switch{display:flex;gap:3px;background:var(--subtle);border:1px solid var(--stroke);border-radius:13px;padding:4px}.dimension-switch a{min-width:58px;padding:8px 15px;border-radius:9px;text-align:center;font-size:13px;font-weight:750;color:var(--muted);text-decoration:none}.dimension-switch a.selected{background:var(--accent);color:#fff;box-shadow:0 2px 8px #4545c03d}.top-actions{display:flex;align-items:center;gap:8px}.quiet-button,.primary-button{border:1px solid var(--stroke);border-radius:10px;min-height:37px;padding:8px 12px;font-size:12px;font-weight:750;background:var(--panel);color:var(--text)}.quiet-button:hover{background:var(--subtle)}.primary-button{background:var(--accent);color:#fff;border-color:var(--accent)}.primary-button:hover{background:var(--accent-hover)}
.editor-mobile-close{display:none}.editor{grid-column:1;grid-row:2;min-height:0;overflow:auto;background:var(--panel);border-right:1px solid var(--stroke);scrollbar-width:thin;overscroll-behavior:contain}.intro{padding:25px 23px 19px}.intro-eyebrow{font-size:10px;letter-spacing:1.2px;text-transform:uppercase;color:var(--accent);font-weight:850}.intro h2{font-size:21px;letter-spacing:-.6px;margin:7px 0 6px}.intro p{font-size:12px;line-height:1.65;color:var(--muted);margin:0}.panel-divider{height:1px;background:var(--stroke)}.editor-section{padding:20px 21px 18px;border-bottom:1px solid var(--stroke)}.section-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:15px}.section-heading h2{font-size:15px;letter-spacing:-.2px;margin:0}.section-heading h3{font-size:12px;margin:0}.count{background:var(--subtle);color:var(--muted);min-width:23px;text-align:center;border-radius:8px;font-size:11px;font-weight:800;padding:4px 6px}.editor form label{display:block;font-size:11px;font-weight:700;margin-bottom:9px;color:var(--muted)}textarea{width:100%;resize:vertical;min-height:69px;border:1px solid var(--stroke);background:var(--input);color:var(--text);border-radius:11px;padding:12px 13px;font-size:13px;line-height:1.5;outline:none}textarea:focus{border-color:var(--accent)}.composer-actions{display:flex;gap:8px;margin-top:8px}.composer-actions .primary-button{flex:1}.composer-actions .quiet-button{flex:0}.form-error{color:#db534e;min-height:0;font-size:12px;line-height:1.5;margin:6px 0 0}.form-error:empty{display:none}.field-hint{font-size:11px;color:var(--muted);line-height:1.7;margin:10px 0 18px}.field-hint code,.editor-bottom code{background:var(--subtle);color:var(--text);font-size:11px;padding:2px 4px;border-radius:4px}.examples-heading{margin:0 0 10px}.preset-categories>span{display:block;margin:13px 0 8px;font-size:10px;font-weight:850;color:var(--muted);letter-spacing:.55px;text-transform:uppercase}.chip-row{display:flex;flex-wrap:wrap;gap:7px}.chip-row button{background:var(--subtle);border:1px solid var(--stroke);color:var(--text);border-radius:8px;font-size:11px;padding:7px 10px;font-weight:700}.chip-row button:hover{color:var(--accent);border-color:var(--accent)}.layers{display:grid;gap:9px;margin-top:20px}.graph-layer{border:1px solid var(--stroke);border-radius:11px;background:var(--panel);padding:11px}.layer-top{display:flex;align-items:center;gap:7px}.layer-equation{min-width:0;flex:1;text-align:left;border:0;background:transparent;color:var(--text);font-size:12px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:5px 0}.layer-equation:hover{text-decoration:underline}.layer-type{margin:5px 0 0 36px;font-size:10px;color:var(--muted)}.layer-color{width:24px;height:26px;border:0;background:transparent;padding:0;cursor:pointer;flex:0 0 24px}.layer-button{border:1px solid var(--stroke);background:var(--subtle);border-radius:7px;min-width:27px;height:27px;font-size:12px;color:var(--muted)}.graph-layer.invisible{opacity:.56}.layer-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:14px 0 0}.text-button{border:0;background:transparent;color:var(--accent);font-size:11px;font-weight:750;padding:3px}.layer-footer span{color:var(--muted);font-size:10px}.live-dot{font-size:10px;color:#1ea47d}.parameter{padding:10px 0;border-bottom:1px solid var(--stroke)}.parameter:last-child{border-bottom:0}.parameter-top{display:flex;justify-content:space-between;align-items:center;font-size:12px;font-weight:750}.parameter-top output{font-variant-numeric:tabular-nums;color:var(--accent)}.parameter input[type="range"]{width:100%;accent-color:var(--accent);margin:9px 0 0}.animate{margin-top:12px;width:100%}
.select-setting{display:flex;justify-content:space-between;gap:15px;align-items:center;margin:11px 0;font-size:12px}.select-setting select{background:var(--input);color:var(--text);border:1px solid var(--stroke);padding:7px;border-radius:8px;width:143px}.toggle-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px 9px;margin-top:18px}.toggle-grid label{font-size:11px;color:var(--text);display:flex;align-items:center;gap:6px}.toggle-grid input{accent-color:var(--accent)}.slice-setting{margin-top:17px}.slice-setting label{display:flex;justify-content:space-between;font-size:11px;font-weight:700}.slice-setting input{width:100%;accent-color:var(--accent)}.domain-settings{font-size:11px;margin-top:19px;color:var(--muted)}.domain-settings summary{font-size:12px;font-weight:750;color:var(--text);cursor:pointer}.domain-settings p{line-height:1.5}.domain-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:11px 0}.domain-grid input{display:block;margin-top:4px;width:100%;font-size:12px;border:1px solid var(--stroke);border-radius:7px;padding:7px;color:var(--text);background:var(--input)}.editor-bottom{padding:19px 23px 32px;color:var(--muted);font-size:11px;line-height:1.7}.editor-bottom strong{color:var(--text);font-size:12px}
.viewport{grid-column:2;grid-row:2;position:relative;min-width:0;min-height:0;overflow:hidden;background:var(--bg)}canvas{display:block;width:100%;height:100%;touch-action:none;cursor:grab}canvas.dragging{cursor:grabbing}.view-label{position:absolute;left:25px;top:22px;font-size:10px;letter-spacing:1.3px;color:var(--muted);font-weight:800;pointer-events:none}.view-status-dot{display:inline-block;width:7px;height:7px;background:#29b88a;border-radius:50%;margin-right:6px}.view-label-separator{color:var(--stroke);margin:0 8px}#renderStatus3d{letter-spacing:0;text-transform:none;font-weight:550}.viewport-hint{position:absolute;left:24px;bottom:24px;pointer-events:none;padding:10px 13px;border:1px solid var(--stroke);background:var(--panel);color:var(--muted);border-radius:9px;box-shadow:var(--shadow);font-size:11px;white-space:nowrap}.view-tools{position:absolute;right:23px;bottom:25px;display:flex;gap:4px;align-items:center;background:var(--panel);border:1px solid var(--stroke);padding:5px;border-radius:12px;box-shadow:var(--shadow)}.view-tools button{min-width:37px;height:35px;border:0;background:transparent;border-radius:8px;color:var(--text);font-size:13px;font-weight:750}.view-tools button:hover{background:var(--subtle)}.toolbar-line{width:1px;height:22px;background:var(--stroke);margin:0 3px}.nav-cube{position:absolute;right:36px;top:28px;display:grid;width:67px;height:67px;transform:rotate(-12deg);border:1.5px solid var(--stroke);border-radius:16px;background:var(--panel);box-shadow:var(--shadow);pointer-events:none}.nav-cube span{position:absolute;font-size:13px;font-weight:850}.cube-z{color:#669ef7;top:9px;left:31px}.cube-y{color:#34ba96;bottom:14px;left:12px}.cube-x{color:#f26a72;bottom:14px;right:11px}.mobile-editor-toggle{display:none}.toast3d{position:absolute;left:50%;top:75px;transform:translateX(-50%);color:var(--text);background:var(--panel);box-shadow:var(--shadow);border:1px solid var(--stroke);padding:10px 14px;border-radius:10px;font-size:12px;font-weight:650;white-space:nowrap;max-width:calc(100% - 30px);overflow:hidden;text-overflow:ellipsis}
@media(max-width:900px){.studio{grid-template-columns:315px minmax(0,1fr)}.topbar{padding:0 12px;gap:8px}.editor-section{padding:17px 15px}.intro{padding:23px 15px}.top-actions{gap:4px}.top-actions .quiet-button span{display:none}}
@media(max-width:700px){.studio{grid-template-columns:minmax(0,1fr);grid-template-rows:60px minmax(0,1fr)}.brand{min-width:0}.brand-words h1{font-size:14px}.brand-words small{font-size:8px}.topbar{gap:4px}.dimension-switch a{min-width:35px;padding:7px 10px}.top-actions .quiet-button{min-width:31px;padding:6px}.export-button{padding:7px 9px;min-height:34px}.export-button span{display:none}.editor{position:absolute;top:60px;bottom:0;left:0;width:min(90vw,365px);z-index:15;box-shadow:var(--shadow);transform:translateX(-110%);transition:transform .22s ease}.editor.open{transform:translateX(0)}.editor-mobile-close{display:block;position:sticky;top:0;z-index:4;width:100%;text-align:right;border:0;border-bottom:1px solid var(--stroke);background:var(--panel);color:var(--accent);font-size:12px;font-weight:750;padding:11px 19px}.viewport{grid-column:1;grid-row:2}.mobile-editor-toggle{position:absolute;left:13px;top:60px;display:block;background:var(--panel);color:var(--text);padding:10px 12px;border-radius:10px;font-size:12px;font-weight:750;border:1px solid var(--stroke);box-shadow:var(--shadow)}.nav-cube{width:57px;height:57px;right:16px;top:18px}.view-label{left:15px;top:20px;max-width:calc(100% - 105px);font-size:9px}.viewport-hint{left:10px;bottom:81px;font-size:10px;max-width:calc(100% - 20px);white-space:normal}.view-tools{bottom:16px;right:12px}.view-tools button{min-width:32px;height:32px}.editor.open~.viewport .mobile-editor-toggle{background:var(--accent);color:#fff}}
@media(prefers-reduced-motion:reduce){.editor{transition:none}}
/* Integrated 3D problem gallery: question selection uses the same workspace as custom expressions. */
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.problem-library-intro{font-size:11px;line-height:1.6;color:var(--muted);margin:0 0 12px}
.problem-library-filters{display:grid;grid-template-columns:minmax(0,1fr) 112px;gap:7px;margin-bottom:10px}
.problem-library-filters input,.problem-library-filters select{width:100%;min-width:0;min-height:36px;background:var(--input);color:var(--text);border:1px solid var(--stroke);border-radius:9px;font-size:11px;padding:8px}
.problem-library-filters input:focus,.problem-library-filters select:focus{border-color:var(--accent)}
.problem-library-status{color:var(--muted);font-size:11px;line-height:1.5;margin:5px 0 10px}
.problem-library-list{display:grid;gap:7px;max-height:290px;overflow:auto;scrollbar-width:thin;overscroll-behavior:contain;padding:1px 3px 1px 1px}
.problem-library-item{display:flex;flex-direction:column;text-align:left;gap:4px;padding:10px 12px;border:1px solid var(--stroke);border-radius:10px;color:var(--text);background:var(--panel);width:100%;transition:border-color .12s,background .12s}
.problem-library-item:hover{border-color:var(--accent);background:var(--subtle)}
.problem-library-item.selected{border-color:var(--accent);background:var(--subtle);box-shadow:inset 3px 0 0 var(--accent)}
.problem-library-item-top{display:flex;justify-content:space-between;align-items:center;gap:8px}
.problem-library-code{font-size:10px;font-weight:800;color:var(--accent);letter-spacing:.6px}
.problem-library-difficulty{text-transform:capitalize;font-size:10px;font-weight:700;color:var(--muted);background:var(--subtle);border:1px solid var(--stroke);border-radius:7px;padding:2px 6px}
.problem-library-difficulty.difficulty-easy{color:#188260}.problem-library-difficulty.difficulty-hard{color:#bf6a22}
.problem-library-item strong{font-size:12px;line-height:1.35;font-weight:740}
.problem-library-item small{font-size:10px;color:var(--muted);text-transform:capitalize}
.selected-problem3d{margin-top:14px;padding:13px;border:1px solid var(--accent);border-radius:11px;background:var(--subtle)}
.selected-problem-heading{display:grid;gap:4px}.selected-problem-heading strong{font-size:12px;line-height:1.4}.selected-problem-heading span{font-size:10px;color:var(--muted);text-transform:capitalize}
.selected-problem3d p{color:var(--text);font-size:11px;line-height:1.65;margin:9px 0 12px;white-space:pre-wrap}
.selected-problem-actions{display:grid;gap:7px}.selected-problem-actions a{text-align:center;text-decoration:none;min-height:38px;display:grid;place-items:center}.selected-problem-actions button{min-height:35px}
.problem-library-footnote{font-size:11px;margin:13px 0 0}.problem-library-footnote a{color:var(--accent);font-weight:700;text-decoration:none}.problem-library-footnote a:hover{text-decoration:underline}
.problem-stage-banner{position:absolute;z-index:2;top:70px;left:24px;max-width:min(415px,calc(100% - 120px));background:var(--panel);border:1px solid var(--stroke);border-radius:12px;padding:11px 12px;box-shadow:var(--shadow);display:flex;align-items:center;gap:16px}
.problem-stage-banner>div{min-width:0;display:grid;gap:3px}.problem-stage-banner small{font-size:9px;font-weight:850;color:var(--accent);letter-spacing:.5px}.problem-stage-banner strong{font-size:12px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.problem-stage-banner a{white-space:nowrap;font-size:11px;background:var(--accent);color:#fff;padding:8px 10px;text-decoration:none;font-weight:750;border-radius:8px}
@media(max-width:700px){.problem-stage-banner{left:12px;right:12px;top:113px;max-width:none;padding:9px 10px;gap:9px}.problem-stage-banner strong{font-size:11px}.problem-stage-banner a{font-size:10px}.problem-library-list{max-height:42vh}}

/* Side-by-side solving: problems remain visible while rotating the canvas. */
.studio.solver-open{grid-template-columns:340px minmax(0,1fr) 335px}
.studio.solver-open .viewport{grid-column:2}
.solver3d{grid-column:3;grid-row:2;min-width:0;min-height:0;overflow:auto;background:var(--panel);border-left:1px solid var(--stroke);padding:22px 20px 28px;scrollbar-width:thin}
.solver3d-top{display:flex;align-items:center;justify-content:space-between;gap:9px;font-size:10px;color:var(--accent);font-weight:850;letter-spacing:.8px;text-transform:uppercase}
.solver3d-top button{border:1px solid var(--stroke);border-radius:8px;background:var(--subtle);color:var(--text);width:32px;height:32px}
.solver3d h2{font-size:20px;line-height:1.25;letter-spacing:-.4px;margin:18px 0 6px;color:var(--text)}
.solver3d-meta{font-size:11px;color:var(--muted);text-transform:capitalize;margin:0 0 20px}
.solver3d-statement{font-size:13px;line-height:1.75;color:var(--text);white-space:pre-wrap}
.solver3d-caption{font-size:11px;line-height:1.6;color:var(--muted);background:var(--subtle);padding:10px 12px;border-radius:9px}
.solver3d-form{display:grid;gap:9px;margin:22px 0;border-top:1px solid var(--stroke);padding-top:17px}
.solver3d-form label{font-size:12px;font-weight:750;color:var(--text)}
.solver3d-form input{height:43px;border:1px solid var(--stroke);border-radius:9px;background:var(--input);padding:10px 12px;color:var(--text);font-size:14px;min-width:0}
.solver3d-form .primary-button{width:100%}
.solver3d-form a.primary-button{display:grid;place-items:center;text-decoration:none}
#solverFeedback3d{font-size:12px;line-height:1.5;min-height:17px;margin:3px 0;color:var(--muted)}
#solverFeedback3d.correct{color:#14805e}#solverFeedback3d.incorrect{color:#b54e3a}
.solver3d-hints{border-top:1px solid var(--stroke);padding-top:13px}
.solver3d-hints h3{font-size:13px;margin:0 0 9px}
.solver3d-hints details{border:1px solid var(--stroke);border-radius:9px;margin:7px 0;background:var(--subtle);padding:10px}
.solver3d-hints summary{cursor:pointer;font-size:12px;font-weight:700}
.solver3d-hints details p{font-size:12px;line-height:1.65;white-space:pre-wrap}
.solver3d-links{display:flex;flex-direction:column;gap:10px;margin-top:19px;font-size:12px}
.solver3d-links a{color:var(--accent);text-decoration:none;font-weight:750}
.solver3d-links button{border:1px solid var(--stroke);border-radius:9px;background:var(--panel);color:var(--text);min-height:36px}
.show-solver-button{position:absolute;top:70px;right:20px;z-index:3;background:var(--accent);color:#fff;border:0;border-radius:9px;padding:10px 13px;font-weight:750;font-size:12px}
.range-setting{margin:14px 0;font-size:12px;color:var(--text)}.range-setting>label{display:block;font-weight:750;margin-bottom:9px}
.range-controls{display:grid;grid-template-columns:40px minmax(0,1fr) 40px;gap:7px}
.range-controls button{background:var(--subtle);border:1px solid var(--stroke);border-radius:8px;color:var(--text);font-size:20px;font-weight:700;cursor:pointer}
.range-controls input{height:39px;min-width:0;text-align:center;border:1px solid var(--stroke);border-radius:8px;color:var(--text);background:var(--input);font-size:15px;font-weight:750}
.range-setting>input[type=range]{width:100%;margin:12px 0 6px;accent-color:var(--accent)}.range-setting small{display:block;color:var(--muted);line-height:1.5}
@media(max-width:1180px) and (min-width:701px){.studio.solver-open{grid-template-columns:285px minmax(0,1fr) 300px}.solver3d{padding:15px 14px}.studio.solver-open .editor-section{padding:16px 13px}}
@media(max-width:700px){.studio.solver-open{grid-template-columns:minmax(0,1fr)}.studio.solver-open .viewport{grid-column:1}.solver3d{position:absolute;z-index:14;right:0;left:0;bottom:0;top:auto;height:min(51dvh,510px);border-top:1px solid var(--stroke);border-left:0;border-radius:16px 16px 0 0;box-shadow:0 -8px 30px #0002;padding:14px 16px 30px}.solver3d h2{font-size:16px;margin:9px 0 3px}.solver3d-meta{margin-bottom:9px}.solver3d-statement{font-size:12px;margin:8px 0}.solver3d-form{margin:12px 0;padding-top:10px}.show-solver-button{top:107px;right:12px}.studio.solver-open .viewport-hint{display:none}}

/* 3D construction challenges use an equation area instead of integer entry. */
.solver3d-form textarea{width:100%;min-height:88px;resize:vertical;font:500 13px/1.6 ui-monospace,Menlo,monospace;padding:11px;border:1px solid var(--stroke);border-radius:9px;background:var(--input);color:var(--text)}
#solverTry3d{width:100%;border-color:var(--accent);color:var(--accent)}

/* 2D-parity 3D solving: one question/answer column and one graph canvas.
   The calculator-only route keeps its original full editor. */
.studio.challenge-mode{grid-template-columns:minmax(315px,410px) minmax(0,1fr);grid-template-rows:68px minmax(0,1fr)}
.studio.challenge-mode .editor{display:none!important}
.studio.challenge-mode .solver3d{display:block!important;grid-column:1;grid-row:2;border-left:0;border-right:1px solid var(--stroke);padding:24px 22px 35px;position:relative;height:auto;top:auto;bottom:auto;left:auto;right:auto;border-radius:0;box-shadow:none;overflow:auto}
.studio.challenge-mode .viewport{grid-column:2;grid-row:2;min-width:0}
.studio.challenge-mode .solver3d-top button,.studio.challenge-mode .problem-stage-banner,.studio.challenge-mode .show-solver-button,.studio.challenge-mode .mobile-editor-toggle,.studio.challenge-mode #solverFullPage3d{display:none!important}
.studio.challenge-mode .solver3d h2{margin:12px 0 6px;font-size:23px}
.studio.challenge-mode .solver3d-meta{margin-bottom:13px}
.studio.challenge-mode .solver3d-statement{font-size:14px;line-height:1.65}
.studio.challenge-mode .solver3d-form{margin:16px 0}
.studio.challenge-mode .solver3d-form textarea{min-height:80px}
.studio.challenge-mode .challenge-graph-tools{display:block;border:1px solid var(--stroke);background:var(--subtle);border-radius:12px;padding:12px 14px;margin-bottom:16px}
.challenge-graph-tools h3{font-size:12px;margin:0 0 10px}
.challenge-graph-tools .range-setting{margin:0 0 12px}
.challenge-graph-tools .layers{margin:8px 0}
.challenge-graph-tools #clear3d{margin-top:8px}
.studio.challenge-mode .solver3d-links{margin-top:10px}
@media(max-width:850px){
  html:has(.studio.challenge-mode),body:has(.studio.challenge-mode){overflow:hidden}
  .studio.challenge-mode{height:100dvh;grid-template-columns:minmax(0,1fr);grid-template-rows:60px minmax(270px,1fr) minmax(210px,42dvh)}
  .studio.challenge-mode .topbar{padding:0 10px;gap:5px}
  .studio.challenge-mode .brand{min-width:0}.studio.challenge-mode .brand-words h1{font-size:13px}
  .studio.challenge-mode .dimension-switch a{min-width:36px;padding:6px}
  .studio.challenge-mode .top-actions .quiet-button span,.studio.challenge-mode .top-actions .export-button span{display:none}
  .studio.challenge-mode .top-actions{gap:4px}.studio.challenge-mode .top-actions button{padding:6px;min-height:30px}
  .studio.challenge-mode .solver3d{grid-column:1;grid-row:2;width:100%;max-height:none;min-height:0;padding:14px 16px 24px;border:0;border-bottom:1px solid var(--stroke);overflow:auto;position:relative;z-index:1}
  .studio.challenge-mode .viewport{grid-column:1;grid-row:3;min-height:0}
  .studio.challenge-mode .solver3d h2{font-size:18px;margin:8px 0 4px}
  .studio.challenge-mode .solver3d-statement{font-size:13px;margin:9px 0}
  .studio.challenge-mode .solver3d-form{margin:11px 0;padding-top:10px}
  .studio.challenge-mode .solver3d-form textarea{min-height:58px}
  .studio.challenge-mode .solver3d-caption{margin:6px 0}
  .studio.challenge-mode .view-label{top:10px}
}

/* Visual-first recognition challenge: reference mesh remains on screen while
   the student plots an orange attempt on the same rotatable coordinate plane. */
.mystery-legend{position:absolute;left:20px;top:55px;z-index:4;border:1px solid var(--stroke);background:var(--panel);border-radius:12px;padding:10px 12px;max-width:min(345px,calc(100% - 35px));font-size:11px;line-height:1.7;box-shadow:var(--shadow);pointer-events:none}
.mystery-legend div{display:flex;align-items:center;gap:7px;font-weight:750}
.mystery-legend p{font-size:10px;color:var(--muted);margin:4px 0 0}
.reference-dot,.attempt-dot{width:9px;height:9px;border-radius:50%;display:inline-block;background:#5264dc}
.attempt-dot{background:#e98936}
.challenge-graph-tools #toggleMystery3d,.challenge-graph-tools #toggleAttempt3d{width:100%;margin:0 0 8px}
.studio.challenge-mode .mystery-legend{top:43px;left:14px}
@media(max-width:700px){.studio.challenge-mode .mystery-legend{top:33px;left:10px;padding:6px 9px;font-size:10px;max-width:calc(100% - 115px)}.mystery-legend p{font-size:9px}.studio.challenge-mode .viewport-hint{display:none}}

/* Keyboard discoverability and single-finger touch interaction. */
.view-tools{flex-wrap:wrap;max-width:min(480px,calc(100% - 16px));justify-content:flex-end}
.view-tools button[aria-pressed="true"]{background:var(--accent);color:#fff}
.shortcuts-dialog{border:1px solid var(--stroke);border-radius:14px;max-width:min(400px,calc(100vw - 32px));background:var(--panel);color:var(--text);padding:20px 24px;box-shadow:var(--shadow)}
.shortcuts-dialog::backdrop{background:rgba(3,12,31,.6)}
.shortcuts-dialog h2{font-size:19px;margin:0 0 12px}
.shortcuts-dialog p{font-size:13px;line-height:1.5;color:var(--muted)}
.shortcuts-dialog dl{display:grid;grid-template-columns:max-content 1fr;gap:10px 17px;font-size:13px}
.shortcuts-dialog dt{font-weight:750}.shortcuts-dialog dd{margin:0;color:var(--muted)}
.shortcuts-dialog form{text-align:right;margin-top:16px}.shortcuts-dialog .primary-button{min-height:37px}
@media(max-width:700px){.view-tools{bottom:10px;right:8px;max-width:calc(100% - 16px);gap:2px}.view-tools button{min-width:30px;padding:0 4px;font-size:11px}.view-tools .toolbar-line{margin:0 1px}.viewport-hint{bottom:115px}}

/* GPU canvas renders surfaces under the accessible Canvas 2D overlay. */
.viewport #canvasGpu3d{position:absolute;inset:0;z-index:0;width:100%;height:100%;pointer-events:none}
.viewport #canvas3d{position:relative;z-index:1;background:transparent}
.viewport .view-label,.viewport .viewport-hint,.viewport .nav-cube,.viewport .view-tools,.viewport .toast3d,.viewport .problem-stage-banner,.viewport .mystery-legend,.viewport .mobile-editor-toggle,.viewport .show-solver-button,.viewport .shortcuts-dialog{z-index:3}

/* Sliding equations drawer: only the layout changes; the 3D renderer and all
   expression/solver state live in their existing modules. */
@media(min-width:701px){
  .studio:not(.challenge-mode).equation-panel-collapsed:not(.solver-open){grid-template-columns:0 minmax(0,1fr)}
  .studio.solver-open:not(.challenge-mode).equation-panel-collapsed{grid-template-columns:0 minmax(0,1fr) 335px}
  .studio:not(.challenge-mode).equation-panel-collapsed > .editor{visibility:hidden;pointer-events:none}
}
@media (min-width:701px) and (max-width:1180px){
  .studio.solver-open:not(.challenge-mode).equation-panel-collapsed{grid-template-columns:0 minmax(0,1fr) 300px}
}
@media(min-width:851px){
  .studio.challenge-mode.equation-panel-collapsed{grid-template-columns:0 minmax(0,1fr)}
  .studio.challenge-mode.equation-panel-collapsed .viewport{grid-column:2}
}
.studio.challenge-mode.equation-panel-collapsed .solver3d{display:none!important}
/* Keep status/legend distinct from the reachable graph panel switch. */
.viewport > .equation-panel-toggle{top:13px;left:14px;}
.viewport > .view-label{top:69px;left:17px;max-width:calc(100% - 35px)}
.studio.challenge-mode .mystery-legend{top:100px;}
.editor3d-scrim{display:none}

@media(max-width:850px){
  /* Mobile challenges show the graph first, larger than the scrollable answer
     area. Hiding the answer makes the graph genuinely full-height. */
  .studio.challenge-mode{grid-template-rows:60px minmax(210px,1fr) minmax(190px,38dvh)}
  .studio.challenge-mode .viewport{grid-column:1;grid-row:2}
  .studio.challenge-mode .solver3d{grid-column:1;grid-row:3;padding:13px 16px max(25px,env(safe-area-inset-bottom));overscroll-behavior:contain;}
  .studio.challenge-mode.equation-panel-collapsed{grid-template-rows:60px minmax(0,1fr)}
  .studio.challenge-mode.equation-panel-collapsed .viewport{grid-column:1;grid-row:2}
  .studio.challenge-mode .mystery-legend{top:103px;max-width:min(290px,calc(100% - 20px));}
  .studio.challenge-mode .viewport > .view-label{top:68px;}
  /* All on-screen camera controls remain reachable by horizontal swiping,
     rather than wrapping over much of the usable drawing area. */
  .view-tools{left:10px;right:10px;bottom:max(10px,env(safe-area-inset-bottom));width:auto;max-width:none;flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;scroll-snap-type:x proximity;padding:5px 7px;gap:5px;}
  .view-tools button{flex:0 0 auto;min-width:44px;height:42px;font-size:12px;scroll-snap-align:start;}
  .view-tools .toolbar-line{flex:0 0 1px;}
  .viewport-hint{bottom:80px;max-width:calc(100% - 20px);font-size:10px;}
  .viewport > .equation-panel-toggle{min-height:44px;top:10px;left:10px;}
  .nav-cube{width:53px;height:53px;right:12px;top:10px;}
}
@media(max-width:700px){
  .editor3d-scrim:not([hidden]){display:block;position:fixed;inset:60px 0 0;z-index:14;background:rgba(4,12,28,.42);}
  .editor{width:min(91vw,390px);padding-bottom:env(safe-area-inset-bottom);}
  .editor-mobile-close{min-height:44px;}
  .mobile-editor-toggle{display:none;}
  .studio:not(.challenge-mode) .viewport > .view-label{top:68px;left:12px;}
  .studio:not(.challenge-mode) .problem-stage-banner{top:103px;}
  .studio:not(.challenge-mode) .mystery-legend{top:104px;}
  #panMode3d{min-width:48px;}
}
@media(max-width:380px){
  .topbar{padding:0 7px;gap:3px;}
  .brand{gap:5px;}
  .home-icon{width:32px;height:34px;}
  .brand-words h1{font-size:12px;}
  .dimension-switch{gap:1px;padding:2px;}
  .dimension-switch a{min-width:32px;padding:7px 7px;}
  .equation-panel-toggle .panel-toggle-label{font-size:11px;}
}

/* Calm X-Plot surface: just the equation editor and canvas until advanced tools are requested. */
:root{--bg:#f6f9f8;--panel:#fff;--muted:#647770;--text:#19343b;--stroke:#dfeae5;--subtle:#edf5f1;--accent:#176f67;--accent-hover:#105b55;--input:#fff;--shadow:0 10px 28px rgba(17,49,52,.075)}
html[data-theme="dark"]{--bg:#101c22;--panel:#1a292e;--muted:#a2b9b3;--text:#e9f3ef;--stroke:#334a4b;--subtle:#24373a;--accent:#49bdad;--accent-hover:#6bcebe;--input:#192b31;--shadow:0 10px 35px rgba(0,0,0,.3)}
.topbar{box-shadow:none;padding-inline:19px}.brand-words h1{letter-spacing:-.025em}.dimension-switch{border-color:transparent}.quiet-button,.primary-button{font-size:12px;border-radius:9px}.editor{scrollbar-width:thin}
.intro{padding:26px 22px 17px}.intro h2{font-size:22px}.intro p{font-size:12px}.intro-eyebrow{letter-spacing:.07em}
.editor-section{padding:20px 21px}.section-heading h2{font-size:16px}.editor-section .section-heading{margin-bottom:13px}
.studio-disclosure{border-bottom:1px solid var(--stroke)}.studio-disclosure>summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:10px;color:var(--text);font-weight:760;font-size:13px;padding:17px 22px}.studio-disclosure>summary::-webkit-details-marker{display:none}.studio-disclosure>summary>span{color:var(--muted);font-size:16px;transition:transform .15s ease}.studio-disclosure[open]>summary>span{transform:rotate(180deg)}.studio-disclosure>summary:hover{background:var(--subtle)}.studio-disclosure>.editor-section{padding-top:4px;border-bottom:none}.studio-disclosure .editor-bottom{padding-top:0}
.editor-section .layers{margin-top:16px}.graph-layer{border-radius:9px}.graph-layer .layer-type{display:none}.layer-equation{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px;line-height:1.4}.layer-button{min-height:30px;min-width:30px}
.problem-library-intro{display:none}.problem-library-list{max-height:240px}.problem-library-status{margin-bottom:8px}
.view-label{letter-spacing:.06em}.viewport-hint{box-shadow:none;background:color-mix(in srgb,var(--panel) 90%,transparent)}
.nav-cube{display:none}.view-tools{gap:2px;border-radius:10px;box-shadow:0 6px 20px rgba(20,50,53,.07)}
.view-tools #sideView3d,.view-tools #isoView3d,.view-tools #panMode3d,.view-tools #shortcuts3d{display:none}
.problem-stage-banner{box-shadow:none;max-width:min(350px,calc(100% - 100px))}
.mystery-legend{display:flex;align-items:center;gap:8px;border-radius:10px;box-shadow:none;font-weight:680;line-height:1.3;padding:8px 11px;max-width:min(350px,calc(100% - 30px))}
.mystery-legend .reference-dot{flex:none;margin-right:1px}.mystery-legend .legend-separator{color:var(--muted)}.mystery-legend p{display:none}
.solver3d{padding:24px 22px 32px}.solver3d h2{font-size:21px}.solver3d-meta{margin-bottom:12px}.solver3d-statement{line-height:1.6}
.solver3d-caption{padding:0;background:transparent;color:var(--muted);font-size:12px;margin:13px 0}
.solver3d-form{gap:8px;margin:18px 0 16px;padding-top:15px}
.solver3d-form textarea{width:100%;min-height:78px;resize:vertical;line-height:1.55;border:1px solid var(--stroke);background:var(--input);border-radius:9px;padding:11px 12px;color:var(--text);font:500 13px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace}
#solverTry3d{border-color:var(--accent);color:var(--accent);min-height:43px}#solverSubmit3d{min-height:43px}#solverFeedback3d{font-size:12px;line-height:1.5;margin:2px 0 0}
.challenge-graph-tools h3{font-size:13px;font-weight:800;margin:0 0 11px}.question-graph-row{display:flex;gap:10px;align-items:center;background:var(--panel);padding:11px;border:1px solid var(--stroke);border-radius:10px}.question-graph-swatch{display:block;flex:0 0 10px;width:10px;height:10px;border-radius:50%;background:#5264dc}
.question-graph-row>span:nth-child(2){display:grid;gap:3px;flex:1;min-width:0}.question-graph-row strong{font-size:12px}.question-graph-row small{font-size:10px;color:var(--muted);line-height:1.3}.graph-row-badge{font-size:11px;color:var(--muted)}
.attempts-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:13px 2px 5px;font-size:12px}.attempts-heading span{font-size:11px;color:var(--muted)}
.challenge-graph-tools .layers{display:grid;gap:7px;margin:9px 0}.challenge-graph-tools .graph-layer{padding:9px;background:var(--panel)}.challenge-graph-tools .layer-color{width:25px;flex-basis:25px}.challenge-graph-tools .layer-equation{min-height:33px}
.graph-compare-note{font-size:11px;color:var(--muted);line-height:1.5;margin:9px 1px 4px}.challenge-range{margin-top:13px;padding-top:12px;border-top:1px solid var(--stroke)}.challenge-range summary{font-size:11px;cursor:pointer;color:var(--accent);font-weight:720}.challenge-range .range-setting{margin-top:13px!important}.challenge-range .range-setting small{display:none}
.studio.challenge-mode .challenge-graph-tools{padding:13px;background:transparent;border:1px solid var(--stroke);border-radius:11px;margin-bottom:14px}
.studio.challenge-mode .solver3d h2{font-size:22px}.studio.challenge-mode .solver3d-statement{line-height:1.55}
.studio.challenge-mode .solver3d-form{margin-top:16px}
.studio.challenge-mode .mystery-legend{top:72px;left:15px}
.studio.challenge-mode .viewport .view-label{top:52px}
.studio.challenge-mode .solver3d-hints{margin-top:14px}.studio.challenge-mode .solver3d-hints details{background:var(--panel)}
@media(max-width:700px){
  .studio.challenge-mode .solver3d{padding:14px 16px max(24px,env(safe-area-inset-bottom))}
  .studio.challenge-mode .solver3d h2{font-size:18px}
  .studio.challenge-mode .solver3d-statement{font-size:12px}
  .studio.challenge-mode .mystery-legend{top:101px;left:10px;max-width:calc(100% - 20px)}
  .studio.challenge-mode .viewport .view-label{top:69px}
  .studio.challenge-mode .view-tools{right:10px;bottom:10px}
  .studio.challenge-mode .solver3d-caption{font-size:11px}
  .studio.challenge-mode .challenge-graph-tools{padding:11px}
  .studio.challenge-mode .solver3d-form textarea{min-height:61px}
  .mystery-legend{font-size:10px}
  .view-tools button{min-width:33px;height:35px}
  .top-actions #share3d{display:none}
  .viewport-hint{display:none}
}

.solver3d .challenge-graph-tools{border:1px solid var(--stroke);border-radius:11px;padding:13px;margin:14px 0}
.mystery-legend.has-warning{flex-wrap:wrap}.mystery-legend.has-warning p{display:block;flex:0 0 100%;color:#aa5544;margin:2px 0 0;line-height:1.45}

/* Keep the two independent visibility controls compact and keyboard-accessible. */
.question-graph-row .question-graph-action{flex:none;min-height:32px;padding:5px 11px;border-radius:8px;font-size:11px;font-weight:750}
.question-graph-row.is-hidden .question-graph-swatch{opacity:.26}
.view-tools #toggleGrid3d[aria-pressed="false"]{color:var(--muted)}

/* SEO: individual 3D problem titles are visible as the page H1 without breaking the toolbar. */
.brand-words{min-width:0;max-width:min(40vw,390px)}
.brand-words h1{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.solver-related{margin-top:18px;padding-top:15px;border-top:1px solid var(--stroke);display:grid;gap:10px;font-size:12px}
.solver-related a{color:var(--accent);text-decoration:underline;text-underline-offset:2px}
.solver-related h3{font-size:12px;margin:6px 0 0}
.solver-related ul{margin:0;padding-left:18px;display:grid;gap:8px}
@media(max-width:700px){.brand-words{max-width:36vw}.brand-words h1{font-size:13px}}

.section-dialog3d .slice-setting{display:grid;gap:12px;margin:14px 0 0;padding:10px 12px 12px;border:1px solid var(--stroke);border-radius:9px}
.section-dialog3d .slice-setting:disabled{opacity:.52}
.section-dialog3d legend{padding:0 5px;font-size:12px}
.section-inputs3d{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.section-dialog3d .section-inputs3d label{display:grid;gap:5px}
.section-inputs3d select,.section-inputs3d input{width:100%;padding:6px 8px;border:1px solid var(--stroke);border-radius:6px;background:var(--input);color:var(--text)}
.view-tools #sectionTools3d[data-active="true"]{background:var(--accent);color:#fff}

/* Optional curriculum context: useful to solvers and readable in initial HTML. */
.public-math-context { margin: .75rem 0; padding: .65rem .8rem; border: 1px solid #d0d9e7; border-radius: .65rem; font-size: .92rem; }
.public-math-context summary { cursor: pointer; font-weight: 650; }
.public-math-context p, .public-math-context ul { margin: .6rem 0 0; line-height: 1.45; }
.public-math-context li + li { margin-top: .3rem; }


/* 2026-11 mobile usability: preserve a large canvas without trapping the
   question or the equation editor in tiny, hard-to-scroll viewports. */
.mobile-graph-hint3d{display:none}
@media (max-width:850px){
  .studio.challenge-mode{
    grid-template-rows:60px minmax(0,1fr) minmax(0,45dvh);
    min-height:0;
  }
  .studio.challenge-mode .solver3d{
    min-height:0;overflow-y:auto;overscroll-behavior-y:contain;
    -webkit-overflow-scrolling:touch;
    padding-bottom:max(28px,env(safe-area-inset-bottom));
  }
  .studio.challenge-mode .viewport{min-height:0}
  .studio.challenge-mode .view-tools,.studio:not(.challenge-mode) .view-tools{
    scrollbar-width:none;-webkit-overflow-scrolling:touch;
    overscroll-behavior-x:contain;scroll-padding-inline:8px;
    touch-action:pan-x;
  }
  .view-tools::-webkit-scrollbar{display:none}
  /* On phones these view options must be reachable, not silently hidden. */
  .view-tools #sideView3d,.view-tools #isoView3d,
  .view-tools #panMode3d{display:inline-flex;align-items:center;justify-content:center}
  .view-tools button{min-width:44px;min-height:44px;touch-action:manipulation}
  .mobile-graph-hint3d{
    display:block;position:absolute;z-index:3;
    left:12px;bottom:72px;max-width:calc(100% - 24px);
    color:var(--muted);background:color-mix(in srgb,var(--panel) 92%,transparent);
    border:1px solid var(--stroke);border-radius:9px;
    padding:6px 9px;font-size:11px;line-height:1.35;
    pointer-events:none;
  }
  .studio.challenge-mode .viewport > .equation-panel-toggle{z-index:5}
  .studio.challenge-mode .solver3d-form textarea,.editor textarea,
  .studio.challenge-mode .section-inputs3d input,
  .studio.challenge-mode .section-inputs3d select{font-size:16px}
  .section-dialog3d,.shortcuts-dialog{max-height:calc(100dvh - 24px);overflow-y:auto;overscroll-behavior:contain}
  .section-dialog3d .section-inputs3d input,.section-dialog3d .section-inputs3d select{min-height:44px;font-size:16px}
  .section-dialog3d #slice3d{min-height:36px}
  .shortcuts-dialog form button{min-height:44px}
}
@media(max-width:700px){
  /* Equation entry opens as a full-width, thumb-friendly bottom sheet. */
  .studio:not(.challenge-mode) .editor{
    position:fixed;top:auto;bottom:0;left:0;right:0;
    width:100%;height:min(84dvh,760px);max-height:calc(100dvh - 60px);
    z-index:15;overflow-y:auto;overscroll-behavior-y:contain;
    -webkit-overflow-scrolling:touch;
    border:1px solid var(--stroke);border-bottom:0;
    border-radius:19px 19px 0 0;
    transform:translateY(105%);
    padding-bottom:max(18px,env(safe-area-inset-bottom));
    box-shadow:0 -15px 48px rgba(8,29,33,.19);
  }
  .studio:not(.challenge-mode) .editor.open{transform:translateY(0)}
  .studio:not(.challenge-mode) .editor-mobile-close{
    text-align:center;border-radius:19px 19px 0 0;
    min-height:48px;font-size:14px;
  }
  .studio:not(.challenge-mode) .editor-mobile-close::before{
    content:"";display:block;width:40px;height:4px;border-radius:8px;
    background:var(--stroke);margin:0 auto 9px;
  }
  .editor3d-scrim:not([hidden]){inset:60px 0 0}
  .studio:not(.challenge-mode) .editor-section,.studio:not(.challenge-mode) .intro{padding-inline:18px}
  .studio:not(.challenge-mode) .editor .quiet-button,
  .studio:not(.challenge-mode) .editor .primary-button,
  .studio:not(.challenge-mode) .editor .chip-row button{min-height:44px}
  .studio:not(.challenge-mode) .editor input,.studio:not(.challenge-mode) .editor select,
  .studio:not(.challenge-mode) .editor textarea{font-size:16px}
  .studio.challenge-mode .solver3d{border-radius:0;box-shadow:none}
  .studio.challenge-mode .solver3d h2{font-size:19px;line-height:1.3}
  .studio.challenge-mode .solver3d-statement{font-size:14px;line-height:1.6}
  .studio.challenge-mode .solver3d-form .primary-button,
  .studio.challenge-mode .solver3d-form .quiet-button,
  .studio.challenge-mode .solver3d-form a.primary-button{min-height:48px}
  .studio.challenge-mode .mobile-graph-hint3d{bottom:70px;font-size:10px}
  .top-actions .quiet-button,.top-actions .primary-button{min-width:38px;min-height:42px}
}
@media(max-width:390px){
  .studio.challenge-mode{grid-template-rows:60px minmax(0,1fr) minmax(0,49dvh)}
  .studio.challenge-mode .mystery-legend{max-width:calc(100% - 20px)}
  .top-actions #share3d{display:none}
  .brand-words{max-width:31vw}
  .mobile-graph-hint3d{max-width:calc(100% - 24px)}
}
@media(max-height:550px) and (max-width:850px){
  .studio.challenge-mode{grid-template-rows:54px minmax(0,1fr) minmax(0,49dvh)}
  .studio.challenge-mode .topbar{min-height:54px}
  .studio.challenge-mode .mobile-graph-hint3d{display:none}
  .studio.challenge-mode .view-tools{bottom:5px}
  .studio:not(.challenge-mode) .editor{max-height:calc(100dvh - 54px)}
}
@media(prefers-reduced-motion:reduce){
  .studio:not(.challenge-mode) .editor{transition:none}
}
