/* HR business geometry only. Outer page insets remain owned by workspace-container.css. */
[data-hr-layout="fixed"][data-hr-layout] {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
[data-hr-layout] > [data-hr-workspace="fixed"][data-hr-workspace] {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
[data-hr-workspace] > .mis-page-banner-stack { flex: 0 0 auto; }
[data-hr-layout] [data-hr-scroll="content"][data-hr-scroll] {
  flex: 1 1 0%;
  min-height: 0;
  min-width: 0;
  width: 100%;
  padding: 10px 0 0;
  overflow: auto;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}
/* Empty/error panels fill the same available body as successful content. */
[data-hr-scroll] > section:only-child { min-height: 100%; }
/* Benefits: statistics stay above a ledger whose rows scroll within its panel. */
[data-hr-view="social-benefits"] [data-hr-scroll] > div {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  height: 100%;
  gap: 12px;
}
[data-hr-view="social-benefits"] [data-hr-scroll] > div > * { flex-shrink: 0; }
[data-hr-view="social-benefits"] [data-hr-scroll] > div > section:last-child {
  display: flex;
  flex-direction: column;
  flex: 1 0 360px;
  min-height: 360px;
}
[data-hr-view="social-benefits"] [data-hr-scroll] > div > section:last-child > div:has(> table) {
  flex: 1 1 0%;
  min-height: 120px;
  overflow: auto;
  scrollbar-width: thin;
}
[data-hr-view="social-benefits"] [data-hr-scroll] thead { position: sticky; top: 0; z-index: 1; }
@media (max-width: 760px) {
  /* The phone shell has no block insets; consume the public page variables once. */
  [data-hr-layout="fixed"][data-hr-layout] {
    padding-block: var(--mis-page-inset-block, 10px) var(--mis-page-inset-bottom, 18px);
  }
  /* Keep all business controls reachable as a single content scroller on phones. */
  [data-hr-layout] [data-hr-scroll="content"][data-hr-scroll] { display: block; }
  [data-hr-view="social-benefits"] [data-hr-scroll] > div { height: auto; }
  [data-hr-view="social-benefits"] [data-hr-scroll] > div > section:last-child {
    flex: 0 0 auto;
    min-height: 0;
  }
  [data-hr-view="social-benefits"] [data-hr-scroll] > div > section:last-child > div:has(> table) {
    flex: 0 0 auto;
    max-height: min(360px, 50dvh);
  }
}
/* Organization maintenance: fill the public workspace, preserving its bottom inset. */
@media (min-width: 1200px) {
  [data-hr-view="organization"] [data-hr-scroll="content"][data-hr-scroll]:has(> [data-employee-editor]) {
    display: flex;
    flex-direction: column;
  }
  [data-hr-view="organization"] [data-hr-scroll] > section[aria-label="真实组织统计"] {
    flex: 0 0 auto;
  }
  [data-hr-view="organization"] [data-hr-scroll] > [data-employee-editor] {
    flex: 1 1 0%;
    height: auto;
    min-height: 0;
  }
}

