:root{--bg:#f3f0ea;--panel:#fffdf9;--text:#1e1c1a;--muted:#6c675f;--line:#e2ddd3;--line-strong:#cec6b8;--accent:#c2561a;--accent-ink:#fff;--accent-soft:#fbe6d8;--error:#b42318;--stage:#e7e2d8;--focus:#0078bf;--radius:10px;--shadow:0 1px 2px #0000000d, 0 2px 8px #0000000a;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;color:var(--text);font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;font-size:14px;line-height:1.4}@media (prefers-color-scheme:dark){:root{--bg:#161514;--panel:#1f1e1c;--text:#ecebe8;--muted:#9c978f;--line:#2f2d2a;--line-strong:#3e3b37;--accent:#f08a4b;--accent-ink:#1c0e05;--accent-soft:#3a2416;--error:#ff8a7a;--stage:#100f0e;--focus:#62a8e5;--shadow:0 1px 2px #0006;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}}*{box-sizing:border-box}body{background:var(--bg);margin:0}button,input,select{font:inherit;color:inherit}input[type=range]{accent-color:var(--accent);min-width:0}:focus-visible{outline:2px solid var(--focus);outline-offset:2px}h1,h2,h3{margin:0}.app{flex-direction:column;height:100vh;display:flex}.topbar{border-bottom:1px solid var(--line);background:var(--panel);align-items:center;gap:12px;padding:10px 16px;display:flex}.topbar h1{font-size:16px}.empty{color:var(--muted);flex:1;place-items:center;display:grid}button{border:1px solid var(--line-strong);background:var(--panel);cursor:pointer;border-radius:8px;padding:6px 12px}button:hover:not(:disabled){border-color:var(--accent)}button:disabled{opacity:.5;cursor:default}button.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}button.active{background:var(--accent-soft);border-color:var(--accent)}.button-row{flex-wrap:wrap;gap:6px;display:flex}.hint{color:var(--muted);margin:0;font-size:12px}.error{color:var(--error);margin:0;font-size:13px}.file-name{font-weight:600}.busy{color:var(--muted);font-size:12px}.welcome{text-align:center;max-width:460px;color:var(--text);justify-items:center;gap:12px;display:grid}.welcome p{color:var(--muted);margin:0}.workspace{flex:1;min-height:0;display:flex}.panel{border-right:1px solid var(--line);background:var(--panel);flex:none;width:320px;overflow:hidden auto}.panel-sections section{border-bottom:1px solid var(--line);gap:8px;padding:14px 16px;display:grid}.panel-sections h2{text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-size:13px}.field{grid-template-columns:1fr auto;align-items:center;gap:4px 8px;display:grid}.field .hint{grid-column:1/-1}.field select{max-width:170px}.field-input{align-items:center;gap:4px;display:inline-flex}.field-input input{border:1px solid var(--line-strong);background:var(--bg);border-radius:6px;width:80px;padding:3px 6px}.field-input.small input{width:60px}.unit{color:var(--muted);min-width:22px;font-size:12px}select{border:1px solid var(--line-strong);background:var(--bg);border-radius:6px;padding:3px 6px}.check{align-items:center;gap:6px;display:flex}.angle{grid-template-columns:64px minmax(0,1fr) auto;align-items:center;gap:8px;display:grid}.view{flex-direction:column;flex:1;min-width:0;display:flex;position:relative}.stage{background:var(--stage);flex:1;min-height:0}.stage.picking{cursor:crosshair}.view-controls{border-top:1px solid var(--line);background:var(--panel);flex-wrap:wrap;align-items:center;gap:14px;padding:8px 14px;display:flex}.view-controls label{align-items:center;gap:6px;display:flex}.view-tabs{border-bottom:1px solid var(--line);background:var(--panel);gap:4px;padding:8px 14px;display:flex}.layer-view{flex-direction:column;flex:1;min-height:0;display:flex}.layer-view.empty{color:var(--muted);place-items:center;display:grid}.layer-canvas{background:#f7f4ee;flex:1;width:100%;min-height:0}.layer-stepper{border-top:1px solid var(--line);background:var(--panel);flex-wrap:wrap;align-items:center;gap:10px;padding:8px 14px;display:flex}.layer-stepper input[type=range]{flex:1;max-width:320px}.layer-stepper button[aria-label]{padding:4px 9px;font-size:11px}.colours{flex-wrap:wrap;align-items:center;gap:6px 14px;display:flex}.colours label{align-items:center;gap:6px;display:flex}.colours input[type=color]{border:1px solid var(--line-strong);border-radius:4px;width:28px;height:22px;padding:0}.pin{fill:none;stroke:#8a5a2b;stroke-width:.6px;cursor:grab;pointer-events:all}.pin.through{fill:#8a5a2b;fill-opacity:.55}.pin.dragging{cursor:grabbing;fill:var(--accent)}.note{justify-items:start;gap:6px;display:grid}.pin.unplaced{stroke:var(--error);stroke-dasharray:1 .8;fill:none}.pair{grid-template-columns:1fr 1fr;gap:8px;display:grid}.pair .field{grid-template-columns:auto auto;justify-content:start}.pair .field-input input{width:64px}.panel-sections section>button{justify-self:start}.sheet-view{background:var(--stage);flex:1;align-content:start;gap:18px;min-height:0;padding:16px;display:grid;overflow-y:auto}.sheet-view.empty{color:var(--muted);place-items:center}.sheet{gap:6px;max-width:1000px;margin:0;display:grid}.sheet figcaption{justify-content:space-between;align-items:center;gap:10px;display:flex}.sheet svg{width:100%;height:auto;box-shadow:var(--shadow);display:block}.sheet-board{fill:#f2e6d2}.sheet-margin{fill:none;stroke:#c9b89c;stroke-dasharray:4 3}.flute-lines{fill:none;stroke:#9c7a4e;stroke-opacity:.45}.unsaved{color:var(--muted);font-size:12px;font-weight:400}.modal{border-radius:var(--radius);background:var(--panel);width:min(440px,100vw - 32px);color:var(--text);border:none;padding:0;box-shadow:0 10px 40px #00000040}.modal.wide{width:min(720px,100vw - 32px)}.modal::backdrop{background:#00000059}.modal-body{gap:12px;padding:16px 18px 18px;display:grid}.modal-body header{justify-content:space-between;align-items:center;display:flex}.modal-body h2{font-size:16px}.modal .close{border:none;padding:2px 8px;font-size:20px;line-height:1}.save-form{gap:12px;display:grid}.save-form input{border:1px solid var(--line-strong);background:var(--bg);border-radius:6px;width:240px;padding:4px 8px}.project-list{gap:8px;max-height:60vh;margin:0;padding:0;list-style:none;display:grid;overflow-y:auto}.project-list li{border:1px solid var(--line);border-radius:8px;grid-template-columns:72px 1fr auto;align-items:center;gap:12px;padding:8px;display:grid}.project-list li.current{border-color:var(--accent)}.project-list .thumb{background:var(--stage);width:72px;height:72px;padding:0;overflow:hidden}.project-list .thumb img{width:100%;height:100%;display:block}.project-meta{gap:2px;min-width:0;display:grid}.project-meta form{gap:6px;display:flex}.project-meta input{border:1px solid var(--line-strong);background:var(--bg);border-radius:6px;flex:1;min-width:0;padding:3px 6px}.empty-list{color:var(--muted);margin:0}@media (width<=760px){.app{height:auto;min-height:100vh}.topbar{flex-wrap:wrap}.workspace{flex-direction:column}.panel{border-right:none;border-bottom:1px solid var(--line);width:100%;max-height:none}.view{min-height:70vh}}
