
:root{--bg:#fffdf8;--card:#fff;--ink:#251532;--muted:#776a80;--purple:#7a2dbb;--purple2:#9c64ca;--light-purple:#f3eafb;--orange:#f2a900;--light-orange:#fff2cf;--border:#e5d8ed;--blue:#4e85c5;--shadow:0 18px 48px rgba(84,43,110,.12)}
*{box-sizing:border-box}html,body{min-height:100%;margin:0}body{font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif;color:var(--ink);background:radial-gradient(circle at 88% 3%,rgba(122,45,187,.07),transparent 34%),linear-gradient(180deg,#fff,#fffaf1 130%);font-size:13px}button,input,textarea{font:inherit}button{cursor:pointer;color:inherit}button:disabled{opacity:.44;cursor:not-allowed}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid #c49ce5;outline-offset:2px}[hidden]{display:none!important}.app-shell{min-height:100vh;display:grid;grid-template-columns:280px minmax(0,1fr)}
.sidebar{min-width:0;position:relative;z-index:4;display:flex;flex-direction:column;height:100vh;position:sticky;top:0;background:rgba(255,255,255,.95);border-right:3px solid var(--orange);box-shadow:8px 0 32px rgba(62,31,82,.05)}.brand{display:flex;align-items:center;gap:12px;padding:25px 20px 21px;border-bottom:1px solid var(--border)}.brand-logo{display:grid;place-items:center;flex:0 0 46px;height:46px;border:1px solid #e4c8ee;border-radius:14px;background:#fff;box-shadow:0 7px 19px #7a2dbb16}.brand-logo svg{width:36px;height:36px}.brand-title{font-weight:850;font-size:23px;line-height:1.05}.brand-sub{color:var(--muted);font-size:12px;margin-top:4px}.brand-back{font-size:10px;margin-top:5px;color:#aa94b4}.aside-scroll{overflow-y:auto;overscroll-behavior:contain;padding:0 18px 22px;scrollbar-color:#e6d9ee transparent;scrollbar-width:thin;flex:1}.aside-section{padding:19px 3px 20px;border-bottom:1px solid #f0eaf2}.aside-section.compact{padding-top:19px}.aside-section.last{border-bottom:0}.section-heading{text-transform:uppercase;letter-spacing:.055em;font-size:12px;font-weight:850;color:#66546e;display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:13px}.eyebrow-label{font-size:9px;color:#a997b4;background:#f8f2fc;border-radius:6px;padding:4px 6px}.segmented{display:grid;grid-template-columns:1fr 1fr;gap:3px;padding:4px;background:#f9f6fb;border:1px solid #e8ddeb;border-radius:13px}.segmented button{border:0;border-radius:10px;background:transparent;padding:10px;font-weight:760;color:#786980;transition:all .15s}.segmented button.active{color:var(--purple);background:#fff;box-shadow:0 4px 12px #48285c19}.mode-icon{font-weight:900;font-size:16px;margin-right:5px}.small-hint{color:#918497;font-size:11px;line-height:1.5;margin:9px 1px 0}.search-wrap{display:flex;align-items:center;gap:9px;padding:9px 11px;border:1px solid #e8ddeb;border-radius:11px;background:#fff;margin-bottom:11px}.search-wrap svg{width:17px;height:17px;stroke:#a89caf;fill:none;stroke-width:1.8;flex:0 0 auto}.search-wrap input{border:0;outline:0;width:100%;font-size:11.5px;background:transparent;color:#45344f}.search-wrap input:focus{outline:0}.search-wrap:focus-within{border-color:#ba89d7}.preset-list{display:grid;gap:6px}.preset-card{display:grid;grid-template-columns:45px minmax(0,1fr) 20px;align-items:center;gap:9px;width:100%;border:1px solid transparent;border-radius:13px;padding:8px 8px;text-align:left;background:transparent;transition:.13s}.preset-card:hover{background:#fff9ee;border-color:#f2d495}.preset-card:active{transform:scale(.985)}.preset-icon{display:grid;place-items:center;width:43px;height:43px;border-radius:11px;background:#fff;border:1px solid #eee5f2}.preset-icon svg{width:36px;height:32px}.preset-icon svg path:not([stroke]),.preset-icon svg ellipse:not([stroke]),.preset-icon svg circle:not([stroke]){fill:none;stroke:var(--purple);stroke-width:2.25;stroke-linejoin:round;stroke-linecap:round}.preset-card:hover .preset-icon{border-color:#f0d7a5}.preset-info{min-width:0}.preset-name{font-size:12px;font-weight:760;color:#35263e;line-height:1.22}.preset-formula{color:#93869a;font-size:10.5px;font-family:Georgia,'Times New Roman',serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:4px}.preset-plus{color:#b29dbc;display:grid;place-items:center;font-size:19px}.preset-card:hover .preset-plus{color:var(--purple)}.count-label{font-size:10px;color:#a896b0;font-weight:700}.count-pill{display:grid;place-items:center;min-width:23px;height:23px;border-radius:50px;background:var(--light-purple);color:var(--purple);font-size:11px}.duo-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.btn{display:inline-flex;justify-content:center;align-items:center;gap:5px;border-radius:10px;padding:10px 11px;font-size:11.5px;font-weight:760;min-height:36px;border:1px solid transparent;white-space:nowrap}.btn-ghost{background:#fff;border-color:#e5d8ed;color:#685772}.btn-ghost:hover{background:#fcf8ff;border-color:#caa8d9}.btn-purple{background:var(--purple);color:#fff;box-shadow:0 6px 15px #7a2dbb28}.btn-purple:hover{background:#6923a5}.full{width:100%}.mt8{margin-top:9px}.arrow{font-size:14px;margin-left:auto}.palette-row{display:flex;gap:5px;flex-wrap:wrap}.chip{padding:7px 8px;font-size:10px;font-weight:720;background:#fff;border:1px solid #e7d9ea;border-radius:9px;color:#7c6a85}.chip.active{background:var(--light-orange);border-color:#eebd45;color:#775018}.color-control{margin-top:11px;display:flex;align-items:center;justify-content:space-between;gap:10px;border:1px solid #eee5f2;border-radius:11px;padding:7px 10px;color:#62516e;font-size:11.5px;background:#fff}.color-control input[type=color]{border:0;background:transparent;width:35px;height:26px;padding:0;cursor:pointer}.color-control input::-webkit-color-swatch-wrapper{padding:0}.color-control input::-webkit-color-swatch{border:1px solid #dfd0e9;border-radius:7px}.aside-footer{padding:15px 19px;background:#fcfaff;border-top:1px solid #f0e9f3;color:#aa9bb0;font-size:10px;display:flex;align-items:center;gap:7px}.status-circle{width:6px;height:6px;display:inline-block;border-radius:50%;background:#28aa6b}
.workspace{min-width:0;min-height:100vh;padding:24px 28px 28px;display:flex;flex-direction:column}.topbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:0 auto 15px;max-width:1580px;width:100%}.kicker{color:var(--purple);font-size:10px;font-weight:850;letter-spacing:.09em}.topbar h1{margin:5px 0 0;font-size:25px;line-height:1.18;font-weight:820;letter-spacing:-.045em}.title-light{font-weight:480;color:#675474}.top-actions{display:flex;align-items:center;gap:11px}.beta-label{border-radius:999px;border:1px solid #e7d6eb;background:#fff;color:#8c7796;font-weight:750;font-size:10px;padding:7px 10px;white-space:nowrap}.icon-btn{width:35px;height:35px;border-radius:11px;border:1px solid #e5d7eb;background:white;color:var(--purple);font-weight:850;font-size:19px}.work-card{max-width:1580px;width:100%;flex:1;min-height:590px;margin:0 auto;display:flex;flex-direction:column;overflow:hidden;border:1px solid rgba(78,133,197,.75);border-radius:25px;background:#fff;box-shadow:var(--shadow)}.work-head{padding:12px 16px;display:flex;align-items:center;justify-content:space-between;gap:9px;background:#f9fbfe;border-bottom:1px solid #e4ebf3;min-height:54px}.work-status{display:flex;align-items:center;gap:9px;font-size:11.5px;font-weight:740;color:#5f5369}.status-dot{width:9px;height:9px;border-radius:50%;background:#32ae70;box-shadow:0 0 0 4px #32ae7019}.work-head-right{display:flex;align-items:center;gap:10px;color:#8e7b96;font-size:11px}.splitter{height:17px;width:1px;background:#e5d9e9}.head-action{border:1px solid #e7d7ec;border-radius:8px;background:#fff;padding:7px 9px;color:#6c547b;font-size:10.5px;font-weight:730;white-space:nowrap}.head-action span{font-size:15px;vertical-align:-1px}.head-action:hover{border-color:#cfaadb}.graph-count{font-weight:760;white-space:nowrap}.stage{flex:1;min-height:520px;display:grid;grid-template-columns:minmax(0,1fr) minmax(288px,324px)}.plot-area{min-width:0;min-height:520px;position:relative;background:#f9fbff;overflow:hidden;user-select:none;touch-action:none;cursor:grab}.plot-area.dragging{cursor:grabbing}.plot-area canvas{position:absolute;inset:0;width:100%;height:100%;display:block}.plot-mark{position:absolute;pointer-events:none;color:#91859b;border-radius:8px;font-size:10.5px;background:rgba(255,255,255,.83);border:1px solid #ebe5f0;padding:6px 9px;backdrop-filter:blur(3px)}.plot-mark-top{top:16px;left:16px}.plot-mark-bottom{bottom:14px;left:14px}.plot-key{display:flex;align-items:center;gap:6px}.plot-key i{width:6px;height:6px;border-radius:50%;background:#ae86ca}.plot-corner{position:absolute;right:17px;top:17px;font-size:10px;letter-spacing:.1em;font-weight:800;color:#a497b1}.plot-tools{position:absolute;right:16px;bottom:16px;display:flex;flex-direction:column;gap:5px}.plot-tool{width:35px;height:35px;border-radius:10px;background:rgba(255,255,255,.94);border:1px solid #e6d9eb;font-size:19px;font-weight:700;color:#755a88;box-shadow:0 6px 13px #20102a0a}.plot-tool:hover{color:var(--purple);border-color:#cbaaee}.toast{position:absolute;z-index:6;top:54px;left:50%;transform:translate(-50%,-8px);background:#32263b;color:#fff;border-radius:11px;padding:10px 14px;box-shadow:0 12px 22px #20102a2b;font-size:11px;opacity:0;pointer-events:none;transition:opacity .15s,transform .15s;max-width:85%;text-align:center}.toast.show{opacity:1;transform:translate(-50%,0)}
.editor-panel{display:flex;flex-direction:column;gap:0;min-width:0;min-height:520px;background:linear-gradient(180deg,#fff,#fefbff);border-left:1px solid #e4eaf1;padding:17px 17px 19px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#e5d9ea transparent;max-height:calc(100vh - 170px)}.editor-top{display:flex;align-items:center;justify-content:space-between;gap:7px;margin-bottom:12px}.editor-top h2{font-size:20px;margin:4px 0 0;line-height:1.2}.mini-add{border:1px solid #e6d6ec;background:var(--light-purple);color:var(--purple);width:35px;height:35px;border-radius:11px;font-size:23px}.graph-list{display:grid;gap:7px;min-height:62px}.graph-entry{border:1px solid #eee5f2;background:#fff;border-radius:12px;display:flex;align-items:center;gap:8px;padding:9px 8px;cursor:pointer;transition:.13s}.graph-entry.selected{background:linear-gradient(95deg,#fcf7ff,#fff);border-color:#cda9dd;box-shadow:0 4px 12px #7a2dbb0c}.graph-entry:hover{border-color:#d4b4e4}.visibility{width:18px;height:18px;flex:0 0 18px;display:grid;place-items:center;border:0;background:none;color:#9885a2;padding:0;font-size:14px}.visibility.invisible{color:#cbbdd1;opacity:.75}.entry-dot{width:13px;height:13px;flex:0 0 13px;border-radius:50%;border:2px solid white;box-shadow:0 0 0 1px #ded3e8}.entry-copy{min-width:0;flex:1}.entry-name{font-weight:780;font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.entry-formula{font-family:Georgia,serif;color:#92839b;font-size:10.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:3px}.entry-delete{border:0;background:transparent;color:#aa9ab2;font-size:19px;padding:1px 4px;border-radius:7px;line-height:1.2}.entry-delete:hover{background:#fceef2;color:#b62450}.empty-graphs{border:1px dashed #dfcce9;padding:16px;text-align:center;color:#9585a1;border-radius:11px;font-size:11px;line-height:1.45}.editor-divider{height:1px;background:#eee6f1;margin:18px 0}.editor-heading{display:flex;align-items:end;justify-content:space-between;gap:8px;margin-bottom:13px}.tiny-label{font-weight:850;color:var(--purple);font-size:9px;letter-spacing:.07em}.editor-heading h3{margin:4px 0 0;font-size:15px;letter-spacing:-.02em}.selection-indicator{visibility:hidden;background:#f4ebfa;color:#88659c;font-size:10px;font-weight:770;padding:5px 7px;border-radius:7px;max-width:116px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.formula-input-wrap{display:flex;gap:9px;align-items:flex-start;padding:10px 11px 6px;background:#fff;border:1.5px solid #dac9e6;border-radius:12px;transition:.15s}.formula-input-wrap:focus-within{border-color:#9f69ca;box-shadow:0 0 0 3px #7a2dbb10}.formula-symbol{font-size:17px;line-height:1.6;color:var(--purple);font-family:Georgia,serif;white-space:nowrap}.formula-input-wrap textarea{border:0;resize:vertical;width:100%;padding:4px 0 2px;min-height:51px;max-height:140px;background:transparent;color:#2c1b36;font-size:13px;line-height:1.55;font-family:'Cambria Math',Georgia,serif;outline:0}.formula-input-wrap textarea:focus{outline:0}.formula-tools{display:flex;align-items:center;justify-content:space-between;gap:5px;margin:7px 0 0}.formula-status{color:#32a366;font-size:10px;line-height:1.4}.formula-status.error{color:#b73e5b}.keyboard-button{border:0;background:transparent;color:var(--purple);font-size:10.5px;font-weight:810;padding:5px 2px;white-space:nowrap}.keyboard-button span{font-size:16px;vertical-align:-2px;margin-right:3px}.math-keyboard{background:#fff;border:1px solid #ddc9e9;padding:10px;border-radius:13px;box-shadow:0 9px 20px #62348213;margin-top:9px}.math-keyboard__top{display:flex;justify-content:space-between;color:#735781;font-size:10px;font-weight:820;margin-bottom:8px}.math-keyboard__top button{font-size:16px;border:0;background:none;color:#a58ab4;line-height:1}.key-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:5px}.key{min-width:0;border:1px solid #eee5f2;background:#faf7fc;border-radius:7px;padding:8px 1px;color:#483553;font-family:Georgia,serif;font-size:12px}.key:hover{background:#f2e6fa;border-color:#d3b5e4}.key-wide{grid-column:span 2;background:var(--light-purple);color:var(--purple)}.text-action{border:0;background:none;color:var(--purple);font-weight:750;font-size:10.5px;padding:4px}.transform-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}.transform-btn{border:1px solid #e5d7eb;border-radius:11px;padding:11px 5px;background:white;display:grid;place-items:center;gap:7px;text-align:center;min-height:75px}.transform-btn strong{color:#412551;font-size:19px;font-weight:650;font-family:Georgia,serif}.transform-btn span{font-size:10px;color:#8a7993}.transform-btn.active{border-color:#b17acb;background:linear-gradient(160deg,#f3eafb,#fff)}.transform-btn.active strong{color:var(--purple)}.transform-btn:hover{border-color:#caa4da}.transform-title{color:#76617f;font-size:11px;font-weight:800;margin:15px 0 9px}.shift-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}.shift-btn{border:1px solid #e7dbea;border-radius:9px;background:#fff;padding:9px 7px;color:#695875;font-weight:730;font-size:10.5px}.shift-btn span{color:var(--purple);font-size:17px;vertical-align:-1px;margin-right:3px}.shift-btn:hover{border-color:#b995d0;background:#fcf9ff}.shift-diagonal{grid-column:1/-1;background:#f8f2fc;color:var(--purple)}.shift-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:12px}.shift-fields:has(#shiftZWrap:not([hidden])){grid-template-columns:repeat(3,minmax(0,1fr))}.shift-fields label{font-size:10px;color:#85728e;font-weight:760}.shift-fields input{display:block;margin-top:5px;border:1px solid #e7dbea;border-radius:9px;padding:8px;width:100%;background:#fff;color:#44304f;font-size:12px;outline:0}.shift-fields input:focus{border-color:#b67ed3}.transform-note{margin-top:10px;color:#998aa0;font-size:10.5px;line-height:1.5}.work-footer{min-height:43px;padding:11px 16px;border-top:1px solid #e8edf4;display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:10px;color:#9c8ea5;background:#fff}.footer-light{color:var(--purple);font-weight:780}.footer-trailing{white-space:nowrap}.work-footer kbd{display:inline-block;border:1px solid #e9e0ee;border-radius:5px;padding:1px 5px;background:#f8f5fa;font-size:9px;color:#816e8d}.dotsep{margin:0 5px}
.modal{width:min(960px,calc(100vw - 24px));max-height:calc(100vh - 35px);border:0;border-radius:22px;padding:23px 26px 26px;color:var(--ink);box-shadow:0 26px 90px #321d4c4a;background:#fff;overflow-y:auto}.modal::backdrop{background:#24133470;backdrop-filter:blur(3px)}.modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.modal-head h2{margin:5px 0 3px;font-size:22px}.modal-head p{color:#95879a;margin:6px 0;font-size:12px}.modal-close{width:33px;height:33px;flex:0 0 auto;background:#f7f0fb;border:0;border-radius:9px;color:#876c96;font-size:24px;line-height:1}.print-logo small{font-size:11px;color:#a494ac;font-weight:600}.variant-item__formula-line+.help-dialog{width:min(590px,calc(100vw - 24px))}.help-content p{font-size:13px;color:#63566b;line-height:1.65}.help-content code{background:#f6edf9;color:#7037a0;padding:1px 3px;border-radius:4px}.help-content .help-caution{background:#fff8e8;padding:10px 13px;border-radius:11px;font-size:11.5px;color:#886d43}
@media(max-width:1260px){.workspace{padding:19px 16px}.stage{grid-template-columns:minmax(0,1fr) 292px}.editor-panel{padding:15px 13px}.work-footer .footer-trailing{display:none}}@media(max-width:1050px){.app-shell{grid-template-columns:238px minmax(0,1fr)}.brand{padding:20px 12px}.aside-scroll{padding:0 10px}.workspace{padding:17px 13px}.topbar h1{font-size:21px}.stage{grid-template-columns:minmax(0,1fr)}.plot-area{min-height:440px}.editor-panel{border-left:0;border-top:1px solid #e9e0f0;max-height:none;min-height:0}.graph-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr))}.editor-panel .editor-divider{margin:12px 0}.work-card{min-height:0}}@media(max-width:700px){.app-shell{display:block}.sidebar{position:relative;height:auto;border-right:0;border-bottom:3px solid var(--orange)}.brand{padding:13px 15px}.brand-logo{height:40px;flex-basis:40px}.brand-logo svg{width:32px;height:32px}.brand-title{font-size:19px}.brand-back,.aside-footer{display:none}.aside-scroll{overflow:visible;padding:0 13px;display:grid;grid-template-columns:minmax(0,1fr);min-width:0;gap:0}.aside-section{min-width:0}.aside-section.compact{padding:13px 0 8px}.aside-section{padding:12px 0}.preset-list{display:flex;gap:7px;overflow-x:auto;max-width:100%;min-width:0;padding-bottom:7px;scroll-snap-type:x proximity}.preset-card{flex:0 0 165px;grid-template-columns:37px minmax(0,1fr) 12px;scroll-snap-align:start}.preset-icon{width:35px;height:35px}.preset-icon svg{width:30px}.aside-section:has(#presetList) .small-hint{display:none}.aside-section.last{display:block}.workspace{padding:14px 9px}.topbar h1{font-size:19px}.title-light{display:block;font-size:16px;margin-top:3px}.beta-label{display:none}.work-head{padding:10px}.head-action{padding:7px}.work-head-right .graph-count,.splitter{display:none}.plot-area{min-height:400px}.plot-mark-top{font-size:9px;max-width:72%;top:10px;left:10px}.plot-mark-bottom{font-size:10px;bottom:9px;left:9px}.work-card{border-radius:18px}.stage{min-height:0}.editor-panel{padding:14px}.work-footer{font-size:9px}}


/* v1.2: fixed-height graph list and math-first cards; the editor cannot be covered by list items. */
.editor-panel{min-height:0;overscroll-behavior:contain;}
.editor-top,.editor-heading,.editor-divider,.formula-editor{flex-shrink:0;}
.graph-list{display:flex;flex-direction:column;flex:0 0 auto;gap:8px;max-height:clamp(162px,31vh,350px);overflow-y:auto;overflow-x:hidden;min-height:0;padding:2px 4px 5px 2px;scrollbar-width:thin;scrollbar-color:#d6bee8 transparent;align-content:start;}
.graph-entry{display:grid;grid-template-columns:18px 13px minmax(0,.9fr) minmax(0,1.3fr) 19px;grid-template-rows:auto;column-gap:7px;row-gap:5px;min-width:0;flex:0 0 auto;align-items:center;padding:12px 9px;min-height:60px;}
.graph-entry .visibility,.graph-entry .entry-dot,.graph-entry .entry-copy,.graph-entry .entry-math-area,.graph-entry .entry-delete{min-width:0;grid-row:1;}
.graph-entry .visibility{grid-column:1}.graph-entry .entry-dot{grid-column:2}.graph-entry .entry-copy{grid-column:3}.graph-entry .entry-math-area{grid-column:4}.graph-entry .entry-delete{grid-column:5}
.entry-copy{overflow:hidden;align-self:center}.entry-name{font-size:11.5px;line-height:1.35;}
.entry-math-area{min-width:0;display:flex;align-items:center;justify-content:flex-end;gap:4px;overflow:hidden;}
.entry-math-viewport{min-width:0;max-width:100%;flex:1 1 auto;overflow-x:auto;overflow-y:hidden;overscroll-behavior-inline:contain;scrollbar-width:none;white-space:nowrap;text-align:right;touch-action:pan-x;}
.entry-math-viewport::-webkit-scrollbar{display:none;}
.entry-math-viewport math{display:inline;font-size:19px;line-height:1.25;vertical-align:middle;font-family:'Cambria Math','STIX Two Math','Latin Modern Math','Times New Roman',serif;color:#281433;}
.entry-math-viewport math mfrac{line-height:normal;}
.entry-math-nav{flex:0 0 20px;min-width:20px;height:26px;border:1px solid #e7d8ee;border-radius:7px;color:var(--purple);background:#faf5ff;font-size:21px;line-height:1;display:none;place-items:center;padding:0;}
.entry-math-nav:hover{background:#f3e6fb}.entry-math-nav:disabled{opacity:.25;}
.graph-entry.entry-overflow .entry-math-nav{display:grid;}
.graph-entry.entry-long{grid-template-rows:auto auto;min-height:85px;}
.graph-entry.entry-long .entry-copy{grid-column:3/5;grid-row:1;}
.graph-entry.entry-long .entry-math-area{grid-column:3/5;grid-row:2;max-width:100%;min-width:0;justify-content:flex-start;border-top:1px solid #f3edf6;padding-top:7px;}
.graph-entry.entry-long .entry-math-viewport{text-align:left;}
.graph-entry.entry-long .entry-delete{grid-row:1;}
/* Wide tablets: keep a single readable column of cards instead of tiny grid cells. */
@media(max-width:1050px){.graph-list{display:flex;flex-direction:column;max-height:300px;}.graph-entry{max-width:none;}}
@media(max-width:700px){.graph-list{max-height:295px;}.graph-entry{min-height:62px;padding:11px 9px;}}
/* WebGL is a pointer-transparent overlay: all existing mouse/pen/touch interactions stay on plotCanvas. */
#plotCanvas{z-index:0}
#plot3dCanvas{z-index:1;pointer-events:none;display:none;}
.plot-area .plot-mark,.plot-area .plot-tools,.plot-area .plot-corner,.plot-area .toast{z-index:2}

/* v1.5: interactive intersections, kept independent of 3D drawing */
.intersections-toggle{display:inline-flex;align-items:center;gap:4px;color:#7a2dbb;border-color:#d9b9ea}
.intersections-toggle[aria-pressed="false"]{color:#9a8f9e;border-color:#e8dfea;background:#fbfafb}
.intersections-toggle #intersectionCount{display:inline-grid;place-items:center;min-width:17px;height:17px;border-radius:999px;background:#f0e4fb;color:#7930ad;font-size:9px;padding:1px 3px}
.intersection-tooltip{position:absolute;z-index:6;pointer-events:none;max-width:min(240px,75vw);padding:9px 12px;border-radius:11px;background:#2a1a37;color:#fff;box-shadow:0 9px 25px #25153244;font:600 12px/1.55 Inter,system-ui,sans-serif;white-space:normal;text-align:left}
.intersection-tooltip strong{display:block;font-size:13px;font-weight:800;color:#fff;white-space:nowrap}
.intersection-tooltip span{display:block;color:#d8c5e7;font-size:10px;max-width:208px;line-height:1.35}
@media(max-width:760px){.intersections-toggle{font-size:10px;padding:7px 8px}.intersections-toggle #intersectionCount{display:none}.work-head-right{gap:5px}.graph-count{display:none}}
@media(max-width:425px){.intersections-toggle{padding:7px 6px}.work-status{font-size:10px}.work-head{padding:10px 9px}}
/* v1.4: lightweight 3D display modes */
.style3d-options{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:7px 0 10px}
.style3d-options button{min-width:0;border:1px solid #e5d8ed;border-radius:10px;padding:10px 6px;background:#fff;color:#6d547c;font-weight:760;font-size:10px;white-space:normal;line-height:1.25}
.style3d-options button.active{background:#f2e8fb;color:#6922aa;border-color:#c9a1df;box-shadow:inset 0 0 0 1px #d6bce5}
.style3d-options button:hover{border-color:#b78cda}
.style3d-panel{flex-shrink:0}.opacity-label{font-weight:700;font-size:11px;color:#6a5777;display:flex;flex-wrap:wrap;justify-content:space-between;gap:6px}
.opacity-label input{display:block;width:100%;accent-color:#7a2dbb;margin:5px 0 0;cursor:pointer}

/* v1.7 — inequalities have their own catalogue and a soft compositing stage. */
.ineq-preset-list{display:grid;gap:7px;margin:8px 0 9px}
.ineq-preset{width:100%;text-align:left;display:flex;align-items:center;gap:9px;padding:10px 12px;background:#fffaf3;border:1px solid #f1e1c7;border-radius:11px;color:#4f3141;min-width:0}
.ineq-preset:hover{background:#fff3e2;border-color:#e7bf8e}.ineq-preset .ineq-preset-symbol{flex:0 0 24px;display:grid;place-items:center;width:24px;height:26px;background:#ffe1b9;color:#a9672b;border-radius:8px;font:italic 20px Georgia,serif}
.ineq-preset-copy{min-width:0;flex:1}.ineq-preset strong,.system-preset strong{display:block;font-size:11.5px;line-height:1.3}.ineq-preset small,.system-preset small{display:block;font:11px/1.45 'Cambria Math',Georgia,serif;color:#a78163;margin-top:3px;overflow-wrap:anywhere}.ineq-preset .ineq-preset-plus{font-size:18px;color:#bd8a4a}
.system-preset{display:flex;align-items:center;gap:10px;width:100%;padding:13px 11px;border:1.4px solid #e7b985;border-radius:13px;background:linear-gradient(105deg,#fff0d8,#fff9ef);text-align:left;color:#5b374d;box-shadow:0 4px 12px #c4853522}
.system-preset:hover{border-color:#d79a4c;background:#ffeacb}.system-icon{display:grid;place-items:center;width:37px;flex:0 0 37px;height:48px;border-radius:10px;background:#ffe0b3;color:#ab6c32;font:42px/1 Georgia,serif}.system-copy{flex:1;min-width:0}.system-copy strong{font-size:12px}.system-plus{font-size:21px;color:#ae7437}
.inequality-style{flex-shrink:0}.ineq-style-note,.ineq-style-foot{font-size:10.5px;line-height:1.5;color:#8b7383;margin:0 0 12px}.ineq-style-foot{margin:10px 0 0}
.ineq-style-row{display:flex;justify-content:space-between;align-items:center;padding:8px 10px;border:1px solid #f0e1d0;border-radius:10px;margin-bottom:12px;background:#fffaf5;color:#785567;font-size:11px;font-weight:750}.ineq-style-row input{width:38px;height:27px;border:0;background:none;cursor:pointer}
.inequality-style .opacity-label input{accent-color:#e29e60}
@media(max-width:700px){.ineq-preset-list{grid-template-columns:1fr}.system-preset{min-height:62px}}
.system-clauses{margin:8px 0 12px;padding:10px 10px 11px;border:1px solid #f0dfcf;border-radius:12px;background:linear-gradient(180deg,#fffaf4,#fff)}
.system-clauses-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}.system-clauses-head strong{font-size:11px;color:#65485b}.system-clauses-head span{font-size:10px;color:#9b7a63}
.system-clause-list{display:grid;gap:7px}.system-clause-row{display:grid;grid-template-columns:auto auto 1fr;align-items:center;gap:8px;padding:8px 9px;border:1px solid #f1e6dc;border-radius:10px;background:#fff}.system-clause-row input{margin:0}.clause-swatch{width:14px;height:14px;border-radius:999px;border:1px solid #ffffff;box-shadow:0 0 0 1px #e1d0c4}.system-clause-copy{min-width:0}.system-clause-copy strong{display:block;font-size:10.5px;line-height:1.2;color:#67475c}.system-clause-copy small{display:block;margin-top:2px;font:11px/1.35 "Cambria Math",Georgia,serif;color:#9f7f69;overflow-wrap:anywhere}.system-add-btn{margin-top:9px;width:100%;border:1px dashed #deb890;border-radius:10px;background:#fff6ea;color:#8c5a2d;font-weight:760;font-size:11px;padding:9px 10px}.system-add-btn:hover{background:#ffedd4;border-color:#cb9958}.system-clauses-note{margin-top:8px;color:#997a68;font-size:10px;line-height:1.45}

/* MathLav v2.0 – inequality-system editor and legend */
.system-clauses{margin:11px 0 13px;padding:12px;border:1px solid #ecd9c7;border-radius:13px;background:linear-gradient(180deg,#fffaf5,#fff)}
.system-clauses-head{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:7px;margin:0 0 10px}.system-clauses-head strong{font-size:12px;color:#4b2f48}.system-clauses-head span{color:#977c78;font-size:10px}
.system-clause-list{display:grid;gap:9px}.system-clause-row{min-width:0;padding:9px;border-radius:11px;background:#fff;border:1px solid #f0e5d9;display:grid;grid-template-columns:minmax(0,1fr);gap:7px}
.system-clause-head{display:flex;align-items:center;gap:7px;min-width:0}.system-clause-head .clause-index{flex:1;min-width:0;color:#725a66;font-size:10.5px;font-weight:800}.system-clause-show{display:flex;align-items:center;gap:4px;font-size:10px;color:#897581;cursor:pointer;white-space:nowrap}.system-clause-show input{margin:0;accent-color:#7a2dbb}
.system-clause-row .clause-swatch{width:16px;height:16px;border-radius:50%;flex:0 0 16px;box-shadow:0 0 0 1px #d4bdaf;border:2px solid white}
.system-clause-actions{display:flex;gap:3px}.system-clause-actions button{border:1px solid #ebdfe6;background:#fffafc;border-radius:7px;width:26px;height:25px;color:#846177;font-size:13px}.system-clause-actions button:hover{background:#f8edf7;border-color:#cfa9dd}
.system-clause-edit{width:100%;min-width:0;border:1px solid #e8d7e5;border-radius:8px;padding:8px 9px;background:#fff;color:#422a42;font-size:13px;font-family:'Cambria Math',Georgia,serif}.system-clause-edit:focus{border-color:#ae81d0;outline:2px solid #efe3f6}
.system-clauses-note{font-size:10px;color:#927b84;line-height:1.4;margin-top:9px}.system-add-btn{width:100%;margin-top:9px;background:#fff5e9;border:1px dashed #dfae7e;color:#9d5e34;border-radius:9px;padding:9px;font-size:11px;font-weight:760}
.system-operation{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:11px 0}.system-operation button{min-width:0;border:1px solid #e3d1c4;border-radius:9px;background:#fff;padding:9px 4px;color:#805d58;font-size:11px;font-weight:760}.system-operation button[aria-pressed="true"]{border-color:#e3a46d;background:#fff0db;box-shadow:inset 0 0 0 1px #f3c596;color:#794b28}.system-operation button:focus-visible{outline:2px solid #a779c8}
.system-legend{padding:10px;background:#fffefa;border:1px solid #f0e6dc;border-radius:11px;margin-bottom:12px}.system-legend-head{font-size:10.5px;color:#624961;font-weight:800;margin-bottom:8px}.system-legend-list{display:grid;gap:6px}.system-legend-item{display:flex;align-items:center;gap:7px;min-width:0;font-size:10.5px;color:#68546b}.system-legend-item .legend-swatch{width:14px;height:14px;flex:0 0 14px;border:1px solid #fff;box-shadow:0 0 0 1px #e7d6cf;border-radius:4px}.system-legend-item .legend-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1}.system-legend-item.is-hidden{opacity:.48}.system-legend-item.is-result{font-weight:800;border-top:1px solid #ede4e0;padding-top:8px;margin-top:3px;color:#754a34}

/* v2.1: color picker is anchored to each swatch */
.graph-entry .entry-dot{overflow:visible;border:0;background:transparent!important;box-shadow:none;width:16px;height:16px;flex:0 0 16px}
.entry-dot .color-picker-dot{display:block}
.system-clause-head .clause-swatch,.system-legend-item .legend-swatch{background:transparent!important;border:0;box-shadow:none;overflow:visible;display:inline-flex;align-items:center;justify-content:center}
.system-clause-head .clause-swatch{min-width:17px;flex:0 0 17px}

.color-picker-dot{position:relative;display:inline-block;flex:0 0 16px;width:16px;height:16px;border:2px solid #fff;border-radius:50%;box-shadow:0 0 0 1px #cab9cc;cursor:pointer;overflow:hidden;vertical-align:middle}
.color-picker-dot input[type=color]{position:absolute;inset:-10px;width:40px;height:40px;padding:0;opacity:0;cursor:pointer;border:0}
.color-picker-dot:focus-within{outline:2px solid #a466cf;outline-offset:3px}
.system-result-color{display:flex;align-items:center;gap:8px;border:1px solid #efdbc9;background:#fff8ee;border-radius:10px;padding:9px 10px;margin:10px 0;font-size:11px;font-weight:750;color:#764d4a}
.system-result-color .color-picker-dot{flex-basis:19px;width:19px;height:19px}
.system-legend-item .color-picker-dot{flex-basis:14px;width:14px;height:14px}

/* v2.2 — compact, viewport-filling graph workspace */
@media screen and (min-width:1051px){
 html,body{height:100%;overflow:hidden}
 .app-shell{height:100vh;height:100dvh;min-height:0;overflow:hidden;grid-template-columns:252px minmax(0,1fr)}
 .sidebar{height:100%;min-height:0;position:relative;top:auto}
 .brand{padding:12px 13px 11px;gap:9px}
 .brand-logo{flex-basis:38px;height:38px;border-radius:11px}
 .brand-logo svg{width:30px;height:30px}
 .brand-title{font-size:19px}.brand-sub{font-size:10.5px;margin-top:2px}.brand-back{font-size:9px;margin-top:2px}
 .aside-scroll{padding:0 11px 12px}.aside-section{padding:13px 2px 14px}.aside-section.compact{padding-top:13px}
 .aside-footer{padding:8px 12px}
 .workspace{height:100%;min-height:0;min-width:0;padding:7px;overflow:hidden;display:flex;flex-direction:column}
 .topbar{display:none}
 .work-card{height:100%;flex:1 1 auto;min-height:0;max-width:none;border-radius:15px;box-shadow:0 4px 20px rgba(84,43,110,.07)}
 .work-head{flex:0 0 auto;min-height:43px;padding:6px 11px}
 .stage{flex:1 1 0;min-height:0;grid-template-columns:minmax(0,1fr) minmax(286px,302px);overflow:hidden}
 .plot-area{height:100%;min-height:0}
 .editor-panel{height:100%;min-height:0;max-height:none;overflow-y:auto;padding:12px 12px 14px}
 .editor-top{margin-bottom:9px}
 .work-footer{display:none}
}
/* Focus: temporarily hide side panels for an uninterrupted graph area. */
.app-shell.focus-view{grid-template-columns:minmax(0,1fr)}
.app-shell.focus-view>.sidebar,.app-shell.focus-view .editor-panel{display:none!important}
.app-shell.focus-view .stage{grid-template-columns:minmax(0,1fr)}
.focus-view-button{background:#f3eafb;color:#7531ad;border-color:#e0c7ef;font-weight:780}
.focus-view-button[aria-pressed=true]{background:#7a2dbb;color:#fff;border-color:#7a2dbb}
.compact-help-button{font-size:16px;font-weight:900;min-width:30px;padding:6px 9px}
@media screen and (max-width:1050px){
 html,body{overflow-x:hidden}
 .app-shell{height:auto;min-height:100vh}
 .workspace{padding:7px;min-height:0;height:auto}
 .topbar{display:none}
 .work-card{min-height:0;height:auto;border-radius:15px;overflow:hidden}
 .work-head{min-height:44px;padding:7px 9px}
 .stage{min-height:0;grid-template-columns:minmax(0,1fr);display:grid;overflow:visible}
 .plot-area{height:clamp(450px,70dvh,720px);min-height:0}
 .editor-panel{height:auto;max-height:none;min-height:0;overflow:visible}
 .work-footer{display:none}
 .app-shell.focus-view .plot-area{height:calc(100dvh - 66px);min-height:380px}
}
@media screen and (max-width:700px){
 .workspace{padding:5px}
 .work-card{border-radius:12px}
 .work-head{display:flex;flex-wrap:wrap;align-items:center;row-gap:6px}
 .work-head-right{flex-wrap:wrap;justify-content:flex-end;gap:5px}
 .head-action{font-size:10px;padding:6px 8px}
 .focus-view-button{margin-left:auto}
 .plot-area{height:clamp(395px,66dvh,650px)}
 .app-shell.focus-view .workspace{min-height:100dvh}
 .app-shell.focus-view .plot-area{height:calc(100dvh - 105px);min-height:360px}
 .plot-mark-top{max-width:64%}
}
@media screen and (max-width:440px){
 .focus-view-button{font-size:0;min-width:30px}
 .focus-view-button::first-letter{font-size:14px}
 .focus-view-button #focusViewLabel{display:none}
 .work-head .work-status{font-size:10px}
 .work-head-right{gap:3px}
 .compact-help-button{min-width:27px}
}

.mobile-catalog-button{display:none;border:1px solid #e9d9ef;background:#f8f0fd;color:#7531a9;border-radius:9px;padding:8px 10px;font-weight:800;font-size:11px;white-space:nowrap}
@media screen and (max-width:700px){
 .mobile-catalog-button{display:inline-flex;align-items:center;gap:5px;margin-left:auto}
 .brand{gap:8px}
 .sidebar:not(.catalog-open) .aside-scroll>.aside-section:not(:first-child){display:none!important}
 .sidebar .aside-scroll>.aside-section.compact{border-bottom:0;padding-bottom:10px}
 .sidebar.catalog-open .aside-scroll>.aside-section.compact{border-bottom:1px solid #f0eaf2}
}

/* v2.4: coordinate system selector and polar angle domain */
.coord-head{display:flex;align-items:center;justify-content:space-between;font-size:10px;color:#886d91;font-weight:760;margin:11px 0 6px}
.coord-switch{display:grid;grid-template-columns:1fr 1fr;gap:5px;padding:4px;background:#faf5fc;border:1px solid #eee2f3;border-radius:12px}
.coord-switch button{min-width:0;padding:8px 5px;font-size:11px;font-weight:760;border-radius:9px;border:1px solid transparent;background:transparent;color:#856c93}
.coord-switch button[aria-pressed=true]{background:#fff;color:#7530b1;border-color:#e7d8ef;box-shadow:0 2px 6px #52216b14}
.coordinate-help{padding:8px 9px;border-radius:9px;background:#fbf6ff;margin:9px 0 0;color:#755c84;font-size:10px;line-height:1.5}
.polar-range-panel{border:1px solid #e9d8ef;border-radius:12px;background:#fcf8ff;padding:12px;margin-top:13px}
.polar-range-panel strong{font-size:12px;color:#613785}.polar-range-panel p{color:#8a7794;margin:6px 0 10px;font-size:10.5px;line-height:1.5}
.polar-range-fields{display:grid;grid-template-columns:1fr 1fr;gap:9px}.polar-range-fields label{font-size:10.5px;color:#806b89;font-weight:700}
.polar-range-fields input{display:block;width:100%;padding:7px 8px;margin-top:4px;border-radius:8px;border:1px solid #ddcae9;background:white;font:12px Inter,system-ui,sans-serif}
@media(max-width:700px){.coord-switch button{padding:9px 6px}}

/* v2.6: sliders appear only with parameters and occupy minimum vertical space. */
.param-panel-compact{margin:8px 0 0;padding:6px;border-radius:10px;max-width:100%;min-width:0}
.param-panel-compact .param-list{gap:5px;max-height:240px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#ddc6ed transparent}
.param-panel-compact .param-row{padding:6px 8px;border-radius:9px}
.param-panel-compact .param-row-head{margin-bottom:1px;gap:6px}
.param-panel-compact .param-label{font-size:14px}
.param-panel-compact .param-value{font-size:11px}
.param-panel-compact .param-range{margin:1px 0;width:100%;height:15px}
.param-panel-compact .param-play,.param-panel-compact .param-options-toggle{min-height:25px;min-width:28px;border:1px solid #dfc8ea;background:#f8effd;color:#7436a0;border-radius:7px;font-size:12px}
.param-panel-compact .param-play[aria-pressed=true]{background:#7a2dbb;color:white}
.param-panel-compact .param-settings{margin-top:5px}
.param-panel-compact .param-settings[hidden]{display:none}
.param-panel-compact .param-settings label{font-size:9px}
.param-panel-compact .param-settings input{padding:4px 5px;margin-top:2px;font-size:11px}
/* v2.4: Desmos-like parameter controls, compact and independently scrollable. */
.param-panel{margin:12px 0 0;padding:12px 11px;background:linear-gradient(180deg,#fdfaff,#fffaf5);border:1px solid #e3d2ed;border-radius:13px}
.param-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px}.param-head strong{font-size:13px;color:#4f2c65}.param-head .small-hint{font-size:10px}
.param-panel p{margin:0 0 9px;color:#8a788e;font-size:10px;line-height:1.4}
.param-list{display:grid;gap:12px}
.param-row{padding:10px;background:#fff;border:1px solid #eadfec;border-radius:11px;min-width:0}
.param-row-head{display:flex;align-items:center;gap:7px;justify-content:space-between;margin-bottom:7px}
.param-label{font:bold italic 17px Georgia,serif;color:#7739a5}.param-value{font:700 12px Inter,system-ui,sans-serif;color:#6e5482;white-space:nowrap}
.param-actions{display:flex;align-items:center;gap:5px;margin-left:auto}.param-play{border:1px solid #dfc8ea;background:#f8effd;color:#7436a0;border-radius:8px;min-width:34px;min-height:30px;font-size:14px}.param-play[aria-pressed=true]{background:#7a2dbb;color:white}
.param-range{display:block;width:100%;accent-color:#9b61c7;cursor:pointer;margin:6px 0}
.param-settings{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:7px}.param-settings label{min-width:0;color:#89748f;font-size:9px;font-weight:740}
.param-settings input,.param-settings select{display:block;min-width:0;width:100%;margin-top:3px;padding:5px 4px;background:#fff;border:1px solid #e7d9eb;border-radius:7px;font-size:11px;color:#4c3b58}
.param-add{border:1px dashed #caa5df;background:#fbf6ff;border-radius:9px;color:#7a2dbb;padding:7px 10px;font-size:11px;font-weight:800;white-space:nowrap}
.param-sweep-note{color:#947d9e;font-size:10px;margin-top:5px}.param-empty{padding:8px;color:#96879d;font-size:11px;text-align:center;border:1px dashed #e5d5e9;border-radius:9px}
@media(max-width:500px){.param-settings{gap:4px}.param-row{padding:8px}.param-head{flex-wrap:wrap}}

/* MathLav v2.5 — compact sidebar: the function catalogue scrolls independently,
   while mode controls, inequality actions and saved constructions remain accessible. */
@media screen and (min-width:701px){
 .sidebar{min-height:0;overflow:hidden}
 .brand{flex:0 0 auto;gap:9px;padding:10px 11px 9px;min-height:61px}
 .brand-logo{flex-basis:38px;height:38px;border-radius:10px}
 .brand-logo svg{width:30px;height:30px}
 .brand-title{font-size:19px;line-height:1.08}
 .brand-sub{font-size:10px;margin-top:2px}
 .brand-back{display:none}
 .aside-scroll{display:flex;flex-direction:column;gap:0;overflow-y:auto;overflow-x:hidden;min-height:0;padding:0 10px 5px;scrollbar-width:thin}
 .aside-scroll>.aside-section{flex:0 0 auto;padding:8px 2px 9px}
 .aside-scroll>.aside-section.space-section{padding-top:9px;padding-bottom:9px}
 .aside-scroll>.catalog-section{display:flex;flex:1 1 150px;flex-direction:column;min-height:112px;overflow:hidden;padding-top:8px;padding-bottom:7px}
 .section-heading{font-size:10.5px;line-height:1.3;margin-bottom:6px}
 .eyebrow-label{padding:2px 5px;font-size:8px}
 .segmented{padding:3px;border-radius:10px}
 .segmented button{padding:7px 5px;border-radius:8px;font-size:12px}
 .mode-icon{font-size:13px;margin-right:4px}
 .coord-head{margin:6px 0 4px;font-size:9.5px}
 .coord-switch{padding:2px;gap:3px;border-radius:9px}
 .coord-switch button{padding:6px 3px;font-size:10px;border-radius:7px}
 .space-section .coordinate-help,.space-section #modeDescription{display:none}
 .catalog-section .search-wrap{margin-bottom:5px;padding:6px 8px;border-radius:9px;flex:0 0 auto}
 .catalog-section .search-wrap svg{width:14px;height:14px}
 .catalog-section .search-wrap input{font-size:10.5px}
 .catalog-section #presetList{display:grid;grid-template-columns:minmax(0,1fr);align-content:start;gap:2px;overflow-x:hidden;overflow-y:auto;min-height:0;flex:1 1 auto;padding:1px 3px 4px 0;scrollbar-color:#d7c1e1 transparent;scrollbar-width:thin;overscroll-behavior:contain;scroll-behavior:smooth}
 .catalog-section #presetList:focus-visible{outline:2px solid #a66fd1;outline-offset:-2px;border-radius:7px}
 .preset-card{grid-template-columns:32px minmax(0,1fr) 14px;gap:7px;padding:5px 4px;min-height:39px;border-radius:9px}
 .preset-icon{width:32px;height:32px;border-radius:8px;background:#f8f5ff;border-color:#e6def7}
 .preset-icon svg{width:28px;height:26px}
 .preset-name{font-size:10.5px;line-height:1.2}
 .preset-formula{font-size:9px;margin-top:2px}
 .preset-plus{font-size:16px}
 #inequalitySection{padding-top:6px;padding-bottom:7px}
 #inequalitySection .section-heading,#inequalitySection>.small-hint,#inequalitySection #ineqPresetList{display:none!important}
 #inequalitySection .system-preset{min-height:36px;padding:4px 8px;gap:7px;border-radius:9px;box-shadow:none}
 #inequalitySection .system-icon{width:25px;flex:0 0 25px;height:26px;font-size:23px;line-height:1;border-radius:6px}
 #inequalitySection .system-copy strong{font-size:10.5px;line-height:1.2}
 #inequalitySection .system-copy small{display:none}
 #inequalitySection .system-plus{font-size:16px}
 
 
 
 
 .palette-section{padding-top:0!important;padding-bottom:4px!important;border-bottom:0}
 .palette-content{padding-top:8px;padding-bottom:4px}
 .palette-section .chip{padding:5px 6px;font-size:9px;border-radius:7px}
 .palette-section .color-control{margin-top:6px;padding:5px 7px;font-size:10px}
 .aside-footer{flex:0 0 auto;padding:6px 11px;font-size:9px}
}
.palette-disclosure{min-width:0}
.palette-disclosure>summary{display:flex;align-items:center;justify-content:space-between;list-style:none;cursor:pointer;color:#76617f;font-weight:780;font-size:10.5px;padding:6px 1px;user-select:none}
.palette-disclosure>summary::-webkit-details-marker{display:none}
.palette-chevron{color:#aa91b8;transition:transform .16s;font-size:15px}
.palette-disclosure[open] .palette-chevron{transform:rotate(180deg)}
.palette-disclosure>summary:hover{color:var(--purple)}
@media screen and (max-width:700px){
 .brand{padding:10px 12px}
 .aside-scroll{display:grid;overflow:visible;min-height:0;padding:0 11px 7px}
 .aside-scroll>.aside-section{padding:9px 0}
 .aside-scroll>.aside-section.space-section{padding:9px 0 7px}
 .space-section .coordinate-help,.space-section #modeDescription{display:none}
 .section-heading{margin-bottom:7px}
 .catalog-section{min-height:0;display:block;overflow:visible}
 .catalog-section #presetList{display:flex;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;max-height:none;min-height:0;padding:0 0 7px;gap:6px;scroll-snap-type:x proximity}
 .catalog-section #presetList .preset-card{flex:0 0 152px;min-height:49px;grid-template-columns:35px minmax(0,1fr) 12px;gap:6px;padding:6px 5px}
 .catalog-section .search-wrap{margin-bottom:7px;padding:7px 9px}
 #inequalitySection .section-heading,#inequalitySection>.small-hint,#inequalitySection #ineqPresetList{display:none!important}
 #inequalitySection .system-preset{padding:7px 9px;min-height:38px;gap:8px;border-radius:10px}
 #inequalitySection .system-icon{width:27px;flex:0 0 27px;height:28px;font-size:25px;border-radius:7px}
 #inequalitySection .system-copy strong{font-size:11px}
 #inequalitySection .system-copy small{display:none}
 
 .palette-content{padding:8px 0 4px}
}

/* v2.9: five compact local graph slots, replacing printed variants. */
.saves-section{padding-top:8px!important;padding-bottom:8px!important}
.saves-disclosure{border:1px solid #e4d3eb;border-radius:11px;background:#fff;min-width:0}
.saves-disclosure>summary{display:flex;align-items:center;gap:7px;list-style:none;cursor:pointer;padding:10px 11px;font-size:12px;font-weight:800;color:#513061;user-select:none}
.saves-disclosure>summary::-webkit-details-marker{display:none}
.save-count{margin-left:auto;background:#f4eafa;color:#7b4aa0;padding:2px 6px;border-radius:7px;font-size:10px}
.saves-chevron{color:#9f80b6;transition:transform .15s}.saves-disclosure[open] .saves-chevron{transform:rotate(180deg)}
.saved-contents{padding:3px 8px 9px;border-top:1px solid #f0e7f3}
.save-new{border:1px solid #caadde;border-radius:8px;background:#f5edfa;color:#7131b5;font-size:11px;font-weight:760;width:100%;padding:8px 5px;margin:7px 0 6px}
.save-new:disabled{opacity:.45;cursor:not-allowed}
.saved-slots{display:grid;gap:5px}.saved-slot{display:flex;align-items:center;gap:4px;padding:4px;border:1px solid #eee4f2;background:#fff;border-radius:9px;min-width:0}
.saved-slot-main{min-width:0;flex:1;text-align:left;padding:5px 4px;border:0;background:none;border-radius:5px;display:block}
.saved-slot-main:hover:not(:disabled){background:#f9f2fd}.saved-slot-main:disabled{color:#b1a3b9;cursor:default}
.saved-slot-title{font-size:11px;font-weight:780;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.saved-slot-desc{font-size:9px;color:#9b8ba4;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}
.saved-slot-action{display:grid;place-items:center;width:25px;height:26px;flex:0 0 25px;border:1px solid #e9ddeb;border-radius:7px;background:#faf6fc;color:#815c91;font-size:13px}
.saved-slot-action:hover{background:#f2e6fb}.saved-slot-delete{color:#b36978}.save-help{font-size:9px;line-height:1.45;color:#92829e;margin:7px 3px 0}
.parametric-preset{margin-top:7px;background:#f4eeff;border-color:#d9c2f5;padding:7px 9px;min-height:38px}
.parametric-preset .system-icon{font-size:20px;background:#eee0ff;color:#8146b5;height:30px;width:30px;flex-basis:30px}
.parametric-preset:hover{background:#ece2ff;border-color:#c9a8ee}

/* v3.2: split equation editor for parametric x(t), y(t). */
.parametric-equation-editor{display:grid;gap:8px;margin:2px 0 7px;padding:9px;border:1px solid #e5d3f2;border-radius:12px;background:#fdf9ff;min-width:0}
.parametric-equation-editor[hidden]{display:none!important}
.parametric-equation-row{display:grid;grid-template-columns:52px minmax(0,1fr);align-items:center;gap:8px;min-width:0}
.parametric-equation-row label{font:italic 700 16px Georgia,serif;color:#7132ad;white-space:nowrap;text-align:right}
.parametric-equation-row input{width:100%;min-width:0;min-height:39px;padding:8px 10px;border:1px solid #decbeb;border-radius:9px;background:#fff;color:#332540;font:14px/1.2 'Cambria Math',Consolas,monospace;outline:none}
.parametric-equation-row input:focus{border-color:#a874d4;box-shadow:0 0 0 2px #ddc1f54a}
.parametric-editor-note{font-size:10px;line-height:1.35;color:#907c99;margin:0 0 0 60px}
@media(max-width:470px){.parametric-equation-editor{padding:7px}.parametric-equation-row{grid-template-columns:45px minmax(0,1fr);gap:5px}.parametric-editor-note{margin-left:50px}}

/* v3.2 — differential equations */
.ode-preset{margin-top:7px;border-color:#b5cfda;background:linear-gradient(105deg,#e9f7fb,#fffaf2)}
.ode-preset:hover{background:#e1f5f9;border-color:#7bafc4}
.ode-preset .system-icon{background:#dbf1f8;color:#267f9e;font:italic 22px/1 Georgia,serif}
.ode-tools{display:grid;gap:10px;padding:11px;border-radius:12px;border:1px solid #d5e9ef;background:#f7fcff;flex-shrink:0}
.ode-tools-head{display:flex;align-items:center;justify-content:space-between;gap:6px}
.ode-tools-head strong{color:#356a80;font-size:12px}
.ode-presets{font-size:10.5px;max-width:145px;padding:5px;border:1px solid #c9e2e9;border-radius:7px;color:#356a80;background:white}
.ode-checks{display:flex;flex-wrap:wrap;gap:7px 10px}
.ode-checks label{display:inline-flex;align-items:center;gap:5px;font-size:10px;font-weight:700;color:#577587;cursor:pointer}
.ode-checks input{margin:0;accent-color:#3191b1;width:14px;height:14px}
.ode-iso{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px;color:#426d81;font-size:11px;font-weight:700}
.ode-iso input{min-width:0;accent-color:#3b95bb}
.ode-initial{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.ode-initial label{display:flex;flex-direction:column;gap:4px;color:#698191;font-size:10px;font-weight:750}
.ode-initial input{min-width:0;width:100%;height:31px;border:1px solid #c9e0e9;border-radius:8px;padding:5px 8px;font-size:12px;color:#29536b;background:white}
.ode-actions{display:flex;gap:5px;flex-wrap:wrap}
.ode-actions button{border:1px solid #bedde8;background:white;color:#377b99;border-radius:8px;padding:7px 9px;font-size:10.5px;font-weight:800}
.ode-actions button:hover{background:#e5f6fa}
.ode-actions button[aria-pressed="true"]{background:#d8f1fc;border-color:#539cb7}
.ode-note{color:#778994;font-size:10px;line-height:1.45;margin:0}
.ode-seeds{display:flex;gap:5px;flex-wrap:wrap}
.ode-seeds button{padding:4px 6px;font:10px/1.2 Inter,system-ui,sans-serif;background:#e8f3f8;border:1px solid #d2e3e9;border-radius:7px;color:#47798e;cursor:pointer}
.phase-preset{margin-top:7px;border-color:#d4d6f6;background:linear-gradient(105deg,#f0f1ff,#fffaf7)}
.phase-preset:hover{background:#ebeefe;border-color:#8e91d8}
.phase-preset .system-icon{background:#e8e9ff;color:#5157b8;font:700 20px/1 Inter,system-ui,sans-serif}
.phase-tools{display:grid;gap:10px;padding:11px;border-radius:12px;border:1px solid #dddff6;background:#fafbff;flex-shrink:0}
.phase-tools-head{display:flex;align-items:center;justify-content:space-between;gap:6px}.phase-tools-head strong{color:#4952a5;font-size:12px}
.phase-checks{display:flex;flex-wrap:wrap;gap:7px 10px}.phase-checks label{display:inline-flex;align-items:center;gap:5px;font-size:10px;font-weight:700;color:#5e669d;cursor:pointer}.phase-checks input{margin:0;accent-color:#6670d9;width:14px;height:14px}
.phase-presets{font-size:10.5px;max-width:158px;padding:5px;border:1px solid #d2d5f0;border-radius:7px;color:#4d56a8;background:white}
.phase-initial{display:grid;grid-template-columns:1fr 1fr;gap:9px}.phase-initial label{display:grid;gap:4px;font-size:10px;color:#61729c;font-weight:700}.phase-initial input{border:1px solid #d8daef;border-radius:8px;padding:7px 8px;background:#fff;font:12px Inter,system-ui,sans-serif;color:#343651}
.phase-actions{display:flex;gap:7px;flex-wrap:wrap}.phase-actions button{flex:1;min-width:112px;padding:7px 8px;border-radius:8px;border:1px solid #d6d9ef;background:#eef0ff;color:#4952a5;font-weight:700;font-size:10.5px;cursor:pointer}.phase-actions button:hover{background:#e5e9ff}.phase-actions button[aria-pressed="true"]{background:#dde4ff;border-color:#7a84e1}
.phase-note{color:#7880a7;font-size:10px;line-height:1.45;margin:0}.phase-seeds{display:flex;gap:5px;flex-wrap:wrap}.phase-seeds button{padding:4px 6px;font:10px/1.2 Inter,system-ui,sans-serif;background:#edf0ff;border:1px solid #d9def2;border-radius:7px;color:#4956a0;cursor:pointer}
.phase-equation-editor{display:grid;gap:8px;margin-top:8px}.phase-equation-row{display:grid;grid-template-columns:58px minmax(0,1fr);gap:8px;align-items:center}.phase-equation-row label{font-size:12px;font-weight:800;color:#4c539c}.phase-equation-row input{width:100%;border:1px solid #dddff3;border-radius:9px;padding:10px 11px;font:13px Inter,system-ui,sans-serif;color:#302d47;background:#fff}.phase-editor-note{margin:0;font-size:10px;color:#6e77a7;line-height:1.4}
.phase-badge{display:inline-flex;align-items:center;gap:5px;padding:4px 8px;border-radius:999px;background:#eef0ff;color:#525bb1;font-size:10px;font-weight:800}
@media(max-width:420px){.phase-tools{padding:9px}.phase-presets{max-width:132px}}
@media(max-width:420px){.ode-tools{padding:9px}.ode-presets{max-width:128px}}

/* v3.5: shared vector-field density and size controls */
.field-controls{display:grid;gap:7px;padding:8px 9px;border:1px solid #e2e1f3;border-radius:10px;background:rgba(255,255,255,.72)}
.field-control{display:grid;grid-template-columns:91px minmax(0,1fr) 37px;align-items:center;gap:8px;min-width:0}
.field-control label{font-size:10.5px;font-weight:700;color:#606489;white-space:nowrap}
.field-control input{min-width:0;width:100%;margin:0;accent-color:#8063c2;cursor:pointer}
.field-control output{font-size:10.5px;font-weight:800;color:#65529b;text-align:right;font-variant-numeric:tabular-nums}
@media(max-width:420px){.field-control{grid-template-columns:82px minmax(0,1fr) 32px;gap:6px}}
/* v3.7: compact editor, no horizontal overflow, motion-only overlay */
#phaseMotionCanvas{z-index:2;pointer-events:none;display:none}
.plot-area .plot-mark,.plot-area .plot-tools,.plot-area .plot-corner,.plot-area .toast{z-index:3}
.editor-panel{overflow-x:hidden;min-width:0}
.editor-panel *{box-sizing:border-box}
.phase-tools,.ode-tools,.phase-tools-head,.ode-tools-head,.phase-checks,.ode-checks,.field-controls,.field-control,.phase-initial,.ode-initial,.param-panel,.param-row,.formula-editor{width:100%;max-width:100%;min-width:0}
.phase-tools,.ode-tools{gap:8px;padding:10px}
.phase-tools-head,.ode-tools-head{flex-wrap:wrap;align-items:center;row-gap:6px}
.phase-tools-head strong,.ode-tools-head strong{flex:0 0 auto;max-width:100%;white-space:normal}
.phase-presets,.ode-presets{flex:1 1 116px;max-width:100%;width:auto;min-width:0;overflow:hidden;text-overflow:ellipsis}
.phase-checks,.ode-checks{gap:6px 8px}
.phase-checks label,.ode-checks label{min-width:0;max-width:100%;overflow-wrap:anywhere;white-space:normal}
.field-controls{padding:7px 7px;max-width:100%;min-width:0}
.field-control{grid-template-columns:minmax(0,78px) minmax(36px,1fr) minmax(32px,max-content);column-gap:6px;max-width:100%;min-width:0}
.field-control label{min-width:0;white-space:normal;line-height:1.2;overflow-wrap:anywhere}
.field-control input{min-width:0;width:100%;max-width:100%}
.field-control output{white-space:nowrap;max-width:100%;text-align:right}
.phase-initial,.ode-initial{grid-template-columns:repeat(2,minmax(0,1fr))}
.phase-initial label,.ode-initial label,.phase-initial input,.ode-initial input{min-width:0;max-width:100%;width:100%}
.phase-actions,.ode-actions{width:100%;gap:5px}
.phase-actions button,.ode-actions button{flex:1 1 90px;min-width:0;white-space:normal;overflow-wrap:anywhere}
.phase-motion-controls{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:7px 8px;align-items:center;min-width:0;max-width:100%;padding:8px;background:#f1f2ff;border:1px solid #dbdff6;border-radius:9px;overflow:hidden}
.phase-motion-controls button{grid-column:1/-1;min-width:0;border:1px solid #bcc5ef;border-radius:7px;background:white;color:#5257a8;padding:8px 10px;font-weight:800;font-size:11px;white-space:normal;line-height:1.25;text-align:left}
.phase-motion-controls button[aria-pressed="true"]{background:#5b62bd;color:#fff;border-color:#5b62bd}
.phase-motion-controls label{min-width:0;font-size:10px;color:#69739c;white-space:nowrap}
.phase-motion-controls input{min-width:0;width:100%;accent-color:#6669bf}
.phase-motion-controls output{font-size:10px;font-weight:800;white-space:nowrap;color:#555ab1;text-align:right}
@media(max-width:420px){.phase-motion-controls{grid-template-columns:minmax(0,1fr) auto}.phase-motion-controls label{grid-column:1;grid-row:2}.phase-motion-controls input{grid-column:1;grid-row:3}.phase-motion-controls output{grid-column:2;grid-row:3;align-self:center}}

.brand-logo img{display:block;width:34px;height:34px;object-fit:contain}
.graph-back-link{display:inline-block;text-decoration:none;color:#75439b;font-weight:750}.graph-back-link:hover{text-decoration:underline}


/* v4.3 — responsive editor polish. Presentation only; formula and drawing engine unchanged. */
.editor-panel{
  min-width:0;
  overflow-x:hidden;
  padding:12px 12px 15px;
  scrollbar-width:thin;
}
.editor-panel :where(section,div,form,label){min-width:0}
.editor-panel :where(input:not([type=checkbox]):not([type=color]):not([type=radio]),textarea,select){min-width:0;max-width:100%}
.editor-top{margin-bottom:9px;gap:8px}
.editor-top>div{min-width:0}
.editor-panel .editor-divider{margin:11px 0}
.editor-panel .editor-heading{align-items:center;gap:8px;margin-bottom:9px;min-width:0}
.editor-panel .editor-heading>div{flex:1 1 auto;min-width:0}
.editor-panel .editor-heading h3{font-size:14px;line-height:1.25;overflow-wrap:break-word}
.editor-panel .selection-indicator{
  flex:0 1 112px;
  max-width:112px;
  min-width:0;
  white-space:normal;
  text-overflow:clip;
  overflow-wrap:anywhere;
  line-height:1.25;
  text-align:right;
  padding:5px 6px;
  font-size:9px;
}
.editor-panel .graph-list{gap:6px;max-height:clamp(158px,30vh,325px)}
.editor-panel .graph-entry{padding:9px 8px;row-gap:5px}
.editor-panel .graph-entry.entry-long{min-height:74px}
.editor-panel .graph-entry.entry-long .entry-copy{overflow:visible}
.editor-panel .graph-entry.entry-long .entry-name{
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  line-height:1.25;
  overflow-wrap:break-word;
}
.editor-panel .graph-entry.entry-long .entry-math-area{padding-top:5px}
.editor-panel .entry-math-viewport math{font-size:17px}
.editor-panel .formula-tools{gap:8px;flex-wrap:wrap;min-width:0}
.editor-panel .formula-status{flex:1 1 108px;min-width:0;overflow-wrap:anywhere}
.editor-panel .keyboard-button{margin-left:auto;flex:0 0 auto}
.editor-panel .formula-input-wrap{min-width:0;padding:8px 10px 5px}
.editor-panel .formula-input-wrap textarea{min-width:0;resize:vertical}
.editor-panel :where(.parametric-equation-editor,.phase-equation-editor){gap:7px;margin:3px 0 5px}
.editor-panel :where(.parametric-equation-row,.phase-equation-row){grid-template-columns:52px minmax(0,1fr);gap:6px;align-items:center}
.editor-panel :where(.parametric-equation-row,.phase-equation-row) input{min-width:0;min-height:36px;padding:7px 9px}
.editor-panel .phase-equation-row label{white-space:nowrap}
.editor-panel :where(.phase-tools,.ode-tools,.system-clauses,.polar-range-panel,.style3d-panel,.param-panel){width:100%;min-width:0;max-width:100%}
.editor-panel :where(.phase-tools,.ode-tools){padding:9px;gap:8px}
.editor-panel :where(.phase-tools-head,.ode-tools-head){display:grid;grid-template-columns:minmax(0,1fr);gap:6px;align-items:start}
.editor-panel :where(.phase-tools-head,.ode-tools-head) strong{font-size:11px;line-height:1.3;max-width:100%;overflow-wrap:anywhere}
.editor-panel :where(.phase-presets,.ode-presets){display:block;min-width:0;width:100%;max-width:100%;min-height:31px;padding:5px 8px;font-size:10.5px}
.editor-panel :where(.phase-checks,.ode-checks){display:flex;gap:5px 9px;flex-wrap:wrap}
.editor-panel :where(.phase-checks,.ode-checks) label{font-size:10px;line-height:1.3}
.editor-panel :where(.phase-checks,.ode-checks) input{flex:0 0 auto}
.editor-panel .field-controls{padding:7px 8px;gap:7px}
.editor-panel .field-control{grid-template-columns:minmax(0,76px) minmax(34px,1fr) 37px;gap:6px;align-items:center}
.editor-panel .field-control label{font-size:10px;line-height:1.25}
.editor-panel .field-control output{font-size:10px;font-variant-numeric:tabular-nums}
.editor-panel .ode-iso{grid-template-columns:63px minmax(0,1fr) 25px;gap:6px;min-width:0}
.editor-panel .ode-iso output{font-size:10px;text-align:right}
.editor-panel :where(.phase-initial,.ode-initial,.polar-range-fields){grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.editor-panel :where(.phase-initial,.ode-initial,.polar-range-fields) label{min-width:0;max-width:100%;width:100%}
.editor-panel :where(.phase-initial,.ode-initial,.polar-range-fields) input{width:100%;min-width:0;min-height:31px}
.editor-panel :where(.phase-actions,.ode-actions){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;width:100%}
.editor-panel :where(.phase-actions,.ode-actions) button{min-width:0;max-width:100%;font-size:10px;line-height:1.25;padding:7px 5px;overflow-wrap:break-word}
.editor-panel :where(.phase-actions,.ode-actions) button:last-child:nth-child(3){grid-column:1/-1}
.editor-panel .phase-motion-controls{
  display:grid;
  grid-template-columns:minmax(50px,auto) minmax(0,1fr) 28px;
  gap:6px 7px;
  align-items:center;
  min-width:0;
  padding:7px;
  overflow:visible;
}
.editor-panel .phase-motion-controls button{grid-column:1/-1;font-size:10.5px;min-height:32px;line-height:1.25;text-align:center;padding:7px 8px;white-space:normal;overflow-wrap:anywhere}
.editor-panel .phase-motion-controls label{grid-column:1;grid-row:auto;white-space:nowrap;font-size:10px}
.editor-panel .phase-motion-controls input{grid-column:2;grid-row:auto;min-width:0;width:100%;margin:0}
.editor-panel .phase-motion-controls output{grid-column:3;grid-row:auto;min-width:0;font-variant-numeric:tabular-nums}
.editor-panel .system-clauses{padding:9px;margin:9px 0}
.editor-panel .system-clauses-head{margin-bottom:7px}
.editor-panel .system-clause-list{gap:6px}
.editor-panel .system-clause-row{padding:7px;gap:6px}
.editor-panel .system-clause-head{display:grid;grid-template-columns:17px minmax(0,1fr) auto auto;gap:5px;align-items:center;min-width:0}
.editor-panel .system-clause-head .clause-index{min-width:0;overflow-wrap:anywhere;font-size:10px}
.editor-panel .system-clause-show{white-space:nowrap;font-size:9.5px}
.editor-panel .system-clause-actions{gap:3px}
.editor-panel .system-clause-actions button{width:24px;height:24px;padding:0}
.editor-panel .system-clause-edit{min-height:34px;padding:7px 9px;min-width:0}
.editor-panel .system-clauses-note{margin:7px 0 0;font-size:9.5px;line-height:1.35}
.editor-panel .system-add-btn{margin-top:7px;padding:8px 7px}
.editor-panel .system-operation{gap:6px;margin:9px 0}
.editor-panel .system-operation button{min-width:0;white-space:normal;line-height:1.25;padding:8px 4px;font-size:10px}
.editor-panel .system-legend{margin-bottom:8px;padding:8px}
.editor-panel .system-legend-item .legend-label{min-width:0;white-space:normal;overflow-wrap:anywhere;text-overflow:clip}
.editor-panel .system-result-color{display:flex;justify-content:space-between;gap:7px;font-size:10.5px;padding:8px}
.editor-panel .system-result-color .color-picker-dot{flex:0 0 19px}
.editor-panel .ineq-style-note[hidden]{display:none!important}
.editor-panel :where(.style3d-options,.transform-grid,.shift-grid){grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.editor-panel .style3d-options button{min-width:0;overflow-wrap:break-word;padding:9px 5px;line-height:1.3}
.editor-panel .transform-btn{min-width:0;min-height:66px;padding:9px 5px;gap:5px}
.editor-panel .transform-btn strong{font-size:17px}
.editor-panel .transform-btn span{font-size:9.5px;overflow-wrap:anywhere}
.editor-panel .transform-title{margin:12px 0 7px}
.editor-panel .shift-btn{min-width:0;padding:8px 5px;white-space:normal}
.editor-panel .shift-fields{gap:7px;margin-top:9px}
.editor-panel .shift-fields label{min-width:0}
.editor-panel .shift-fields input{min-width:0;max-width:100%;padding:7px 6px}
.editor-panel .transform-note{margin-top:7px;font-size:10px;line-height:1.35}
.editor-panel .polar-range-panel{padding:9px;margin-top:10px}
.editor-panel .polar-range-panel p{margin:4px 0 7px;line-height:1.35}
.editor-panel .param-panel{margin-top:8px}
.editor-panel .param-row{padding:7px;min-width:0}
.editor-panel .param-settings{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
.editor-panel .param-settings input{min-width:0;padding:6px 4px}
@media(max-width:380px){
 .editor-panel{padding:10px}
 .editor-panel .graph-entry{padding:8px 6px}
 .editor-panel .selection-indicator{flex-basis:93px;max-width:93px;font-size:8.7px}
 .editor-panel .system-clause-head{gap:4px}
 .editor-panel .field-control{grid-template-columns:66px minmax(0,1fr) 36px;gap:5px}
 .editor-panel :where(.phase-actions,.ode-actions) button{font-size:9.5px}
}


/* Unavailable transforms should not consume vertical space in polar, inequality,
   ODE, phase, or 2D parametric editors. Relevant controls remain for ordinary functions. */
.editor-panel .transforms-section{min-width:0;flex:0 0 auto}
.editor-panel .transforms-section:has(#resetTransforms:disabled){display:none!important}

/* Site navigation remains visible when the mobile catalog is collapsed. */
.brand-title{margin:0}
.graph-back-link{display:inline-block!important}

/* step50: six complete rows cannot be shrunk away by the lower controls. */
@media screen and (min-width:701px){
 .sidebar .aside-scroll{overflow-y:auto;min-height:0}
 .sidebar .aside-scroll>.catalog-section{flex:0 0 auto;min-height:0;overflow:visible}
 .catalog-section #presetList{flex:none;grid-auto-rows:44px;gap:4px;height:288px;min-height:288px;max-height:288px;overflow-y:auto;padding:0 4px 4px 0}
 .catalog-section .preset-card{height:44px;min-height:44px;grid-template-columns:30px minmax(0,1fr) 14px;padding:4px;box-sizing:border-box}
 .catalog-section .preset-icon{width:30px;height:30px}
 .catalog-section .preset-name,.catalog-section .preset-formula{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}
.add-formula-graph{width:100%;margin-top:10px;border:0;border-radius:11px;padding:11px 14px;background:var(--purple);color:#fff;font-weight:800}
.add-formula-graph:disabled{cursor:not-allowed;opacity:.45}
.formula-input-wrap textarea[aria-invalid="true"]{outline:2px solid #ba4666;outline-offset:2px}

/* A visible catalogue always reserves six full rows, including narrow windows. */
.catalog-section #presetList{display:grid;grid-template-columns:minmax(0,1fr);grid-auto-rows:44px;align-content:start;gap:4px;flex:none;height:288px;min-height:288px;max-height:288px;overflow-x:hidden;overflow-y:auto;padding:0 4px 4px 0}
.catalog-section #presetList .preset-card{flex:none;width:100%;height:44px;min-height:44px;grid-template-columns:30px minmax(0,1fr) 14px;padding:4px;box-sizing:border-box}
.catalog-section #presetList .preset-icon{width:30px;height:30px}
.catalog-section #presetList .preset-name,.catalog-section #presetList .preset-formula{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* MathLav 4.4: compact educational point-by-point graph construction. */
#lessonCanvas{z-index:3;pointer-events:none;display:none}
.lesson-tool{display:grid;gap:9px;min-width:0;padding:10px;border:1px solid #dac5ec;border-radius:12px;background:linear-gradient(150deg,#fcfaff,#f8f5ff);margin:9px 0 10px}
.lesson-tool button,.lesson-tool select{font:inherit}
.lesson-toggle{border:1px solid #c9a8e6;border-radius:9px;background:white;color:#6536a4;font-size:11.5px;font-weight:800;padding:9px 10px;text-align:left;width:100%;min-width:0;cursor:pointer}
.lesson-toggle[aria-pressed=true]{background:#eee3fb}
.lesson-toggle[hidden],.lesson-tool[hidden],.lesson-body[hidden]{display:none!important}
.lesson-body{min-width:0;display:grid;gap:9px}
.lesson-controls{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:5px;min-width:0}
.lesson-controls button{border:1px solid #ddc6ed;border-radius:8px;background:#fff;color:#6939a1;font-size:10.5px;font-weight:730;padding:8px 6px;min-width:0}
.lesson-controls button:disabled{opacity:.35;cursor:default}
.lesson-speed{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:10px;color:#83718f}
.lesson-speed select{max-width:100px;min-width:75px;border:1px solid #ddd0ee;background:white;padding:4px 8px;border-radius:7px;font-size:10px;color:#57436e}
.lesson-current{background:#fff;border:1px solid #e9def2;border-radius:9px;padding:10px;min-width:0}
.lesson-current .lesson-counter{font-size:9px;color:#9373b1;font-weight:800;letter-spacing:.04em}
.lesson-current strong{display:block;margin:5px 0;font-size:12.5px;color:#362442;overflow-wrap:anywhere}
.lesson-current p{font-size:11px;line-height:1.5;color:#645773;margin:0;overflow-wrap:anywhere;white-space:normal}
.lesson-timeline{display:flex;gap:5px;overflow-x:auto;max-width:100%;padding-bottom:5px;scrollbar-width:thin}
.lesson-step{flex:0 0 auto;max-width:135px;min-width:70px;border:1px solid #e6d9ef;background:#fff;color:#816b90;padding:6px 7px;border-radius:7px;font-size:9.5px;white-space:normal;text-align:left;line-height:1.3}
.lesson-step.is-current{border-color:#8c56cd;background:#efe4fe;color:#542a92;font-weight:750}.lesson-step.is-done{border-color:#e2c2e9;background:#fcf6ff}
@media(max-width:390px){.lesson-tool{padding:8px}.lesson-controls button{font-size:10px;padding:7px 4px}}

/* v4.5: notebook-style cumulative construction walkthrough. */
.editor-panel.lesson-view{display:flex;flex-direction:column;overflow:hidden!important;max-height:none;min-height:0;height:100%;padding:11px 11px 12px;background:#fcfaff}
.editor-panel.lesson-view > :not(#lessonPanel){display:none!important}
.editor-panel.lesson-view #lessonPanel{display:flex!important;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden;margin:0;padding:0;background:none;border:0;gap:8px;box-shadow:none}
.editor-panel.lesson-view .lesson-toggle{flex:0 0 auto;padding:7px 10px;background:#f3e8fd;color:#673ba4;text-align:left;font-size:11px}
.editor-panel.lesson-view .lesson-body{display:flex!important;flex-direction:column;flex:1 1 auto;min-height:0;gap:9px}
.lesson-function{flex:0 0 auto;padding:11px 12px 12px;border:1px solid #e2d5ed;background:#fff;border-radius:12px;min-width:0}
.lesson-eyebrow{font-size:9px;font-weight:820;letter-spacing:.09em;color:#895caf;margin-bottom:6px}
.lesson-formula{min-width:0;overflow-wrap:anywhere;font-size:19px;line-height:1.4;color:#281a36;overflow-x:auto;scrollbar-width:thin}
.lesson-formula math{font-size:1.17em;max-width:none;vertical-align:middle}
.editor-panel.lesson-view .lesson-controls{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) minmax(0,1fr);gap:6px;flex:0 0 auto}
.editor-panel.lesson-view .lesson-controls button{min-width:0;min-height:35px;font-size:10.5px;line-height:1.25;padding:7px 4px;white-space:normal;overflow-wrap:anywhere}
.editor-panel.lesson-view .lesson-controls #lessonPlay{background:#eee1fb;border-color:#cdaae9;color:#62309b;font-weight:810}
.editor-panel.lesson-view .lesson-speed{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:7px;font-size:10px;min-width:0;flex:0 0 auto}
.editor-panel.lesson-view .lesson-speed label{min-width:0;overflow-wrap:anywhere}
.editor-panel.lesson-view .lesson-speed select{min-width:64px;max-width:88px;width:auto}
.lesson-position{color:#7a5696;font-size:10px;font-weight:780;text-align:right;white-space:nowrap}
.lesson-paper{background:#fff;border:1.5px solid #d8c9eb;border-radius:13px;flex:1 1 auto;min-height:220px;overflow-y:auto;overflow-x:hidden;padding:8px 9px 10px;scrollbar-color:#d5bee8 transparent;scrollbar-width:thin;overscroll-behavior:contain}
.lesson-transcript{display:grid;gap:0;min-width:0}
.lesson-record{border-bottom:1px solid #f0e8f7;padding:0 0 6px;margin-bottom:6px;min-width:0;animation:lesson-reveal .22s ease-out}
.lesson-record:last-child{border-bottom:0;margin-bottom:0;padding-bottom:0}
.lesson-record h4{margin:0 0 2px;color:#342243;font-weight:800;font-size:11.5px;line-height:1.26;overflow-wrap:anywhere}
.lesson-record.is-current h4{color:#633298}
.lesson-record-body{display:grid;gap:2px;min-width:0}
.lesson-record-body p{margin:0;color:#47364f;font:13px/1.28 'Cambria Math',Georgia,serif;overflow-wrap:anywhere;word-break:normal}
.lesson-record-body p.lesson-equation{font-size:14px;letter-spacing:.01em;color:#2f2140}
.lesson-record-num{display:none}
.lesson-paper:focus-visible{outline:2px solid #b184d9;outline-offset:-2px}
@keyframes lesson-reveal{from{opacity:.4;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
@media(min-width:1051px){.editor-panel.lesson-view .lesson-paper{max-height:none}}
@media(max-width:1050px){.editor-panel.lesson-view{height:auto;max-height:none;min-height:400px;overflow:visible!important}.editor-panel.lesson-view .lesson-body{min-height:0}.editor-panel.lesson-view .lesson-paper{flex:0 1 auto;height:clamp(300px,52vh,540px);min-height:250px}}
@media(max-width:390px){.editor-panel.lesson-view .lesson-paper{padding:12px 10px}.lesson-record h4{font-size:12px}.lesson-record-body p{font-size:12px}.editor-panel.lesson-view .lesson-controls button{font-size:10px;padding:7px 2px}.lesson-formula{font-size:17px}}
@media(prefers-reduced-motion:reduce){.lesson-record{animation:none}}


/* v4.6: one mathematical equality per frame; compact notebook, native MathML. */
.lesson-paper{padding:9px 12px 10px!important}
.lesson-transcript{display:flex;flex-direction:column;align-items:stretch;gap:0}
.lesson-record,.lesson-record:last-child{border:0!important;padding:0!important;margin:0!important;min-width:0;animation:lesson-reveal .17s ease-out}
.lesson-record .lesson-math{display:block;font-size:15px;line-height:1.14;color:#201627;min-height:24px;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;padding:1px 0}
.lesson-record .lesson-math math{font-family:'Cambria Math',math,serif;font-size:1.1em;max-width:none;white-space:nowrap}
.lesson-heading{font:700 11.5px/1.3 Inter,system-ui,sans-serif;color:#322142;margin:5px 0 2px}
.lesson-note{font:600 11.5px/1.4 Inter,system-ui,sans-serif;color:#5c3a83;padding:2px 0}
.lesson-record.is-current .lesson-math{color:#39234c}
@media(max-width:390px){.lesson-paper{padding:8px!important}.lesson-record .lesson-math{font-size:13.5px}}

/* The notebook grows with the calculation; it only scrolls when genuinely full. */
.editor-panel.lesson-view .lesson-paper{flex:0 1 auto;height:auto;min-height:52px;max-height:min(64vh,580px);overflow-y:auto}
@media(max-width:1050px){.editor-panel.lesson-view .lesson-paper{flex:0 1 auto;height:auto;min-height:52px;max-height:58vh}}


/* MathLav step52: one native document scroll, in portrait and landscape. */
.mobile-plot-controls,.graph-mobile-nav{display:none}
@media screen and (max-width:1400px){
 html:where(.graph-phone-ui){height:auto;overflow-x:hidden;overflow-y:auto;scroll-padding-bottom:calc(76px + env(safe-area-inset-bottom))}
 body:where(.graph-phone-ui),body:where(.graph-phone-ui).graph-lesson-active{height:auto;min-height:100vh;overflow-x:hidden;overflow-y:auto;touch-action:auto;padding-bottom:calc(70px + env(safe-area-inset-bottom))}
 :where(body.graph-phone-ui) .app-shell,:where(body.graph-phone-ui) .app-shell.focus-view{display:block;height:auto;min-height:0;overflow:visible}
 :where(body.graph-phone-ui) .sidebar{position:static;height:auto;min-height:0;max-height:none;overflow:visible;border-right:0;border-bottom:2px solid var(--orange);padding-top:env(safe-area-inset-top);padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
 :where(body.graph-phone-ui) .brand{flex-wrap:wrap;gap:8px;padding:10px 12px}
 :where(body.graph-phone-ui) .brand-copy{flex:1 1 120px;min-width:0}
 :where(body.graph-phone-ui) .mobile-catalog-button{display:inline-flex;align-items:center;flex:0 0 auto;min-height:44px;padding:8px 10px}
 :where(body.graph-phone-ui) .aside-scroll{display:block;min-height:0;max-height:none;overflow:visible;overscroll-behavior:auto;padding:0 12px 10px;flex:none}
 :where(body.graph-phone-ui) .aside-scroll>.aside-section,:where(body.graph-phone-ui) .aside-scroll>.catalog-section{flex:none;min-height:0;max-height:none;overflow:visible;padding:10px 0}
 :where(body.graph-phone-ui) .sidebar:not(.catalog-open) .aside-scroll>.aside-section:not(:first-child){display:none!important}
 :where(body.graph-phone-ui) .sidebar.catalog-open .aside-scroll>.aside-section{display:block}
 :where(body.graph-phone-ui) .aside-footer{display:none}
 :where(body.graph-phone-ui) .catalog-section #presetList{
  display:grid;grid-template-columns:minmax(0,1fr);grid-auto-rows:44px;align-content:start;
  gap:4px;height:288px;min-height:288px;max-height:288px;flex:none;
  overflow-x:hidden;overflow-y:auto;overscroll-behavior:auto;touch-action:auto;
  scroll-snap-type:none;scroll-behavior:auto;padding:0 0 4px;
  -webkit-overflow-scrolling:touch;
 }
 :where(body.graph-phone-ui) .catalog-section #presetList .preset-card{display:grid;width:100%;min-width:0;min-height:44px;height:44px;flex:none;grid-template-columns:34px minmax(0,1fr) 18px;gap:8px;padding:4px 7px;touch-action:auto}
 :where(body.graph-phone-ui) .preset-icon{width:32px;height:32px}:where(body.graph-phone-ui) .preset-name{font-size:12px}:where(body.graph-phone-ui) .preset-formula{font-size:10px;margin-top:1px}
 :where(body.graph-phone-ui) .preset-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 :where(body.graph-phone-ui) .search-wrap input,:where(body.graph-phone-ui) .editor-panel input:not([type=range]):not([type=color]),:where(body.graph-phone-ui) .formula-input-wrap textarea,:where(body.graph-phone-ui) .lesson-speed select,:where(body.graph-phone-ui) .editor-panel.lesson-view .lesson-speed select{font-size:16px}
 :where(body.graph-phone-ui) .workspace,:where(body.graph-phone-ui).graph-lesson-active .workspace{
  position:static;inset:auto;z-index:auto;width:auto;height:auto;min-height:0;overflow:visible;
  padding:6px max(6px,env(safe-area-inset-right)) 6px max(6px,env(safe-area-inset-left));
 }
 :where(body.graph-phone-ui) .work-card,:where(body.graph-phone-ui).graph-lesson-active .work-card{display:flex;flex-direction:column;height:auto;min-height:0;max-width:none;overflow:visible;flex:none;border-radius:12px}
 :where(body.graph-phone-ui) .work-head,:where(body.graph-phone-ui).graph-lesson-active .work-head{display:flex;flex-wrap:wrap;min-height:0;gap:6px;padding:8px}
 :where(body.graph-phone-ui) .work-head-right{min-width:0;flex-wrap:wrap;gap:6px}
 :where(body.graph-phone-ui) .work-head .head-action,:where(body.graph-phone-ui) .segmented button,:where(body.graph-phone-ui) .coord-switch button{min-height:44px}
 :where(body.graph-phone-ui) .work-head .graph-count,:where(body.graph-phone-ui) .work-head .splitter,:where(body.graph-phone-ui) .work-footer,:where(body.graph-phone-ui) .topbar{display:none}
 :where(body.graph-phone-ui) .stage,:where(body.graph-phone-ui).graph-lesson-active .stage{
  display:grid;height:auto;min-height:0;overflow:visible;flex:none;
  grid-template-columns:minmax(0,1fr);grid-template-rows:auto;align-items:start;
 }
 :where(body.graph-phone-ui) .plot-area,:where(body.graph-phone-ui).graph-lesson-active .plot-area{
  position:relative;height:clamp(230px,48vh,500px)!important;height:clamp(230px,48svh,500px)!important;
  min-height:0;min-width:0;touch-action:pan-y pinch-zoom;cursor:auto;border-radius:10px;
 }
 :where(body.graph-phone-ui) .plot-area.plot-touch-active{touch-action:none;cursor:grab}
 :where(body.graph-phone-ui) .plot-area.plot-touch-active.dragging{cursor:grabbing}
 :where(body.graph-phone-ui) .plot-area .plot-tools,:where(body.graph-phone-ui) .plot-area .plot-mark,:where(body.graph-phone-ui) .plot-area .plot-corner{z-index:4}
 :where(body.graph-phone-ui) .plot-tool{width:44px;height:44px}
 :where(body.graph-phone-ui) .plot-tools{right:10px;bottom:10px;gap:4px}
 :where(body.graph-phone-ui) .plot-mark-top{max-width:70%;font-size:9px;top:8px;left:8px}
 :where(body.graph-phone-ui) .plot-mark-bottom{bottom:88px;left:10px;font-size:10px}
 :where(body.graph-phone-ui) .mobile-plot-controls{display:grid;gap:3px;position:absolute;z-index:6;bottom:10px;left:10px;max-width:calc(100% - 76px);pointer-events:auto}
 :where(body.graph-phone-ui) .mobile-plot-controls button{min-height:44px;max-width:100%;padding:7px 10px;border:1px solid #bc8bd7;border-radius:10px;background:#fff;color:#642a92;font-size:12px;font-weight:750;white-space:normal;touch-action:manipulation}
 :where(body.graph-phone-ui) .mobile-plot-controls button[aria-pressed=true]{background:#7433aa;color:#fff}
 :where(body.graph-phone-ui) .mobile-plot-controls small{max-width:230px;background:#fffffff0;border-radius:5px;padding:3px 5px;font-size:10px;line-height:1.3;pointer-events:none}
 :where(body.graph-phone-ui) .editor-panel,:where(body.graph-phone-ui).graph-lesson-active .editor-panel.lesson-view{
  display:flex;height:auto;min-height:0;max-height:none;overflow:visible!important;
  border-left:0;border-top:1px solid #e4eaf1;padding:12px;overscroll-behavior:auto;
 }
 :where(body.graph-phone-ui) .editor-panel .graph-list{display:flex;flex-direction:column;height:auto;min-height:0;max-height:none;overflow:visible;overscroll-behavior:auto}
 :where(body.graph-phone-ui) .entry-math-viewport{touch-action:auto;overscroll-behavior:auto}
 :where(body.graph-phone-ui) .graph-entry{min-height:58px}
 :where(body.graph-phone-ui) .entry-delete,:where(body.graph-phone-ui) .visibility,:where(body.graph-phone-ui) .mini-add,:where(body.graph-phone-ui) .keyboard-button,:where(body.graph-phone-ui) .key,:where(body.graph-phone-ui) .param-play{min-height:44px;min-width:44px}
 :where(body.graph-phone-ui) .key-grid{grid-template-columns:repeat(auto-fit,minmax(44px,1fr));gap:5px}
 :where(body.graph-phone-ui).graph-lesson-active .editor-panel.lesson-view #lessonPanel,:where(body.graph-phone-ui).graph-lesson-active .editor-panel.lesson-view .lesson-body{display:flex;height:auto;min-height:0;overflow:visible;flex:none;gap:7px}
 :where(body.graph-phone-ui).graph-lesson-active .lesson-function{padding:7px 9px}
 :where(body.graph-phone-ui).graph-lesson-active .lesson-formula{font-size:16px}
 :where(body.graph-phone-ui).graph-lesson-active .editor-panel.lesson-view .lesson-paper{
  flex:none;height:auto;min-height:90px;max-height:42vh;max-height:42svh;
  overflow:auto;overscroll-behavior:auto;touch-action:auto;-webkit-overflow-scrolling:touch;
 }
 :where(body.graph-phone-ui) .lesson-toggle,:where(body.graph-phone-ui) .editor-panel.lesson-view .lesson-toggle,:where(body.graph-phone-ui) .lesson-controls button,:where(body.graph-phone-ui) .editor-panel.lesson-view .lesson-controls button,:where(body.graph-phone-ui) .lesson-speed select,:where(body.graph-phone-ui) .editor-panel.lesson-view .lesson-speed select{min-height:44px}
 :where(body.graph-phone-ui) .app-shell.focus-view .plot-area{height:clamp(230px,68vh,620px)!important;height:clamp(230px,68svh,620px)!important;min-height:0}
 :where(body.graph-phone-ui) .graph-mobile-nav{
  position:fixed;z-index:30;bottom:0;left:0;right:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;
  border-top:1px solid #dac7e7;background:#fffcfff5;box-shadow:0 -3px 14px #44215f12;
  padding:6px max(8px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
 }
 :where(body.graph-phone-ui) .graph-mobile-nav button{min-width:0;min-height:44px;padding:7px 3px;border:1px solid #e0cce9;border-radius:10px;background:#fff;color:#642a92;font-size:12px;font-weight:750;touch-action:manipulation}
 :where(body.graph-phone-ui) .sidebar,:where(body.graph-phone-ui) .plot-area,:where(body.graph-phone-ui) .editor-panel{scroll-margin-top:8px;scroll-margin-bottom:80px}
}
@media screen and (min-width:600px) and (max-width:1050px) and (orientation:landscape) and (max-height:600px),
 screen and (min-width:600px) and (max-width:1400px) and (pointer:coarse) and (orientation:landscape) and (max-height:600px){
 :where(body.graph-phone-ui).graph-lesson-active .stage{grid-template-columns:minmax(0,1fr) minmax(260px,44%);grid-template-rows:auto}
 :where(body.graph-phone-ui).graph-lesson-active .plot-area{height:clamp(230px,70vh,440px)!important;height:clamp(230px,70svh,440px)!important}
 :where(body.graph-phone-ui).graph-lesson-active .editor-panel.lesson-view{border-top:0;border-left:1px solid #e4eaf1;padding:8px}
 :where(body.graph-phone-ui).graph-lesson-active .plot-mark-top{display:none}
}
@media screen and (max-width:1050px) and (max-height:450px),
 screen and (pointer:coarse) and (max-width:1400px) and (max-height:450px){
 :where(body.graph-phone-ui) .plot-area,:where(body.graph-phone-ui).graph-lesson-active .plot-area,:where(body.graph-phone-ui) .app-shell.focus-view .plot-area{
  height:clamp(170px,54vh,260px)!important;height:clamp(170px,54svh,260px)!important;
 }
}
@media(prefers-reduced-motion:reduce){:where(body.graph-phone-ui) .lesson-record{animation:none!important}:where(body.graph-phone-ui) .lesson-paper{scroll-behavior:auto}}


/* Step53 adds no portrait overrides. Panel switches only appear in landscape. */
.graph-landscape-controls{display:none}
@media screen and (orientation:landscape) and (max-width:1400px){
 body:where(.graph-phone-ui).graph-landscape-layout{--landscape-bottom-space:70px;--landscape-top-space:116px}
 body:where(.graph-phone-ui).graph-landscape-layout .app-shell,body:where(.graph-phone-ui).graph-landscape-layout .app-shell.focus-view{
  display:grid;grid-template-columns:calc(clamp(154px,25vw,240px) + env(safe-area-inset-left)) minmax(0,1fr);
  align-items:start;gap:0;min-height:100vh;min-height:100svh;height:auto;overflow:visible;
 }
 body:where(.graph-phone-ui).graph-landscape-layout .app-shell>.sidebar,body:where(.graph-phone-ui).graph-landscape-layout .app-shell.focus-view>.sidebar{
  display:flex!important;flex-direction:column;position:sticky;top:0;
  width:auto;min-width:0;height:100vh;height:100dvh;min-height:0;max-height:none;
  overflow-x:hidden;overflow-y:auto;overscroll-behavior:auto;touch-action:auto;
  border-bottom:0;border-right:2px solid var(--orange);padding-right:0;padding-bottom:calc(var(--landscape-bottom-space) + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling:touch;
 }
 body:where(.graph-phone-ui).graph-landscape-layout .sidebar .brand{padding:8px;gap:6px;flex-wrap:nowrap;flex:0 0 auto}
 body:where(.graph-phone-ui).graph-landscape-layout .sidebar .brand-logo{flex-basis:26px;height:26px;border-radius:7px}
 body:where(.graph-phone-ui).graph-landscape-layout .sidebar .brand-logo svg{width:24px;height:24px}
 body:where(.graph-phone-ui).graph-landscape-layout .sidebar .brand-copy{min-width:0;flex:1 1 0}
 body:where(.graph-phone-ui).graph-landscape-layout .sidebar .brand-title{font-size:16px;line-height:1.1}
 body:where(.graph-phone-ui).graph-landscape-layout .sidebar .brand-sub{display:none}
 body:where(.graph-phone-ui).graph-landscape-layout .sidebar .graph-back-link{font-size:9px}
 body:where(.graph-phone-ui).graph-landscape-layout .sidebar #toggleMobileCatalog{display:none}
 body:where(.graph-phone-ui).graph-landscape-layout .sidebar .aside-scroll{flex:0 0 auto;min-height:0;overflow:visible;padding:0 8px 10px}
 body:where(.graph-phone-ui).graph-landscape-layout .sidebar:not(.catalog-open) .aside-scroll>.aside-section:not(:first-child){display:block!important}
 body:where(.graph-phone-ui).graph-landscape-layout .sidebar .aside-scroll>.aside-section{padding:8px 0}
 body:where(.graph-phone-ui).graph-landscape-layout .sidebar .coord-switch button{font-size:10px;white-space:normal;overflow-wrap:anywhere;padding:6px 2px}
 body:where(.graph-phone-ui).graph-landscape-layout .sidebar .catalog-section #presetList{height:auto;min-height:0;max-height:none;overflow:visible;overscroll-behavior:auto}
 body:where(.graph-phone-ui).graph-landscape-layout .sidebar .catalog-section #presetList .preset-card{grid-template-columns:28px minmax(0,1fr) 12px;gap:4px;padding:4px}
 body:where(.graph-phone-ui).graph-landscape-layout .sidebar .preset-icon{width:28px;height:28px}
 body:where(.graph-phone-ui).graph-landscape-layout .sidebar .preset-icon svg{width:25px;height:25px}
 body:where(.graph-phone-ui).graph-landscape-layout .sidebar .preset-name{font-size:11px}
 body:where(.graph-phone-ui).graph-landscape-layout .sidebar .preset-formula{font-size:9px}
 body:where(.graph-phone-ui).graph-landscape-layout .workspace,body:where(.graph-phone-ui).graph-landscape-layout.graph-lesson-active .workspace{min-width:0;padding:4px max(4px,env(safe-area-inset-right)) 4px 4px}
 body:where(.graph-phone-ui).graph-landscape-layout .work-card,body:where(.graph-phone-ui).graph-landscape-layout.graph-lesson-active .work-card{min-width:0;overflow:visible}
 body:where(.graph-phone-ui).graph-landscape-layout .graph-landscape-controls{
  display:flex;position:sticky;top:max(0px,env(safe-area-inset-top));z-index:12;
  flex:0 0 auto;gap:6px;min-width:0;padding:4px;background:#fffafefa;
  border-bottom:1px solid #e6d6ee;border-radius:10px 10px 0 0;
 }
 body:where(.graph-phone-ui).graph-landscape-layout .graph-landscape-controls button{
  flex:1 1 0;min-width:0;min-height:44px;border:1px solid #d5b9e5;border-radius:9px;
  background:#fff;color:#642a92;font-size:11px;font-weight:750;line-height:1.2;
  white-space:normal;overflow-wrap:anywhere;padding:6px;touch-action:manipulation;
 }
 body:where(.graph-phone-ui).graph-landscape-layout .graph-landscape-controls button[aria-pressed=true]{background:#f0e3fb;border-color:#ae79d0}
 body:where(.graph-phone-ui).graph-landscape-layout .work-head,body:where(.graph-phone-ui).graph-landscape-layout.graph-lesson-active .work-head{padding:4px;flex-wrap:nowrap}
 body:where(.graph-phone-ui).graph-landscape-layout .work-head .work-status,body:where(.graph-phone-ui).graph-landscape-layout .work-head #focusView{display:none}
 body:where(.graph-phone-ui).graph-landscape-layout .work-head-right{flex:1 1 0;flex-wrap:nowrap;max-width:100%;overflow-x:auto;overscroll-behavior:auto;touch-action:auto}
 body:where(.graph-phone-ui).graph-landscape-layout .work-head-right .head-action{flex:0 0 auto}
 body:where(.graph-phone-ui).graph-landscape-layout .stage,body:where(.graph-phone-ui).graph-landscape-layout.graph-lesson-active .stage{grid-template-columns:minmax(0,1fr);grid-template-rows:auto;align-items:start}
 body:where(.graph-phone-ui).graph-landscape-layout .plot-area,body:where(.graph-phone-ui).graph-landscape-layout.graph-lesson-active .plot-area,body:where(.graph-phone-ui).graph-landscape-layout .app-shell.focus-view .plot-area{
  height:max(170px,calc(100vh - var(--landscape-top-space) - var(--landscape-bottom-space) - env(safe-area-inset-top) - env(safe-area-inset-bottom)))!important;
  height:max(170px,calc(100svh - var(--landscape-top-space) - var(--landscape-bottom-space) - env(safe-area-inset-top) - env(safe-area-inset-bottom)))!important;
 }
 body:where(.graph-phone-ui).graph-landscape-layout .editor-panel,body:where(.graph-phone-ui).graph-landscape-layout .app-shell.focus-view .editor-panel,body:where(.graph-phone-ui).graph-landscape-layout.graph-lesson-active .editor-panel.lesson-view{
  display:flex!important;min-width:0;height:auto;max-height:none;overflow:visible!important;border-left:0;border-top:1px solid #e4eaf1;
 }
 body:where(.graph-phone-ui).graph-landscape-layout.graph-landscape-left-hidden .app-shell{grid-template-columns:minmax(0,1fr)}
 body:where(.graph-phone-ui).graph-landscape-layout.graph-landscape-left-hidden .app-shell>.sidebar,body:where(.graph-phone-ui).graph-landscape-layout.graph-landscape-left-hidden .app-shell.focus-view>.sidebar{display:none!important}
 body:where(.graph-phone-ui).graph-landscape-layout.graph-landscape-left-hidden .workspace{padding-left:max(4px,env(safe-area-inset-left))}
 body:where(.graph-phone-ui).graph-landscape-layout.graph-landscape-bottom-hidden{--landscape-bottom-space:0px;padding-bottom:env(safe-area-inset-bottom)}
 body:where(.graph-phone-ui).graph-landscape-layout.graph-landscape-bottom-hidden .editor-panel,body:where(.graph-phone-ui).graph-landscape-layout.graph-landscape-bottom-hidden.graph-lesson-active .editor-panel.lesson-view,body:where(.graph-phone-ui).graph-landscape-layout.graph-landscape-bottom-hidden .app-shell.focus-view .editor-panel,body:where(.graph-phone-ui).graph-landscape-layout.graph-landscape-bottom-hidden .graph-mobile-nav{display:none!important}
}


/* Step54 compact phone landscape: a single icon toolbar and a clear canvas. */
@media screen and (orientation:landscape) and (max-width:1400px){
 body.graph-phone-ui.graph-landscape-layout{--landscape-bottom-space:0px;--landscape-top-space:48px;padding-bottom:env(safe-area-inset-bottom)}
 body.graph-phone-ui.graph-landscape-layout .app-shell{grid-template-columns:calc(clamp(132px,21vw,190px) + env(safe-area-inset-left)) minmax(0,1fr)}
 body.graph-phone-ui.graph-landscape-layout.graph-landscape-left-hidden .app-shell{grid-template-columns:minmax(0,1fr)}
 body.graph-phone-ui.graph-landscape-layout .graph-mobile-nav{display:none!important}
 body.graph-phone-ui.graph-landscape-layout .work-card,
 body.graph-phone-ui.graph-landscape-layout.graph-lesson-active .work-card{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto auto;gap:0}
 body.graph-phone-ui.graph-landscape-layout .graph-landscape-controls{position:static;grid-column:1;grid-row:1;width:auto;gap:2px;padding:2px;border:0;border-radius:8px 0 0 0;align-items:center}
 body.graph-phone-ui.graph-landscape-layout .work-head,
 body.graph-phone-ui.graph-landscape-layout.graph-lesson-active .work-head{grid-column:2;grid-row:1;min-width:0;min-height:0;padding:2px;border-radius:0 8px 0 0}
 body.graph-phone-ui.graph-landscape-layout .work-head-right{justify-content:flex-end;gap:2px;min-width:0;overflow-x:auto}
 body.graph-phone-ui.graph-landscape-layout .stage,
 body.graph-phone-ui.graph-landscape-layout.graph-lesson-active .stage{grid-column:1/-1;grid-row:2}
 body.graph-phone-ui.graph-landscape-layout .graph-landscape-controls button,
 body.graph-phone-ui.graph-landscape-layout .work-head .head-action{
  flex:0 0 34px;width:34px;height:34px;min-width:34px;min-height:34px;padding:0;border-radius:7px;
  font-size:0;line-height:1;overflow:hidden;box-shadow:none;
 }
 body.graph-phone-ui.graph-landscape-layout button[data-compact-icon]::before{content:attr(data-compact-icon);display:inline-block;font:19px/1 system-ui,sans-serif}
 body.graph-phone-ui.graph-landscape-layout .work-head .head-action>*{display:none}
 body.graph-phone-ui.graph-landscape-layout .plot-area,
 body.graph-phone-ui.graph-landscape-layout.graph-lesson-active .plot-area,
 body.graph-phone-ui.graph-landscape-layout .app-shell.focus-view .plot-area{
  height:max(150px,calc(100vh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom)))!important;
  height:max(150px,calc(100svh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom)))!important;
 }
 body.graph-phone-ui.graph-landscape-layout .plot-mark,
 body.graph-phone-ui.graph-landscape-layout .plot-corner,
 body.graph-phone-ui.graph-landscape-layout .mobile-plot-controls small{display:none!important}
 body.graph-phone-ui.graph-landscape-layout .mobile-plot-controls{left:8px;bottom:8px;max-width:none;gap:0}
 body.graph-phone-ui.graph-landscape-layout #touchPlotToggle{width:34px;height:34px;min-width:34px;min-height:34px;padding:0;font-size:0;line-height:1;border-radius:7px}
 body.graph-phone-ui.graph-landscape-layout #touchPlotToggle[aria-pressed=true]::before{content:'↕'}
 body.graph-phone-ui.graph-landscape-layout .plot-tools{right:8px;bottom:8px;gap:3px}
 body.graph-phone-ui.graph-landscape-layout .plot-tool{width:32px;height:32px;min-width:32px;min-height:32px;font-size:18px;border-radius:7px}
 body.graph-phone-ui.graph-landscape-layout .sidebar .brand{padding:4px 6px;min-height:32px}
 body.graph-phone-ui.graph-landscape-layout .sidebar .brand-logo,
 body.graph-phone-ui.graph-landscape-layout .sidebar .brand-title,
 body.graph-phone-ui.graph-landscape-layout .sidebar .brand-sub,
 body.graph-phone-ui.graph-landscape-layout .sidebar .section-heading,
 body.graph-phone-ui.graph-landscape-layout .sidebar .coord-head,
 body.graph-phone-ui.graph-landscape-layout .sidebar .small-hint,
 body.graph-phone-ui.graph-landscape-layout .sidebar .coordinate-help{display:none}
 body.graph-phone-ui.graph-landscape-layout .sidebar .graph-back-link{display:inline-flex!important;align-items:center;justify-content:center;font-size:0;min-width:28px;height:28px;margin:0}
 body.graph-phone-ui.graph-landscape-layout .sidebar .graph-back-link::before{content:'←';font-size:19px}
 body.graph-phone-ui.graph-landscape-layout .sidebar .aside-scroll>.aside-section{padding:5px 0}
 body.graph-phone-ui.graph-landscape-layout .sidebar .segmented button,
 body.graph-phone-ui.graph-landscape-layout .sidebar .coord-switch button{min-height:32px;padding:4px 2px;font-size:11px}
 body.graph-phone-ui.graph-landscape-layout .sidebar .catalog-section #presetList{grid-auto-rows:36px;gap:2px}
 body.graph-phone-ui.graph-landscape-layout .sidebar .catalog-section #presetList .preset-card{height:36px;min-height:36px;grid-template-columns:minmax(0,1fr);gap:0;padding:3px 5px}
 body.graph-phone-ui.graph-landscape-layout .sidebar .preset-icon,
 body.graph-phone-ui.graph-landscape-layout .sidebar .preset-plus{display:none}
 body.graph-phone-ui.graph-landscape-layout .sidebar .search-wrap{min-height:32px;padding:4px 6px;margin-bottom:4px}
}

/* Step58: all new layout rules require an actual phone in portrait orientation. */
.graph-portrait-controls[hidden]{display:none!important}
html.graph-phone-ui.graph-portrait-layout{height:100%;overflow:hidden;scroll-padding:0}
body.graph-phone-ui.graph-portrait-layout,body.graph-phone-ui.graph-portrait-layout.graph-lesson-active{height:100dvh;min-height:0;overflow:hidden;padding:0;touch-action:auto}
body.graph-phone-ui.graph-portrait-layout .app-shell,body.graph-phone-ui.graph-portrait-layout .app-shell.focus-view{display:flex;flex-direction:column;height:var(--graph-portrait-height,100dvh);min-height:0;max-height:var(--graph-portrait-height,100dvh);overflow:hidden;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
body.graph-phone-ui.graph-portrait-layout .workspace,body.graph-phone-ui.graph-portrait-layout.graph-lesson-active .workspace{flex:0 0 50%;height:50%;width:100%;min-width:0;min-height:0;max-height:50%;padding:4px;overflow:hidden}
body.graph-phone-ui.graph-portrait-layout.graph-portrait-menu-hidden .workspace{flex-basis:100%;height:100%;max-height:100%}
body.graph-phone-ui.graph-portrait-layout .workspace>.topbar,body.graph-phone-ui.graph-portrait-layout .graph-mobile-nav,body.graph-phone-ui.graph-portrait-layout .graph-landscape-controls{display:none!important}
body.graph-phone-ui.graph-portrait-layout .work-card{display:flex;flex-direction:column;min-width:0;min-height:0;height:100%;max-height:100%;border-radius:12px;overflow:hidden}
body.graph-phone-ui.graph-portrait-layout .work-head{flex:0 0 auto;padding:3px 4px;min-height:44px}
body.graph-phone-ui.graph-portrait-layout .work-status,body.graph-phone-ui.graph-portrait-layout .graph-count,body.graph-phone-ui.graph-portrait-layout .splitter{display:none}
body.graph-phone-ui.graph-portrait-layout .work-head-right{display:flex;align-items:center;gap:3px;flex-wrap:wrap;width:100%}
body.graph-phone-ui.graph-portrait-layout .work-head-right [data-compact-icon]{display:inline-flex;align-items:center;justify-content:center;flex:none;width:44px;min-width:44px;height:44px;padding:0;font-size:0;line-height:1}
body.graph-phone-ui.graph-portrait-layout .work-head-right [data-compact-icon]::before{content:attr(data-compact-icon);font-size:18px}
body.graph-phone-ui.graph-portrait-layout .work-head-right [data-compact-icon] span{display:none}
body.graph-phone-ui.graph-portrait-layout #focusView{min-height:44px;padding:5px 6px;font-size:11px}
body.graph-phone-ui.graph-portrait-layout #focusViewLabel{font-size:11px}
body.graph-phone-ui.graph-portrait-layout .stage,body.graph-phone-ui.graph-portrait-layout.graph-lesson-active .stage{display:block;flex:1;min-height:0;height:0;overflow:hidden}
body.graph-phone-ui.graph-portrait-layout .plot-area,body.graph-phone-ui.graph-portrait-layout.graph-lesson-active .plot-area,body.graph-phone-ui.graph-portrait-layout .app-shell.focus-view .plot-area{height:100%!important;min-height:0!important;max-height:none;touch-action:pan-y pinch-zoom}
body.graph-phone-ui.graph-portrait-layout .plot-area.plot-touch-active{touch-action:none}
body.graph-phone-ui.graph-portrait-layout .plot-mark-top,body.graph-phone-ui.graph-portrait-layout .plot-corner{display:none}
body.graph-phone-ui.graph-portrait-layout .mobile-plot-controls small{display:none}
body.graph-phone-ui.graph-portrait-layout .plot-mark-bottom{bottom:62px}
body.graph-phone-ui.graph-portrait-layout .graph-portrait-controls{display:block;flex:1 1 50%;min-height:0;width:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y pinch-zoom;-webkit-overflow-scrolling:touch;padding-bottom:8px;background:#fff}
body.graph-phone-ui.graph-portrait-layout .graph-portrait-controls .editor-panel,body.graph-phone-ui.graph-portrait-layout.graph-lesson-active .graph-portrait-controls .editor-panel.lesson-view{display:flex!important;flex-direction:column;width:100%;height:auto;max-height:none;min-height:0;overflow:visible!important;touch-action:auto;border-left:0;border-top:1px solid #e4eaf1;padding:10px}
body.graph-phone-ui.graph-portrait-layout #graphEditor .portrait-formula-heading{display:flex!important;order:-7}
body.graph-phone-ui.graph-portrait-layout #graphEditor .formula-editor{display:block!important;order:-6}
body.graph-phone-ui.graph-portrait-layout #graphEditor .catalog-section{display:block!important;order:-5;padding:12px 0;border-block:1px solid #ece6f1;margin:12px 0}
body.graph-phone-ui.graph-portrait-layout #graphEditor .editor-top,body.graph-phone-ui.graph-portrait-layout #graphEditor .graph-list{display:flex!important}
body.graph-phone-ui.graph-portrait-layout .graph-list{height:auto;min-height:0;max-height:none;overflow:visible!important}
body.graph-phone-ui.graph-portrait-layout .catalog-section #presetList{display:grid;grid-template-columns:minmax(0,1fr);height:auto!important;min-height:0;max-height:none!important;overflow:visible!important;touch-action:auto;gap:4px}
body.graph-phone-ui.graph-portrait-layout .catalog-section .preset-card{min-height:44px;touch-action:auto}
body.graph-phone-ui.graph-portrait-layout .graph-portrait-controls .sidebar{display:flex!important;position:static;width:100%;height:auto;min-height:0;max-height:none;overflow:visible;border:0;padding:0;box-shadow:none}
body.graph-phone-ui.graph-portrait-layout .sidebar .aside-scroll{display:block;height:auto;max-height:none;min-height:0;overflow:visible;flex:none;touch-action:auto}
body.graph-phone-ui.graph-portrait-layout .sidebar .aside-scroll>.aside-section{display:block!important}
body.graph-phone-ui.graph-portrait-layout .sidebar .brand-logo,body.graph-phone-ui.graph-portrait-layout .sidebar .brand-title,body.graph-phone-ui.graph-portrait-layout .sidebar .brand-sub,body.graph-phone-ui.graph-portrait-layout #toggleMobileCatalog{display:none}

/* Step60: keyboard groups and optional derivative comparison only. */
.keyboard-tabs{display:flex;flex-wrap:wrap;gap:5px;margin:0 0 9px}
.keyboard-tabs button{min-height:36px;padding:6px 9px;border:1px solid #e4d3ed;border-radius:8px;background:#fff;color:#6b4283;font:700 11px/1.3 Arial,sans-serif;cursor:pointer}
.keyboard-tabs button.active{color:#fff;background:#7a2dbb;border-color:#7a2dbb}
.keyboard-tabs button:focus-visible,.math-keyboard .key:focus-visible{outline:2px solid #7a2dbb;outline-offset:2px}
.keyboard-help{min-height:3.5em;margin:9px 0 0;color:#685272;font:12px/1.5 Arial,sans-serif;overflow-wrap:anywhere}
.derivative-panel{display:grid;gap:8px;margin:12px 0;padding:12px;border:1px solid #e5d4ee;border-radius:12px;background:#fcf8ff}
.derivative-panel>label:first-child{font-size:12px;font-weight:800;color:#5f327a}
.derivative-panel select{width:100%;min-width:0;min-height:40px;padding:7px;border:1px solid #d9c4e5;border-radius:8px;color:#4c2f60;background:#fff;font:12px/1.4 Arial,sans-serif}
.derivative-guides{display:flex;align-items:center;gap:7px;color:#6b5578;font-size:11px;line-height:1.5}
.derivative-guides input{flex:none;accent-color:#7a2dbb}
.derivative-panel p{margin:0;color:#80658c;font-size:11px;line-height:1.5}
.derivative-legend{position:absolute;left:12px;top:40px;z-index:3;display:flex;gap:12px;padding:5px 9px;border:1px solid #e7ddeb;border-radius:8px;background:#ffffffed;font:700 12px/1.3 Arial,sans-serif;pointer-events:none}
.derivative-legend[hidden]{display:none!important}
body.graph-phone-ui .keyboard-tabs button{min-height:44px}
body.graph-phone-ui .derivative-panel select{min-height:44px;font-size:16px}
body.graph-phone-ui .derivative-guides{min-height:44px;font-size:12px}
body.graph-phone-ui.graph-portrait-layout #graphEditor .derivative-panel{order:-4}
body.graph-phone-ui.graph-landscape-layout .derivative-legend{top:6px;left:54px;font-size:10px;gap:7px;padding:4px 6px}
@media print{.derivative-panel,.math-keyboard,.derivative-legend{display:none!important}}

/* Step62: one derivative checkbox row until the user enables comparison. */
#derivativePanel{display:block;margin:6px 0;padding:0;border:0;border-radius:0;background:transparent}
#derivativePanel .derivative-enable{display:flex;align-items:center;gap:7px;min-height:27px;margin:0;font:700 12px/1.4 Arial,sans-serif;color:#68447e;cursor:pointer}
#derivativePanel input[type=checkbox]{width:16px;height:16px;margin:0;accent-color:#7a2dbb;flex:none}
#derivativeOptions{display:flex;align-items:center;gap:8px;margin-top:3px}
#derivativeOptions[hidden]{display:none!important}
#derivativePanel select{flex:1;min-width:0;width:auto;min-height:30px;padding:4px 6px;font-size:11px}
#derivativePanel .derivative-guides{min-height:30px;font-size:11px;gap:4px;white-space:nowrap;cursor:pointer}
body.graph-phone-ui #derivativePanel .derivative-enable{min-height:36px}
body.graph-phone-ui #derivativePanel select{min-height:36px;font-size:16px}
body.graph-phone-ui #derivativePanel .derivative-guides{min-height:36px}

/* v125: derivative controls are part of the selected function card. */
.graph-entry #derivativePanel{grid-column:1/-1;width:100%;margin:3px 0 0;padding:2px 4px 1px 27px;min-width:0}
.graph-entry #derivativePanel[hidden]{display:none!important}
.graph-entry #derivativePanel .derivative-enable{min-height:24px;font-size:11px;gap:5px}
.graph-entry #derivativeOptions{padding-left:0;flex-wrap:wrap}
.graph-entry #derivativeOptions select{max-width:100%;font-size:11px}
#graphEditor #lessonPanel{margin-top:8px}
@media(pointer:coarse){.graph-entry #derivativePanel .derivative-enable{min-height:34px}}
.graph-mode-links{margin:22px auto;display:flex;gap:10px 18px;flex-wrap:wrap;max-width:1100px;font-size:14px}

body.graph-phone-ui.graph-portrait-layout #graphEditor .graph-entry #derivativePanel{order:0}
body[data-graph-entry] .brand-title{font-size:22px;line-height:1.14}
