.cut-canvas {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background-color: #e9eeea;
  background-image: radial-gradient(circle, rgb(87 111 97 / 23%) .65px, transparent .85px);
  background-position: 4px 4px;
  background-size: 9px 9px;
}

.cut-stage {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.cut-stage:focus { outline: none; }
.cut-stage:focus-visible { outline: 2px solid #387362; outline-offset: -2px; }
.cut-board {
  fill: #fdfdf6;
  stroke: #bfc7b8;
  stroke-width: 1;
  filter: drop-shadow(0 1px 1.5px rgb(37 49 41 / 13%));
}
.cut-minor-grid, .cut-major-grid, .cut-margin { fill: none; }
.cut-minor-grid { stroke: #e6e9df; stroke-width: .8; }
.cut-major-grid { stroke: #cfd7c8; stroke-width: 1; }
.cut-margin { stroke: #bbc7b3; stroke-width: .85; stroke-dasharray: 3 4; pointer-events: none; }
.cut-ghosts { opacity: .65; pointer-events: none; }
.cut-guides { fill:none; stroke:#8b5128; stroke-width:1; stroke-dasharray:5 3; pointer-events:none; }

.cut-ruler-bg { fill: #f6f8f4; }
.cut-ruler-line { fill: none; stroke: #cfd7cd; stroke-width: 1; }
.cut-ruler-marks path { stroke: #a5b2a6; stroke-width: 1; }
.cut-ruler-marks text, .cut-ruler-unit {
  fill: #687969;
  font: 9px/1 Consolas, "IBM Plex Mono", monospace;
  font-variant-numeric: tabular-nums;
}
.cut-ruler-unit { font: 10px/1 system-ui, sans-serif; }

.cut-item { cursor: move; outline: none; }
.cut-item.cut-locked { cursor: default; }
.cut-item:focus-visible .cut-hit { stroke: #228568; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.cut-selected-outline, .cut-rotate-stem { fill: none; stroke: #299878; stroke-width: 1.15; pointer-events: none; }
.cut-grip { fill: #f8fff9; stroke: #26876c; stroke-width: 1.2; }
.cut-rotate-handle { cursor: grab; }
.cut-resize-ne { cursor: nesw-resize; }
.cut-resize-nw { cursor: nwse-resize; }
.cut-stage.cut-hand, .cut-stage.cut-hand * { cursor: grab; }
.cut-stage.cut-grabbing, .cut-stage.cut-grabbing * { cursor: grabbing; }
.cut-size { pointer-events: none; }
.cut-size rect { fill: #e5f3e9; stroke: #9cc6ad; stroke-width: .6; }
.cut-size text { fill: #286349; font: 500 10px/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; }

#workspace-foot { container-type: inline-size; }
.physical-tools { display:inline-flex; align-items:stretch; flex:none; border:1px solid var(--line); border-radius:5px; overflow:hidden; }
.physical-tools button { min-height:27px; padding:2px 7px; color:var(--green); font-size:12px; font-weight:650; }
.physical-tools button + button { border-left:1px solid var(--line); display:grid; place-items:center; padding-inline:5px; }
.physical-tools button:hover, #workspace-foot button[aria-pressed=true][data-act=fit] { background:var(--green2); }
.physical-tools button[aria-pressed=true] { color:white; background:var(--green); }
.physical-tools button:focus-visible { outline-offset:-2px; }
@container (max-width:450px) { .ghost-caption { display:none; } }
.display-calibration { display:grid; gap:17px; }
.display-calibration input { max-width:180px; }
.measure-space { display:grid; place-items:center; min-height:76px; padding:16px; border:1px solid var(--line); border-radius:6px; background:#f7f9f5; }
.measure-line { position:relative; width:min(100%,360px); height:26px; color:var(--green); }
.measure-line::before { content:""; position:absolute; top:50%; left:0; right:0; border-top:1px solid currentColor; }
.measure-line i { position:absolute; top:0; bottom:0; width:2px; background:currentColor; transform:translateX(-50%); }
.measure-line i:first-child { left:0; }
.measure-line i:last-child { left:100%; }
.cut-marquee { fill:#29987819;stroke:#258467;stroke-width:1;pointer-events:none; }
.cut-group-box { fill:none;stroke:#167554;stroke-width:1.2;stroke-dasharray:5 3; }
.cut-item[aria-pressed=true] .cut-hit,.cut-in-marquee .cut-hit { stroke:#299878;stroke-width:1;vector-effect:non-scaling-stroke; }
.selection-actions { display:grid;gap:6px;justify-items:start; }
.layer-folder { padding-block:4px;min-width:0; }
.layer-folder>button { display:flex;align-items:center;gap:6px;color:var(--green);font-weight:600;font-size:12px;padding:5px 2px; }
.layer-folder>div { margin-left:5px;padding-left:5px;border-left:1px solid var(--line); }
.editor-menu { position:fixed;z-index:20;min-width:min(270px,95vw);max-width:95vw;max-height:90dvh;overflow:auto;padding:5px;background:var(--paper);border:1px solid var(--line);border-radius:8px;box-shadow:0 8px 35px #17362930; }
.editor-menu button { width:100%;display:grid;grid-template-columns:18px 1fr auto;align-items:center;gap:8px;text-align:left;padding:7px 8px;color:var(--ink);border-radius:4px;font-size:13px; }
.editor-menu button:hover:not(:disabled),.editor-menu button:focus-visible { background:var(--green2);outline:0; }
.editor-menu button:disabled { opacity:.45; }
.editor-menu kbd { font:11px system-ui;color:var(--muted); }
.editor-menu hr { margin:3px 0;border:0;border-top:1px solid var(--line); }
.operation-picker { width:100%;display:grid;grid-template-columns:18px 1fr 15px;align-items:center;gap:9px;text-align:left;padding:8px 10px;border:1px solid var(--line);border-radius:6px;background:white;font-size:13px; }
.operation-picker svg,.operation-menu svg { color:var(--green);justify-self:center; }
.operation-picker:hover:not(:disabled),.operation-picker[aria-expanded=true] { border-color:var(--green); }
.operation-menu { min-width:min(220px,95vw); }
.operation-menu button { min-height:44px;line-height:1.25;row-gap:2px; }
.operation-menu button>span { grid-area:1/2; }
.operation-menu button>svg:last-child { grid-area:1/3; }
.operation-menu small { grid-area:2/2/3/4;color:var(--muted);font-size:11.5px; }
.operation-menu [aria-checked=true] { background:var(--green2); }
.stage-svg-editor { position:absolute;z-index:2;top:44px;right:14px;background:var(--paper);color:var(--green); }
.stage-svg-editor[hidden] { display:none; }
.node-editor,.svg-chooser { display:grid;gap:12px; }
.svg-chooser { justify-items:start; }
.svg-chooser .field { width:100%; }
.node-page { fill:white;stroke:var(--line);vector-effect:non-scaling-stroke; }
.node-stage { cursor:default; }
.node-view { border:1px solid var(--line);border-radius:8px;overflow:hidden; }
.node-viewbar { display:flex;align-items:center;gap:2px;padding:2px 5px;background:var(--paper); }
.node-viewbar [data-view-out] { margin-left:auto; }
.node-viewbar output { min-width:4ch;text-align:center;font-variant-numeric:tabular-nums;font-size:12px; }
.node-view .node-stage { border:0;border-top:1px solid var(--line);border-radius:0; }
.node-stage:focus-visible { outline:2px solid var(--green);outline-offset:-2px; }
.node-stage.magnified { cursor:grab; }
.node-stage [data-vertex] { fill:white;stroke:var(--green);cursor:grab; }
.node-stage [data-vertex] circle { r:var(--node-radius);stroke-width:2px;vector-effect:non-scaling-stroke; }
.node-stage [data-vertex] .node-hit { r:calc(var(--node-radius) * 2.7);fill:transparent;stroke:none; }
.node-outline { fill:none;stroke:var(--green);stroke-width:1.5px;vector-effect:non-scaling-stroke;pointer-events:none; }
.node-preview { r:var(--node-radius);fill:#fff;stroke:#a1441e;stroke-width:3px;vector-effect:non-scaling-stroke;pointer-events:none; }
.node-stage.placing,.node-stage.placing [data-vertex] { cursor:crosshair; }
.node-actions [aria-pressed=true] { background:var(--green2);border-color:var(--green);color:var(--green); }
.node-stage [data-vertex].active { fill:#a1441e;stroke:#fff; }
.node-stage [data-vertex].active circle:last-child { transform:scale(1.3); }
.node-stage:active [data-vertex] { cursor:grabbing; }
.node-editor .node-hint { margin:0;color:var(--muted);font-size:12px; }
.node-kind { margin:0;padding:0;border:0;min-width:0; }
.node-kind legend { margin:0 0 5px;padding:0;color:var(--muted);font-size:12px; }
.node-kind>div { display:flex;padding:3px;gap:3px;background:var(--pale);border-radius:7px; }
.node-kind button { display:flex;flex:1;align-items:center;justify-content:center;gap:6px;min-height:34px;border:1px solid transparent;border-radius:5px;font-size:13px; }
.node-kind button[aria-pressed=true] { border-color:#bbccbd;color:var(--green);background:white;font-weight:650; }
.node-kind button:focus-visible { outline:2px solid var(--green); }
.node-handles line { stroke:#ab552b;stroke-width:1.5px;vector-effect:non-scaling-stroke;pointer-events:none; }
.node-handles .suggested line { stroke-dasharray:3 3; }
.node-stage.placing .node-handles { display:none; }
.node-handles [data-handle] { cursor:grab; }
.node-handles [data-handle]:focus { outline:none; }
.node-handles [data-handle]:active { cursor:grabbing; }
.node-handles circle { r:calc(var(--node-radius)*2.7);fill:transparent; }
.node-handles rect { x:calc(-1 * var(--node-radius));y:calc(-1 * var(--node-radius));width:calc(2 * var(--node-radius));height:calc(2 * var(--node-radius));fill:#a1441e;stroke:white;stroke-width:1.5px;vector-effect:non-scaling-stroke; }
.node-handles .suggested rect { fill:white;stroke:#a1441e; }
.node-handles [data-handle]:focus-visible rect { stroke:var(--green);stroke-width:3px; }
@media(pointer:coarse) { .node-kind button { min-height:42px; } }
.node-coordinates { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px; }
.node-actions,.node-footer { display:flex;align-items:center;gap:8px;flex-wrap:wrap; }
.node-footer { justify-content:space-between;padding-top:12px;border-top:1px solid var(--line); }
.node-footer .dialog-actions { margin-left:auto; }
@media (max-width:560px) {
  .stage-svg-editor { top:32px;right:8px; }
  .node-stage { height:clamp(152px,31dvh,260px); }
  .node-editor { gap:9px; }
}
@media (max-width:560px) and (max-height:720px) {
  .app-dialog:has(.node-editor) { max-height:96dvh; }
  .node-stage { height:clamp(120px,21dvh,155px); }
}
.cut-stage [data-guide] image { opacity:.28; }
.cut-stage [data-guide] .cut-hit { stroke:#55796e;stroke-width:1;stroke-dasharray:4 4;vector-effect:non-scaling-stroke; }
.subtract-form { display:grid; gap:14px; }
.subtract-form .field,.subtract-form select { min-width:0;max-width:100%; }
.subtract-check { display:flex;align-items:center;gap:8px;font-size:13px;cursor:pointer; }
.subtract-check input { accent-color:var(--green);width:16px;height:16px;flex:none; }
.linked-art { display:grid;gap:2px;width:100%;margin:4px 0;padding:4px 0;text-align:left;color:var(--green);font-size:13px;overflow-wrap:anywhere; }
.linked-art:hover { text-decoration:underline; }
.linked-art small { color:var(--muted);font-size:11px; }
.subtract-preview { display:grid;justify-items:center;align-content:center;gap:7px;min-height:144px;padding:10px;border:1px solid var(--line);border-radius:6px;background:repeating-conic-gradient(#e7eae4 0 25%,#f8faf6 0 50%) 0 0/16px 16px; }
.subtract-preview img { display:block;width:100%;height:110px;object-fit:contain; }
.subtract-preview span { font-size:12px;color:var(--ink);background:#f8faf6;padding:2px 6px;border-radius:3px; }
.subtract-preview span:empty,.subtract-form [hidden] { display:none; }
@media(max-width:520px) { .subtract-form .form-grid { grid-template-columns:1fr; } }
