:root{--bg:var(--carpet);--surface:var(--paper);--text:var(--ink);--muted:var(--ink-soft);--line:var(--rule);--accent:var(--ink);--accent-ink:var(--paper);--accent-soft:color-mix(in srgb, var(--highlighter) 45%, var(--paper));--trace:var(--stamp);--scan-paper:#16a34a;--warn-bg:#fff4e5;--warn-ink:#8a4b00}@media (prefers-color-scheme:dark){:root:not([data-theme=light]){--scan-paper:#4ade80;--warn-bg:#3a2a12;--warn-ink:#ffcf8a}}:root[data-theme=dark]{--scan-paper:#4ade80;--warn-bg:#3a2a12;--warn-ink:#ffcf8a}main{--main-width:720px}body{padding-bottom:env(safe-area-inset-bottom)}h2{letter-spacing:-.01em;margin:.25rem 0 .75rem;font-size:1.35rem}h3{margin:1.5rem 0 .4rem;font-size:1.05rem}:where(button){color:inherit;font:inherit;white-space:normal;background:0 0;border:0;border-radius:0;padding:0}:where(button):hover{background:0 0}.title{text-decoration:none}.back-btn{white-space:nowrap}.icon-btn{width:40px;height:40px;color:var(--text);cursor:pointer;background:0 0;border:0;border-radius:50%;place-items:center;display:inline-grid}.icon-btn:active{background:var(--line)}.screen{padding:0 0 3rem;display:none}.screen.active{display:block}.hero{text-align:center;padding:.5rem 0 1rem}.hero h2{letter-spacing:-.02em;margin:.4rem 0 .5rem;font-size:1.6rem;line-height:1.2}.hero-art{width:200px;height:auto;margin:.5rem auto 0;display:block}.art-paper{fill:var(--surface);stroke:var(--line);stroke-width:2px}.art-insole{fill:#b98a54}.art-trace{fill:none;stroke:var(--trace);stroke-width:2.5px;stroke-dasharray:6 5}.lede{color:var(--muted);max-width:30rem;margin:0 auto}.stack{gap:.6rem;margin:1rem 0;display:grid}.row{gap:.6rem;display:grid}.row.two{grid-template-columns:1fr 1fr}.btn{border-radius:var(--radius);border:1px solid var(--line);background:var(--surface);min-height:48px;color:var(--text);font:inherit;text-align:center;cursor:pointer;-webkit-tap-highlight-color:transparent;justify-content:center;align-items:center;gap:.5rem;padding:.6rem 1rem;font-weight:500;display:inline-flex}.btn:hover{border-color:var(--muted)}.btn:active{transform:translateY(1px)}.btn.primary{background:var(--accent);color:var(--accent-ink);border-color:#0000;font-weight:700}.btn.primary:hover{background:var(--muted)}.btn.ghost{background:0 0}.btn.big{min-height:56px;font-size:1.05rem}.btn.small{min-height:40px;padding:.4rem .8rem}.btn:disabled{opacity:.5;cursor:default}.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);margin:.75rem 0;padding:.75rem 1rem}details.card summary{cursor:pointer;padding:.2rem 0;font-weight:600}details.card[open] summary{margin-bottom:.4rem}.field-row{align-items:center;gap:.5rem;padding:.45rem 0;display:flex}.field-row.wrap{flex-wrap:wrap}.form .field-row+.field-row{border-top:1px solid var(--line)}.label{flex:1;min-width:0;font-weight:500}.unit{color:var(--muted);font-size:.9rem}input[type=number],select{font:inherit;color:var(--text);background:var(--bg);border:1px solid var(--line);border-radius:var(--radius);min-height:42px;padding:.45rem .55rem}input[type=number]{text-align:center;width:5rem}input.pct{width:4.2rem}select{flex:12rem;max-width:100%}.stepper{flex:none;align-items:stretch;display:inline-flex}.stepper input{border-left:0;border-right:0;border-radius:0;width:3.4rem;padding:.45rem .2rem}.stepper button{border:1px solid var(--line);background:var(--surface);width:40px;color:var(--text);cursor:pointer;flex:none;font-size:1.3rem;line-height:1}.stepper button:first-child{border-radius:var(--radius) 0 0 var(--radius)}.stepper button:last-child{border-radius:0 var(--radius) var(--radius) 0}.switch{width:1.4rem;height:1.4rem;accent-color:var(--accent)}.seg{background:var(--bg);border:1px solid var(--line);border-radius:var(--radius);padding:3px;display:inline-flex}.seg button{color:var(--text);font:inherit;cursor:pointer;background:0 0;border:0;border-radius:2px;min-height:36px;padding:.35rem .9rem;font-weight:600}.seg button[aria-checked=true]{background:var(--accent);color:var(--accent-ink)}.seg.small button{min-height:32px;padding:.25rem .7rem;font-size:.9rem}.seg.wide{width:100%;margin:.4rem 0 .2rem;display:flex}.seg.wide button{flex:1;padding:.35rem .4rem}.card-title{padding-top:.25rem;font-weight:600}.chips{flex-wrap:wrap;gap:.5rem;margin:.25rem 0 .5rem;display:flex}.chip{border:1px solid var(--line);background:var(--surface);color:var(--text);font:inherit;border-radius:var(--radius);cursor:pointer;min-height:40px;padding:.45rem .9rem;font-weight:600}.chip[aria-pressed=true]{border-color:var(--accent);box-shadow:inset 0 -4px 0 var(--highlighter)}.steps{margin:1.25rem 0 .5rem;padding-left:1.25rem}.steps li{margin:.45rem 0}.fine{color:var(--muted);font-size:.875rem}.hint{color:var(--muted);margin:.4rem 0}.tips{margin:.25rem 0;padding-left:1.1rem}.tips li{margin:.35rem 0}.alert{background:var(--warn-bg);color:var(--warn-ink);border-radius:var(--radius);margin:.75rem 0;padding:.75rem .9rem}.swatch{vertical-align:middle;border-radius:2px;width:1.1em;height:.25em;display:inline-block}.swatch.trace{background:var(--trace)}.swatch.paper{background:var(--scan-paper)}.photo-wrap{border-radius:var(--radius);touch-action:pan-y;background:#000;overflow:hidden}#review-canvas{width:100%;height:auto;display:block}.stats{text-align:center;grid-template-columns:1fr 1fr 1fr;gap:.5rem;margin:.9rem 0 .25rem;display:grid}.stat{font-variant-numeric:tabular-nums;font-size:1.45rem;font-weight:700;display:block}.stat.small{font-size:1.1rem;line-height:2.05rem}.stat-label{color:var(--muted);text-transform:uppercase;letter-spacing:.06em;font-size:.8rem}.editor-wrap{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);margin:.75rem 0}#editor{touch-action:none;-webkit-user-select:none;user-select:none;width:100%;height:min(68vh,640px);display:block}#editor .orig{fill:none;stroke:var(--muted);stroke-opacity:.45;stroke-width:1.2px;vector-effect:non-scaling-stroke}#editor .shape{fill:#b98a544d;stroke:var(--trace);stroke-width:2px;vector-effect:non-scaling-stroke}#editor .handle{fill:var(--surface);stroke:var(--trace);stroke-width:2px;vector-effect:non-scaling-stroke;cursor:grab}#editor .handle.dragging{fill:var(--trace)}#editor .axis-label{fill:var(--muted);font-size:7px}.preview figcaption{margin-bottom:.4rem;font-weight:600}.preview svg{width:100%;height:auto;display:block}#bed{max-height:320px}.bed-plate{fill:var(--bg);stroke:var(--muted);stroke-width:1.5px;vector-effect:non-scaling-stroke}.bed-keepout{fill:var(--line)}.bed-part{fill:color-mix(in srgb, var(--accent) 35%, transparent);stroke:var(--accent);stroke-width:1.5px;vector-effect:non-scaling-stroke}.bed-part.over{fill:color-mix(in srgb, var(--trace) 30%, transparent);stroke:var(--trace)}.bed-hole{fill:var(--bg);stroke:var(--accent);stroke-width:.6px;vector-effect:non-scaling-stroke}.profile-hole{fill:var(--bg)}.profile-fill{fill:color-mix(in srgb, var(--accent) 35%, transparent);stroke:var(--accent);stroke-width:1.5px}.profile-text{fill:var(--muted);font-size:10px}.profile-floor{stroke:var(--muted);stroke-width:1px}.screen.camera{z-index:20;color:#fff;background:#000;max-width:none;padding:0;position:fixed;inset:0}.cam-stage{position:absolute;inset:0}#video,#overlay{width:100%;height:100%;position:absolute;inset:0}#video{object-fit:contain;background:#000}.cam-top{padding:calc(env(safe-area-inset-top) + .5rem) .75rem .5rem;background:linear-gradient(#0000008c,#0000);justify-content:space-between;align-items:center;gap:.5rem;display:flex;position:absolute;top:0;left:0;right:0}.cam-bottom{padding:1.5rem 1rem calc(env(safe-area-inset-bottom) + 1rem);background:linear-gradient(#0000,#000000a6);justify-items:center;gap:.6rem;display:grid;position:absolute;bottom:0;left:0;right:0}.on-dark{color:#fff}.seg.on-dark{background:#00000073;border-color:#ffffff40}.seg.on-dark button{color:#fff}.seg.on-dark button[aria-checked=true]{color:#000;background:#fff}.cam-status{text-align:center;background:#0000008c;border-radius:999px;max-width:34rem;margin:0;padding:.45rem .9rem;font-weight:600}.cam-status.good{background:#12823b}.shutter{cursor:pointer;background:0 0;border:0;width:78px;height:78px;padding:0}.shutter svg{width:100%;height:100%}.shutter .ring-bg{fill:none;stroke:#ffffffd9;stroke-width:5px}.shutter .ring{fill:none;stroke:#4ade80;stroke-width:5px;stroke-dasharray:226.2;stroke-dashoffset:226.2px;transform-origin:40px 40px;transform:rotate(-90deg)}.shutter .core{fill:#fff;transition:fill .2s}.shutter.ready .core{fill:#4ade80}.auto-toggle{color:#ffffffd9;align-items:center;gap:.4rem;font-size:.9rem;display:flex}.busy{z-index:30;background:color-mix(in srgb, var(--bg) 85%, transparent);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);place-content:center;justify-items:center;gap:1rem;display:grid;position:fixed;inset:0}.busy[hidden]{display:none}.spinner{border:4px solid var(--line);border-top-color:var(--accent);border-radius:50%;width:44px;height:44px;animation:.9s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.guide ul,.guide ol{padding-left:1.2rem}.guide li{margin:.35rem 0}.mold-figs{grid-template-columns:9fr 16fr;align-items:start;gap:.75rem;margin:.75rem 0;display:grid}.mold-figs figure{margin:0}.mold-figs img{border-radius:var(--radius);border:1px solid var(--line);background:var(--line);width:100%;height:auto;display:block}.mold-figs figcaption{color:var(--muted);margin-top:.3rem;font-size:.85rem}@media (max-width:420px){.mold-figs{grid-template-columns:1fr}}@media (prefers-reduced-motion:reduce){.spinner{animation-duration:3s}}.tilt-map{width:100%;height:auto;max-height:200px;margin:.5rem 0 .25rem;display:block}#tilt-editor{touch-action:none;-webkit-user-select:none;user-select:none;width:100%;height:min(68vh,640px);display:block}.tilt-outline{fill:none;stroke:var(--text);stroke-opacity:.55;stroke-width:1.2px;vector-effect:non-scaling-stroke}.tilt-line{stroke:var(--trace);stroke-width:2.5px;vector-effect:non-scaling-stroke;stroke-linecap:round}.tilt-end{fill:var(--surface);stroke:var(--trace);stroke-width:2.5px;vector-effect:non-scaling-stroke}.tilt-label{fill:var(--text);paint-order:stroke;stroke:var(--surface);stroke-width:3px;stroke-linejoin:round;font-weight:700}.legend{color:var(--muted);font-variant-numeric:tabular-nums;align-items:center;gap:.5rem;margin-bottom:.5rem;font-size:.8rem;display:flex}.legend-bar{border-radius:4px;flex:1;height:8px}.btn.full{width:100%;margin:.25rem 0}
