/* Compatibility with the deployed homepage bundle; removed from its source. */
:root { --portal-menu-layer: 100000100; }
/* Raise both the portal wrapper and its content, not just the child menu. */
html body :is(.select-dropdown-portal, .ant-select-dropdown, .ant-picker-dropdown, .ant-dropdown, .ant-popover,
  [data-slot="select-content"], [data-radix-popper-content-wrapper]:has([role="listbox"], [data-slot="select-content"])) {
  z-index: var(--portal-menu-layer) !important;
}
html body .ant-tooltip { z-index: 100000110 !important; }
/* Inline date menus share the toolbar's stacking context. */
html body .nocturne-table-toolbar:has(.date-picker-dropdown) {
  position: relative;
  z-index: 100000099 !important;
}
html body .date-picker-dropdown { z-index: var(--portal-menu-layer) !important; }

html body .nocturne-home .nocturne-hero-panels { display: none !important; }

/* Shared material for signed-in pages, including overlays teleported to body. */
html body:has(.nocturne-workspace, .ant-app, .app-shell, .arena-panel) {
  --workspace-glass: linear-gradient(135deg, rgb(65 76 96 / 38%), rgb(20 27 40 / 62%));
  --workspace-glass-inner: rgb(103 122 153 / 9%);
  --workspace-glass-edge: rgb(201 216 242 / 26%);
}

html body:has(.nocturne-workspace, .ant-app, .app-shell, .arena-panel) :is(
  .card, .glass-card, .stat-card, .ant-card, .nocturne-table-toolbar,
  .table-scroll-container, .workspace-header, .workspace-sidebar, .sidebar,
  .nocturne-mobile-dock, .portal-dashboard-panel, .portal-dashboard-stat,
  .modal-content, .ant-modal-content, .ant-drawer-content, .announcement-panel,
  .nocturne-toast, .ant-message-notice-content, .ant-notification-notice,
  .ant-popover-inner, .ant-dropdown-menu, .ant-select-dropdown, .dropdown,
  [role="listbox"], [role="menu"], .driver-popover,
  .settings-dialog, .image-preview-dialog, .canvas-appearance-panel,
  .canvas-zoom-dock, .canvas-toolbar-dock, .home-controls, .home-stats-panel,
  .arena-panel, .list-screen, .main-panel, .composer, .control-card,
  .app-shell-header, .topbar, .nocturne-project-card, .nocturne-history-rail,
  .nocturne-creation-panels > div, .nocturne-reading-room article,
  .admin-section-nav-shell,
  .bg-popover, div.bg-card[class*="rounded"],
  div.bg-white[class*="rounded"], section.bg-white[class*="rounded"],
  div.bg-dark-800[class*="rounded"]
) {
  background: var(--workspace-glass) !important;
  border-color: var(--workspace-glass-edge) !important;
  box-shadow: inset 0 1px 0 rgb(237 244 255 / 17%), inset 0 -1px 0 rgb(180 197 224 / 5%), 0 12px 32px rgb(0 0 0 / 16%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(125%) !important;
  backdrop-filter: blur(18px) saturate(125%) !important;
}

/* Inner layers must not obscure the translucent outer surface. */
html body:has(.nocturne-workspace, .ant-app, .app-shell, .arena-panel) :is(
  .modal-header, .modal-body, .modal-footer, .ant-modal-header, .ant-modal-footer,
  .ant-drawer-header, .ant-drawer-body, .ant-drawer-footer, .ant-card-head,
  .ant-card-body, .ant-table, .ant-table-container, .table-wrapper,
  .announcement-header, .announcement-body, .announcement-footer
) {
  background: transparent !important;
}
html body:has(.nocturne-workspace, .ant-app, .app-shell, .arena-panel) :is(
  .nocturne-workspace table th, .ant-table-thead > tr > th,
  .modal-content .input, .ant-modal-content .ant-input,
  .ant-drawer-content .ant-input
) {
  background: var(--workspace-glass-inner) !important;
}

/* Light theme keeps dark text on a pale, translucent material. */
html:not(.dark) body:has(.nocturne-workspace) {
  --workspace-glass: linear-gradient(135deg, rgb(255 255 255 / 66%), rgb(233 239 250 / 72%));
  --workspace-glass-inner: rgb(120 140 175 / 8%);
  --workspace-glass-edge: rgb(108 129 163 / 25%);
}
@supports not (backdrop-filter: blur(1px)) {
  html body:has(.nocturne-workspace, .ant-app, .app-shell, .arena-panel) {
    --workspace-glass: rgb(24 32 47 / 92%);
  }
  html:not(.dark) body:has(.nocturne-workspace) { --workspace-glass: rgb(243 246 252 / 94%); }
}

/* Lists must reveal their glass container rather than paint a solid body. */
html body .nocturne-workspace :is(table, tbody, .table-body, thead, .table-header) {
  background: transparent !important;
}
html body .nocturne-workspace :is(thead, .table-header) {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
html body .nocturne-workspace {
  --list-sticky-glass: rgb(39 48 66 / 64%);
  --list-hover-glass: rgb(170 192 224 / 12%);
}
html:not(.dark) body .nocturne-workspace {
  --list-sticky-glass: rgb(236 242 252 / 72%);
  --list-hover-glass: rgb(100 130 175 / 12%);
}
/* Blur on sticky cells prevents scrolled text from overlapping their labels. */
html body:has(.nocturne-workspace) .nocturne-workspace :is(table th, tbody .sticky-col, .ant-table-cell-fix-left, .ant-table-cell-fix-right) {
  background: var(--list-sticky-glass) !important;
  -webkit-backdrop-filter: blur(14px) saturate(120%) !important;
  backdrop-filter: blur(14px) saturate(120%) !important;
}
html body .nocturne-workspace tbody tr:hover {
  background: var(--list-hover-glass) !important;
}
html body .nocturne-workspace :is(.pagination-panel, div.border-t:has(> div > nav[aria-label="Pagination"])) {
  background: var(--workspace-glass) !important;
  border: 1px solid var(--workspace-glass-edge) !important;
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgb(237 244 255 / 17%), 0 8px 24px rgb(0 0 0 / 12%);
  -webkit-backdrop-filter: blur(18px) saturate(125%) !important;
  backdrop-filter: blur(18px) saturate(125%) !important;
}
html body .nocturne-workspace :is(.pagination-panel, div.border-t:has(> div > nav[aria-label="Pagination"])) :is(button, input) {
  background: var(--workspace-glass-inner) !important;
  border-color: var(--workspace-glass-edge) !important;
}
html body .nocturne-workspace :is(.pagination-panel, div.border-t:has(> div > nav[aria-label="Pagination"])) button[aria-current="page"] {
  background: rgb(159 184 235 / 24%) !important;
  border-color: rgb(192 211 249 / 60%) !important;
}
