*{box-sizing:border-box}html,body{margin:0;height:100%;min-height:460px;background:#f7f9fc;color:#19334f;font-family:"Microsoft YaHei","PingFang SC",Arial,sans-serif}button,input,select{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #4485d0;outline-offset:2px}[hidden]{display:none!important}.shell{display:flex;flex-direction:column;height:100dvh;min-height:480px}.header{height:68px;flex-shrink:0;display:flex;align-items:center;justify-content:space-between;background:#fff;border-bottom:1px solid #e4eaf1;padding:0 25px;gap:16px;box-shadow:0 1px 7px #17365408;z-index:10}.brand{display:flex;gap:11px;align-items:center;min-width:190px}.brand-symbol{height:39px;width:39px;background:#193d62;color:white;border-radius:12px;display:grid;place-items:center;font-size:23px;font-weight:800;font-family:Georgia,serif}.brand strong{display:block;font-size:15px;letter-spacing:.04em}.brand small{display:block;color:#8a99ab;font-size:10px;margin-top:3px}.version{color:#397db6;margin-left:5px}.header-subtitle{color:#8194a8;font-size:12px;letter-spacing:.02em}.header-actions{display:flex;align-items:center;gap:11px;white-space:nowrap}.saved-label{color:#96a6b4;font-size:11px}.soft-button,.primary-light{border-radius:9px;padding:9px 12px;background:#fff;color:#546c84;border:1px solid #dce5ee;font-size:12px;font-weight:600}.soft-button:hover,.primary-light:hover{background:#f4f8fb}.primary-light{background:#183c62;border-color:#183c62;color:white}.primary-light:hover{background:#255477;color:white}.workspace{flex:1;min-height:0;display:flex}.editor-panel{width:358px;max-width:47vw;flex:0 0 358px;overflow-y:auto;background:#fff;border-right:1px solid #e1e9f0;scrollbar-width:thin;display:flex;flex-direction:column;padding-bottom:18px;z-index:3}.editor-head{padding:23px 21px 20px;display:flex;align-items:flex-start;justify-content:space-between;gap:8px}.editor-head h1{font-size:20px;line-height:1;margin:0;color:#193a5c}.editor-head p{font-size:11px;color:#8293a4;line-height:1.65;margin:9px 0 0}.count-pill{border-radius:40px;padding:6px 10px;background:#eaf2fb;color:#3474a8;font-size:10px;white-space:nowrap}.add-section{padding:0 21px 21px;border-bottom:1px solid #ecf0f5}.section-row,.group-title{display:flex;align-items:center;justify-content:space-between;gap:9px}.section-row strong,.group-title span:first-child{font-size:12px;color:#304d6a}.section-row span,.group-title span:last-child{font-size:10px;color:#97a6b4}.preset-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:11px}.preset-grid button{min-height:37px;padding:7px 4px;border-radius:8px;border:1px solid #dce7f1;background:#f8fafc;color:#456580;font-size:11px}.preset-grid button:hover{border-color:#7db3db;background:#eff7ff;color:#1d5d90}.add-custom{width:100%;height:38px;margin-top:9px;border-radius:9px;border:1px dashed #9cbad5;background:#f4f9fc;color:#245c89;text-align:center;font-size:12px;font-weight:700}.add-custom span{font-size:17px;margin-right:5px}.group-title{padding:17px 21px 9px}.curve-list{padding:0 14px;display:flex;flex-direction:column;gap:10px}.curve-card{border:1px solid #dfe7ef;background:#fff;border-radius:13px;box-shadow:0 2px 9px #142e4410;overflow:hidden}.curve-card.selected{border-color:#a8c8e4;box-shadow:0 3px 14px #356da419}.curve-top{display:flex;align-items:center;gap:9px;padding:13px 12px 8px}.curve-dot{width:12px;height:12px;display:block;flex-shrink:0;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px #cedce8}.curve-title{font-size:12px;font-weight:800;color:#304c65;min-width:0;flex:1}.curve-action{height:28px;min-width:28px;padding:0 6px;background:#fff;color:#8194a7;border:1px solid #e5ebf1;border-radius:7px;font-size:13px}.curve-action:hover{color:#215d91;background:#f4f8fc}.curve-action.delete:hover{color:#b34c4c}.curve-action.muted{opacity:.4}.curve-field{display:flex;align-items:center;gap:8px;margin:2px 12px 8px}.curve-field label{font-size:12px;font-weight:700;color:#628099;white-space:nowrap}.curve-field input{min-width:0;flex:1;height:39px;padding:8px 10px;border-radius:8px;border:1px solid #dce6f0;background:#f8fbfe;color:#173b5f;font-size:16px;font-family:"Cambria Math","Times New Roman",monospace}.curve-field input:focus{background:white}.curve-error{color:#c14d4d;font-size:10px;margin:0 12px 8px;line-height:1.5}.curve-edit{padding:2px 12px 12px}.curve-params{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:5px 0 10px}.curve-params label{font-size:11px;color:#718498;display:grid;gap:5px}.curve-params input{width:100%;height:33px;border-radius:7px;border:1px solid #dce6ed;background:#fff;padding:5px 7px;color:#263f57;font-variant-numeric:tabular-nums;font-size:12px}.curve-range-panel{padding:9px 10px;background:#f6f9fc;border-radius:9px;border:1px solid #e8eef4}.curve-range-panel .curve-check{display:flex;align-items:center;gap:7px;font-size:11px;color:#557189;font-weight:650}.curve-interval-fields{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:9px}.curve-interval-fields label{font-size:10px;color:#73879a;display:grid;gap:4px}.curve-interval-fields input{min-width:0;width:100%;height:32px;border:1px solid #d6e2ec;border-radius:7px;background:white;padding:4px 7px}.curve-features{padding:9px 0 0;display:flex;gap:5px;flex-wrap:wrap}.feature-pill{padding:5px 7px;font-size:10px;background:#f4f7fa;color:#567086;border-radius:6px}.feature-pill strong{color:#254863}.curve-help{line-height:1.55;font-size:10px;color:#93a1ae;margin:8px 0 0}.curve-card:not(.selected) .curve-edit{display:none}.import-area{padding:16px 20px;margin-top:2px}.import-toggle{border:1px solid #dde8f1;border-radius:9px;background:#f8fbfe;color:#356583;width:100%;display:flex;align-items:center;justify-content:space-between;text-align:left;padding:11px 12px;font-size:11px;font-weight:700}#import-content{padding:10px 0}#question-search{height:34px;border:1px solid #dae5f0;border-radius:8px;padding:6px 9px;width:100%;font-size:11px}.question-list{max-height:240px;overflow:auto;margin-top:7px}.question-item{display:block;text-align:left;width:100%;padding:9px;border-radius:7px;border:0;background:white;color:#506b84;font-size:11px;line-height:1.6}.question-item:hover{background:#eef6fd}.question-item b{color:#256899}.sidebar-hint{font-size:10px;line-height:1.8;color:#93a3b4;margin:auto 22px 0;padding:17px 0 0}.sidebar-hint code{color:#557da5}.graph-area{min-width:0;min-height:0;flex:1;display:flex;flex-direction:column;position:relative;background:#f8fafc}.graph-toolbar{min-height:64px;flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fff;border-bottom:1px solid #e4eaf0;padding:0 20px}.view-menu{display:flex;align-items:center;gap:15px}.tool-title{font-size:14px;font-weight:800;color:#254563;white-space:nowrap}#view-status{font-size:10px;color:#9aabba}.graph-actions{display:flex;gap:7px;align-items:center}.graph-actions button{height:34px;min-width:35px;padding:0 11px;background:#fff;color:#496782;border:1px solid #dde7ef;border-radius:8px;font-weight:650;font-size:11px;white-space:nowrap}.graph-actions button:hover{background:#edf5fa}.graph-actions .toolbar-strong{background:#eef5fb;color:#276392;border-color:#cee1ef}.plot-wrap{flex:1;position:relative;overflow:hidden;min-height:240px;background:#fff}.plot-wrap canvas{width:100%;height:100%;display:block;touch-action:none;cursor:grab}.plot-wrap canvas:active{cursor:grabbing}.plot-hint{position:absolute;left:20px;top:17px;color:#a6b5c4;font-size:11px;pointer-events:none}.plot-legend{position:absolute;left:20px;bottom:55px;display:flex;flex-wrap:wrap;gap:10px;pointer-events:none;max-width:calc(100% - 30px)}.legend-item{font-size:11px;display:flex;align-items:center;gap:6px;color:#52677b;background:#ffffffd9;border:1px solid #e7ecf2;padding:5px 8px;border-radius:7px}.legend-line{width:18px;border-top:3px solid var(--c)}.plot-bottom{position:absolute;bottom:10px;left:18px;right:18px;display:flex;align-items:center;gap:12px;color:#607d96;justify-content:flex-end;pointer-events:none}.cursor-coordinate{font-size:11px;margin-right:auto;font-variant-numeric:tabular-nums;color:#68839c;background:#ffffffce;border-radius:6px;padding:5px 9px}.toggle-chip{background:#ffffffdd;border:1px solid #e5ebf1;border-radius:7px;padding:5px 8px;font-size:10px;pointer-events:auto;white-space:nowrap}.toggle-chip input{accent-color:#2467a3;vertical-align:-2px}.statusline{height:39px;flex-shrink:0;border-top:1px solid #e9eef2;padding:12px 20px;color:#8aa0b2;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:#fcfdff}.bounds-panel{position:absolute;right:19px;top:76px;width:min(435px,calc(100% - 28px));z-index:20;background:#fff;border:1px solid #d7e4ef;border-radius:12px;padding:16px;box-shadow:0 18px 50px #112c4566}.bounds-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:13px}.bounds-title strong{font-size:13px}.bounds-title button{border:0;background:transparent;font-size:24px;color:#8596a5}.bounds-inputs{display:grid;grid-template-columns:1fr 1fr;gap:10px}.bounds-inputs label{display:grid;gap:5px;font-size:11px;color:#6f8396}.bounds-inputs input{min-width:0;height:36px;border:1px solid #d5e2ef;border-radius:7px;padding:7px 9px;color:#29455f}.bounds-footer{margin-top:13px;display:flex;align-items:center;justify-content:space-between}.bounds-footer label{font-size:11px;color:#687f93}.apply-button{border:0;background:#1b577e;color:#fff;border-radius:7px;padding:9px 13px;font-size:11px;font-weight:700}#bounds-error{margin:9px 0 0;color:#b4504b;font-size:11px}.point-tooltip{position:absolute;pointer-events:none;z-index:7;background:#173b5de9;color:white;border-radius:8px;padding:8px 11px;font-size:11px;white-space:nowrap;box-shadow:0 6px 15px #19334940}@media(min-width:1440px){.editor-panel{width:380px;flex-basis:380px}.graph-toolbar{min-height:69px}.curve-list{gap:12px}}@media(max-width:850px){.header{height:60px;padding:0 15px}.header-subtitle,.saved-label{display:none}.editor-panel{width:300px;flex-basis:300px}.editor-head{padding:19px 13px 16px}.add-section{padding:0 13px 15px}.curve-list{padding:0 9px}.group-title{padding-left:13px;padding-right:13px}.preset-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.graph-toolbar{padding:0 10px}.view-menu #view-status{display:none}}@media(max-width:650px){.header{height:57px;padding:0 12px}.brand{min-width:0}.brand strong{font-size:12px}.brand small{font-size:9px}.brand-symbol{height:34px;width:34px}.soft-button{display:none}.header-actions{gap:6px}.primary-light{font-size:10px;padding:8px}.workspace{position:relative}.editor-panel{position:absolute;left:0;top:0;bottom:0;width:min(87vw,340px);max-width:none;flex-basis:auto;z-index:9;box-shadow:8px 0 28px #243e5d26}.shell.panel-hidden .editor-panel{transform:translateX(-110%);pointer-events:none}.graph-area{width:100%}.graph-toolbar{min-height:58px;flex-wrap:wrap;padding:9px 10px;gap:4px}.tool-title{font-size:12px}.graph-actions{gap:4px}.graph-actions button{padding:0 7px;font-size:10px;min-width:28px;height:32px}.plot-hint{font-size:10px;left:10px;top:12px}.plot-legend{left:10px;bottom:51px;gap:4px}.legend-item{font-size:10px;padding:3px 5px}.statusline{font-size:10px;padding:12px}.toggle-chip{font-size:9px;padding:4px 6px}.plot-bottom{left:8px;right:8px;gap:4px}}
.shell.panel-hidden .editor-panel{display:none}

/* V0.6 compact in-workspace teaching drawer; no extra windows */
#study-compact-toggle{background:#e9f5ef;border-color:#b5dcc8;color:#216d55}
.study-drawer{position:absolute;right:14px;top:75px;bottom:50px;width:min(405px,calc(100% - 28px));z-index:18;border:1px solid #d2e2ed;border-radius:13px;background:#fff;box-shadow:0 15px 45px #1a3a5870;display:flex;flex-direction:column;overflow:hidden}
.study-header{padding:17px 18px 13px;display:flex;align-items:flex-start;justify-content:space-between;border-bottom:1px solid #edf1f5;background:#fafcfe}
.study-header strong{font-size:16px;color:#1e4466}
.study-header p{margin:4px 0 0;font-size:11px;color:#8a9caf}
.study-header button{border:0;background:transparent;font-size:24px;color:#8b9fb0}
.study-tabs{display:flex;gap:7px;padding:10px 14px;border-bottom:1px solid #e8eff5}
.study-tabs button{flex:1;border:1px solid #e1eaf1;background:#f7fafc;color:#668095;padding:9px 4px;border-radius:8px;font-size:12px}
.study-tabs button.active{background:#215b86;border-color:#215b86;color:#fff;font-weight:700}
.study-content{padding:15px 16px;overflow:auto;min-height:0;flex:1;scrollbar-width:thin}
.study-toolbar{display:flex;justify-content:space-between;gap:8px;align-items:center;color:#8293a4;font-size:11px;margin-bottom:12px}
.study-toolbar button{padding:6px 9px;background:#f2f8fc;border:1px solid #deebf4;color:#2d6188;border-radius:7px;font-size:11px}
#study-question-select,.intersection-selectors select{height:40px;width:100%;border-radius:8px;border:1px solid #d5e4ee;padding:7px;background:white;color:#244967;font-size:12px}
.study-question-heading{display:flex;justify-content:space-between;gap:8px;padding:15px 0 5px;font-size:11px;color:#517493}
.study-question-heading strong{color:#1d5a87}
.study-question-text{font-size:15px;font-weight:750;line-height:1.85;color:#1e425f;margin:7px 0 14px}
.question-options{display:grid;gap:9px}
.question-options label{display:flex;align-items:flex-start;gap:9px;padding:10px;border:1px solid #e0e9f0;border-radius:8px;color:#385877;font-size:12px;line-height:1.65;cursor:pointer}
.question-options label:has(input:checked){border-color:#81b3d2;background:#f1f8ff}
.question-options input{accent-color:#2766a2;margin-top:4px}
.study-question-actions{display:flex;gap:8px;margin-top:15px}
.study-question-actions button{flex:1}
.study-guidance{font-size:11px;color:#91a0ae;line-height:1.8;margin:13px 0 0}
.study-feedback{margin-top:12px;border-radius:9px;padding:11px;font-size:12px;line-height:1.8}
.study-feedback p{margin:5px 0 0}
.study-feedback.correct{background:#e8f6ee;color:#2c7253}
.study-feedback.incorrect{background:#fff3ea;color:#98613a}
#study-free-answer{width:100%;height:38px;border:1px solid #d4e0ed;border-radius:7px;padding:8px}
.study-formula-series{display:flex;flex-direction:column;gap:8px;margin-bottom:13px;padding:13px;border:1px solid #dceaf4;border-radius:9px;background:#f7fbfe;overflow-wrap:anywhere}
.study-formula-series strong{font-size:13px;color:#2c5478}
.study-formula-series span{font-size:13px;font-family:"Times New Roman",serif;color:#415f7d}
.formula-detail{border:1px solid #e2eaf1;border-radius:9px;margin:8px 0;background:white;overflow:hidden}
.formula-detail summary{padding:12px;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;color:#2b5376}
.formula-detail summary b{font-weight:750;text-align:right;color:#1c6890;overflow-wrap:anywhere}
.formula-detail[open] summary{background:#f5f9fc}
.formula-detail ol{padding:7px 15px 11px 34px;margin:0;color:#627e94;line-height:2;font-size:12px;overflow-wrap:anywhere}
.study-intersection{border-top:1px solid #e3edf5;margin-top:18px;padding-top:15px}
.study-intersection h3{font-size:13px;color:#1e4664;margin:0 0 13px}
.intersection-selectors{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.intersection-selectors select{min-width:0}
.intersection-toggle{margin:13px 0;display:flex;gap:8px;align-items:center;font-size:12px;color:#526f86}
.intersection-toggle input{accent-color:#9951b6}
.intersection-points{padding:10px;background:#f7f1fc;color:#7b4093;font-size:12px;line-height:1.85;border-radius:8px;overflow-wrap:anywhere}
#intersection-result{font-size:12px;color:#698397}
#study-compact-toggle{display:block}
@media(max-width:850px){#study-toggle{display:none}}
@media(max-width:650px){.study-drawer{top:59px;bottom:42px;right:6px;width:calc(100% - 12px)}.study-header{padding:13px 14px}.study-content{padding:12px}.graph-actions button#study-compact-toggle{font-size:10px;padding:0 6px}}

/* V0.7 parameters as classroom rheostats and opt-in teaching layers */
.parameter-slider-settings{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:6px;margin:1px 0 9px;padding:8px;border:1px solid #e7edf4;border-radius:9px;background:#f8fbfe}
.parameter-slider-settings label{font-size:10px;color:#637d93;display:grid;gap:4px}
.parameter-slider-settings select,.parameter-slider-settings input{height:30px;min-width:0;width:100%;border:1px solid #d9e5ef;border-radius:6px;padding:3px 6px;color:#2f5472;background:#fff;font-size:11px}
.parameter-sliders{display:grid;gap:9px;margin:0 0 12px}
.parameter-slider-row{display:grid;grid-template-columns:17px minmax(0,1fr) 57px;gap:8px;align-items:center;font-size:12px;color:#3a5d78;font-weight:700}
.parameter-slider-row input[type=range]{width:100%;margin:0;min-width:0;accent-color:#286da6;cursor:ew-resize;touch-action:pan-y}
.parameter-slider-row output{font-size:11px;text-align:center;color:#215f91;background:#edf5fb;border-radius:6px;min-height:26px;padding:6px 2px;font-variant-numeric:tabular-nums}
.graph-actions #layers-toggle{background:#eaf3fd;border-color:#c3d9ec;color:#1f5d8c}
.graph-actions #baseline-button{background:#f6f8fb}
.layer-panel{position:absolute;top:75px;right:16px;z-index:19;width:min(342px,calc(100% - 32px));padding:14px 15px;border-radius:13px;background:#fff;border:1px solid #ccdeed;box-shadow:0 12px 35px #1a3e5360}
.layer-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:12px;font-size:13px;color:#254c6f}
.layer-heading button{font-size:23px;background:transparent;border:0;color:#8a9eac}
.layer-switches{display:grid;grid-template-columns:1fr 1fr;gap:9px 7px}
.layer-switches label{display:flex;align-items:center;gap:5px;font-size:11px;color:#4d6c85;line-height:1.4}
.layer-switches input{accent-color:#256eab}
.condition-setting{margin-top:15px;padding:10px 11px;background:#f7fafc;border:1px solid #e3edf3;border-radius:8px;display:grid;gap:7px}
.condition-setting label{font-size:11px;color:#5a768c;display:flex;align-items:center;justify-content:space-between}
.condition-setting select{border:1px solid #d5e3ef;border-radius:6px;background:#fff;color:#235578;padding:6px;font-size:11px}
.condition-setting small{font-size:10px;line-height:1.6;color:#869ba9}
#layer-help{font-size:10px;line-height:1.6;color:#728a9d;margin:10px 0 0}
.math-overlay{position:absolute;top:55px;right:14px;max-width:min(500px,67%);max-height:42%;overflow:auto;pointer-events:none;padding:10px 12px;border-radius:11px;background:#fffdf4e8;border:1px solid #e8d9ad;box-shadow:0 7px 20px #8c794827;z-index:4;color:#795520}
.math-overlay .math-layer-line{font-size:11px;line-height:1.8;overflow-wrap:anywhere}
.math-overlay .math-layer-line+ .math-layer-line{border-top:1px solid #ece3cb;padding-top:4px;margin-top:4px}
.math-overlay .math-layer-status{font-weight:750;color:#146f55}
.math-overlay .math-layer-status.invalid{color:#a45535}
.animation-controls{position:absolute;right:12px;bottom:54px;z-index:4;display:flex;align-items:center;gap:5px;background:#fffffff2;border:1px solid #e0eaf2;padding:5px 7px;border-radius:9px}
.animation-controls button{border:1px solid #d7e6f1;border-radius:6px;padding:6px 9px;background:#f6faff;color:#315f83;font-size:10px}
.animation-controls button:disabled{opacity:.45;cursor:default}
.animation-controls span{font-size:10px;color:#8098a9}
@media(max-width:1100px){.graph-actions #baseline-button,.graph-actions #undo-parameter{padding:0 5px;min-width:29px}.graph-actions{gap:4px}.graph-actions button{padding:0 6px}}
@media(max-width:650px){.graph-actions #baseline-button,.graph-actions #undo-parameter{font-size:9px}.graph-actions #layers-toggle{font-size:9px}.graph-actions{flex-wrap:wrap}.layer-panel{top:90px;right:6px;width:calc(100% - 12px)}.math-overlay{top:65px;right:7px;max-width:82%;max-height:37%}.animation-controls span{display:none}.animation-controls{right:7px;bottom:51px}}

#layer-panel:not([hidden]) ~ .plot-wrap .math-overlay{right:auto;left:12px;max-width:min(470px,48%)}
@media(max-width:650px){#layer-panel:not([hidden]) ~ .plot-wrap .math-overlay{left:7px;top:320px;max-width:94%;max-height:22%}}

/* V0.8: shared interval in the main stage; richer but collapsible presets */
.more-presets-toggle{display:block;width:100%;margin-top:8px;padding:8px 10px;text-align:center;font-size:11px;font-weight:650;border:1px solid #e2ebf3;border-radius:8px;background:#fff;color:#46718e}
.more-presets-toggle:hover{background:#f2f8fc}
.more-presets{margin-top:7px}
.shared-interval-bar{flex-shrink:0;display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-height:48px;padding:7px 16px;background:#fff;border-bottom:1px solid #e2ebf1;position:relative;z-index:3}
.shared-interval-bar.active{background:#f5fbf8}
.shared-interval-check{display:flex;gap:7px;align-items:center;color:#2b5d6e;font-size:11px;white-space:nowrap;cursor:pointer}
.shared-interval-check input{accent-color:#238870}
.shared-interval-controls{display:flex;align-items:center;gap:5px;white-space:nowrap}
.shared-interval-controls label{font-size:10px;color:#6b8495;display:flex;align-items:center;gap:4px}
.shared-interval-controls input{width:64px;height:30px;min-width:0;border-radius:7px;border:1px solid #cadde9;background:#fff;padding:5px 7px;font-size:12px;color:#22516e;text-align:center}
.shared-interval-controls input[aria-invalid=true]{border-color:#d56757;background:#fff8f5}
.interval-dots{color:#95a8b9}
.shared-interval-note{font-size:10px;color:#91a5af;flex:1;min-width:130px}
.shared-trend-summary{display:flex;align-items:center;gap:5px;flex-wrap:wrap;max-width:100%}
.trend-pill{display:inline-flex;align-items:center;gap:5px;background:#f0f7f3;color:#396b61;border:1px solid #d4e6df;border-radius:6px;padding:4px 7px;font-size:10px;white-space:nowrap}
.trend-pill i{display:inline-block;width:7px;height:7px;border-radius:50%;flex-shrink:0}
.graph-area .layer-panel,.graph-area .bounds-panel{top:126px}
@media(max-width:1050px){.shared-interval-bar{gap:7px;padding:6px 10px}.shared-interval-note{display:none}}
@media(max-width:650px){.shared-interval-bar{align-content:center;padding:5px 7px;gap:4px}.shared-interval-check{font-size:10px}.shared-trend-summary{width:100%;overflow:hidden}.trend-pill{font-size:9px;padding:3px 5px}.shared-interval-controls input{width:47px;height:28px;padding:4px;font-size:10px}.graph-area .layer-panel,.graph-area .bounds-panel{top:145px}}

/* V0.9: single-canvas-area composition lab, optimized for iPad landscape */
.graph-actions .composition-open{background:#185b74;border-color:#185b74;color:#fff;font-weight:750}
.graph-actions .composition-open:hover{background:#24748f;color:#fff}
.composition-workbench{position:absolute;inset:0;z-index:32;display:flex;flex-direction:column;overflow:hidden;background:#f5f8fc;color:#214562}
.comp-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;min-height:61px;padding:9px 18px;background:#fff;border-bottom:1px solid #dfe9f1}
.comp-head strong{display:block;font-size:17px;color:#194363}
.comp-head span{display:block;font-size:11px;color:#829bb0;margin-top:4px}
.comp-head-actions{display:flex;gap:8px;align-items:center}
.comp-head-actions button{min-height:42px;border:1px solid #d4e2ed;border-radius:9px;padding:8px 13px;background:#f5f9fd;color:#315d7c;font-size:12px;font-weight:700;white-space:nowrap}
#comp-close{background:#1a597d;color:#fff;border-color:#1a597d}
.comp-controls{flex:none;display:grid;grid-template-columns:1.2fr 1fr 1fr 1.2fr;gap:10px;padding:10px 14px;background:#fff;border-bottom:1px solid #e3edf4}
.comp-controls label{min-width:0;display:grid;gap:4px;color:#5a7991;font-size:11px;font-weight:700}
.comp-controls input,.comp-controls select{width:100%;height:39px;border:1px solid #d8e5ef;border-radius:8px;padding:7px 9px;color:#204968;background:#f9fcff;font-size:13px}
.comp-controls .comp-range{grid-template-columns:auto minmax(52px,1fr) auto minmax(52px,1fr);align-items:end;gap:7px}
.comp-controls .comp-range input{min-width:0;text-align:center}
.comp-stages{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;padding:8px 12px;flex:none;background:#f6fafc;border-bottom:1px solid #e2eaf1}
.comp-stages button{min-height:39px;border:1px solid #dce6ee;background:#fff;border-radius:9px;color:#53718b;font-size:12px;font-weight:650}
.comp-stages button.active{background:#235e85;border-color:#235e85;color:#fff}
.comp-diagrams{flex:1;min-height:210px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:10px 12px;overflow:hidden}
.comp-diagram{min-width:0;min-height:0;display:flex;flex-direction:column;border:1px solid #dce6ed;border-radius:12px;overflow:hidden;background:#fff;transition:opacity .15s}
.comp-diagram.comp-muted{opacity:.32}
.comp-chart-title{display:flex;justify-content:space-between;align-items:center;gap:6px;min-height:42px;padding:7px 12px;background:#f8fbfe;border-bottom:1px solid #e8eef4}
.comp-chart-title span{font-size:11px;color:#678297}
.comp-chart-title strong{font-size:13px;color:#234969}
.comp-diagram canvas{width:100%;height:100%;min-height:128px;flex:1;display:block;touch-action:none;cursor:ew-resize}
.comp-diagram footer{min-height:38px;padding:9px 11px;background:#f9fcff;border-top:1px solid #e9eff4;font-size:12px;color:#285e82;font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.comp-experiment{display:grid;grid-template-columns:1.2fr 1.3fr 1.1fr;flex:none;gap:10px;padding:9px 12px 12px;max-height:230px;min-height:172px;border-top:1px solid #dce7f1;background:#fff}
.comp-experiment>div{min-width:0;overflow:auto;padding:11px;border:1px solid #e0e9f1;border-radius:10px;background:#fafcfe;scrollbar-width:thin}
.comp-slider-caption{display:flex;justify-content:space-between;align-items:center;font-size:13px;color:#245573}
#comp-x{width:100%;height:38px;margin:8px 0 3px;accent-color:#2b719c;touch-action:pan-y}
.comp-play{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.comp-play button,.comp-question-buttons button{min-height:37px;border:1px solid #cadfe9;border-radius:8px;background:#eaf5fb;color:#295f7e;padding:8px 10px;font-size:11px;font-weight:750}
.comp-play button:disabled{opacity:.4}
.comp-play span{flex:1;min-width:90px;font-size:11px;color:#688ba0}
.comp-analysis{font-size:12px;line-height:1.65;color:#476b84}
#comp-range-summary{font-weight:750;color:#245d81}
.comp-monotonic-summary{margin-top:6px;color:#527990}
#comp-proof{margin-top:5px;border-top:1px solid #dce8f0;padding-top:5px;color:#376181;font-size:11px;line-height:1.7}
.comp-question-head{display:flex;justify-content:space-between;gap:7px;font-size:11px;color:#456f8d}
#comp-question-body{font-size:11px;line-height:1.6;margin:5px 0 7px;min-height:18px}
.comp-answer{display:flex;flex-wrap:wrap;gap:8px}
.comp-answer label{font-size:10px;white-space:nowrap;color:#476b82;display:flex;align-items:center;gap:2px;cursor:pointer}
.comp-answer input{accent-color:#245d85}
.comp-question-buttons{display:flex;gap:7px;margin-top:7px}
#comp-feedback{margin-top:6px;font-size:11px;line-height:1.5;color:#1d785c}
.comp-quiz-locked{opacity:.65}
.composition-workbench.comp-focus .comp-experiment{display:none}
.composition-workbench.comp-focus .comp-diagrams{min-height:300px}
@media(max-width:1180px){.comp-controls{grid-template-columns:1.2fr 1fr 1fr 1.1fr;gap:7px;padding:7px 9px}.comp-diagrams{gap:7px;padding:8px}.comp-experiment{grid-template-columns:1.05fr 1.25fr 1fr;gap:7px;padding:7px}.comp-head{padding:6px 12px;min-height:54px}.comp-chart-title strong{font-size:12px}}
@media(max-width:850px){.comp-controls{grid-template-columns:repeat(2,minmax(0,1fr))}.comp-stages button{font-size:10px;padding:5px 1px}.comp-experiment{max-height:260px;grid-template-columns:1fr 1fr}.comp-question{grid-column:1/-1}.composition-workbench{overflow-y:auto}.comp-diagrams{flex:none;min-height:300px}.comp-diagram{min-height:300px}.comp-experiment{flex:none;max-height:none}.comp-head{position:sticky;top:0;z-index:5}.comp-head strong{font-size:13px}}
@media(max-width:620px){.comp-head{gap:5px}.comp-head span{display:none}.comp-head-actions button{font-size:10px;min-height:40px;padding:5px 8px}.comp-controls{grid-template-columns:1fr 1fr}.comp-controls label{font-size:10px}.comp-controls input,.comp-controls select{height:35px;font-size:11px}.comp-stages{gap:2px;padding:4px}.comp-stages button{min-height:37px;font-size:9px}.comp-diagrams{display:grid;grid-template-columns:1fr;min-height:0;overflow:visible;gap:8px;padding:8px}.comp-diagram{min-height:260px}.comp-experiment{grid-template-columns:1fr}.comp-question{grid-column:1}.composition-workbench{overflow-y:auto}}
@media(orientation:landscape) and (pointer:coarse){.comp-head-actions button,.comp-stages button,.comp-play button,.comp-question-buttons button{min-height:44px}.comp-diagram canvas{touch-action:none}.comp-controls input{min-height:43px}}

/* V0.9: prevent new launch control from causing tablet-width horizontal scrolling */
@media(max-width:1200px){
 .graph-toolbar{flex-wrap:wrap;gap:4px;min-height:62px;height:auto;padding:6px 10px;align-content:center}
 .view-menu{flex:1;min-width:130px}
 .graph-actions{flex-wrap:wrap;justify-content:flex-end;gap:4px;min-width:0;max-width:100%}
 .graph-actions button{min-height:31px;height:31px;padding:0 6px;font-size:10px}
 .graph-actions .composition-open{font-size:10px}
}
@media(max-width:680px){.graph-actions{flex:1;justify-content:flex-end}.view-menu{min-width:95px}.graph-actions button{font-size:9px;padding:0 5px}}

/* V0.10: iPad-first math palette for inner/outer composition formulas */
.composition-workbench{isolation:isolate}
.comp-input-strip{display:flex;align-items:center;gap:8px;flex:none;min-height:43px;background:#fff;border-bottom:1px solid #dbe7f0;padding:6px 12px;flex-wrap:wrap;position:relative;z-index:20}
.comp-input-status{font-weight:700;color:#316083;font-size:12px;white-space:nowrap;margin-right:4px}
.comp-input-strip button{min-height:37px;border-radius:8px;padding:6px 12px;font-size:11px;font-weight:750;touch-action:manipulation}
.comp-input-open{border:1px solid #b7d7e7;background:#edf7fc;color:#1b6185}
.comp-input-open[aria-expanded=true]{background:#205d84;color:#fff;border-color:#205d84}
.comp-input-mode{border:1px solid #d5e5ed;background:#fff;color:#647e91}
#comp-input-error{font-size:11px;color:#a45c44;min-width:0}
.comp-input-popover{position:absolute;left:12px;top:clamp(170px,20vh,210px);width:min(640px,calc(100% - 24px));max-height:min(480px,60%);overflow:auto;z-index:60;border:1px solid #bdd4e4;background:#fff;border-radius:13px;box-shadow:0 14px 38px #284b6880;padding:11px 13px 12px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.comp-input-popover[hidden]{display:none!important}
.comp-input-tabs{display:flex;gap:7px;align-items:center;margin-bottom:11px}
.comp-input-tabs button{height:40px;border:1px solid #d2e2ed;background:#f6f9fc;border-radius:8px;padding:8px 14px;font-size:12px;font-weight:700;color:#567a92}
.comp-input-tabs button.active{background:#286b96;color:#fff}
#comp-palette-close{margin-left:auto;width:42px;padding:0;font-size:24px}
.comp-palette-section[hidden]{display:none}
.comp-palette-label,.comp-symbol-group strong{display:block;color:#618097;font-size:12px;margin:5px 0 8px}
.comp-template-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.comp-template-grid button{display:grid;gap:3px;min-height:58px;padding:7px 5px;border:1px solid #dbe8f0;border-radius:9px;background:#f6fafc;color:#2e6386;text-align:center;touch-action:manipulation}
.comp-template-grid button b{font-size:11px}
.comp-template-grid button span{font-size:12px;font-family:"Times New Roman",serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.comp-template-grid button:active,.comp-key-grid button:active{background:#d0e9fa;transform:scale(.98)}
.comp-palette-hint{font-size:12px;color:#8097a6}

.comp-symbol-group{margin:0 0 11px}
.comp-key-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}
.comp-key-grid button{min-width:0;min-height:43px;white-space:nowrap;background:#f5f9fc;color:#245c83;border:1px solid #d9e6ef;border-radius:9px;font-size:12px;font-weight:700;padding:6px 2px;touch-action:manipulation}
.comp-key-grid button[data-composition-key="backspace"]{background:#fff4eb;color:#9e563a}
.comp-key-grid button[data-composition-key="clear"]{background:#fff4eb;color:#9e563a}
.comp-preview-line{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:10px;border-top:1px solid #e4edf3;padding-top:9px;color:#6b8599}
.comp-preview-line span{font-size:11px}
.comp-preview-line strong{font-size:16px;color:#245c83;font-family:"Times New Roman",serif;font-weight:600;max-width:100%;overflow-wrap:anywhere}
.comp-preview-line small{font-size:10px;line-height:1.5}
.comp-controls input:focus-visible{outline:2px solid #3c8bbb;outline-offset:2px}
@media(max-width:1180px){.comp-input-strip{gap:6px;padding:5px 9px}.comp-input-strip button{min-height:41px;padding:7px 11px}.comp-input-popover{top:185px}}
@media(max-width:850px){.comp-input-popover{top:235px;width:calc(100% - 16px);left:8px}.comp-template-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.comp-key-grid{grid-template-columns:repeat(6,minmax(0,1fr))}}
@media(max-width:620px){.comp-input-status{flex-basis:100%}.comp-input-strip{gap:4px;padding:5px 7px}.comp-input-strip button{min-height:42px;padding:7px 8px;font-size:10px}.comp-input-popover{position:sticky;top:0;left:0;width:100%;max-height:370px;border-radius:0;box-shadow:0 6px 16px #254c6060}.comp-template-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.comp-key-grid{grid-template-columns:repeat(5,minmax(0,1fr))}}
@media(orientation:landscape) and (pointer:coarse){.comp-template-grid button{min-height:58px}.comp-key-grid button{min-height:47px}.comp-input-strip button{min-height:44px}}

/* V0.11: classroom typesetting with touch-selectable numerator, denominator and exponents */
.comp-input-strip .comp-live-typeset{display:flex;align-items:center;gap:8px;flex:1 1 290px;min-width:235px;min-height:47px;overflow:hidden;padding:5px 9px;background:#f8fbfd;border:1px solid #e2edf4;border-radius:9px}
.comp-live-typeset .math-caption{font-size:10px;color:#648299;white-space:nowrap}
#comp-math-live{display:flex;align-items:center;gap:4px;min-width:0;overflow:auto;max-width:100%;font-size:18px;font-weight:500;color:#185779;font-family:Cambria,"Times New Roman",serif;white-space:nowrap;padding:3px 0;scrollbar-width:thin}
.comp-live-typeset small{font-size:10px;color:#8ba0af;flex:1;min-width:70px;line-height:1.5}
.comp-preview-line strong#comp-formula-preview{display:inline-flex;align-items:center;gap:5px;font-size:23px;font-weight:500;max-width:100%;overflow:auto;padding:7px 4px;white-space:nowrap}
.math-equals{font-style:normal;font-size:.83em;color:#54798e;white-space:nowrap}
.math-binary,.math-frac,.math-power,.math-unary,.math-abs,.math-radical{display:inline-flex;align-items:center;vertical-align:middle}
.math-frac{flex-direction:column;justify-content:center;vertical-align:middle;line-height:1.1;text-align:center;margin:0 3px;min-width:24px}
.math-frac-top,.math-frac-bottom{padding:2px 5px;min-height:19px;display:flex;align-items:center;justify-content:center;white-space:nowrap}
.math-frac-top{border-bottom:1.5px solid currentColor;padding-bottom:3px}
.math-power{align-items:flex-start}
.math-power sup{font-size:.73em;line-height:1.1;display:inline-block;margin-top:-.18em}
.math-radical{align-items:flex-start;padding-top:3px;position:relative}
.math-root-symbol{font-family:Cambria,"Times New Roman",serif;font-size:1.32em;line-height:1.2;margin-right:-1px}
.math-root-index{font-size:.53em;position:relative;top:-.27em;left:2px}
.math-radicand{display:inline-flex;align-items:center;border-top:1.5px solid currentColor;padding:2px 4px 0 2px;min-height:24px}
.math-abs{gap:2px}
.math-function{font-style:normal;font-family:Cambria,"Times New Roman",serif;padding-left:2px}
.math-op{padding:0 3px}
.math-parenthesis{opacity:.85}
.math-selectable{display:inline-flex;align-items:center;justify-content:center;min-width:8px;min-height:22px;padding:1px 2px;border-radius:4px;cursor:pointer;touch-action:manipulation}
.math-selectable:hover,.math-selectable:focus-visible{background:#d6eef9;color:#125675;outline:1px solid #8fc9e7}
.math-selectable:active{background:#addcf4}
.math-incomplete{color:#b35a4b;border-bottom:1px dashed #ce806e}
.math-error{color:#ad6549!important}
@media(max-width:1180px){.comp-input-strip .comp-live-typeset{flex-basis:235px}.comp-live-typeset small{display:none}}
@media(max-width:850px){.comp-input-strip .comp-live-typeset{flex-basis:100%;min-height:37px}.comp-preview-line strong#comp-formula-preview{font-size:21px}}
@media(max-width:620px){.comp-input-strip .comp-live-typeset{flex-basis:100%}#comp-math-live{font-size:16px}.comp-preview-line strong#comp-formula-preview{font-size:18px}}

/* Keep the typeset equation uncovered while editing its visible components. */
.comp-input-popover{top:clamp(246px,30vh,285px)}
@media(max-width:1180px){.comp-input-popover{top:265px}}
@media(max-width:850px){.comp-input-popover{top:315px}}
@media(max-width:620px){.comp-input-popover{position:sticky;top:0}}

/* V0.12 — graph is the permanent backdrop; all work panels float above it */
.workspace{position:relative;display:block;min-height:0;overflow:hidden}
.graph-area{position:absolute;inset:0;width:100%;height:100%;min-width:0;overflow:hidden;background:#fff}
#plot-wrap.plot-wrap{position:absolute;inset:0;width:100%;height:100%;min-height:0;flex:none}
.graph-toolbar{position:absolute;top:10px;left:14px;right:14px;z-index:12;width:auto;min-height:51px;height:auto;padding:6px 10px;background:#fffffff5;border:1px solid #e3ebf2;border-radius:11px;box-shadow:0 6px 25px #213f5517}
.shared-interval-bar{position:absolute;z-index:11;top:78px;left:14px;right:14px;width:auto;min-height:40px;border:1px solid #dfe9ee;border-radius:9px;padding:5px 10px;background:#ffffffed;box-shadow:0 3px 14px #1b394415}
.statusline{position:absolute;bottom:0;left:0;right:0;z-index:8;min-height:26px;padding:5px 12px;background:#ffffffea;font-size:10px}
.editor-panel{position:absolute;top:138px;left:12px;height:min(610px,calc(100% - 162px));width:min(365px,36vw);min-width:290px;max-width:calc(100% - 24px);z-index:25;border:1px solid #d9e6ef;border-radius:12px;overflow:auto;background:#fffc;box-shadow:0 12px 35px #1f3a5328;flex-basis:auto;transform:none}
.shell.panel-hidden .editor-panel{display:none}
#editor-close{font-size:22px}
.floating-drag-head{touch-action:none;cursor:grab;user-select:none;-webkit-user-select:none}
.floating-drag-head:active{cursor:grabbing}
.float-close{border:1px solid #dce7ef;border-radius:8px;color:#607d92;background:#f6f9fb;width:36px;height:36px;flex-shrink:0;font-size:20px;touch-action:manipulation}
.quick-builder,.moving-panel{position:absolute;right:16px;top:136px;z-index:35;width:min(355px,calc(100% - 28px));max-height:calc(100% - 158px);overflow:auto;border:1px solid #cee1ed;border-radius:13px;background:#fff;box-shadow:0 16px 36px #1c405a45;padding:13px;scrollbar-width:thin}
.moving-panel{right:16px;top:auto;bottom:48px;width:min(335px,calc(100% - 28px))}
.float-title{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:15px;color:#204b6d;padding-bottom:9px;border-bottom:1px solid #e4edf4}
.float-subtitle,.moving-help{font-size:11px;color:#7d94a5;line-height:1.65;margin:8px 0}
.quick-family{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:10px 0}
.quick-family button{min-height:42px;border:1px solid #d9e7f1;border-radius:8px;background:#f7fafc;color:#456b88;font-size:11px;font-weight:700;touch-action:manipulation}
.quick-family button.active{background:#20628b;border-color:#20628b;color:#fff}
.quick-preview{border:1px solid #d9e8f4;border-radius:8px;padding:9px 11px;background:#f5faff;color:#47708f;margin:9px 0;font-family:Cambria,serif;font-size:17px}
.quick-preview strong{color:#164e7e}
.quick-parameters{display:grid;gap:7px}
.quick-param{display:grid;grid-template-columns:30px 46px minmax(0,1fr) 46px;gap:6px;align-items:center}
.quick-param strong{font-size:16px;color:#345e7c}
.quick-param button{border:1px solid #c7deeb;background:#edf7fd;color:#235d84;border-radius:8px;height:43px;font-size:22px;touch-action:manipulation}
.quick-param input{min-width:0;height:43px;padding:7px;border:1px solid #d8e5ee;border-radius:8px;font-size:14px;color:#285e83;text-align:center}
.quick-builder-footer{display:flex;align-items:center;justify-content:space-between;gap:7px;margin-top:13px}
.quick-builder-footer label{font-size:11px;color:#608198}
.quick-builder-footer select{min-height:38px;border:1px solid #d1e2ef;border-radius:8px;background:#f9fcff;color:#2a6589}
.quick-builder-footer button{min-height:44px;flex:1}
.quick-builder-feedback{font-size:11px;color:#587d92;line-height:1.5;margin:10px 0 2px}
.moving-panel>label{display:grid;gap:5px;margin-top:9px;font-size:11px;color:#59778b}
.moving-panel select,.moving-range input{min-height:40px;padding:6px 9px;border-radius:8px;border:1px solid #d9e7ef;background:#f8fbfe;color:#245576}
.moving-range{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:10px 0}
.moving-range label{display:grid;gap:4px;font-size:11px;color:#668498}
.moving-range input{width:100%}
.moving-values{display:grid;gap:5px;background:#fff9ec;border:1px solid #f0dfba;padding:10px;border-radius:8px;color:#86572a;font-size:12px;line-height:1.75}
.moving-values strong{font-size:16px}
#moving-slider{width:100%;height:42px;accent-color:#d78b25;touch-action:pan-y;margin:5px 0}
.moving-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.moving-actions button,.moving-reset{min-height:40px;border:1px solid #d7e5ef;border-radius:8px;padding:7px 9px;background:#f2f8fd;color:#2b6083;font-size:11px}
.moving-actions button:disabled{opacity:.4}
.moving-actions label{font-size:10px;color:#607e91;white-space:nowrap}
.moving-reset{min-height:34px}
.study-drawer{top:140px;bottom:auto;right:15px;height:min(610px,calc(100% - 165px));max-height:calc(100% - 165px)}
.layer-panel{top:140px;right:15px;max-height:calc(100% - 160px);overflow:auto}
.graph-area .layer-panel,.graph-area .bounds-panel{top:140px}
.bounds-panel{z-index:38!important}
.graph-actions #quick-create-toggle{background:#176c83;border-color:#176c83;color:white}
.graph-actions #moving-point-toggle{background:#fff1d9;border-color:#edd4a7;color:#9b6119}
#moving-point-toggle.active{background:#f8d89e}
.plot-hint{top:129px}
.plot-legend{bottom:65px}
.animation-controls{bottom:70px}
.plot-bottom{bottom:34px}

.shared-interval-bar[hidden],.animation-controls[hidden]{display:none!important}
@media(max-width:1199px){
 .editor-panel{width:min(355px,calc(100% - 20px));min-width:0;left:10px;top:95px;height:calc(100% - 120px)}
 .quick-builder{top:95px;right:10px;max-height:calc(100% - 112px)}
 .moving-panel{top:95px;bottom:auto;right:10px;max-height:calc(100% - 112px)}
 .graph-toolbar{left:7px;right:7px;top:6px;max-width:calc(100% - 14px);flex-wrap:wrap;min-height:54px}
 .shared-interval-bar{top:90px;left:7px;right:7px}
 .graph-area .layer-panel,.graph-area .bounds-panel{top:95px}
 .study-drawer{top:95px;height:calc(100% - 114px);max-height:calc(100% - 114px)}
}
@media(max-width:650px){
 .graph-toolbar{padding:5px;gap:4px}
 .graph-actions button{min-height:34px}
 .view-menu{min-width:95px}
 .quick-builder,.moving-panel{width:min(340px,calc(100% - 14px));top:105px;right:7px;max-height:calc(100% - 119px)}
 .quick-param button{height:40px}
 .editor-panel{max-width:calc(100% - 12px);left:6px}
}

.moving-scenarios{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:10px 0}
.moving-scenarios span{grid-column:1/-1;font-size:11px;color:#607e94;font-weight:750}
.moving-scenarios button{border:1px solid #edd8b2;background:#fff8ec;color:#895b27;border-radius:8px;font-size:11px;font-weight:750;min-height:42px;padding:6px 7px;touch-action:manipulation}
.moving-scenarios button:active{background:#f8e0b1}
.moving-question{font-size:11px;line-height:1.7;color:#526e81;border:1px solid #dfe9ef;border-radius:8px;padding:9px;margin:8px 0;background:#f8fafc}

/* V0.13 – touch-first one-tap templates and derived quantity function */
.one-tap-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:8px 0 12px}
.one-tap-list button{background:#f6fafc;color:#235779;border:1px solid #d6e6f0;border-radius:8px;min-height:43px;font-family:Cambria,"Times New Roman",serif;font-size:14px;touch-action:manipulation}
.one-tap-list button:active{background:#dceef7}
.moving-metric-box{padding:10px 8px;border:1px solid #d8e7f1;border-radius:10px;background:#fff;margin:8px 0}
.moving-metric-title{display:flex;justify-content:space-between;align-items:center;gap:8px;color:#2b5d7d;font-size:12px}
.moving-metric-title span{font-family:Cambria,"Times New Roman",serif;font-size:13px;white-space:nowrap}
#moving-metric-chart{width:100%;height:152px;margin:6px 0 3px;display:block;touch-action:none;cursor:crosshair}
#moving-metric-status{color:#678298;font-size:11px;line-height:1.6;min-height:24px;margin:3px 0 8px}
.moving-critical-buttons{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.moving-critical-buttons button,#moving-solution-toggle{font-size:11px;border:1px solid #cbdfe9;border-radius:8px;min-height:40px;background:#eff7fb;color:#276180;padding:6px;touch-action:manipulation}
.moving-critical-buttons button:disabled,#moving-solution-toggle:disabled{opacity:.45}
#moving-solution-toggle{margin-top:7px;width:100%;background:#f5fafc}
#moving-solution{font-size:11px;line-height:1.85;color:#486d88;margin:8px 0 0;padding:9px 5px 8px 22px;background:#f6fafd;border-radius:8px}
#moving-solution[hidden]{display:none}
#moving-solution li+li{margin-top:6px}

/* V0.14 — iPad-friendly parameter inequalities; the graph remains the background */
.parameter-explorer{position:absolute;right:14px;top:134px;z-index:52;width:min(375px,calc(100% - 28px));max-height:calc(100% - 151px);overflow:auto;background:#fff;border:1px solid #cde1ed;border-radius:13px;box-shadow:0 14px 35px #20445f40;padding:12px;scrollbar-width:thin}
.param-examples{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:11px 0}
.param-examples button{min-height:42px;touch-action:manipulation;background:#f3f9fe;color:#285e81;border:1px solid #d3e5ef;border-radius:8px;font-size:12px;font-weight:700;padding:6px}
.param-row{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:9px 0}
.param-row label,.param-step label{display:grid;gap:5px;font-size:11px;color:#587b91;font-weight:650}
.param-row input,.param-row select,.param-step select{width:100%;min-height:42px;min-width:0;border:1px solid #d8e6ee;border-radius:8px;padding:6px;background:#f8fbfe;color:#215372;font-size:12px}
.param-adjust{display:grid;grid-template-columns:auto 42px minmax(0,1fr) 42px;gap:7px;align-items:center;margin:12px 0 10px}
.param-adjust span{font-size:15px;min-width:66px;color:#276082;font-weight:750}
.param-adjust button{height:44px;border:1px solid #cbdfe9;border-radius:8px;background:#eaf5fb;color:#1e6186;font-size:22px;touch-action:manipulation}
#param-slider{width:100%;height:40px;accent-color:#197c96;touch-action:pan-y}
.param-step{display:flex;gap:8px;align-items:end;justify-content:space-between}
.param-step button,.param-actions button{min-height:42px;border-radius:8px;border:1px solid #ccdee9;background:#f1f8fc;color:#275c7d;padding:7px 10px;font-size:11px;font-weight:700;touch-action:manipulation}
.param-observation{white-space:pre-line;line-height:1.85;color:#365f79;background:#f5f9fc;border:1px solid #e0eaf1;border-radius:8px;padding:10px;margin:12px 0 8px;font-size:12px}
.param-actions button{width:100%}
#param-steps{font-size:11px;line-height:1.9;color:#436881;background:#f8fbfd;border-radius:8px;margin:8px 0;padding:10px 8px 10px 24px}
#param-steps[hidden]{display:none}
#param-explore-toggle{background:#ebf6fb;color:#255d7c;border-color:#c5dce8}
@media(max-width:1199px){.parameter-explorer{top:97px;right:8px;max-height:calc(100% - 116px)}}
@media(max-width:650px){.parameter-explorer{top:112px;right:6px;width:min(360px,calc(100% - 12px));max-height:calc(100% - 130px)}}

/* V0.15: question-first floating studio; original canvas stays fully visible */
.task-hub{position:absolute;left:15px;top:138px;z-index:56;width:min(380px,calc(100% - 30px));max-height:calc(100% - 154px);overflow:auto;border:1px solid #d1e4ef;border-radius:13px;padding:12px;background:#fff;box-shadow:0 14px 38px #183f6045;scrollbar-width:thin}
.task-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;margin:9px 0}
.task-tabs button{border:1px solid #d5e5ee;border-radius:8px;background:#f6fafc;color:#3f718e;font-size:10px;padding:6px 1px;min-height:38px;font-weight:700;touch-action:manipulation}
.task-tabs button.active{background:#215d85;color:#fff;border-color:#215d85}
.task-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin-bottom:10px}
.task-list button{min-height:40px;border-radius:8px;border:1px solid #d9e5ee;padding:7px 5px;background:#f8fbfe;color:#476e89;font-size:10px;text-align:left;touch-action:manipulation}
.task-list button.active{background:#e4f3fc;color:#185a88;border-color:#7cbddf}
.task-detail{border:1px solid #dce7ef;border-radius:10px;background:#fafcff;padding:10px;display:grid;gap:8px;color:#305a74}
.task-detail>strong{font-size:13px}
#task-question{font-size:12px;line-height:1.7;margin:1px 0 2px}
.task-options{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.task-options label{display:flex;align-items:flex-start;gap:4px;background:#fff;border:1px solid #e2eaf1;padding:8px 6px;min-height:38px;border-radius:7px;color:#496b84;font-size:11px;line-height:1.5;touch-action:manipulation}
.task-options input{accent-color:#245f89;flex-shrink:0;margin-top:3px}
.task-operations{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:6px}
.task-operations button,#task-explain-toggle{min-height:42px;padding:5px;border:1px solid #c6dce9;border-radius:8px;background:#edf7fd;color:#236182;font-size:11px;font-weight:700;touch-action:manipulation}
#task-start{background:#216489;color:#fff;border-color:#216489}
#task-feedback{white-space:pre-wrap;font-size:11px;color:#276f82;line-height:1.6;min-height:14px;margin:2px 0}
#task-explanation{font-size:11px;line-height:1.75;color:#4a6b80;background:#eef7fb;border-radius:8px;padding:9px}
#task-explanation[hidden]{display:none}
#task-explain-toggle[hidden]{display:none}
#task-hub-toggle{background:#25678b!important;color:#fff!important;border-color:#25678b!important}
.moving-scenarios{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:1199px){.task-hub{left:8px;top:96px;width:min(365px,calc(100% - 16px));max-height:calc(100% - 113px)}}
@media(max-width:650px){.task-hub{left:6px;top:112px;width:min(358px,calc(100% - 12px));max-height:calc(100% - 129px)}}

.task-focus-clear{border:1px solid #b9d7e8;border-radius:8px;background:#fff;color:#245d7e;min-height:40px;font-size:11px;font-weight:750;touch-action:manipulation}
.task-focus-clear[hidden]{display:none}

/* V0.16: separate creation (right) from management (left). */
.editor-panel{width:min(370px,36vw);background:#fffffff3}
.editor-panel .editor-head{position:sticky;top:0;z-index:2;background:#fff;padding:12px}
.editor-panel .curve-list{padding-top:6px}
.manager-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:11px 13px 3px;background:#fff}
.manager-tools button{min-height:40px;border:1px solid #d7e4ed;border-radius:8px;background:#f5fafc;color:#315c78;font-size:11px;font-weight:700;touch-action:manipulation}
.manager-tools button:active{background:#dbeef7}
.curve-top{gap:3px}
.curve-top .curve-title{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.curve-top .curve-action{width:29px;min-width:29px;height:31px;display:inline-grid;place-items:center;padding:0;font-size:13px}
.curve-card.selected{border:1px solid #7bb2dc;box-shadow:0 0 0 2px #eaf4fb}
.curve-rename{padding:6px 10px}
.curve-rename label{font-size:10px;display:flex;align-items:center;gap:7px;color:#657f91}
.curve-rename input{min-width:0;flex:1;border:1px solid #d7e7ef;border-radius:7px;padding:8px;font-size:12px;background:#f9fcff}
.quick-builder{width:min(370px,calc(100% - 28px))}
.quick-advanced{margin-top:12px;border:1px solid #dce8ef;border-radius:10px;background:#f9fcfe}
.quick-advanced>summary{list-style:none;cursor:pointer;color:#376887;font-size:11px;font-weight:700;padding:13px 10px;touch-action:manipulation}
.quick-advanced>summary::-webkit-details-marker{display:none}
#quick-advanced-slot .add-section{padding:8px 10px;margin:0;background:transparent}
#quick-advanced-slot .preset-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
#quick-advanced-slot .preset-grid button{min-height:42px}
#quick-advanced-slot .import-area{padding:8px 10px}
#quick-advanced-slot .sidebar-hint{padding:8px 12px;font-size:10px}
.cursor-modes{position:absolute;z-index:24;top:128px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:4px;background:#fffffff0;border:1px solid #dde9f2;border-radius:12px;box-shadow:0 6px 18px #17354d27;padding:5px;white-space:nowrap;max-width:calc(100% - 24px)}
.cursor-modes button{min-height:38px;border:1px solid transparent;border-radius:8px;background:transparent;color:#536f88;font-size:11px;padding:8px 10px;font-weight:750;touch-action:manipulation}
.cursor-modes button.active{background:#1b6889;color:#fff}
.cursor-modes span{font-size:10px;color:#7890a2;padding:0 6px;overflow:hidden;text-overflow:ellipsis}
#plot-canvas[data-cursor-mode="select"]{cursor:crosshair}
#plot-canvas[data-cursor-mode="pan"]{cursor:grab}
#plot-canvas[data-cursor-mode="move"]{cursor:move}
@media(max-width:1199px){.cursor-modes{top:91px;left:50%}.cursor-modes span{display:none}.cursor-modes button{min-height:43px}}
@media(max-width:650px){.cursor-modes{top:120px;left:6px;transform:none;max-width:calc(100% - 12px)}.cursor-modes button{font-size:10px;padding:7px 8px}.editor-panel{width:min(355px,calc(100% - 12px))}}
/* V0.17: first cross-subject question bank and source review */
.bank-panel{position:absolute;z-index:64;top:122px;right:18px;width:min(630px,calc(100% - 34px));max-height:calc(100% - 145px);overflow:auto;background:#fff;border:1px solid #d6e3ed;border-radius:13px;box-shadow:0 17px 35px #1d3c5740;padding:13px}
.bank-subtitle{font-size:11px;line-height:1.65;color:#647f96;margin:7px 0 9px}
.bank-tabs{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-bottom:10px}
.bank-tabs button,.bank-footer button{border:1px solid #d0e2ed;border-radius:8px;min-height:38px;background:#f5faff;color:#2c6487;font-size:11px;touch-action:manipulation}
.bank-tabs button.active{background:#246a8e;color:white;border-color:#246a8e}
.bank-filters{display:grid;grid-template-columns:minmax(80px,1fr) 125px 133px;gap:7px;margin-bottom:10px}
.bank-filters input,.bank-filters select{min-width:0;min-height:41px;border:1px solid #d7e5ee;border-radius:8px;background:#f9fcfe;padding:6px 8px;font-size:11px;color:#315c7a}
.bank-body{display:grid;grid-template-columns:42% minmax(0,1fr);gap:10px}
.bank-results{max-height:345px;overflow:auto;display:grid;align-content:start;gap:5px;scrollbar-width:thin}
.bank-result{min-height:49px;border:1px solid #dde9ef;border-radius:8px;background:#f7fafc;text-align:left;display:grid;gap:4px;padding:8px;touch-action:manipulation}
.bank-result.selected{border-color:#7fb4db;background:#e8f5fc}
.bank-result strong{font-size:11px;color:#295c7d}
.bank-result small{font-size:10px;color:#8297a9}
.bank-detail{padding:10px;border:1px solid #dce7ee;border-radius:9px;background:#fdfefe;display:flex;flex-direction:column;gap:9px;min-width:0}
.bank-detail strong{font-size:13px;color:#265a7c}
#bank-stem{font-size:12px;line-height:1.7;margin:0;color:#3a5b72}
#bank-options{display:grid;gap:5px}
#bank-options label{display:flex;gap:7px;align-items:flex-start;padding:7px;border:1px solid #e1eaf1;border-radius:7px;background:#fff;color:#496d85;font-size:11px}
#bank-options input{flex-shrink:0;margin-top:3px;accent-color:#206c92}
.bank-actions{display:flex;gap:7px}
.bank-actions button{flex:1;min-height:39px;border:1px solid #cbdfeb;border-radius:8px;background:#eaf6fd;color:#275f83;font-size:11px;touch-action:manipulation}
.bank-actions button:disabled{opacity:.45}
#bank-feedback{font-size:11px;color:#24708a;margin:0}
#bank-explanation{font-size:11px;line-height:1.75;color:#3c6a87;border-radius:7px;background:#eaf5fd;padding:9px}
#bank-explanation[hidden],#bank-sources[hidden],#bank-questions[hidden],.bank-panel[hidden]{display:none!important}
.bank-footer{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:10px;color:#708ca0;font-size:10px}
.bank-footer button{padding:8px}
.bank-rights-note{font-size:11px;line-height:1.7;color:#92682e;background:#fff9ed;padding:11px;border-radius:9px}
.bank-source-item{border-bottom:1px solid #e2ebef;padding:10px 6px;display:grid;gap:5px}
.bank-source-item a{font-size:13px;font-weight:750;color:#23658d}
.bank-source-item p{font-size:11px;line-height:1.6;color:#607f95;margin:0}
.bank-source-item small{font-size:11px;color:#916f47}
#bank-open{background:#e5f2f9;color:#286487;border-color:#cee1ec}
@media(max-width:1199px){.bank-panel{top:95px;right:8px;max-height:calc(100% - 112px)}}
@media(max-width:650px){.bank-panel{top:112px;right:5px;width:calc(100% - 10px);max-height:calc(100% - 130px)}.bank-body{grid-template-columns:1fr}.bank-results{max-height:145px;grid-template-columns:1fr 1fr}.bank-filters{grid-template-columns:1fr 1fr}.bank-filters input{grid-column:1/-1}}
