/* RuRadar — дашборд в стиле «терминал / фосфор»: тёмная основа, зелёный и циановый неон дозированно,
   моноширинные табличные цифры. Светлая тема — [data-theme='light'] (переключатель в шапке).
   Без фреймворков, без сборки. Цвета графиков берутся из этих же переменных (js/charts.js). */

/* ---------- шрифты (самохостинг, OFL: fonts/OFL-*.txt) ---------- */
@font-face {
  font-family: 'Manrope Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(../fonts/manrope-cyrillic-wght-normal.woff2) format('woff2-variations'), url(../fonts/manrope-cyrillic-wght-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(../fonts/manrope-latin-wght-normal.woff2) format('woff2-variations'), url(../fonts/manrope-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(../fonts/ibm-plex-mono-cyrillic-500-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(../fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- токены: тёмная тема (по умолчанию) ---------- */
:root {
  color-scheme: dark;
  --bg: #050807;
  --bg-grid: rgba(57, 255, 143, 0.035);
  --surface: #080d0b;
  --surface-2: #0c1310;
  --surface-3: #111b17;
  --line: rgba(150, 255, 200, 0.09);
  --line-2: rgba(150, 255, 200, 0.18);
  --line-3: rgba(150, 255, 200, 0.3);
  --text: #e6f1ea;
  --text-mid: #c2cec7;
  --text-dim: #8f9c95;
  --text-faint: #66726c;
  --phosphor: #39ff8f;
  --phosphor-soft: rgba(57, 255, 143, 0.14);
  --accent: #3ad8ff;
  --accent-hover: #8fe9ff;
  --accent-soft: rgba(58, 216, 255, 0.13);
  --accent-2: #ff5fd2;
  --good: #3ddc97;
  --bad: #ff6b5e;
  --warn: #ffc24b;
  --crit: #ff4d6a;
  --neutral: #a9b8d6;
  --good-bg: rgba(61, 220, 151, 0.11);
  --bad-bg: rgba(255, 107, 94, 0.11);
  --neutral-bg: rgba(169, 184, 214, 0.1);
  --flat-bg: rgba(230, 241, 234, 0.06);
  --warn-bg: rgba(255, 194, 75, 0.09);
  --crit-bg: rgba(255, 77, 106, 0.11);
  --glow: rgba(57, 255, 143, 0.5);
  --glow-accent: rgba(58, 216, 255, 0.45);
  --tooltip-bg: rgba(5, 9, 8, 0.96);
  --chart-grid: rgba(150, 255, 200, 0.07);
  --chart-axis: rgba(150, 255, 200, 0.2);
  --chart-area: rgba(58, 216, 255, 0.2);
  --chart-bar: rgba(58, 216, 255, 0.5);
  --map-empty: #141c19;
  --map-border: rgba(200, 255, 230, 0.24);
  --map-hover: #ffffff;
  --seq-0: #46327e; --seq-1: #365c8d; --seq-2: #277f8e; --seq-3: #1fa187; --seq-4: #4ac16d; --seq-5: #a0da39; --seq-6: #fde725;
  --hero-rgb-1: 57, 255, 143;
  --hero-rgb-2: 58, 216, 255;
  --hero-glow: 1;
  --rain: #39ff8f;
  --rain-head: #d8ffe9;
  --rain-opacity: 0.12;
  --scanlines: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, 0.22) 2px 3px);
  --card-bg: linear-gradient(180deg, rgba(150, 255, 200, 0.035), rgba(150, 255, 200, 0.008) 55%), var(--surface);
  --shadow-pop: 0 40px 120px -20px rgba(0, 0, 0, 0.9), 0 0 80px -30px var(--glow-accent);
  --radius: 4px;
  --font: 'Manrope Variable', Manrope, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --container: 1240px;
  --gutter: 16px;
  --topbar-h: 56px;
  --banner-h: 0px;
}
/* ---------- светлая тема: «распечатка терминала» ---------- */
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #eef3ef;
  --bg-grid: rgba(0, 110, 60, 0.05);
  --surface: #ffffff;
  --surface-2: #f6f9f7;
  --surface-3: #e8efea;
  --line: rgba(12, 50, 30, 0.12);
  --line-2: rgba(12, 50, 30, 0.22);
  --line-3: rgba(12, 50, 30, 0.36);
  --text: #0a1510;
  --text-mid: #23332a;
  --text-dim: #4a5a51;
  --text-faint: #7a877f;
  --phosphor: #00874a;
  --phosphor-soft: rgba(0, 135, 74, 0.1);
  --accent: #006c96;
  --accent-hover: #004a68;
  --accent-soft: rgba(0, 108, 150, 0.1);
  --accent-2: #b0168f;
  --good: #07804f;
  --bad: #c8322a;
  --warn: #9a6500;
  --crit: #c0143c;
  --neutral: #44597f;
  --good-bg: rgba(7, 128, 79, 0.1);
  --bad-bg: rgba(200, 50, 42, 0.09);
  --neutral-bg: rgba(68, 89, 127, 0.09);
  --flat-bg: rgba(10, 21, 16, 0.06);
  --warn-bg: rgba(154, 101, 0, 0.09);
  --crit-bg: rgba(192, 20, 60, 0.08);
  --glow: rgba(0, 135, 74, 0.22);
  --glow-accent: rgba(0, 108, 150, 0.2);
  --tooltip-bg: rgba(255, 255, 255, 0.97);
  --chart-grid: rgba(12, 50, 30, 0.08);
  --chart-axis: rgba(12, 50, 30, 0.28);
  --chart-area: rgba(0, 108, 150, 0.14);
  --chart-bar: rgba(0, 108, 150, 0.42);
  --map-empty: #dde5df;
  --map-border: rgba(10, 40, 25, 0.35);
  --map-hover: #0a1510;
  --hero-rgb-1: 0, 140, 80;
  --hero-rgb-2: 0, 108, 160;
  --hero-glow: 0.3;
  --rain: #00874a;
  --rain-head: #00431f;
  --rain-opacity: 0.1;
  --scanlines: none;
  --card-bg: var(--surface);
  --shadow-pop: 0 30px 80px -20px rgba(10, 40, 25, 0.35);
}
@media (min-width: 760px) { :root { --gutter: 32px; } }
html.is-mock { --banner-h: 36px; }

