/* Minimal palettes. Stable IDs preserve saved preferences. */
:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --sidebar-bg: #000000;
  --panel: #000000;
  --panel-2: #000000;
  --panel-3: #000000;
  --panel-hover: #000000;
  --line: #222222;
  --line-strong: #333333;
  --text: #ededed;
  --text-soft: #ededed;
  --muted: #b5b5b5;
  --muted-2: #8a8a8a;
  --accent: #f1f1f1;
  --accent-strong: #ffffff;
  --accent-ink: #000000;
  --accent-soft: rgba(241, 241, 241, 0.08);
  --accent-line: rgba(241, 241, 241, 0.28);
  --cool: #a6c9ff;
  --cool-soft: #a6c9ff12;
  --positive: #8dd4a2;
  --warning: #e7c777;
  --danger: #ff9aa5;
  --code-bg: #1a1a1c;
  --code-header: #242426;
  --user-bubble: #441865;
  --glass: #000000;
  --shadow-lg: 0 18px 60px #000000aa;
  --shadow-md: 0 4px 18px #00000066;
  --grain-opacity: 0;
  --font-ui: "Instrument Sans", system-ui, sans-serif;
  --font-display: "Instrument Sans", system-ui, sans-serif;
}

html[data-theme="dark-graphite"] {
  color-scheme: dark;
  --bg: #202123;
  --sidebar-bg: #171819;
  --panel: #2b2c2f;
  --panel-2: #2b2c2f;
  --panel-3: color-mix(in srgb, #2b2c2f 85%, #f0f0f0);
  --panel-hover: color-mix(in srgb, #2b2c2f 90%, #f0f0f0);
  --line: color-mix(in srgb, #202123 86%, #f0f0f0);
  --line-strong: color-mix(in srgb, #202123 70%, #f0f0f0);
  --text: #f0f0f0;
  --text-soft: #f0f0f0;
  --muted: #b4b6bc;
  --muted-2: #b4b6bc;
  --accent: #c4d0e4;
  --accent-strong: #c4d0e4;
  --accent-ink: #202123;
  --accent-soft: color-mix(in srgb, #c4d0e4 9%, transparent);
  --accent-line: color-mix(in srgb, #c4d0e4 30%, transparent);
  --cool: #a6c9ff;
  --cool-soft: #a6c9ff12;
  --positive: #8dd4a2;
  --warning: #e7c777;
  --danger: #ff9aa5;
  --code-bg: #171819;
  --code-header: #2b2c2f;
  --user-bubble: #2b2c2f;
  --glass: #202123;
  --shadow-lg: 0 18px 60px #00000055;
  --shadow-md: 0 4px 18px #00000012;
  --grain-opacity: 0;
  --font-ui: "Segoe UI", system-ui, sans-serif;
  --font-display: "Segoe UI", system-ui, sans-serif;
}

html[data-theme="dark-ash"] {
  color-scheme: dark;
  --bg: #211925;
  --sidebar-bg: #19131c;
  --panel: #302436;
  --panel-2: #302436;
  --panel-3: color-mix(in srgb, #302436 85%, #f6edf8);
  --panel-hover: color-mix(in srgb, #302436 90%, #f6edf8);
  --line: color-mix(in srgb, #211925 86%, #f6edf8);
  --line-strong: color-mix(in srgb, #211925 70%, #f6edf8);
  --text: #f6edf8;
  --text-soft: #f6edf8;
  --muted: #bfabc6;
  --muted-2: #bfabc6;
  --accent: #dbb3ec;
  --accent-strong: #dbb3ec;
  --accent-ink: #211925;
  --accent-soft: color-mix(in srgb, #dbb3ec 9%, transparent);
  --accent-line: color-mix(in srgb, #dbb3ec 30%, transparent);
  --cool: #a6c9ff;
  --cool-soft: #a6c9ff12;
  --positive: #8dd4a2;
  --warning: #e7c777;
  --danger: #ff9aa5;
  --code-bg: #19131c;
  --code-header: #302436;
  --user-bubble: #302436;
  --glass: #211925;
  --shadow-lg: 0 18px 60px #00000055;
  --shadow-md: 0 4px 18px #00000012;
  --grain-opacity: 0;
  --font-ui: "Trebuchet MS", sans-serif;
  --font-display: "Trebuchet MS", sans-serif;
}

html[data-theme="dim"] {
  color-scheme: dark;
  --bg: #171e32;
  --sidebar-bg: #11182a;
  --panel: #242e48;
  --panel-2: #242e48;
  --panel-3: color-mix(in srgb, #242e48 85%, #eff3ff);
  --panel-hover: color-mix(in srgb, #242e48 90%, #eff3ff);
  --line: color-mix(in srgb, #171e32 86%, #eff3ff);
  --line-strong: color-mix(in srgb, #171e32 70%, #eff3ff);
  --text: #eff3ff;
  --text-soft: #eff3ff;
  --muted: #acbbd8;
  --muted-2: #acbbd8;
  --accent: #a6c2ff;
  --accent-strong: #a6c2ff;
  --accent-ink: #171e32;
  --accent-soft: color-mix(in srgb, #a6c2ff 9%, transparent);
  --accent-line: color-mix(in srgb, #a6c2ff 30%, transparent);
  --cool: #a6c9ff;
  --cool-soft: #a6c9ff12;
  --positive: #8dd4a2;
  --warning: #e7c777;
  --danger: #ff9aa5;
  --code-bg: #11182a;
  --code-header: #242e48;
  --user-bubble: #242e48;
  --glass: #171e32;
  --shadow-lg: 0 18px 60px #00000055;
  --shadow-md: 0 4px 18px #00000012;
  --grain-opacity: 0;
  --font-ui: Verdana, sans-serif;
  --font-display: Verdana, sans-serif;
}

html[data-theme="dim-ocean"] {
  color-scheme: dark;
  --bg: #11251f;
  --sidebar-bg: #0c1c17;
  --panel: #1d362d;
  --panel-2: #1d362d;
  --panel-3: color-mix(in srgb, #1d362d 85%, #ebf6ed);
  --panel-hover: color-mix(in srgb, #1d362d 90%, #ebf6ed);
  --line: color-mix(in srgb, #11251f 86%, #ebf6ed);
  --line-strong: color-mix(in srgb, #11251f 70%, #ebf6ed);
  --text: #ebf6ed;
  --text-soft: #ebf6ed;
  --muted: #a7c2b3;
  --muted-2: #a7c2b3;
  --accent: #a8d5b2;
  --accent-strong: #a8d5b2;
  --accent-ink: #11251f;
  --accent-soft: color-mix(in srgb, #a8d5b2 9%, transparent);
  --accent-line: color-mix(in srgb, #a8d5b2 30%, transparent);
  --cool: #a6c9ff;
  --cool-soft: #a6c9ff12;
  --positive: #8dd4a2;
  --warning: #e7c777;
  --danger: #ff9aa5;
  --code-bg: #0c1c17;
  --code-header: #1d362d;
  --user-bubble: #1d362d;
  --glass: #11251f;
  --shadow-lg: 0 18px 60px #00000055;
  --shadow-md: 0 4px 18px #00000012;
  --grain-opacity: 0;
  --font-ui: Georgia, serif;
  --font-display: Georgia, serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --sidebar-bg: #f5f5f5;
  --panel: #f0f0f0;
  --panel-2: #f0f0f0;
  --panel-3: color-mix(in srgb, #f0f0f0 85%, #202020);
  --panel-hover: color-mix(in srgb, #f0f0f0 90%, #202020);
  --line: color-mix(in srgb, #ffffff 86%, #202020);
  --line-strong: color-mix(in srgb, #ffffff 70%, #202020);
  --text: #202020;
  --text-soft: #202020;
  --muted: #626262;
  --muted-2: #626262;
  --accent: #303030;
  --accent-strong: #303030;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, #303030 9%, transparent);
  --accent-line: color-mix(in srgb, #303030 30%, transparent);
  --cool: #2459a6;
  --cool-soft: #2459a60f;
  --positive: #287441;
  --warning: #825d0b;
  --danger: #ae2739;
  --code-bg: #f2f0ed;
  --code-header: #f0f0f0;
  --user-bubble: #f0f0f0;
  --glass: #ffffff;
  --shadow-lg: 0 18px 60px #00000018;
  --shadow-md: 0 4px 18px #00000012;
  --grain-opacity: 0;
  --font-ui: Arial, Helvetica, sans-serif;
  --font-display: Arial, Helvetica, sans-serif;
}

html[data-theme="light-sand"] {
  color-scheme: light;
  --bg: #faf5eb;
  --sidebar-bg: #eee6d7;
  --panel: #f0e7d8;
  --panel-2: #f0e7d8;
  --panel-3: color-mix(in srgb, #f0e7d8 85%, #322a20);
  --panel-hover: color-mix(in srgb, #f0e7d8 90%, #322a20);
  --line: color-mix(in srgb, #faf5eb 86%, #322a20);
  --line-strong: color-mix(in srgb, #faf5eb 70%, #322a20);
  --text: #322a20;
  --text-soft: #322a20;
  --muted: #74634d;
  --muted-2: #74634d;
  --accent: #78552b;
  --accent-strong: #78552b;
  --accent-ink: #faf5eb;
  --accent-soft: color-mix(in srgb, #78552b 9%, transparent);
  --accent-line: color-mix(in srgb, #78552b 30%, transparent);
  --cool: #2459a6;
  --cool-soft: #2459a60f;
  --positive: #287441;
  --warning: #825d0b;
  --danger: #ae2739;
  --code-bg: #f2f0ed;
  --code-header: #f0e7d8;
  --user-bubble: #f0e7d8;
  --glass: #faf5eb;
  --shadow-lg: 0 18px 60px #00000018;
  --shadow-md: 0 4px 18px #00000012;
  --grain-opacity: 0;
  --font-ui: Cambria, Georgia, serif;
  --font-display: Cambria, Georgia, serif;
}

/* Quiet conversation surface; keep the activity/thinking area in its existing position. */
.workspace::before, .empty-scope { display: none; }
.topbar { background: transparent; border-bottom-color: transparent; }
.message-content { font-size: 16px; line-height: 1.75; overflow-wrap: anywhere; }
.message-content pre { overflow-wrap: normal; }
.message-content h1, .message-content h2, .message-content h3 { font-family: var(--font-ui); letter-spacing: -.02em; }
.composer-card, .composer-card:focus-within { box-shadow: none; }
.composer-card::after { display: none; }
.empty-title { font-size: clamp(28px, 4vw, 42px); font-weight: 500; }
.empty-title em { font-style: normal; }
.message, .message-body, .settings-section, .settings-card { min-width: 0; }
.source-card { box-shadow: none; }
@media (max-width: 640px) {
  .message-content { font-size: 15px; line-height: 1.7; }
  .form-grid.two, .form-grid.four { grid-template-columns: minmax(0, 1fr); }
  .serpapi-engine-grid { gap: 12px; }
  input, select, textarea { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
