/* Layout pass, revised. Every room (editor, palettes, library, motion, post,
   export) is the same thing: a modal. They were a mix of full-screen "rooms"
   and one floating dialog, which made going back from one to another read as
   broken. They now all open as one huge modal, 96% of the viewport each way,
   centred over a dimmed page, with the dock inside it for moving between rooms. */

html.graphite63.studio59 dialog.g-room63:is(#detail,#palette-panel,#library-room63,#motion-room50,#post-panel50,#export-menu49)[open]{
  position:fixed;
  inset:0;
  box-sizing:border-box;
  width:96vw;
  height:96vh;
  height:96dvh;
  max-width:none;
  max-height:none;
  margin:auto;
  border:1px solid var(--g-line);
  border-radius:18px;
  box-shadow:0 36px 90px -24px rgb(0 0 0 / .75),0 8px 24px -8px rgb(0 0 0 / .5);
  overscroll-behavior:contain;
}
/* Rounded corners clip the room's own surfaces; the palette scrolls itself. */
html.graphite63.studio59 dialog.g-room63:is(#detail,#library-room63,#motion-room50,#post-panel50,#export-menu49)[open]{
  overflow:clip;
}
html.graphite63.studio59 dialog.g-room63:is(#palette-panel)[open]{
  overflow:auto;
}

/* The page behind is dimmed so the modal reads as a layer, not a screen. */
html.graphite63.studio59 dialog.g-room63:is(#detail,#palette-panel,#library-room63,#motion-room50,#post-panel50,#export-menu49)::backdrop{
  background:oklch(.12 .01 265 / .72);
}

/* The dock sits inside the modal's rounded edge. */
html.graphite63.studio59 dialog.g-room63 .dock63{
  border-start-start-radius:18px;
  border-end-start-radius:18px;
}

/* One close button, in every room, on top of the dock. Post and export wrap
   their bar in a shell with overflow:hidden, which clipped a button moved
   sideways out of the bar. So the button no longer moves inside the bar: the
   bar stops being a positioning context in a room and the button is placed
   against the modal itself, in the 64px dock column, centred on the bar's
   height. Below 1101px there is no dock and the button stays in the bar. */
@media(min-width:1101px){
  html.graphite63.studio59 dialog#export-menu49.g-room63[open]{padding-inline-start:64px!important}

  html.graphite63.studio59 dialog.g-room63:is(#detail,#library-room63,#palette-panel,#motion-room50,#post-panel50,#export-menu49) .workspace-bar64{
    position:static;
  }
  html.graphite63.studio59 dialog.g-room63:is(#detail,#library-room63,#palette-panel,#motion-room50,#post-panel50,#export-menu49) .workspace-bar64 .local-actions64{
    z-index:7;
  }
  html.graphite63.studio59 dialog.g-room63:is(#detail,#library-room63,#palette-panel,#motion-room50,#post-panel50,#export-menu49) .workspace-bar64 .close64{
    position:absolute;
    z-index:8;
    top:calc((var(--bar-height64) - 36px) / 2);
    left:14px;
    transform:none;
    margin:0;
  }
}

/* Galería closes the modal and returns to the page; the rule after it says the
   rest of the dock navigates between rooms. */
.dock63 .dock-sep64{display:block;flex:none;align-self:center;width:32px;height:0;margin:6px 0;border-top:1px solid var(--g-line,var(--u-line))}

.rail59 .stage-nav50 .dock-sep64{align-self:stretch;width:auto;margin:6px 10px}
html.graphite63.studio59 .rail59 .stage-nav50 .dock-sep64{display:block;flex:none;height:0;border:0!important;border-top:1px solid var(--g-line,var(--u-line))!important;background:none;padding:0}

/* Main rail: the collapse button is gone; the brand header now holds the logo
   (same 65px as the top bar, so the bar line and the rail icons stay aligned). */
.rail-logo64{display:none;flex:none;width:34px;height:34px;border-radius:10px}
@media(min-width:751px){
  html.graphite63.studio59 .rail59 .rail-brand59{display:flex;justify-content:center;padding:0}
  html.graphite63.studio59 .rail59 .rail-logo64{display:block}
}

/* Main rail edge: same 1px pane edge the right-hand inspectors use. */
@media(min-width:751px){
  html.graphite63.studio59 .rail59{border-right:1px solid var(--pane-edge65)}
}