/* ---------- база ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + var(--banner-h) + 12px); background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* сетка «миллиметровки» на фоне */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(to right, var(--bg-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--bg-grid) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
  mask-image: radial-gradient(130% 90% at 50% 0%, #000 25%, transparent 80%);
  -webkit-mask-image: radial-gradient(130% 90% at 50% 0%, #000 25%, transparent 80%);
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { margin: 0; line-height: 1.12; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; box-shadow: 0 0 0 4px var(--accent-soft); }
::selection { background: var(--phosphor); color: #000; }
code { font-family: var(--mono); font-size: 0.9em; color: var(--text-mid); }

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--text-dim); }
.small { font-size: 13px; }
.mono-sm { font-family: var(--mono); font-size: 12px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--phosphor); color: #000; padding: 8px 14px; border-radius: var(--radius); font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 8px; }
.eyebrow {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.eyebrow .idx { color: var(--phosphor); margin-right: 10px; }
.eyebrow .idx::before { content: '['; color: var(--text-faint); }
.eyebrow .idx::after { content: ']'; color: var(--text-faint); }
.field-label { font-family: var(--mono); font-weight: 500; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
.empty { color: var(--text-dim); padding: 24px 0; }

/* ---------- демо-плашка ---------- */
.demo-banner {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--banner-h);
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 14px;
  padding: 0 var(--gutter);
  background: repeating-linear-gradient(-45deg, #ffc24b 0 14px, #eaa92c 14px 28px);
  color: #000;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-align: center;
}
.demo-banner strong { font-weight: 800; letter-spacing: 0.06em; }
.demo-sub { font-weight: 600; }
.demo-exit { color: #000; font-weight: 700; }
.demo-exit:hover { color: #000; }
@media (max-width: 520px) { .demo-sub { display: none; } .demo-banner { font-size: 12px; flex-wrap: nowrap; white-space: nowrap; } }
@media (max-width: 420px) { .demo-exit { display: none; } }

/* ---------- плашка open source + донат ---------- */
.oss {
  position: relative;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, var(--phosphor-soft), transparent 55%), var(--surface);
  font-size: 13.5px;
  line-height: 1.5;
}
.oss::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--phosphor); box-shadow: 0 0 12px var(--glow); }
.oss-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding-top: 10px; padding-bottom: 10px; align-items: start; }
.oss-text { grid-column: 1; color: var(--text-mid); }
.oss-donate { grid-column: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.oss-close { grid-column: 2; grid-row: 1 / span 2; width: 32px; height: 32px; }
.oss-badge {
  display: inline-block;
  margin-right: 6px;
  padding: 0 6px;
  border: 1px solid var(--phosphor);
  border-radius: 2px;
  color: var(--phosphor);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.6;
  vertical-align: 1px;
}
.oss-repo { white-space: nowrap; font-weight: 600; }
.oss-donate-lbl { font-weight: 700; color: var(--text); }
.addr-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; max-width: 100%; }
.addr-lbl { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); white-space: nowrap; }
.addr {
  display: inline-block;
  max-width: 100%;
  padding: 2px 8px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--surface-3);
  color: var(--phosphor);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  line-height: 1.6;
  user-select: all;
  -webkit-user-select: all;
  overflow-wrap: anywhere;
  word-break: break-all;
}
:root[data-theme='light'] .addr { color: #00512c; }
.addr--block { display: block; padding: 8px 10px; font-size: 14px; }
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--line-3);
  border-radius: 3px;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.copy-btn:hover { border-color: var(--phosphor); color: var(--phosphor); box-shadow: 0 0 14px -4px var(--glow); }
