/* Foam insert designer: app chrome (light) around a dark cutting stage. */
body.app{height:100dvh;display:flex;flex-direction:column;overflow:hidden;font-size:14px}
body.app main{flex:1;min-height:0;display:flex;flex-direction:column}
body.app .site-foot,body.app .site-head{display:none}
.dz{display:grid;grid-template-columns:64px 1fr var(--side,340px);grid-template-rows:52px 1fr;height:100%;min-height:0;background:var(--mist)}
.dz button{font:inherit;color:inherit}
.dz-top{grid-column:1/-1;display:flex;align-items:center;gap:10px;padding:0 12px;background:#fff;border-bottom:1px solid var(--line)}
.dz-top .logo img{width:30px;height:auto}
.dz-top .logo span{font-size:.95rem}
.dz-ver{font:600 11px var(--mono,monospace);color:#fff;background:var(--red,#E8242B);padding:3px 7px;border-radius:999px;white-space:nowrap}
.dz-name{font:600 15px var(--f);border:1px solid transparent;border-radius:3px;padding:6px 8px;width:220px;background:transparent}
.dz-name:hover{border-color:var(--line)}
.dz-name:focus{border-color:var(--ink);outline:0;background:#fff}
.dz-group{display:flex;align-items:center;gap:2px;margin-left:8px}
.dz-group+.dz-group{margin-left:14px;padding-left:14px;border-left:1px solid var(--line)}
.ib{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:34px;min-width:34px;padding:0 8px;border:0;border-radius:4px;background:transparent;cursor:pointer;color:var(--ink)}
.ib svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.ib:hover{background:var(--mist)}
.ib.on{background:var(--ink);color:#fff}
.ib:disabled{opacity:.35;cursor:default;background:transparent}
.ib.txt{font-size:.85rem;font-weight:600;min-width:52px}
.dz-top-r{margin-left:auto;display:flex;align-items:center;gap:10px}
.dz-saved{font-size:.78rem;color:var(--grey)}
.dz .btn{padding:9px 14px;font-size:.85rem}
.dz-snap{display:flex;align-items:center;gap:6px;font-size:.78rem;font-weight:600;color:var(--steel)}
.dz-snap select{width:auto;padding:5px 6px;font-size:13px}

.dz-rail{display:flex;flex-direction:column;align-items:center;gap:4px;padding:10px 0;background:#fff;border-right:1px solid var(--line);overflow:visible}
.dz-rail .ib{flex-direction:column;gap:2px;width:52px;height:46px;padding:0;font-size:.62rem;font-weight:600;letter-spacing:.02em}
.dz-rail .ib svg{width:20px;height:20px}
.dz-rail .sep{width:32px;height:1px;background:var(--line);margin:6px 0}
.dz-rail label.ib{cursor:pointer}

.dz-stage{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;background:#232326;background-image:radial-gradient(rgba(255,255,255,.06) 1px,transparent 1px);background-size:22px 22px}
.canvas{display:block;flex:1;width:100%;min-height:0;touch-action:none;outline:none;cursor:default}
.dz-bar{display:flex;align-items:center;gap:4px;padding:0 10px;height:46px;background:#fff;border-top:1px solid var(--line);overflow-x:auto;flex:none}
.dz-bar .dz-group{margin-left:0;padding-left:0;border:0}
.dz-bar .dz-group+.dz-group{margin-left:8px;padding-left:8px;border-left:1px solid var(--line)}
.dz-sel{font-size:.78rem;font-weight:600;color:var(--steel);white-space:nowrap;flex:none;max-width:240px;overflow:hidden;text-overflow:ellipsis;margin-right:6px}
.canvas[data-tool="rect"],.canvas[data-tool="circle"],.canvas[data-tool="slot"],.canvas[data-tool="poly"],.canvas[data-tool="measure"]{cursor:crosshair}
.canvas.panning{cursor:grab}
.dz-hint{position:absolute;left:12px;right:12px;bottom:54px;font-size:.76rem;color:#C9C9C9;pointer-events:none;text-shadow:0 1px 2px #000}
.dz-flash{position:absolute;left:12px;top:48px;max-width:min(520px,70%);background:#fff;color:var(--ink);padding:10px 14px;border-radius:4px;box-shadow:0 6px 24px rgba(0,0,0,.35);font-size:.85rem}
.dash-size{font-family:var(--mono);font-size:.74rem;color:var(--grey);margin:-4px 0 8px}
.meas-size{font-family:var(--mono);font-size:.74rem;color:var(--ink);background:var(--mist);padding:3px 8px;border-radius:3px}
.layers li small.sz{font-family:var(--mono);opacity:.75}
.shape{cursor:move}
.handle{fill:#fff;stroke:#E8242B;stroke-width:2px;vector-effect:non-scaling-stroke;cursor:nwse-resize}
.handle.selv{fill:#E8242B;stroke:#fff}.handle.selv2{fill:#E85112;stroke:#fff}
.canvas[data-tool="notch"],.canvas[data-tool="sline"],.canvas[data-tool="area"]{cursor:crosshair}.canvas[data-tool="sline"] .shape,.canvas[data-tool="area"] .shape{cursor:crosshair}

.dz-side{position:relative;display:flex;flex-direction:column;min-height:0;background:#fff;border-left:1px solid var(--line)}
.dz-tabs{display:flex;border-bottom:1px solid var(--line)}
.dz-tabs button{flex:1;padding:11px 4px;border:0;background:transparent;font-size:.8rem;font-weight:600;color:var(--grey);border-bottom:2px solid transparent;cursor:pointer}
.dz-tabs button.on{color:var(--ink);border-bottom-color:var(--red)}
.dz-panels{flex:1;min-height:0;overflow:auto;padding:14px}
.dz-foot{flex:none;border-top:1px solid var(--line);padding:10px 14px;background:#fff}
.dz-panel h3{font-size:.95rem;margin-bottom:10px}
.fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.fields .wide,.fields>p,.fields .chk{grid-column:1/-1}
.fields label{font-size:.74rem}
.fields input,.fields select{padding:7px 9px;font-size:14px}
.chk{display:flex;align-items:center;gap:8px;font-size:.85rem;font-weight:500;color:var(--ink)}
.chk input{width:auto;margin:0}
.muted{color:var(--grey);font-size:.8rem}
.sub{font-size:.7rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--grey);margin:16px 0 8px}
.legend{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px}
.chip{display:inline-flex;align-items:center;gap:6px;font-size:.78rem;padding:3px 8px 3px 4px;border:1px solid var(--line);border-radius:20px}
.chip i,.layers li i{width:14px;height:14px;border-radius:3px;flex:none;display:inline-block}
.layers{list-style:none;margin:0;padding:0;border-top:1px solid var(--line)}
.layers li{display:flex;align-items:center;gap:10px;padding:7px 4px;border-bottom:1px solid var(--line);font-size:.85rem;cursor:pointer}
.layers li.on{background:var(--mist)}
.layers li span{flex:1}
.layers li em{font-style:normal;color:var(--grey);font-family:var(--mono);font-size:.75rem}
.layers li button{border:0;background:transparent;color:var(--grey);font-size:1.1rem;cursor:pointer;padding:0 4px}
.layers li button:hover{color:var(--red)}
.import-box{border:1px solid var(--line);border-radius:4px;padding:12px;margin-top:10px}
.import-box .fields{margin-top:8px}
.import-box input[type=range]{padding:0;width:100%}
.import-box .row{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.drop{display:flex;flex-direction:column;align-items:center;gap:6px;padding:18px 12px;border:1.5px dashed #CFCCC8;border-radius:4px;text-align:center;cursor:pointer;font-size:.85rem;color:var(--steel)}
.drop:hover{border-color:var(--ink);color:var(--ink)}
.drop strong{color:var(--ink)}

.dz-quote{border-top:1px solid var(--line);padding:12px 0 0;margin-top:18px}
.dz-quote dl{display:grid;grid-template-columns:1fr auto;gap:3px 12px;margin:0;font-size:.82rem}
.dz-quote dd{margin:0;text-align:right;font-family:var(--mono);font-size:.78rem}
.dz-quote dt{color:var(--steel)}
.dz-quote .tot{font-weight:700;color:var(--ink);font-size:.95rem;border-top:1px solid var(--line);padding-top:5px;margin-top:2px}
.dz-quote .muted{margin-top:6px}
.issues{list-style:none;margin:8px 0 0;padding:0;font-size:.8rem;display:grid;gap:5px}
.issues li{padding:7px 10px;border-radius:3px;background:#FDECEC;color:#8A1116}
.issues li.warn{background:#FFF4CC;color:#5B4A00}
.dz-actions{display:grid;grid-template-columns:auto 1fr;gap:8px;align-items:center}
.dz-actions label{grid-template-columns:auto 64px;display:grid;align-items:center;gap:8px;font-size:.74rem}
.dz-actions .btn{grid-column:1/-1;justify-content:center}
.dz-actions .link-btn{grid-column:1/-1;justify-self:center}

dialog.dz-dialog{border:0;border-radius:6px;padding:0;width:min(520px,94vw);box-shadow:0 20px 60px rgba(0,0,0,.3)}
dialog.dz-dialog::backdrop{background:rgba(0,0,0,.45)}
.dz-dialog form,.dz-dialog .done{padding:24px}
.dz-dialog h2{font-size:1.4rem;margin-bottom:6px}
.dz-dialog .fields{margin-top:16px}
.dz-dialog textarea{font:15px var(--f);padding:9px 11px;border:1px solid #CFCCC8;border-radius:3px;min-height:70px;resize:vertical}
.dz-dialog .row{display:flex;gap:10px;justify-content:flex-end;margin-top:18px}
.dz-dialog .error{color:var(--red-dark);font-size:.85rem;margin-top:10px}

@media (max-width:980px){
  body.app{height:auto;overflow:visible}
  .dz{grid-template-columns:1fr;grid-template-rows:auto auto 72vh auto;height:auto}
  .dz-sel{min-width:0}
  .dz-top{flex-wrap:wrap;height:auto;padding:8px 12px;gap:6px}
  .dz-name{width:100%}
  .dz-top-r{margin-left:0;width:100%;justify-content:space-between}
  .dz-rail{flex-direction:row;flex-wrap:wrap;justify-content:center;border-right:0;border-bottom:1px solid var(--line);padding:6px}
  .dz-rail .sep{width:1px;height:32px;margin:0 4px}
  .dz-side{border-left:0;border-top:1px solid var(--line)}
}

/* v3: overlays, trace preview, known-length scaling */
.ov-frame{pointer-events:stroke;cursor:move}
.ov-handle{cursor:nwse-resize}
.canvas[data-tool="scale"]{cursor:crosshair}
.import-box .step{font-size:.72rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--steel);margin:12px 0 6px}
.import-box .step:first-child{margin-top:0}
.import-box .muted{margin-top:8px}
.scale-box{margin-top:10px;padding:10px;border-radius:4px;background:#FFF8DD;border:1px solid #F2C94C}
.scale-box p{font-size:.82rem;margin:0}
.scale-box .presets{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}
.scale-box .presets button{font-size:.74rem;padding:4px 8px;border:1px solid #D9C86C;border-radius:14px;background:#fff;cursor:pointer}
.scale-box .presets button:hover{border-color:var(--ink)}
.scale-box .row{margin-top:8px}

/* crop dialog */
dialog.dz-crop{width:fit-content;max-width:96vw}
.crop-wrap{position:relative;display:inline-block;line-height:0;background:#111;user-select:none;touch-action:none}
.crop-wrap canvas{display:block;max-width:100%}
.crop-box{position:absolute;box-sizing:border-box;border:2px solid #E85112;box-shadow:0 0 0 9999px rgba(0,0,0,.55);cursor:move}
.crop-box i{position:absolute;width:18px;height:18px;background:#fff;border:2px solid #E85112;border-radius:3px}
.crop-box i[data-h="nw"]{left:-10px;top:-10px;cursor:nwse-resize}.crop-box i[data-h="se"]{right:-10px;bottom:-10px;cursor:nwse-resize}
.crop-box i[data-h="ne"]{right:-10px;top:-10px;cursor:nesw-resize}.crop-box i[data-h="sw"]{left:-10px;bottom:-10px;cursor:nesw-resize}
.crop-foot{padding:14px 18px 18px;width:0;min-width:100%;box-sizing:border-box}.crop-foot .row{margin-top:10px}

/* tags, colour-by, grouped layers */
.seg{display:flex;align-items:center;gap:0;font-size:.8rem;margin:10px 0}.seg span{margin-right:8px;color:var(--grey)}
.seg button{border:1px solid var(--line);background:#fff;padding:4px 10px;font-size:.8rem;cursor:pointer}.seg button:first-of-type{border-radius:4px 0 0 4px}.seg button:last-of-type{border-radius:0 4px 4px 0;margin-left:-1px}
.seg button.on{background:var(--ink,#1b1b1b);color:#fff;border-color:var(--ink,#1b1b1b)}
button.chip{background:#fff;cursor:pointer;font:inherit;font-size:.78rem}button.chip:hover{border-color:var(--ink,#1b1b1b)}
.tagchips{display:flex;flex-wrap:wrap;gap:5px;margin:-2px 0 8px}.tagchips button{display:inline-flex;align-items:center;gap:5px;font-size:.74rem;padding:3px 8px 3px 4px;border:1px solid var(--line);border-radius:14px;background:#fff;cursor:pointer}
.tagchips button i{width:12px;height:12px;border-radius:3px;display:inline-block}.tagchips button.on{border-color:var(--ink,#1b1b1b);background:var(--mist)}
.layers li.grp{background:#F4F2EE;font-weight:600;cursor:pointer}.layers li.grp:hover{background:#ECE9E3}
.layers li span small{font-weight:400;color:var(--grey);margin-left:4px}

/* sheet tabs above the foam */
.dz-sheets{display:flex;align-items:center;gap:4px;padding:6px 10px;background:#1b1b1d;border-bottom:1px solid #35353a;overflow-x:auto;flex:none}
.dz-sheets .sh{display:inline-flex;align-items:center;gap:6px;border:1px solid #3a3a40;background:#2a2a2e;color:#d8d5cf;font:500 12px var(--f);padding:5px 10px;border-radius:5px;cursor:pointer;white-space:nowrap;max-width:200px;overflow:hidden;text-overflow:ellipsis}
.dz-sheets .sh b{font-family:var(--mono);font-weight:600;color:#9a978f}.dz-sheets .sh small{color:#8a877f;font-family:var(--mono)}
.dz-sheets .sh.on{background:#F5F2EA;color:#1b1b1b;border-color:#F5F2EA}.dz-sheets .sh.on b,.dz-sheets .sh.on small{color:#6b675f}
.dz-sheets .sh.add{font-size:16px;line-height:1;padding:3px 10px;color:#E85112;border-style:dashed}
.dz-sheets .sh-tools{margin-left:auto;display:flex;gap:4px}.dz-sheets .sh-tools button{border:0;background:transparent;color:#9a978f;font:12px var(--f);cursor:pointer;padding:4px 6px}.dz-sheets .sh-tools button:hover{color:#fff}
.btn.sm{padding:3px 9px;font-size:.78rem;margin:0 4px}

/* rotation dial (Shape tab) */
.rotrow{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;margin-top:6px}
.dial{position:relative;width:96px;height:96px;cursor:grab;touch-action:none;user-select:none}
.dial:active{cursor:grabbing}
.dial svg{width:100%;height:100%;display:block}
.dial-face{fill:#fff;stroke:var(--line);stroke-width:2}
.dial-ticks line{stroke:#bbb;stroke-width:2}
.dial-hand{stroke:#E8242B;stroke-width:3;stroke-linecap:round}
.dial-knob{fill:#E8242B}
.dial-pin{fill:#333}
.dial-deg{position:absolute;left:0;right:0;top:58%;text-align:center;font:600 .75rem/1 IBM Plex Mono,monospace;color:#555;pointer-events:none}

/* v24: shape menu, on-canvas rotate knob, arrange box, info toggles, Advanced, compact footer */
.dz-menu{position:absolute;z-index:5;min-width:190px;background:#fff;color:var(--ink);border-radius:6px;box-shadow:0 10px 30px rgba(0,0,0,.4);padding:6px;font-size:.84rem}
.dz-menu-h{font-weight:700;padding:4px 8px 6px;font-size:.78rem;color:var(--grey);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dz-menu-d{display:flex;align-items:center;gap:6px;padding:4px 8px 6px;border-bottom:1px solid var(--line);margin-bottom:4px;font-size:.8rem}
.dz-menu-d input{width:64px;padding:4px 6px;font-size:13px}
.dz-menu button{display:block;width:100%;text-align:left;border:0;background:transparent;padding:6px 8px;border-radius:4px;cursor:pointer;font:inherit}
.dz-menu button:hover{background:var(--mist)}
.dz-menu button.danger{color:var(--red,#E8242B)}
.handle.rot{cursor:grab;fill:#fff;stroke:#E8242B}
.rot-knob:active .handle.rot{cursor:grabbing}
.handle.arr{cursor:nwse-resize}
.handle.arr[data-c="ne"],.handle.arr[data-c="sw"]{cursor:nesw-resize}
.handle.arr[data-c="n"],.handle.arr[data-c="s"]{cursor:ns-resize}
.handle.arr[data-c="e"],.handle.arr[data-c="w"]{cursor:ew-resize}
details.info{margin:6px 0 2px}
details.info>summary{list-style:none;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:50%;border:1px solid #CFCCC8;font:600 11px/1 var(--mono,monospace);color:var(--grey);cursor:pointer;user-select:none}
details.info>summary::-webkit-details-marker{display:none}
details.info>summary:hover,details.info[open]>summary{background:var(--ink,#1b1b1b);color:#fff;border-color:var(--ink,#1b1b1b)}
details.info>p{margin:6px 0 0}
details.info.inline{display:inline-block;margin:0 0 0 4px;vertical-align:middle}
details.info.inline[open]{display:block;width:100%;margin:4px 0 0}details.info.inline>p{margin-top:6px}
.row{position:relative}
details.adv{margin-top:10px;border:1px solid var(--line);border-radius:4px;padding:0 10px}
details.adv>summary{cursor:pointer;font-size:.74rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--steel);padding:8px 0;list-style:none;display:flex;align-items:center;gap:6px}
details.adv>summary::-webkit-details-marker{display:none}
details.adv>summary::before{content:"▸";font-size:.9em}
details.adv[open]>summary::before{content:"▾"}
details.adv>.fields{margin:0 0 10px}
details.adv label{cursor:help}
.dz-quote{border-top:1px solid var(--line);padding:10px 0 0;margin-top:18px}
.dz-quote>summary{cursor:pointer;font-size:.72rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--steel);list-style:none}
.dz-quote>summary::-webkit-details-marker{display:none}
.dz-quote>summary::before{content:"▸ "}.dz-quote[open]>summary::before{content:"▾ "}
.dz-quote>div{margin-top:8px}
.dz-foot{padding:8px 10px}
.dz-actions{display:flex;align-items:center;gap:8px}
.dz-actions label{display:flex;align-items:center;gap:4px;font-size:.8rem;color:var(--grey)}
.dz-actions label input{width:52px;padding:6px;font-size:13px}
.dz-price{flex:1;display:flex;flex-direction:column;line-height:1.15;min-width:0}
.dz-price b{font-size:.9rem;white-space:nowrap}.dz-price small{font-size:.7rem;color:var(--red,#E8242B)}
.dz-actions .btn{padding:8px 14px;grid-column:auto}
.dz-more{position:relative}
.dz-more>summary{list-style:none;cursor:pointer;padding:6px 10px;font-size:1.1rem;line-height:1}
.dz-more>summary::-webkit-details-marker{display:none}
.dz-more>div{position:absolute;right:0;bottom:calc(100% + 6px);min-width:170px;background:#fff;border:1px solid var(--line);border-radius:6px;box-shadow:0 10px 30px rgba(0,0,0,.2);padding:6px;z-index:6}
.dz-more>div button{display:block;width:100%;text-align:left;border:0;background:transparent;padding:7px 10px;border-radius:4px;cursor:pointer;font:inherit;font-size:.84rem}
.dz-more>div button:hover{background:var(--mist)}.dz-more>div button:disabled{opacity:.4;cursor:default}
.dz-bar .ib.txt{min-width:0;padding:0 7px;font-size:.78rem;white-space:nowrap}

/* v25: notch bar, popovers in the bar, panel grip, dark theme */
.dz-bars{position:absolute;left:12px;top:48px;z-index:4;display:flex;flex-direction:column;gap:6px;align-items:flex-start;max-width:min(640px,92%);pointer-events:none}.dz-bars>*{pointer-events:auto}
.dz-notchbar{flex-wrap:wrap;display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;background:#fff;color:var(--ink);padding:8px 12px;border-radius:6px;box-shadow:0 6px 24px rgba(0,0,0,.35);font-size:.8rem;max-width:min(560px,90%)}
.dz-notchbar label{display:flex;align-items:center;gap:5px;font-size:.74rem;color:var(--grey)}
.dz-notchbar input,.dz-notchbar select{padding:4px 6px;font-size:13px;width:auto}.dz-notchbar input{width:60px}

.dz-pop{position:relative}
.dz-pop>summary{list-style:none;cursor:pointer}.dz-pop>summary::-webkit-details-marker{display:none}
.dz-pop[open]>summary{background:var(--mist)}
.dz-pop-body{position:absolute;left:0;bottom:calc(100% + 8px);z-index:6;background:#fff;color:var(--ink);border:1px solid var(--line);border-radius:6px;box-shadow:0 10px 30px rgba(0,0,0,.25);padding:8px}
.dz-pop-body.wide{width:340px;padding:12px}
.dz-pop-body .fields{gap:8px}.dz-pop-body .muted{margin-top:8px;font-size:.74rem}
.dz-pop-body .dz-group{margin:0}
.dz-grip{position:absolute;left:-4px;top:0;bottom:0;width:8px;cursor:col-resize;z-index:3}
.dz-grip:hover,.dz-grip:active{background:rgba(232,81,18,.35)}
.dz-top .ib svg{width:18px;height:18px}
:root[data-theme="dark"] .dz{background:#1c1c1e;color:#e8e6e1}
:root[data-theme="dark"] .dz-top,:root[data-theme="dark"] .dz-rail,:root[data-theme="dark"] .dz-side,:root[data-theme="dark"] .dz-bar,:root[data-theme="dark"] .dz-foot{background:#232326;color:#e8e6e1;border-color:#3a3a40}
:root[data-theme="dark"] .dz-top .logo span,:root[data-theme="dark"] .dz-name,:root[data-theme="dark"] .ib,:root[data-theme="dark"] .dz-panel h3,:root[data-theme="dark"] .chk,:root[data-theme="dark"] .layers li,:root[data-theme="dark"] .dz-price b{color:#e8e6e1}
:root[data-theme="dark"] .dz-top .logo img{filter:invert(1) brightness(1.6)}
:root[data-theme="dark"] .dz-name:focus{background:#2a2a2e;border-color:#e8e6e1}
:root[data-theme="dark"] .ib:hover,:root[data-theme="dark"] .dz-tabs button.on,:root[data-theme="dark"] .layers li.on,:root[data-theme="dark"] .dz-pop[open]>summary,:root[data-theme="dark"] .dz-menu button:hover,:root[data-theme="dark"] .dz-more>div button:hover{background:#333338}
:root[data-theme="dark"] .ib.on{background:#F5F2EA;color:#1b1b1b}
:root[data-theme="dark"] .dz-tabs,:root[data-theme="dark"] .dz-tabs button,:root[data-theme="dark"] .layers,:root[data-theme="dark"] .layers li,:root[data-theme="dark"] .import-box,:root[data-theme="dark"] details.adv,:root[data-theme="dark"] .dz-quote,:root[data-theme="dark"] .dz-group+.dz-group,:root[data-theme="dark"] .dz-menu-d,:root[data-theme="dark"] .chip,:root[data-theme="dark"] .tagchips button,:root[data-theme="dark"] .seg button{border-color:#3a3a40}
:root[data-theme="dark"] .dz-tabs button.on{color:#fff}
:root[data-theme="dark"] .dz-panel input:not([type=checkbox]):not([type=radio]),:root[data-theme="dark"] .dz-panel select,:root[data-theme="dark"] .fields input,:root[data-theme="dark"] .fields select,:root[data-theme="dark"] .dz-snap select,:root[data-theme="dark"] .dz-actions input,:root[data-theme="dark"] .dz-menu input,:root[data-theme="dark"] .dz-notchbar input,:root[data-theme="dark"] .dz-notchbar select,:root[data-theme="dark"] .dz-dialog textarea{background:#1c1c1e;color:#e8e6e1;border-color:#4a4a52}
:root[data-theme="dark"] .dz .btn:not(.btn-red){background:#2e2e33;color:#e8e6e1;border-color:#4a4a52}
:root[data-theme="dark"] .dz-menu,:root[data-theme="dark"] .dz-pop-body,:root[data-theme="dark"] .dz-more>div,:root[data-theme="dark"] .dz-notchbar,:root[data-theme="dark"] .dz-flash,:root[data-theme="dark"] details.info.inline>p{background:#2a2a2e;color:#e8e6e1;border-color:#4a4a52}
:root[data-theme="dark"] .muted,:root[data-theme="dark"] .sub,:root[data-theme="dark"] .dz-saved,:root[data-theme="dark"] .dz-sel,:root[data-theme="dark"] .fields label,:root[data-theme="dark"] .layers li em,:root[data-theme="dark"] .dz-menu-h,:root[data-theme="dark"] details.adv>summary,:root[data-theme="dark"] .dz-quote>summary,:root[data-theme="dark"] .import-box .step,:root[data-theme="dark"] .dz-quote dt,:root[data-theme="dark"] .dz-actions label{color:#a9a69f}
:root[data-theme="dark"] .layers li.grp{background:#2a2a2e}:root[data-theme="dark"] .layers li.grp:hover{background:#333338}
:root[data-theme="dark"] .seg button,:root[data-theme="dark"] .tagchips button,:root[data-theme="dark"] button.chip,:root[data-theme="dark"] .chip{background:#2a2a2e;color:#e8e6e1}
:root[data-theme="dark"] .seg button.on{background:#F5F2EA;color:#1b1b1b;border-color:#F5F2EA}
:root[data-theme="dark"] .drop{border-color:#4a4a52;color:#c9c6bf}:root[data-theme="dark"] .drop strong{color:#fff}
:root[data-theme="dark"] details.info>summary{border-color:#4a4a52;color:#a9a69f}:root[data-theme="dark"] details.info[open]>summary{background:#F5F2EA;color:#1b1b1b}
:root[data-theme="dark"] .issues li{background:#4a1d20;color:#ffb3b6}:root[data-theme="dark"] .issues li.warn{background:#4a3f12;color:#f2d98a}
:root[data-theme="dark"] .dz-sheets{background:#151517}
:root[data-theme="dark"] .dz-quote .tot{color:#fff}
/* v26: control pad, layer filters, tool library, guide, closable notices */
.dz-flash{display:block;padding:6px 10px 10px}.dz-flash-h{display:flex;justify-content:flex-end;gap:2px;height:20px;margin:0 -4px 2px 0;cursor:grab;border-bottom:1px solid rgba(0,0,0,.08)}.dz-flash-h:active{cursor:grabbing}.dz-flash-h .dz-flash-x{position:static;width:22px;height:20px;font-size:16px}.dz-flash.fold .dz-flash-b{max-height:1.4em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.dz-flash.fold [data-flash-fold]{transform:rotate(180deg)}.dz-flash-b{padding-top:4px}
.dz-flash-x{position:absolute;right:6px;top:4px;width:24px;height:24px;border:0;background:transparent;color:inherit;font-size:18px;line-height:1;cursor:pointer;border-radius:4px;opacity:.65}.dz-flash-x:hover{opacity:1;background:rgba(0,0,0,.08)}
.dash-head{display:flex;align-items:center;gap:8px;margin-bottom:8px}.dash-head h3{margin:0;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dash-head .swatch{width:14px;height:14px;border-radius:50%;flex:none;border:1px solid rgba(0,0,0,.2)}.tagpill{font-size:.68rem;padding:2px 8px;border-radius:999px;background:var(--mist);color:var(--ink2,#555);white-space:nowrap}
.dz-dash{margin-top:12px;border:1px solid var(--line);border-radius:10px;padding:8px;display:grid;grid-template-columns:1fr 1fr;gap:8px;background:var(--mist,#f3f1ec)}
.dash-g{display:flex;flex-wrap:wrap;gap:4px;padding:6px 6px 6px;background:#fff;border-radius:8px;position:relative;padding-top:18px}
.dash-cap{position:absolute;left:8px;top:4px;font-size:.6rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#8a857d}
.dash-b{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;width:60px;height:52px;border:0;border-radius:6px;background:transparent;color:var(--ink);cursor:pointer;font-size:.62rem;font-weight:600;letter-spacing:.01em;line-height:1}
.dash-b svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.dash-b:hover{background:var(--mist)}.dash-b.on{background:var(--ink);color:#fff}.dash-b:disabled{opacity:.35;cursor:default;background:transparent}
.layer-filter{display:flex;gap:6px;margin:4px 0 6px}.layer-filter input{flex:1;min-width:0}.layer-filter select{max-width:46%}
.row.sm{gap:6px;margin-bottom:6px}.btn.sm.ghost,.btn.ghost.sm{font-size:.72rem;padding:4px 8px}
.layers li input[type=checkbox]{margin:0 6px 0 0;accent-color:var(--orange,#E85112)}
.lib-top{display:flex;gap:6px;margin-bottom:8px}.lib-top input{flex:1;min-width:0}
.chips{display:flex;flex-wrap:wrap;gap:4px;margin:6px 0}
.lib-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:8px;margin-top:8px}
.lib-card{position:relative;border:1px solid var(--line);border-radius:8px;padding:6px 6px 8px;background:#fff;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:3px;text-align:center}
.lib-card:hover{border-color:var(--ink);box-shadow:0 2px 10px rgba(0,0,0,.12)}.lib-card svg{width:72px;height:56px;fill:rgba(232,81,18,.12);stroke:var(--ink);stroke-width:1.2;stroke-linejoin:round}
.lib-card b{font-size:.72rem;line-height:1.15;max-width:100%;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.lib-card small{font-size:.62rem;color:#8a857d;display:flex;align-items:center;gap:4px;justify-content:center}.lib-card small i{width:8px;height:8px;border-radius:50%;display:inline-block}
.lib-card .x{position:absolute;right:2px;top:2px;width:20px;height:20px;border:0;border-radius:50%;background:transparent;color:#8a857d;font-size:14px;line-height:1;cursor:pointer;opacity:0}.lib-card:hover .x{opacity:1}.lib-card .x:hover{background:#eee;color:#b03737}
.dz-tour{position:fixed;inset:0;z-index:50;pointer-events:none}
.tour-hl{position:absolute;border:2px solid var(--orange,#E85112);border-radius:8px;box-shadow:0 0 0 9999px rgba(0,0,0,.45);transition:all .25s ease}
.tour-card{position:absolute;width:320px;background:#fff;color:var(--ink);border-radius:10px;padding:14px 16px 12px;box-shadow:0 14px 40px rgba(0,0,0,.4);pointer-events:auto;transition:left .25s ease,top .25s ease}
.tour-card small{font-size:.66rem;color:#8a857d;letter-spacing:.06em;text-transform:uppercase}.tour-card h4{margin:2px 0 6px;font-size:1rem}.tour-card p{margin:0 0 10px;font-size:.82rem;line-height:1.45}
.tour-nav{display:flex;justify-content:space-between;gap:8px}
:root[data-theme="dark"] .dz-dash{background:#1c1c1e;border-color:#3a3a40}:root[data-theme="dark"] .dash-g,:root[data-theme="dark"] .lib-card,:root[data-theme="dark"] .tour-card{background:#2a2a2e;color:#e8e6e1;border-color:#4a4a52}
:root[data-theme="dark"] .dash-b{color:#e8e6e1}:root[data-theme="dark"] .dash-b:hover{background:#333338}:root[data-theme="dark"] .dash-b.on{background:#F5F2EA;color:#1b1b1b}:root[data-theme="dark"] .lib-card svg{stroke:#e8e6e1}:root[data-theme="dark"] .lib-card:hover{border-color:#e8e6e1}
:root[data-theme="dark"] .tagpill{background:#333338;color:#e8e6e1}:root[data-theme="dark"] .dz-flash-x:hover{background:rgba(255,255,255,.12)}
.dz-top-r{white-space:nowrap}.dz-saved{font-size:.72rem}@media (max-width:1500px){.dz-saved{display:none}}
.lib-top input,.layer-filter input{flex:1 1 auto;width:auto;min-width:80px}.lib-top select,.layer-filter select{flex:0 0 auto;width:auto;max-width:44%}
.dz-dash{margin-top:4px;margin-bottom:12px}.tour-card .dz-flash-x{right:4px;top:4px}
.dz-dash{grid-template-columns:1fr;gap:6px;padding:6px}.dash-g{padding:16px 4px 4px;gap:2px}.dash-b{width:66px;height:48px}.dash-b span{white-space:nowrap}
.lib-h{grid-column:1/-1;display:flex;align-items:center;gap:6px;margin:10px 0 0;font-size:.72rem;letter-spacing:.08em;text-transform:uppercase;color:#8a857d;border-bottom:1px solid var(--line);padding-bottom:4px}.lib-h:first-child{margin-top:0}
.lib-h i{width:9px;height:9px;border-radius:50%;display:inline-block}.lib-h em{font-style:normal;margin-left:auto;font-weight:400}

.arr-groups li{cursor:default}.arr-groups li span small{display:block;color:var(--grey);font-size:.72rem}.arr-groups li .btn{margin-left:4px}
.lib-card .stars{display:flex;gap:1px;line-height:1}.lib-card .stars button{border:0;background:none;padding:0 1px;font-size:.8rem;color:#C9A227;cursor:pointer}.lib-card .stars.mine button{color:#E85112}.lib-card.poor{border-style:dashed;opacity:.85}.lib-card .poor-tag{font-size:.62rem;color:#B3261E;font-style:normal;font-weight:600}
.saves li span{flex:1;display:flex;flex-direction:column}.saves li small{color:var(--grey);font-size:.72rem}.saves li.on{background:rgba(232,81,18,.08)}.dz-save .done{padding:20px 24px}.dz-save .saves{max-height:40vh;overflow:auto}
/* 3D view (v38) */
dialog.dz-3d{width:min(1100px,96vw);max-height:94vh;display:flex;flex-direction:column;overflow:hidden}
dialog.dz-3d:not([open]){display:none}
.v3-head{display:flex;align-items:center;gap:12px;padding:12px 18px;border-bottom:1px solid #E4E1DC;flex-wrap:wrap}.v3-head h2{font-size:1.15rem;margin:0 8px 0 0}
.v3-views{display:flex;gap:4px}.v3-views .btn.on{background:var(--orange,#E85112);color:#fff;border-color:var(--orange,#E85112)}
.v3-col{display:flex;align-items:center;gap:6px;font-size:.8rem;color:var(--grey)}.v3-col select{font:13px var(--f);padding:4px 6px;border:1px solid #CFCCC8;border-radius:3px}
.v3-stage{position:relative;flex:none;height:min(62vh,640px);background:linear-gradient(#F7F5F0,#E6E2DA)}
.v3-stage canvas{width:100%;height:100%;display:block;touch-action:none;cursor:grab}.v3-stage canvas:active{cursor:grabbing}
.v3-hint{position:absolute;left:12px;bottom:8px;font-size:.72rem;color:var(--grey);pointer-events:none}
.v3-err{position:absolute;inset:0;display:grid;place-items:center;padding:24px;text-align:center;color:var(--red-dark)}
.v3-foot{display:flex;align-items:center;gap:14px;padding:10px 18px;border-top:1px solid #E4E1DC;flex-wrap:wrap}
.v3-legend{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:.78rem}.v3-legend i{display:inline-block;width:12px;height:12px;border-radius:2px;margin-right:5px;vertical-align:-1px;border:1px solid rgba(0,0,0,.15)}
.v3-info{font-size:.76rem;color:var(--grey);margin-left:auto}
:root[data-theme="dark"] .v3-stage{background:linear-gradient(#3a3a3c,#232325)}:root[data-theme="dark"] .v3-head,:root[data-theme="dark"] .v3-foot{border-color:#3a3a3c}
/* panels as control pads (v41) */
.dash-b.hot{color:var(--red,#E85112)}.dash-b.hot:hover{background:var(--red,#E85112);color:#fff}a.dash-b{text-decoration:none}
.dz-panel>.dz-dash{margin-top:8px}
.layers li{display:grid;grid-template-columns:auto auto minmax(0,1fr) auto auto;gap:8px;align-items:center}.layers li span{min-width:0;overflow:hidden;text-overflow:ellipsis}.layers li em{white-space:nowrap}
.arr-groups li{grid-template-columns:auto minmax(0,1fr) auto auto}
.dash-head .seg button{padding:3px 9px;font-size:.74rem}
:root[data-theme="dark"] .layers li span{color:#e8e6e1}
.dash-b{width:auto;min-width:66px;padding:0 6px}
/* library reference photos (v43) */
.lib-ph{position:relative;display:block;width:88px;height:62px;border-radius:4px;overflow:hidden;background:#f1efe9}.lib-ph img{width:100%;height:100%;object-fit:contain;display:block}
.lib-card .lib-ph svg{position:absolute;inset:0;width:100%;height:100%;fill:rgba(255,30,30,.08);stroke:#ff1e1e;stroke-width:1.5px}
.lib-card .chk-ai{border:1px solid var(--line);background:#fff;border-radius:999px;font-size:.62rem;padding:2px 7px;cursor:pointer;color:var(--ink)}.lib-card .chk-ai:hover{border-color:var(--ink)}
.lib-card .no-ph{font-size:.6rem;color:#a8a39a;font-style:normal}
:root[data-theme="dark"] .lib-ph{background:#1c1c1e}:root[data-theme="dark"] .lib-card .chk-ai{background:#2a2a2e;color:#e8e6e1;border-color:#4a4a52}

/* v45: hover explanations (every setting's title as a quick tooltip) and trace progress */
.dz-tip{position:fixed;z-index:60;max-width:300px;background:#141414;color:#fff;font-size:.74rem;line-height:1.4;padding:7px 10px;border-radius:6px;box-shadow:0 6px 20px rgba(0,0,0,.35);pointer-events:none}
html[data-theme=dark] .dz-tip{background:#f3f1ec;color:#111}
.dz-prog,.dz-progpill{display:flex;align-items:center;gap:8px;font-size:.76rem}
.dz-prog{margin:4px 0 8px}
.dz-prog .bar,.dz-progpill .bar{display:block;flex:none;width:110px;height:7px;border-radius:4px;background:var(--mist,#e6e2da);overflow:hidden}
.dz-prog .bar i,.dz-progpill .bar i{display:block;height:100%;width:0;background:#E85112;border-radius:4px;transition:width .25s}
.dz-prog.done .bar i,.dz-progpill.done .bar i{background:#2E9E5B}
.dz-prog b,.dz-progpill b{font-family:var(--mono);min-width:38px;text-align:right}
.dz-progpill{position:absolute;top:12px;left:50%;transform:translateX(-50%);z-index:5;background:#fff;color:var(--ink);padding:7px 14px;border-radius:999px;box-shadow:0 6px 24px rgba(0,0,0,.35);max-width:min(560px,90%);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dz-progpill span:last-child{overflow:hidden;text-overflow:ellipsis}
.dash-sel{align-self:center;max-width:92px;height:28px;margin-left:2px;border:1px solid var(--line,#ccc);border-radius:6px;background:transparent;color:inherit;font:inherit;font-size:.66rem;padding:0 4px}
:root[data-theme="dark"] .dash-sel{border-color:#55555c}

/* v59: the Trace tab as six steps, rail captions, the Issues badge */
.rail-cap{font-size:.56rem;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--grey);margin:6px 0 -2px}
details.stage{border:1px solid var(--line);border-radius:4px;margin-top:8px;background:#fff}
details.stage>summary{list-style:none;display:flex;align-items:center;gap:8px;padding:8px 10px;cursor:pointer;font-size:.8rem;font-weight:700;color:var(--ink)}
details.stage>summary::-webkit-details-marker{display:none}
details.stage[open]>summary{border-bottom:1px solid var(--line)}
.st-n{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:#B9B5AE;color:#fff;font-size:.66rem;flex:none}
details.stage.done .st-n{background:#2E8B57}
details.stage.now .st-n{background:var(--ink)}
details.stage>summary:focus{outline:none}details.stage>summary:focus-visible{outline:2px solid var(--orange,#E85112);outline-offset:-2px}
.st-t{flex:none}
.st-sum{flex:1;min-width:0;font-weight:500;color:var(--grey);font-size:.7rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.st-chg{flex:none;font-size:.64rem;font-weight:700;color:#8A4B00;background:#FFE8CC;border-radius:10px;padding:2px 7px}
.st-reset{flex:none;border:1px solid var(--line);background:transparent;border-radius:3px;font-size:.66rem;font-weight:600;padding:2px 7px;cursor:pointer;color:var(--ink)}
.st-reset:hover{background:var(--mist)}
.st-body{padding:10px}
.st-body>.dz-dash:first-child{margin-top:0}
.st-foot{position:sticky;bottom:-14px;margin:10px -14px -14px;padding:10px 14px;background:#fff;border-top:1px solid var(--line);display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.st-foot .muted{flex:1;min-width:0;font-size:.74rem}
.st-foot .btn{flex:none}
label.changed{box-shadow:inset 3px 0 0 #E85112;padding-left:7px;border-radius:2px}
.def{display:block;margin-top:3px;border:0;background:transparent;padding:0;font:inherit;font-size:.66rem;font-weight:600;color:#B24A10;cursor:pointer;text-align:left}
.def:hover{text-decoration:underline}
.dz-issues{margin:0 0 8px;border:1px solid #E6C34D;border-radius:4px;background:#FFF8DC}
.dz-issues.err{border-color:#E8242B;background:#FDECEC}
.dz-issues>summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:8px;padding:6px 10px;font-size:.76rem;color:#5B4A00}
.dz-issues.err>summary{color:#8A1116}
.dz-issues>summary::-webkit-details-marker{display:none}
.dz-issues>summary::after{content:"▾";margin-left:auto;font-size:.8em}
.dz-issues[open]>summary::after{content:"▴"}
.iss-n{font-weight:800}
.dz-issues .issues{margin:0;padding:0 8px 8px;max-height:200px;overflow:auto}
.dz-issues .issues li[data-issue-shape]{cursor:pointer}
.dz-issues .issues li[data-issue-shape]:hover{outline:2px solid rgba(0,0,0,.15)}
:root[data-theme="dark"] details.stage,:root[data-theme="dark"] .st-foot{background:#232326;border-color:#3a3a40}
:root[data-theme="dark"] details.stage>summary,:root[data-theme="dark"] .st-reset{color:#e8e6e1}
:root[data-theme="dark"] .dz-issues{background:#4a3f12;border-color:#8a7a2a}:root[data-theme="dark"] .dz-issues.err{background:#4a1d20;border-color:#E8242B}
:root[data-theme="dark"] .dz-issues>summary{color:#f2d98a}:root[data-theme="dark"] .dz-issues.err>summary{color:#ffb3b6}
.dz-prog{flex-wrap:wrap}.dz-prog>.muted{flex-basis:100%;margin-top:4px}
.dz-issues .issues{max-height:120px}
.imp{display:flex;flex-direction:column;align-items:center;gap:6px;margin-top:10px}
.imp-btn{display:inline-flex;align-items:center;gap:8px;cursor:pointer}
.imp-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.imp .muted{font-size:.72rem}
.dz-top .ib[data-tool="measure"].on{background:var(--ink);color:#fff}
.dz-fly{position:fixed;z-index:60;display:flex;flex-direction:column;gap:2px;width:150px;padding:8px;background:#fff;border:1px solid var(--line);border-radius:6px;box-shadow:0 8px 24px rgba(0,0,0,.18)}
.dz-fly .ib{justify-content:flex-start;gap:10px;height:36px;width:100%;font-size:.8rem;font-weight:600}
.dz-fly .ib svg{width:18px;height:18px}
.dz-fly .dash-cap{margin:0 0 4px 6px}
.dz-fly .muted{font-size:.66rem;margin:6px 6px 0}
.dz-rail .ib.open{background:var(--mist)}
:root[data-theme="dark"] .dz-fly{background:#232326;border-color:#3a3a40}

/* v67: file lock (cutting files are staff-only until buying a design opens) */
.dz-lock{display:none;font-size:.72em;margin-left:6px;opacity:.75;vertical-align:1px}
html:not([data-staff]) .dz-lock{display:inline}
.dz-staff{display:inline-flex;align-items:center;gap:6px;font-size:.72rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:#fff;background:var(--orange,#E85112);padding:3px 4px 3px 9px;border-radius:999px}
.dz-staff button{border:0;background:rgba(255,255,255,.22);color:#fff;font:inherit;font-size:.68rem;text-transform:none;letter-spacing:0;padding:2px 8px;border-radius:999px;cursor:pointer}
.dz-staff button:hover{background:rgba(255,255,255,.35)}
