/* Тёмная тема использует исходные значения fallback. Focus всегда включает её
   целиком, поэтому его страницы, модалы, анимации и цвета не меняются. */
html[data-theme="light"] {
  --theme-page: #f5f6f8;
  --theme-surface: #ffffff;
  --theme-raised: #e9edf2;
  --theme-panel-rgb: 255, 255, 255;
  --theme-surface-rgb: 35, 48, 68;
  --theme-ink-rgb: 25, 34, 48;
  --theme-line-rgb: 56, 71, 92;
  --theme-text: #192230;
  --theme-muted: #626d7c;
  --theme-muted-opacity: .7;
  --theme-border: #d5dce5;
  --theme-gold: #826100;
  --theme-blue: #245fac;
  --theme-cyan: #08768a;
  --theme-green: #16734d;
  --theme-pink: #b33564;
  --theme-red: #b53840;
  --theme-purple: #7542a8;
  color-scheme: only light;
}

html[data-theme="dark"] { color-scheme: dark; }
html[data-theme] body { color: var(--theme-text, #fff); }
html[data-theme="light"], html[data-theme="light"] body {
  background: var(--theme-page);
  color: var(--theme-text);
}
html[data-theme="light"] :is(input, textarea, select) { color-scheme: only light !important; }
html[data-theme="light"] option { color: #192230; background: #fff; }
html[data-theme="light"] ::selection { color: #163764; background: #c9e4ff; }

.theme-setting { gap: 12px; cursor: pointer; }
.theme-setting .item-content { flex: 1; min-width: 0; }
.settings-select-control { position: relative; flex: 0 0 144px; max-width: 46%; }
.settings-page .settings-select-chevron { position: absolute; right: 12px; top: 50%; transform: translateY(-50%) rotate(90deg); pointer-events: none; }
.theme-select {
  width: 100%;
  max-width: none;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  height: 36px;
  min-height: 36px;
  padding: 8px 40px 8px 14px;
  line-height: 20px;
  border: 0;
  border-radius: 14px;
  background: rgba(var(--theme-surface-rgb, 255, 255, 255), .06);
  color: var(--theme-text, #fff);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.theme-select:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }

html[data-theme="light"] .stars-background { opacity: .3; }
html[data-theme="light"] .stars-background svg path { fill: #73859c; }
html[data-theme="light"] :is(.loading-logo, .chat-intro-logo) { filter: brightness(0) saturate(100%); opacity: .85; }
html[data-theme="light"] :is(.modal-ui, .settings-shell) {
  --sheet-content-shadow: inset 0 .5px .5px rgba(33,48,68,.15);
}

/* Монохромные SVG следуют цвету текста, цветные иллюстрации и маски сохраняются. */
html[data-theme="light"] svg :is([stroke="white"], [stroke="#fff"], [stroke="#ffffff"], [stroke="#FFFFFF"]):not(defs *, mask *) { stroke: currentColor; }
html[data-theme="light"] svg :is([fill="white"], [fill="#fff"], [fill="#ffffff"], [fill="#FFFFFF"]):not(defs *, mask *) { fill: currentColor; }
html[data-theme="light"] svg [stroke^="rgba(255"]:not(defs *, mask *) { stroke: var(--theme-muted); }
html[data-theme="light"] .settings-shell .settings-unified-controls {
  --settings-control-bg: rgba(35, 48, 68, .06);
  --settings-control-shadow: inset 0 .5px .5px rgba(33, 48, 68, .15);
}
