/* CNC Studio · Ferramentas CAD (R27 v1.2.3): explosão, Raio X, arestas, grade e orientador. */
.cad-tool-group{display:inline-flex;align-items:center;gap:2px;padding-left:6px;margin-left:2px;border-left:1px solid var(--line)}
.cad-tool-group .tool-button svg{fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
.cad-panel{position:absolute;top:12px;left:12px;z-index:6;width:300px;max-width:calc(100% - 24px);max-height:calc(100% - 24px);overflow:auto;box-sizing:border-box;padding:14px 15px 12px;border:1px solid #dfe7ec;border-radius:10px;background:rgba(255,255,255,.96);box-shadow:0 14px 38px rgba(24,45,60,.16);color:#34495a;font-size:11px;backdrop-filter:blur(10px)}
.cad-panel[hidden],.cad-gizmo[hidden],.cad-caption[hidden]{display:none!important}
.cad-panel-head{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:10px}
.cad-panel-head h3{margin:3px 0 0;font-size:14px;font-weight:600;color:#24323c}
.cad-panel .eyebrow{font-size:9px;letter-spacing:1.4px;color:#8a9aa5;font-weight:600}
.cad-row{display:flex;justify-content:space-between;align-items:center;margin:8px 0 4px;color:#5b6f7c}
.cad-row output{font-variant-numeric:tabular-nums;font-weight:600;color:var(--teal)}
.cad-panel input[type=range]{width:100%;accent-color:var(--teal);margin:2px 0 6px}
.cad-chips{display:flex;gap:6px;margin:4px 0 8px}
.cad-chips button{flex:1;border:1px solid #d9e3e8;background:#f6f9fa;color:#4d6573;border-radius:6px;padding:5px 0;font-size:10.5px;cursor:pointer}
.cad-chips button:hover{border-color:var(--teal);color:var(--teal)}
.cad-note{margin:2px 0 4px;font-size:10px;line-height:1.45;color:#8193a0}
.cad-divider{height:1px;background:var(--line);margin:11px 0 6px}
.cad-switch-row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:7px 0}
.cad-switch-row span{display:flex;flex-direction:column;gap:2px}
.cad-switch-row b{font-weight:600;color:#2e404c;font-size:11.5px}
.cad-switch-row small{font-size:9.5px;color:#8a9aa5;line-height:1.35}
.cad-switch{flex:none;position:relative;width:34px;height:19px;border-radius:12px;border:0;background:#cfd9df;cursor:pointer;transition:background .18s}
.cad-switch::after{content:"";position:absolute;top:2px;left:2px;width:15px;height:15px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .18s}
.cad-switch[aria-checked="true"]{background:var(--teal)}
.cad-switch[aria-checked="true"]::after{transform:translateX(15px)}
.cad-caption{display:inline-block;margin-top:6px;padding:3px 8px;border-radius:10px;background:var(--teal-soft);color:var(--teal);font-size:10px;font-weight:600;letter-spacing:.2px}
.cad-gizmo{position:absolute;right:16px;bottom:84px;z-index:4;width:122px;display:flex;flex-direction:column;align-items:center;gap:2px;user-select:none;-webkit-user-select:none}
.cad-gizmo svg{width:122px;height:122px;overflow:visible;cursor:grab;touch-action:none;fill:none;stroke:none}
.cad-gizmo svg:active{cursor:grabbing}
.cad-gizmo-bg{fill:rgba(255,255,255,.35);stroke:rgba(120,140,155,.25);stroke-width:1;transition:fill .2s}
.cad-gizmo:hover .cad-gizmo-bg{fill:rgba(255,255,255,.7)}
.cad-gizmo-line{stroke-width:3;stroke-linecap:round}
.cad-gizmo-ball{cursor:pointer;outline:none}
.cad-gizmo-ball circle{stroke:rgba(255,255,255,.9);stroke-width:1.4;transition:transform .12s}
.cad-gizmo-ball.negative circle{stroke:none}
.cad-gizmo-ball:hover circle,.cad-gizmo-ball:focus-visible circle{transform:scale(1.22)}
.cad-gizmo-ball text{fill:#fff;font:700 11px/1 Inter,system-ui,sans-serif;text-anchor:middle;pointer-events:none;stroke:none}
.cad-gizmo-center{fill:#8fa1ad;cursor:pointer}
.cad-gizmo-center:hover{fill:var(--teal)}
.cad-gizmo-label{min-height:13px;font-size:10px;font-weight:600;color:#6b828e;letter-spacing:.3px}
[data-theme="dark"] .cad-panel{background:rgba(13,20,29,.95);border-color:#233446;color:#a1b6c4;box-shadow:0 16px 40px rgba(0,0,0,.45)}
[data-theme="dark"] .cad-panel-head h3,[data-theme="dark"] .cad-switch-row b{color:#f0f6fc}
[data-theme="dark"] .cad-row{color:#9fb2c0}
[data-theme="dark"] .cad-chips button{background:#141f2b;border-color:#24374a;color:#a9bccb}
[data-theme="dark"] .cad-switch{background:#2a3a4b}
[data-theme="dark"] .cad-gizmo-bg{fill:rgba(13,20,29,.35);stroke:rgba(96,165,250,.18)}
[data-theme="dark"] .cad-gizmo:hover .cad-gizmo-bg{fill:rgba(13,20,29,.75)}
[data-theme="dark"] .cad-gizmo-ball circle{stroke:rgba(10,14,20,.85)}
[data-theme="dark"] .cad-gizmo-label{color:#8ea3b3}
@media (max-width:1180px){.cad-tool-group .tool-button span{display:none}}
@media (max-width:900px){.cad-gizmo{right:10px;bottom:62px;width:96px}.cad-gizmo svg{width:96px;height:96px}.cad-panel{width:calc(100% - 24px)}}
