:root{--bg-app: #0c0d12;--bg-sidebar: #13141b;--bg-surface: #181922;--bg-surface-elevated: #1f212d;--bg-input: #15161f;--bg-input-focus: #1a1c27;--border-subtle: #242634;--border-medium: #323547;--border-focus: #5b6282;--text-primary: #f2f3f7;--text-secondary: #9094a6;--text-muted: #5e6275;--text-dark: #0e1015;--color-surface-f: #5b8ec7;--color-surface-g: #8e95a5;--color-curve: #f5eedb;--color-success: #4ade80;--color-warning: #fbbf24;--color-info: #60a5fa;--btn-primary-bg: #eceef2;--btn-primary-text: #111218;--btn-primary-hover: #ffffff;--btn-secondary-bg: #222431;--btn-secondary-text: #d4d6e2;--btn-secondary-hover: #2c2f40;--font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;--space-xs: 4px;--space-sm: 8px;--space-md: 14px;--space-lg: 20px;--space-xl: 28px;--radius-sm: 6px;--radius-md: 10px;--radius-lg: 14px;--shadow-subtle: 0 4px 20px rgba(0, 0, 0, .35);--shadow-panel: 4px 0 24px rgba(0, 0, 0, .4);--keyboard-background: #13141b;--keyboard-border: #242634;--keyboard-toolbar-background: #181922;--keyboard-toolbar-text: #9094a6;--keyboard-toolbar-text-active: #f2f3f7;--keyboard-toolbar-background-hover: #1f212d;--keyboard-toolbar-background-selected: #242634;--keyboard-accent-color: #5b8ec7;--keyboard-zindex: 1000;--keycap-background: #1c1d27;--keycap-background-hover: #262836;--keycap-background-active: #323547;--keycap-border: #2e3144;--keycap-border-bottom: #1c1d27;--keycap-text: #f2f3f7;--keycap-secondary-background: #252838;--keycap-secondary-text: #9094a6}[data-theme=light]{--bg-app: #f6f7fa;--bg-sidebar: #ffffff;--bg-surface: #ffffff;--bg-surface-elevated: #f0f2f7;--bg-input: #f3f5f9;--bg-input-focus: #ffffff;--border-subtle: #e3e6ee;--border-medium: #cbd0dd;--border-focus: #3b82f6;--text-primary: #12141c;--text-secondary: #4f5567;--text-muted: #7b8396;--text-dark: #0e1015;--color-surface-f: #3a75b5;--color-surface-g: #6b7280;--color-curve: #b45309;--btn-primary-bg: #12141c;--btn-primary-text: #ffffff;--btn-primary-hover: #222634;--btn-secondary-bg: #ebeef5;--btn-secondary-text: #1f2430;--btn-secondary-hover: #dfe3ed;--shadow-subtle: 0 4px 20px rgba(0, 0, 0, .08);--shadow-panel: 4px 0 24px rgba(0, 0, 0, .1);--keyboard-background: #f0f2f7;--keyboard-border: #d4d8e3;--keyboard-toolbar-background: #ffffff;--keyboard-toolbar-text: #4f5567;--keyboard-toolbar-text-active: #12141c;--keyboard-toolbar-background-hover: #e8ebf2;--keyboard-toolbar-background-selected: #dce0ec;--keyboard-accent-color: #2563eb;--keycap-background: #ffffff;--keycap-background-hover: #f3f5f9;--keycap-background-active: #e2e6f0;--keycap-border: #d4d8e3;--keycap-border-bottom: #cbd0dd;--keycap-text: #12141c;--keycap-secondary-background: #e8ebf2;--keycap-secondary-text: #4f5567}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--border-medium);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:var(--text-muted)}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html,body{width:100%;height:100%;overflow:hidden}body{position:fixed;top:0;right:0;bottom:0;left:0;font-family:var(--font-sans);background-color:var(--bg-app);color:var(--text-primary);line-height:1.5;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;height:100dvh;min-height:0;overflow-x:hidden}button,input,select,textarea{font-family:inherit}button{cursor:pointer;border:none;background:none}a{color:inherit;text-decoration:none}:focus-visible{outline:2px solid var(--color-info, #60a5fa);outline-offset:2px}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}.app-container{display:flex;height:calc(100vh - var(--math-keyboard-height, 0px));height:calc(100dvh - var(--math-keyboard-height, 0px));width:100vw;overflow:hidden;background-color:var(--bg-app)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.sidebar{width:440px;min-width:360px;max-width:500px;background-color:var(--bg-sidebar);border-right:1px solid var(--border-subtle);display:flex;flex-direction:column;height:100%;overflow-y:auto;box-shadow:var(--shadow-panel);z-index:10}.sidebar-content{padding:24px 28px;display:flex;flex-direction:column;gap:22px;flex:1}.app-credits{margin-top:auto;padding:14px 16px 12px;border:1px solid var(--border-subtle);border-radius:12px;background:linear-gradient(145deg,color-mix(in srgb,var(--color-surface-f) 6%,var(--bg-sidebar)),var(--bg-sidebar) 75%);color:var(--text-secondary);font-size:11px;line-height:1.5;overflow-wrap:anywhere}.credits-heading{display:flex;align-items:center;gap:6px;margin-bottom:10px;font-size:10px;font-weight:600;letter-spacing:.08em;text-transform:uppercase}.credits-accent{width:5px;height:5px;border-radius:50%;background:var(--color-surface-f)}.credits-person{margin:0 0 10px}.credits-links{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.credits-role{display:block;font-size:10px;margin-bottom:2px}.credits-person strong{display:block;font-size:12px;font-weight:600;letter-spacing:-.01em;color:var(--text-primary)}.app-credits a{display:inline-flex;align-items:center;gap:5px;min-height:28px;color:var(--text-secondary);text-decoration:none;border-radius:5px;transition:color .16s ease,background .16s ease}.app-credits a:hover{color:var(--text-primary);background:var(--bg-surface-elevated)}.app-credits a:focus-visible{outline:2px solid var(--color-surface-f);outline-offset:3px}.credits-bottom{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;border-top:1px solid var(--border-subtle);padding-top:7px}.app-credits .credits-license{min-height:24px;padding:0 7px;border:1px solid var(--border-subtle);font-size:9px;font-weight:600;letter-spacing:.03em}.credits-license-note{display:block;margin-top:4px;font-size:9px}.app-header{margin-bottom:4px}.header-brand-row{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}.brand-identity{display:flex;align-items:center;gap:10px}.brand-logo-container{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:var(--radius-md);background:var(--bg-surface-elevated);border:1px solid var(--border-subtle);flex-shrink:0;box-shadow:0 2px 6px #00000040}.brand-text{display:flex;flex-direction:column}.app-title{font-size:1.25rem;font-weight:700;letter-spacing:-.02em;color:var(--text-primary);margin:0;line-height:1.2}.app-subtitle{font-size:.76rem;color:var(--text-secondary);font-weight:400;margin:0;line-height:1.3}.header-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.header-btn{display:inline-flex;align-items:center;gap:5px;font-size:.75rem;color:var(--text-secondary);padding:5px 8px;border-radius:var(--radius-sm);background:var(--bg-surface-elevated);border:1px solid var(--border-subtle);transition:all .15s ease;cursor:pointer;white-space:nowrap}.header-btn:hover{color:var(--text-primary);border-color:var(--border-medium);background:var(--bg-input-focus)}.header-btn-label{font-size:.74rem}.history-count-badge{font-size:.65rem;font-weight:700;padding:1px 5px;background:#5b8ec740;color:#93c5fd;border-radius:999px;margin-left:2px}.version-badge{font-size:.7rem;padding:3px 8px;background:#5b8ec726;color:#7eb3ea;border:1px solid rgba(91,142,199,.3);border-radius:999px;font-family:var(--font-mono);font-weight:500}.form-section{display:flex;flex-direction:column;gap:8px}.section-label-row{display:flex;justify-content:space-between;align-items:center}.section-label{display:flex;align-items:center;gap:6px;font-size:.85rem;font-weight:500;color:var(--text-secondary)}.surface-indicator-dot{width:8px;height:8px;border-radius:50%;display:inline-block}.surface-indicator-dot.surface-f{background-color:var(--color-surface-f);box-shadow:0 0 6px #5b8ec766}.surface-indicator-dot.surface-g{background-color:var(--color-surface-g);box-shadow:0 0 6px #8e95a566}.diagnostic-badge{font-size:.72rem;color:#f87171;font-family:var(--font-mono);font-weight:500}.input-container{display:flex;align-items:center;background-color:var(--bg-input);border:1px solid var(--border-subtle);border-radius:var(--radius-md);padding:4px 10px;transition:border-color .2s ease,box-shadow .2s ease,background-color .2s ease}.input-container:focus-within,.input-container.is-focused{border-color:var(--border-focus);background-color:var(--bg-input-focus);box-shadow:0 0 0 1px var(--border-focus)}.input-container.is-invalid{border-color:#f87171!important;background-color:#f871710d}.input-error-message{font-size:.75rem;color:#f87171;margin-top:4px;line-height:1.3}math-field.intersect-mathfield{flex:1;background:transparent;color:var(--text-primary);font-size:1.15rem;padding:8px 4px;border:none;outline:none;width:100%;min-height:38px;--selection-background-color: rgba(91, 142, 199, .35);--caret-color: #f2f3f7;--hue: 212}math-field.intersect-mathfield:focus,math-field.intersect-mathfield:focus-within{outline:none}math-field.intersect-mathfield::part(virtual-keyboard-toggle),math-field.intersect-mathfield::part(menu-toggle){display:none!important}.math-text-input{flex:1;background:transparent;border:none;color:var(--text-primary);font-size:1.05rem;font-family:var(--font-mono);padding:10px 4px;outline:none}.math-text-input::placeholder{color:var(--text-muted)}.keyboard-icon-btn{color:var(--text-muted);display:flex;align-items:center;justify-content:center;padding:6px;border-radius:var(--radius-sm);transition:all .15s ease;border:1px solid transparent;flex-shrink:0}.keyboard-icon-btn:hover{color:var(--text-primary);background:var(--bg-surface-elevated)}.keyboard-icon-btn.is-active{color:#7eb3ea;background:#5b8ec72e;border-color:#5b8ec759}.provisional-note{font-size:.72rem;color:var(--text-muted);line-height:1.3}.draft-dirty-notice{display:flex;align-items:center;gap:6px;font-size:.74rem;color:#fbbf24;background:#fbbf241a;border:1px solid rgba(251,191,36,.25);border-radius:var(--radius-sm);padding:5px 8px;margin-bottom:8px;line-height:1.3}.draft-dirty-notice .dirty-indicator{font-size:.65rem;color:#fbbf24}.curve-card.is-stale-draft{border-color:#fbbf244d}.direction-group{display:flex;flex-direction:column;gap:8px}.direction-buttons{display:grid;grid-template-columns:1fr 1fr;background:var(--bg-input);border:1px solid var(--border-subtle);border-radius:var(--radius-md);padding:3px;gap:4px}.direction-btn{display:inline-flex;align-items:center;justify-content:center;padding:8px 12px;font-size:.84rem;font-weight:500;color:var(--text-secondary);border-radius:var(--radius-sm);background:transparent;border:1px solid transparent;cursor:pointer;transition:all .18s cubic-bezier(.16,1,.3,1);text-align:center}.direction-btn:hover:not(:disabled){color:var(--text-primary);background:#ffffff0a}.direction-btn.active{background:var(--bg-surface-elevated);color:var(--text-primary);border-color:var(--border-medium);font-weight:600;box-shadow:0 1px 4px #00000040}.direction-subtext{font-size:.75rem;color:var(--text-muted)}.calculation-actions{display:flex;gap:8px;align-items:center;margin-top:4px}.calculate-btn{flex:1;background-color:var(--btn-primary-bg);color:var(--btn-primary-text);font-weight:600;font-size:.95rem;padding:13px 20px;border-radius:var(--radius-md);text-align:center;box-shadow:0 2px 8px #00000040;transition:all .2s ease}.calculate-btn:hover:not(:disabled){background-color:var(--btn-primary-hover);transform:translateY(-1px);box-shadow:0 4px 12px #ffffff1a}.calculate-btn:disabled{opacity:.6;cursor:not-allowed;transform:none}.calculate-btn:active:not(:disabled){transform:translateY(0)}.auto-calculating-indicator{flex:1;display:flex;align-items:center;gap:8px;font-size:.85rem;color:var(--text-muted);padding:8px 12px;background:var(--bg-surface-elevated);border:1px solid var(--border-subtle);border-radius:var(--radius-md)}.spinner-dot{width:8px;height:8px;border-radius:50%;background-color:var(--accent-primary);animation:pulse-dot 1.2s ease-in-out infinite}@keyframes pulse-dot{0%,to{transform:scale(.8);opacity:.5}50%{transform:scale(1.3);opacity:1}}.cancel-btn{background-color:#ef444426;color:#f87171;border:1px solid rgba(239,68,68,.3);font-weight:600;font-size:.9rem;padding:12px 18px;border-radius:var(--radius-md);transition:all .2s ease}.cancel-btn:hover{background-color:#ef444440;border-color:#ef444480}.retry-btn{background-color:#5b8ec726;color:#93c5fd;border:1px solid rgba(91,142,199,.35);font-weight:500;font-size:.8rem;padding:6px 12px;border-radius:var(--radius-sm);margin-top:8px;transition:all .2s ease}.retry-btn:hover{background-color:#5b8ec740;border-color:#5b8ec799}.v1-status-box{background:#5b8ec714;border:1px solid rgba(91,142,199,.2);border-radius:var(--radius-md);padding:12px 14px;font-size:.78rem;color:#c7d2e9;line-height:1.45}.v1-status-box strong{color:#e2e8f0}.result-section{display:flex;flex-direction:column;gap:10px;margin-top:4px}.curve-header{display:flex;align-items:center;justify-content:space-between;gap:10px;position:relative}.curve-header-left{display:flex;align-items:center;gap:8px;position:relative}.curve-swatch-wrapper{display:flex;align-items:center;gap:4px;position:relative}.curve-swatch-btn{width:16px;height:16px;border-radius:50%;border:1px solid rgba(255,255,255,.25);box-shadow:0 0 8px #f5eedb59;cursor:pointer;padding:0;display:inline-block;transition:transform .15s ease,box-shadow .15s ease}.curve-swatch-btn:hover{transform:scale(1.15);box-shadow:0 0 12px #ffffff80}.curve-swatch-btn:focus-visible{outline:2px solid #5b8ec7;outline-offset:2px}.curve-color-edit-icon-btn{background:transparent;border:none;color:var(--text-muted);cursor:pointer;padding:3px;border-radius:4px;display:flex;align-items:center;justify-content:center;transition:color .15s ease,background-color .15s ease}.curve-color-edit-icon-btn:hover{color:var(--text-primary);background-color:#ffffff14}.curve-color-edit-icon-btn:focus-visible{outline:2px solid #5b8ec7;outline-offset:1px}.color-editor-popover{position:absolute;top:calc(100% + 8px);left:0;z-index:60;background:#141722;border:1px solid rgba(255,255,255,.16);border-radius:var(--radius-md);padding:14px;width:228px;box-shadow:0 12px 28px #000000a6,0 0 0 1px #ffffff0d;-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);display:flex;flex-direction:column;animation:popoverFadeIn .15s ease-out}@keyframes popoverFadeIn{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.color-editor-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.color-editor-title{font-size:.82rem;font-weight:600;color:#e2e8f0;letter-spacing:.02em}.color-editor-close-btn{background:transparent;border:none;color:#94a3b8;font-size:1.15rem;line-height:1;cursor:pointer;padding:0 4px;border-radius:3px;transition:color .15s ease}.color-editor-close-btn:hover{color:#fff}.color-editor-close-btn:focus-visible{outline:2px solid #5b8ec7}.color-swatches-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:12px}.color-swatch-item{width:100%;aspect-ratio:1;border-radius:5px;border:1px solid rgba(255,255,255,.14);cursor:pointer;padding:0;display:flex;align-items:center;justify-content:center;box-shadow:0 1px 3px #0000004d;transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease}.color-swatch-item:hover{transform:scale(1.08);border-color:#fff6}.color-swatch-item.is-selected{outline:2px solid #ffffff;outline-offset:1px;box-shadow:0 0 10px #ffffff80}.color-swatch-item:focus-visible{outline:2px solid #5b8ec7;outline-offset:2px}.swatch-check-icon{width:14px;height:14px;filter:drop-shadow(0 1px 2px rgba(0,0,0,.4))}.color-custom-row{display:flex;align-items:center;gap:8px;margin-bottom:8px}.color-custom-preview{width:26px;height:26px;border-radius:4px;border:1px solid rgba(255,255,255,.22);flex-shrink:0;box-shadow:0 1px 3px #0000004d}.color-input-wrapper{flex:1}.color-hex-input{width:100%;background:#0d0f17;border:1px solid rgba(255,255,255,.14);border-radius:4px;color:#f8fafc;font-family:var(--font-mono);font-size:.8rem;padding:5px 8px;box-sizing:border-box;transition:border-color .15s ease}.color-hex-input:focus{outline:none;border-color:#5b8ec7;box-shadow:0 0 0 1px #5b8ec7}.color-hex-input.is-invalid{border-color:#f87171}.color-error-text{font-size:.72rem;color:#f87171;margin-bottom:8px}.color-editor-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:4px}.color-action-btn{padding:5px 12px;font-size:.76rem;font-weight:500;border-radius:4px;cursor:pointer;border:none;transition:all .15s ease}.color-action-btn.cancel{background:#ffffff14;color:#94a3b8}.color-action-btn.cancel:hover{background:#ffffff24;color:#fff}.color-action-btn.apply{background:#5b8ec7;color:#fff}.color-action-btn.apply:hover{background:#4a82b8}.color-action-btn:focus-visible{outline:2px solid #5b8ec7;outline-offset:1px}.curve-label{font-size:.86rem;font-weight:500;color:var(--text-secondary)}.curve-card{background:var(--bg-surface);border:1px solid var(--border-subtle);border-radius:var(--radius-md);padding:16px;display:flex;flex-direction:column;gap:12px}.curve-formula-box{display:flex;flex-direction:column;gap:6px;font-family:var(--font-mono);overflow-x:auto;max-width:100%;padding-bottom:2px}.curve-equation{font-size:1.02rem;color:var(--text-primary);font-weight:500;white-space:nowrap}.curve-domain{font-size:.88rem;color:var(--text-secondary);white-space:nowrap}.curve-badges-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.direction-badge{font-size:.68rem;font-family:var(--font-sans);font-weight:600;text-transform:uppercase;letter-spacing:.04em;padding:2px 7px;border-radius:4px}.direction-badge-forward{background:#5b8ec726;color:#7eb3ea;border:1px solid rgba(91,142,199,.3)}.direction-badge-reverse{background:#a855f726;color:#c084fc;border:1px solid rgba(168,85,247,.35)}.traversal-meta-note{font-size:.72rem;color:var(--text-muted);font-family:var(--font-mono)}.example-tag{display:inline-block;font-size:.68rem;font-family:var(--font-sans);text-transform:uppercase;letter-spacing:.04em;padding:2px 7px;background:#fbbf241f;color:#fbbf24;border:1px solid rgba(251,191,36,.25);border-radius:4px;margin-bottom:4px;width:fit-content}.derivation-container{border-top:1px solid var(--border-subtle);padding-top:10px}.derivation-toggle-btn{display:flex;justify-content:space-between;align-items:center;width:100%;font-size:.8rem;color:var(--text-muted);transition:color .15s ease,background-color .15s ease;padding:6px 8px;border-radius:var(--radius-sm);background:transparent;cursor:pointer;border:1px solid transparent}.derivation-toggle-btn:hover{color:var(--text-secondary);background:#ffffff08}.derivation-toggle-btn:focus-visible{outline:2px solid var(--border-focus);outline-offset:1px}.derivation-content{margin-top:10px;padding:10px 12px;background:var(--bg-input);border-radius:var(--radius-sm);font-size:.78rem;color:var(--text-secondary);line-height:1.5;display:flex;flex-direction:column;gap:10px}.derivation-step-item{border-bottom:1px solid var(--border-subtle);padding-bottom:8px;display:flex;flex-direction:column;gap:4px}.derivation-step-item:last-child{border-bottom:none;padding-bottom:0}.step-number-badge{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;min-width:20px;border-radius:50%;background:#5b8ec733;border:1px solid rgba(91,142,199,.4);color:#93c5fd;font-size:.72rem;font-weight:700;line-height:1;flex-shrink:0}.derivation-step-formula{font-family:var(--font-mono);background:#00000040;border-radius:4px;padding:4px 8px;overflow-x:auto;max-width:100%;color:var(--text-primary);white-space:nowrap}.derivation-step-conditions{font-size:.72rem;color:var(--text-muted);font-style:italic}.reversal-step-badge{font-size:.65rem;font-family:var(--font-sans);text-transform:uppercase;letter-spacing:.04em;padding:1px 5px;border-radius:3px;background:#a855f733;color:#c084fc;border:1px solid rgba(168,85,247,.4);margin-left:6px;vertical-align:middle}.proof-scope-badge{font-size:.68rem;font-family:var(--font-sans);font-weight:600;text-transform:uppercase;letter-spacing:.04em;padding:2px 6px;border-radius:4px}.scope-global{background:#ef444426;color:#f87171;border:1px solid rgba(239,68,68,.3)}.scope-bounded{background:#f59e0b26;color:#fbbf24;border:1px solid rgba(245,158,11,.3)}.history-section{margin-top:auto;border-top:1px solid var(--border-subtle);padding-top:14px;display:flex;flex-direction:column;gap:8px}.history-header{font-size:.82rem;font-weight:500;color:var(--text-muted)}.history-card{background:var(--bg-surface);border:1px solid var(--border-subtle);border-radius:var(--radius-md);padding:12px 14px;display:flex;justify-content:space-between;align-items:center;font-size:.78rem;color:var(--text-secondary)}.history-item-left{display:flex;flex-direction:column;gap:2px;font-family:var(--font-mono)}.history-item-right{font-size:.7rem;color:var(--text-muted)}.graph-viewport-container{flex:1;position:relative;background-color:var(--bg-app);display:flex;flex-direction:column;overflow:hidden}.graph-canvas-area{flex:1;display:block;position:relative;width:100%;height:100%;overflow:hidden}.three-viewport-canvas{width:100%!important;height:100%!important;display:block;outline:none;touch-action:none}.graph-controls-overlay{position:absolute;top:16px;right:20px;z-index:10;display:flex;gap:8px}.graph-control-btn{background:#141721c7;border:1px solid rgba(255,255,255,.14);color:#cdd4e5;font-size:.8rem;font-weight:500;padding:7px 14px;border-radius:var(--radius-sm);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);cursor:pointer;box-shadow:0 2px 8px #00000059;transition:all .2s ease}.graph-control-btn:hover{background:#202434eb;color:#fff;border-color:#ffffff47;transform:translateY(-1px)}.graph-control-btn:focus-visible{outline:2px solid #5b8ec7;outline-offset:2px}.graph-control-btn.playback-btn{display:flex;align-items:center;gap:6px}.graph-control-btn.playback-btn .btn-icon{font-size:.85rem;line-height:1}.graph-control-btn.playback-btn.playing{color:#8ab4f8;border-color:#5b8ec773}.graph-control-btn.playback-btn.paused{color:#fbbf24;border-color:#fbbf2473}.graph-control-btn.playback-btn.finished{color:#cdd4e5}.graph-status-pill{position:absolute;top:16px;left:20px;z-index:10;display:flex;align-items:center;gap:8px;font-size:.76rem;padding:6px 14px;border-radius:9999px;background:#12141cd9;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border:1px solid rgba(255,255,255,.12);color:#c7d2e9;box-shadow:0 2px 8px #0000004d}.graph-status-pill.warning{border-color:#f59e0b66;color:#fbbf24}.graph-status-pill.info{border-color:#5b8ec766;color:#93c5fd}.pill-dot{width:7px;height:7px;border-radius:50%;display:inline-block}.warning-dot{background-color:#f59e0b}.graph-spinner{width:12px;height:12px;border:2px solid rgba(91,142,199,.25);border-top-color:#5b8ec7;border-radius:50%;animation:spin .8s linear infinite;display:inline-block}.graph-fallback-card{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);max-width:440px;padding:28px 24px;text-align:center;background:#141620eb;border:1px solid rgba(239,68,68,.35);border-radius:var(--radius-lg);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);box-shadow:var(--shadow-subtle);z-index:10}.graph-fallback-card .graph-status-title{color:#fca5a5;margin-bottom:8px}.graph-legend-bar{display:flex;align-items:center;justify-content:center;gap:28px;padding:16px 24px;background:#0c0d12d9;border-top:1px solid var(--border-subtle);z-index:3}.legend-item{display:flex;align-items:center;gap:8px;font-size:.78rem;color:var(--text-secondary)}.legend-swatch{width:10px;height:10px;border-radius:50%;flex-shrink:0}.legend-swatch.surface-f{background-color:var(--color-surface-f)}.legend-swatch.surface-g{background-color:var(--color-surface-g)}.legend-swatch.curve{background-color:var(--color-curve);box-shadow:0 0 6px #f5eedb66}.legend-math{font-family:var(--font-mono);color:var(--text-primary);margin-left:2px}.modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#000000bf;display:flex;align-items:center;justify-content:center;z-index:100;padding:20px;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.modal-content{background:var(--bg-sidebar);border:1px solid var(--border-medium);border-radius:var(--radius-lg);width:100%;max-width:680px;max-height:85vh;display:flex;flex-direction:column;box-shadow:0 20px 40px #0009}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid var(--border-subtle)}.modal-title{font-size:1rem;font-weight:600;color:var(--text-primary)}.modal-close-btn{font-size:1.2rem;color:var(--text-secondary);padding:4px 8px;border-radius:var(--radius-sm)}.modal-close-btn:hover{color:var(--text-primary);background:var(--bg-surface)}.modal-body{padding:20px;overflow-y:auto;display:flex;flex-direction:column;gap:16px}.contract-code-block{background:var(--bg-app);border:1px solid var(--border-subtle);border-radius:var(--radius-md);padding:14px;font-family:var(--font-mono);font-size:.75rem;color:#a5b4fc;overflow-x:auto;line-height:1.45}.geom-diagnostics-box{display:flex;flex-direction:column;gap:10px;width:100%;max-width:440px;background:#0f111ab3;border:1px solid var(--border-subtle);border-radius:var(--radius-md);padding:12px 16px;text-align:left}.geom-diagnostics-header{display:flex;align-items:center;justify-content:space-between;font-size:.78rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--text-secondary)}.geom-status-badge{font-size:.7rem;padding:2px 8px;border-radius:var(--radius-sm);font-weight:500}.geom-status-ready{background:#10b98126;color:#34d399;border:1px solid rgba(16,185,129,.3)}.geom-status-generating{background:#3b82f626;color:#60a5fa;border:1px solid rgba(59,130,246,.3);animation:pulse-soft 1.5s ease-in-out infinite}.geom-diagnostics-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.geom-stat-card{display:flex;flex-direction:column;gap:2px;background:var(--bg-surface);border:1px solid var(--border-subtle);border-radius:var(--radius-sm);padding:8px 10px}.geom-stat-title{font-size:.68rem;font-weight:600;color:var(--text-muted)}.geom-stat-value{font-family:var(--font-mono);font-size:.8rem;font-weight:500;color:var(--text-primary)}.geom-stat-sub{font-size:.65rem;color:var(--text-secondary)}.geom-diagnostics-footer{display:flex;justify-content:space-between;font-size:.7rem;color:var(--text-muted);font-family:var(--font-mono);border-top:1px solid var(--border-subtle);padding-top:6px;margin-top:2px}@media(max-width:900px){.app-container{display:flex;flex-direction:column;height:calc(100vh - var(--math-keyboard-height, 0px));height:calc(100dvh - var(--math-keyboard-height, 0px));overflow-y:auto;overflow-x:hidden}.graph-viewport-container{order:1;width:100%;height:44vh;min-height:280px;max-height:420px;flex:none;position:relative;border-bottom:1px solid var(--border-subtle)}.sidebar{order:2;width:100%;max-width:100%;min-width:unset;height:auto;flex:1;border-right:none;border-top:none;overflow-y:visible}.sidebar-content{padding:16px 18px 32px;gap:16px}.graph-legend-bar{flex-wrap:wrap;gap:8px 14px;padding:8px 12px;font-size:.72rem}}.history-drawer-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#000000a6;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);z-index:90;display:flex;justify-content:flex-start;animation:overlayFadeIn .2s ease-out}@keyframes overlayFadeIn{0%{opacity:0}to{opacity:1}}.history-drawer-panel{width:380px;max-width:88vw;height:100vh;background:#13141b;border-right:1px solid var(--border-medium);box-shadow:10px 0 30px #000000b3;display:flex;flex-direction:column;animation:drawerSlideIn .22s cubic-bezier(.16,1,.3,1);overflow:hidden;z-index:95}@keyframes drawerSlideIn{0%{transform:translate(-100%)}to{transform:translate(0)}}.history-drawer-header{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid var(--border-subtle);background:var(--bg-surface)}.history-header-title-row{display:flex;align-items:center;gap:10px}.history-drawer-title{font-size:1.1rem;font-weight:600;color:var(--text-primary);margin:0}.history-count-badge{font-size:.72rem;font-weight:600;padding:2px 7px;background:#5b8ec729;color:#7eb3ea;border:1px solid rgba(91,142,199,.3);border-radius:999px;font-family:var(--font-mono)}.history-header-actions{display:flex;align-items:center;gap:10px}.history-clear-btn{font-size:.76rem;color:var(--text-muted);background:transparent;border:1px solid var(--border-subtle);border-radius:var(--radius-sm);padding:4px 8px;cursor:pointer;transition:all .15s ease}.history-clear-btn:hover{color:#f87171;border-color:#f8717166;background:#f8717114}.history-clear-btn.confirming{color:#fff;background:#ef4444;border-color:#ef4444;font-weight:600}.history-drawer-close-btn{background:transparent;border:none;font-size:1.4rem;line-height:1;color:var(--text-muted);cursor:pointer;padding:2px 6px;border-radius:var(--radius-sm);transition:color .15s ease}.history-drawer-close-btn:hover{color:var(--text-primary)}.history-status-banner{padding:8px 16px;font-size:.75rem;line-height:1.4;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--border-subtle)}.history-status-banner.warning{background:#fbbf241f;color:#fbbf24;border-color:#fbbf2440}.history-status-banner.error{background:#f871711f;color:#f87171;border-color:#f8717140}.banner-dismiss-btn{background:transparent;border:none;color:inherit;font-size:1.1rem;cursor:pointer;padding:0 4px}.history-empty-state{padding:40px 24px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:8px}.history-empty-title{font-size:.95rem;font-weight:500;color:var(--text-secondary);margin:0}.history-empty-subtitle{font-size:.78rem;color:var(--text-muted);line-height:1.45;margin:0;max-width:280px}.history-items-list{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:8px}.history-card-item{display:flex;align-items:stretch;background:var(--bg-surface);border:1px solid var(--border-subtle);border-radius:var(--radius-md);transition:all .15s ease;position:relative;overflow:hidden}.history-card-item:hover{border-color:var(--border-medium);background:var(--bg-surface-elevated)}.history-card-item.is-active{border-color:#5b8ec78c;box-shadow:0 0 0 1px #5b8ec759}.history-card-item.is-corrupt{border-color:#f871714d}.history-card-main-btn{flex:1;display:flex;flex-direction:column;gap:8px;padding:10px 12px;background:transparent;border:none;text-align:left;cursor:pointer;color:inherit}.history-card-top-row{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;width:100%}.history-equations-col{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}.history-eq-line{font-family:var(--font-mono);font-size:.8rem;color:var(--text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.history-eq-line .eq-label{color:var(--text-muted);font-size:.72rem;margin-right:2px}.history-eq-line.f-line .eq-label{color:var(--color-surface-f)}.history-eq-line.g-line .eq-label{color:var(--color-surface-g)}.history-color-swatch-circle{width:12px;height:12px;border-radius:50%;border:1px solid rgba(255,255,255,.35);flex-shrink:0;margin-top:3px;box-shadow:0 0 4px #0006}.history-card-meta-row{display:flex;justify-content:space-between;align-items:center;width:100%}.history-badges-group{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.hist-status-badge{font-size:.65rem;font-weight:600;text-transform:uppercase;letter-spacing:.03em;padding:1px 5px;border-radius:3px}.hist-status-badge.verified{background:#4ade8026;color:#4ade80;border:1px solid rgba(74,222,128,.3)}.hist-status-badge.empty{background:#94a3b826;color:#94a3b8;border:1px solid rgba(148,163,184,.3)}.hist-status-badge.degenerate{background:#fbbf2426;color:#fbbf24;border:1px solid rgba(251,191,36,.3)}.hist-status-badge.inconclusive{background:#f8717126;color:#f87171;border:1px solid rgba(248,113,113,.3)}.hist-status-badge.corrupt{background:#ef444433;color:#ef4444;border:1px solid rgba(239,68,68,.4)}.hist-direction-badge{font-size:.65rem;font-weight:600;text-transform:uppercase;color:var(--text-muted);background:#ffffff0f;padding:1px 4px;border-radius:3px}.hist-active-pill{font-size:.62rem;font-weight:600;text-transform:uppercase;background:#5b8ec7;color:#fff;padding:1px 5px;border-radius:3px}.history-timestamp{font-size:.7rem;color:var(--text-muted)}.history-row-delete-btn{background:transparent;border:none;border-left:1px solid var(--border-subtle);color:var(--text-muted);padding:0 10px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s ease}.history-row-delete-btn:hover{color:#f87171;background:#f871711a}.history-row-delete-btn:focus-visible{outline:2px solid #f87171;outline-offset:-2px}math-field.intersect-mathfield,math-field.result-math-field{min-width:0;max-width:100%;width:100%;touch-action:pan-x}math-field.intersect-mathfield::part(container),math-field.result-math-field::part(container){min-width:0;pointer-events:auto;touch-action:pan-x}math-field.intersect-mathfield::part(content),math-field.result-math-field::part(content){overflow-x:auto;overflow-y:hidden;touch-action:pan-x;scrollbar-width:thin;scrollbar-color:var(--border-subtle) transparent}math-field.result-math-field::part(virtual-keyboard-toggle),math-field.result-math-field::part(menu-toggle){display:none}.curve-equation,.curve-domain,.derivation-step-formula{min-width:0;max-width:100%;overflow-x:auto;touch-action:pan-x;scrollbar-width:thin}math-field.result-math-field{width:max-content;min-width:100%;max-width:none}math-field.result-math-field::part(content){overflow:visible}.math-keyboard-host{position:fixed;bottom:0;left:0;width:100%;height:0;z-index:1000;pointer-events:none;--keyboard-padding-bottom: env(safe-area-inset-bottom, 0px)}.math-keyboard-host>.ML__keyboard{position:fixed;top:0;right:0;bottom:0;left:0;height:100%}.math-keyboard-host .MLK__backdrop{height:calc(var(--_keyboard-height) + var(--_padding-top) + var(--_padding-bottom))}
