:root{font-family:Arial,sans-serif;color:#292521;background:#f7f4ef}*{box-sizing:border-box}body{margin:0}header{display:flex;justify-content:space-between;gap:1rem;padding:1rem 2rem;background:#fff;border-bottom:1px solid #ddd3c8}header a{color:#d84d27}header span{color:#a34628;font-size:.8rem;font-weight:700;letter-spacing:.08em}main{max-width:1400px;margin:auto;padding:2rem}h1{font-size:2.5rem;margin:.2rem 0}h2{font-size:1.3rem;margin:0 0 1rem}.lead{color:#706962;max-width:850px}.settings,.layout{display:grid;gap:1rem}.settings{grid-template-columns:repeat(3,minmax(130px,1fr));margin:1.5rem 0}.layout{grid-template-columns:minmax(260px,360px) 1fr;align-items:start}.panel{background:#fff;border:1px solid #e0d7ce;border-radius:18px;padding:1.4rem;margin-bottom:1rem;min-width:0}label{display:grid;gap:.4rem;font-weight:700;color:#655c54;margin-bottom:1rem}input,select{width:100%;padding:.8rem;border:1px solid #c9beb2;border-radius:10px;font:inherit;color:#292521;background:#fff}button{font:inherit;cursor:pointer}#add{background:#d84d27;color:#fff;border:0;border-radius:10px;padding:.9rem 1.2rem;font-weight:700}.tabs{display:flex;flex-wrap:wrap;gap:.4rem;margin-bottom:.8rem}.tabs button{background:#fff;border:1px solid #c9beb2;border-radius:8px;padding:.55rem .7rem}.tabs button[aria-selected=true]{background:#d84d27;border-color:#d84d27;color:#fff}svg{display:block;width:100%;height:auto;max-height:530px;background:#f3efe8;border:1px solid #ded5cc;border-radius:12px}.hint{font-size:.9rem;color:#756c63;line-height:1.5}.error{color:#a72d21}.operation{display:flex;justify-content:space-between;gap:1rem;align-items:center;border-top:1px solid #eee3da;padding:.7rem 0}.operation button{border:1px solid #c9beb2;background:#fff;border-radius:7px;padding:.4rem .6rem}@media(max-width:850px){.layout{grid-template-columns:1fr}.settings{grid-template-columns:1fr}main{padding:1rem}header{padding:1rem}}
.hole-palette{display:flex;flex-wrap:wrap;gap:.5rem;margin:1rem 0}.hole-choice{border:1px solid #c9beb2;border-radius:9px;background:#fff;padding:.6rem .7rem;text-align:left;cursor:grab}.hole-choice:active{cursor:grabbing}.hole-choice[aria-pressed=true]{border-color:#d84d27;background:#fff0e9;color:#a6381e}.drawing svg{cursor:crosshair}.precise-placement{border-top:1px solid #e7ded5;padding-top:1rem}.precise-placement summary{cursor:pointer;font-weight:700;color:#655c54;margin-bottom:1rem}
.system32-tool{padding:1rem;margin-bottom:1rem;border:1px solid #e7ded5;border-radius:12px;background:#faf7f2}.system32-tool h3{margin:0;font-size:1rem}.system32-pair{display:flex;align-items:flex-start;gap:.6rem}.system32-pair input{width:auto;margin:.15rem 0 0}.system32-tool button{background:#d84d27;color:#fff;border:0;border-radius:10px;padding:.75rem 1rem;font-weight:700}
.notice{color:#6b561b;background:#fff4d8;padding:.7rem;border-radius:8px}
.system32-note{max-width:1000px;padding:.8rem 1rem;border-left:4px solid #d84d27;background:#fff7f0;color:#574b42;line-height:1.5}.dialog-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:.6rem;margin-top:1.2rem}dialog{max-width:min(560px,calc(100vw - 2rem));border:1px solid #d8cbbd;border-radius:16px;padding:1.5rem;box-shadow:0 20px 60px #0004}dialog::backdrop{background:#0008}.dialog-actions button{border:1px solid #c9beb2;border-radius:9px;background:#fff;padding:.7rem 1rem}.dialog-actions button:last-child{border-color:#d84d27;background:#d84d27;color:#fff;font-weight:700}
.drawing svg{cursor:grab;touch-action:none;user-select:none}.drawing svg:active{cursor:grabbing}.part-face{stroke:#6a594c;stroke-width:2;fill:#dcc7a9}.part-face-front{fill:#ead9bd}.part-face-back{fill:#baaa95}.part-face-top{fill:#f1e5d1}.part-face-bottom{fill:#c8b292}.part-face-left,.part-face-right{fill:#d3bc9d}.hole-marker{fill:#fffaf0;stroke:#c54729;stroke-width:2;cursor:pointer}.hole-hidden{fill:url(#hidden-hole-hatch);stroke:#b82c24;stroke-dasharray:4 3;stroke-width:3}.hole-selected{fill:none;stroke:#2d776b;stroke-width:2;stroke-dasharray:4 3}.hole-preview{fill:#e5f6ee88;stroke:#2d776b;stroke-width:3;stroke-dasharray:4 3}.dimension-line{stroke:#356b61;stroke-width:1.5}.dimension-extension{stroke:#356b61;stroke-width:1;stroke-dasharray:3 3}.dimension-input{display:flex;align-items:center;justify-content:center;width:88px;height:46px}.dimension-input input{width:78px;height:34px;padding:3px;border:1px solid #356b61;background:#fff;font-size:15px;text-align:center;box-shadow:0 2px 8px #0002}.dimension-input input:disabled{background:#e9e3da;color:#665f57}.operation-label{flex:1;border:0!important;background:transparent!important;text-align:left;white-space:normal}.operation.selected{background:#eaf4f0}
.edge-hole-rod{stroke:#dc3e31;stroke-width:9;stroke-linecap:round;opacity:.9}.edge-hole-preview{stroke-dasharray:6 3;opacity:.8}.edge-hole-end{fill:#c83e30;stroke:#fff;stroke-width:2;cursor:pointer}.preview-dimension{font-size:17px;font-weight:700;paint-order:stroke;stroke:#f3efe8;stroke-width:4px}
.tools-panel{position:sticky;top:12px}.tools-panel h2{margin-bottom:.35rem}.palette-instruction{margin:.25rem 0 .6rem}.hole-palette{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.4rem;margin:.6rem 0}.hole-choice{min-width:0;min-height:45px;padding:.45rem .55rem;cursor:pointer;font-size:.86rem;line-height:1.2}.hole-choice:active{cursor:pointer}.template-hint{margin:.4rem 0 .75rem}.system32-tool{margin:.6rem 0 0;padding:.6rem .8rem}.system32-tool summary{cursor:pointer;font-weight:700}.system32-tool[open]{position:relative}.system32-tool label{font-size:.9rem}@media(max-width:850px){.tools-panel{position:static}}
.placement-assist{display:flex;align-items:center;flex-wrap:wrap;column-gap:.45rem;row-gap:.1rem;margin:.5rem 0;font-size:.9rem;color:#292521}.placement-assist input{width:auto;margin:0}.placement-assist .hint{font-weight:400;font-size:.8rem}
.decor-direction{stroke:#50627f;stroke-width:2.4;stroke-linecap:round;opacity:.9}.decor-caption{display:flex;align-items:center;gap:.55rem;margin:.7rem 0 .3rem;color:#50627f;font-size:.9rem;font-weight:700}.decor-caption::before{content:"↔";font-size:1.35rem;line-height:1}
.basis-export{border:0;border-radius:10px;background:#d84d27;color:#fff;padding:.75rem 1rem;font-weight:700;margin:.7rem 0 .2rem}.basis-instructions{margin:.7rem 0;padding:.65rem .8rem;border:1px solid #e0d7ce;border-radius:10px}.basis-instructions summary{cursor:pointer;font-weight:700}.basis-instructions li{margin:.5rem 0;line-height:1.4}
#b3d-export-status:not(:empty){margin:.3rem 0 .7rem;padding:.65rem .8rem;border-radius:8px}#b3d-export-status.b3d-export-success{background:#e6f4eb;color:#17633a}#b3d-export-status.b3d-export-error{background:#fff0ec;color:#a82e18;font-weight:700}
.contour-controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:.6rem 1rem}.contour-controls label{margin:0}.contour-actions{display:flex;flex-wrap:wrap;gap:.6rem;margin:1rem 0}.contour-actions button{border:1px solid #c9beb2;border-radius:9px;background:#fff;padding:.7rem 1rem}.contour-actions button:last-child{background:#d84d27;border-color:#d84d27;color:#fff;font-weight:700}.contour-preview{max-width:650px;margin:auto}.contour-preview svg{max-height:520px}.contour-panel .error{font-weight:700}
.contour-controls [hidden]{display:none!important}
.adjacent-panel [hidden]{display:none!important}.adjacent-fields{display:grid;grid-template-columns:repeat(4,minmax(140px,1fr));gap:1rem}.adjacent-panel button{background:#d84d27;color:#fff;border:0;border-radius:10px;padding:.8rem 1.1rem;font-weight:700;margin-bottom:1rem}#adjacent-drawing{max-height:none}@media(max-width:850px){.adjacent-fields{grid-template-columns:repeat(2,minmax(140px,1fr))}}
.adjacent-fields .adjacent-check{display:flex;align-items:center}.adjacent-fields .adjacent-check input{width:auto}#shelf-adjacent-drawing{max-height:none}
.hole-alignment-guide{stroke:#1d8fbb;stroke-width:2.5;stroke-dasharray:6 4;filter:drop-shadow(0 0 2px #fff)}.hole-alignment-source{fill:#1d8fbb;stroke:#fff;stroke-width:2}
.technical-drawing-preview{overflow:auto;border:1px solid #d8d1c8;background:#fff}.technical-drawing-preview svg{width:100%;min-width:850px;max-height:none;border:0;border-radius:0;background:#fff}.technical-drawing-panel button{border:0;border-radius:9px;background:#d84d27;color:#fff;padding:.75rem 1rem;font-weight:700}.technical-drawing-panel button:disabled{opacity:.5;cursor:not-allowed}
