/* Editor 3D funciona como aplicación independiente de la navegación pública. */
/* El editor ocupa toda la ventana: no reserva espacio para navbar ni selector público. */
.personalization-page.is-editor #standalone-language-panel{display:none!important}
.personalization-page.is-editor{padding-top:0!important}

/* Menús del editor alineados con el tema público claro.
 * El plano 3D ya era claro y se conserva, igual que los colores de cada pieza. */
.editor-shell{width:calc(100% - 40px);max-width:1800px;margin:22px auto 50px}
.editor-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:19px}
.editor-title .p-eyebrow{margin-bottom:3px}
.editor-title h1{margin:0;font-size:1.9rem;line-height:1.12;letter-spacing:-.035em}
.editor-title p{color:var(--p-muted);margin:5px 0 0;font-size:.86rem}
.editor-projectbar{display:flex;align-items:center;gap:20px;background:var(--p-card);border:1px solid var(--p-line);border-radius:14px 14px 0 0;padding:15px 18px}
.project-title-label{display:flex;flex-direction:column;gap:3px;min-width:140px;max-width:360px;flex:1;font-size:.68rem;letter-spacing:.06em;color:var(--p-muted)}
.project-title-label input{background:var(--p-card);color:var(--p-text);border:0;border-bottom:1px solid var(--p-input-line);padding:5px 0;font-size:1.05rem;font-weight:700;border-radius:0;min-width:0;width:100%}
.project-save-state{font-size:.75rem;color:var(--p-muted);flex:1}
.project-actions{display:flex;gap:10px;flex-shrink:0}
.project-actions .project-nav-link{white-space:nowrap;text-decoration:none}
.editor-notice{padding:11px 16px;background:var(--p-soft);border-left:1px solid var(--p-line);border-right:1px solid var(--p-line);font-size:.78rem;color:#365472}
.editor-notice a{color:var(--p-primary-hover)}
.editor-notice button{border:1px solid var(--p-soft-line);color:var(--p-primary-hover);background:var(--p-card);border-radius:6px;margin:4px 4px 4px 8px;padding:5px 9px;cursor:pointer}
.editor-toolbar{display:flex;align-items:center;gap:5px;flex-wrap:wrap;padding:10px 13px;background:var(--p-subtle);border:1px solid var(--p-line)}
.editor-toolbar button{padding:8px 10px;border:1px solid var(--p-input-line);border-radius:7px;color:var(--p-text);background:var(--p-card);font-size:.78rem;min-height:38px;white-space:nowrap;cursor:pointer}
.editor-toolbar button[aria-pressed=true]{background:var(--p-soft);color:var(--p-primary-hover);border-color:var(--p-primary)}
.editor-toolbar button:not(:disabled):hover,.editor-notice button:hover,.side-button:hover,.stage-views button:hover{background:var(--p-soft);border-color:#9bc9f5;color:var(--p-primary-hover)}
.stage-views button[aria-pressed=true]{background:var(--p-soft);border-color:var(--p-primary);color:var(--p-primary-hover)}
.editor-toolbar button:disabled{opacity:.35;cursor:not-allowed}
.tool-divider{height:22px;width:1px;background:var(--p-line);margin:0 5px}
.editor-layout{display:grid;grid-template-columns:182px minmax(200px,1fr) 254px;grid-template-areas:'shapes stage properties';min-height:560px;height:min(690px,72vh);border:1px solid var(--p-line);border-top:0}
.editor-side{background:var(--p-card);padding:16px;overflow-y:auto;min-height:0;scrollbar-width:thin;scrollbar-color:#bfcedd #f4f7fb}
.editor-side h2{margin:0 0 8px;font-size:.88rem}
.editor-small{font-size:.72rem;color:var(--p-muted);line-height:1.55;margin:7px 0 13px}
.editor-shapes{grid-area:shapes;border-right:1px solid var(--p-line)}
.editor-inspector{grid-area:properties;border-left:1px solid var(--p-line)}
.shape-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.shape-grid button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;background:var(--p-subtle);border:1px solid var(--p-input-line);border-radius:9px;color:var(--p-text);font-size:.74rem;padding:8px 2px;min-height:79px;cursor:pointer}
.shape-grid button:hover{border-color:var(--p-primary);background:var(--p-soft)}
.shape-symbol{display:block;font-size:1.65rem;color:var(--p-primary);line-height:1.2;text-shadow:2px 2px 0 #c3ddf6}
.shape-symbol.text{font-weight:800;text-shadow:none;font-size:1.45rem;color:var(--p-primary)}
.shape-grid button:nth-child(even) .shape-symbol{color:var(--p-primary-hover);text-shadow:2px 2px 0 #c3ddf6}
.editor-side .section-gap{margin-top:22px}
.side-button{display:flex;align-items:center;justify-content:center;width:100%;border:1px solid var(--p-input-line);border-radius:7px;padding:8px 6px;background:var(--p-subtle);color:var(--p-text);font-size:.76rem;margin:7px 0;min-height:37px;text-align:center;cursor:pointer}
.file-button{box-sizing:border-box}
.editor-side details{font-size:.76rem}
.editor-side summary{cursor:pointer;padding:6px 0}
.editor-side hr{border:0;border-top:1px solid var(--p-line);margin:18px 0}
.editor-stage{position:relative;grid-area:stage;min-height:0;background:#dce6ed;overflow:hidden;isolation:isolate}
#editor-canvas{position:absolute;inset:0;touch-action:none;outline:none}
#editor-canvas canvas{display:block;width:100%;height:100%}
.stage-views{position:absolute;z-index:3;top:12px;left:12px;display:flex;gap:5px;max-width:calc(100% - 24px);overflow-x:auto}
.stage-views button{min-height:33px;border:1px solid var(--p-input-line);border-radius:6px;padding:6px 10px;color:var(--p-text);background:rgba(255,255,255,.92);font-size:.74rem;font-weight:650;white-space:nowrap;cursor:pointer}
.stage-bottom{position:absolute;z-index:3;bottom:0;left:0;right:0;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px 10px;background:rgba(248,250,252,.95);padding:7px 11px;font-size:.69rem;color:var(--p-muted);pointer-events:none}.stage-bottom #scene-info{white-space:nowrap;flex:0 0 auto}
.stage-bottom label{display:flex;align-items:center;gap:6px;pointer-events:auto}
.stage-bottom select,.stage-bottom input{background:#fff;color:var(--p-text);border:1px solid var(--p-input-line);padding:4px 5px;border-radius:5px;font-size:.73rem}.stage-bottom input{width:48px}
.editor-loading{position:absolute;inset:0;z-index:5;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;background:rgba(248,250,252,.94);color:var(--p-text);padding:30px;font-size:.95rem}
.editor-loading button{margin-top:15px;border-radius:6px;background:var(--p-primary);border:0;color:#fff;padding:9px 15px;cursor:pointer}
.object-list{display:grid;gap:6px;max-height:168px;overflow-y:auto}
.object-row{display:flex;align-items:center;gap:8px;background:var(--p-subtle);border:1px solid var(--p-input-line);border-radius:7px;padding:8px 7px;font-size:.76rem;min-height:38px;cursor:pointer}
.object-row:hover{border-color:#9bc9f5}
.object-row.selected{border-color:var(--p-primary);background:var(--p-soft)}
.object-row input{margin:0;width:16px;height:16px;accent-color:var(--p-primary);flex-shrink:0}
.object-row .object-swatch{width:10px;height:10px;border-radius:50%;border:1px solid #97aec5;flex-shrink:0}
.object-row>span:nth-of-type(2){overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}.object-export-stl{flex:0 0 auto;border:1px solid var(--p-input-line);border-radius:5px;background:#fff;color:var(--p-primary);padding:3px 5px;font-size:.62rem;font-weight:800;cursor:pointer}.object-export-stl:hover{background:var(--p-soft);border-color:var(--p-primary)}
.editor-inspector .field{font-size:.73rem;margin-top:12px}
.editor-inspector .field input,.editor-inspector .field select{padding:7px 8px;font-size:.78rem;height:34px}
.field-inline{display:grid;grid-template-columns:70px 1fr;gap:12px}
.editor-inspector input[type=color]{padding:3px;width:100%;cursor:pointer}
.xyz-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:0;border:0;margin:16px 0}
.xyz-fields legend{font-size:.73rem;font-weight:650;padding:0;margin-bottom:7px}
.xyz-fields label{min-width:0;font-size:.65rem;color:var(--p-muted)}
.xyz-fields input{width:100%;min-width:0;border:1px solid var(--p-input-line);border-radius:6px;background:var(--p-card);color:var(--p-text);font-size:.75rem;padding:6px 3px;height:33px;-moz-appearance:textfield}
.xyz-fields input::-webkit-inner-spin-button{opacity:1;width:10px}
.editor-mobile-tabs{display:none}
.editor-status{border:1px solid var(--p-line);border-top:0;background:var(--p-soft);padding:12px 16px;color:#365472;border-radius:0 0 12px 12px;font-size:.8rem;min-height:46px}
.editor-status.error{color:var(--p-danger);background:var(--p-danger-bg)}
.editor-foot{display:flex;justify-content:space-between;gap:25px;font-size:.7rem;color:var(--p-muted);margin-top:12px}
.editor-foot p{margin:0;max-width:550px}
#editor-dialog{background:var(--p-card);color:var(--p-text);border:1px solid var(--p-line);border-radius:15px;padding:25px;box-shadow:0 18px 50px rgba(25,48,78,.18);max-width:460px;width:calc(100% - 32px)}
#editor-dialog::backdrop{background:rgba(23,34,54,.32)}
#editor-dialog h2{font-size:1.25rem;margin-top:0}
#editor-dialog p{color:var(--p-muted);line-height:1.6}
.dialog-actions{display:flex;justify-content:flex-end;gap:12px}
.editor-shell.is-readonly .editor-toolbar,.editor-shell.is-readonly .editor-shapes,.editor-shell.is-readonly #selection-properties,.editor-shell.is-readonly #multi-properties{display:none}
.editor-shell.is-readonly .editor-layout{grid-template-columns:minmax(0,1fr) 254px;grid-template-areas:'stage properties'}
.editor-shell.is-readonly #save-project,.editor-shell.is-readonly #use-project{display:none}
.editor-shell.is-readonly .project-title-label input{pointer-events:none}
.editor-shell.is-readonly .editor-mobile-tabs [data-tab=shapes]{display:none}
@media(max-width:1200px){.editor-layout{grid-template-columns:155px minmax(200px,1fr) 230px}
.editor-side{padding:12px}
.editor-projectbar{gap:12px}
.project-save-state{max-width:170px;font-size:.7rem}
.project-actions .p-btn{font-size:.76rem;padding-left:10px;padding-right:10px}
}
@media(max-width:820px){.editor-shell{width:calc(100% - 20px);margin-top:14px}
.editor-heading{margin-bottom:14px}
.editor-title h1{font-size:1.55rem}
.editor-title p{font-size:.72rem}
.editor-heading>.p-btn{font-size:.76rem;padding:8px 12px}
.editor-projectbar{padding:11px 12px;gap:10px;flex-wrap:wrap}
.project-title-label{max-width:none;flex:1;min-width:180px}
.project-save-state{max-width:none;flex:0 1 auto;font-size:.65rem}
.project-actions{width:100%;gap:8px;flex-wrap:wrap}
.project-actions>.p-btn{flex:1 1 145px;min-height:40px}
.editor-toolbar{overflow-x:auto;flex-wrap:nowrap;padding:8px;gap:5px;scrollbar-width:thin}
.editor-toolbar button{font-size:.73rem}
.tool-divider{flex-shrink:0}
.editor-layout,.editor-shell.is-readonly .editor-layout{display:flex;flex-direction:column;height:auto;min-height:0}
.editor-stage{order:0;height:48vh;min-height:290px;max-height:540px;flex-shrink:0}
.editor-side{order:2;border:0;border-top:1px solid var(--p-line);max-height:none;overflow:visible;padding:16px}
.editor-inspector{display:none}
.editor-layout.show-properties .editor-inspector{display:block}
.editor-layout.show-properties .editor-shapes{display:none}
.editor-shell.is-readonly .editor-inspector{display:block}
.shape-grid{grid-template-columns:repeat(6,minmax(0,1fr))}
.shape-grid button{font-size:.7rem;min-height:66px}
.shape-symbol{font-size:1.35rem}
.editor-shapes .side-button{width:auto;min-width:130px;display:inline-flex;margin-right:8px;padding:9px 12px}
.editor-shapes details .side-button{display:flex;width:100%;max-width:260px}
.editor-small{font-size:.75rem}
.editor-mobile-tabs{display:flex;position:sticky;bottom:0;z-index:7;background:var(--p-card);border:1px solid var(--p-line);padding:7px;gap:7px;box-shadow:0 -5px 12px rgba(25,48,78,.10)}
.editor-mobile-tabs button{border:1px solid var(--p-input-line);background:var(--p-subtle);color:var(--p-text);border-radius:7px;padding:10px 8px;flex:1;font-size:.8rem;font-weight:700;cursor:pointer}
.editor-mobile-tabs button[aria-pressed=true]{background:var(--p-primary);color:#fff;border-color:var(--p-primary)}
.editor-inspector .field input,.editor-inspector .field select{font-size:16px;height:40px}
.xyz-fields input{font-size:16px;height:40px;padding:7px}
.object-list{max-height:190px}
.editor-foot{display:block;padding-bottom:15px}
.editor-foot p{margin:8px 0}
.stage-bottom{font-size:.62rem}
.stage-views{top:8px;left:8px;gap:4px}
.stage-views button{font-size:.68rem;padding:6px 8px}
.editor-shell.is-readonly .editor-stage{height:57vh}
.editor-shell.is-readonly .editor-mobile-tabs{display:none}
}
@media(max-width:400px){.shape-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.project-save-state{width:100%;flex-basis:100%}
.editor-heading>.p-btn{white-space:nowrap}
.editor-title p{max-width:240px}
}

/* HTML hidden always wins over flex overlays and inspector layout. */
.editor-shell [hidden]{display:none!important}
.editor-shell.is-busy .editor-side,.editor-shell.is-busy .editor-toolbar,.editor-shell.is-busy .project-title-label{pointer-events:none;opacity:.6}
.editor-shell.is-busy .stage-views{pointer-events:none}
.editor-shell.is-busy .editor-mobile-tabs{pointer-events:none}
.personalization-page.is-embedded{padding-top:0!important}


/* Parametric shape controls: same light palette as the rest of the editor. */
.shape-settings{min-width:0;margin:18px 0;padding:12px;border:1px solid var(--p-line);border-radius:10px;background:var(--p-subtle)}
.shape-settings legend{padding:0 6px;font-size:.8rem;font-weight:750;color:var(--p-text)}
.shape-settings .field{display:flex;flex-direction:column;gap:6px}
.shape-settings .field input{width:100%;min-width:0;background:var(--p-card);color:var(--p-text);border:1px solid var(--p-input-line);border-radius:6px}
.shape-settings input[type=range]{display:block;width:100%;height:28px;min-height:28px;margin:9px 0;accent-color:var(--p-primary);padding:0;background:transparent;cursor:pointer}
.shape-settings .editor-small{line-height:1.5;margin:8px 0}
.shape-settings .shape-apply{background:var(--p-soft);border-color:var(--p-primary);color:var(--p-primary);font-weight:700}
.shape-settings input:disabled{opacity:.55;cursor:not-allowed}
@media(max-width:820px){.shape-settings{padding:14px}.shape-settings .side-button{min-height:44px}.shape-settings input[type=range]{height:40px;min-height:40px}}


/* 2026-09-17: Web minimal full-screen workspace.
   Desktop: grid/stage fills viewport; tool panels float above the canvas and collapse by default.
   Mobile/app keep their existing layout. */
@media (min-width:821px){
  html,body{height:100%}
  .personalization-page,.personal-shell{max-width:none!important;width:100%!important;padding:0!important;margin:0!important}
  .editor-shell{position:relative;width:100vw;max-width:none;min-height:100vh;margin:0;padding:0;background:#eef4f9;overflow:hidden}
  .editor-heading{display:none}
  .editor-foot{display:none}
  .editor-notice{position:absolute;left:16px;right:16px;top:86px;z-index:24;border:1px solid rgba(133,160,185,.45);border-radius:12px;background:rgba(255,255,255,.94);backdrop-filter:blur(10px);box-shadow:0 10px 28px rgba(20,36,58,.08)}
  .editor-projectbar{position:absolute;left:16px;right:16px;top:16px;z-index:25;display:grid;grid-template-columns:minmax(240px,360px) 1fr auto;align-items:center;gap:12px;padding:10px 12px;border:1px solid rgba(133,160,185,.5);border-radius:14px;background:rgba(255,255,255,.90);backdrop-filter:blur(14px);box-shadow:0 10px 28px rgba(20,36,58,.08)}
  .project-title-label{min-width:0;max-width:none;font-size:.64rem}
  .project-title-label input{font-size:1rem}
  .project-save-state{font-size:.72rem;line-height:1.35}
  .project-actions{gap:8px}
  .project-actions .p-btn{min-height:38px;padding:0 14px}
  .editor-toolbar{position:absolute;left:16px;right:16px;top:76px;z-index:23;display:flex;flex-wrap:nowrap;overflow-x:auto;gap:6px;padding:8px 10px;border:1px solid rgba(133,160,185,.42);border-radius:12px;background:rgba(255,255,255,.82);backdrop-filter:blur(12px);box-shadow:0 8px 22px rgba(20,36,58,.06);scrollbar-width:thin}
  .editor-toolbar button{min-height:36px;padding:7px 10px;font-size:.74rem;background:rgba(255,255,255,.95)}
  .direct-options{position:absolute;top:126px;left:50%;transform:translateX(-50%);z-index:22;display:flex;align-items:center;gap:14px;padding:8px 14px;border:1px solid rgba(133,160,185,.34);border-radius:999px;background:rgba(255,255,255,.78);backdrop-filter:blur(12px);box-shadow:0 8px 20px rgba(20,36,58,.06);font-size:.72rem;white-space:nowrap;max-width:calc(100vw - 160px);overflow:auto}
  .direct-options-help{display:none}
  .editor-layout,.editor-shell.is-readonly .editor-layout{position:relative;display:block;height:100vh;min-height:100vh;border:0}
  .editor-stage{position:absolute;inset:0;height:100vh;min-height:100vh;max-height:none;border:0;background:#dce6ed}
  #editor-canvas{inset:0}
  .stage-views{top:168px;left:16px;z-index:18;background:rgba(255,255,255,.55);backdrop-filter:blur(10px);padding:6px;border:1px solid rgba(133,160,185,.35);border-radius:12px;box-shadow:0 8px 20px rgba(20,36,58,.06)}
  .stage-bottom{left:50%;right:auto;bottom:16px;transform:translateX(-50%);width:auto;border:1px solid rgba(133,160,185,.4);border-radius:999px;background:rgba(255,255,255,.84);backdrop-filter:blur(10px);box-shadow:0 8px 20px rgba(20,36,58,.08);padding:7px 10px 7px 14px}
  .editor-status{position:absolute;left:16px;right:16px;bottom:16px;z-index:21;min-height:0;padding:10px 14px;border:1px solid rgba(133,160,185,.35);border-radius:12px;background:rgba(255,255,255,.9);backdrop-filter:blur(10px);box-shadow:0 10px 28px rgba(20,36,58,.08)}
  .editor-status:not(.error){left:auto;right:16px;max-width:380px;bottom:16px}
  .editor-mobile-tabs{display:none!important}

  .editor-side{position:absolute;top:204px;bottom:16px;z-index:20;display:flex;flex-direction:column;gap:0;padding:16px 14px 14px;border:1px solid rgba(133,160,185,.42);border-radius:16px;background:rgba(255,255,255,.88);backdrop-filter:blur(14px);box-shadow:0 14px 36px rgba(20,36,58,.10);overflow:hidden;max-height:calc(100vh - 220px);transition:width .22s ease, transform .22s ease, background-color .22s ease, box-shadow .22s ease}
  .editor-shapes{left:16px;width:74px;border-right:0}
  .editor-inspector{right:16px;width:74px;border-left:0}
  .editor-side:hover,.editor-side:focus-within{width:min(320px,28vw);background:rgba(255,255,255,.97);box-shadow:0 20px 48px rgba(20,36,58,.16)}
  .editor-shapes::before,.editor-inspector::before{display:block;font-size:.72rem;line-height:1.1;font-weight:800;letter-spacing:.08em;color:#244b73;text-transform:uppercase;margin:0 0 14px 2px}
  .editor-shapes::before{content:"Formas"}
  .editor-inspector::before{content:"Propiedades"}
  .editor-side > *{opacity:0;transition:opacity .12s ease}
  .editor-side:hover > *,.editor-side:focus-within > *{opacity:1}
  .editor-side h2:first-of-type,.editor-side .editor-small:first-of-type{margin-top:0}
  .editor-side::after{content:"";position:absolute;top:48px;bottom:12px;right:10px;width:2px;border-radius:999px;background:linear-gradient(to bottom, rgba(54,116,179,.28), rgba(54,116,179,.05));pointer-events:none}
  .editor-shapes:not(:hover):not(:focus-within) .shape-grid,
  .editor-shapes:not(:hover):not(:focus-within) .section-gap,
  .editor-shapes:not(:hover):not(:focus-within) hr,
  .editor-shapes:not(:hover):not(:focus-within) details,
  .editor-shapes:not(:hover):not(:focus-within) .side-button,
  .editor-shapes:not(:hover):not(:focus-within) .file-button,
  .editor-shapes:not(:hover):not(:focus-within) p,
  .editor-inspector:not(:hover):not(:focus-within) #object-list,
  .editor-inspector:not(:hover):not(:focus-within) hr,
  .editor-inspector:not(:hover):not(:focus-within) #selection-title,
  .editor-inspector:not(:hover):not(:focus-within) #selection-empty,
  .editor-inspector:not(:hover):not(:focus-within) #selection-properties,
  .editor-inspector:not(:hover):not(:focus-within) #multi-properties{
    opacity:0;pointer-events:none
  }
  .editor-shapes:not(:hover):not(:focus-within),
  .editor-inspector:not(:hover):not(:focus-within){cursor:pointer}
  .editor-shapes:not(:hover):not(:focus-within) .shape-grid,
  .editor-inspector:not(:hover):not(:focus-within) #object-list{display:none}
  .editor-shapes:not(:hover):not(:focus-within) .shape-grid + *,
  .editor-inspector:not(:hover):not(:focus-within) #object-list + *{display:none}
  .editor-shapes:not(:hover):not(:focus-within) .editor-small:first-of-type,
  .editor-inspector:not(:hover):not(:focus-within) .editor-small:first-of-type{display:none}
  .editor-shapes:not(:hover):not(:focus-within) h2,
  .editor-inspector:not(:hover):not(:focus-within) h2{display:none}
  .editor-shapes:not(:hover):not(:focus-within)::before,
  .editor-inspector:not(:hover):not(:focus-within)::before{writing-mode:vertical-rl;text-orientation:mixed;height:100%;margin:0 auto;display:flex;align-items:center;justify-content:center;font-size:.76rem;letter-spacing:.10em}
  .editor-side .side-button,.editor-side .shape-grid button,.editor-side .object-row{border-radius:10px}
  .shape-grid{grid-template-columns:1fr 1fr;gap:10px}
  .shape-grid button{min-height:88px}
  .object-list{max-height:220px}
  .editor-inspector .field input,.editor-inspector .field select{height:36px}
  .editor-shell.is-readonly .editor-shapes,.editor-shell.is-readonly .editor-inspector{display:block}
  .editor-shell.is-readonly .editor-inspector{width:74px}
  .editor-shell.is-readonly .editor-inspector:hover,.editor-shell.is-readonly .editor-inspector:focus-within{width:min(320px,28vw)}
}


/* Editor 3D independiente: ocupa el viewport completo sin reservar el navbar público. */
@media (min-width:821px){
  body{overflow:hidden!important}
  .editor-shell{
    position:fixed!important;
    top:0!important;
    right:0!important;
    bottom:0!important;
    left:0!important;
    width:100vw!important;
    height:auto!important;
    min-height:0!important;
    margin:0!important;
  }
  .editor-layout,.editor-shell.is-readonly .editor-layout{
    height:100%!important;
    min-height:100%!important;
  }
  .editor-stage{
    height:100%!important;
    min-height:100%!important;
    max-height:none!important;
  }
}

/* En tablet horizontal el editor también comienza en el borde superior. */
@media (min-width:821px) and (max-width:1024px) and (orientation:landscape) and (pointer:coarse),
       (min-width:821px) and (max-width:1024px) and (orientation:landscape) and (max-height:600px){
  .editor-shell{top:0!important}
}

/* 2026-09-17: definitive non-overlapping desktop fullscreen slots. */
@media (min-width:821px){
  /* Top stack: project -> toolbar -> transform options -> views. */
  .editor-projectbar{
    top:8px!important;
    left:10px!important;
    right:10px!important;
  }
  .editor-toolbar{
    top:82px!important;
    left:10px!important;
    right:10px!important;
  }
  .direct-options{
    top:132px!important;
    left:50%!important;
    transform:translateX(-50%)!important;
    max-width:calc(100vw - 220px)!important;
  }
  .stage-views{
    top:178px!important;
    left:10px!important;
  }

  /* Side drawers start after all top controls and stop before bottom controls. */
  .editor-side{
    top:226px!important;
    bottom:72px!important;
    max-height:calc(100% - 298px)!important;
  }
  .editor-shapes{left:10px!important}
  .editor-inspector{right:10px!important}

  /* Bottom row: cooperation at left, grid/info centered, status at right. */
  #editor-canvas>.editor-coop-badge{
    left:96px!important;
    bottom:16px!important;
    max-width:min(360px,calc(33vw - 110px))!important;
  }
  .stage-bottom{
    left:50%!important;
    right:auto!important;
    bottom:16px!important;
    transform:translateX(-50%)!important;
    max-width:34vw!important;
  }
  .editor-status,
  .editor-status:not(.error){
    left:auto!important;
    right:10px!important;
    bottom:16px!important;
    max-width:min(380px,30vw)!important;
  }

  /* Notices become compact toasts so they never consume a toolbar row. */
  .editor-notice{
    left:auto!important;
    right:10px!important;
    top:178px!important;
    width:min(460px,32vw)!important;
    max-width:calc(100vw - 120px)!important;
    z-index:27!important;
  }

  /* Avoid a view strip growing underneath the left drawer. */
  .stage-views{max-width:calc(100vw - 110px)!important}
}

/* Slightly tighter desktop/laptop heights. */
@media (min-width:821px) and (max-height:820px){
  .editor-projectbar{top:6px!important}
  .editor-toolbar{top:76px!important}
  .direct-options{top:124px!important}
  .stage-views{top:168px!important}
  .editor-side{top:214px!important;bottom:66px!important;max-height:calc(100% - 280px)!important}
  #editor-canvas>.editor-coop-badge,.stage-bottom,.editor-status,.editor-status:not(.error){bottom:12px!important}
}

/* 2026-09-17: dedicated grid-only fullscreen mode. */
@media (min-width:821px){
  .grid-fullscreen-toggle{display:inline-flex!important;align-items:center;gap:6px;font-weight:750;border-color:#8db8df!important;background:rgba(255,255,255,.96)!important}
  .grid-fullscreen-toggle span[aria-hidden=true]{font-size:1rem;line-height:1}
  .editor-shell.grid-only{top:0!important;right:0!important;bottom:0!important;left:0!important;width:100vw!important;height:100vh!important;z-index:2147483000!important;background:#dce6ed!important}
  .editor-shell.grid-only .editor-projectbar,
  .editor-shell.grid-only .editor-toolbar,
  .editor-shell.grid-only .direct-options,
  .editor-shell.grid-only .editor-side,
  .editor-shell.grid-only .editor-notice,
  .editor-shell.grid-only .editor-status,
  .editor-shell.grid-only .editor-mobile-tabs,
  .editor-shell.grid-only .editor-foot,
  .editor-shell.grid-only .stage-bottom,
  .editor-shell.grid-only #editor-canvas>.editor-coop-badge{display:none!important}
  .editor-shell.grid-only .editor-layout,
  .editor-shell.grid-only .editor-stage{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;min-height:100%!important;max-height:none!important}
  .editor-shell.grid-only .stage-views{position:absolute!important;top:14px!important;right:14px!important;left:auto!important;max-width:none!important;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;backdrop-filter:none!important;overflow:visible!important}
  .editor-shell.grid-only .stage-views>button:not(.grid-fullscreen-toggle){display:none!important}
  .editor-shell.grid-only .grid-fullscreen-toggle{min-height:42px!important;padding:9px 14px!important;border-radius:12px!important;background:rgba(255,255,255,.9)!important;box-shadow:0 8px 24px rgba(20,36,58,.14)}
  .editor-stage:fullscreen{width:100vw!important;height:100vh!important;min-height:100vh!important;background:#dce6ed!important}
  .editor-stage:fullscreen .stage-views{position:absolute!important;top:14px!important;right:14px!important;left:auto!important;max-width:none!important;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;backdrop-filter:none!important}
  .editor-stage:fullscreen .stage-views>button:not(.grid-fullscreen-toggle),
  .editor-stage:fullscreen .stage-bottom{display:none!important}
  .editor-stage:fullscreen .grid-fullscreen-toggle{display:inline-flex!important;min-height:42px!important;padding:9px 14px!important;border-radius:12px!important;background:rgba(255,255,255,.9)!important;box-shadow:0 8px 24px rgba(20,36,58,.14)}
}
@media (max-width:820px){.grid-fullscreen-toggle{display:none!important}}
.personalization-page.is-embedded .grid-fullscreen-toggle{display:none!important}

/* 2026-09-17: essential editing controls stay available in grid fullscreen mode. */
.grid-essential-tools{display:none}
@media (min-width:821px){
  .editor-shell.grid-only .grid-essential-tools{display:block;position:absolute;z-index:2147483500;top:14px;left:50%;transform:translateX(-50%);max-width:calc(100vw - 260px);pointer-events:auto}
  .grid-essential-main{display:flex;align-items:center;gap:5px;max-width:100%;overflow-x:auto;padding:7px;border:1px solid rgba(118,151,181,.45);border-radius:14px;background:rgba(255,255,255,.88);backdrop-filter:blur(14px);box-shadow:0 10px 28px rgba(20,36,58,.14);scrollbar-width:none}
  .grid-essential-main::-webkit-scrollbar{display:none}
  .grid-essential-drag-handle{display:flex;align-items:center;justify-content:center;align-self:stretch;flex:0 0 28px;min-width:28px;border:1px solid #cad8e5;border-radius:9px;background:rgba(238,245,251,.96);color:#55718b;font-size:1rem;font-weight:800;line-height:1;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}
  .grid-essential-drag-handle:hover,.grid-essential-drag-handle:focus-visible{background:#eaf4ff;border-color:#74aee3;color:#075ba8;outline:none}
  .grid-essential-tools.is-dragging,.grid-essential-tools.is-dragging *{cursor:grabbing!important;user-select:none!important}
  .grid-essential-tools button{min-height:38px;padding:7px 10px;border:1px solid #cad8e5;border-radius:9px;background:rgba(255,255,255,.96);color:#17334f;font:inherit;font-size:.74rem;font-weight:700;white-space:nowrap;cursor:pointer}
  .grid-essential-tools button:hover:not(:disabled),.grid-essential-tools button[aria-pressed=true]{background:#eaf4ff;border-color:#74aee3;color:#075ba8}
  .grid-essential-tools button:disabled{opacity:.36;cursor:not-allowed}
  .grid-essential-tools .grid-essential-save{background:#087be6;color:#fff;border-color:#087be6}
  .grid-essential-tools .danger{color:#a3293d}
  .grid-essential-sep{width:1px;height:24px;background:#d9e3ec;flex:0 0 1px;margin:0 2px}
  .grid-essential-more{position:absolute;right:7px;top:54px;display:grid;min-width:190px;padding:7px;border:1px solid rgba(118,151,181,.45);border-radius:12px;background:rgba(255,255,255,.94);backdrop-filter:blur(14px);box-shadow:0 14px 34px rgba(20,36,58,.17)}
  .grid-essential-more[hidden]{display:none!important}
  .grid-essential-more button{text-align:left;width:100%}

  /* The view row and direct-edit options remain available without occupying the modelling area. */
  .editor-shell.grid-only .stage-views{display:flex!important;top:auto!important;bottom:16px!important;left:16px!important;right:auto!important;max-width:calc(50vw - 40px)!important;padding:6px!important;border:1px solid rgba(118,151,181,.38)!important;border-radius:12px!important;background:rgba(255,255,255,.78)!important;backdrop-filter:blur(12px)!important;box-shadow:0 8px 22px rgba(20,36,58,.10)!important;overflow-x:auto!important}
  .editor-shell.grid-only .stage-views>button{display:inline-flex!important}
  .editor-shell.grid-only .grid-fullscreen-toggle{margin-left:4px}
  .editor-shell.grid-only .direct-options{display:flex!important;position:absolute!important;z-index:2147483400!important;top:auto!important;bottom:16px!important;left:50%!important;transform:translateX(-50%)!important;max-width:40vw!important;padding:8px 12px!important;background:rgba(255,255,255,.78)!important;backdrop-filter:blur(12px)!important;border:1px solid rgba(118,151,181,.38)!important;box-shadow:0 8px 22px rgba(20,36,58,.10)!important}
  .editor-shell.grid-only .direct-options-help{display:none!important}

  /* Panels become on-demand floating drawers, not permanent columns. */
  .editor-shell.grid-only.grid-fs-shapes-open .editor-shapes,
  .editor-shell.grid-only.grid-fs-properties-open .editor-inspector{display:block!important;position:absolute!important;z-index:2147483450!important;top:72px!important;bottom:72px!important;width:min(330px,calc(100vw - 32px))!important;max-height:none!important;overflow-y:auto!important;padding:16px!important;border:1px solid rgba(118,151,181,.42)!important;border-radius:16px!important;background:rgba(255,255,255,.94)!important;backdrop-filter:blur(16px)!important;box-shadow:0 18px 46px rgba(20,36,58,.18)!important;opacity:1!important}
  .editor-shell.grid-only.grid-fs-shapes-open .editor-shapes{left:16px!important;right:auto!important}
  .editor-shell.grid-only.grid-fs-properties-open .editor-inspector{right:16px!important;left:auto!important}
  .editor-shell.grid-only.grid-fs-shapes-open .editor-shapes>*,
  .editor-shell.grid-only.grid-fs-properties-open .editor-inspector>*{opacity:1!important;pointer-events:auto!important;display:revert}
  .editor-shell.grid-only.grid-fs-shapes-open .editor-shapes .shape-grid{display:grid!important}
  .editor-shell.grid-only.grid-fs-properties-open .editor-inspector #object-list{display:grid!important}
  .editor-shell.grid-only.grid-fs-shapes-open .editor-shapes::before,
  .editor-shell.grid-only.grid-fs-properties-open .editor-inspector::before{display:none!important}

  /* Real Fullscreen API now targets the whole editor shell so all essential controls remain usable. */
  .editor-shell:fullscreen{width:100vw!important;height:100vh!important;min-height:100vh!important;background:#dce6ed!important;overflow:hidden!important}
  .editor-shell:fullscreen .editor-layout,.editor-shell:fullscreen .editor-stage{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;min-height:100%!important;max-height:none!important}
  .editor-stage:fullscreen{all:unset}
}

/* Durante un croquis CAD solo se muestra la barra propia del diseñador. */
.editor-shell.grid-only.sketch-mode .grid-essential-tools{display:none!important}


/* 2026-09-19: on-screen Ctrl / Shift for touch editor and Android app. */
.editor-mobile-modifiers{display:none;position:absolute;z-index:18;left:9px;bottom:45px;gap:7px;align-items:center;pointer-events:auto;user-select:none;-webkit-user-select:none}
.editor-mobile-modifiers button{min-width:58px;min-height:40px;padding:8px 12px;border:1px solid rgba(105,135,163,.58);border-radius:10px;background:rgba(255,255,255,.92);color:var(--p-text);font:800 .78rem/1 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 7px 18px rgba(20,36,58,.14);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);touch-action:manipulation;cursor:pointer}
.editor-mobile-modifiers button[aria-pressed=true]{background:var(--p-primary);border-color:var(--p-primary);color:#fff;box-shadow:0 7px 18px rgba(15,116,209,.28)}
.editor-mobile-modifiers button:active{transform:translateY(1px)}
@media(max-width:820px){
  .editor-mobile-modifiers{display:flex}
  .editor-shell.is-busy .editor-mobile-modifiers{pointer-events:none;opacity:.55}
}
.editor-shell.native-app-editor .editor-mobile-modifiers{display:flex;left:12px;bottom:14px;z-index:40}
.editor-shell.native-app-editor .editor-mobile-modifiers button{min-width:64px;min-height:44px;font-size:.82rem;border-radius:12px}


/* 2026-09-19 v10: Ctrl/Shift live inside #editor-canvas so native canvas-only mode cannot hide them. */
#editor-canvas>.editor-mobile-modifiers{display:none;position:absolute;left:12px;bottom:12px;z-index:2147483600;gap:8px;pointer-events:auto}
@media (max-width:900px), (pointer:coarse){
  .editor-shell.is-mobile-modifiers-visible #editor-canvas>.editor-mobile-modifiers{display:flex!important}
}
.editor-shell.native-app-editor #editor-canvas>.editor-mobile-modifiers{display:flex!important}


/* 2026-09-19 v11: Ctrl / Shift / Alt as the same circular language as the touch radial dial. */
#editor-canvas>.editor-mobile-modifiers{display:none;position:absolute;left:12px;bottom:12px;z-index:2147483600;gap:8px;align-items:center;flex-direction:column;pointer-events:auto;user-select:none;-webkit-user-select:none}
@media (max-width:900px),(pointer:coarse){.editor-shell.is-mobile-modifiers-visible #editor-canvas>.editor-mobile-modifiers{display:flex!important}}
.editor-shell.native-app-editor #editor-canvas>.editor-mobile-modifiers{display:flex!important}
#editor-canvas>.editor-mobile-modifiers button{display:inline-flex;align-items:center;justify-content:center;width:58px;height:58px;min-width:58px;min-height:58px;padding:0;border:1px solid rgba(169,195,219,.94);border-radius:50%;background:rgba(250,253,255,.91);color:#1f4769;font:800 11px/1 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 5px 16px rgba(17,58,91,.20);backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px);touch-action:manipulation;cursor:pointer}
#editor-canvas>.editor-mobile-modifiers button[aria-pressed=true]{background:rgba(214,238,255,.97);color:#075aa7;border-color:#0b7fe0;box-shadow:0 0 0 3px rgba(19,131,226,.18),0 7px 18px rgba(15,86,145,.25);transform:scale(1.07)}
#editor-canvas>.editor-mobile-modifiers button:active{transform:scale(.96)}
.editor-shell.is-busy #editor-canvas>.editor-mobile-modifiers{pointer-events:none;opacity:.55}
@media (max-width:420px){#editor-canvas>.editor-mobile-modifiers button{width:54px;height:54px;min-width:54px;min-height:54px;font-size:10px}}

/* Panel móvil remoto: el PC se convierte en un visor limpio del modelo. */
.editor-remote-dialog{max-width:min(560px,calc(100vw - 28px));border:0;border-radius:20px;padding:0;box-shadow:0 24px 70px rgba(9,35,58,.28)}
.editor-remote-dialog::backdrop{background:rgba(18,36,52,.52);backdrop-filter:blur(3px)}
.remote-panel-dialog-inner{padding:26px}.remote-panel-dialog-inner h2{margin:0 0 10px}.remote-panel-code{margin:20px auto 12px;max-width:320px;padding:18px 20px;text-align:center;border:1px solid #b6cfdf;border-radius:16px;background:#f2f8fc;color:#153c5d;font:900 clamp(30px,8vw,48px)/1 ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:.18em}
html.editor-remote-display,html.editor-remote-display body{margin:0!important;width:100%!important;height:100%!important;overflow:hidden!important;background:#dce6ed!important}
html.editor-remote-display body>*{display:none!important}
html.editor-remote-display body>#editor-shell{display:block!important;position:fixed!important;inset:0!important;width:100vw!important;height:100vh!important;max-width:none!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;background:#dce6ed!important;z-index:2147483000!important}
html.editor-remote-display #editor-shell>*{display:none!important}
html.editor-remote-display #editor-shell>.editor-layout{display:block!important;position:absolute!important;inset:0!important;width:100%!important;height:100%!important;margin:0!important;padding:0!important}
html.editor-remote-display .editor-layout>*{display:none!important}
html.editor-remote-display .editor-layout>.editor-stage{display:block!important;position:absolute!important;inset:0!important;width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;margin:0!important;border:0!important;border-radius:0!important}
html.editor-remote-display .editor-stage>*{display:none!important}
html.editor-remote-display .editor-stage>#editor-canvas{display:block!important;position:absolute!important;inset:0!important;width:100%!important;height:100%!important}
html.editor-remote-display .editor-stage>#editor-loading:not([hidden]){display:flex!important;position:absolute!important;inset:0!important;z-index:50!important}
html.editor-remote-display #editor-canvas canvas{display:block!important;width:100%!important;height:100%!important}
html.editor-remote-display #editor-canvas>.sketch-plane-picker,
html.editor-remote-display #editor-canvas>.sketch-cad-toolbar,
html.editor-remote-display #editor-canvas>.sketch-dimension-panel,
html.editor-remote-display #editor-canvas>.sketch-extrude-panel,
html.editor-remote-display #editor-canvas>.sketch-face-pick-hint,
html.editor-remote-display #editor-canvas>.surface-tools,
html.editor-remote-display #editor-canvas>.surface-badge,
html.editor-remote-display #editor-canvas>.edge-tools,
html.editor-remote-display #editor-canvas>.edge-badge,
html.editor-remote-display #editor-canvas>.curve-badge,
html.editor-remote-display #editor-canvas>.curve-panel,
html.editor-remote-display #editor-canvas>.reference-panel{display:none!important}

/* 2026-09-19 v16 · emparejamiento del panel remoto solo mediante código. */
.remote-panel-code-wrap{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;margin:20px 0 10px;color:#526d82;font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em}
.remote-panel-code-wrap .remote-panel-code{margin:0;max-width:none;padding:14px 18px;border-radius:14px;font-size:clamp(24px,6vw,38px);letter-spacing:.16em;text-transform:none}
.remote-panel-actions{flex-wrap:wrap}
@media (max-width:600px){.remote-panel-dialog-inner{padding:20px}.remote-panel-actions .p-btn{flex:1 1 120px}}
