:root {
  /* Layout */
  --topbar-height: 52px;
  --chatbar-height: 68px;
  --chat-panel-width: 340px;
  --moment-panel-width: 380px;
  --moment-panel-min: 280px;
  --moment-panel-max: 600px;

  /* Lebensrad Design Tokens — Hermes darf nur diese kontrollierten Tokens setzen. */
  --lr-font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --lr-font-size-base: 16px;
  --lr-font-scale: 1;

  --lr-radius-xs: 0.35rem;
  --lr-radius-sm: 0.55rem;
  --lr-radius-md: 0.75rem;
  --lr-radius-lg: 1rem;
  --lr-radius-xl: 1.25rem;
  --lr-radius-2xl: 1.5rem;
  --lr-button-radius: 0.75rem;
  --lr-button-height-sm: 2rem;
  --lr-button-height-md: 2.5rem;
  --lr-button-height-lg: 3rem;
  --lr-button-padding-x: 0.9rem;

  --lr-color-bg: #0f172a;
  --lr-color-bg-soft: rgba(15, 23, 42, 0.85);
  --lr-color-surface: rgba(15, 23, 42, 0.58);
  --lr-color-surface-strong: rgba(30, 41, 59, 0.78);
  --lr-color-surface-muted: rgba(30, 41, 59, 0.5);
  --lr-color-input: rgba(30, 41, 59, 0.75);
  --lr-color-border: rgba(71, 85, 105, 0.15);
  --lr-color-border-strong: rgba(71, 85, 105, 0.25);
  --lr-color-text: #e2e8f0;
  --lr-color-text-soft: #94a3b8;
  --lr-color-text-muted: #64748b;
  --lr-color-primary: #6366f1;
  --lr-color-secondary: #8b5cf6;
  --lr-color-accent: #06b6d4;
  --lr-color-success: #22c55e;
  --lr-color-warning: #eab308;
  --lr-color-danger: #ef4444;
  --lr-gradient-accent: linear-gradient(135deg, #6366f1, #8b5cf6);

  --lr-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3);
  --lr-shadow-floating: 0 24px 60px rgba(0, 0, 0, 0.35);
  --lr-blur-surface: blur(16px);
  --lr-blur-bar: blur(20px);
  --lr-backdrop-opacity: 0.78;

  --lr-motion-fast: 150ms ease;
  --lr-motion-normal: 220ms ease;
  --lr-motion-slow: 360ms ease;
  --lr-density-card-padding: 1rem;
  --lr-density-panel-gap: 0.75rem;
  --lr-effect-button: 0 8px 20px rgba(99, 102, 241, 0.16);
  --lr-effect-card: 0 14px 40px rgba(15, 23, 42, 0.24);

  /* Legacy aliases — bestehende Komponenten bleiben kompatibel. */
  --bg-primary: var(--lr-color-bg);
  --bg-secondary: var(--lr-color-bg-soft);
  --bg-panel: var(--lr-color-surface);
  --bg-input: var(--lr-color-input);
  --border-subtle: var(--lr-color-border);
  --border-input: var(--lr-color-border-strong);
  --border-accent: color-mix(in srgb, var(--lr-color-primary) 35%, transparent);

  --text-primary: var(--lr-color-text);
  --text-secondary: var(--lr-color-text-soft);
  --text-muted: var(--lr-color-text-muted);
  --text-dimmed: color-mix(in srgb, var(--lr-color-text-muted) 72%, transparent);

  --accent-primary: var(--lr-color-primary);
  --accent-secondary: var(--lr-color-secondary);
  --accent-gradient: var(--lr-gradient-accent);

  --bg-hover: color-mix(in srgb, var(--lr-color-surface-strong) 68%, transparent);
  --bg-card: var(--lr-color-surface-muted);
  --shadow-card: var(--lr-shadow-card);
  --blur-panel: var(--lr-blur-surface);
  --blur-bar: var(--lr-blur-bar);
  --transition-panel: width var(--lr-motion-slow), opacity var(--lr-motion-slow);
  --transition-fast: all var(--lr-motion-fast);
  --transition-normal: all var(--lr-motion-normal);
}

:root.light {
  --lr-color-bg: #faf8f5;
  --lr-color-bg-soft: rgba(245, 240, 235, 0.85);
  --lr-color-surface: rgba(255, 252, 248, 0.88);
  --lr-color-surface-strong: rgba(255, 255, 255, 0.96);
  --lr-color-surface-muted: rgba(255, 255, 255, 0.72);
  --lr-color-input: rgba(235, 228, 218, 0.75);
  --lr-color-border: rgba(15, 23, 42, 0.08);
  --lr-color-border-strong: rgba(15, 23, 42, 0.12);
  --lr-color-text: #1e293b;
  --lr-color-text-soft: #475569;
  --lr-color-text-muted: #64748b;
  --lr-shadow-card: 0 1px 3px rgba(15, 23, 42, 0.1);
  --lr-shadow-floating: 0 24px 60px rgba(15, 23, 42, 0.16);
  --lr-blur-surface: blur(12px);
  --lr-blur-bar: blur(16px);
}

:root[data-lr-material="solid"] {
  --lr-color-surface: rgba(15, 23, 42, 0.96);
  --lr-color-surface-muted: rgba(30, 41, 59, 0.96);
  --lr-blur-surface: blur(0);
  --lr-blur-bar: blur(0);
}

:root.light[data-lr-material="solid"] {
  --lr-color-surface: rgba(255, 255, 255, 0.98);
  --lr-color-surface-muted: rgba(255, 255, 255, 0.94);
}

:root[data-lr-material="flat"] {
  --lr-shadow-card: none;
  --lr-shadow-floating: 0 10px 28px rgba(15, 23, 42, 0.16);
  --lr-blur-surface: blur(0);
  --lr-blur-bar: blur(0);
}

:root[data-lr-material="glow"] {
  --lr-effect-button: 0 0 22px color-mix(in srgb, var(--lr-color-primary) 42%, transparent);
  --lr-effect-card: 0 0 46px color-mix(in srgb, var(--lr-color-secondary) 20%, transparent);
}

:root[data-lr-material="paper"] {
  --lr-radius-lg: 0.85rem;
  --lr-shadow-card: 0 8px 30px rgba(120, 53, 15, 0.12);
}

:root[data-lr-motion="reduced"] {
  --lr-motion-fast: 0ms;
  --lr-motion-normal: 80ms ease;
  --lr-motion-slow: 120ms ease;
}

:root[data-lr-motion="off"] {
  --lr-motion-fast: 0ms;
  --lr-motion-normal: 0ms;
  --lr-motion-slow: 0ms;
}

:root[data-lr-density="compact"] {
  --lr-density-card-padding: 0.7rem;
  --lr-density-panel-gap: 0.45rem;
  --lr-button-height-md: 2.2rem;
}

:root[data-lr-density="generous"] {
  --lr-density-card-padding: 1.25rem;
  --lr-density-panel-gap: 1rem;
  --lr-button-height-md: 2.85rem;
}

:root[data-lr-font="serif"] {
  --lr-font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}

:root[data-lr-font="rounded"] {
  --lr-font-family: ui-rounded, "SF Pro Rounded", "Nunito", Inter, ui-sans-serif, system-ui, sans-serif;
}

:root[data-lr-font="mono"] {
  --lr-font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

html,
body,
#root {
  font-family: var(--lr-font-family);
  font-size: calc(var(--lr-font-size-base) * var(--lr-font-scale));
}

button,
input,
textarea,
select {
  font-family: inherit;
}
