:root{color:#111;background:#f5f5f5;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}*{box-sizing:border-box}body{margin:0;background:radial-gradient(circle at top left,rgba(0,0,0,.06),transparent 28rem),#f5f5f5}button,input,textarea,select{font:inherit}.app-shell{min-height:0;padding:24px 32px 10px;max-width:1600px;margin:0 auto}.app-footer{display:flex;align-items:center;justify-content:center;gap:16px;padding:10px 20px 14px;color:#666;font-size:.88rem;font-weight:600;text-align:center}.footer-line{width:min(160px,18vw);height:1px;background:linear-gradient(90deg,transparent,#d4d4d4,transparent)}.footer-credit{display:inline-flex;align-items:center;gap:4px;border:1px solid #e5e7eb;border-radius:999px;padding:6px 12px;background:#ffffffb8;box-shadow:0 12px 32px #0000000f}.footer-credit strong{color:#111}.notification-stack{position:fixed;top:80px;right:24px;z-index:200;width:min(520px,calc(100vw - 32px))}.notification-card{display:grid;gap:10px;border:1px solid #d4d4d4;border-radius:18px;padding:14px 16px;background:#fff;box-shadow:0 22px 60px #00000029}.notification-card.error{border-color:#fecaca;color:#7f1d1d;background:#fff7f7}.notification-card.warning{border-color:#fde68a;color:#78350f;background:#fffbeb}.notification-card.info{border-color:#bfdbfe;color:#1e3a8a;background:#eff6ff}.notification-header{display:flex;align-items:center;justify-content:space-between;gap:12px}.notification-card p{margin:0;line-height:1.45;font-size:.92rem}.notification-close{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border:1px solid rgba(127,29,29,.18);border-radius:999px;padding:0;color:inherit;background:#ffffffb8;font-size:1.15rem;line-height:1}.notification-details{border-top:1px solid rgba(127,29,29,.14);padding-top:8px;font-size:.82rem}.notification-details summary{cursor:pointer;font-weight:700}.notification-details ul{margin:8px 0 0;padding-left:18px}.notification-details li+li{margin-top:4px}.global-header{display:flex;align-items:center;justify-content:space-between;padding:0 24px;height:64px;background:#fff;border-bottom:1px solid #e5e7eb;position:sticky;top:0;z-index:100;box-shadow:0 1px 2px #00000005}.header-left{display:flex;align-items:center;gap:12px}.header-logo{width:40px;height:40px;border-radius:8px;object-fit:cover;box-shadow:0 2px 8px #0000000f}.header-titles{display:flex;flex-direction:column;justify-content:center;gap:2px}.header-title{margin:0;font-size:16px;font-weight:700;color:#1e1b4b;line-height:1.2}.header-subtitle{font-size:12px;color:#6b7280;font-weight:500;line-height:1}.header-nav{display:flex;align-items:stretch;height:100%}.nav-item{display:flex;align-items:center;gap:8px;padding:0 16px;border:none;border-radius:0;color:#374151;background:transparent;font-size:14px;font-weight:600;text-decoration:none;height:100%;position:relative;transition:color .15s}.nav-item:after{content:"";position:absolute;left:16px;right:16px;bottom:14px;height:2px;background-color:currentColor;border-radius:999px;transform:scaleX(0);transform-origin:left center;transition:transform .2s ease}.nav-item:hover{color:#111}.nav-item:hover:after{transform:scaleX(1)}.nav-item.active{color:#111}.nav-item.active:after{transform:scaleX(1)}.nav-item svg{margin-top:-1px}.workspace{display:grid;grid-template-columns:minmax(320px,380px) 1fr;gap:24px;align-items:start}.workspace>.problem-form{position:sticky;top:88px;max-height:calc(100vh - 112px);overflow-y:auto;overscroll-behavior:contain}.panel,.viewer-card,.empty-state,.error-box,.warning-box{border:1px solid #d4d4d4;border-radius:20px;background:#fffffff0;box-shadow:0 22px 60px #00000014}.panel{padding:18px}.panel-title,.viewer-header{margin-bottom:12px;color:#111;font-weight:600;font-size:1rem}.problem-form{display:flex;flex-direction:column;gap:14px}.textarea-wrap{position:relative}.textarea-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:10;border-radius:14px;background:#f5f5f5c7;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;pointer-events:all}.textarea-overlay-text{color:#111;font-weight:800;font-size:.98rem}.spinner-overlay{width:26px;height:26px}.spinner-overlay.spinner{animation-duration:.7s}.ocr-dropzone textarea{transition:border-color .16s ease,box-shadow .16s ease,background .16s ease}.ocr-dropzone.empty textarea{cursor:pointer}.ocr-dropzone.drag-active textarea{border-color:#2563eb;background:#eff6ff;box-shadow:0 0 0 3px #2563eb29}.hidden-file-input{display:none}.ocr-empty-hint,.ocr-status,.ocr-error{position:absolute;left:12px;right:12px;bottom:10px;font-size:.78rem;font-weight:600;pointer-events:none}.ocr-empty-hint{color:#737373}.ocr-status{color:#2563eb}.ocr-error{color:#b91c1c}.ocr-dropzone.empty .char-counter,.ocr-status+.char-counter,.ocr-error+.char-counter{display:none}textarea,input,select{width:100%;border:1px solid #c7c7c7;border-radius:14px;padding:12px;color:#111;background:#fff;outline:none;transition:border-color .16s ease,box-shadow .16s ease}textarea:focus,input:focus,select:focus{border-color:#111;box-shadow:0 0 0 3px #00000014}textarea{resize:vertical;min-height:180px;padding-bottom:34px;line-height:1.55}.char-counter{position:absolute;right:12px;bottom:10px;color:#737373;font-size:.75rem;font-weight:500;pointer-events:none}.field-label{display:grid;gap:8px;color:#333;font-weight:600;font-size:.95rem}.field-hint{margin:0;color:#666;font-size:.9rem;font-weight:500;line-height:1.5}.advanced-settings{display:grid;gap:24px;padding:18px;border:1px solid #d4d4d4;border-radius:14px;background:#fafafa}.advanced-settings:not([open]){gap:0;padding:12px 16px}.advanced-settings[open]{display:grid}.advanced-settings summary,.json-panel summary{cursor:pointer;color:#111;font-weight:600;font-size:.95rem}.advanced-settings select{font-size:.85rem;padding:11px 12px;border-radius:10px}.advanced-settings .field-label{gap:12px}.advanced-settings>.field-label+.field-label{margin-top:8px}.advanced-settings .checkbox-label{margin-top:6px}.advanced-settings>.checkbox-label+.checkbox-label{margin-top:2px}.checkbox-label{display:flex;align-items:center;gap:10px;color:#333;font-weight:500;font-size:.9rem}.checkbox-label input{width:auto;accent-color:#111111}button{cursor:pointer;border:1px solid #111111;border-radius:14px;padding:10px 14px;color:#fff;background:#111;font-weight:500;font-size:.95rem;transition:transform .14s ease,background .14s ease,color .14s ease,border-color .14s ease}button:not(:disabled):hover{transform:translateY(-1px)}button:disabled{cursor:not-allowed;border-color:#a3a3a3;color:#f5f5f5;background:#a3a3a3}.submit-button{display:inline-flex;align-items:center;justify-content:center;gap:10px}.submit-button-sticky{position:sticky;bottom:14px;z-index:30;width:100%;box-shadow:0 12px 28px #00000029}.spinner{width:20px;height:20px;animation:spin .8s linear infinite}.examples{display:grid;gap:10px;border:1px solid #d4d4d4;border-radius:14px;padding:14px 16px;background:#fafafa}.examples:not([open]){gap:0;padding:12px 16px}.examples-title{color:#333;font-size:.9rem;font-weight:600;cursor:pointer;list-style:none}.examples-title::-webkit-details-marker{display:none}.examples-title:before{content:"▸";display:inline-block;margin-right:8px;transition:transform .18s ease}.examples[open] .examples-title:before{transform:rotate(90deg)}.examples:not([open]) .example-card{display:none}.example-card{display:grid;gap:6px;grid-template-rows:auto auto 1fr;border:1px solid #d4d4d4;color:#111;background:#fff;text-align:left;width:100%;padding:14px 16px;align-content:start}.example-card:hover{border-color:#111;background:#f7f7f7}.example-tag{width:fit-content;border:1px solid #e5e5e5;border-radius:999px;padding:2px 8px;color:#555;font-size:.7rem;font-weight:600;letter-spacing:.04em;text-transform:uppercase}.example-title{font-weight:600;font-size:.95rem}.example-text{color:#666;font-size:.85rem;font-weight:400;line-height:1.45;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.result-area{min-width:0;display:flex;flex-direction:column;gap:12px}.render-stage{position:sticky;top:88px;align-self:stretch;width:100%}.viewer-card{overflow:hidden;display:flex;flex-direction:column}.viewer-header{padding:16px 20px 0;font-size:1.05rem}.viewer-header-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.viewer-controls{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap}.viewer-hint{color:#666;font-size:.86rem;font-weight:500}.viewer-toggle{border-color:#d4d4d4;border-radius:10px;padding:7px 10px;color:#111;background:#fff;font-size:.82rem;font-weight:700}.viewer-toggle:hover{border-color:#111;background:#f7f7f7}.three-view{width:100%;height:min(68vh,720px);min-height:520px}.three-canvas{width:100%!important;height:100%!important}.geogebra-view{width:100%;min-height:520px;display:flex;align-items:center;justify-content:center}.empty-state,.error-box,.warning-box{padding:18px}.empty-state{display:flex;align-items:center;justify-content:center;width:100%;min-height:600px;color:#111}.empty-state-content{display:grid;justify-items:center;gap:12px;max-width:420px;text-align:center}.empty-state-content h2{margin:0;font-size:1.35rem;letter-spacing:-.02em}.empty-state-content p{margin:0;color:#666;line-height:1.55}.empty-state-graphic{width:min(240px,70%);color:#111}.error-box{border-color:#fecaca;color:#7f1d1d;background:#fef2f2}.warning-box{border-color:#fde68a;color:#78350f;background:#fffbeb}.json-panel{margin-top:20px}.json-panel:not([open]){padding-top:12px;padding-bottom:12px}.render-editor-trigger{position:fixed;right:24px;z-index:170;border-color:#1111112e;background:#111111db;box-shadow:0 12px 32px #0000002e;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);touch-action:none;-webkit-user-select:none;user-select:none}.render-editor-trigger:hover{transform:translateY(-1px)}.scene-editor-layer{position:fixed;top:64px;right:0;bottom:0;left:0;z-index:180;background:#1111111f}.scene-editor-popover{position:fixed;top:84px;left:24px;z-index:181;width:min(720px,calc(100vw - 48px));max-height:calc(100vh - 108px);overflow:auto;border:1px solid #d4d4d4;border-radius:20px;background:#fffffffa;box-shadow:0 24px 80px #0000003d}.scene-editor-popover-header{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border-bottom:1px solid #e5e5e5;background:#fffffff5}.scene-editor-close{width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:0;font-size:1.2rem;line-height:1}.scene-editor-popover .scene-editor{border:none;border-radius:0;box-shadow:none}.scene-editor-popover .scene-editor-details{display:grid}.scene-editor-popover .scene-editor-summary{display:none}.scene-editor-popover .scene-editor-content{padding-top:0}.scene-editor{display:grid;gap:14px}.scene-editor-details{display:grid;gap:12px}.scene-editor-summary{display:flex;align-items:center;justify-content:space-between;gap:12px;color:#111;font-weight:700;cursor:pointer;list-style:none}.scene-editor-summary::-webkit-details-marker{display:none}.scene-editor-summary:before{content:"▸";color:#666;transition:transform .18s ease}.scene-editor-details[open] .scene-editor-summary:before{transform:rotate(90deg)}.scene-editor-summary span:first-child{margin-right:auto}.scene-editor-content{display:grid;gap:12px}.scene-editor .panel-title{margin-bottom:6px}.click-tool{display:grid;gap:8px;padding:12px;border:1px solid #e5e5e5;border-radius:14px;background:#fff}.tool-mode-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.tool-mode-button{display:grid;gap:4px;text-align:left;border:1px solid #d8dee9;border-radius:12px;background:#f8fbff;color:#1f2937;padding:10px;cursor:pointer}.tool-mode-button span{color:#64748b;font-size:.78rem;line-height:1.3}.tool-mode-button.active{border-color:#2563eb;background:#eff6ff;color:#1d4ed8}.tool-mode-button:disabled{cursor:not-allowed;opacity:.55}.editor-grid{display:grid;grid-template-columns:repeat(4,minmax(110px,1fr)) auto;gap:8px;align-items:end;padding:10px;border:1px solid #e5e5e5;border-radius:14px;background:#fafafa}.editor-grid .field-label{font-size:.8rem;gap:5px}.editor-grid input,.editor-grid select{min-height:36px;border-radius:10px;padding:7px 9px;font-size:.86rem}.editor-grid button{min-height:36px;padding:7px 10px;font-size:.86rem;white-space:nowrap}.compact-editor-grid,.placement-grid{grid-template-columns:minmax(180px,1fr) auto}.placement-grid button{grid-column:auto}.settings-page,.settings-layout{display:grid;gap:20px}.settings-tabs{display:flex;gap:10px;padding:6px;border:1px solid #d4d4d4;border-radius:18px;background:#fffffff0;width:fit-content}.settings-tab{border:1px solid transparent;border-radius:12px;padding:10px 16px;color:#374151;background:transparent;font-weight:700}.settings-tab:hover,.settings-tab.active{border-color:#111;color:#111;background:#f7f7f7}.settings-hero{width:100%}.settings-grid{display:grid;grid-template-columns:repeat(2,minmax(280px,1fr));gap:20px;align-items:stretch}.settings-grid-providers{grid-template-columns:1fr}.settings-grid-balanced{align-items:stretch}.settings-stack{display:grid;gap:20px;align-content:start}.settings-section{display:grid;gap:16px;height:100%}.settings-provider-header{display:grid;gap:8px}.settings-provider-header .panel-title,.settings-section .panel-title{margin-bottom:0}.settings-checkbox{margin-top:4px}.settings-notes{margin:0;padding-left:20px;color:#444;display:grid;gap:8px;line-height:1.5}.settings-reset{width:fit-content}.json-panel summary{margin-bottom:12px}.json-panel:not([open]) summary{margin-bottom:0}.json-actions{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:12px}.secondary-button{border-color:#d4d4d4;color:#111;background:#fff}.secondary-button:hover{border-color:#111;background:#f7f7f7}.link-button{width:fit-content;border:none;padding:0;color:#2563eb;background:transparent;text-align:left;font-weight:700}.model-search{margin-top:4px}.model-actions{display:flex;flex-wrap:wrap;gap:10px}.model-list{display:grid;gap:8px;max-height:460px;overflow:auto;padding-right:4px}.model-row{display:grid;grid-template-columns:auto 1fr;gap:10px;align-items:start;padding:10px;border:1px solid #e5e5e5;border-radius:12px;background:#fff}.model-row input{width:auto;margin-top:3px}.model-row span{display:grid;gap:4px;min-width:0}.model-row strong,.model-row small{overflow-wrap:anywhere}.model-row small{color:#666}pre{overflow:auto;max-height:360px;margin:0;border:1px solid #262626;border-radius:14px;padding:14px;background:#111;color:#f5f5f5;line-height:1.5}@keyframes spin{to{transform:rotate(360deg)}}@media (max-width: 900px){.app-shell{padding:16px 18px 8px}.workspace{grid-template-columns:1fr}.hero h1{font-size:clamp(30px,10vw,44px)}.three-view,.geogebra-view{min-height:400px}.settings-grid{grid-template-columns:1fr}.settings-stack{gap:20px}.editor-grid{grid-template-columns:1fr 1fr}.editor-grid button{grid-column:1 / -1}}
