/* Constant screen-size engineering dimensions. Only the selected feature gets controls. */
.ply-dimensions-host{position:relative}
.ply-dimensions{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:2;color:#673185;font:12px/1.3 var(--font-sans,system-ui,sans-serif);font-variant-numeric:tabular-nums}
.ply-dimensions[hidden]{display:none}
.studio-canvas:has(.canvas-selection-tools) .ply-dimensions{bottom:0}
.ply-dimension-lines{color:#763e96;pointer-events:none}
.ply-dimension-lines path{stroke:currentColor;stroke-width:1;stroke-linecap:square;vector-effect:non-scaling-stroke;pointer-events:none}
/* Transparent 40px hit targets keep the annotation visually separate from its editor. */
.ply-dimension-control{position:absolute;pointer-events:auto;touch-action:manipulation;display:flex;align-items:center;justify-content:center;min-height:40px;min-width:40px;max-width:calc(100% - 8px);padding:4px 7px;border:0;border-radius:0;background:transparent;color:inherit;box-shadow:none;font:500 13px/1.3 var(--font-sans,system-ui,sans-serif);font-variant-numeric:tabular-nums;white-space:nowrap;cursor:text;user-select:none;text-underline-offset:3px}
.ply-dimension-control:hover,.ply-dimension-control[aria-expanded=true]{background:transparent;text-decoration:underline}
.ply-dimension-control:focus-visible{outline:1px dashed currentColor;outline-offset:-5px;text-decoration:underline}
.ply-dimension-editor{box-sizing:border-box;position:fixed;inset:auto;margin:0;z-index:1000;width:288px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow:auto;overscroll-behavior:contain;padding:14px;border:1px solid #b2c3ce;border-radius:7px;background:#fff;color:#21343e;box-shadow:0 12px 36px #102d3e26,0 1px 4px #102d3e14;font:12px/1.4 var(--font-sans,system-ui,sans-serif);font-variant-numeric:tabular-nums}
.ply-dimension-editor::backdrop{background:transparent;pointer-events:none}
.ply-dimension-editor>strong{display:block;font-size:13px;margin-bottom:12px}
.ply-dimension-editor label{display:block;font-size:11px;font-weight:600;margin:10px 0 5px}
.ply-dimension-editor input,.ply-dimension-editor select{box-sizing:border-box;width:100%;min-height:40px;border:1px solid #aabcc6;border-radius:4px;background:#fff;color:inherit;padding:7px 9px;font:inherit;font-size:16px;font-variant-numeric:tabular-nums}
.ply-dimension-editor select{font-size:12px}
.ply-dimension-editor input:focus-visible,.ply-dimension-editor select:focus-visible,.ply-dimension-editor button:focus-visible{outline:2px solid #17618c;outline-offset:2px}
.ply-dimension-editor input[aria-invalid=true]{border-color:#a22d27}
.ply-dimension-explanation{font-size:11px;line-height:1.45;color:#51636e;margin:10px 0}
.ply-dimension-error{font-size:11px;line-height:1.45;color:#a22d27;margin:8px 0}
.ply-dimension-error:empty{display:none}
.ply-dimension-actions{display:flex;gap:8px;margin-top:12px}
.ply-dimension-actions button{flex:1;min-height:40px;min-width:40px;border:1px solid #bcc8ce;border-radius:4px;padding:7px 10px;background:#fff;color:inherit;font:600 12px/1.3 var(--font-sans,system-ui,sans-serif);cursor:pointer;touch-action:manipulation}
.ply-dimension-actions .ply-dimension-apply{color:#fff;background:#185e83;border-color:#185e83}
.ply-dimension-actions button:hover{filter:brightness(.95)}
.ply-dimension-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(forced-colors:active){.ply-dimension-control,.ply-dimension-editor{border-color:ButtonText}.ply-dimension-lines path{stroke:CanvasText}.ply-dimension-actions .ply-dimension-apply{color:HighlightText;background:Highlight}}

.ply-dimension-arrow{fill:currentColor;stroke:none;pointer-events:none}
.ply-dimension-control[hidden]{display:none}

/* Continuous witness lines, heavier measures, no masks over the geometry. */
.ply-dimension-lines .ply-dimension-measure{stroke-width:1.75px}
.ply-dimension-lines .ply-dimension-extension{stroke-width:1px;stroke-opacity:.8}
.ply-dimension-lines .ply-dimension-leader{stroke-width:1px}
.ply-dimensions.is-dragging .ply-dimension-control{pointer-events:none;opacity:1;cursor:default}
.ply-dimension-options{display:flex;flex-wrap:wrap;gap:4px;margin:8px 0}
.ply-dimension-options button{flex:1;min-width:40px;min-height:40px;padding:5px 8px;border:1px solid #c6ccd1;border-radius:4px;background:white;color:inherit;font:600 12px/1.2 var(--font-sans,system-ui,sans-serif);cursor:pointer}
.ply-dimension-options button[aria-pressed=true]{background:#f0e5f8;border-color:#9666af;color:#673185}
