/* Studio-Leitzentrale V23.32 – Mobile drawer repair.
   A short landscape viewport is a mobile layout even if it is >860 px wide.
   This ONLY changes navigation layout and scrolling, never data or permissions. */
@media (orientation:landscape) and (max-height:600px) and (min-width:861px) and (max-width:1180px) {
  #dashboard {display:block;grid-template-columns:none;min-width:0;}
  #dashboard .main-column {width:100%;max-width:none;min-width:0;padding:0 16px 36px;}
  #dashboard .topbar {min-height:56px;padding:7px 0 9px;margin-bottom:10px;}
  #dashboard .topbar-leading {min-width:0;gap:12px;}
  #dashboard .topbar-description {display:none;}
  #dashboard .topbar h1 {font-size:21px;}
  #dashboard #mobile-nav-toggle {display:flex;align-items:center;justify-content:center;min-width:46px;min-height:46px;flex:none;}
  #dashboard .topbar .pill {display:none;}
  #dashboard .studio-mobile-bottom-nav {display:none!important;}
  #dashboard .sidebar {position:fixed;top:0;bottom:0;left:0;
    width:min(350px,91vw);max-width:91vw;height:100dvh;max-height:100dvh;
    padding:10px 16px 12px;z-index:250;
    background:#fffdfd;border-right:1px solid #eadfdc;
    box-shadow:22px 0 55px #36242f26;
    transform:translateX(calc(-100% - 24px));transition:transform .24s ease;}
  #dashboard .sidebar.nav-open {transform:translateX(0);}
  #dashboard .sidebar .admin-brand {display:none;}
  #dashboard .app-sidebar-heading {display:flex;align-items:center;justify-content:space-between;min-height:44px;}
  #dashboard .app-sidebar-heading button {display:grid;place-items:center;border:0;
    width:44px;height:44px;border-radius:12px;background:#f5e9eb;color:#654551;font-size:28px;}
  #dashboard .sidebar-search {padding:7px 0 12px;}
  #dashboard .sidebar-search input {font-size:16px;min-height:42px;}
  #dashboard .nav-backdrop:not([hidden]) {display:block;position:fixed;inset:0;z-index:240;
    border:0;background:rgba(38,23,33,.57);cursor:pointer;}
  body.admin-nav-open {overflow:hidden;}
}
/* Scroll the entire drawer in short landscape, not a tiny 20–60 px navigation
   subpane: search, all 19 sections and logout can all be reached by touch. */
@media (orientation:landscape) and (max-height:600px) and (max-width:1180px) {
  #dashboard .sidebar {display:block;overflow-y:auto!important;overflow-x:hidden!important;
    overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y;
    scrollbar-width:thin;}
  #dashboard .sidebar .app-sidebar-heading {position:sticky;top:0;z-index:1;
    background:#fffdfd;margin:-1px 0 4px;padding:0 0 4px;border-bottom:1px solid #eadfdc;}
  #dashboard .sidebar .tabs {display:block;flex:none;height:auto;min-height:0;
    overflow:visible;margin-right:0;padding-right:0;}
  #dashboard .sidebar .sidebar-bottom {margin-top:10px;}
  #dashboard .sidebar .tab {white-space:normal;}
}
/* Prevent a brief "self-opening" flash while rotating: changing from a
   desktop sidebar (transform:none) to a hidden drawer must be immediate. */
@media (max-width:860px), (orientation:landscape) and (max-height:600px) and (max-width:1180px) {
  #dashboard .sidebar:not(.nav-open) {transition:none!important;}
}
