/* Page adapters: layout-only fixes. Do not define separate color themes here. */

.page-command-center .sidebar {
  display: none;
}

.page-command-center .main {
  padding: 0;
}

.mechlab-page,
.calendar-page,
.roster-page,
.builder-page,
.account-page {
  background: transparent;
}

/* Keep large tools usable while inheriting global theme. */
.map-shell,
.board-layout,
.table-wrap,
.slot-grid {
  min-width: 0;
}

/* Mechlab embedded app may carry its own CSS; this adapter only nudges shared chrome. */
body:has(.mechlab-shell) .sidebar,
body:has(.mechlab-app) .sidebar {
  background:
    radial-gradient(circle at 45% 8%, rgba(155,255,0,.12), transparent 28%),
    linear-gradient(180deg, rgba(5,10,7,.98), rgba(2,4,3,.99)) !important;
}


/* Calendar scroll restoration */
.page-calendar,
.page-calendar body,
.page-calendar .content,
.page-calendar .main-content,
.page-calendar .page-shell,
.page-calendar .calendar-shell,
.page-calendar .calendar-page,
.page-calendar .calendar-wrap,
body.page-calendar,
body.page-calendar .content,
body.page-calendar .main-content {
  min-height:100vh !important;
  height:auto !important;
  max-height:none !important;
  overflow-y:auto !important;
}
.page-calendar .calendar-grid,
.page-calendar .calendar-list,
.page-calendar .events-list,
body.page-calendar .calendar-grid,
body.page-calendar .calendar-list,
body.page-calendar .events-list {
  max-height:none !important;
  overflow:visible !important;
}

/* Mechlab scroll restoration */
.page-mechlab,
body.page-mechlab,
body.page-mechlab .content,
body.page-mechlab .main-content,
body.page-mechlab .page-shell,
.page-mechlab .content,
.page-mechlab .main-content,
.page-mechlab .page-shell,
.page-mechlab .mechlab-integrated-shell,
.page-mechlab .mechlab-integrated-frame {
  height:auto !important;
  max-height:none !important;
  overflow-y:auto !important;
}
.page-mechlab .mechlab-integrated-frame,
.page-mechlab .mechlab-integrated-frame #root,
.page-mechlab .mechlab-integrated-frame #root .mechlab-page {
  overflow:visible !important;
  max-height:none !important;
  height:auto !important;
}

/* Mechlab Warehouse scroll-with-page restoration */
.page-mechlab .mechlab-integrated-frame,
.page-mechlab .mechlab-integrated-frame #root,
.page-mechlab .mechlab-integrated-frame #root .mechlab-page,
.page-mechlab .mechlab-integrated-frame #root .mechlab-page > div,
.page-mechlab .mechlab-integrated-frame #root [class*="flex-1"],
.page-mechlab .mechlab-integrated-frame #root [class*="min-h-screen"] {
  height:auto !important;
  max-height:none !important;
  overflow:visible !important;
}
.page-mechlab .mechlab-integrated-frame #root [class*="sticky"] {
  position:relative !important;
  top:auto !important;
  align-self:stretch !important;
}
.page-mechlab .mechlab-integrated-frame #root [class*="overflow-y-scroll"],
.page-mechlab .mechlab-integrated-frame #root [class*="overflow-auto"],
.page-mechlab .mechlab-integrated-frame #root [style*="overflow"] {
  max-height:none !important;
}

/* Navigation pane rollback: keep new nav buttons, restore pane/background to Command Center nav. */
.ops-sidebar {
  background:
    radial-gradient(circle at 45% 8%, rgba(155,255,0,.12), transparent 28%),
    linear-gradient(180deg, rgba(5,10,7,.98), rgba(2,4,3,.99)) !important;
  border-right:1px solid rgba(155,255,0,.24) !important;
  box-shadow:inset -1px 0 0 rgba(255,255,255,.04), inset 0 0 120px rgba(155,255,0,.035), 18px 0 40px rgba(0,0,0,.34) !important;
  clip-path:none !important;
}
.ops-sidebar.ui-pane-texture,
.ops-sidebar.ui-texture-armored-specops,
.ops-sidebar.ui-metal-frame,
.ops-sidebar.ui-pane,
.ops-sidebar.ui-nav-frame {
  background:
    radial-gradient(circle at 45% 8%, rgba(155,255,0,.12), transparent 28%),
    linear-gradient(180deg, rgba(5,10,7,.98), rgba(2,4,3,.99)) !important;
  border-top:0 !important;
  border-left:0 !important;
  border-bottom:0 !important;
  border-right:1px solid rgba(155,255,0,.24) !important;
  clip-path:none !important;
}
.ops-sidebar::before {
  content:"" !important;
  position:absolute !important;
  inset:8px !important;
  pointer-events:none !important;
  z-index:0 !important;
  border:1px solid rgba(155,255,0,.16) !important;
  clip-path:polygon(0 18px,18px 0,calc(100% - 18px) 0,100% 18px,100% calc(100% - 18px),calc(100% - 18px) 100%,18px 100%,0 calc(100% - 18px)) !important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.03), inset 0 0 56px rgba(0,0,0,.42) !important;
  background:transparent !important;
}
.ops-sidebar::after {
  display:none !important;
}
.ops-sidebar > * {
  position:relative !important;
  z-index:2 !important;
}
.ops-sidebar-bg {
  display:block !important;
  opacity:1 !important;
  visibility:visible !important;
}
/* Do not rollback .ops-sidebar a here. New metal nav button system remains active. */