/* Breathing room between the rail logo and the first nav icon. */
@media(min-width:751px){
  html.graphite63.studio59 .rail59 .rail-brand59{margin-bottom:10px}
}

/* Editor "Propiedades" header: title left, history on one row at the right.
   Undo / redo are icon-only (name in tooltip and aria-label), Comparar stays text. */
html.studio59 #detail #editor-prop59 .props-head59{flex-wrap:nowrap;gap:8px}
html.studio59 #detail #editor-prop59 .props-head59 .history-detail48{flex:none;flex-wrap:nowrap;align-items:center;gap:2px;margin:0}
html.studio59 #detail #editor-prop59 .props-head59 .history-detail48 :is(#undo-detail48,#redo-detail48){font-size:0;width:30px;min-width:30px;height:30px;min-height:30px;padding:0;display:inline-flex;align-items:center;justify-content:center}
html.studio59 #detail #editor-prop59 .props-head59 .history-detail48 #compare-detail48{font-size:12px;white-space:nowrap;padding:4px 10px;margin-left:4px}

/* "Volver a …" rows inside a panel: Tabler arrow + label. Only the row itself
   is interactive; the panel title next to it is plain text. */
html.studio59 :is(#detail #editor-prop59 .editor-return63,#palette-panel #palette-editor .pal-back63){
  align-items:center;gap:6px;align-self:flex-start;padding:4px 10px 4px 6px;margin:0 0 0 -6px;
  border-radius:var(--g-pill,999px);cursor:pointer;
  transition:background-color var(--dur-state,.16s) var(--ease-out,ease),color var(--dur-state,.16s) var(--ease-out,ease);
}
html.studio59 #detail #editor-prop59 :is(#versions-detail48,#salida48)[open] .editor-return63,
html.studio59 #palette-panel #palette-editor[open] .pal-back63{display:inline-flex}
html.studio59 .back-arrow64{flex:none;width:16px;height:16px}
html.studio59 :is(#detail #editor-prop59 .editor-return63,#palette-panel #palette-editor .pal-back63):hover{background:var(--g-hover);color:var(--g-text)}
html.studio59 :is(#detail #editor-prop59 .editor-return63,#palette-panel #palette-editor .pal-back63):active{background:var(--g-line)}
/* While open, the summary row (title) must not react: only the back row does. */
html.studio59 #detail#detail #editor-prop59 :is(#versions-detail48,#salida48)[open]>summary,
html.studio59 #palette-panel#palette-panel #palette-editor[open]>summary{pointer-events:none;cursor:default;background:transparent;border-color:transparent}
html.studio59 :is(#detail#detail #editor-prop59 .editor-return63,#palette-panel#palette-panel #palette-editor .pal-back63){pointer-events:auto}

/* "Usar muestra …" and "Aplicar muestra": full width, content centred, like the
   Variación / Explorar buttons above them. */
html.studio59 #detail #editor-prop59 :is(#reference-look42,#detail-use-sample71):not([hidden]){width:100%;box-sizing:border-box;justify-content:center;text-align:center}
html.studio59 #detail #editor-prop59 .context-actions49{display:grid;grid-template-columns:minmax(0,1fr);gap:7px}

/* Small modals (tile menu, discard confirmation): Tabler icons as masks. */
:root{
 --ti-wind:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8h8.5a2.5 2.5 0 1 0 -2.34 -3.24'/%3E%3Cpath d='M3 12h15.5a2.5 2.5 0 1 1 -2.34 3.24'/%3E%3Cpath d='M4 16h5.5a2.5 2.5 0 1 1 -2.34 3.24'/%3E%3C/svg%3E");
 --ti-wave:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12h-2c-.894 0 -1.662 -.857 -1.761 -2c-.296 -3.45 -.749 -6 -2.239 -6c-1.5 0 -2 3.5 -2.5 8s-1 8 -2.5 8c-1.5 0 -1.943 -2.55 -2.239 -6c-.099 -1.143 -.867 -2 -1.761 -2h-2'/%3E%3C/svg%3E");
 --ti-camera:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 7h1a2 2 0 0 0 2 -2a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1a2 2 0 0 0 2 2h1a2 2 0 0 1 2 2v9a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-9a2 2 0 0 1 2 -2'/%3E%3Cpath d='M9 13a3 3 0 1 0 6 0a3 3 0 0 0 -6 0'/%3E%3C/svg%3E");
 --ti-movie:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12'/%3E%3Cpath d='M8 4l0 16'/%3E%3Cpath d='M16 4l0 16'/%3E%3Cpath d='M4 8l4 0'/%3E%3Cpath d='M4 16l4 0'/%3E%3Cpath d='M4 12l16 0'/%3E%3Cpath d='M16 8l4 0'/%3E%3Cpath d='M16 16l4 0'/%3E%3C/svg%3E");
 --ti-alert:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0z'/%3E%3Cpath d='M12 16h.01'/%3E%3C/svg%3E");
 --ti-pencil:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4'/%3E%3Cpath d='M13.5 6.5l4 4'/%3E%3C/svg%3E");
 --ti-logout:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2'/%3E%3Cpath d='M9 12h12l-3 -3'/%3E%3Cpath d='M18 15l3 -3'/%3E%3C/svg%3E");
}

html.graphite63.studio59 :is(#tile-menu59 #quick-breath54,#tile-menu59 #quick-flow54,#tile-menu59 #gallery-use-frame71,#tile-menu59>button:last-child)::before{
  content:'';flex:none;width:16px;height:16px;background:currentColor;opacity:.85;
  -webkit-mask:var(--ti-icon) center/contain no-repeat;mask:var(--ti-icon) center/contain no-repeat;
}
html.graphite63.studio59 #tile-menu59 #quick-breath54{--ti-icon:var(--ti-wind)}
html.graphite63.studio59 #tile-menu59 #quick-flow54{--ti-icon:var(--ti-wave)}
html.graphite63.studio59 #tile-menu59 #gallery-use-frame71{--ti-icon:var(--ti-camera)}
html.graphite63.studio59 #tile-menu59>button:last-child{--ti-icon:var(--ti-movie)}
html.graphite63.studio59 :is(#tile-menu59 .quick-motion54>button,#tile-menu59>button){display:flex;align-items:center;gap:10px;text-align:left}
html.graphite63.studio59 #tile-menu59>button:last-child{flex-direction:row}
html.graphite63.studio59 #tile-menu59>button:last-child svg{margin-left:auto}
html.graphite63.studio59 #tile-menu59{padding:6px;min-width:216px}
html.graphite63.studio59 #tile-menu59 strong{padding:6px 10px 8px;font-size:11px;letter-spacing:.04em;text-transform:uppercase;color:var(--g-muted)}

/* Discard confirmation. */
html.graphite63.studio59 #discard63{padding:24px;width:min(380px,calc(100vw - 32px))}
html.graphite63.studio59 #discard63 h2::before{
  content:'';display:block;width:44px;height:44px;margin-bottom:14px;border-radius:50%;
  background:color-mix(in oklab,var(--accent,#ffb347) 24%,transparent);
  box-shadow:inset 0 0 0 1px color-mix(in oklab,var(--accent,#ffb347) 40%,transparent);
}
html.graphite63.studio59 #discard63 h2{position:relative}
html.graphite63.studio59 #discard63 h2::after{
  content:'';position:absolute;left:12px;top:12px;width:20px;height:20px;background:var(--accent,#ffb347);
  -webkit-mask:var(--ti-alert) center/contain no-repeat;mask:var(--ti-alert) center/contain no-repeat;
}
html.graphite63.studio59 #discard63 .discard-actions65{justify-content:flex-end;flex-wrap:nowrap}
html.graphite63.studio59 #discard63 .discard-actions65 button{display:inline-flex;align-items:center;gap:8px;white-space:nowrap}
html.graphite63.studio59 #discard63 .discard-actions65 button::before{
  content:'';flex:none;width:16px;height:16px;background:currentColor;
  -webkit-mask:var(--ti-icon) center/contain no-repeat;mask:var(--ti-icon) center/contain no-repeat;
}
html.graphite63.studio59 #discard63 .discard-actions65 button:first-child{--ti-icon:var(--ti-pencil)}
html.graphite63.studio59 #discard63 .discard-actions65 button:last-child{--ti-icon:var(--ti-logout)}
@media(max-width:420px){html.graphite63.studio59 #discard63 .discard-actions65{flex-wrap:wrap}}

/* Rooms are 96% of the viewport; their inner shells must fill the dialog,
   not the viewport, or the footer buttons end up below the modal edge. */
html.graphite63.studio59 :is(dialog#post-panel50 .post-shell50,dialog#export-menu49 .export-shell49){height:100%}
