/* AUTO-GENERATED by Birko.DesignTokens from tokens.json. DO NOT EDIT.
   Change a value in tokens.json, then: dotnet run --project Birko.DesignTokens -- generate
   A hand-edit here is silently deleted by the next generate — that has happened twice, and both
   times the lost edit was a real fix (see Birko.DesignTokens/CLAUDE.md). */

/* ── Dark theme ───────────────────────────────────────────────────────────────
   Opt-in theme. Link AFTER tokens.css (the base/light tokens live in :root there):
     <link rel="stylesheet" href="css/tokens.css" />
     <link rel="stylesheet" href="css/themes/dark.css" />
   Activate with `data-theme="dark"` on <html> (the shell persists this via the
   `{storagePrefix}-theme` localStorage key). Register it in the switcher with
   `registerThemes([BUILTIN_THEMES.dark])` from birko-web-shell. ── */
[data-theme="dark"] {
  --b-color-primary: #3b82f6;
  --b-color-primary-hover: #60a5fa;
  --b-color-primary-light: #1e3a5f;
  --b-color-primary-text: #70a4f8;
  /* The rest of the semantic *-light family. These are TINT BACKGROUNDS, and tokens.css gives them pale
     pastels (#dcfce7 / #fef3c7 / #fee2e2 / #cffafe) for a light page. Only primary-light was ever darkened
     here, so in dark mode the other four kept their pastel value while --b-text flipped to #f1f5f9 — near-
     white text on cream. Found on the Reps device pass 2026-08-01, where b-stale-banner's offline warning
     was unreadable in dark but fine in light. b-badge, b-sync-status and b-markdown-editor use the same
     tokens and had the same defect; fixing the tokens fixes all four at once, and any future consumer.
     Values follow primary-light's approach: a dark, desaturated tint of the same hue, so --b-text sits on
     them at a comfortable ratio. */
  --b-color-success-light: #14352a;
  --b-color-success-text: #2cac5b;
  --b-color-warning-light: #3d2c0a;
  --b-color-warning-text: #dc8117;
  --b-color-danger-light: #3f1d1d;
  --b-color-info-light: #0e3438;
  --b-color-info-text: #32a4bf;
  --b-color-danger-hover: #ef4444;
  /* Text-only red. The base #dc2626 measures 3.03:1 on --b-bg-secondary — below AA for small text.
     #f87171 gives 5.29:1 there and 6.45:1 on --b-bg, without touching the danger used for fills. */
  --b-color-danger-text: #f87171;

  --b-bg: #0f172a;
  --b-bg-secondary: #1e293b;
  --b-bg-tertiary: #334155;
  --b-bg-elevated: #1e293b;

  --b-tooltip-bg: #0f172a;
  --b-tooltip-text: #e2e8f0;
  --b-tooltip-border: #1e293b;

  --b-text: #f1f5f9;
  --b-text-secondary: #b3becd;
  /* Muted text floor: 5.59:1 on --b-bg, 4.58:1 on --b-bg-secondary. #64748b measured 3.75 / 3.07 (TASK-562). */
  --b-text-muted: #a3adbd;
  /* White on #3b82f6 is 3.68:1 (2.54:1 on hover). Primary stays, because 45 rules use it as a text
     colour on dark surfaces; the text on the fill goes dark instead: 4.85:1, 7.02:1 on hover (TASK-562). */
  --b-text-on-primary: #0f172a;

  --b-border: #334155;
  --b-border-hover: #475569;

  --b-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --b-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --b-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --b-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  /* xl is the level every overlay uses (b-modal, b-drawer, b-confirm-dialog, b-command-palette,
     b-tour). The dark themes stopped overriding at lg, so xl fell through to the light :root value
     (alpha 0.1 / 0.04) and measured weaker on a dark page than --b-shadow four rungs below it — the
     depth scale inverted at its deepest step. Alpha continues this theme's own progression. */
  --b-shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);

  --b-focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.25);
  --b-focus-ring-danger: 0 0 0 3px rgba(239, 68, 68, 0.25);

  --b-backdrop-bg: rgba(0, 0, 0, 0.6);
  --b-backdrop-bg-light: rgba(0, 0, 0, 0.3);

  /* Status alpha — brighter hues + stronger alpha so tints read on dark surfaces */
  --b-color-danger-alpha-bg: rgba(239, 68, 68, 0.15);
  --b-color-danger-alpha-border: rgba(239, 68, 68, 0.4);
  --b-color-success-alpha-bg: rgba(34, 197, 94, 0.15);
  --b-color-success-alpha-border: rgba(34, 197, 94, 0.4);
  --b-color-warning-alpha-bg: rgba(234, 179, 8, 0.15);
  --b-color-warning-alpha-border: rgba(234, 179, 8, 0.4);
  --b-color-info-alpha-bg: rgba(14, 165, 233, 0.15);
  --b-color-info-alpha-border: rgba(14, 165, 233, 0.4);

  /* Neutral overlays — white-based so hover/dividers stay visible on dark */
  --b-overlay-subtle: rgba(255, 255, 255, 0.04);
  --b-overlay-light: rgba(255, 255, 255, 0.06);
  --b-overlay-medium: rgba(255, 255, 255, 0.12);
}
