/* Белые списки — редакционная вёрстка: бумага и графит, линейки вместо карточек. */

/* =============================================================== шрифты */

@font-face { font-family: "PT Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/pt-serif-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PT Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/pt-serif-latin-400-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: "PT Serif"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/pt-serif-cyrillic-700-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PT Serif"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/pt-serif-latin-700-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 Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/ibm-plex-sans-cyrillic-400-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 Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/ibm-plex-sans-latin-400-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 Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/ibm-plex-sans-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 Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/ibm-plex-sans-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; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/ibm-plex-sans-cyrillic-600-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 Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/ibm-plex-sans-latin-600-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-weight: 400; font-display: swap; src: url("/static/fonts/ibm-plex-mono-cyrillic-400-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-weight: 400; font-display: swap; src: url("/static/fonts/ibm-plex-mono-latin-400-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-weight: 500; font-display: swap; src: url("/static/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-weight: 500; font-display: swap; src: url("/static/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: light;
  --serif: "PT Serif", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", Consolas, "SFMono-Regular", monospace;

  --paper: #f3f0e8;
  --paper-2: #ebe7dc;
  --paper-3: #e2ddd0;
  --ink: #161513;
  --ink-2: #3a3833;
  --muted: #69655c;
  --faint: #98938a;
  --rule: #d6d0c2;
  --rule-strong: #161513;
  --on-ink: #f3f0e8;
  --focus: #1d4ed8;
  --shadow: 0 18px 48px rgba(22, 21, 19, 0.16);

  --red: #7a000e;
  --amber: #cc6810;
  --green: #4b6b05;
  --gray: #8f8a7f;
  --nodata: #d8d2c4;

  --map-land: #e3ded2;
  --map-whitelist: #7a000e;
  --map-mixed: #cc6810;
  --map-open: #4b6b05;
  --map-hatch: #a29d91;
  --map-border: #f3f0e8;
  --map-outline: #8d887d;
  --map-hover: #161513;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #121211;
    --paper-2: #1a1a18;
    --paper-3: #23221f;
    --ink: #ece8df;
    --ink-2: #cdc9bf;
    --muted: #9c988e;
    --faint: #6d6a63;
    --rule: #2c2b28;
    --rule-strong: #ece8df;
    --on-ink: #121211;
    --focus: #8fb0ff;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.55);

    --red: #db5766;
    --amber: #cc6810;
    --green: #7b9e2e;
    --gray: #77736b;
    --nodata: #34322e;

    --map-land: #242320;
    --map-whitelist: #7a000e;
    --map-mixed: #cc6810;
    --map-open: #4b6b05;
    --map-hatch: #55524b;
    --map-border: #121211;
    --map-outline: #4a4842;
    --map-hover: #ece8df;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121211;
  --paper-2: #1a1a18;
  --paper-3: #23221f;
  --ink: #ece8df;
  --ink-2: #cdc9bf;
  --muted: #9c988e;
  --faint: #6d6a63;
  --rule: #2c2b28;
  --rule-strong: #ece8df;
  --on-ink: #121211;
  --focus: #8fb0ff;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.55);

  --red: #db5766;
  --amber: #cc6810;
  --green: #7b9e2e;
  --gray: #77736b;
  --nodata: #34322e;

  --map-land: #242320;
  --map-whitelist: #7a000e;
  --map-mixed: #cc6810;
  --map-open: #4b6b05;
  --map-hatch: #55524b;
  --map-border: #121211;
  --map-outline: #4a4842;
  --map-hover: #ece8df;
}

/* ================================================================== база */

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 0;
}

[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 32px; }
.mono, code { font-family: var(--mono); font-size: 0.92em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }

.kicker {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 2px solid var(--rule-strong);
  margin-bottom: 18px;
}
.section-title {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ============================================================ шапка */

.topline { border-bottom: 1px solid var(--rule); font-size: 12.5px; color: var(--muted); }
.topline-inner { display: flex; justify-content: space-between; gap: 16px; padding-top: 7px; padding-bottom: 7px; }
.topline-right { display: flex; gap: 18px; align-items: center; }
.live { display: inline-flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gray); }
.live.ok .live-dot { background: var(--green); animation: live 2.4s ease-in-out infinite; }
.live.stale .live-dot { background: var(--amber); }
@keyframes live { 50% { opacity: 0.25; } }

.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
  border-bottom: 1px solid var(--rule-strong);
}
.masthead-inner { display: flex; align-items: center; gap: 36px; min-height: 60px; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 23px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { text-decoration: none; }
.wordmark-mark {
  width: 13px;
  height: 13px;
  background: var(--red);
  box-shadow: 4px 4px 0 var(--ink);
  flex: none;
}
.wordmark-mark.small { display: inline-block; width: 9px; height: 9px; box-shadow: 3px 3px 0 var(--ink); margin-right: 9px; vertical-align: 1px; }

.nav { display: flex; gap: 24px; }
.nav-link {
  padding: 4px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.nav-link:hover { color: var(--ink); text-decoration: none; }
.nav-link[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

.masthead-actions { margin-left: auto; display: flex; align-items: center; gap: 18px; }

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.text-btn:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.lang-switch { display: inline-flex; border: 1px solid var(--rule); }
.lang-btn {
  padding: 3px 9px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.lang-btn + .lang-btn { border-left: 1px solid var(--rule); }
.lang-btn:hover { color: var(--ink); }
.lang-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.theme-glyph {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

/* ============================================================ кнопки */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 2px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.btn:hover { background: var(--paper-3); }
.btn.primary { background: var(--ink); color: var(--on-ink); }
.btn.primary:hover { background: var(--ink-2); }
.btn.ghost { border-color: var(--rule); }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn.danger:hover { background: var(--red); color: #fff; }
.btn.small { min-height: 28px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: progress; }

/* ============================================================ вводка */

.lead { padding-top: 40px; padding-bottom: 36px; }
.lead .kicker { margin-bottom: 14px; }
.headline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 4.4vw, 58px);
  line-height: 1.06;
  letter-spacing: -0.015em;
  max-width: 24ch;
}
.headline.small { font-size: clamp(28px, 3vw, 40px); max-width: none; }
.figure {
  padding: 0;
  border: 0;
  background: none;
  color: var(--red);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 8px;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s;
}
.figure:hover, .figure[aria-pressed="true"] { text-decoration-color: var(--red); }
.dek { margin-top: 18px; max-width: 64ch; font-size: 18px; line-height: 1.55; color: var(--ink-2); }

.nowrap { white-space: nowrap; }
.num-toggle {
  padding: 0 1px;
  border: 0;
  border-bottom: 2px solid var(--toggle-color, var(--ink));
  background: none;
  color: inherit;
  font: inherit;
  font-family: var(--mono);
  font-size: 0.92em;
  font-weight: 500;
  cursor: pointer;
}
.num-toggle:hover, .num-toggle[aria-pressed="true"] { background: var(--toggle-color); color: #fff; }
.num-toggle[data-status="whitelist"] { --toggle-color: var(--red); }
.num-toggle[data-status="mixed"] { --toggle-color: var(--amber); }
.num-toggle[data-status="open"] { --toggle-color: var(--green); }
.num-toggle[data-status="offline"] { --toggle-color: var(--gray); }
.num-toggle[data-status="nodata"] { --toggle-color: var(--faint); }

.unitbar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 2px;
  height: 34px;
  margin-top: 34px;
}
.unit {
  padding: 0;
  border: 0;
  background: var(--unit, var(--nodata));
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.unit:hover, .unit.selected { transform: scaleY(1.25); }
.unit[data-status="whitelist"] { --unit: var(--map-whitelist); }
.unit[data-status="mixed"] { --unit: var(--map-mixed); }
.unit[data-status="open"] { --unit: var(--map-open); }
.unit[data-status="offline"] { --unit: repeating-linear-gradient(45deg, var(--map-hatch) 0 2px, var(--map-land) 2px 5px); }
.unit[data-status="nodata"] { --unit: var(--nodata); }
.unitbar.filtering .unit:not(.match) { opacity: 0.18; }
.unitbar-caption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12.5px;
}

/* ============================================================== карта */

.atlas { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 48px; padding-bottom: 48px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; }
.legend li { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.swatch { width: 12px; height: 12px; flex: none; background: var(--swatch); }
.swatch[data-status="whitelist"] { --swatch: var(--map-whitelist); }
.swatch[data-status="mixed"] { --swatch: var(--map-mixed); }
.swatch[data-status="open"] { --swatch: var(--map-open); }
.swatch[data-status="offline"] { --swatch: repeating-linear-gradient(45deg, var(--map-hatch) 0 2px, var(--map-land) 2px 4.5px); }
.swatch[data-status="nodata"] { --swatch: var(--map-land); box-shadow: inset 0 0 0 1px var(--rule); }

.map-stage { position: relative; touch-action: none; user-select: none; }
.map { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; cursor: grab; }
.map.dragging { cursor: grabbing; }

.region { fill: var(--map-land); fill-rule: evenodd; cursor: pointer; transition: fill 0.3s, opacity 0.2s; }
.region[data-status="whitelist"] { fill: var(--map-whitelist); animation: burn 3.2s ease-in-out infinite; }
.region[data-status="mixed"] { fill: var(--map-mixed); }
.region[data-status="open"] { fill: var(--map-open); }
.region[data-status="offline"] { fill: url(#hatch); }
.region.hover { opacity: 0.82; animation: none; }
.map.filtering .region:not(.match) { opacity: 0.2; animation: none; }
@keyframes burn { 50% { opacity: 0.84; } }

.hatch-bg { fill: var(--map-land); }
.hatch-line { fill: var(--map-hatch); }

/* Толщина линий — в экранных пикселях при любом масштабе карты. */
.borders, .outline, .highlight, .marker { vector-effect: non-scaling-stroke; }
.borders { fill: none; stroke: var(--map-border); stroke-width: 0.8px; stroke-linejoin: round; pointer-events: none; }
.outline { fill: none; stroke: var(--map-outline); stroke-width: 0.8px; stroke-linejoin: round; pointer-events: none; }
/* Крым и Севастополь: территория под фактическим контролем РФ, не признанная граница.
   Толщину и шаг пунктира карта пересчитывает под масштаб сама (map.js, apply). */
.outline.de-facto { stroke: var(--ink); vector-effect: none; stroke-linecap: butt; }
.highlight { fill: none; stroke: var(--map-hover); stroke-width: 1.6px; stroke-linejoin: round; pointer-events: none; }
.highlight.selected { stroke-width: 2.4px; }

.marker { stroke: var(--paper); stroke-width: 1.5px; cursor: pointer; }
.marker[hidden] { display: none; }
.marker[data-status="whitelist"] { fill: var(--map-whitelist); }
.marker[data-status="mixed"] { fill: var(--map-mixed); }
.marker[data-status="open"] { fill: var(--map-open); }
.marker[data-status="offline"] { fill: var(--gray); }
.map.filtering .marker:not(.match) { opacity: 0.2; }

.map-controls { position: absolute; top: 0; right: 0; display: flex; gap: 0; border: 1px solid var(--ink); background: var(--paper); }
.map-btn {
  min-width: 34px;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-left: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.map-btn:first-child { border-left: 0; }
.map-btn.wide { font-size: 12px; font-family: var(--sans); font-weight: 500; }
.map-btn:hover { background: var(--ink); color: var(--paper); }

.map-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  min-width: 190px;
  max-width: 270px;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  pointer-events: none;
  font-size: 13px;
}
.map-tooltip strong { display: block; font-family: var(--serif); font-size: 16px; font-weight: 700; line-height: 1.2; margin-bottom: 6px; }
.tip-meta { margin-top: 6px; color: var(--muted); font-family: var(--mono); font-size: 12px; }

.map-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); font-size: 14px; }
/* Водяной знак: адрес сайта остаётся на любом скриншоте карты. */
.map-watermark { position: absolute; right: 0; bottom: 0; padding: 3px 0 3px 8px; background: color-mix(in srgb, var(--paper) 82%, transparent); color: var(--muted); font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; text-decoration: none; }
/* Тот же знак, что у логотипа в подвале (.wordmark-mark.small): красный квадрат с тенью. */
.map-watermark::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 9px; vertical-align: 1px; background: var(--red); box-shadow: 3px 3px 0 var(--ink); }
.map-watermark:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .region[data-status="whitelist"], .live.ok .live-dot { animation: none; }
  .region, .unit { transition: none; }
}

/* ============================================================== досье */

.dossier { border-left: 1px solid var(--rule); padding-left: 32px; align-self: start; position: sticky; top: 84px; }
.dossier .kicker { margin-bottom: 8px; }
.dossier h2 { font-family: var(--serif); font-weight: 700; font-size: 30px; line-height: 1.1; letter-spacing: -0.01em; }
.dossier .reason { margin-top: 10px; color: var(--ink-2); }
.dossier h3 { margin-top: 26px; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.status-pill { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-weight: 600; font-size: 14px; }
.ops .status-pill, .op-table .status-pill { margin-top: 0; font-size: 13px; font-weight: 500; }
.dot { width: 10px; height: 10px; flex: none; background: var(--dot, var(--nodata)); }
[data-status="whitelist"] > .dot { --dot: var(--map-whitelist); }
[data-status="mixed"] > .dot { --dot: var(--map-mixed); }
[data-status="open"] > .dot { --dot: var(--map-open); }
[data-status="offline"] > .dot { --dot: repeating-linear-gradient(45deg, var(--map-hatch) 0 2px, var(--map-land) 2px 4.5px); }
[data-status="nodata"] > .dot { --dot: var(--nodata); }

/* Список «показатель … значение» с точечной отбивкой. */
dl.kv { margin: 18px 0 0; font-size: 14px; }
dl.kv dd { margin: 0; }
dl.kv.leaders { display: grid; gap: 7px; }
dl.kv.leaders > div { display: flex; align-items: baseline; gap: 8px; }
dl.kv.leaders dt { color: var(--ink-2); }
dl.kv.leaders .leader { flex: 1; border-bottom: 1px dotted var(--faint); transform: translateY(-4px); }
dl.kv.leaders dd { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.op-table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 14px; }
.op-table td { padding: 8px 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.op-table td:nth-child(2) { font-size: 13px; color: var(--muted); padding: 8px 14px; line-height: 1.35; }
.op-table td:last-child { text-align: right; white-space: nowrap; }

.history-list { margin: 8px 0 0; padding: 0; list-style: none; }
.history-list li { display: grid; gap: 3px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.history-list .status-pill { margin-top: 0; font-size: 13px; font-weight: 500; }
.history-when { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.dossier-links { display: flex; gap: 20px; margin-top: 22px; }

.legend-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 14px; }
.legend-list li { display: grid; grid-template-columns: 14px 1fr; gap: 12px; font-size: 14px; }
.legend-list .swatch { margin-top: 5px; }
.legend-list strong { display: block; font-weight: 600; }
.legend-list span { color: var(--muted); font-size: 13.5px; }

/* =========================================================== таблица */

.regions { padding-bottom: 56px; }
.filters { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-bottom: 14px; }
.filter {
  padding: 4px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.filter b { margin-left: 6px; font-family: var(--mono); font-weight: 500; font-size: 12.5px; }
.filter:hover { color: var(--ink); }
.filter[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--filter-color, var(--ink)); }
.filter[data-status="whitelist"] { --filter-color: var(--red); }
.filter[data-status="mixed"] { --filter-color: var(--amber); }
.filter[data-status="open"] { --filter-color: var(--green); }
.filter[data-status="offline"] { --filter-color: var(--gray); }

.table-wrap { overflow-x: auto; }
.regions .table-wrap { max-height: 640px; overflow-y: auto; border-bottom: 1px solid var(--rule-strong); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 14px 10px 0; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--rule); }
.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--paper);
  border-bottom: 1px solid var(--rule-strong);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.table td.num, .table th.num { text-align: right; font-family: var(--mono); font-size: 13px; }
.table th.num { font-family: var(--sans); font-size: 11.5px; }
.table td.when { text-align: right; white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; }
.table tbody tr:hover td { background: var(--paper-2); }
.table tbody tr.selected td { background: var(--paper-3); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.table td.faint, .table td.mono:first-child { white-space: nowrap; }
/* Адрес шлюза длинный — переносится, чтобы кнопки строки оставались на экране. */
.table td.mono.faint:not(:first-child) { white-space: normal; word-break: break-all; font-size: 12px; }

.sort { padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.sort::after { content: " ↕"; color: var(--faint); }
.sort[data-dir="asc"]::after { content: " ↑"; color: var(--ink); }
.sort[data-dir="desc"]::after { content: " ↓"; color: var(--ink); }

.link-btn { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-family: var(--serif); font-size: 15.5px; text-align: left; cursor: pointer; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 13px;
  vertical-align: middle;
  white-space: nowrap;
  color: var(--ink-2);
}
.badge::before { content: ""; width: 8px; height: 8px; flex: none; background: var(--badge, transparent); }
.badge:not([data-status]):not([data-mode]) { padding: 1px 7px; border: 1px solid var(--rule); color: var(--muted); font-size: 12px; }
.badge:not([data-status]):not([data-mode])::before { display: none; }
.badge + .badge { margin-left: 12px; }
.badge[data-mode="RESTRICTED_WHITELIST"], .badge[data-status="whitelist"] { --badge: var(--map-whitelist); }
.badge[data-mode="FULL_ACCESS"], .badge[data-status="open"] { --badge: var(--map-open); }
.badge[data-status="mixed"] { --badge: var(--map-mixed); }
.badge[data-mode="OFFLINE"], .badge[data-status="offline"] { --badge: var(--gray); }
.badge[data-mode="UNKNOWN"], .badge[data-status="nodata"] { --badge: var(--nodata); color: var(--muted); }

/* =========================================================== методика */

.method { padding-bottom: 64px; }
.method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.method-item h3 { display: flex; gap: 12px; align-items: baseline; font-family: var(--serif); font-weight: 700; font-size: 20px; line-height: 1.25; }
.method-item h3 span { font-family: var(--mono); font-weight: 400; font-size: 13px; color: var(--red); }
.method-item p { margin-top: 10px; color: var(--ink-2); font-size: 14.5px; }

/* ============================================================ статьи */

.articles-teaser { padding-bottom: 64px; }
.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.article-grid .article-item { border-top: 1px solid var(--rule); padding-top: 14px; }
.article-item h2, .article-item h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; }
.article-item h2 { font-size: 26px; }
.article-item h3 { font-size: 20px; }
.article-item a { text-decoration: none; }
.article-item a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.article-meta { margin-bottom: 8px; color: var(--muted); font-size: 12.5px; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.article-summary { margin-top: 8px; color: var(--ink-2); }

.articles { padding-bottom: 72px; }
.article-list { display: grid; border-top: 2px solid var(--rule-strong); max-width: 860px; }
.article-list .article-item { padding: 24px 0; border-bottom: 1px solid var(--rule); }

.article { padding-top: 40px; padding-bottom: 72px; }
.article-head { max-width: 860px; }
.article-head .kicker { margin-bottom: 14px; }
.article .headline { max-width: 26ch; }
.draft-banner { margin-bottom: 24px; padding: 10px 14px; border: 1px dashed var(--amber); color: var(--ink-2); font-size: 14px; }

/* Текст статьи: шрифт с засечками и спокойная мера строки — для чтения, а не просмотра. */
.prose { max-width: 68ch; margin-top: 36px; font-family: var(--serif); font-size: 19px; line-height: 1.7; color: var(--ink); }
.prose > * + * { margin-top: 1em; }
.prose h2 { margin-top: 1.8em; font-size: 28px; font-weight: 700; line-height: 1.2; }
.prose h3 { margin-top: 1.5em; font-size: 22px; font-weight: 700; line-height: 1.25; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.35em; }
.prose blockquote { margin-left: 0; padding-left: 20px; border-left: 3px solid var(--red); color: var(--ink-2); font-style: italic; }
.prose code { font-family: var(--mono); font-size: 0.82em; padding: 1px 5px; background: var(--paper-2); }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2em 0; }
.prose a { text-decoration-color: var(--red); }
.back-link { margin-top: 48px; font-size: 15px; }
a.lang-btn { text-decoration: none; display: inline-block; }

/* ======================================================= посещаемость */

.bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 8px; border-bottom: 1px solid var(--rule-strong); }
.bar { flex: 1; min-height: 1px; background: var(--ink); opacity: 0.85; }
.bar:last-child { background: var(--red); opacity: 1; }
.bar:hover { opacity: 1; }
.bars-axis { display: flex; justify-content: space-between; margin-top: 6px; color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.stat.stat-live .stat-value { color: var(--green); }
.stat.stat-live .stat-label::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--green); animation: live 2.4s ease-in-out infinite; }

/* ============================================================ подвал */

.colophon { margin-top: auto; border-top: 1px solid var(--rule-strong); }
.colophon-inner { display: grid; grid-template-columns: 1fr; gap: 24px; padding-top: 22px; padding-bottom: 28px; color: var(--muted); font-size: 13px; }
.colophon strong { color: var(--ink); font-weight: 600; }
.colophon-main { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 24px; }
.colophon-main p { margin: 0; }
.colophon-domain { font-family: var(--mono); color: var(--ink); text-decoration: none; }
.colophon-domain:hover { text-decoration: underline; text-underline-offset: 3px; }
/* Оговорка о границах карты — внизу страницы, мелко, с образцом пунктира Крыма и Севастополя. */
.colophon-note { display: flex; gap: 10px; align-items: flex-start; max-width: 78ch; margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.dashed-swatch { width: 18px; height: 12px; flex: none; margin-top: 2px; border: 1.2px dashed var(--muted); }

/* ============================================================== формы */

.input, select.input, textarea.input {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border-radius: 2px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}
.input:hover { border-color: var(--faint); }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
textarea.input { min-height: 96px; resize: vertical; font-family: var(--mono); font-size: 13px; }
textarea.article-body-input { min-height: 340px; line-height: 1.6; }
.input.search { width: 280px; border-width: 0 0 1px; border-color: var(--ink); padding-left: 0; background: transparent; }
.input.search:focus { box-shadow: 0 1px 0 var(--ink); }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field .hint { font-size: 12px; font-weight: 400; color: var(--faint); }
.field.check { display: flex; align-items: center; gap: 9px; font-weight: 400; color: var(--ink); }
.field.check input { width: 16px; height: 16px; accent-color: var(--ink); }
.field .changed { margin-left: 6px; font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--amber); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 20px; align-items: start; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 26px; padding: 14px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.form-actions { display: flex; gap: 14px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.form-error { min-height: 1em; color: var(--red); font-size: 13.5px; }

/* ============================================================ диалоги */

.dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 26px;
  border-radius: 0;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
}
.dialog.wide { width: min(800px, calc(100vw - 32px)); }
.dialog h2, .dialog-title { font-family: var(--serif); font-weight: 700; font-size: 26px; line-height: 1.15; }
.dialog .kicker { margin-bottom: 6px; }
.dialog::backdrop { background: rgba(18, 18, 17, 0.5); }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  max-width: min(440px, calc(100vw - 48px));
  padding: 12px 16px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 14px;
  box-shadow: var(--shadow);
}
.toast.error { background: var(--red); color: #fff; }

.locked { padding-top: 64px; padding-bottom: 64px; display: grid; gap: 16px; justify-items: start; }

/* ========================================================= админ-панель */

.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-top: 36px; padding-bottom: 20px; }
.admin-head .kicker { margin-bottom: 10px; }

.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--rule-strong); margin-bottom: 28px; overflow-x: auto; }
.tab {
  padding: 10px 0;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--red); }

