:root{--bg: #f6f5f2;--panel: #ffffff;--text: #1d1f23;--muted: #6b6f76;--line: #e2e0da;--accent: #c8752a;--accent-ink: #ffffff;--error: #b3261e;--warn: #8a5a00;font-family:system-ui,-apple-system,Segoe UI,sans-serif;color:var(--text);background:var(--bg)}*{box-sizing:border-box}body{margin:0}button{font:inherit;cursor:pointer;border:1px solid var(--line);background:var(--panel);border-radius:6px;padding:6px 10px}button.primary{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}button:disabled{opacity:.5;cursor:default}select,input[type=number]{font:inherit;padding:4px 6px;border:1px solid var(--line);border-radius:5px;background:#fff;max-width:100%}header{display:flex;align-items:center;gap:24px;padding:10px 16px;background:var(--panel);border-bottom:1px solid var(--line);flex-wrap:wrap}header h1{font-size:18px;margin:0}header h1 small{color:var(--muted);font-weight:400;font-size:13px}.tabs,.subtabs{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.tabs button.active,.subtabs button.active{background:var(--text);color:#fff;border-color:var(--text)}.subtabs{margin-bottom:8px}.hint{color:var(--muted);font-size:12px}.error{color:var(--error)}.placeholder{color:var(--muted);padding:40px;text-align:center}.workspace{display:grid;grid-template-columns:340px 1fr;gap:12px;padding:12px;align-items:start}.workspace aside{max-height:calc(100vh - 90px);overflow:auto}.workspace main{min-width:0}.image-tab{display:grid;grid-template-columns:280px 1fr;gap:0}.image-controls{padding:12px 0 12px 12px;max-height:calc(100vh - 60px);overflow:auto}.image-tab .workspace aside{max-height:calc(100vh - 90px)}.source-preview,.class-preview{width:100%;border-radius:6px;margin-top:8px;image-rendering:pixelated}.panel{display:flex;flex-direction:column;gap:8px}.section{background:var(--panel);border:1px solid var(--line);border-radius:8px;margin-bottom:8px}.section summary{padding:8px 10px;font-weight:600;cursor:pointer}.section-body{padding:0 10px 10px;display:flex;flex-direction:column;gap:8px}.field{display:flex;flex-direction:column;gap:3px;font-size:13px;flex:1;min-width:0}.field-label{color:var(--muted);font-size:12px}.row{display:flex;gap:8px;align-items:flex-end}.material-row{align-items:center;font-size:13px}.material-row .row-label{width:92px;flex-shrink:0;color:var(--muted);font-size:12px}.material-row select{flex:1;min-width:0}.number{display:inline-flex;align-items:center;gap:4px}.number input{width:80px}.unit{color:var(--muted);font-size:12px}.slider{display:flex;align-items:center;gap:8px}.slider input{flex:1}.slider output{width:52px;text-align:right;font-size:12px;color:var(--muted)}.check{display:flex;gap:6px;align-items:center;font-size:13px}.warnings{list-style:none;padding:0;margin:0 0 8px;display:flex;flex-direction:column;gap:3px;font-size:13px}.warnings li{padding:4px 8px;border-radius:5px;background:#f0efe9}.warnings li.warning{background:#fff4d6;color:var(--warn)}.warnings li.error{background:#fde7e5;color:var(--error)}.preview3d{background:var(--panel);border:1px solid var(--line);border-radius:8px;overflow:hidden}.preview3d canvas{height:min(70vh,720px)!important}.toolbar{display:flex;gap:8px;align-items:center;padding:8px;border-bottom:1px solid var(--line);flex-wrap:wrap;font-size:13px}.toolbar button.on{background:#ffe9a8;border-color:#e7c35b}.toolbar label{display:flex;gap:6px;align-items:center}.parts-grid{display:flex;flex-wrap:wrap;gap:12px}.part-card{margin:0;background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:8px;width:200px;font-size:13px}.part-svg{display:block;margin:0 auto 6px;background:repeating-conic-gradient(#f3f3f3 0 25%,#fff 0 50%) 0 0 / 12px 12px}.bom table{width:100%;border-collapse:collapse;background:var(--panel);font-size:13px}.bom th,.bom td{text-align:left;padding:5px 8px;border-bottom:1px solid var(--line)}.bom .group-row td{font-weight:600;background:#f0efe9}.bom-actions{display:flex;gap:12px;align-items:center;margin-bottom:10px;flex-wrap:wrap}.swatch{display:inline-block;width:10px;height:10px;border-radius:2px;margin-right:6px;border:1px solid #0003;vertical-align:middle}.testfiles{padding:16px;display:flex;flex-direction:column;gap:12px;max-width:1100px}@media(max-width:900px){.workspace,.image-tab{grid-template-columns:1fr}.workspace aside,.image-controls{max-height:none}}textarea{font:inherit;padding:6px;border:1px solid var(--line);border-radius:5px;resize:vertical;width:100%}.versions{display:grid;grid-template-columns:repeat(2,1fr);gap:6px}.version{display:flex;flex-direction:column;gap:3px;padding:4px;font-size:11px;text-align:left}.version img{width:100%;height:70px;object-fit:cover;border-radius:4px}.version.active{border-color:var(--accent);box-shadow:0 0 0 2px #c8752a44}.object-canvas{width:100%;border-radius:6px;cursor:crosshair;image-rendering:auto}.object-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:4px;max-height:260px;overflow:auto;font-size:12px}.object-list li{display:flex;align-items:center;gap:6px;padding:2px 4px;border-radius:5px}.object-list li.selected{background:#f3eadf}.object-list .object-name{flex:1;min-width:0}.object-list select{max-width:120px;font-size:12px}button.icon{padding:0 6px;line-height:20px}.scene-editor{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:12px;align-items:start}.scene-svg{width:100%;max-height:75vh;background:var(--panel);border:1px solid var(--line);border-radius:8px;touch-action:none;user-select:none}.scene-controls{display:flex;flex-direction:column;gap:8px;background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:10px}@media(max-width:900px){.scene-editor{grid-template-columns:1fr}}.warnings-wrap{margin-bottom:8px}.infos summary{cursor:pointer;font-size:13px;color:var(--muted);padding:2px 0 6px}header .mode-switch{margin-left:auto}.mode-simple header h1{font-size:20px}.wizard{max-width:980px;margin:0 auto;padding:16px;display:flex;flex-direction:column;gap:16px}.stepper{list-style:none;display:flex;gap:6px;padding:0;margin:0;flex-wrap:wrap}.stepper li{flex:1;min-width:110px}.stepper button{width:100%;display:flex;align-items:center;gap:8px;justify-content:center;border-radius:999px;padding:8px 10px;font-size:14px}.stepper .num{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--line);font-size:12px;font-weight:600}.stepper li.current button{border-color:var(--accent);background:#fff4e8;font-weight:600}.stepper li.current .num,.stepper li.done .num{background:var(--accent);color:#fff}.card{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:20px;display:flex;flex-direction:column;gap:12px}.card h2{margin:0 0 4px;font-size:22px}.card h3{margin:8px 0 0;font-size:15px;color:var(--muted);font-weight:600}.dropzone{border:2px dashed #d6cfc2;border-radius:14px;min-height:260px;display:grid;place-items:center;cursor:pointer;background:#faf8f4;text-align:center;padding:12px;font-size:18px;color:var(--muted)}.dropzone.over{border-color:var(--accent);background:#fff4e8}.dropzone img{max-width:100%;max-height:420px;border-radius:8px}.choice-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:10px}.choice{display:flex;flex-direction:column;gap:4px;align-items:flex-start;text-align:left;padding:12px 14px;border-radius:12px;font-size:15px}.choice small{color:var(--muted);font-size:12px}.choice.selected,.segmented button.selected{border-color:var(--accent);box-shadow:0 0 0 2px #c8752a55;background:#fff8f0}.choice.palette .swatches{display:flex;gap:3px}.choice.palette .sw{width:22px;height:22px;border-radius:5px;border:1px solid #0002}.segmented{display:flex;flex-wrap:wrap;gap:6px}.segmented button{padding:10px 16px;border-radius:10px;font-size:15px;display:inline-flex;align-items:center;gap:6px}.icon-big{font-size:18px}.dot{width:14px;height:14px;border-radius:50%;display:inline-block;border:1px solid #0003}.check.big{font-size:15px;gap:10px}.check.big input{width:18px;height:18px}.row-wrap{display:flex;gap:24px;align-items:flex-end;flex-wrap:wrap}button.big{padding:14px 18px;font-size:17px;border-radius:12px;display:flex;flex-direction:column;align-items:center;gap:2px}button.big small{font-size:12px;opacity:.85}button.link{border:none;background:none;color:var(--accent);padding:0;text-align:left;text-decoration:underline;width:fit-content}.progress{position:relative;height:34px;border-radius:10px;background:#f0ece4;overflow:hidden}.progress-bar{position:absolute;inset:0 auto 0 0;background:linear-gradient(90deg,#e6a160,var(--accent));transition:width .3s}.progress span{position:relative;display:block;line-height:34px;padding:0 12px;font-size:14px;font-weight:500}.wizard .object-canvas{max-height:520px;object-fit:contain}.mini-preview .preview3d canvas{height:360px!important}.facts{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:4px;font-size:15px}.download-grid{display:grid;grid-template-columns:2fr 1fr 1fr;gap:10px}.howto{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:4px;font-size:14px}.wizard-nav{display:flex;justify-content:space-between;position:sticky;bottom:0;padding:10px 0;background:linear-gradient(transparent,var(--bg) 30%)}.wizard-nav button{padding:12px 22px;font-size:16px;border-radius:10px}@media(max-width:700px){.download-grid{grid-template-columns:1fr}.stepper li{min-width:0}.stepper button{font-size:0;gap:0}.stepper .num{font-size:12px}.card{padding:14px}}.busy-host{position:relative}.busy-overlay{position:absolute;inset:0;z-index:20;display:flex;gap:12px;align-items:center;justify-content:center;background:#f6f5f28c;backdrop-filter:blur(1px);border-radius:8px;font-weight:600;color:var(--text);pointer-events:none}.spinner{width:28px;height:28px;border-radius:50%;border:3px solid #c8752a33;border-top-color:var(--accent);animation:spin .8s linear infinite;will-change:transform}.spinner.small{width:14px;height:14px;border-width:2px;display:inline-block;vertical-align:-2px}@keyframes spin{to{transform:rotate(360deg)}}.wizard:has(.adjust){max-width:1400px}.start-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.start-option{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;text-align:center;min-height:170px;border-radius:14px;padding:16px;font-size:16px}.start-option.dropzone{min-height:170px}.start-option small{color:var(--muted);font-size:13px;max-width:320px}.start-icon{font-size:34px}.library-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}.library-card{display:flex;flex-direction:column;gap:4px;padding:8px;border-radius:12px;text-align:left}.library-card strong{font-size:14px}.library-card small{color:var(--muted);font-size:12px}.library-card.selected{border-color:var(--accent);box-shadow:0 0 0 2px #c8752a55}.motif-thumb{width:100%;aspect-ratio:100 / 140;border-radius:8px;display:block}.adjust{display:grid;grid-template-columns:360px minmax(0,1fr);gap:14px;align-items:start}.adjust-panel{max-height:calc(100vh - 190px);overflow:auto;gap:10px}.adjust-preview{gap:10px;min-height:400px}.preview-head{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.busy-inline{color:var(--muted);font-size:13px;display:inline-flex;gap:6px;align-items:center}.preview-area{min-height:360px}.preview-area .placeholder{display:grid;place-items:center;min-height:360px;border:2px dashed var(--line);border-radius:10px}.tabs-2 button{flex:1;justify-content:center}.tabs-2{display:flex}.choice-grid.compact{grid-template-columns:repeat(auto-fill,minmax(140px,1fr))}.choice-grid.compact .choice{padding:8px 10px;font-size:13px}.layer-block{border:1px solid var(--line);border-radius:10px;padding:8px 10px;display:flex;flex-direction:column;gap:4px}.layer-head{display:flex;align-items:center;gap:8px}.layer-head strong{flex:1;font-size:14px}.swatch.big{width:18px;height:18px;border-radius:5px;margin:0}button.small{padding:3px 8px;font-size:12px}.layer-items{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}.layer-items li{display:flex;align-items:center;gap:4px;font-size:13px}.layer-items .item-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hint.empty{margin:0;font-style:italic}.photo-block .object-canvas{max-height:300px;object-fit:contain}.progress span{display:flex;gap:8px;align-items:center}@media(max-width:900px){.adjust{grid-template-columns:1fr}.adjust-panel{max-height:none}.start-grid{grid-template-columns:1fr}}.figures-grid{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(260px,1fr);gap:16px;align-items:start}.figures-grid .object-canvas{max-height:70vh;object-fit:contain}.figures-side{display:flex;flex-direction:column;gap:8px}.figures-side .object-list{max-height:50vh}.stack-preview{width:100%;max-height:60vh;border-radius:8px;border:1px solid var(--line)}.geo-thumb{width:34px;height:34px;background:#f4f1ea;border-radius:4px;flex-shrink:0}.pending-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:4px}.pending-list li{display:flex;align-items:center;gap:6px;font-size:13px;padding:4px;border:1px solid var(--line);border-radius:8px}.pending-list .item-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dropzone.small{min-height:110px;font-size:16px}.segmented.vertical{flex-direction:column}.segmented.vertical button{justify-content:flex-start;text-align:left}.choice small.ok{color:#2f7a3a;font-weight:600}.choice small.bad{color:var(--error);font-weight:600}.download-grid{grid-template-columns:2fr 1fr 1fr 1fr}@media(max-width:900px){.figures-grid{grid-template-columns:1fr}}.canvas-wrap{position:relative}.canvas-wrap.locked canvas{pointer-events:none;touch-action:pan-y}.canvas-unlock,.canvas-lock{position:absolute;z-index:5;border-radius:999px;font-size:15px;padding:10px 16px;box-shadow:0 2px 10px #0003}.canvas-unlock{left:50%;top:12px;transform:translate(-50%);background:#fffffff0;white-space:nowrap}.canvas-lock{right:10px;top:10px;background:var(--accent);color:#fff;border-color:var(--accent)}.wizard-nav.hidden{display:none}.card,.adjust>*,.figures-grid>*,.workspace main{min-width:0}.adjust{grid-template-columns:360px minmax(0,1fr)}@media(max-width:900px){.adjust,.figures-grid,.scene-editor{grid-template-columns:minmax(0,1fr)}.adjust-panel{max-height:none;overflow:visible}.wizard{padding:10px;gap:10px}}@media(max-width:700px){header{padding:8px 12px;gap:8px}header h1 small{display:none}header .mode-switch{padding:4px 8px;font-size:13px}.stepper{gap:4px}.stepper li{min-width:0}.stepper button{font-size:0;gap:0;padding:6px 4px}.stepper li.current button{font-size:14px;gap:6px}.stepper li.current{flex:2.5}.card{padding:12px;border-radius:12px}.card h2{font-size:19px}.preview3d canvas{height:52vh!important}.mini-preview .preview3d canvas{height:40vh!important}.scene-svg{max-height:60vh}.toolbar{gap:6px;font-size:12px}.toolbar label input{width:80px}.toolbar .hint{display:none}.download-grid{grid-template-columns:1fr}.choice-grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr))}.library-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.library-card small{display:none}.wizard-nav{padding:8px 0 calc(8px + env(safe-area-inset-bottom))}.wizard-nav button{padding:12px 16px;font-size:15px}.layer-items .item-label{font-size:14px}.adjust-preview{order:-1}}@media(pointer:coarse){button.icon,button.small{min-width:40px;min-height:40px;font-size:15px}.layer-items li,.object-list li,.pending-list li{min-height:44px}select,input[type=number]{min-height:40px;font-size:16px}.segmented button{min-height:44px}.check input{width:22px;height:22px}.toolbar button{min-height:38px}.object-list select{max-width:150px;font-size:14px}.choice-grid.compact .choice,header .mode-switch,button.link{min-height:44px}}.only-coarse{display:none}@media(pointer:coarse){.only-coarse{display:inline}.only-fine{display:none}}.model-state{display:inline-flex;gap:6px;align-items:center;font-weight:600}.model-state.ready{color:#2f7a3a}button.icon,button.small,header .mode-switch,.pending-list .geo-thumb{flex-shrink:0}.crop-editor{display:flex;flex-direction:column;gap:10px}.crop-wrap{position:relative;width:fit-content;max-width:100%;touch-action:none;user-select:none}.crop-wrap canvas{display:block;max-width:100%;max-height:65vh;border-radius:6px}.crop-rect{position:absolute;box-shadow:0 0 0 9999px #00000073;outline:2px solid #fff;cursor:move}.crop-handle{position:absolute;width:22px;height:22px;background:#fff;border:2px solid var(--accent);border-radius:50%}.crop-handle.nw{left:-11px;top:-11px;cursor:nwse-resize}.crop-handle.ne{right:-11px;top:-11px;cursor:nesw-resize}.crop-handle.sw{left:-11px;bottom:-11px;cursor:nesw-resize}.crop-handle.se{right:-11px;bottom:-11px;cursor:nwse-resize}.ai-box{border:1px solid var(--line);border-radius:10px;padding:8px 10px}.ai-box summary{cursor:pointer;font-weight:600}.ai-box .row-wrap{gap:8px;margin-top:8px}.version-chips{display:flex;gap:6px;flex-wrap:wrap}.version-chips button.selected{border-color:var(--accent);background:#fff8f0}.frame-info{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:13px}
