/* Shared layout overrides that used to live beside the icon rail.
   The rail itself is gone; these rules still apply to every page. */

/* ── Semantic z-index scale ────────────────────────────────────── */
/* One ordered scale for app chrome, so layers stack predictably instead of
   escalating to arbitrary values like 999999. (DaisyUI's modal sits at 999;
   toasts are placed above it so confirmations are never hidden behind a modal.) */
:root {
  --z-sticky: 10;      /* topbar (set in nexus.css) */
  --z-rail: 40;        /* command centre sidebar */
  --z-widget: 45;
  --z-bottom-nav: 50;  /* mobile bottom nav */
  --z-modal: 999;      /* DaisyUI modal */
  --z-toast: 1100;     /* flash messages, above modal */
}

/* ── Hide the old nexus sidebar ────────────────────────────────── */
#layout-sidebar,
#layout-sidebar-toggle-trigger,
#layout-sidebar-hover-trigger,
#layout-sidebar-hover,
#layout-sidebar-backdrop {
  display: none !important;
}

/* ── Bottom Nav (mobile) ─────────────────────────────────────── */
.bottom-nav {
  display: none;
}

.bottom-nav-item-wrapper {
  flex: 1;
  display: flex;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 4px;
  padding: 6px 0;
  color: color-mix(in oklab, var(--color-base-content) 72%, transparent);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item.active {
  color: var(--color-base-content);
}
.bottom-nav-pill {
  display: grid;
  place-items: center;
  width: 52px;
  height: 30px;
  border-radius: 15px;
  transition: background-color 0.15s ease-out, color 0.15s ease-out;
}
.bottom-nav-item.active .bottom-nav-pill {
  background: color-mix(in oklab, var(--color-primary) 16%, transparent);
}
.bottom-nav-item.active .bottom-nav-label {
  font-weight: 600;
}
.bottom-nav-item:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
  border-radius: 8px;
}

.bottom-nav-icon {
  width: 22px;
  height: 22px;
}

.bottom-nav-mark-accent {
  stroke: var(--color-primary);
}

#bottom-nav-more-menu {
  flex-wrap: nowrap;
  max-height: calc(100dvh - 64px - env(safe-area-inset-bottom, 0px) - 24px);
  overflow-x: hidden;
  overflow-y: auto;
}
#bottom-nav-more-menu a {
  overflow-wrap: anywhere;
}

.bottom-nav-label {
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
  .bottom-nav-item,
  .bottom-nav-pill {
    transition: none;
  }
}

/* ── Missing max-width utilities ───────────────────────────────── */
/* The vendored nexus.css is a partial Tailwind build that omitted several base
   max-w-* utilities (the --container-* vars exist, but the classes were never
   emitted). Without these, e.g. `max-w-3xl` is a no-op and content stretches
   full-width — which also lets wide tables overflow the viewport horizontally.
   Restored here against the same container tokens nexus.css already defines. */
.max-w-xl {
  max-width: var(--container-xl);
}
.max-w-3xl {
  max-width: var(--container-3xl);
}
.max-w-5xl {
  max-width: var(--container-5xl);
}
.max-w-6xl {
  max-width: var(--container-6xl);
}
.max-w-7xl {
  max-width: 80rem;
}
.ml-auto {
  margin-left: auto;
}

/* ── Section Tabs ──────────────────────────────────────────────── */
.section-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin: 0 -4px;
  padding-left: 4px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.section-tabs:hover {
  scrollbar-color: color-mix(in oklab, var(--color-base-content) 30%, transparent) transparent;
}