.copy-btn.is-done { border-color: var(--good); color: var(--good); }
.copy-btn.is-done .copy-lbl::before { content: '✓ '; }
.copy-btn.is-fail { border-color: var(--warn); color: var(--warn); }
.copy-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.copy-btn.is-fail + .copy-status { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; color: var(--warn); font-size: 12.5px; flex-basis: 100%; }
@media (max-width: 640px) {
  .oss { font-size: 13px; }
  .oss-inner { padding-top: 8px; padding-bottom: 10px; }
  .oss-text { padding-right: 4px; }
  .oss-donate { grid-column: 1 / -1; }
  .oss-close { grid-row: 1; }
}

/* ---------- шапка ---------- */
.topbar {
  position: sticky;
  top: var(--banner-h);
  z-index: 50;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--phosphor) 50%, transparent); opacity: 0.35; pointer-events: none; }
.topbar-inner { height: 100%; display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; flex: none; }
.brand:hover { color: var(--text); }
.brand-mark { color: var(--phosphor); filter: drop-shadow(0 0 6px var(--glow)); }
.brand-name { font-family: var(--mono); font-weight: 500; letter-spacing: 0.02em; font-size: 17px; }
.brand-cursor { font-family: var(--mono); color: var(--phosphor); margin-left: -6px; } /* без мигания: шапка липкая, анимация стоила бы перерисовок на каждой странице */
@keyframes blink { 50% { opacity: 0; } }
.nav {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%);
}
.nav::-webkit-scrollbar { display: none; }
.nav-list { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0 14px; width: max-content; }
.nav-list a {
  display: block;
  padding: 6px 9px;
  border-radius: 3px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
.nav-list a:hover { color: var(--text); background: var(--flat-bg); }
.nav-list a[aria-current='true'] { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.topbar-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.lang-switch { display: inline-flex; border: 1px solid var(--line-2); border-radius: 3px; overflow: hidden; }
.lang-switch a {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 32px;
  padding: 0 7px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-decoration: none;
}
.lang-switch a + a { border-left: 1px solid var(--line-2); }
.lang-switch a:hover { color: var(--text); background: var(--flat-bg); }
.lang-switch a[aria-current='true'] { color: #000; background: var(--phosphor); cursor: default; }
:root[data-theme='light'] .lang-switch a[aria-current='true'] { color: #fff; }
.theme-btn { width: 34px; height: 34px; }
.theme-btn .ico-moon { display: none; }
:root[data-theme='light'] .theme-btn .ico-sun { display: none; }
:root[data-theme='light'] .theme-btn .ico-moon { display: block; }
@media (max-width: 560px) {
  .brand .brand-name, .brand-cursor { display: none; }
  .topbar-inner { gap: 6px; }
  .nav-list { padding: 0 10px; }
  .topbar-tools { gap: 4px; }
  .lang-switch a { min-width: 30px; padding: 0 5px; }
}

/* ---------- hero ---------- */
.hero { position: relative; padding: clamp(28px, 4.5vw, 56px) 0 clamp(16px, 3vw, 32px); overflow: hidden; isolation: isolate; }
.hero-glow {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(50% 38% at 50% 64%, rgba(var(--hero-rgb-1), 0.10), transparent 70%),
    radial-gradient(30% 30% at 20% 50%, rgba(var(--hero-rgb-2), 0.07), transparent 70%),
    radial-gradient(60% 30% at 50% 0%, rgba(var(--hero-rgb-2), 0.07), transparent 70%);
}
/* строки развёртки — только фон hero, под текстом */
.hero::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--scanlines); opacity: 0.5; }
.rain {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--rain-opacity);
  /* слабее слева сверху, где заголовок и текст */
  mask-image: radial-gradient(70% 70% at 25% 20%, rgba(0, 0, 0, 0.25), #000 75%);
  -webkit-mask-image: radial-gradient(70% 70% at 25% 20%, rgba(0, 0, 0, 0.25), #000 75%);
}
.hero-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.hero-eyebrow { color: var(--text-mid); }
.prompt { color: var(--phosphor); }
.cursor { display: inline-block; width: 0.6em; height: 1.1em; margin-left: 4px; background: var(--phosphor); vertical-align: -2px; animation: blink 1.1s steps(1) infinite; box-shadow: 0 0 8px var(--glow); }
.hero-title {
  font-size: clamp(34px, 5.2vw, 70px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
  max-width: 17ch;
}
.grad {
  display: inline;
  background: linear-gradient(92deg, var(--phosphor) 0%, var(--accent) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px var(--glow));
}
:root[data-theme='light'] .grad { background: linear-gradient(92deg, #00753f 0%, #005f86 75%); -webkit-background-clip: text; background-clip: text; filter: none; }
.hero-lead { max-width: 60ch; color: var(--text-mid); font-size: clamp(16px, 1.5vw, 18px); }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.hero-updated { display: flex; align-items: baseline; gap: 10px; font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.02em; color: var(--text-dim); }
.hero-updated-text { display: flex; flex-wrap: wrap; column-gap: 0; }
.hero-updated .hu-main { color: var(--text-mid); }
.hero-updated .hu-sep { white-space: pre; }
/* «пульс» — кольцо на transform/opacity (композитор, без перерисовки страницы) */
.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--phosphor); flex: none; align-self: center; }
.live-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--phosphor); opacity: 0.5; animation: pulse 2.4s ease-out infinite; }
.hero-updated.is-unknown .live-dot { background: var(--text-dim); }
.hero-updated.is-stale .live-dot { background: var(--warn); }
.hero-updated.is-unknown .live-dot::after, .hero-updated.is-stale .live-dot::after, html.is-mock .live-dot::after { display: none; }
.hero-updated.is-stale .hu-rel { color: var(--warn); }
@keyframes pulse { 0% { transform: scale(1); opacity: 0.55; } 70%, 100% { transform: scale(3.2); opacity: 0; } }
html.is-mock .live-dot { background: var(--warn); }
.rain-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 3px 10px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.rain-btn:hover { color: var(--text); border-color: var(--line-3); }
.rain-btn[aria-pressed='true'] { color: var(--phosphor); border-color: rgba(var(--hero-rgb-1), 0.5); }
@media (max-width: 640px) { .hero-updated .hu-next { display: none; } }

.hero-stage { position: relative; grid-column: 1 / -1; height: clamp(170px, 30vw, 420px); margin-top: -4px; }
.hero-art {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(100vw, 1520px);
  transform: translateX(-50%);
  pointer-events: none;
  mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}
.hero-canvas { position: absolute; inset: 0; }
.hero-kpis {
  position: relative;
  z-index: 2;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: calc(-1 * clamp(24px, 10vw, 150px));
}
@media (min-width: 760px) { .hero-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 1100px) {
  .hero-kpis[data-n='6'] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .hero-kpis[data-n='5'] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .hero-kpis[data-n='4'] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.hero-kpis[data-n='1'] { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .hero-inner { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: 48px; }
  .hero-eyebrow, .hero-title { grid-column: 1 / -1; }
  .hero-lead { grid-column: 1; }
  .hero-meta { grid-column: 1 / -1; }
}
.empty-state {
  grid-column: 1 / -1;
  padding: clamp(18px, 3vw, 28px);
  border: 1px dashed var(--line-3);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px);
  display: grid;
  gap: 10px;
  justify-items: start;
}
.empty-state--error { border-color: var(--crit); border-style: solid; }
.empty-state--error .eyebrow { color: var(--crit); }
.empty-state h2 { font-size: 22px; letter-spacing: -0.02em; }
.empty-state p { color: var(--text-mid); max-width: 62ch; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

/* скелетоны загрузки */
.card.is-skeleton { min-height: 150px; gap: 12px; }
.sk { display: block; border-radius: 2px; background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 40%, var(--surface-3) 80%); background-size: 300% 100%; animation: sk 1.6s linear infinite; }
.sk--t { width: 60%; height: 12px; }
.sk--n { width: 75%; height: 26px; }
.sk--s { width: 100%; height: 34px; margin-top: auto; opacity: 0.6; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: -200% 0; } }

/* ---------- кнопки, поля ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 650;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}
.btn--ghost { color: var(--text); border-color: var(--line-2); background: transparent; }
.btn--ghost:hover { color: var(--text); border-color: var(--accent); box-shadow: 0 0 22px -8px var(--glow-accent); }
.btn--primary { color: #000; background: var(--phosphor); border-color: var(--phosphor); }
.btn--primary:hover { color: #000; box-shadow: 0 0 22px -4px var(--glow); }
:root[data-theme='light'] .btn--primary, :root[data-theme='light'] .btn--primary:hover { color: #fff; }
.btn--sm { min-height: 32px; padding: 6px 12px; font-size: 13px; }
.icon-btn {
  width: 36px;
  height: 36px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 3px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.link-arrow { color: var(--accent); font-weight: 650; font-size: 14px; text-decoration: none; }
.link-arrow:hover { text-decoration: underline; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--grow { flex: 1 1 260px; }
.select, .input {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  max-width: 100%;
}
.select:hover, .input:hover { border-color: var(--line-3); }
.select option, .select optgroup { background: var(--surface-2); color: var(--text); }
.input::placeholder { color: var(--text-dim); opacity: 1; }
.range { width: 100%; accent-color: var(--phosphor); }
.range-row { display: flex; align-items: center; gap: 12px; min-height: 40px; }

.seg-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
}
.seg {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-weight: 650;
  font-size: 13px;
  min-height: 30px;
  padding: 6px 11px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-variant-numeric: tabular-nums;
}
.seg:hover:not(:disabled) { color: var(--text); background: var(--flat-bg); }
.seg[aria-pressed='true'] { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.seg:disabled { opacity: 0.35; cursor: not-allowed; }
.seg--sm { padding: 5px 10px; font-size: 12.5px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text-mid);
  border-radius: 3px;
  padding: 5px 11px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.chip:hover { border-color: var(--line-3); color: var(--text); }
.chip[aria-pressed='true'] { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip-n { font-family: var(--mono); font-size: 11.5px; opacity: 0.75; }

/* ---------- панель «изменение на карточках» ---------- */
.toolbar-wrap { position: relative; z-index: 3; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 14px; padding: 8px 0 0; }

/* ---------- секции ---------- */
.section { position: relative; padding: clamp(40px, 6vw, 76px) 0 0; }
.section:last-of-type { padding-bottom: clamp(48px, 6vw, 80px); }
.section-head { display: grid; gap: 10px; margin-bottom: clamp(18px, 2.4vw, 28px); padding-top: 18px; border-top: 1px solid var(--line); position: relative; }
.section-head::before { content: ''; position: absolute; left: 0; top: -1px; width: 88px; height: 1px; background: linear-gradient(90deg, var(--phosphor), transparent); box-shadow: 0 0 10px var(--glow); }
.section-head .eyebrow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 0; }
.section-head h2 { font-size: clamp(26px, 3.3vw, 40px); font-weight: 800; letter-spacing: -0.03em; }
.section-head .lead { color: var(--text-mid); max-width: 68ch; }
.sec-stats { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: 4px 12px; text-transform: none; letter-spacing: 0.02em; padding-left: 16px; }
.sec-crit { color: var(--crit); }

