/* Canvas editing chrome. Geometry remains solid; only interaction overlays carry accents. */
.studio-canvas{isolation:isolate}
/* Neutral drafting surface keeps unboxed annotations readable inside and outside the part. */
.studio-canvas .plate{fill:#d7dfe2;stroke:#424b50;stroke-width:1.25px;vector-effect:non-scaling-stroke}
.studio-canvas .local-region{stroke-dasharray:none;fill:#d86a3218}
.studio-canvas .feature-selected{stroke:#176a99!important;stroke-width:1.75px!important;vector-effect:non-scaling-stroke;fill:#e5f4ff!important}
.studio-canvas .canvas-editable-outline{fill:none;stroke:#0076ba;stroke-width:3px;stroke-linejoin:round;stroke-linecap:round;vector-effect:non-scaling-stroke;pointer-events:none}
.studio-canvas [data-feature-label]{paint-order:stroke;stroke:#f7fafc;stroke-width:3px;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.studio-canvas .selection-envelope{fill:none;stroke:#2476a4;stroke-opacity:.5;stroke-width:1px;stroke-dasharray:3 4;vector-effect:non-scaling-stroke}
.studio-canvas .group-envelope{stroke-dasharray:4 3}
.canvas-feature-hit{fill:transparent;stroke:transparent;cursor:move;outline:none}
.canvas-feature-hit:focus-visible{stroke:#2476a450;stroke-width:6px}
.canvas-resize-handle,.studio-canvas .vertex-handle{fill:white;stroke:#176a99;stroke-width:1.4px;vector-effect:non-scaling-stroke;outline:none}
.canvas-resize-handle:hover,.canvas-resize-handle:focus-visible{fill:#d9edf7;stroke:#114b6d;stroke-width:2px}
.midpoint-handle{fill:#eaf4f9;stroke:#176a99;stroke-width:1px;vector-effect:non-scaling-stroke;cursor:copy;outline:none}
.midpoint-handle:hover,.midpoint-handle:focus-visible{fill:#f3c58a;stroke:#93521e}
.canvas-selection-tools{position:absolute;left:50%;bottom:14px;transform:translateX(-50%);display:flex;align-items:center;gap:5px;padding:5px 7px;border:1px solid #c2ccd2;border-radius:6px;background:#fff;box-shadow:0 3px 12px #172d3d13;z-index:3;max-width:calc(100% - 16px);white-space:nowrap;overflow:auto}
.canvas-selection-tools .btn,.canvas-selection-tools select{min-height:32px;font-size:11px;font-family:inherit;padding:5px 8px;border-radius:4px;background:#fff}
.selection-count{padding:0 5px;font-size:10px;color:#52616a;font-variant-numeric:tabular-nums}
.canvas-align{display:flex;align-items:center}
.canvas-align select{border:1px solid var(--line,#c8cdd0);color:inherit;max-width:150px}
.feature-controls .canvas-selection-tools{position:static;transform:none;max-width:100%;box-shadow:none;flex-wrap:wrap;margin:12px 0;overflow:visible}
.canvas-history{display:flex;gap:3px}
.canvas-history .btn{min-height:32px;min-width:32px;padding:3px 7px;font-size:17px}
.canvas-history .btn:disabled{opacity:.35;cursor:default}
.feature-list .feature-row[aria-pressed=true]{background:#e8f2f8;color:#125979}
.feature-controls .canvas-properties{gap:8px 12px}
.feature-controls .canvas-properties .field{font-size:11px;margin-bottom:6px}
.feature-controls .canvas-properties input{font-variant-numeric:tabular-nums}
.canvas-only{grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important}
.feature-studio.feature-embedded{height:100%;max-height:100%;width:100%;min-width:0;min-height:0;background:transparent}
.feature-embedded>.feature-preview{flex:1;min-height:0;width:100%;grid-template-rows:auto minmax(0,1fr) 30px}
.feature-embedded .studio-tools{padding:6px 10px;gap:6px}
.feature-embedded .studio-tools .studio-zoom{margin-left:auto}
.feature-embedded .feature-status{position:absolute;bottom:44px;left:12px;z-index:2;max-width:min(500px,calc(100% - 24px));font-size:11px;line-height:1.45;color:#375061;background:#f8fafbeF;border-radius:4px;padding:5px 8px;pointer-events:none}
.feature-embedded .feature-status:empty{display:none}
.feature-embedded .feature-status:empty:before{content:none}
.feature-embedded:has(.canvas-selection-tools) .feature-status{bottom:89px}
.studio-inspector:has(.feature-controls){height:100%;min-height:0;overflow:hidden}
.studio-inspector>.feature-controls{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain}
.studio-inspector>.feature-controls .selected-feature{margin-top:8px;padding:12px}
.studio-inspector>.feature-controls .selected-feature h3{margin:0 0 10px;font-size:13px;text-transform:capitalize}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
@media(max-width:720px){
  .feature-embedded>.feature-preview{grid-template-rows:auto minmax(0,1fr) 25px}
  .feature-embedded .studio-tools{gap:3px;padding:4px 6px}
  .feature-embedded .studio-tools .studio-quick{margin-left:0}
  .feature-embedded .studio-tools .studio-zoom{margin-left:auto}
  .feature-embedded .studio-canvas{padding:8px 16px}
  .canvas-selection-tools{bottom:8px;padding:4px;gap:3px}
  .canvas-selection-tools .btn,.canvas-selection-tools select{font-size:10px;padding:5px 6px}
  .canvas-selection-tools .selection-count{font-size:9px;padding:0 3px}
  .canvas-align select{max-width:110px}
  .feature-embedded .feature-status{bottom:35px;font-size:10px}
  .feature-embedded:has(.canvas-selection-tools) .feature-status{bottom:79px}
}

/* Pointer targets stay usable at all viewport sizes. */
.studio-tools .btn,.canvas-history .btn,.canvas-selection-tools .btn,.canvas-selection-tools select{min-height:40px;min-width:40px}

/* Transient interaction geometry. These overlays never enter the panel specification. */
.studio-canvas .canvas-snap-guide{stroke:#b24b16;stroke-width:1px;stroke-dasharray:5 3;vector-effect:non-scaling-stroke}
.studio-canvas .canvas-marquee{fill:#176a9915;stroke:#176a99;stroke-width:1px;vector-effect:non-scaling-stroke}
.studio-canvas .canvas-marquee.crossing{fill:#18764c13;stroke:#18764c;stroke-dasharray:5 3}
.studio-canvas .marquee-selected{stroke:#176a99!important;fill:#e5f4ff!important;vector-effect:non-scaling-stroke}
.studio-canvas .feature-ghost{stroke:#176a99;stroke-width:1.5px;stroke-dasharray:4 3;fill:#176a9914;vector-effect:non-scaling-stroke}
.studio-canvas.pattern>svg{cursor:crosshair}
.studio-canvas .pattern-ghost-hole{fill:#fff;fill-opacity:.9}
.studio-canvas .pattern-ghost.refused .feature-ghost{stroke:#b3261e;fill:#b3261e14}
.canvas-drag-readout{position:absolute;left:50%;top:12px;transform:translateX(-50%);z-index:4;max-width:calc(100% - 24px);padding:7px 10px;border-radius:0;background:transparent;color:#673185;box-shadow:none;font-size:12px;font-variant-numeric:tabular-nums;pointer-events:none}
.canvas-drag-readout:empty{display:none}
.studio-canvas{touch-action:none}
.canvas-align,.canvas-distribute{display:flex;gap:2px;border-left:1px solid #dbe1e5;padding-left:5px}
.canvas-selection-tools .canvas-icon{font-size:17px;padding:4px;flex-shrink:0}
.canvas-options{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px}
.canvas-options .btn{min-height:40px;padding:6px 9px;font-size:11px;line-height:1.25;white-space:normal;text-align:left}
.canvas-options [aria-pressed=true],.snap-control [aria-pressed=true],.studio-quick [aria-pressed=true]{background:#e8f2f8!important;border-color:#7bafca!important;color:#125979!important}
.option-field>span{display:block}
.studio-tools .snap-control{display:flex;align-items:center;gap:2px;font-size:10px;white-space:nowrap}
.studio-tools .snap-control .btn{padding:3px;min-width:32px;font-size:11px}
.studio-tools .studio-quick{display:flex;gap:3px}
.studio-tools .studio-quick .canvas-icon{display:flex;align-items:center;justify-content:center;gap:4px;padding:5px 7px;font-size:11px}
.studio-quick .canvas-icon>span:first-child{font-size:17px}
.canvas-feature-tree{flex:0 1 auto;min-height:44px;max-height:30%;overflow:auto;overscroll-behavior:contain;border-bottom:1px solid #dbe1e5;padding:0 12px 5px;background:#f8fafb}
.feature-tree-heading{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:4px;min-height:40px;background:#f8fafb;font-size:11px;font-weight:600;font-variant-numeric:tabular-nums}
.feature-tree-heading .btn{font-size:11px;padding:4px 8px;min-height:36px}
.canvas-feature-tree .feature-list{margin:0}
.canvas-feature-tree .feature-list>div{gap:3px}
.canvas-feature-tree .feature-row{display:flex;justify-content:flex-start;gap:7px;min-width:0;min-height:40px;padding:4px 7px;border:0;border-radius:4px;background:transparent;font-family:inherit;cursor:pointer}
.canvas-feature-tree .tree-icon{font-size:17px;flex-shrink:0}
.canvas-feature-tree .tree-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}
.canvas-feature-tree .tree-dimensions{margin-left:auto;color:#52616a;font-size:10px;font-variant-numeric:tabular-nums;white-space:nowrap}
.canvas-feature-tree .canvas-icon{min-width:40px;min-height:40px;padding:4px;background:transparent;border:0;font-size:17px}
.canvas-feature-tree .feature-row:hover,.canvas-feature-tree .canvas-icon:hover{background:#edf2f5}
.canvas-feature-tree .tree-empty{font-size:11px;color:#65747c;margin:2px 7px 7px}
.canvas-feature-tree button:focus-visible,.canvas-options button:focus-visible,.studio-tools button:focus-visible,.canvas-selection-tools button:focus-visible{outline:2px solid #176a99;outline-offset:-2px}
/* Keep the selection actions clear of the editable lower dimension line. */
.studio-canvas>.canvas-selection-tools{top:10px;bottom:auto}
.feature-embedded:has(.canvas-selection-tools) .feature-status{bottom:44px}
@media(max-width:1000px){
  .feature-embedded .studio-tools{flex-wrap:wrap}
  .studio-tools .studio-quick .canvas-icon{font-size:10px;padding:4px 5px}
  .canvas-selection-tools{max-width:calc(100% - 12px)}
}
@media(max-width:720px){
  .canvas-feature-tree{max-height:28%;padding:0 8px 4px}
  .studio-tools .studio-quick .canvas-icon>span:last-child{display:none}
  .studio-tools .snap-control .btn{min-width:28px}
  .feature-tree-heading{min-height:36px}
  .feature-embedded:has(.canvas-selection-tools) .feature-status{bottom:35px}
}

/* Always-available controls; dimensions use a separate visual language from profiles. */
.studio-tools .snap-control{display:flex!important}
.studio-tools .snap-control .btn{min-height:40px;padding:5px 9px;font-size:12px}
.studio-canvas line.panel-dimension{stroke:#763e96;stroke-width:1.75px;vector-effect:non-scaling-stroke}
.studio-canvas text.panel-dimension{fill:#673185;stroke:none;font-weight:500}
.studio-canvas marker[id^="panel-arrow-"] path{fill:#763e96}
.studio-canvas.is-dragging .canvas-selection-tools{visibility:hidden}
.studio-canvas.is-dragging .canvas-drag-readout{font-size:15px;font-weight:500;color:#673185;top:10px}
.feature-controls .canvas-position{margin-top:6px;gap:8px 12px}
.feature-controls .canvas-position .field{margin:0}
.feature-controls .studio-tolerance{display:flex;align-items:center;gap:12px;margin:10px 0 4px;padding:0;border:0}
.feature-controls .studio-tolerance .field{flex:1;max-width:170px;margin:0}
.feature-controls .studio-tolerance small{flex:1;color:#5a6570;font-size:11px;line-height:1.3}
@media(max-width:720px){.studio-tools .snap-control .btn{font-size:11px;padding:5px 7px}}
.studio-canvas line.panel-dimension:not([marker-start]){stroke-width:1px;stroke-opacity:.8}
/* Direct numeric controls: one compact row, with a precise value beside each slider. */
.feature-controls .compact-parameters{display:grid;grid-template-columns:1fr;gap:8px}
.feature-controls .cad-slider{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(56px,1fr) 76px;align-items:center;gap:6px 8px;margin:0;font-size:12px}
.feature-controls .cad-slider span{min-width:0;line-height:1.25}
.feature-controls .cad-slider input[type=number]{width:100%;min-height:34px;padding:5px 4px;font-size:13px;font-variant-numeric:tabular-nums;text-align:right}
.feature-controls .cad-slider input[type=range]{width:100%;height:22px;min-height:22px;margin:0;padding:0;accent-color:#176a99;cursor:ew-resize}
.compact-boundary{margin-top:16px;padding-top:12px;border-top:1px solid #dbe1e5}
.feature-controls .compact-boundary h3{font-size:13px;margin:0 0 8px}
.edge-profiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin-bottom:10px}
.edge-choice{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:0;min-height:58px;padding:5px 3px;border:1px solid #ccd4d8;border-radius:4px;background:transparent;color:#4b5c65;font:500 11px/1.2 var(--font-sans,system-ui,sans-serif);cursor:pointer}
.edge-choice svg{width:40px;height:24px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linejoin:round}
.edge-choice:hover{background:#edf4f7}.edge-choice[aria-pressed=true]{background:#e5f2fa;border-color:#176a99;color:#125979}
.cad-choice-row{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:7px 0;font-size:12px}
.cad-choice-row .canvas-options{margin:0;gap:3px}.cad-choice-row .btn{min-height:34px;padding:4px 9px}
.edge-scope{max-height:120px;overflow:auto}.edge-feedback{display:block;margin-top:8px;font-size:10px;color:#65747c}
.compact-boundary .edge-advanced{margin:8px 0;font-size:11px}.compact-boundary summary{cursor:pointer}
.studio-canvas .canvas-edge-details path{fill:#c97b2526;stroke:#a86721;stroke-width:1px;stroke-dasharray:4 3;vector-effect:non-scaling-stroke}
@media(max-width:720px){.feature-controls .cad-slider input[type=number]{font-size:16px}}
.feature-controls .compact-boundary .cad-choice-row .canvas-options{display:flex;flex-wrap:nowrap;gap:4px;width:auto;grid-template-columns:none}
.feature-controls .compact-boundary .cad-choice-row .btn{width:auto;min-width:42px;min-height:32px;padding:4px 8px;flex:0 0 auto}
.feature-controls .compact-boundary .cad-choice-row{margin:5px 0}
.feature-controls .compact-boundary .edge-advanced{margin:5px 0}

.studio-inspector>.feature-status{flex:none;margin:0;padding:7px 14px;max-height:70px;overflow:auto;font-size:11px;line-height:1.4;border-top:1px solid #dbe1e5;color:#375061}
.studio-inspector>.feature-status:empty{display:none}
.studio-inspector>.feature-status[role=alert]{color:#8a301f;background:#fff3ec}
.feature-controls .pattern-wizard h2{margin-bottom:4px}
.feature-controls .pattern-step{margin:14px 0 0;padding:12px 0 0;border-top:1px solid #e3e8ec}
.feature-controls .pattern-step h3{display:flex;align-items:center;gap:8px;margin:0 0 8px;font-size:13px}
.feature-controls .pattern-step-n{display:inline-grid;place-items:center;width:20px;height:20px;border-radius:50%;background:#176a99;color:#fff;font-size:11px;font-weight:700;flex:none}
.feature-controls .pattern-result{margin-top:14px;padding:10px 12px;background:#f6f9fb;border:1px solid #d6e2ea;border-radius:6px}

.pattern-hole-choices{max-height:240px;overflow:auto;border:1px solid #d6e2ea;border-radius:6px;padding:4px 8px}
.pattern-hole-choices label{display:flex;align-items:center;gap:8px;min-height:40px;font-size:12px;font-variant-numeric:tabular-nums}
.pattern-sources{margin-top:16px;padding-top:12px;border-top:1px solid #e3e8ec}
.pattern-sources textarea{width:100%;box-sizing:border-box;font-family:ui-monospace,monospace}
.pattern-sources input[type=file]{width:100%;max-width:100%;font-size:12px}