/* Final sidebar split: old pane, new buttons only. */
.shell > .ops-sidebar,
aside.ops-sidebar {
  background:
    radial-gradient(circle at 45% 8%, rgba(155,255,0,.12), transparent 28%),
    linear-gradient(180deg, rgba(5,10,7,.98), rgba(2,4,3,.99)) !important;
  border:0 !important;
  border-right:1px solid rgba(155,255,0,.24) !important;
  clip-path:none !important;
  border-radius:0 !important;
}
.shell > .ops-sidebar.ui-pane-texture,
.shell > .ops-sidebar.ui-texture-armored-specops {
  background:
    radial-gradient(circle at 45% 8%, rgba(155,255,0,.12), transparent 28%),
    linear-gradient(180deg, rgba(5,10,7,.98), rgba(2,4,3,.99)) !important;
}
.ops-sidebar .ops-nav a {
  background:var(--ui-nav-btn-bg) !important;
  border:1px solid rgba(155,255,0,.18) !important;
  clip-path:polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px)) !important;
}

/* Roster scroll restoration */
body.page-roster_page,
body.page-roster,
.page-roster_page,
.page-roster,
body.page-roster_page .shell,
body.page-roster .shell,
body.page-roster_page .main,
body.page-roster .main,
body.page-roster_page .content,
body.page-roster .content,
body.page-roster_page .page-shell,
body.page-roster .page-shell {
  height:auto !important;
  min-height:100vh !important;
  max-height:none !important;
  overflow-y:auto !important;
}
body.page-roster_page .main,
body.page-roster .main {
  overflow:visible !important;
}
body.page-roster_page .panel,
body.page-roster .panel,
body.page-roster_page .table-wrap,
body.page-roster .table-wrap,
body.page-roster_page .roster-grid,
body.page-roster .roster-grid,
body.page-roster_page .roster-list,
body.page-roster .roster-list {
  max-height:none !important;
  overflow:visible !important;
}
body.page-roster_page .ops-sidebar,
body.page-roster .ops-sidebar {
  height:100vh !important;
  overflow-y:auto !important;
}
@media(max-width:1280px){
  body.page-roster_page .ops-sidebar,
  body.page-roster .ops-sidebar {
    height:auto !important;
    min-height:0 !important;
  }
}

/* Archives scroll restoration */
body.page-archives_page,
body.page-archive_detail_page,
.page-archives_page,
.page-archive_detail_page,
body.page-archives_page .shell,
body.page-archive_detail_page .shell,
body.page-archives_page .main,
body.page-archive_detail_page .main,
body.page-archives_page .content,
body.page-archive_detail_page .content,
body.page-archives_page .page-shell,
body.page-archive_detail_page .page-shell {
  height:auto !important;
  min-height:100vh !important;
  max-height:none !important;
  overflow-y:auto !important;
}
body.page-archives_page .main,
body.page-archive_detail_page .main {
  overflow:visible !important;
}
body.page-archives_page .archives-hub,
body.page-archive_detail_page .archives-hub,
body.page-archives_page .archive-section,
body.page-archive_detail_page .archive-section,
body.page-archives_page .archive-list-grid,
body.page-archive_detail_page .archive-list-grid,
body.page-archives_page .archive-detail,
body.page-archive_detail_page .archive-detail,
body.page-archives_page .archive-rounds,
body.page-archive_detail_page .archive-rounds,
body.page-archives_page .panel,
body.page-archive_detail_page .panel {
  height:auto !important;
  max-height:none !important;
  overflow:visible !important;
}
body.page-archives_page .ops-sidebar,
body.page-archive_detail_page .ops-sidebar {
  height:100vh !important;
  overflow-y:auto !important;
}
@media(max-width:1280px){
  body.page-archives_page .ops-sidebar,
  body.page-archive_detail_page .ops-sidebar {
    height:auto !important;
    min-height:0 !important;
  }
}

/* Calendar scroll restoration and guard */
body.page-calendar_page,
body.page-calendar_event_detail_page,
.page-calendar_page,
.page-calendar_event_detail_page,
body.page-calendar_page .shell,
body.page-calendar_event_detail_page .shell,
body.page-calendar_page .main,
body.page-calendar_event_detail_page .main,
body.page-calendar_page .content,
body.page-calendar_event_detail_page .content,
body.page-calendar_page .page-shell,
body.page-calendar_event_detail_page .page-shell {
  height:auto !important;
  min-height:100vh !important;
  max-height:none !important;
  overflow-y:auto !important;
}
body.page-calendar_page .main,
body.page-calendar_event_detail_page .main {
  overflow:visible !important;
}
body.page-calendar_page .calendar-shell,
body.page-calendar_event_detail_page .event-detail-page,
body.page-calendar_page .month-grid,
body.page-calendar_page .upcoming-panel,
body.page-calendar_page .panel,
body.page-calendar_event_detail_page .panel,
body.page-calendar_event_detail_page .event-detail-hero,
body.page-calendar_event_detail_page .attendance-groups {
  height:auto !important;
  max-height:none !important;
  overflow:visible !important;
}
body.page-calendar_page .ops-sidebar,
body.page-calendar_event_detail_page .ops-sidebar {
  height:100vh !important;
  overflow-y:auto !important;
}
@media(max-width:1280px){
  body.page-calendar_page .ops-sidebar,
  body.page-calendar_event_detail_page .ops-sidebar {
    height:auto !important;
    min-height:0 !important;
  }
}