/* ---------- KPI-карточки ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 228px), 1fr)); gap: 10px; }
.cards + .cards { margin-top: 10px; }
.regions-cards { margin-bottom: 24px; }
.more-btn { margin-top: 12px; }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  min-height: 168px;
  padding: 14px 14px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  transition: border-color 0.2s, box-shadow 0.25s;
}
/* полоска статуса сверху */
.card::before {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  top: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-3), transparent);
}
.card.is-warn::before { background: linear-gradient(90deg, transparent, var(--warn), transparent); height: 2px; }
.card.is-crit::before { background: linear-gradient(90deg, transparent, var(--crit), transparent); height: 2px; box-shadow: 0 0 10px var(--crit-bg); }
/* «уголки прицела» при наведении/фокусе */
.card::after {
  content: '';
  position: absolute;
  inset: -1px;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.2s;
  background:
    linear-gradient(var(--accent), var(--accent)) top left / 10px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) top left / 1px 10px no-repeat,
    linear-gradient(var(--accent), var(--accent)) top right / 10px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) top right / 1px 10px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom left / 10px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom left / 1px 10px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom right / 10px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom right / 1px 10px no-repeat;
}
.card:hover { border-color: var(--line-2); box-shadow: 0 16px 44px -26px var(--glow-accent); }
.card:hover::after, .card:focus-within::after { opacity: 1; }
.card:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 24px -8px var(--glow-accent); }
.card.is-skeleton::after { display: none; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-link { color: var(--text); font-size: 14px; font-weight: 650; line-height: 1.3; text-decoration: none; }
.card-link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.card-link:hover { color: var(--accent-hover); }
.card-link:focus-visible { outline: none; box-shadow: none; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; min-height: 20px; }
.card-badges { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; position: relative; z-index: 2; }
.card-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; margin-top: 2px; }
.num {
  font-family: var(--mono);
  font-size: clamp(24px, 2.3vw, 30px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text);
}
.num--empty { color: var(--text-dim); }
.unit { color: var(--text-dim); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.card-date { font-family: var(--mono); font-weight: 500; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.card-change { min-height: 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.card-spark { margin-top: auto; height: 44px; }
.card-spark.is-empty { opacity: 0; }
.card-note { font-size: 13px; color: var(--text-dim); }
.card.is-nodata { background: repeating-linear-gradient(-45deg, var(--flat-bg) 0 1px, transparent 1px 9px), var(--surface); }
.card.is-stale .num { color: var(--text-mid); }
.card.is-stale .card-spark { opacity: 0.5; }

.card--hero { min-height: 0; padding: 12px 12px 8px; background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-color: var(--line-2); }
.card--hero .num { font-size: clamp(22px, 2.1vw, 28px); }
.card--hero .card-spark { height: 38px; }
.card--compact { min-height: 0; }
.card--compact .num { font-size: clamp(20px, 2vw, 26px); }
.card--compact .card-spark { height: 36px; }

/* спарклайн: цвет через currentColor */
.spark { color: var(--accent); overflow: visible; }
.spark--good { color: var(--good); }
.spark--bad { color: var(--bad); }
.spark--flat, .spark--neutral { color: var(--accent); }
.spark-th { stroke-opacity: 0.6; }
.spark-th--warn { stroke: var(--warn); }
.spark-th--crit { stroke: var(--crit); }

/* показатели без данных — компактный список вместо пустых карточек */
.nodata-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 12px; }
.nodata-list .field-label { margin-right: 4px; }
.nodata-list ul { display: contents; list-style: none; }
.nodata-list li { display: inline; }
.nodata-list a {
  display: inline-block;
  padding: 3px 9px;
  border: 1px dashed var(--line-2);
  border-radius: 3px;
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: none;
}
.nodata-list a:hover { color: var(--text); border-color: var(--line-3); }

/* изменения */
.chg {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 6px;
  padding: 2px 7px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.chg-arrow { font-size: 9px; transform: translateY(-1px); }
.chg-lbl { font-weight: 500; color: var(--text-dim); font-size: 12.5px; line-height: 1.3; }
.chg--good { color: var(--good); background: var(--good-bg); }
.chg--bad { color: var(--bad); background: var(--bad-bg); }
.chg--neutral { color: var(--neutral); background: var(--neutral-bg); }
.chg--flat { color: var(--text-dim); background: var(--flat-bg); }
.seg .chg--good, .seg .chg--bad, .seg .chg--neutral, .seg .chg--flat { background: none; padding: 0; }

.pill {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-dim);
}
.pill--warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: var(--warn-bg); }
.pill--crit { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 55%, transparent); background: var(--crit-bg); }
.pill--stale { border-style: dashed; color: var(--text-mid); }
.pill--nodata { color: var(--text-mid); }
.pill--note { min-width: 18px; text-align: center; font-style: italic; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); cursor: help; }
.pill--type { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 45%, transparent); }

