/* Design tokens. Pre-hydration defaults = the Sunsama Matte theme (2026-10-31);
   applyDisplaySettingsToDocument() repaints them from the user's settings row. */
:root {
  /* Backgrounds */
  --bg: #131314;
  --card: #141415;
  --daily-goals-bg: #131314;
  --week-grid-surface: var(--daily-goals-bg);
  /* Card / row / event surfaces. 🔴 OPAQUE — a translucent card takes the colour
     of whatever it lands on (backdrop gradient, another card, a connector), so
     the same card is two colours in two places. These are the pre-hydration
     defaults; applyDisplaySettingsToDocument() resolves them per theme, dark by
     flattening the old 0.72/0.82 tint, light by moving toward white. */
  --utility-surface: #212123;
  --utility-surface-strong: #262628;
  /* Accent-tinted surface, e.g. long-term-goal rows. Set per-theme too. */
  --utility-surface-accent: #2f2d45;
  /* The board card, on every goal tab. Opaque like the two above and for the
     same reason: the old `rgba(var(--overlay-rgb), 0.04)` had no panel under it
     — the boards are transparent to the body — so a card was showing the
     backdrop gradient through itself. Dark is that 4%/9% flattened against the
     default body; light resolves to the utility surface. */
  --card-surface: #1d1d1e;
  --card-surface-strong: #272728;
  --backdrop-gradient-layer: none;

  /* Surfaces that sit ABOVE a panel — menus, dropdowns, popovers.
     One token, three names: `--bg-elevated` is the one to use, the other two are
     the names older stylesheets reached for. All three are set per-theme by
     applyDisplaySettingsToDocument(); before that they were declared NOWHERE, so
     every `var(--bg-elevated, #1c1f26)` fell through to its hardcoded dark hex
     and a light-theme menu drew dark text on a dark panel. */
  --bg-elevated: #212123;
  --bg-secondary: var(--bg-elevated);
  --surface-raised: var(--bg-elevated);
  /* The floating panel (nav drawer, week widgets). Same story — and opaque now,
     like every other surface. */
  --panel-bg: #212123;

  /* Text */
  --text-primary: #e6e6e6;
  --text-secondary: #a8a8a8;
  --text-muted: #858585;
  /* Between secondary and muted — icon glyphs and row details. */
  --text-tertiary: #969696;

  /* Accents */
  --accent: #8f88d9;
  --accent-hover: #7b75bb;
  /* Text on an accent fill; resolved per accent by applyDisplaySettingsToDocument(). */
  --accent-contrast: #131314;
  --tab-active-bg: rgba(143, 136, 217, 0.18);
  --tab-active-border: rgba(143, 136, 217, 0.35);

  /* Experiment colors */
  --experiment-1: #4a9eff;
  --experiment-2: #9c7cf4;
  --experiment-3: #4ecdc4;

  /* Widget colors */
  --rating-line: #33c46e;
  --burnout-line: #e05050;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);

  /* Theme-adaptive overlay base.
     Use as rgba(var(--overlay-rgb), <alpha>) for surface tints, hovers,
     dividers, and text that must contrast with the panel/background.
     White on dark themes; flipped to dark slate on light themes by
     applyDisplaySettingsToDocument() so the same alpha reads correctly
     against the opposite background. */
  --overlay-rgb: 255, 255, 255;
  /* Scrim behind modals/popovers — stays dark in both themes. */
  --scrim: rgba(0, 0, 0, 0.55);

  /* Selection / focus */
  --selection: rgba(143, 136, 217, 0.3);

  /* Shared dimensions */
  --shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --radius-sm: 12px;
  --slot: 28px; /* schedule grid row height */
}
