/* Theme control is always in the same viewport corner, including top-layer dialogs. */
body > .themeSwitchGlobal,
#detail > .themeSwitchDocked,
#project > .themeSwitchDocked,
#editor > .themeSwitchDocked{
  position:fixed;inset:auto max(15px,env(safe-area-inset-right)) max(15px,env(safe-area-inset-bottom)) auto;
  z-index:1100;
  display:grid;place-items:center;width:44px;height:44px;padding:0;margin:0;
  border:1px solid var(--latam-line);border-radius:50%;
  background:var(--latam-surface);color:var(--latam-mist);
  box-shadow:0 3px 14px #14191032;isolation:isolate;
}
body > .themeSwitchGlobal:hover,
dialog > .themeSwitchDocked:hover{
  background:var(--latam-surface-raised);border-color:var(--latam-sage);
}
.themeSwitch:focus-visible{outline:2px solid var(--latam-sage);outline-offset:3px}
body:has(dialog[open]) > .themeSwitchGlobal{visibility:hidden}
.themeIcon{
  grid-area:1/1;width:21px;height:21px;fill:none;stroke:currentColor;
  stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;pointer-events:none;
  transition:opacity .23s ease,transform .36s cubic-bezier(.22,.75,.32,1);
}
.themeIconMoon{opacity:0;transform:rotate(65deg) scale(.45)}
html[data-theme=light] .themeIconSun{opacity:0;transform:rotate(-70deg) scale(.45)}
html[data-theme=light] .themeIconMoon{opacity:1;transform:rotate(0) scale(1)}
#detail #close{
  position:absolute;inset:10px 12px auto auto;
  z-index:5;width:37px;height:37px;padding:0;margin:0;
  display:grid;place-items:center;border-radius:50%;line-height:1;
}
#detail #close svg{display:block;pointer-events:none}
#detail #data{padding-top:24px}
@media(prefers-reduced-motion:reduce){.themeIcon{transition:none}}
html[data-theme=dark]{color-scheme:dark;background:#262626}
html[data-theme=dark] #editor{color-scheme:dark;color:var(--latam-mist);background:var(--latam-charcoal)}
html[data-theme=dark] #editor :is(.studioNav,.studioWorkspace,.studioInspector,#canvasBar,#saveStatus),
html[data-theme=dark] #editor[data-editor-mode=basic] :is(#editFields,.studioNav,.studioInspector,.djEntry,.basicDJExtra,.basicZoneDetails){
  background:var(--latam-surface);color:var(--latam-mist);border-color:var(--latam-line);
}
html[data-theme=dark] #editor :is(.studioSlide,.minor,input:not([type=color]),select,textarea){
  background:var(--latam-surface-raised);color:var(--latam-mist);border-color:var(--latam-line);
}
html[data-theme=dark] #editor :is(.studioSlide,.minor)[aria-pressed=true]{
  background:var(--latam-olive-deep);color:var(--latam-paper);
}
html[data-theme=dark] #editor :is(.basicHeading,.djRoster h3){color:var(--latam-sage)}
html[data-theme=dark] #project .principles{background:var(--latam-charcoal);color:var(--latam-mist)}
html[data-theme=dark] #project .principles article{background:var(--latam-surface);color:var(--latam-mist)}
html[data-theme=dark] #project .principles h3{color:var(--latam-sage)}