/* ---------- детальный график ---------- */
.detail {
  width: min(1000px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.detail::backdrop { background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.detail[open] { animation: dlg-in 0.28s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: none; } }
.detail-body { padding: clamp(18px, 3vw, 28px); overflow-y: auto; overflow-x: hidden; max-height: calc(100dvh - 50px); display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.detail-title { font-size: clamp(21px, 2.8vw, 30px); font-weight: 800; letter-spacing: -0.025em; margin-top: 6px; }
.detail-top { display: grid; gap: 16px; }
.detail-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.detail-value .num { font-size: clamp(32px, 4.6vw, 48px); }
.detail-value .unit { font-size: 17px; }
.detail-sub { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: var(--text-dim); }
.detail-lastchg { font-family: var(--mono); font-size: 12.5px; }
.detail-periods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 640px) { .detail-periods { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.detail-periods .seg {
  display: grid;
  gap: 2px;
  justify-items: start;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface-2);
}
.seg-lbl { font-size: 13px; font-weight: 800; color: var(--text); }
.seg-chg { font-family: var(--mono); font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.seg-note { font-size: 11px; color: var(--text-dim); font-weight: 500; line-height: 1.2; }
.detail-compare { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.detail-compare .field { flex: 1 1 260px; }
.detail-compare .select { width: 100%; }
.detail-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-presets .chip[aria-pressed='true'] { background: color-mix(in srgb, var(--accent-2) 16%, transparent); color: var(--text); border-color: var(--accent-2); }
.detail-chart-wrap { position: relative; border: 1px solid var(--line); border-radius: 4px; padding: 12px 8px 8px; background: radial-gradient(80% 60% at 50% 0%, var(--accent-soft), transparent 70%), var(--surface-2); }
.detail-chart { height: clamp(260px, 42vh, 400px); position: relative; }
.detail-legend { padding: 6px 8px 0; font-size: 12.5px; font-family: var(--mono); }
.detail-hint { padding: 2px 8px 0; font-size: 12px; color: var(--text-dim); }
@media (pointer: coarse) { .detail-hint { display: none; } }
.chart-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-dim); font-size: 14px; text-align: center; padding: 16px; }
.detail-note { display: grid; gap: 4px; padding: 10px 12px; border-left: 2px solid var(--warn); background: var(--warn-bg); border-radius: 0 3px 3px 0; font-size: 14px; color: var(--text-mid); }
.detail-note p { line-height: 1.55; }
.detail-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.detail-source { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.detail-text { display: grid; gap: 16px; padding-top: 10px; border-top: 1px solid var(--line); }
@media (min-width: 760px) { .detail-text { grid-template-columns: 1fr 1fr; } .detail-facts { grid-column: 1 / -1; } }
.detail-text h3 { font-family: var(--mono); font-weight: 500; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--phosphor); margin-bottom: 6px; }
:root[data-theme='light'] .detail-text h3 { color: var(--text-dim); }
.detail-text p { color: var(--text-mid); line-height: 1.65; }
.detail-facts dl, .facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0; }
.detail-facts dt, .facts dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
.detail-facts dd, .facts dd { margin: 2px 0 0; font-size: 14px; }
.th { font-weight: 650; }
.th--warn { color: var(--warn); }
.th--crit { color: var(--crit); margin-left: 8px; }
@media (max-width: 640px) {
  .detail { width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .detail-body { max-height: 100dvh; padding-bottom: 40px; }
}

/* ---------- война ---------- */
.war-lead { color: var(--text-mid); margin: -6px 0 16px; max-width: 72ch; }
.war-grid { display: grid; gap: 14px; }
@media (min-width: 1000px) { .war-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.war-block {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
  padding: clamp(14px, 2.2vw, 22px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  position: relative;
}
.war-block::before { content: ''; position: absolute; left: -1px; right: -1px; top: -1px; height: 2px; }
.war-block--genstaff::before { background: linear-gradient(90deg, var(--warn), transparent 70%); }
.war-block--confirmed::before { background: linear-gradient(90deg, var(--accent), transparent 70%); }
.war-block-head { display: grid; gap: 8px; justify-items: start; }
.war-block-head h3, .war-other-head h3 { font-size: clamp(19px, 2vw, 24px); font-weight: 800; letter-spacing: -0.02em; }
.war-block-head .note, .war-other-head .note { color: var(--text-dim); font-size: 14px; max-width: 70ch; }
.type-badge { font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 8px; border-radius: 2px; border: 1px solid; }
.type-badge--genstaff { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: var(--warn-bg); }
.type-badge--confirmed { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: var(--accent-soft); }
.cards--war { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 8px; }
.cards--war .card { padding: 11px 11px 8px; }
@media (max-width: 420px) { .cards--war .num { font-size: 19px; } .cards--war .card-spark { height: 28px; } }
.war-chart-head { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.war-chart { height: 300px; position: relative; }
.war-avg { font-size: 13px; min-height: 1em; font-family: var(--mono); }
.war-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: baseline; font-size: 13.5px; }
.war-other { margin-top: 18px; display: grid; gap: 14px; padding-top: 18px; border-top: 1px dashed var(--line-2); }
.war-other-head { display: grid; gap: 6px; }
.source-line { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tab {
  appearance: none;
  min-height: 30px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text-dim);
  border-radius: 3px;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab[aria-selected='true'] { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }

/* ---------- регионы ---------- */
.regions-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 20px; margin-bottom: 16px; }
.regions-controls .field:first-child { flex: 0 1 380px; }
.reg-date-out { color: var(--text); font-family: var(--mono); font-size: 13px; letter-spacing: 0; text-transform: none; margin-left: 4px; }
.regions-grid { display: grid; gap: 16px; }
@media (min-width: 1000px) { .regions-grid { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); } }
.map-wrap { position: relative; align-self: start; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; background: radial-gradient(70% 60% at 50% 40%, var(--accent-soft), transparent 70%), var(--surface); }
.map { position: relative; width: 100%; aspect-ratio: 1.78 / 1; min-height: 200px; max-height: 600px; }
.map-zoom { position: absolute; top: 14px; right: 14px; display: grid; gap: 6px; z-index: 2; }
.map-zoom .icon-btn { width: 32px; height: 32px; background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(6px); }
.map-legend { list-style: none; margin: 6px 0 0; padding: 0 4px; display: flex; flex-wrap: wrap; gap: 6px 14px; font-family: var(--mono); font-size: 11.5px; color: var(--text-mid); font-variant-numeric: tabular-nums; }
.map-legend li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.map-legend .sw { width: 14px; height: 10px; border-radius: 1px; flex: none; }
.map-legend .sw--none { background: var(--map-empty); box-shadow: inset 0 0 0 1px var(--map-border); }
.map-note { font-size: 12.5px; color: var(--text-dim); padding: 10px 6px 2px; border-top: 1px solid var(--line); margin-top: 6px; }
.rank { display: grid; gap: 12px; align-content: start; min-width: 0; }
.rank-total { font-size: 13px; font-family: var(--mono); }

.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table-wrap--scroll { max-height: clamp(320px, 52vw, 560px); overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  text-align: left;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.table th button { appearance: none; border: 0; background: none; padding: 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; min-height: 24px; }
.table th button:hover { color: var(--text); }
.table th[aria-sort='ascending'] button::after { content: ' ↑'; color: var(--accent); }
.table th[aria-sort='descending'] button::after { content: ' ↓'; color: var(--accent); }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td, .table tbody tr:focus-within td { background: var(--accent-soft); }
.table tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.num-col { text-align: right !important; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.table--rank td.up, .table--rank td.down { color: var(--text-mid); }

/* ---------- источники ---------- */
.src-controls { display: grid; gap: 10px; margin-bottom: 14px; }
.src-row2 { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.src-search { flex: 0 1 300px; }
.src-search .input { width: 100%; }
.chip--st .dot, .src-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); flex: none; }
.chip--st .dot--active, .src-status--active .dot { background: var(--good); box-shadow: 0 0 8px var(--good-bg); }
.chip--st .dot--failing, .src-status--failing .dot { background: var(--bad); }
.chip--st .dot--dead, .src-status--dead .dot { background: var(--crit); }
.chip--st .dot--manual, .src-status--manual .dot { background: var(--accent-2); }
.chip--st .dot--planned, .src-status--planned .dot { background: transparent; box-shadow: inset 0 0 0 1px var(--text-dim); }
.src-name { font-weight: 650; }
.kind { font-size: 13px; color: var(--text-mid); white-space: nowrap; }
.src-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.src-status--failing { color: var(--bad); }
.src-status--planned { color: var(--text-dim); }
.src-err { display: block; font-size: 12.5px; color: var(--bad); margin-top: 2px; max-width: 34ch; overflow-wrap: anywhere; }
.src-err--prev { color: var(--text-dim); font-size: 12px; }
.src-err-d { margin-top: 4px; font-size: 12px; color: var(--text-dim); max-width: 40ch; }
.src-err-d summary { cursor: pointer; width: max-content; }
.src-err-d code { display: block; margin-top: 4px; font-size: 11.5px; overflow-wrap: anywhere; white-space: normal; }
.src-id { font-family: var(--mono); font-size: 11.5px; }
.untranslated { font-size: 14px; }
details.orig { font-size: 13.5px; color: var(--text-dim); }
details.orig summary { cursor: pointer; width: max-content; max-width: 100%; color: var(--accent); }
details.orig p { margin-top: 6px; }
.src-inds { font-size: 13px; color: var(--text-dim); }
.src-inds a { color: var(--text-mid); text-decoration: none; }
.src-inds a:hover { color: var(--accent); text-decoration: underline; }
.src-link { text-align: right; }
.src-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.sources-count { font-size: 13px; font-family: var(--mono); }
@media (max-width: 760px) {
  .table--sources thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--sources, .table--sources tbody, .table--sources tr, .table--sources td { display: block; width: 100%; }
  .table--sources tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .table--sources td { border: 0; padding: 4px 0; display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 8px; }
  .table--sources td::before { content: attr(data-label); font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); padding-top: 2px; }
  .table--sources td.src-link { display: block; text-align: left; padding-top: 8px; }
  .table--sources td.src-link::before { content: none; }
  .table--sources td[colspan] { display: block; }
  .table--sources td[colspan]::before { content: none; }
  .src-search { flex: 1 1 100%; }
}

/* ---------- методология ---------- */
.method-intro { display: grid; gap: 22px; margin-bottom: 32px; }
.principles { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 900px) { .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.principles li { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.principle-n { font-family: var(--mono); color: var(--phosphor); font-size: 12px; padding-top: 3px; }
.principles p { color: var(--text-mid); font-size: 15px; }
.legend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 24px; font-size: 14px; color: var(--text-mid); }
.legend-list li { display: flex; align-items: center; gap: 10px; }
.method-cats { column-gap: 44px; }
@media (min-width: 1000px) { .method-cats { columns: 2; } }
.method-cat { break-inside: avoid; margin-bottom: 26px; }
.method-cat h3 { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 6px; }
.method-item { border-bottom: 1px solid var(--line); }
.method-item summary {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 16px;
  padding: 10px 2px;
  cursor: pointer;
}
.method-item summary:hover .method-title { color: var(--accent-hover); }
.method-item summary::-webkit-details-marker { display: none; }
.method-item summary::before { content: '+'; font-family: var(--mono); color: var(--phosphor); width: 1ch; margin-right: 6px; }
.method-item[open] summary::before { content: '−'; }
.method-title { font-weight: 600; flex: 1 1 60%; font-size: 15px; }
.method-unit { font-size: 12.5px; font-family: var(--mono); }
.method-body { display: grid; gap: 10px; padding: 0 2px 16px 22px; color: var(--text-mid); max-width: 80ch; }

/* ---------- подвал ---------- */
.footer { border-top: 1px solid var(--line); padding: 36px 0 52px; margin-top: 24px; background: linear-gradient(180deg, var(--phosphor-soft), transparent 40%); }
.footer-inner { display: grid; gap: 28px; font-size: 14px; }
@media (min-width: 1000px) { .footer-inner { grid-template-columns: 1fr 1.15fr 1fr; } }
.footer-about { display: grid; gap: 8px; align-content: start; }
.footer .brand-name { font-size: 18px; color: var(--phosphor); }
.footer-meta { display: grid; gap: 8px; justify-items: start; align-content: start; }
.donate {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--phosphor) 45%, transparent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 0 40px -24px var(--glow);
}
.donate-title { font-family: var(--mono); font-weight: 500; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--phosphor); }
.donate-ask { font-weight: 700; }
.donate-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.donate-row .addr { flex: 1 1 100%; }

/* ---------- ECharts tooltip ---------- */
.detail-chart > div, .map > div, .war-chart > div { border-radius: 4px; }

/* ---------- уменьшение движения ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- печать ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --text-mid: #111; --text-dim: #333; }
  .oss, .topbar, .rain, .hero-art, .hero-stage, .rain-btn, .toolbar-wrap, .more-btn, .detail { display: none !important; }
  body::before, .hero::after { display: none; }
  .hero-kpis { margin-top: 0; }
  .grad { color: #000; background: none; filter: none; }
}
