:root{
  --bg:#050b11;--bg2:#08131d;--panel:#0c1822;--panel2:#10212e;--panel3:#132735;--line:#213746;--line2:#315065;
  --text:#ecf4f8;--muted:#8ea3b0;--yellow:#ffd21f;--yellow2:#e7b900;--cyan:#42cfff;--green:#4ce19a;--red:#ff6471;--orange:#ffab52;
  --radius:10px;--shadow:0 18px 45px rgba(0,0,0,.32);--editor-share:35%;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;color-scheme:dark;
}
*{box-sizing:border-box}html,body{height:100%;margin:0;overflow:hidden;background:var(--bg);color:var(--text)}
button,input,select,textarea{font:inherit}button{color:inherit}.hidden{display:none!important}
button{border:1px solid var(--line);background:#132431;border-radius:7px;padding:7px 10px;cursor:pointer;transition:.13s ease}
button:hover{background:#193344;border-color:#436278}button:active{transform:translateY(1px)}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--yellow);outline-offset:1px}
.app-root{height:100%;display:grid;grid-template-rows:58px minmax(0,1fr) 25px;background:radial-gradient(circle at 55% -15%,#18374b 0,#08131d 36%,#050b11 78%)}
.topbar{display:flex;align-items:center;border-bottom:1px solid var(--line);background:rgba(5,12,18,.97);backdrop-filter:blur(14px);padding:0 12px;position:relative;z-index:50}
.brand{display:flex;align-items:center;gap:10px;min-width:220px}.brand-logo{width:38px;height:38px;object-fit:contain;display:block;filter:drop-shadow(0 0 16px rgba(255,210,31,.15))}.brand-copy{display:flex;flex-direction:column}.brand-copy strong{font-size:15px;letter-spacing:.03em}.brand-copy span{font-size:9px;color:var(--muted);margin-top:2px;letter-spacing:.03em}
.menu-bar{display:flex;align-self:stretch}.menu{position:relative;display:flex;align-items:center}.menu-trigger{height:100%;border:0;border-radius:0;background:transparent;padding:0 12px;font-size:12px;color:#c9d6de}.menu-trigger:hover,.menu.open .menu-trigger{background:#142634;color:#fff}
.menu-popover{position:absolute;top:49px;left:0;display:none;min-width:270px;padding:6px;background:#0b1822;border:1px solid #345066;border-radius:9px;box-shadow:0 22px 60px rgba(0,0,0,.58);z-index:200}.menu.open .menu-popover{display:block}.menu-popover.align-right{left:auto;right:0}.menu-popover button{width:100%;display:flex;justify-content:space-between;align-items:center;border:0;background:transparent;padding:9px 10px;text-align:left;font-size:11px}.menu-popover button:hover{background:#173044}.menu-popover kbd{font:9px "Cascadia Code",Consolas,monospace;color:#79909e;background:#071018;border:1px solid #223846;border-radius:4px;padding:2px 5px}.menu-separator{height:1px;background:var(--line);margin:5px}
.quick-actions{margin-left:auto;display:flex;align-items:center;gap:6px}.icon-button{width:32px;height:32px;padding:0;display:grid;place-items:center;font-size:15px}.validate-button{font-size:11px}.run-button,.primary{background:var(--yellow);border-color:var(--yellow);color:#0a1117;font-weight:900}.run-button:hover,.primary:hover{background:#ffe056;border-color:#ffe056}
.main-area{display:grid;grid-template-rows:minmax(0,1fr) 190px;gap:7px;padding:7px;min-height:0}.main-area.dock-collapsed{grid-template-rows:minmax(0,1fr) 35px}.main-area.dock-collapsed .dock-pane{display:none!important}.main-area.dock-collapsed .bottom-dock{min-height:35px}.main-area.dock-collapsed .dock-collapse{transform:rotate(180deg)}
.workbench{display:grid;grid-template-columns:minmax(280px,var(--editor-share)) 6px minmax(520px,1fr);min-height:0;gap:0}.panel{background:linear-gradient(180deg,rgba(14,29,40,.98),rgba(8,18,27,.98));border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);min-width:0;min-height:0;overflow:hidden}
.splitter{cursor:col-resize;position:relative}.splitter:after{content:"";position:absolute;left:2px;top:42%;width:2px;height:42px;border-radius:9px;background:#294354}.splitter:hover:after,.splitter.dragging:after{background:var(--yellow)}
.editor-panel,.sim-panel{display:flex;flex-direction:column}.panel-titlebar,.sim-toolbar{height:45px;flex:none;display:flex;align-items:center;border-bottom:1px solid var(--line);background:linear-gradient(180deg,#132735,#0e202c);padding:0 10px}.panel-titlebar{justify-content:space-between}.document-title{display:flex;align-items:center;gap:7px;font-size:11px;min-width:0}.document-title strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-dot{width:8px;height:8px;background:var(--yellow);border-radius:2px}.dirty-mark{color:var(--orange);font-size:8px}.panel-tools{display:flex;gap:5px}.panel-tools button{font-size:10px;padding:5px 8px}.primary-soft{color:var(--yellow);border-color:#645918;background:#272613}
.editor-shell{position:relative;display:grid;grid-template-columns:48px 1fr;flex:1;min-height:0;background:#061018}.line-numbers{padding:12px 8px 40px 0;border-right:1px solid #1c2d38;text-align:right;color:#496273;white-space:pre;overflow:hidden;user-select:none;font:12px/1.6 "Cascadia Code",Consolas,monospace;background:#07121a}
#codeEditor{width:100%;height:100%;border:0;resize:none;outline:0;padding:12px 15px 80px;background:transparent;color:#dce9f0;caret-color:var(--yellow);font:13px/1.6 "Cascadia Code",Consolas,monospace;white-space:pre;tab-size:2;overflow:auto}
.editor-status{height:27px;flex:none;display:flex;align-items:center;gap:18px;padding:0 10px;border-top:1px solid var(--line);font-size:9px;color:var(--muted);background:#091722}.editor-status span:last-child{margin-left:auto}.status-ok{color:var(--green)!important}.status-bad{color:var(--red)!important}
.autocomplete{position:absolute;z-index:90;width:min(430px,calc(100% - 70px));max-height:250px;overflow:auto;background:#081722;border:1px solid #41677f;border-radius:9px;box-shadow:0 20px 55px rgba(0,0,0,.72)}.ac-item{display:grid;grid-template-columns:74px minmax(0,1fr) auto;gap:8px;padding:7px 12px;border-bottom:1px solid #172a36;cursor:pointer}.ac-item:hover,.ac-item.active{background:#173247}.ac-code{font:900 12px "Cascadia Code",monospace;color:var(--yellow)}.ac-name{font-size:11px}.ac-detail{grid-column:2/4;color:#8095a2;font-size:9px;line-height:1.35}.support-pill{align-self:start;border-radius:99px;padding:2px 6px;font-size:8px;background:#203845;color:#b8cad4}.support-pill.full{background:#123a2d;color:#77efb2}.support-pill.partial{background:#3b3215;color:#ffdb65}.support-pill.reference{background:#27303a;color:#a7b4bc}
.drop-overlay{position:absolute;inset:12px;border:2px dashed var(--yellow);border-radius:10px;background:rgba(7,17,24,.93);z-index:90;display:grid;place-items:center;color:var(--yellow);font-weight:800;text-align:center;padding:30px}
.sim-toolbar{gap:7px;padding:0 8px;flex-wrap:wrap;min-height:45px;height:auto}.transport{display:flex;gap:4px}.transport button,.display-modes button,.toolbar-button{height:29px;padding:0 8px;font-size:9px}.play-compact{background:var(--yellow)!important;color:#101317!important;border-color:var(--yellow)!important;font-weight:900}.display-modes{display:flex;border-left:1px solid var(--line);padding-left:7px;gap:3px}.display-modes button.active{background:#284458;border-color:#577890;color:#fff}.toolbar-select{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:9px;white-space:nowrap}.toolbar-select select{width:auto;min-width:88px;margin:0;padding:5px 8px;height:29px}.speed-control{display:flex;align-items:center;gap:5px;margin-left:auto;color:var(--muted);font-size:9px;white-space:nowrap}.speed-control input{width:80px;accent-color:var(--yellow)}.speed-control output{width:25px;color:var(--text)}
.mini-toggle{display:flex;align-items:center;gap:5px;font-size:9px;color:var(--muted);white-space:nowrap}.mini-toggle input{display:none}.mini-toggle span{width:25px;height:14px;border-radius:20px;background:#263a47;position:relative}.mini-toggle span:after{content:"";position:absolute;left:2px;top:2px;width:10px;height:10px;border-radius:50%;background:#8296a2;transition:.15s}.mini-toggle input:checked+span{background:#625514}.mini-toggle input:checked+span:after{left:13px;background:var(--yellow)}
.canvas-wrap{position:relative;flex:1;min-height:0;background:#07111a}#simCanvas{width:100%;height:100%;display:block;cursor:grab;touch-action:none}#simCanvas.dragging{cursor:grabbing}.canvas-hud{position:absolute;top:10px;display:flex;gap:6px;pointer-events:none}.hud-left{left:10px}.hud-right{right:10px}.canvas-hud div{min-width:72px;padding:5px 8px;background:rgba(4,11,16,.82);border:1px solid rgba(74,105,124,.62);border-radius:6px;backdrop-filter:blur(6px)}.canvas-hud span{font-size:8px;color:var(--muted);margin-right:6px}.canvas-hud b{font:700 10px "Cascadia Code",monospace}.camera-help{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);font-size:9px;color:#8fa5b2;background:rgba(5,12,17,.72);border:1px solid rgba(57,83,98,.55);border-radius:99px;padding:5px 10px;pointer-events:none;white-space:nowrap}.alarm-banner{position:absolute;left:50%;top:52px;transform:translateX(-50%);background:rgba(126,21,31,.96);border:1px solid var(--red);border-radius:7px;padding:7px 12px;color:#fff;font-size:10px;box-shadow:0 12px 35px rgba(0,0,0,.5)}.app-root.mode-2d .camera-help,.app-root.mode-2d .canvas-hud{display:none}.app-root.mode-2d .canvas-wrap{background:#fff}.app-root.mode-2d #simCanvas{cursor:default}
.machine-strip{height:42px;flex:none;display:grid;grid-template-columns:repeat(7,1fr);border-top:1px solid var(--line);background:#0a1720}.machine-strip div{padding:6px 8px;border-right:1px solid #1b2d38;min-width:0}.machine-strip span{display:block;font-size:7px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em}.machine-strip b{display:block;margin-top:2px;font:700 10px "Cascadia Code",monospace;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bottom-dock{display:flex;flex-direction:column}.dock-tabs{height:35px;flex:none;display:flex;align-items:center;border-bottom:1px solid var(--line);background:#0d1d28}.dock-tab{height:100%;border:0;border-radius:0;background:transparent;font-size:10px;padding:0 14px}.dock-tab.active{background:#162c3b;color:var(--yellow);box-shadow:inset 0 -2px var(--yellow)}.dock-collapse{margin-left:auto;height:100%;width:38px;border:0;border-left:1px solid var(--line);border-radius:0;background:transparent}.badge{display:inline-grid;place-items:center;min-width:18px;height:16px;padding:0 5px;border-radius:99px;background:#61212a;color:#ffdce0;font-size:8px;margin-left:4px}.badge.neutral{background:#253d4c;color:#c6d7df}.dock-pane{display:none;flex:1;min-height:0;overflow:auto}.dock-pane.active{display:block}.dock-filter{height:38px;display:flex;gap:6px;align-items:center;padding:5px 8px;border-bottom:1px solid var(--line)}.dock-filter input,.dock-filter select{height:28px;margin:0}.dock-filter input{max-width:330px}.dock-filter button{height:28px;font-size:9px}.code-filters input{max-width:none;flex:1}.code-filters select{width:180px}.catalog-note{padding:6px 9px;color:#8095a1;font-size:8px;border-bottom:1px solid var(--line);background:#0b1923}
.diagnostics{padding:7px;display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:6px}.diag{padding:8px 10px;background:#14232c;border-left:3px solid var(--orange);border-radius:0 7px 7px 0;font-size:9px}.diag.error{background:#29171c;border-color:var(--red)}.diag.info{border-color:var(--cyan)}.diag b{display:block;margin-bottom:3px}.diag span{color:#a5b6c0}.empty-state{height:100%;min-height:80px;display:grid;place-items:center;color:#69808e;text-align:center;font-size:10px;padding:20px}.variables-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:1px;background:#1d303d}.var-cell{display:flex;justify-content:space-between;background:#091722;padding:7px 10px;font:10px "Cascadia Code",monospace}.var-cell b{color:var(--yellow)}
.code-dictionary{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:6px;padding:7px}.code-card{background:#0a1822;border:1px solid #203744;border-radius:7px;padding:8px;cursor:pointer;transition:.12s}.code-card:hover{border-color:#4c7087;background:#102433}.code-card-head{display:flex;align-items:center;gap:6px}.code-card code{font:900 11px "Cascadia Code",monospace;color:var(--yellow)}.code-card strong{font-size:9px}.code-card p{margin:5px 0;color:#a7b8c1;font-size:9px;line-height:1.4}.code-card small{display:block;color:#708895;font:8px/1.35 "Cascadia Code",monospace;white-space:pre-wrap}.category-tag{margin-left:auto;color:#728a98;font-size:7px;text-transform:uppercase;letter-spacing:.06em}#traceLog{margin:0;padding:9px;font:9px/1.5 "Cascadia Code",Consolas,monospace;color:#bfd0d9;white-space:pre-wrap}
.global-statusbar{display:flex;align-items:center;gap:18px;padding:0 10px;border-top:1px solid #1d303c;background:#061018;color:#718895;font-size:8px}.global-statusbar span:not(:first-child){border-left:1px solid #1d303c;padding-left:12px}.global-statusbar #statusMessage{color:#b8c8d0}.status-spacer{flex:1;border:0!important}
.app-dialog{padding:0;border:1px solid #3a586c;border-radius:12px;background:#091722;color:var(--text);box-shadow:0 35px 110px rgba(0,0,0,.75);max-width:650px;width:min(650px,calc(100vw - 28px))}.app-dialog::backdrop{background:rgba(2,7,11,.72);backdrop-filter:blur(3px)}.wide-dialog{max-width:850px;width:min(850px,calc(100vw - 28px))}.small-dialog{max-width:420px}.dialog-card{display:flex;flex-direction:column;max-height:min(760px,calc(100vh - 30px))}.dialog-card>header{height:62px;display:flex;align-items:center;justify-content:space-between;padding:0 17px;border-bottom:1px solid var(--line);background:linear-gradient(180deg,#142938,#0f202c)}.dialog-card h2{font-size:16px;margin:2px 0 0}.eyebrow{font-size:8px;letter-spacing:.16em;color:var(--yellow);font-weight:900}.dialog-close{width:31px;height:31px;padding:0;font-size:20px;background:transparent}.dialog-body{padding:16px;overflow:auto}.dialog-card>footer{height:56px;display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:0 16px;border-top:1px solid var(--line);background:#0a1822}.dialog-card>footer button{min-width:90px}.form-section{padding:12px;border:1px solid var(--line);background:#0b1a24;border-radius:9px;margin-bottom:11px}.form-section h3{font-size:11px;margin:0 0 10px}.form-grid{display:grid;gap:9px}.form-grid.three{grid-template-columns:repeat(3,1fr)}.form-grid.two{grid-template-columns:repeat(2,1fr)}label{font-size:9px;color:var(--muted)}input,select{width:100%;margin-top:4px;padding:8px 9px;border:1px solid #294353;border-radius:7px;background:#06121a;color:var(--text);outline:0}.help-text{margin:9px 0 0;color:#748b98;font-size:9px;line-height:1.45}.offset-layout{display:grid;grid-template-columns:190px 1fr;gap:12px}.offset-list{display:flex;flex-direction:column;gap:5px}.offset-item{display:flex;justify-content:space-between;align-items:center;padding:9px;border:1px solid var(--line);border-radius:7px;background:#0b1a24;cursor:pointer}.offset-item.active{border-color:var(--yellow);background:#2a2814}.offset-item strong{font:900 11px "Cascadia Code",monospace}.offset-item span{font:8px "Cascadia Code",monospace;color:#8296a2}.offset-editor{border:1px solid var(--line);border-radius:9px;background:#0b1a24;padding:13px}.offset-selected{display:flex;align-items:center;justify-content:space-between;margin-bottom:13px}.offset-selected span{font-size:9px;color:var(--muted)}.offset-selected strong{font:900 22px "Cascadia Code",monospace;color:var(--yellow)}.button-row{display:flex;gap:7px;margin-top:12px}.button-row button{font-size:9px}.tool-preview{display:flex;align-items:center;gap:14px;padding:12px;border:1px solid var(--line);border-radius:9px;background:#0b1a24;margin-bottom:13px}.tool-preview strong,.tool-preview span{display:block}.tool-preview strong{font-size:12px}.tool-preview span{font-size:9px;color:var(--muted);margin-top:3px}.tool-icon{width:35px;height:70px;border-radius:5px 5px 12px 12px;background:linear-gradient(90deg,#889aa4,#e4edf1 45%,#778d99);position:relative}.tool-icon:after{content:"";position:absolute;left:5px;right:5px;bottom:-8px;height:14px;border-radius:0 0 50% 50%;background:var(--yellow)}.prose{font-size:11px;line-height:1.6;color:#c6d4db}.prose h3{font-size:13px;color:#fff;margin:4px 0 8px}.prose p{margin:0 0 10px}.prose kbd{font:9px "Cascadia Code",monospace;background:#061018;border:1px solid #294353;border-radius:4px;padding:2px 5px;color:var(--yellow)}
.toast{position:fixed;left:50%;bottom:42px;transform:translateX(-50%);z-index:500;background:#132835;border:1px solid #426177;border-radius:8px;padding:8px 14px;box-shadow:0 18px 50px rgba(0,0,0,.55);font-size:10px;color:#e7f1f5}.toast.error{background:#381921;border-color:var(--red)}
.app-root.sim-maximized .editor-panel,.app-root.sim-maximized .splitter,.app-root.sim-maximized .bottom-dock{display:none}.app-root.sim-maximized .main-area{grid-template-rows:minmax(0,1fr)}.app-root.sim-maximized .workbench{display:block}.app-root.sim-maximized .sim-panel{height:100%}
@media(max-width:1100px){.brand{min-width:175px}.brand-copy span{display:none}.menu-trigger{padding:0 8px}.quick-actions .icon-button{display:none}.mini-toggle,.small-hide{display:none}.machine-strip{grid-template-columns:repeat(4,1fr)}.machine-strip div:nth-child(n+5){display:none}}
@media(max-width:780px){html,body{overflow:auto}.app-root{height:auto;min-height:100%;grid-template-rows:54px auto 25px}.menu-bar{display:none}.quick-actions{margin-left:auto}.main-area{grid-template-rows:auto 260px}.workbench{display:grid;grid-template-columns:1fr;grid-template-rows:430px 0 520px}.splitter{display:none}.editor-panel{grid-row:1}.sim-panel{grid-row:3}.camera-help{display:none}.speed-control,.toolbar-select{display:none}.bottom-dock{height:260px}.form-grid.three,.form-grid.two{grid-template-columns:1fr}.offset-layout{grid-template-columns:1fr}.offset-list{display:grid;grid-template-columns:repeat(3,1fr)}.global-statusbar span:nth-child(n+3){display:none}}

/* v3 · mesa, unidades y biblioteca de cortadores */
.form-grid.four{grid-template-columns:repeat(4,minmax(0,1fr))}
.workspace-header{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;padding:13px 14px;margin-bottom:12px;border:1px solid #315065;border-radius:10px;background:linear-gradient(135deg,#102635,#0b1b26)}
.workspace-header strong,.workspace-header span{display:block}.workspace-header strong{font-size:12px;color:#f4f8fa}.workspace-header span{margin-top:4px;font-size:9px;color:#8fa4af;line-height:1.45}.unit-selector{min-width:190px;color:#c6d4db}
.check-row{display:flex;align-items:center;gap:8px;margin-top:11px;padding:9px 10px;border-radius:7px;background:#07151e;border:1px solid #213a49;cursor:pointer}.check-row input{width:auto;margin:0;accent-color:var(--yellow)}.check-row span{font-size:9px;color:#aebfc8}
.warning-text{color:#ffb65c!important}
.tool-layout{display:grid;gap:12px}.tool-preview.large{margin-bottom:0;min-height:104px}.tool-preview.large .tool-icon{flex:0 0 auto}.tool-library-section{margin-bottom:0}
.tool-note{display:flex;align-items:center;padding:8px 10px;margin-top:4px;border:1px dashed #315064;border-radius:7px;color:#8299a6;font-size:9px;line-height:1.4}.hidden-field{display:none!important}
.tool-icon.ball:after{left:4px;right:4px;bottom:-10px;height:20px;border-radius:50%}.tool-icon.face{width:50px;height:62px}.tool-icon.face:after{left:-12px;right:-12px;bottom:-5px;height:12px;border-radius:4px;background:linear-gradient(180deg,#ffe867,#cba50f)}.tool-icon.drill:after{left:6px;right:6px;bottom:-14px;height:24px;border-radius:0;clip-path:polygon(0 0,100% 0,50% 100%)}.tool-icon.chamfer:after{left:-2px;right:-2px;bottom:-12px;height:23px;border-radius:0;clip-path:polygon(0 0,100% 0,50% 100%)}
@media(max-width:900px){.form-grid.four{grid-template-columns:repeat(2,1fr)}.workspace-header{align-items:stretch;flex-direction:column}.unit-selector{min-width:0}}
@media(max-width:560px){.form-grid.four{grid-template-columns:1fr}}

/* v4.2 · autocompletado acoplado, 2D limpio y motor 3D refinado */
.autocomplete:not(.hidden):before{content:"SUGERENCIAS";position:sticky;top:0;display:block;padding:5px 12px;background:#07131d;color:#6f8998;font-size:8px;font-weight:800;letter-spacing:.14em;border-bottom:1px solid #1d3340;z-index:2}
.app-root.mode-2d .mini-toggle{opacity:.72}
.app-root.mode-2d .toolbar-button[data-action="fitView"]{display:none}

/* v4.5 · tabla de herramientas */
.tool-manager-dialog{max-width:1080px;width:min(1080px,calc(100vw - 26px))}
.tool-manager-body{display:grid;grid-template-columns:310px minmax(0,1fr);gap:14px;padding:14px}
.tool-slots-panel{display:flex;flex-direction:column;min-height:560px;border:1px solid var(--line);border-radius:10px;background:#07151e;overflow:hidden}
.tool-slots-heading{display:flex;align-items:center;justify-content:space-between;padding:12px;border-bottom:1px solid var(--line);background:#102532}.tool-slots-heading strong,.tool-slots-heading span{display:block}.tool-slots-heading strong{font-size:12px}.tool-slots-heading span{margin-top:3px;color:var(--muted);font-size:8px}.tool-slots-heading button{width:31px;height:31px;padding:0;font-size:18px}
.tool-search{width:calc(100% - 18px);margin:9px;height:33px}
.tool-slot-list{flex:1;overflow:auto;padding:0 8px 8px;display:flex;flex-direction:column;gap:5px}
.tool-slot{display:grid;grid-template-columns:50px 34px minmax(0,1fr);align-items:center;gap:8px;width:100%;padding:8px;border:1px solid #203846;border-radius:8px;background:#0b1c27;text-align:left;cursor:pointer}.tool-slot:hover{background:#112938;border-color:#3e6074}.tool-slot.active{background:#2a2814;border-color:var(--yellow);box-shadow:inset 3px 0 var(--yellow)}.tool-slot-number{font:900 12px "Cascadia Code",monospace;color:var(--yellow)}.tool-slot-copy{min-width:0}.tool-slot-copy strong,.tool-slot-copy span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tool-slot-copy strong{font-size:9px}.tool-slot-copy span{margin-top:2px;color:#7f96a3;font-size:8px}.tool-slot-glyph{width:32px;height:38px;position:relative;display:grid;place-items:center}.tool-slot-glyph:before{content:"";width:8px;height:28px;border-radius:4px;background:linear-gradient(90deg,#6e818d,#e1e9ed 48%,#667b86)}.tool-slot-glyph:after{content:"";position:absolute;bottom:1px;width:14px;height:9px;background:var(--yellow);border-radius:2px}.tool-slot-glyph.ball:after{height:13px;width:13px;border-radius:50%}.tool-slot-glyph.drill:after,.tool-slot-glyph.chamfer:after{height:14px;clip-path:polygon(0 0,100% 0,50% 100%);border-radius:0}.tool-slot-glyph.face:after{width:29px;height:7px;border-radius:50%}
.tool-slot-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:8px;border-top:1px solid var(--line)}.tool-slot-actions button{font-size:8px;padding:7px}.danger-soft{color:#ff9aa3;border-color:#63343a;background:#2a171c}
.tool-editor-panel{min-width:0}.tool-standard-note{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;margin-bottom:11px;border:1px solid #405d6f;border-radius:9px;background:#0f2431}.tool-standard-note strong{font-size:9px;color:#eaf3f7;white-space:nowrap}.tool-standard-note span{font-size:8px;line-height:1.45;color:#8fa5b1}
#toolNumber[readonly]{color:var(--yellow);font-weight:900;background:#101d24}
@media(max-width:850px){.tool-manager-body{grid-template-columns:1fr}.tool-slots-panel{min-height:260px;max-height:330px}.tool-standard-note{display:block}.tool-standard-note span{display:block;margin-top:4px}}

/* v5 · selector Fresa/Torno y paneles de torno */
.machine-switch{display:flex;gap:3px;margin:0 12px 0 10px;padding:3px;border:1px solid var(--line);border-radius:9px;background:#07141d;flex:none}.machine-switch button{display:flex;align-items:center;gap:6px;border:0;background:transparent;padding:7px 10px;font-size:10px;color:#8fa5b2}.machine-switch button.active{background:#243f50;color:#fff;box-shadow:inset 0 -2px var(--yellow)}.machine-icon{font-size:13px;color:var(--yellow)}
.app-root.lathe-mode .brand-copy span::after{content:" · Torno"}.app-root.lathe-mode .toolbar-button[data-action="fitView"]{font-size:0}.app-root.lathe-mode .toolbar-button[data-action="fitView"]::after{content:"Pieza";font-size:9px}.app-root.lathe-mode .toolbar-button[data-action="fitStock"]{display:none}.app-root.lathe-mode #showTable+span+*{display:none}.app-root.lathe-mode label:has(#showTable){display:none}.app-root.lathe-mode .camera-help{content:"Arrastra: rotar · Shift/botón derecho: mover · Rueda: zoom"}
.lathe-tool-preview{display:flex;align-items:center;gap:15px;padding:14px;border:1px solid var(--line);border-radius:9px;background:#0b1a24}.lathe-tool-preview strong,.lathe-tool-preview span{display:block}.lathe-tool-preview strong{font-size:13px}.lathe-tool-preview span{font-size:9px;color:var(--muted);margin-top:4px}.lathe-tool-glyph{width:88px;height:58px;position:relative;flex:none}.lathe-tool-glyph:before{content:"";position:absolute;left:0;top:21px;width:63px;height:16px;border-radius:3px;background:linear-gradient(180deg,#c9d5da,#7e929c);transform:skewX(-10deg);box-shadow:0 4px 12px rgba(0,0,0,.3)}.lathe-tool-glyph:after{content:"";position:absolute;right:5px;top:14px;width:28px;height:28px;background:#ffd21f;border:2px solid #5c4b0c;clip-path:polygon(100% 50%,20% 0,0 85%)}.lathe-tool-glyph.groove:after{clip-path:none;width:13px;height:31px;top:13px}.lathe-tool-glyph.thread:after{clip-path:polygon(100% 50%,0 0,0 100%)}.lathe-tool-glyph.drill:before{width:74px;height:12px;top:22px;border-radius:8px}.lathe-tool-glyph.drill:after{right:0;top:13px;width:26px;height:32px;clip-path:polygon(100% 50%,0 0,0 100%)}.lathe-tool-glyph.boring:before{width:75px}.lathe-tool-glyph.boring:after{right:0}
.app-root.lathe-mode #hudY{opacity:.4}.app-root.lathe-mode .hud-left div:nth-child(2){display:none}.app-root.lathe-mode #hudX::before{content:"Ø"}.app-root.lathe-mode #hudPlane{color:#8ed8f8}.app-root.lathe-mode #stockSummary{color:#c9d9e0}
@media(max-width:1200px){.machine-switch{margin-left:5px;margin-right:5px}.machine-switch button{padding:7px 7px}.machine-switch .machine-icon{display:none}}

.lathe-slot-glyph{width:26px;height:22px;position:relative;display:block}.lathe-slot-glyph:before{content:"";position:absolute;left:0;top:8px;width:20px;height:7px;background:#8fa3ad;border-radius:2px;transform:skewX(-12deg)}.lathe-slot-glyph:after{content:"";position:absolute;right:0;top:4px;width:10px;height:12px;background:var(--yellow);clip-path:polygon(100% 50%,0 0,0 100%)}.lathe-slot-glyph.groove:after{width:5px;clip-path:none}.lathe-slot-glyph.thread:after{clip-path:polygon(100% 50%,0 0,0 100%)}.lathe-slot-glyph.drill:before{width:22px;height:5px}.lathe-slot-glyph.drill:after{top:3px;height:13px}

/* v5.2 · seguridad, ciclos avanzados y torreta */
.lathe-only{display:none!important}
.app-root.lathe-mode .lathe-only{display:flex!important}
.safety-toggle input:checked+span{background:#63312e}
.safety-toggle input:checked+span:after{background:#ff7b6c}
.diag[data-code="CHUCK"],.diag[data-code="X_NEGATIVE"],.diag[data-code="X_TRAVEL"],.diag[data-code="Z_TRAVEL"]{box-shadow:inset 0 0 0 1px rgba(255,80,96,.22)}
.app-root.lathe-mode .alarm-banner{max-width:min(620px,calc(100% - 40px));font-weight:800}
@media(max-width:1350px){.app-root.lathe-mode .safety-toggle{display:none!important}}

/* v5.5 · visual de torno revisado */
.lathe-tool-preview{position:relative;overflow:hidden;min-height:118px;background:linear-gradient(145deg,#0d202b,#08151d)}
.lathe-tool-preview:after{content:"X / Z";position:absolute;right:12px;bottom:9px;color:#527080;font:700 8px "Cascadia Code",monospace;letter-spacing:.12em}
.lathe-tool-stage{position:relative;width:178px;height:84px;flex:0 0 178px;border:1px solid #294452;border-radius:8px;background:linear-gradient(180deg,#102633,#091720);overflow:hidden;box-shadow:inset 0 0 26px rgba(0,0,0,.35)}
.lathe-preview-centerline{position:absolute;left:10px;right:10px;top:58%;height:1px;background:repeating-linear-gradient(90deg,#4ba5c9 0 7px,transparent 7px 12px);opacity:.72}
.lathe-tool-glyph{position:absolute;inset:0;width:auto;height:auto;transform:none!important}
.lathe-tool-glyph:before,.lathe-tool-glyph:after{display:none!important}
.lathe-holder-block{position:absolute;right:13px;top:13px;width:53px;height:57px;border:1px solid #17272e;border-radius:5px;background:linear-gradient(145deg,#687981,#33444c 62%,#1f2d34);box-shadow:0 7px 15px rgba(0,0,0,.34)}
.lathe-holder-block:before,.lathe-holder-block:after{content:"";position:absolute;left:9px;right:9px;height:5px;border-radius:2px;background:#9aa8ad;box-shadow:0 18px 0 #9aa8ad}
.lathe-holder-block:before{top:10px}.lathe-holder-block:after{top:28px}
.lathe-holder-shank{position:absolute;right:48px;top:39px;width:105px;height:18px;border:1px solid #26373e;border-radius:4px 1px 1px 4px;background:linear-gradient(180deg,#c7d2d6,#71858e 52%,#40545c);transform:skewX(-9deg);box-shadow:0 6px 13px rgba(0,0,0,.32)}
.lathe-holder-shank:after{content:"";position:absolute;left:9px;right:15px;top:3px;height:2px;background:rgba(255,255,255,.35)}
.lathe-insert{position:absolute;left:14px;top:31px;width:30px;height:28px;background:#ffd21f;border:2px solid #5e4b09;clip-path:polygon(100% 50%,24% 0,0 76%,46% 100%);filter:drop-shadow(0 3px 4px rgba(0,0,0,.4))}
.lathe-tool-glyph.finish .lathe-insert{width:26px;height:25px;top:33px;clip-path:polygon(100% 50%,34% 0,0 50%,34% 100%);background:#ffe36b}
.lathe-tool-glyph.face .lathe-insert{width:28px;height:28px;top:32px;clip-path:polygon(100% 0,100% 100%,0 78%,22% 0);background:#ffd755}
.lathe-tool-glyph.groove .lathe-holder-shank{height:13px;top:42px}.lathe-tool-glyph.groove .lathe-insert{left:19px;top:29px;width:11px;height:33px;clip-path:none;background:#67d0df;border-color:#1f5963}
.lathe-tool-glyph.thread .lathe-insert{left:16px;top:29px;width:28px;height:32px;clip-path:polygon(100% 50%,0 0,0 100%);background:#f1a54e;border-color:#6b3d12}
.lathe-tool-glyph.boring .lathe-holder-shank{right:45px;top:42px;width:113px;height:11px;border-radius:8px;transform:none;background:linear-gradient(180deg,#cad5d9,#607681)}
.lathe-tool-glyph.boring .lathe-insert{left:13px;top:34px;width:24px;height:22px;clip-path:polygon(100% 50%,15% 0,0 100%);background:#ffd759}
.lathe-tool-glyph.drill .lathe-holder-shank{right:42px;top:39px;width:120px;height:14px;border-radius:8px;transform:none;background:repeating-linear-gradient(135deg,#d3dde0 0 8px,#637981 8px 14px)}
.lathe-tool-glyph.drill .lathe-insert{left:6px;top:31px;width:31px;height:30px;clip-path:polygon(100% 50%,0 0,0 100%);background:#cfd9dd;border-color:#46575e}
.lathe-tool-glyph.orientation-1,.lathe-tool-glyph.orientation-2{transform:scaleY(-1)!important}
.lathe-tool-glyph.orientation-5,.lathe-tool-glyph.orientation-6{transform:scaleX(-1)!important}
.lathe-tool-glyph.orientation-7,.lathe-tool-glyph.orientation-8{transform:scale(-1)!important}
.lathe-tool-unit{color:#738c99}
.app-root.lathe-mode .canvas-wrap{background:#08141d}
.app-root.lathe-mode #simCanvas{filter:saturate(1.04) contrast(1.02)}
@media(max-width:900px){.lathe-tool-stage{width:130px;flex-basis:130px}.lathe-holder-shank{width:75px}.lathe-tool-preview{align-items:flex-start}}


/* CNCVexa · pantalla principal */
.home-screen{height:100%;overflow:auto;background:radial-gradient(circle at 50% -12%,#17374a 0,#09131d 36%,#050b11 78%);color:var(--text)}
.home-shell{min-height:100%;width:min(1280px,100%);margin:0 auto;padding:34px clamp(18px,4vw,56px) 22px;display:flex;flex-direction:column}
.home-hero{text-align:center;display:flex;flex-direction:column;align-items:center}.home-brand-image{width:min(480px,78vw);max-height:235px;object-fit:contain;filter:drop-shadow(0 16px 38px rgba(0,0,0,.32))}.home-hero h1{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.home-hero p{max-width:710px;margin:4px auto 28px;color:#9eb1bc;font-size:13px;line-height:1.65}
.home-layout{display:grid;grid-template-columns:minmax(190px,.52fr) minmax(0,1.35fr) minmax(190px,.52fr);gap:18px;align-items:stretch}.home-projects,.home-ad-area{border:1px solid var(--line);border-radius:14px;background:linear-gradient(180deg,rgba(15,32,44,.94),rgba(7,17,25,.96));box-shadow:var(--shadow)}.home-projects{padding:22px;display:flex;flex-direction:column;justify-content:center}.home-section-heading span,.home-ad-heading>span{font-size:8px;font-weight:900;letter-spacing:.18em;color:var(--yellow)}.home-section-heading h2{margin:5px 0 18px;font-size:21px}.home-action-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.home-action-card{min-height:94px;display:flex;align-items:center;gap:13px;padding:15px;text-align:left;background:#0d202c;border-color:#294454;border-radius:10px}.home-action-card:hover{background:#153143;border-color:#5d7a8b;transform:translateY(-1px)}.home-action-card:nth-child(-n+2){border-color:#5a511c;background:linear-gradient(145deg,#222517,#10212b)}.home-action-icon{display:grid;place-items:center;width:40px;height:40px;flex:none;border:1px solid #4b6170;border-radius:9px;background:#07141c;color:var(--yellow);font-size:20px}.home-action-card strong,.home-action-card small{display:block}.home-action-card strong{font-size:11px}.home-action-card small{margin-top:5px;color:#8298a5;font-size:8px;line-height:1.45}
.home-ad-area{padding:16px;display:flex;flex-direction:column;min-height:100%}.home-ad-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;gap:8px}.home-ad-heading small{font-size:8px;color:#6f8794;text-align:right}.home-ad-slot{flex:1;min-height:310px;border:1px dashed #4a5b63;border-radius:10px;background:repeating-linear-gradient(135deg,rgba(255,255,255,.012) 0 9px,rgba(255,255,255,.025) 9px 18px);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px;color:#728792}.home-ad-slot strong{font-size:11px;color:#9eb0b9}.home-ad-slot span{max-width:220px;margin-top:7px;font-size:8px;line-height:1.5}.home-footer{display:flex;justify-content:space-between;gap:20px;margin-top:auto;padding:20px 4px 0;color:#597281;font-size:8px;letter-spacing:.05em}
.home-return-button{width:32px;height:32px;padding:0;display:grid;place-items:center;margin-right:8px;font-size:16px;flex:none}.editable-filename{cursor:text;padding:3px 5px;margin:-3px -5px;border-radius:5px;border:1px solid transparent;max-width:230px}.editable-filename:hover{border-color:#385264;background:#0b1b25}.editable-filename.editing{border-color:var(--yellow);background:#0a151d;outline:none;white-space:nowrap;overflow:hidden;min-width:120px}
@media(max-width:1180px){.home-layout{grid-template-columns:minmax(170px,.48fr) minmax(0,1fr) minmax(170px,.48fr)}.home-projects{padding:18px}.home-action-grid{grid-template-columns:1fr}.home-ad-slot{min-height:270px}}
@media(max-width:900px){.home-shell{padding-top:22px}.home-layout{grid-template-columns:1fr}.home-ad-slot{min-height:180px}.home-brand-image{max-height:190px}.home-footer{flex-direction:column;gap:5px}.home-ad-area{min-height:230px}.home-projects{order:1}.home-ad-area-left{order:2}.home-ad-area-right{order:3}}
@media(max-width:620px){.home-projects{padding:15px}.home-action-card{min-height:82px}.home-hero p{font-size:11px;margin-bottom:18px}}

/* Lanzamiento desde la portada Blogger de CNCVexa */
.external-open-prompt{position:fixed;inset:0;z-index:99999;display:grid;place-items:center;padding:20px;background:rgba(2,8,12,.78);backdrop-filter:blur(5px)}
.external-open-card{width:min(430px,100%);padding:24px;border:1px solid #315061;border-radius:14px;background:linear-gradient(180deg,#102531,#08151d);box-shadow:0 24px 70px rgba(0,0,0,.5);text-align:left}
.external-open-eyebrow{display:block;margin-bottom:6px;color:var(--yellow);font-size:8px;font-weight:900;letter-spacing:.18em}
.external-open-card h2{margin:0 0 8px;font-size:20px;color:#f3f7f9}.external-open-card p{margin:0;color:#8ca2ae;font-size:11px;line-height:1.55}
.external-open-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:22px}.external-open-actions button{padding:9px 13px;border-radius:8px;border:1px solid #355161;background:#0b1c26;color:#c3d0d6;font-weight:700;font-size:10px}.external-open-actions button:hover{background:#142b38}.external-open-actions .external-open-select{border-color:#6f631a;background:#2a2814;color:#ffe463}.external-open-actions .external-open-select:hover{background:#383319}

/* Blogger es la portada publica; esta vista queda solo como fallback local. */
.home-layout{grid-template-columns:minmax(0,900px)!important;justify-content:center}
.home-projects{width:100%}

/* CNCVexa custom-domain home content */
.home-seo-copy{margin-top:16px;padding:14px 16px;border-top:1px solid rgba(74,98,112,.45);color:#8fa5b2;font-size:9px;line-height:1.55}
.home-seo-copy strong{display:block;color:#c9d7de;font-size:10px;margin-bottom:4px}
.home-seo-copy p{margin:0;max-width:760px}
.home-seo-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:9px}.home-seo-tags span{padding:4px 7px;border:1px solid #294454;border-radius:999px;background:#0a1821;color:#86a0ae;font-size:8px}
.home-footer a{color:inherit;text-decoration:none;border-bottom:1px dotted #597281}.home-footer a:hover{color:#9eb1bc}
