/* One persistent shell. Every destination keeps its own business markup in
   the right scrollport; the approved system surface owns the outer geometry. */
body[data-management-active] { overflow: hidden; }
body[data-management-active] > .site-footer { display: none; }
body[data-management-active] #main-content { padding-top: 22px; }
body[data-management-active] #main-content > .hx-workspace-shell:has(> .hx-management-nav) {
  display: grid; grid-template-columns: 200px minmax(0,1fr); gap: 24px;
  position: relative; width: auto; max-width: none; min-height: 0;
  height: max(220px, calc(100dvh - var(--hx-shell-top,92px) - 22px));
  margin: 0 24px; padding: 0; border: 0; border-radius: 0;
  background: transparent; box-shadow: none;
}
body[data-management-active] .hx-workspace-shell > .hx-management-nav {
  position: relative; inset: auto; width: 200px; height: 100%; min-height: 0;
  margin: 0; padding: 16px 9px; border-radius: 23px; overflow: auto;
}
.hx-workspace-view {
  min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain;
  padding: 28px; border: 1px solid var(--ny-workspace-line);
  border-radius: 24px; background: var(--ny-workspace-surface);
  box-shadow: var(--ny-workspace-shadow); scrollbar-gutter: stable;
  scroll-padding-top: 18px; position: relative;
}
#main-content [data-management-view] > :not(dialog,.flash-stack,.campus-route-notice) {
  width: 100%; max-width: none; min-width: 0; margin: 0; padding: 0;
  border: 0; box-shadow: none; background: transparent;
}
#main-content [data-management-view] > :is(.steward-shell,.owner-dashboard,.agent-control,.alice-plans,.ra-shell,.hx-management-main,.hx-management-module) {
  width: 100%; max-width: none; min-height: 0; padding: 0; margin: 0;
}
.hx-workspace-view :is(.rwx,.rwx-layout,.rwx-detail,.rwx-list) { min-width: 0; }
.hx-workspace-view .rwx-list { max-height: none; }
.hx-workspace-view .rwx-detail { max-height: none; overflow: visible; }
.hx-workspace-view .rwx-head h1 { animation: none !important; }
.hx-workspace-status {
  position: absolute; z-index: 25; bottom: 16px; right: 24px;
  display: flex; gap: 14px; align-items: center; max-width: calc(100% - 260px);
  padding: 10px 16px; border: 1px solid var(--ny-line); border-radius: 12px;
  color: var(--ny-text); background: var(--ny-surface); box-shadow: var(--ny-shadow);
  font-size: 14px;
}
.hx-workspace-status[hidden] { display: none; }
.hx-workspace-status[data-error=true] { border-color: var(--ny-danger); }
.hx-workspace-status button { border: 0; background: transparent; color: var(--ny-link); padding: 5px; cursor: pointer; white-space: nowrap; }
.hx-workspace-shell[aria-busy=true] > .hx-workspace-view { cursor: progress; }
.hx-workspace-shell[aria-busy=true]::after {
  content: ""; position: absolute; z-index: 30; left: 248px; right: 24px; top: 0;
  height: 2px; border-radius: 2px; pointer-events: none;
  background: linear-gradient(90deg,transparent,var(--ny-focus),transparent);
  background-size: 45% 100%; background-repeat: no-repeat;
  animation: hx-workspace-progress 1s ease-in-out infinite;
}
@keyframes hx-workspace-progress { from { background-position: -80% 0; } to { background-position: 180% 0; } }
@media (max-width:1000px) {
  body[data-management-active] #main-content { padding-top: 14px; }
  body[data-management-active] #main-content > .hx-workspace-shell:has(> .hx-management-nav) {
    grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr);
    gap: 10px; margin-inline: 12px; height: max(200px,calc(100dvh - var(--hx-shell-top,80px) - 12px));
  }
  body[data-management-active] .hx-workspace-shell > .hx-management-nav {
    width: 100%; height: auto; overflow: visible; min-height: 0; padding: 0;
    background: var(--ny-workspace-chrome); border: 1px solid var(--ny-workspace-line); border-radius: 15px;
  }
  .hx-workspace-shell .hx-management-nav-menu > summary { padding: 10px 14px; min-height: 44px; }
  .hx-workspace-shell .hx-management-nav-body {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 35;
    max-height: min(60dvh,500px); padding: 14px; border: 1px solid var(--ny-line);
    border-radius: 16px; background: var(--ny-surface); box-shadow: var(--ny-shadow);
  }
  .hx-workspace-view { padding: 20px; border-radius: 20px; }
  .hx-workspace-status { max-width: calc(100% - 24px); right: 12px; bottom: 10px; }
  .hx-workspace-shell[aria-busy=true]::after { left: 20px; right: 20px; top: 58px; }
}
@media (max-width:560px) { .hx-workspace-view { padding: 18px; } }
@media (prefers-reduced-motion:reduce) {
  .hx-workspace-shell::after { animation: none !important; }
}
@media (forced-colors:active) {
  .hx-workspace-view,.hx-workspace-status { border-color: CanvasText; background: Canvas; color: CanvasText; box-shadow: none; }
}
@media print {
  body[data-management-active] { overflow: visible; }
  .hx-workspace-shell { height: auto !important; display: block !important; }
  .hx-workspace-view { overflow: visible; border: 0; box-shadow: none; }
  .hx-workspace-shell > .hx-management-nav,.hx-workspace-status { display: none !important; }
}
