:root,
:host {
  color-scheme: light;

  /* Canonical color tokens are RGB channels so Tailwind alpha utilities can consume them. */
  --color-brand: 139 41 66;
  --color-brand-hover: 116 33 55;
  --color-brand-active: 96 27 45;
  --color-brand-tint: 248 235 235;
  --color-brand-soft: 229 185 184;
  --color-brand-border: 184 131 142;
  --color-on-brand: 255 240 236;
  --color-canvas: 242 233 227;
  --color-surface: 248 239 234;
  --color-surface-muted: 229 214 210;
  --color-text: 53 30 37;
  --color-text-muted: 112 84 92;
  --color-border: 180 155 159;
  --color-border-strong: 53 30 37;
  --color-grid: 139 41 66;
  --color-overlay: 48 24 32;
  --color-shadow: 53 30 37;
  --color-shadow-soft: 186 150 158;
  --color-focus: 139 41 66;
  --color-selection: 229 185 184;
  --color-selection-text: 53 30 37;
  --color-terminal-bg: 48 24 32;
  --color-terminal-text: 246 233 231;
  --color-terminal-accent: 229 185 184;
  --color-terminal-muted: 231 203 208;
  --color-terminal-border: 184 131 142;
  --color-tape: 186 123 130;
  --color-tape-edge: 156 89 103;
  --color-disabled-bg: 229 214 210;
  --color-disabled-text: 112 84 92;
  --color-success: 40 96 68;
  --color-success-surface: 226 238 230;
  --color-success-border: 139 174 151;
  --color-warning: 121 81 0;
  --color-warning-surface: 245 236 215;
  --color-warning-border: 188 151 81;
  --color-error: 156 35 53;
  --color-error-surface: 246 225 225;
  --color-error-border: 193 117 128;
  --color-info: 49 90 120;
  --color-info-surface: 223 234 241;
  --color-info-border: 122 157 178;
  --color-status-surface: var(--color-surface);
  --color-chart-primary: var(--color-brand);
  --color-chart-secondary: var(--color-text-muted);
  --color-chart-tertiary: var(--color-info);
  --color-chart-quaternary: var(--color-success);

  --font-display: "Geist", Arial, Helvetica, sans-serif;
  --font-body: "Inter", Arial, sans-serif;
  --font-editorial: Georgia, "Times New Roman", serif;
  --font-mono: "Courier New", ui-monospace, monospace;

  --type-h1: clamp(3.625rem, 8vw, 5.75rem);
  --type-h2: clamp(2.125rem, 4vw, 2.875rem);
  --type-h3: 1.5rem;
  --type-body-lg: 1.125rem;
  --type-body: 1rem;
  --type-body-sm: 0.875rem;
  --type-caption: 0.75rem;

  --space-section: clamp(3rem, 6vw, 4.5rem);
  --space-card: 1.5rem;
  --space-control: 0.75rem;
  --space-tight: 0.25rem;
  --border-width: 1px;

  --radius-control: 2px;
  --radius-card: 3px;
  --radius-dialog: 4px;
  --radius-full: 9999px;

  --shadow-control: 0 1px 0 rgb(var(--color-shadow) / 0.12);
  --shadow-card: 3px 3px 0 rgb(var(--color-shadow-soft) / 0.9);
  --shadow-offset: 5px 5px 0 rgb(var(--color-shadow));
  --shadow-overlay: 0 16px 36px rgb(var(--color-shadow) / 0.18);
  --shadow-focus: 0 0 0 3px rgb(var(--color-focus) / 0.28);

  /* Existing component tokens remain adapters to the canonical palette. */
  --rm-trip-brand: rgb(var(--color-brand));
  --rm-trip-brand-dark: rgb(var(--color-brand-hover));
  --rm-trip-brand-light: rgb(var(--color-brand-tint));
  --rm-trip-highlight: rgb(var(--color-focus));
  --rm-trip-highlight-dark: rgb(var(--color-brand-active));
  --rm-trip-highlight-light: rgb(var(--color-brand-soft));
  --rm-trip-state-success: rgb(var(--color-success));
  --rm-trip-state-warning: rgb(var(--color-warning));
  --rm-trip-state-error: rgb(var(--color-error));
  --rm-trip-surface: rgb(var(--color-canvas));
  --rm-trip-surface-muted: rgb(var(--color-surface-muted));
  --rm-trip-surface-card: rgb(var(--color-surface));
  --rm-trip-text: rgb(var(--color-text));
  --rm-trip-text-muted: rgb(var(--color-text-muted));
  --rm-trip-font-heading: var(--font-display);
  --rm-trip-font-body: var(--font-body);
  --rm-trip-h1: var(--type-h1);
  --rm-trip-h2: var(--type-h2);
  --rm-trip-h3: var(--type-h3);
  --rm-trip-body-lg: var(--type-body-lg);
  --rm-trip-body: var(--type-body);
  --rm-trip-body-sm: var(--type-body-sm);
  --rm-trip-caption: var(--type-caption);
  --rm-trip-section: var(--space-section);
  --rm-trip-card: var(--space-card);
  --rm-trip-btn: var(--space-control);
  --rm-trip-tight: var(--space-tight);
  --rm-trip-smooth: var(--radius-control);
  --rm-trip-pill: var(--radius-full);
  --rm-trip-card-shadow: var(--shadow-card);
  --rm-trip-lift-shadow: var(--shadow-overlay);
  --rm-trip-glow-shadow: var(--shadow-card);
}
