/* Единая тема Silver: тёмная (по умолчанию) + светлая (data-theme="light").
   Подключается во все отчёты <link rel="stylesheet" href="/theme.css">.
   Канонические токены повторяют имена, уже использовавшиеся в отчётах
   (--gold/--text/--text-dim/--bg/--bg2/--border/--green/--red), плюс расширения.
   Цвета внутри отчётов заменены на var(--token), поэтому переключение темы
   меняет только этот набор — включая inline-стили React и SVG-графики
   (var() резолвится и в presentation-атрибутах fill/stroke). */

:root {
  color-scheme: dark;
  --bg: #0f0e0b;
  --bg2: #1a1810;
  --bg3: #13110b;
  --text: #e8dfc8;
  --text-dim: #a0936a;
  --gold: #d4af37;
  --gold-dim: #a0936a;
  --gold-rgb: 212, 175, 55;
  --dim-rgb: 160, 147, 106;
  --green: #4ade80;
  --green-rgb: 74, 222, 128;
  --red: #f87171;
  --red-rgb: 248, 113, 113;
  --amber: #fbbf24;
  --amber-rgb: 251, 191, 36;
  --orange: #fb923c;
  --orange-rgb: 251, 146, 60;
  --blue: #60a5fa;
  --blue-rgb: 96, 165, 250;
  --purple: #c084fc;
  --purple-rgb: 192, 132, 252;
  --teal: #2dd4bf;
  --teal-rgb: 45, 212, 191;
  --line: #4a4535;
  --line2: #2a2518;
  --border: rgba(212, 175, 55, 0.2);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f1e8;
  --bg2: #ffffff;
  --bg3: #faf7ee;
  --text: #2b2620;
  --text-dim: #6f6346;
  --gold: #8a6d15;
  --gold-dim: #8a7d52;
  --gold-rgb: 138, 109, 21;
  --dim-rgb: 122, 111, 80;
  --green: #1e9e54;
  --green-rgb: 30, 158, 84;
  --red: #c0392b;
  --red-rgb: 192, 57, 43;
  --amber: #b8770b;
  --amber-rgb: 184, 119, 11;
  --orange: #c2410c;
  --orange-rgb: 194, 65, 12;
  --blue: #2563eb;
  --blue-rgb: 37, 99, 235;
  --purple: #7c3aed;
  --purple-rgb: 124, 58, 237;
  --teal: #0d9488;
  --teal-rgb: 13, 148, 136;
  --line: #ddd3bd;
  --line2: #e8e0cc;
  --border: rgba(138, 109, 21, 0.28);
}

/* Плавный переход цветов при смене темы (но не у графиков/transform). */
body, .card, table, th, td, button, input, select, a {
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

/* Контент не должен прятаться под плавающим переключателем темы (низ-право). */
body { padding-bottom: 72px; }

/* Плавающий переключатель темы (общий для всех отчётов). */
#silver-theme-toggle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 99999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-sizing: border-box;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 16px;
  font: 600 13px/1 Georgia, "Times New Roman", serif;
  color: var(--gold);
  background: var(--bg2);
  border: 1px solid rgba(var(--gold-rgb), 0.45);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  opacity: 0.9;
  transition: opacity .2s ease, background-color .25s ease, color .25s ease, border-color .25s ease;
}
#silver-theme-toggle:hover { opacity: 1; }
#silver-theme-toggle .sti { font-size: 15px; line-height: 1; }
@media (max-width: 640px) {
  #silver-theme-toggle { right: 10px; bottom: 10px; padding: 7px 11px; font-size: 12px; }
  #silver-theme-toggle .stl { display: none; }
}
