/* Navbar colours — consumed by shared/navbar.css.
 *
 * Every chain below ends in a literal. A page that mounts the bar without
 * `shared/theme.css` leaves every `--theme-*` undefined, and a chain with no
 * terminal fallback then resolves to nothing: the colour becomes `unset`, the
 * bar paints white, and a project's own override — light text for a dark bar —
 * writes white on white. The storage portal was in exactly that state. Loading
 * the palette is the fix; ending every chain is what keeps the next page that
 * forgets it merely unbranded rather than unreadable.
 *
 * Static on purpose: every value is the theme's own, read through `--theme-*`,
 * so a palette change rewrites `shared/theme.css` and nothing else.
 *
 * Scoped to `.gs-navbar` rather than `:root` because navbar.css declares its own
 * `:root` fallbacks and is injected after this file, so a `:root` rule here
 * would tie on specificity and lose.
 *
 * The `--theme-nav-*` fallbacks are how a coloured navbar arrives: a palette
 * declaring `navBg` emits them into theme.css.
 */
.gs-navbar, .gs-navbar * {
  --nav-bg: var(--theme-nav-bg, #ffffff);
  --nav-bg-scroll: var(--theme-nav-bg-scroll, var(--theme-nav-bg, #ffffff));
  --nav-dropdown-border: var(--theme-primary-dark, rgba(15, 23, 42, 0.12));

  /* The panels that open below the bar — the user menu and the language menu —
     are drawn on a light surface of their own, so they read the *page's*
     palette rather than the bar's.
     Borrowing `--nav-text` put #e2e8f0 on #fff wherever `navBg` was dark, which
     is nearly every data space: the user menu came out at 1.15:1, unreadable,
     and no `branding.overrides` could reach it — the nav text tokens are
     constants in `tokens.nav_tokens()`, not derived values the document can
     pin. On a light navbar these resolve to what they already resolved to, so
     nothing changes there. */
  --nav-dropdown-bg: #ffffff;
  --nav-dropdown-text: var(--theme-text, #334155);
  --nav-dropdown-text-muted: var(--theme-text-muted, #64748b);
  --nav-dropdown-hover-bg: var(--theme-nav-dropdown-hover-bg);
  --nav-dropdown-edge: var(--theme-border, rgba(15, 23, 42, 0.12));
  --nav-border: var(--theme-nav-border, var(--theme-border, rgba(15, 23, 42, 0.12)));
  --nav-text: var(--theme-nav-text, var(--theme-text, #4a5568));
  --nav-text-dark: var(--theme-nav-text-dark, var(--theme-text, #2d3748));
  --nav-text-muted: var(--theme-nav-text-muted, var(--theme-text-muted, #a0aec0));
  --nav-accent: var(--theme-accent, #3f83f8);
  --nav-accent-hover: var(--theme-accent-hover, #2563eb);
  --nav-accent-bg: var(--theme-nav-accent-bg, var(--theme-accent-bg, #eff6ff));
  --nav-accent-shadow: var(--theme-accent-shadow, rgba(59, 130, 246, 0.15));
  /* Left to the stylesheet's own `currentColor` wash unless a space states
     one: a fixed light colour cannot stay legible under light text. */
  --nav-hover-bg: var(--theme-nav-hover-bg);
  --nav-active-bg: var(--theme-nav-active-bg, var(--theme-primary-light, #edf2f7));
  --nav-avatar-bg: linear-gradient(
    135deg,
    var(--theme-accent, #3f83f8) 0%,
    var(--theme-accent-hover, #2563eb) 100%
  );
  --nav-avatar-color: #ffffff;
  --nav-danger: #ef4444;
  --nav-danger-bg: rgba(239, 68, 68, 0.12);
}