.admin-content { display: grid; gap: 40px; padding-bottom: 64px; }
.panel { display: grid; gap: 18px; padding-top: 12px; border-top: 2px solid var(--rule-strong); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { font-family: var(--serif); font-weight: 700; font-size: 22px; line-height: 1.2; }
.panel p { max-width: 80ch; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.stat { padding: 14px 16px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.stat-label { color: var(--muted); font-size: 12.5px; }
.stat-value { margin-top: 4px; font-family: var(--mono); font-size: 24px; font-weight: 500; letter-spacing: -0.02em; }

.code-list { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.code-list span { font-size: 13.5px; color: var(--ink-2); }
.code-list span::before { content: "— "; color: var(--faint); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar .input { width: auto; min-width: 160px; }
.toolbar .grow { flex: 1 1 240px; }

.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; color: var(--muted); font-size: 13px; font-family: var(--mono); }

.ops { list-style: none; padding: 0; margin: 12px 0 0; display: grid; }
.ops li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.op-meta { color: var(--muted); font-size: 12.5px; }

.region-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 4px 14px;
  max-height: 260px;
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid var(--rule);
}
.region-picker label { display: flex; gap: 7px; align-items: center; font-size: 13px; color: var(--ink); }
.region-picker .district { grid-column: 1 / -1; margin-top: 8px; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }

.pool-card { display: grid; gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.pool-card h3 { font-family: var(--serif); font-weight: 700; font-size: 19px; }
.pool-card .kv { margin-top: 4px; }
.pool-template { word-break: break-all; color: var(--muted); font-family: var(--mono); font-size: 12.5px; }

/* Список «ключ — значение» в карточке пула: простая сетка, без отбивки. */
dl.kv:not(.leaders) { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; }
dl.kv:not(.leaders) dt { color: var(--muted); }
dl.kv:not(.leaders) dd { font-family: var(--sans); font-size: 14px; font-weight: 400; }

/* ============================================================ адаптив */

@media (max-width: 1100px) {
  .article-grid { grid-template-columns: 1fr; gap: 20px; }
  .atlas { grid-template-columns: 1fr; gap: 32px; }
  .dossier { position: static; border-left: 0; padding-left: 0; border-top: 2px solid var(--rule-strong); padding-top: 14px; }
  .method-grid { grid-template-columns: 1fr; gap: 28px; }
  .colophon-inner { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 760px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .topline-left { display: none; }
  .topline-inner { justify-content: flex-end; }
  .masthead-inner { gap: 14px; min-height: 54px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .wordmark { font-size: 20px; }
  .nav { order: 3; width: 100%; gap: 20px; overflow-x: auto; }
  #theme-label { display: none; }
  .lead { padding-top: 26px; padding-bottom: 26px; }
  .dek { font-size: 16px; }
  .unitbar { gap: 1px; height: 28px; margin-top: 24px; }
  .map { aspect-ratio: 4 / 3; }
  .map-btn.wide { display: none; }
  .input.search { width: 100%; }
  .regions .table-wrap { max-height: none; }
  .table th, .table td { padding-right: 10px; }
  .table .hide-sm { display: none; }
  .prose { font-size: 17.5px; }
  .article-item h2 { font-size: 22px; }
}
