@layer components {
  :root { --admin-banner-height: 40px; }

  .admin-banner {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    min-height: var(--admin-banner-height); padding: 6px 16px; font-size: 13px; color: var(--foreground);
    background: var(--jx-accent-soft); border-bottom: 1px solid var(--jx-accent-line);
  }
  .admin-banner--urgent { background: var(--jx-no-soft); border-bottom-color: var(--jx-no); }
  .admin-banner time { font-variant-numeric: tabular-nums; }
  .admin-banner-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
  .admin-banner-actions form { margin: 0; }

  /* The shell's full-height columns shrink by the banner so nothing slides under the fold. */
  .admin-banner ~ .app-shell {
    min-height: calc(100vh - var(--admin-banner-height));
    min-height: calc(100dvh - var(--admin-banner-height));
  }
  .admin-banner ~ .app-shell :is(.app-sidebar, .app-panel) {
    top: var(--admin-banner-height);
    height: calc(100vh - var(--admin-banner-height) - var(--panel-offset, 0px));
    height: calc(100dvh - var(--admin-banner-height) - var(--panel-offset, 0px));
  }
  .admin-banner ~ .app-shell .panel-resize {
    top: calc(var(--admin-banner-height) + var(--conversation-header-height));
  }
  .admin-banner ~ .app-shell .app-main--flush {
    height: calc(100vh - var(--admin-banner-height));
    height: calc(100dvh - var(--admin-banner-height));
  }

  /* Both notices: the AI quota one sticks under this one and the shell gives up both heights. */
  .admin-banner ~ .quota-banner { top: var(--admin-banner-height); }
  .admin-banner ~ .quota-banner ~ .app-shell {
    min-height: calc(100dvh - var(--admin-banner-height) - var(--quota-banner-height));
  }
  .admin-banner ~ .quota-banner ~ .app-shell :is(.app-sidebar, .app-panel) {
    top: calc(var(--admin-banner-height) + var(--quota-banner-height));
    height: calc(100dvh - var(--admin-banner-height) - var(--quota-banner-height) - var(--panel-offset, 0px));
  }
  .admin-banner ~ .quota-banner ~ .app-shell .app-main--flush {
    height: calc(100dvh - var(--admin-banner-height) - var(--quota-banner-height));
  }

  @media (max-width: 1099px) {
    .admin-banner ~ .app-shell .app-sidebar { height: auto; }
  }
}
