/* SOUL ONE LIVE 4.5 — STRICT DESKTOP VIEW ISOLATION
   Fix: v31/v35 used #mixer.clean-mixer{display:grid!important}, which
   overrode the older stage/repertoire hide rules (#mixer {display:none}).
   Keep ONE real mixer/audio graph mounted; only change its visibility.
   Also reserve a real grid track for the persistent arrangement map. */
@media(min-width:1000px) and (min-height:580px) and (pointer:fine) {
  /* Layout slots: header / view selector / workspace / mixer caption / mixer /
     persistent section map. The last slot was previously implicit, causing
     the stage and transport to collapse to narrow, cut-off blocks. */
  html:not(.soulone-ipad-classic) body>.app:not(.sl-mode-stage):not(.sl-mode-repertoire),
  html:fullscreen body>.app:not(.sl-mode-stage):not(.sl-mode-repertoire) {
    grid-template-rows:76px 43px minmax(0,1fr) 40px clamp(270px,35dvh,370px) 96px!important;
  }
  html:not(.soulone-ipad-classic) body>.app.sl-mode-mix:not(.stage-mixer-collapsed),
  html:fullscreen body>.app.sl-mode-mix:not(.stage-mixer-collapsed){
    grid-template-rows:76px 43px minmax(0,1fr) 40px clamp(300px,44dvh,490px) 96px!important;
  }
  html:not(.soulone-ipad-classic) body>.app.sl-large-faders:not(.sl-mode-stage):not(.sl-mode-repertoire):not(.stage-mixer-collapsed),
  html:fullscreen body>.app.sl-large-faders:not(.sl-mode-stage):not(.sl-mode-repertoire):not(.stage-mixer-collapsed) {
    grid-template-rows:76px 43px minmax(0,1fr) 40px clamp(350px,55dvh,660px) 96px!important;
  }
  html:not(.soulone-ipad-classic) body>.app.stage-mixer-collapsed:not(.sl-mode-stage):not(.sl-mode-repertoire),
  html:fullscreen body>.app.stage-mixer-collapsed:not(.sl-mode-stage):not(.sl-mode-repertoire) {
    grid-template-rows:76px 43px minmax(0,1fr) 96px!important;
  }
  /* Critical: stage/repertoire have no mixer row, even if the legacy
     mixer controller temporarily remains "open". */
  html:not(.soulone-ipad-classic) body>.app.sl-mode-stage,
  html:fullscreen body>.app.sl-mode-stage,
  html:not(.soulone-ipad-classic) body>.app.sl-mode-repertoire,
  html:fullscreen body>.app.sl-mode-repertoire{
    grid-template-rows:76px 43px minmax(0,1fr) 96px!important;
  }
  /* Compact header uses the same layout with the FIRST track reduced. */
  html:not(.soulone-ipad-classic) body>.app.sl-header-minimized:not(.sl-mode-stage):not(.sl-mode-repertoire):not(.stage-mixer-collapsed),
  html:fullscreen body>.app.sl-header-minimized:not(.sl-mode-stage):not(.sl-mode-repertoire):not(.stage-mixer-collapsed){
    grid-template-rows:44px 43px minmax(0,1fr) 40px clamp(270px,35dvh,370px) 96px!important;
  }
  html:not(.soulone-ipad-classic) body>.app.sl-header-minimized.sl-mode-mix:not(.stage-mixer-collapsed),
  html:fullscreen body>.app.sl-header-minimized.sl-mode-mix:not(.stage-mixer-collapsed) {
    grid-template-rows:44px 43px minmax(0,1fr) 40px clamp(300px,44dvh,490px) 96px!important;
  }
  html:not(.soulone-ipad-classic) body>.app.sl-header-minimized.sl-large-faders:not(.sl-mode-stage):not(.sl-mode-repertoire):not(.stage-mixer-collapsed),
  html:fullscreen body>.app.sl-header-minimized.sl-large-faders:not(.sl-mode-stage):not(.sl-mode-repertoire):not(.stage-mixer-collapsed){
    grid-template-rows:44px 43px minmax(0,1fr) 40px clamp(350px,55dvh,660px) 96px!important;
  }
  html:not(.soulone-ipad-classic) body>.app.sl-header-minimized.stage-mixer-collapsed:not(.sl-mode-stage):not(.sl-mode-repertoire),
  html:fullscreen body>.app.sl-header-minimized.stage-mixer-collapsed:not(.sl-mode-stage):not(.sl-mode-repertoire),
  html:not(.soulone-ipad-classic) body>.app.sl-header-minimized.sl-mode-stage,
  html:fullscreen body>.app.sl-header-minimized.sl-mode-stage,
  html:not(.soulone-ipad-classic) body>.app.sl-header-minimized.sl-mode-repertoire,
  html:fullscreen body>.app.sl-header-minimized.sl-mode-repertoire{
    grid-template-rows:44px 43px minmax(0,1fr) 96px!important;
  }
  /* Position each panel explicitly. The map is a persistent SONG display,
     not an extra implicit row that can squeeze the stage. */
  body>.app>.top.stage-header{grid-row:1!important}
  body>.app>.stage-footer-note{grid-row:2!important}
  body>.app>.main-grid{grid-row:3!important;min-width:0!important;min-height:0!important}
  body>.app>.meter-title{grid-row:4!important}
  body>.app>#mixer.mixer.clean-mixer{grid-row:5!important}
  body>.app>.sl-arrangement-map{
    grid-row:6!important;
    align-self:stretch!important;
    min-height:0!important;
    max-height:100%!important;
    overflow:hidden!important;
    margin:0!important;
    padding:8px 13px!important;
    gap:6px!important;
    position:relative!important;
    top:auto!important;
    z-index:10!important;
  }
  body>.app>.sl-arrangement-map .sl-map-track{
    height:37px!important;
    flex:0 0 37px!important;
  }
  body>.app.sl-mode-stage>.sl-arrangement-map,
  body>.app.sl-mode-repertoire>.sl-arrangement-map,
  body>.app.stage-mixer-collapsed:not(.sl-mode-stage):not(.sl-mode-repertoire)>.sl-arrangement-map{
    grid-row:4!important;
  }
  /* No ghost slot or fragment of the mixer in views that do not use it.
     These selectors MUST outrank v31/v35's multi-class display:grid rules. */
  html:not(.soulone-ipad-classic) body>.app.sl-mode-stage>#mixer.mixer.clean-mixer,
  html:fullscreen body>.app.sl-mode-stage>#mixer.mixer.clean-mixer,
  html:not(.soulone-ipad-classic) body>.app.sl-mode-repertoire>#mixer.mixer.clean-mixer,
  html:fullscreen body>.app.sl-mode-repertoire>#mixer.mixer.clean-mixer,
  html:not(.soulone-ipad-classic) body>.app.stage-mixer-collapsed>#mixer.mixer.clean-mixer,
  html:fullscreen body>.app.stage-mixer-collapsed>#mixer.mixer.clean-mixer {
    display:none!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }
  html:not(.soulone-ipad-classic) body>.app.sl-mode-stage>.meter-title,
  html:fullscreen body>.app.sl-mode-stage>.meter-title,
  html:not(.soulone-ipad-classic) body>.app.sl-mode-repertoire>.meter-title,
  html:fullscreen body>.app.sl-mode-repertoire>.meter-title,
  html:not(.soulone-ipad-classic) body>.app.stage-mixer-collapsed>.meter-title,
  html:fullscreen body>.app.stage-mixer-collapsed>.meter-title {
    display:none!important;
  }
  /* Stage = exactly one full-width timeline+transport workspace. */
  body>.app.sl-mode-stage>.main-grid,
  body>.app.sl-mode-mix>.main-grid,
  body>.app.sl-hide-repertoire:not(.sl-mode-repertoire)>.main-grid{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-areas:"stage"!important;
    gap:0!important;
    width:100%!important;
    min-height:0!important;
    height:100%!important;
    justify-items:stretch!important;
    align-items:stretch!important;
    overflow:hidden!important;
  }
  body>.app.sl-mode-stage>.main-grid>.right.live-library-panel,
  body>.app.sl-mode-mix>.main-grid>.right.live-library-panel{
    display:none!important;
  }
  body>.app.sl-mode-stage>.main-grid>.live-workspace,
  body>.app.sl-mode-mix>.main-grid>.live-workspace{
    display:flex!important;
    grid-area:stage!important;
    width:100%!important;
    min-width:0!important;
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
    flex-direction:column!important;
  }
  /* Repertoire = only the library. The mixer, transport and timeline keep
     their DOM/audio state in memory but must not occupy visible space. */
  body>.app.sl-mode-repertoire>.main-grid{
    display:grid!important;
    grid-template-areas:"library"!important;
    grid-template-columns:minmax(0,min(1100px,100%))!important;
    justify-content:center!important;
    width:100%!important;
    min-width:0!important;
    height:100%!important;
    overflow:hidden!important;
  }
  html:not(.soulone-ipad-classic) body>.app.sl-mode-repertoire>.main-grid>.live-workspace,
  html:fullscreen body>.app.sl-mode-repertoire>.main-grid>.live-workspace{
    display:none!important;
  }
  body>.app.sl-mode-repertoire>.main-grid>.right.live-library-panel{
    display:flex!important;
    grid-area:library!important;
    min-width:0!important;
    width:100%!important;
    max-width:1100px!important;
    height:100%!important;
    overflow:hidden!important;
  }
  /* Mix: mixer takes priority; the sequence transport stays accessible
     but not compressed into a 40px clipped strip. */
  body>.app.sl-mode-mix>.main-grid>.live-workspace>.timeline{
    flex:1 1 auto!important;
    min-height:74px!important;
    width:100%!important;
    overflow:hidden!important;
  }
  body>.app.sl-mode-mix>.main-grid>.live-workspace>.progress-panel{
    flex:0 0 66px!important;
    min-height:66px!important;
    max-height:66px!important;
    width:100%!important;
  }
}
/* Leave existing iPhone/iPad stage and mixer screens unchanged. */
