:root {
  --sp-control-min-touch-size: 44px;
  --sp-selection-light-fill: #7836ef;
  --sp-selection-light-border: #9b6cff;
  --sp-selection-light-text: #ffffff;
  --sp-selection-light-top: #9b6cff;
  --sp-selection-dark-fill: #7656c8;
  --sp-selection-dark-border: #9b6cff;
  --sp-selection-dark-text: #ffffff;
  --sp-selection-dark-top: #9b6cff;
  --sp-color-blue: #2167f5;
  --sp-color-blue-bright: #397cff;
  --sp-color-violet: #9b6cff;
  --sp-control-icon-light: #9b6cff;
  --sp-control-icon-dark: #c3a4ff;
  --sp-color-ink: #0b285b;
  --sp-vibe-fill: #e7efff;
  --sp-vibe-border: rgba(255,255,255,0.92);
  --sp-vibe-text: #0b285b;
  --sp-vibe-hover: #dbe7fc;
  --sp-vibe-pressed: #c7daf7;
  --sp-vibe-selected-fill: #ccdfff;
  --sp-vibe-selected-border: #2167f5;
  --sp-vibe-text-icon: #147aff;
  --sp-vibe-connection-icon: #00b88a;
  --sp-vibe-live-icon: #f57a00;
  --sp-vibe-host-icon: #9254f6;
  --sp-vibe-glass-background: radial-gradient(ellipse at 50% -18%, rgba(255,255,255,0.98), transparent 50%), linear-gradient(155deg, rgba(250,252,255,0.97), rgba(229,239,255,0.96) 76%);
  --sp-vibe-glass-shadow: 0 10px 24px rgba(23,58,115,0.13), inset 0 1px 0 rgba(255,255,255,0.96);
  --sp-vibe-glass-sheen: rgba(255,255,255,0.9);
  --sp-vibe-radius: 20px;
  --sp-vibe-border-width: 2px;
  --sp-vibe-min-height: 72px;
  --sp-vibe-icon-size: 32px;
  --sp-vibe-glyph-size: 24px;
  --sp-vibe-font-size: 12px;
  --sp-vibe-font-weight: 800;
  --sp-vibe-letter-spacing: 0.1px;
  --sp-vibe-line-height: 15px;
  --sp-brand-gradient: linear-gradient(120deg, var(--sp-color-blue) 0%, var(--sp-color-blue-bright) 48%, var(--sp-color-violet) 100%);
  --sp-surface-light: #f5f8fd;
  --sp-surface-light-raised: #ffffff;
  --sp-surface-dark: #050b14;
  --sp-surface-dark-deep: #020b19;
  --sp-surface-dark-raised: #08172b;
  --sp-text-light-primary: #0b285b;
  --sp-text-light-secondary: #52698f;
  --sp-text-dark-primary: #f5f8ff;
  --sp-text-dark-secondary: #9fb4d2;
  --sp-text-on-brand: #ffffff;
  --sp-success: #24d58b;
  --sp-danger: #ff4169;
  --sp-warning: #ffb81f;
  --sp-glass-light: rgba(255, 255, 255, 0.82);
  --sp-glass-dark: rgba(4, 15, 32, 0.92);
  --sp-glass-dark-strong: rgba(2, 11, 25, 0.97);
  --sp-glass-border-light: rgba(255, 255, 255, 0.82);
  --sp-glass-border-dark: rgba(145, 190, 255, 0.28);
  --sp-glass-blur: 18px;
  --sp-space-xs: 4px;
  --sp-space-sm: 8px;
  --sp-space-md: 12px;
  --sp-space-lg: 16px;
  --sp-space-xl: 24px;
  --sp-space-xxl: 32px;
  --sp-curve-control: 14px;
  --sp-curve-card: 24px;
  --sp-curve-panel: 30px;
  --sp-curve-pill: 999px;
  --sp-profile-shell-outer: #8b4dff;
  --sp-profile-shell-inner: #ffffff;
  --sp-profile-shell-radius: 18px;
  --sp-profile-shell-border: 4px;
  --sp-profile-shell-aspect: 0.78;
  --sp-profile-shell-gradient: linear-gradient(145deg, #a96cff 0%, #8755f8 50%, #7047e8 100%);
  --sp-profile-shell-shadow: 0 4px 12px rgba(92, 57, 190, 0.2);
  --sp-font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sp-font-regular: 400;
  --sp-font-medium: 600;
  --sp-font-bold: 800;
  --sp-font-black: 900;

  /* Semantic theme contract. Components should consume these aliases instead
     of selecting a light or dark palette directly. */
  --sp-theme-canvas: var(--sp-surface-light);
  --sp-theme-surface: var(--sp-surface-light-raised);
  --sp-theme-surface-soft: #f4f8fd;
  --sp-theme-surface-inset: #f8fbff;
  --sp-theme-surface-accent: #f7f3ff;
  --sp-theme-text: var(--sp-text-light-primary);
  --sp-theme-text-muted: var(--sp-text-light-secondary);
  --sp-theme-border: rgba(58, 96, 153, 0.24);
  --sp-theme-border-strong: #b9cbe2;
  --sp-theme-accent: #7442df;
  --sp-theme-accent-border: #8556ed;
  --sp-theme-accent-soft: #eee8ff;
  --sp-theme-brand-canvas:
    radial-gradient(circle at 18% 0%, rgba(33, 103, 245, 0.11), transparent 36%),
    radial-gradient(circle at 86% 8%, rgba(155, 108, 255, 0.13), transparent 34%),
    var(--sp-theme-canvas);
  --sp-theme-brand-surface:
    linear-gradient(135deg, rgba(33, 103, 245, 0.045), rgba(155, 108, 255, 0.075)),
    var(--sp-theme-surface);
  --sp-theme-brand-border: rgba(116, 66, 223, 0.34);
  --sp-theme-brand-shadow: 0 14px 34px rgba(70, 64, 174, 0.12);
  --sp-theme-danger-text: #b92545;
  --sp-theme-danger-border: rgba(205, 47, 79, 0.42);
  --sp-theme-danger-surface: #fff0f3;
  --sp-theme-shadow: 0 12px 30px rgba(44, 76, 124, 0.08);
  --sp-theme-overlay: rgba(20, 43, 78, 0.42);
  color-scheme: light;
}

html[data-theme="dark"] {
  --sp-theme-canvas: var(--sp-surface-dark-deep);
  --sp-theme-surface: var(--sp-surface-dark-raised);
  --sp-theme-surface-soft: #0a1d36;
  --sp-theme-surface-inset: #050f1e;
  --sp-theme-surface-accent: #11162a;
  --sp-theme-text: var(--sp-text-dark-primary);
  --sp-theme-text-muted: var(--sp-text-dark-secondary);
  --sp-theme-border: rgba(145, 190, 255, 0.24);
  --sp-theme-border-strong: #33567f;
  --sp-theme-accent: var(--sp-color-violet);
  --sp-theme-accent-border: var(--sp-color-violet);
  --sp-theme-accent-soft: #17234a;
  --sp-theme-brand-canvas:
    radial-gradient(circle at 18% 0%, rgba(33, 103, 245, 0.18), transparent 38%),
    radial-gradient(circle at 86% 8%, rgba(155, 108, 255, 0.19), transparent 36%),
    var(--sp-theme-canvas);
  --sp-theme-brand-surface:
    linear-gradient(135deg, rgba(33, 103, 245, 0.11), rgba(155, 108, 255, 0.13)),
    var(--sp-theme-surface);
  --sp-theme-brand-border: rgba(173, 143, 255, 0.48);
  --sp-theme-brand-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
  --sp-theme-danger-text: #ff9caf;
  --sp-theme-danger-border: rgba(255, 92, 122, 0.62);
  --sp-theme-danger-surface: #190d1a;
  --sp-theme-shadow: none;
  --sp-theme-overlay: rgba(1, 7, 17, 0.78);
  color-scheme: dark;
}

html[data-visual-regression="true"] *,
html[data-visual-regression="true"] *::before,
html[data-visual-regression="true"] *::after {
  animation: none !important;
  caret-color: transparent !important;
  scroll-behavior: auto !important;
  transition: none !important;
}

/* Dark mode: the accent word of every page heading ("home!", "vibe!", "now!", "timeline!") is violet, as in the app. */
html[data-theme="dark"] body.is-logged-in .page-heading-title span { color: var(--sp-color-violet) !important; }

/* The selected tab is violet, as in the app (#7836ef light, #9b6cff dark); the others keep their colour. */
html:root body.is-logged-in .mobile-bottom-nav .mobile-tab.active,
html:root body.is-logged-in .mobile-bottom-nav .mobile-tab.active svg { color: #7836ef !important; }
html:root[data-theme="dark"] body.is-logged-in .mobile-bottom-nav .mobile-tab.active,
html:root[data-theme="dark"] body.is-logged-in .mobile-bottom-nav .mobile-tab.active svg { color: #9b6cff !important; }
