:root {
  color-scheme: light;
  --color-tree-wire: #b6c6dc;
  --color-tree-active: #416bed;
  --color-composer: #ffffff;
  --color-chat-canvas: #eef2f6;
  --color-ai-idle-surface: #dce1e7;
  --color-ai-idle-border: #c5ccd5;
  --shadow-ai-input: 0 4px 16px rgba(25, 43, 69, 0.1);
  --color-unread-marker: #b9232c;
  --color-date-rule: #c3cfe1;
  --chat-divider-width: 1px;

  --color-selected: #e8efff;
  --color-selected-text: #173dc4;
  --color-selected-meta: #536b9e;
  --color-personal: #edf3ff;
  --color-personal-line: #315efb;
  --ease-workspace: cubic-bezier(.22, 1, .36, 1);

  /* Canvas and surfaces */
  --color-canvas: #f2f5fb;
  --color-canvas-highlight: #f7f9fc;
  --color-surface: #ffffff;
  --color-surface-raised: #ffffff;
  --color-surface-subtle: #f7f9fc;
  --color-surface-muted: #f0f4fa;
  --color-surface-hover: #edf2fa;
  --color-surface-active: #e8efff;
  --color-surface-translucent: rgba(255, 255, 255, 0.82);
  --color-backdrop: rgba(18, 20, 31, 0.42);

  /* Typography and neutral borders */
  --color-text: #111f38;
  --color-text-muted: #52617a;
  --color-text-subtle: #697a94;
  --color-text-disabled: #a7acb8;
  --color-border: #e3e9f3;
  --color-border-strong: #c3cfe1;
  --color-neutral-dot: #bec3ce;
  --color-on-accent: #ffffff;
  --color-on-warning: #402d05;

  /* Primary accent */
  --color-accent: #315efb;
  --color-accent-hover: #234ad9;
  --color-accent-strong: #2149b8;
  --color-accent-soft: #edf3ff;
  --color-accent-soft-hover: #e0eaff;
  --color-accent-border: #bccdff;
  --color-focus-border: #315efb;
  --color-focus-ring: #315efb30;
  --color-accent-glow: transparent;

  /* Semantic states */
  --color-info: #3d6fe8;
  --color-info-text: #3157ac;
  --color-info-soft: #eaf0ff;
  --color-info-border: #cbd8fa;
  --color-success: #1f9563;
  --color-success-text: #176743;
  --color-success-soft: #e4f5ed;
  --color-success-border: #b9dfcb;
  --color-warning: #dfa027;
  --color-warning-text: #79520d;
  --color-warning-soft: #fff3d9;
  --color-warning-border: #ebd19b;
  --color-danger: #d84e52;
  --color-danger-text: #94373a;
  --color-danger-soft: #ffebec;
  --color-danger-border: #efc2c4;
  --color-notification-current-bg: #c62828;
  --color-notification-current-text: #ffffff;
  --color-notification-current-border: #a71919;
  --color-notification-descendant-bg: #edc763;
  --color-notification-descendant-text: #42310b;
  --color-notification-descendant-border: #d4ae4d;

  /* Sidebar */
  --color-sidebar: #111c33;
  --color-sidebar-raised: #203456;
  --color-sidebar-hover: rgba(255, 255, 255, 0.08);
  --color-sidebar-active: #203456;
  --color-sidebar-border: rgba(255, 255, 255, 0.1);
  --color-sidebar-text: #f0f4ff;
  --color-sidebar-text-active: #ffffff;
  --color-sidebar-text-muted: #afbdd4;
  --color-sidebar-glow: transparent;
  --color-brand: #7195ff;
  --color-brand-text: #ffffff;
  --color-online: #36c77b;
  --color-online-glow: rgba(54, 199, 123, 0.24);

  /* Weather location cards */
  --weather-card-text: #f6fff9;
  --weather-card-border: rgba(36, 123, 83, 0.34);
  --weather-scene-day: linear-gradient(145deg, #43a37c, #286e52 64%, #225e46);
  --weather-scene-dawn: linear-gradient(145deg, #9a796c, #527b68 58%, #2b624c);
  --weather-scene-dusk: linear-gradient(145deg, #8f695f, #4d705f 58%, #285541);
  --weather-scene-night: linear-gradient(145deg, #24394d, #1b3b3b 62%, #17362d);
  --weather-glow-day: rgba(255, 220, 125, 0.34);
  --weather-glow-night: rgba(128, 163, 220, 0.16);
  --weather-text-muted: rgba(246, 255, 249, 0.74);
  --weather-icon: #eef8f3;
  --weather-icon-shadow: rgba(7, 34, 22, 0.18);
  --weather-sun: #ffd24d;
  --weather-sun-path: rgba(255, 255, 255, 0.38);
  --weather-sun-border: rgba(255, 255, 255, 0.9);
  --weather-sun-marker: #ffd659;
  --weather-sun-shadow: rgba(255, 215, 89, 0.8);
  --weather-horizon: rgba(12, 70, 43, 0.58);
  --weather-forecast: rgba(19, 78, 54, 0.92);
  --weather-forecast-icon: #e8f5ef;
  --weather-forecast-muted: rgba(255, 255, 255, 0.68);
  --weather-temperature-rail: rgba(235, 250, 242, 0.18);
  --weather-temperature-range: linear-gradient(90deg, #70d4bc, #dce477 60%, #ffae62);
  --weather-footer: rgba(11, 57, 39, 0.98);
  --weather-divider: rgba(255, 255, 255, 0.1);
  --weather-remove-border: rgba(255, 255, 255, 0.28);
  --weather-remove-border-hover: rgba(255, 255, 255, 0.56);
  --weather-remove: rgba(8, 34, 23, 0.42);
  --weather-remove-hover: rgba(167, 49, 49, 0.76);

  /* Effects */
  --color-login-glow: transparent;
  --color-shimmer-base: #eef0f5;
  --color-shimmer-highlight: #fafbfe;
  --shadow-xs: 0 1px 2px rgba(23, 25, 35, 0.05);
  --shadow-sm: 0 8px 24px rgba(29, 31, 45, 0.08);
  --shadow-lg: 0 16px 48px rgba(29, 31, 45, 0.12);
  --shadow-dialog: 0 24px 72px rgba(20, 22, 33, 0.22);
}

/* Kontur is the single light palette. Dark and semantic status colors stay stable. */
:root[data-theme="light"] {
  --color-chat-canvas: #e9edf2;
  --color-canvas: #e3e7ec;
  --color-canvas-highlight: #f3f5f7;
  --color-surface-subtle: #f8f9fa;
  --color-surface-muted: #e9edf1;
  --color-border: #bac5d2;
  --color-border-strong: #94a3b6;
  --color-card-header: #ffffff;
  --shadow-card: 0 1px 3px rgba(25, 43, 69, .06);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --color-tree-wire: #607792;
  --color-tree-active: #a6c1ff;
  --color-composer: #414f64;
  --color-ai-idle-surface: #202a38;
  --color-ai-idle-border: #344154;
  --shadow-ai-input: 0 4px 16px rgba(0, 0, 0, 0.24);
  --color-unread-marker: #ff999d;
  --color-date-rule: #92a5bf;
  --chat-divider-width: 2px;
  --color-selected: #435d8e;
  --color-selected-text: #ffffff;
  --color-selected-meta: #e0e9ff;
  --color-personal: #3c5072;
  --color-personal-line: #a6beff;

  --color-canvas: #1a2331;
  --color-canvas-highlight: #263244;
  --color-surface: #333f51;
  --color-surface-raised: #414f64;
  --color-surface-subtle: #263244;
  --color-surface-muted: #3c4b60;
  --color-surface-hover: #3c4b60;
  --color-surface-active: #435d8e;
  --color-surface-translucent: rgba(30, 34, 45, 0.88);
  --color-backdrop: rgba(4, 5, 9, 0.7);

  --color-text: #f3f6fb;
  --color-text-muted: #d1dbea;
  --color-text-subtle: #b8c6d9;
  --color-text-disabled: #626877;
  --color-border: #4e5f76;
  --color-border-strong: #73849e;
  --color-neutral-dot: #59606f;
  --color-on-accent: #14254b;
  --color-on-warning: #2e2107;

  --color-accent: #a6beff;
  --color-accent-hover: #c5d5ff;
  --color-accent-strong: #dce7ff;
  --color-accent-soft: #405678;
  --color-accent-soft-hover: #486183;
  --color-accent-border: #738fb8;
  --color-focus-border: #a6beff;
  --color-focus-ring: #a6beff38;
  --color-accent-glow: transparent;

  --color-info: #6f99ff;
  --color-info-text: #a9c1ff;
  --color-info-soft: #202b45;
  --color-info-border: #34466d;
  --color-success: #45c98d;
  --color-success-text: #8ce0b8;
  --color-success-soft: #1c352b;
  --color-success-border: #2d5846;
  --color-warning: #f1bb4e;
  --color-warning-text: #f0cf8b;
  --color-warning-soft: #3b301c;
  --color-warning-border: #665126;
  --color-danger: #ef7377;
  --color-danger-text: #f2a7aa;
  --color-danger-soft: #402529;
  --color-danger-border: #6b383c;
  --color-notification-current-bg: #d32f2f;
  --color-notification-current-text: #ffffff;
  --color-notification-current-border: #ff6b6b;

  --color-sidebar: #111b2b;
  --color-sidebar-raised: #263244;
  --color-sidebar-hover: rgba(255, 255, 255, 0.07);
  --color-sidebar-active: #2c4163;
  --color-sidebar-border: rgba(255, 255, 255, 0.08);
  --color-sidebar-text: #f0f4ff;
  --color-sidebar-text-active: #ffffff;
  --color-sidebar-text-muted: #b2c0d4;
  --color-sidebar-glow: transparent;
  --color-brand: #91afff;
  --color-brand-text: #ffffff;
  --color-online: #45c98d;
  --color-online-glow: rgba(69, 201, 141, 0.26);

  --weather-card-text: #f6fff9;
  --weather-card-border: rgba(104, 203, 151, 0.28);
  --weather-scene-day: linear-gradient(145deg, #398c6b, #245e48 64%, #1c4c39);
  --weather-scene-dawn: linear-gradient(145deg, #765e59, #416354 58%, #244f3d);
  --weather-scene-dusk: linear-gradient(145deg, #73544f, #3f5c50 58%, #214536);
  --weather-scene-night: linear-gradient(145deg, #1e3042, #173232 62%, #122d25);
  --weather-glow-day: rgba(255, 220, 125, 0.3);
  --weather-glow-night: rgba(128, 163, 220, 0.14);
  --weather-text-muted: rgba(246, 255, 249, 0.72);
  --weather-icon: #eef8f3;
  --weather-icon-shadow: rgba(3, 20, 13, 0.28);
  --weather-sun: #ffd24d;
  --weather-sun-path: rgba(255, 255, 255, 0.34);
  --weather-sun-border: rgba(255, 255, 255, 0.86);
  --weather-sun-marker: #ffd659;
  --weather-sun-shadow: rgba(255, 215, 89, 0.72);
  --weather-horizon: rgba(8, 54, 34, 0.64);
  --weather-forecast: rgba(14, 64, 44, 0.95);
  --weather-forecast-icon: #e8f5ef;
  --weather-forecast-muted: rgba(255, 255, 255, 0.66);
  --weather-temperature-rail: rgba(235, 250, 242, 0.16);
  --weather-temperature-range: linear-gradient(90deg, #70d4bc, #dce477 60%, #ffae62);
  --weather-footer: rgba(8, 45, 31, 0.99);
  --weather-divider: rgba(255, 255, 255, 0.09);
  --weather-remove-border: rgba(255, 255, 255, 0.26);
  --weather-remove-border-hover: rgba(255, 255, 255, 0.52);
  --weather-remove: rgba(5, 25, 17, 0.5);
  --weather-remove-hover: rgba(167, 49, 49, 0.78);

  --color-login-glow: transparent;
  --color-shimmer-base: #222631;
  --color-shimmer-highlight: #303542;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.22);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.32);
  --shadow-dialog: 0 24px 72px rgba(0, 0, 0, 0.52);
}
