/* app/static/style.css — дизайн-система Notabit «Афиша».
   Единственный файл оформления сайта и админки. Правила: docs/redesign.md и
   раздел «Дизайн» в CLAUDE.md. Порядок: 1 шрифты · 2 токены · 3 тёмная тема ·
   4 основа · 5 каркас · 6 компоненты · 7 таблицы · 8 страницы · 9 админка ·
   10 движение. Цвета — только через токены; новые компоненты — сюда, не в шаблон. */

/* 1. Шрифты — Geist и Geist Mono (OFL, app/static/fonts/OFL-Geist.txt), вариативные,
   урезаны до нужных символов и оси 400–600 (devtools/fonts_subset.sh, ~44 КБ на все
   четыре); кириллица и латиница отдельными файлами — браузер качает только нужный. */
@font-face { font-family: "Geist"; src: url(/static/fonts/geist-cyrillic.woff2) format("woff2"); font-weight: 400 600; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Geist"; src: url(/static/fonts/geist-latin.woff2) format("woff2"); font-weight: 400 600; font-display: swap; unicode-range: U+0020-007E, U+00A0-00BF, U+00D7, U+00F7, U+2010-2014, U+2018-201E, U+2022, U+2026, U+2032-2033, U+2039-203A, U+20BD, U+2122, U+2190-2193, U+2212; }
@font-face { font-family: "Geist Mono"; src: url(/static/fonts/geist-mono-cyrillic.woff2) format("woff2"); font-weight: 400 600; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Geist Mono"; src: url(/static/fonts/geist-mono-latin.woff2) format("woff2"); font-weight: 400 600; font-display: swap; unicode-range: U+0020-007E, U+00A0-00BF, U+00D7, U+00F7, U+2010-2014, U+2018-201E, U+2022, U+2026, U+2032-2033, U+2039-203A, U+20BD, U+2122, U+2190-2193, U+2212; }

/* Запасные шрифты с подогнанными метриками: пока Geist грузится, текст набран
   системным шрифтом той же ширины и высоты строки — подмена не двигает таблицу
   (CLS). Метрики сняты с woff2 (devtools: fontTools): Geist — ascent 1005,
   descent 295, средняя строчная 0,534 em (Arial ≈ 0,5); Geist Mono — 0,6 em. */
@font-face { font-family: "Geist Fallback"; src: local("Arial"), local("Helvetica Neue"), local("Helvetica"), local("Liberation Sans"), local("Roboto"); size-adjust: 106.7%; ascent-override: 94.2%; descent-override: 27.6%; line-gap-override: 0%; }
@font-face { font-family: "Geist Mono Fallback"; src: local("Courier New"), local("Liberation Mono"), local("DejaVu Sans Mono"), local("Menlo"); size-adjust: 100%; ascent-override: 100.5%; descent-override: 29.5%; line-gap-override: 0%; }

/* 2. Токены (светлая тема) */
:root {
  color-scheme: light;
  /* поверхности */
  --bg: #ffffff;
  --bg-alt: #f3f4f7;          /* наведение строки, панели, поле ввода */
  --band: #1a2551;            /* фирменная тёмно-синяя плашка: шапка, подвал */
  --band-2: #222e63;          /* наведение на плашке */
  --mint: #3ddc84;            /* фирменный мятный: плашка ответа, акцент на синем */
  /* текст */
  --ink: #12172e;             /* основной текст, линии-разделители разделов */
  --muted: #555b6e;           /* подписи, даты, вторичное (6,8:1 на белом) */
  --on-band: #ffffff;
  --on-band-muted: #c5c9d8;   /* 8,9:1 на --band */
  --on-mint: #12172e;
  /* линии */
  --line: #dfe1e7;            /* разделители строк */
  --line-strong: #8b90a1;     /* рамки полей ввода — 3:1 к фону */
  --flag-ring: rgba(18, 23, 46, .16); /* контур флагов, чтобы белые полосы не сливались с фоном */
  /* смысловые — строго по назначению */
  --up: #0f7a3f;              /* рост позиции; успех */
  --down: #c4261d;            /* падение позиции; ошибка */
  --warn: #8a5a00;            /* предупреждение (статус «отстаёт») */
  --new-bg: #1a2551;          /* метка «NEW» — нейтральная, не смысловая */
  --new-fg: #ffffff;
  --focus: #1a2551;
  --focus-on-band: #3ddc84;
  --primary-bg: #1a2551;      /* единственная залитая кнопка экрана */
  --primary-fg: #ffffff;
  /* серии графиков (dataviz-валидатор: CVD и контраст проходят) */
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100; --series-5: #e87ba4;

  /* шрифт */
  --font: "Geist", "Geist Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", "Geist Mono Fallback", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  /* шкала размеров (компьютер; телефон — ниже, в @media) */
  --t-display: 60px;          /* H1 ключевых страниц */
  --t-h1: 44px;               /* H1 остальных страниц */
  --t-h2: 28px;
  --t-h3: 20px;
  --t-lead: 20px;             /* ответ первым экраном */
  --t-body: 16px;
  --t-small: 14px;
  --t-label: 13px;            /* моно-подписи; меньше — нельзя */
  --t-num-xl: 40px;           /* места первой десятки */
  --t-num: 22px;              /* места */
  --t-stat: 44px;             /* крупные цифры в плашке */
  /* отступы */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
  --s-7: 48px; --s-8: 64px; --s-9: 96px;
  /* сетка */
  --wrap: 1280px;
  --gut: 40px;
  --header-h: 72px;
  --tap: 44px;                /* минимальная цель касания */
  /* формы: Swiss — прямые углы */
  --r: 0;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* 3. Тёмная тема — по системной настройке, своими ступенями, а не инверсией */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0d1020;
    --bg-alt: #161a2e;
    --band: #131938;
    --band-2: #1c2350;
    --ink: #eef0f6;
    --muted: #a3a9bd;
    --on-band-muted: #c5c9d8;
    --line: #262b42;
    --line-strong: #6b7189;
    --flag-ring: rgba(238, 240, 246, .2);
    --up: #4ade80;
    --down: #ff7b72;
    --warn: #f5b84a;
    --new-bg: #3ddc84;
    --new-fg: #0d1020;
    --focus: #3ddc84;
    --primary-bg: #3ddc84;
    --primary-fg: #0d1020;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181;
  }
}

/* 4. Основа */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  font: 400 var(--t-body)/1.55 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01" 0;
  overflow-x: hidden;   /* длинные названия переносятся, широкое скроллится в .table-scroll */
  overflow-wrap: break-word;   /* слово без пробелов (бывают и в названиях треков) не распирает страницу */
}
img, svg { max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 var(--s-4); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-size: var(--t-h1); line-height: 1.05; font-weight: 600; letter-spacing: -0.045em; }
h2 { font-size: var(--t-h2); line-height: 1.15; font-weight: 600; letter-spacing: -0.03em; margin: var(--s-7) 0 var(--s-4); }
h3 { font-size: var(--t-h3); line-height: 1.25; font-weight: 600; letter-spacing: -0.02em; margin: var(--s-5) 0 var(--s-3); }
h2 a, h3 a { text-decoration: none; }
strong, b { font-weight: 600; }
code { font: 500 0.92em var(--mono); background: var(--bg-alt); padding: 1px 5px; }
ul, ol { padding-left: var(--s-5); }

/* Ссылки: в тексте — подчёркнуты (WCAG 1.4.1: в абзаце нельзя опираться только на
   цвет); в таблицах и навигации подчёркивание появляется при наведении. */
.content p:not(.derived-nav):not(.see-also):not(.listen) a, .prose a, .lead a, .day-facts a, .source-note a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.content p:not(.derived-nav):not(.see-also):not(.listen) a:hover, .prose a:hover, .lead a:hover, .source-note a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.site-header :focus-visible, .site-footer :focus-visible, .band-mint :focus-visible { outline-color: var(--focus-on-band); }
.band-mint :focus-visible { outline-color: var(--ink); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; left: var(--s-4); top: -80px; z-index: 100;
  padding: var(--s-3) var(--s-4); background: var(--mint); color: var(--on-mint); font-weight: 600;
}
.skip-link:focus { top: var(--s-2); }

.muted { color: var(--muted); }
.small { font-size: var(--t-small); }
.label { font: 500 var(--t-label)/1.4 var(--mono); color: var(--muted); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* 5. Каркас */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
.content { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut) var(--s-8); }

/* Шапка — фирменная синяя плашка */
.site-header { background: var(--band); color: var(--on-band); }
.header-row { display: flex; align-items: center; gap: var(--s-4); min-height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--on-band); flex: none; }
.logo-mark { display: block; width: 32px; height: 32px; flex: none; }
.logo-word { font: 600 24px/1 var(--font); letter-spacing: -0.045em; }
.main-nav { display: flex; gap: var(--s-4); }
.main-nav a {
  position: relative; padding: var(--s-2) 0; font-size: 15px; font-weight: 500; white-space: nowrap;
  color: var(--on-band-muted); transition: color .15s;
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; background: var(--mint);
  transform: scaleX(0); transform-origin: left; transition: transform .2s var(--ease);
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--on-band); }
.main-nav a:hover::after, .main-nav a[aria-current="page"]::after { transform: scaleX(1); }
.header-tools { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; min-width: 0; flex: 0 1 auto; }
.header-tools > .btn { flex: none; }
.site-search { position: relative; width: 220px; flex: 0 1 220px; min-width: 150px; margin: 0; }
.site-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--on-band-muted); pointer-events: none; }
.site-search input[type="search"] {
  width: 100%; height: var(--tap); padding: 0 var(--s-3) 0 40px;
  font: 400 16px var(--font); color: var(--on-band);
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .32); border-radius: var(--r);
  transition: background .15s, border-color .15s;
}
.site-search input[type="search"]::placeholder { color: var(--on-band-muted); opacity: 1; }
.site-search input[type="search"]:hover { border-color: rgba(255, 255, 255, .6); }
.site-search input[type="search"]:focus { outline: 3px solid var(--focus-on-band); outline-offset: 0; background: rgba(255, 255, 255, .12); }
.header-cta { flex: none; }

/* Меню для телефона и планшета — <details>, работает без JS */
.menu { display: none; position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 14px); z-index: 50; width: min(320px, calc(100vw - 2 * var(--gut)));
  background: var(--band); border: 1px solid rgba(255, 255, 255, .2); padding: var(--s-2) 0;
  box-shadow: 0 16px 40px rgba(5, 8, 20, .35);
}
.menu-panel a {
  display: flex; align-items: center; min-height: 52px; padding: 0 var(--s-5);
  font-size: 17px; font-weight: 500; color: var(--on-band); border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.menu-panel a:last-child { border-bottom: 0; }
.menu-panel a:hover, .menu-panel a[aria-current="page"] { background: var(--band-2); }
.menu-panel a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--mint); }

/* Хлебные крошки */
.crumbs {
  display: block;   /* строчный поток: разделитель не повисает отдельной строкой между длинными названиями */
  width: 100%; max-width: var(--wrap); margin: 0 auto; padding: var(--s-5) var(--gut) 0;
  font: 400 var(--t-label)/1.5 var(--mono); color: var(--muted);
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.crumbs .sep { opacity: .6; margin: 0 var(--s-2); }
.crumbs span:last-child { color: var(--ink); }

/* Подвал — синяя плашка со словесным знаком */
.site-footer { margin-top: var(--s-8); background: var(--band); color: var(--on-band-muted); font-size: var(--t-small); }
.footer-inner { padding-top: var(--s-7); padding-bottom: var(--s-6); }
.footer-word { display: flex; align-items: center; gap: var(--s-3); margin: 0 0 var(--s-6); color: var(--on-band); font: 600 64px/1 var(--font); letter-spacing: -0.055em; }
.footer-word .logo-mark { width: 56px; height: 56px; }
.footer-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.4fr); gap: var(--s-6); }
.footer-cols h2 { margin: 0 0 var(--s-3); font: 500 var(--t-label)/1.4 var(--mono); color: var(--on-band-muted); letter-spacing: 0; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer-cols li { margin: 0 0 var(--s-2); }
.footer-cols a { color: var(--on-band); }
.footer-cols a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 6. Компоненты */

/* Кнопки: одна основная (залитая) на экран + вторичная (рамка). На синей плашке —
   инверсная вторичная. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--tap); padding: 0 var(--s-5); border: 2px solid var(--ink); border-radius: var(--r);
  font: 600 16px/1 var(--font); color: var(--ink); background: transparent; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary-bg); border-color: var(--primary-bg); color: var(--primary-fg); }
.btn--primary:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn--inverse { border-color: rgba(255, 255, 255, .7); color: var(--on-band); }
.btn--inverse:hover { background: var(--on-band); border-color: var(--on-band); color: var(--band); }
.btn--sm { min-height: 36px; padding: 0 var(--s-4); font-size: 14px; border-width: 1px; }
.btn .icon { width: 18px; height: 18px; flex: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.icon { display: inline-block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

/* Флаги стран: SVG-спрайт /static/flags.svg, прямые углы (--r: 0) */
.flag { display: inline-block; width: 18px; height: 12px; flex: none; vertical-align: -0.1em; box-shadow: 0 0 0 1px var(--flag-ring); }
.flag--sm { width: 15px; height: 10px; }
.flag--lg { width: 22px; height: 15px; }
.flag--global { box-shadow: none; color: var(--muted); }
.with-flag { display: inline-flex; align-items: center; gap: var(--s-2); }
.kicker .flag { margin-right: 6px; vertical-align: -0.12em; }
td.chart-tag .flag, td.track .flag { margin-right: 6px; vertical-align: -0.08em; }

/* Шапка страницы: кикер, H1, справа — дата; снизу толстая линия */
.page-head { padding: var(--s-6) 0 var(--s-5); border-bottom: 3px solid var(--ink); margin-bottom: var(--s-5); }
.page-head--split { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-6); align-items: end; }
/* крупный кегль — у ключевых страниц (чарт, главная, трек): .page-head--split или
   h1.display; у подстраниц (движения, рекорды…) заголовки длинные — обычный H1 */
.page-head h1 { font-size: var(--t-h1); line-height: 1.05; }
.page-head--split h1, .page-head h1.display { font-size: var(--t-display); line-height: 1; letter-spacing: -0.05em; }
.page-head h1.h1--long { font-size: var(--t-h1); line-height: 1.08; }
.page-head .lead { margin: var(--s-4) 0 0; }
.page-head h1 + .day-facts, .page-head h1 + .date-nav, .page-head h1 + p { margin-top: var(--s-4); }
.page-head .day-facts + .date-nav { margin-top: var(--s-4); }
.kicker { margin: 0 0 var(--s-3); font: 500 var(--t-label)/1.4 var(--mono); color: var(--muted); }
.kicker a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* Дата крупно + навигация по дням */
.datebox { text-align: right; }
.big-date { display: block; margin: 0; font: 500 80px/.9 var(--mono); letter-spacing: -0.06em; }
.date-nav {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: var(--s-1) var(--s-4);
  margin: var(--s-3) 0 0; padding: 0; border: 0; font-size: var(--t-small);
}
.datebox .date-nav { justify-content: flex-end; }
.date-nav a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.date-nav a:hover { text-decoration-thickness: 2px; }
.date-nav .current { font-weight: 600; }

/* Ответ первым экраном */
.lead { font-size: var(--t-lead); line-height: 1.45; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); max-width: 62ch; margin: 0 0 var(--s-5); }
.day-facts { margin: 0; font-size: var(--t-lead); line-height: 1.45; font-weight: 500; letter-spacing: -0.01em; max-width: 56ch; }
.source-note { margin: var(--s-4) 0 0; font-size: var(--t-small); color: var(--muted); }

/* Мятная плашка — ОДНА на странице: главный ответ (лидер дня, позиция трека) */
.band-mint {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-5); align-items: center;
  margin: 0 0 var(--s-5); padding: var(--s-5); background: var(--mint); color: var(--on-mint);
}
.band-mint .cover { display: block; width: 120px; height: 120px; object-fit: cover; }
.band-mint a:hover { text-decoration-thickness: 2px; }
.band-mint .day-facts a { text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* Крупные цифры с подписью */
.stats { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin: 0; }
.stats div { min-width: 64px; }
.stats dt { font: 500 var(--t-label)/1.3 var(--mono); }
.stats dd { margin: 0; font: 500 var(--t-stat)/1 var(--mono); letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }

/* Подразделы — сетка ячеек (бывшая цепочка ссылок через « · ») */
.derived-nav {
  display: flex; flex-wrap: wrap; margin: var(--s-5) 0; padding: 0;
  font-size: 0; /* прячет текстовые разделители « · » из макроса */
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.derived-nav a {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s-4);
  font-size: var(--t-small); font-weight: 500; line-height: 1.2; color: var(--ink);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transition: background .15s, color .15s;
}
.derived-nav a:hover { background: var(--ink); color: var(--bg); }
/* текущий пункт (на страницах, где он показан текстом, а не ссылкой) */
.derived-nav strong {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s-4);
  font-size: var(--t-small); font-weight: 600; background: var(--ink); color: var(--bg);
  border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
}
/* абзац ссылок с пояснениями (главная): ссылка жирная со стрелкой, пояснение — серым */
.intro-links { margin: 0 0 var(--s-5); color: var(--muted); font-size: var(--t-body); }
.intro-links a { color: var(--ink); font-weight: 600; text-decoration: none !important; }
.intro-links a:hover { text-decoration: underline !important; text-underline-offset: 3px; }

/* Метки */
.badge, .tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; vertical-align: 2px;
  font: 500 var(--t-label)/1.4 var(--mono); white-space: nowrap;
  background: var(--bg-alt); color: var(--muted); border-radius: var(--r);
}
.badge.now { background: transparent; color: var(--up); box-shadow: inset 0 0 0 1px currentColor; }
.tag-new { display: inline-block; padding: 2px 8px; font: 600 var(--t-label)/1.4 var(--mono); background: var(--new-bg); color: var(--new-fg); }

/* Изменение позиции */
.change-up { color: var(--up); }
.change-down { color: var(--down); }
.change-same { color: var(--muted); }
.change-new { color: var(--ink); }

/* Уведомления формы */
.suggest-ok, .suggest-error {
  margin: 0 0 var(--s-5); padding: var(--s-4) var(--s-5); border-left: 4px solid currentColor; background: var(--bg-alt);
}
.suggest-ok { color: var(--up); }
.suggest-error { color: var(--down); }
.suggest-ok > *, .suggest-error > * { color: var(--ink); }
.suggest-ok > :last-child, .suggest-error > :last-child, .empty > :last-child { margin-bottom: 0; }

/* Пустое состояние */
.empty { padding: var(--s-6) var(--s-5); border: 1px dashed var(--line-strong); color: var(--muted); }

/* Поля ввода */
label { font-weight: 600; font-size: var(--t-small); }
input[type="text"], input[type="search"], input[type="password"], input[type="date"], input[type="email"], select, textarea {
  font: 400 16px/1.4 var(--font); color: var(--ink); background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: var(--r); padding: var(--s-3) var(--s-3); min-height: var(--tap);
}
input:hover, select:hover, textarea:hover { border-color: var(--ink); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }
[aria-invalid="true"] { border-color: var(--down); box-shadow: inset 4px 0 0 var(--down); }
.field-error { margin: 0; font-size: var(--t-small); color: var(--down); }
textarea { resize: vertical; }

/* Списки ссылок «смотрите также» и связанные чарты */
.see-also { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 0 var(--s-6); margin-top: var(--s-7); border-top: 3px solid var(--ink); }
.see-also-group h2, .related > h2 { margin: var(--s-5) 0 var(--s-3); font-size: var(--t-h3); }
.see-also-group ul, .related ul { list-style: none; margin: 0; padding: 0; }
.see-also-group li, .related li { border-bottom: 1px solid var(--line); }
.see-also-group a, .related ul:not(.related-grid) a {
  display: flex; justify-content: space-between; align-items: center; min-height: var(--tap); gap: var(--s-3);
  font-weight: 500; transition: padding .15s var(--ease);
}
.see-also-group a::after, .related ul:not(.related-grid) a::after { content: "→"; color: var(--muted); transition: transform .15s var(--ease); }
.see-also-group a:hover, .related ul:not(.related-grid) a:hover { padding-left: 6px; }
.see-also-group a:hover::after, .related ul:not(.related-grid) a:hover::after { transform: translateX(2px); color: var(--ink); }

/* Встраивание */
.embed-wizard { margin: var(--s-6) 0 0; border-top: 1px solid var(--line); padding-top: var(--s-4); }
.embed-wizard summary { cursor: pointer; font-weight: 600; min-height: var(--tap); display: flex; align-items: center; }
.embed-wizard summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.embed-code {
  width: 100%; margin-top: var(--s-2); padding: var(--s-3);
  font: 400 13px/1.5 var(--mono); color: var(--ink); background: var(--bg-alt);
  border: 1px solid var(--line-strong); border-radius: var(--r); resize: vertical;
}
.updated { margin-top: var(--s-5); font: 400 var(--t-label) var(--mono); color: var(--muted); }

/* 7. Таблицы */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; position: relative; }
/* служебные таблицы (статус, админка) на узком экране листаются вбок внутри себя */
.table-scroll > table.keep-table { min-width: 640px; }
table.keep-table td { white-space: nowrap; }

/* position: relative — скрытые подписи заголовков (visually-hidden, абсолютные) остаются
   внутри таблицы и не растягивают страницу вбок */
table.chart { position: relative; width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.chart thead th {
  padding: var(--s-2) var(--s-3); text-align: left; white-space: nowrap;
  font: 500 var(--t-label)/1.4 var(--mono); color: var(--muted); border-bottom: 2px solid var(--ink);
}
table.chart td { padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--line); vertical-align: middle; }
table.chart tbody tr { transition: background .15s; }
table.chart tbody tr:hover { background: var(--bg-alt); }
td.pos { width: 72px; font: 500 var(--t-num)/1 var(--mono); letter-spacing: -0.04em; white-space: nowrap; }
tr.top td.pos { font-size: var(--t-num-xl); }
td.change { width: 72px; font: 500 15px/1.2 var(--mono); white-space: nowrap; }
td.art { width: 64px; }
td.art img { display: block; width: 48px; height: 48px; object-fit: cover; background: var(--bg-alt); }
tr.top td.art img { width: 56px; height: 56px; }
td.track > a { font-weight: 500; }
tr.top td.track > a { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
td.track a:hover, td.artist a:hover { text-decoration: underline; text-underline-offset: 3px; }
td.artist { color: var(--muted); width: 30%; }
td.track, td.artist, .neighbor-list, .rt-title, .rt-artist, .also-in, .cc-title, .cc-artist { overflow-wrap: anywhere; }
.also-in { display: block; margin-top: 2px; font-size: var(--t-label); color: var(--muted); }
.also-in a { font: 500 var(--t-label) var(--mono); }
.also-in a:hover { color: var(--ink); text-decoration: underline; }
.also-in .ai-plat { color: var(--ink); }
td[data-label]::before { content: none; }
td.meta { font-size: var(--t-small); color: var(--muted); white-space: nowrap; }
td.num, table.chart th.num { text-align: right; white-space: nowrap; }
td.num { font-family: var(--mono); }

/* Телефон: строка таблицы — сетка «место | обложка | трек над исполнителем»,
   доп. ячейки (пик, дни…) — строкой подписей под ними. Шапка таблицы остаётся в
   разметке для экранных дикторов, но визуально скрыта. */
@media (max-width: 640px) {
  body:not(.admin) table.chart:not(.keep-table) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  body:not(.admin) table.chart:not(.keep-table),
  body:not(.admin) table.chart:not(.keep-table) tbody { display: block; }
  body:not(.admin) table.chart:not(.keep-table) tr {
    display: grid; grid-template-columns: 40px auto repeat(3, minmax(0, max-content)) minmax(0, 1fr);
    column-gap: var(--s-3); row-gap: 4px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line);
  }
  body:not(.admin) table.chart:not(.keep-table) td { display: block; width: auto; min-width: 0; padding: 0; border: 0; grid-row: 3; font-size: var(--t-label); color: var(--muted); white-space: normal; }
  body:not(.admin) table.chart:not(.keep-table) td.pos { grid-column: 1; grid-row: 1 / span 3; font-size: var(--t-num); color: var(--ink); }
  body:not(.admin) table.chart:not(.keep-table) tr.top td.pos { font-size: 28px; }
  /* метка изменения — сразу под номером (в той же ячейке сетки, со сдвигом на высоту
     номера), а не под второй строкой длинного названия */
  body:not(.admin) table.chart:not(.keep-table) td.change { grid-column: 1; grid-row: 1 / span 2; margin-top: calc(var(--t-num) + 6px); font-size: var(--t-label); }
  body:not(.admin) table.chart:not(.keep-table) tr.top td.change { margin-top: 34px; }
  body:not(.admin) table.chart:not(.keep-table) td.change-up { color: var(--up); }
  body:not(.admin) table.chart:not(.keep-table) td.change-down { color: var(--down); }
  body:not(.admin) table.chart:not(.keep-table) td.art { grid-column: 2; grid-row: 1 / span 3; }
  body:not(.admin) table.chart:not(.keep-table) td.art img { width: 44px; height: 44px; }
  body:not(.admin) table.chart:not(.keep-table) tr.top td.art img { width: 52px; height: 52px; }
  body:not(.admin) table.chart:not(.keep-table) td.track { grid-column: 3 / -1; grid-row: 1; font-size: var(--t-body); line-height: 1.35; color: var(--ink); }
  body:not(.admin) table.chart:not(.keep-table) tr.top td.track > a { font-size: 17px; }
  body:not(.admin) table.chart:not(.keep-table) td.artist { grid-column: 3 / -1; grid-row: 2; font-size: var(--t-small); }
  /* зона нажатия ссылок ≥ 24 px (WCAG 2.5.8) — отступом, без сдвига строк */
  /* название тянет зону вверх, исполнитель — вниз: обе ≥ 24 px и не перекрываются */
  body:not(.admin) table.chart:not(.keep-table) td.track > a,
  body:not(.admin) table.chart:not(.keep-table) td.artist a { display: inline; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
  body:not(.admin) table.chart:not(.keep-table) td.track > a { padding: 4px 0 0; }
  body:not(.admin) table.chart:not(.keep-table) td.artist a { padding: 0 0 4px; }
  /* с 11-й позиции — плотнее: длинный хвост чарта листают, а не разглядывают */
  body:not(.admin) table.chart:not(.keep-table) tbody tr:not(.top) { padding: 8px 0; }
  body:not(.admin) table.chart:not(.keep-table) tr:not(.top) td.art img { width: 36px; height: 36px; }
  body:not(.admin) table.chart:not(.keep-table) tr:not(.top) td.track { font-size: 15px; line-height: 1.35; }
  body:not(.admin) table.chart:not(.keep-table) tr:not(.top) td.artist { font-size: var(--t-label); }
  body:not(.admin) table.chart:not(.keep-table) tr:not(.top) td.pos { font-size: 18px; }
  body:not(.admin) table.chart:not(.keep-table) tr:not(.top) td.change { margin-top: 22px; }
  body:not(.admin) table.chart:not(.keep-table) td[data-label]::before { content: attr(data-label) " "; }
  /* таблица исполнителей (без колонки трека): имя — главной строкой */
  body:not(.admin) table.chart:not(.keep-table) tr:not(:has(td.track)) td.artist { grid-row: 1; font-size: var(--t-body); font-weight: 500; color: var(--ink); }
  body:not(.admin) table.chart:not(.keep-table) tr:not(:has(td.track)) td:not(.pos):not(.change):not(.art):not(.artist) { grid-row: 2; }
  body:not(.admin) table.chart:not(.keep-table) tr:not(:has(td.pos)):not(:has(td.art)) td.track { grid-column: 1 / -1; }
  /* строки без места (мини-таблицы главной, «По чартам» в динамике): метки изменения —
     в строку подписей, а не в колонку места */
  body:not(.admin) table.chart:not(.keep-table) tr:not(:has(td.pos)) td.change { grid-column: auto; grid-row: 3; margin-top: 0; }
  /* таблица без колонки места (рекорды, №1) — обложка встаёт к левому краю */
  body:not(.admin) table.chart:not(.keep-table) tr:not(:has(td.pos)) td.art { grid-column: 1 / span 2; }
  body:not(.admin) table.chart:not(.keep-table) td:empty { display: none; }
  body:not(.admin) table.chart:not(.keep-table) td.chart-tag { white-space: normal; }
  body:not(.admin) table.chart:not(.keep-table) td.chart-tag a { display: inline-block; padding: 4px 0; }
  /* второстепенные колонки, которые на телефоне не показываем (есть на карточке трека) */
  body:not(.admin) table.chart:not(.keep-table) td.cis-where,
  body:not(.admin) table.chart:not(.keep-table) td.year-days { display: none; }
  .also-in { display: none; }
}

/* Кросс-таблица «страна × площадка» */
table.cross { border-collapse: collapse; min-width: 100%; margin: var(--s-3) 0; font-variant-numeric: tabular-nums; }
table.cross th, table.cross td { border: 1px solid var(--line); padding: var(--s-2) var(--s-3); text-align: center; }
table.cross thead th { font: 500 var(--t-label)/1.4 var(--mono); color: var(--muted); white-space: nowrap; border-bottom: 2px solid var(--ink); }
table.cross th[scope="row"] { text-align: left; white-space: nowrap; font-weight: 600; }
.cp-cell { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.25; padding: var(--s-1); }
.cp-cell .cp-pos { font: 500 18px/1.2 var(--mono); }
.cp-cell.now .cp-pos { color: var(--up); text-decoration: underline; text-underline-offset: 3px; }
.cp-cell .cp-peak { font: 400 var(--t-label) var(--mono); color: var(--muted); }
.cp-cell:hover .cp-pos { text-decoration: underline; }

/* Графики (SVG рисует сервер; цвета — токенами, тёмная тема подхватывается) */
svg.history-chart { display: block; margin: var(--s-3) 0; max-width: 100%; height: auto; color: var(--ink); }
svg.history-chart .line { stroke: var(--ink); stroke-width: 2; }
svg.history-chart .area { fill: var(--mint); opacity: .35; }
svg.history-chart .grid, svg.multi-chart .grid { stroke: var(--line); stroke-width: 1; }
svg.history-chart .axis, svg.multi-chart .axis { fill: var(--muted); font: 400 11px var(--mono); }
svg.history-chart .dot { fill: var(--ink); }
svg.history-chart .dot.peak { fill: var(--up); }
svg.history-chart .dot.current { fill: var(--bg); stroke: var(--ink); stroke-width: 2; }
svg.spark { width: 160px; height: 32px; flex: none; background: var(--bg-alt); }
svg.spark .line { stroke: var(--ink); stroke-width: 3; }
svg.spark .area { fill: var(--mint); opacity: .4; }
.multi-chart { max-width: 100%; height: auto; }
.multi-chart .s1 { stroke: var(--series-1); fill: var(--series-1); }
.multi-chart .s2 { stroke: var(--series-2); fill: var(--series-2); }
.multi-chart .s3 { stroke: var(--series-3); fill: var(--series-3); }
.multi-chart .s4 { stroke: var(--series-4); fill: var(--series-4); }
.multi-chart .s5 { stroke: var(--series-5); fill: var(--series-5); }
.multi-chart polyline[class] { fill: none; }
ul.multi-legend { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); font-size: var(--t-small); color: var(--ink); }
ul.multi-legend li { display: flex; align-items: center; gap: 6px; }
.multi-legend .swatch { width: 12px; height: 12px; display: inline-block; flex: none; }
.multi-legend .s1 { background: var(--series-1); } .multi-legend .s2 { background: var(--series-2); }
.multi-legend .s3 { background: var(--series-3); } .multi-legend .s4 { background: var(--series-4); }
.multi-legend .s5 { background: var(--series-5); }
.chart-tip {
  position: absolute; z-index: 20; transform: translate(-50%, -100%);
  padding: 4px 8px; font: 500 var(--t-label) var(--mono); white-space: nowrap; pointer-events: none;
  background: var(--band); color: var(--on-band);
}
.graph-fold { margin: var(--s-2) 0; }
.graph-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--s-3); min-height: var(--tap); }
.graph-fold > summary::-webkit-details-marker { display: none; }
.graph-fold > summary:hover .fold-label { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.fold-label { font-size: var(--t-small); color: var(--muted); }
.graph-fold[open] .fold-open { display: none; }
.graph-fold:not([open]) .fold-close { display: none; }

/* 8. Страницы */

/* Главная: карточки чартов с №1 */
.platform-block { margin: var(--s-7) 0 0; padding-top: var(--s-4); border-top: 3px solid var(--ink); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: var(--s-4) var(--s-5); align-items: start; }
.platform-block > h2 { grid-column: 1 / -1; margin: 0; }
.country-group { min-width: 0; }
.country-group h3 { margin: 0 0 var(--s-2); font-size: var(--t-small); font-family: var(--mono); font-weight: 500; color: var(--muted); line-height: 1.35; }
.country-group h3 a { display: inline-flex; align-items: center; gap: var(--s-2); max-width: 100%; }
.country-group h3 a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.country-group ul, .chart-list { list-style: none; margin: 0; padding: 0; }
/* «Итоги года»: годы — крупные строки-ссылки */
.year-list li { border-bottom: 1px solid var(--line); }
.year-list a { display: flex; justify-content: space-between; align-items: center; min-height: 72px; font: 600 var(--t-h2)/1.1 var(--font); letter-spacing: -0.03em; transition: padding .15s var(--ease); }
.year-list a::after { content: "→"; font-family: var(--mono); color: var(--muted); }
.year-list a:hover { padding-left: 8px; }
h1 .h1-note { font-size: 0.45em; font-weight: 500; letter-spacing: -0.01em; color: var(--muted); }
.search-form input[type="search"] { min-height: 52px; font-size: 18px; }
.search-form .btn { min-height: 52px; }
ul.chart-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); grid-auto-rows: 1fr; gap: var(--s-3); }
.country-group ul.chart-cards { grid-template-columns: 1fr; grid-auto-rows: auto; }
ul.chart-cards > li { min-width: 0; display: flex; flex-direction: column; min-height: 136px; padding: var(--s-4); border: 1px solid var(--line); background: var(--bg); transition: transform .15s var(--ease), border-color .15s; }
ul.chart-cards > li:hover { transform: translateY(-2px); border-color: var(--ink); }
.cc-chart { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; margin: 0 0 var(--s-3); font-weight: 600; line-height: 1.3; min-height: 2.6em; }
.cc-chart:hover { text-decoration: underline; text-underline-offset: 3px; }
.cc-lead { display: flex; gap: var(--s-3); align-items: center; margin-top: auto; }
.cc-lead img { flex: none; width: 48px; height: 48px; object-fit: cover; }
.cc-meta { min-width: 0; line-height: 1.3; }
.cc-title { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-lead:hover .cc-title { text-decoration: underline; text-underline-offset: 3px; }
.cc-num { font-family: var(--mono); color: var(--muted); margin-right: 4px; }
.cc-artist { display: block; font-size: var(--t-small); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Страница площадки: страны сеткой ячеек */
.country-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); grid-auto-rows: 1fr; gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.country-grid .country-group { display: flex; flex-direction: column; padding: var(--s-4) var(--s-5); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.country-grid .country-group h2 { margin: 0 0 var(--s-2); font-size: var(--t-h3); }
.country-grid .country-group h2 a { display: inline-flex; align-items: center; gap: var(--s-2); }
.country-grid .country-group h2 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.country-grid .country-group ul { list-style: none; margin: 0; padding: 0; }
.country-grid .country-group li a { display: flex; justify-content: space-between; gap: var(--s-2); min-height: 36px; align-items: center; color: var(--muted); }
.country-grid .country-group li a::after { content: "→"; }
.country-grid .country-group li a:hover { color: var(--ink); }
.country-chart h2 a:hover, .country-artists h2 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.country-chart .more a { font-weight: 600; }
.country-chart .more a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Тизер «Сегодня в движении» */
.today-movers { margin: var(--s-6) 0; }
.today-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: var(--s-4) var(--s-6); }
.today-cols h3 { margin-top: 0; }
td.chart-tag { font: 400 var(--t-label) var(--mono); white-space: nowrap; color: var(--muted); }
td.chart-tag a:hover { color: var(--ink); text-decoration: underline; }

/* Карточка трека и исполнителя */
.track-head { display: flex; gap: var(--s-5); align-items: flex-end; }
.track-head > div { min-width: 0; }
.track-head .cover { flex: none; width: 160px; height: 160px; object-fit: cover; background: var(--bg-alt); }
.track-head .by { margin: var(--s-3) 0 0; font-size: 20px; font-weight: 500; }
ul.meta-facts { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-3); font-size: var(--t-label); color: var(--muted); }
ul.meta-facts li { min-width: 0; overflow-wrap: anywhere; }
ul.meta-facts .meta-val { color: var(--ink); }
ul.meta-facts .mono { font-family: var(--mono); }
.badge--explicit { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong, var(--line)); font-family: var(--mono); font-size: var(--t-label); font-weight: 600; padding: 0 6px; line-height: 1.5; }
.track-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-5); margin: var(--s-4) 0; }
.track-actions .listen { margin: 0; }
.preview-bar { display: flex; align-items: center; gap: var(--s-3); flex-wrap: nowrap; max-width: 100%; }
.preview-audio { max-width: 100%; height: var(--tap); }
.preview-btn { display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--tap); padding: 0 var(--s-4); font-size: var(--t-small); white-space: nowrap; }
.preview-btn[hidden], .preview-track[hidden], .preview-time[hidden], .preview-btn .icon[hidden] { display: none; }
.preview-btn .icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; }
.preview-btn.is-playing { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.preview-track { position: relative; width: 140px; height: 8px; background: var(--line); cursor: pointer; flex: none; }
.preview-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--ink); transition: width 120ms linear; }
.preview-time { font-family: var(--mono); font-size: var(--t-label); color: var(--muted); min-width: 40px; }
.watch-wrap { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.watch-btn { display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--tap); padding: 0 var(--s-4); font-size: var(--t-small); white-space: nowrap; }
.watch-btn .icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.watch-btn.is-watching { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.watch-status[hidden] { display: none; }
.watch-status.is-error { color: var(--down); }
.watchlist-section { margin: var(--s-5) 0; }
ul.watch-list, ul.watch-events { list-style: none; margin: var(--s-3) 0 0; padding: 0; border-top: 1px solid var(--line); }
ul.watch-list li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
ul.watch-list li > a { display: flex; align-items: center; gap: var(--s-3); min-width: 0; flex: 1 1 180px; font-weight: 500; }
ul.watch-list li > a > span { min-width: 0; overflow-wrap: anywhere; }
ul.watch-list li > a:hover { text-decoration: underline; text-underline-offset: 3px; }
ul.watch-list .thumb { flex: none; width: 40px; height: 40px; object-fit: cover; background: var(--bg-alt); }
ul.watch-events li { padding: var(--s-2) 0; border-bottom: 1px solid var(--line); font-size: var(--t-small); overflow-wrap: anywhere; }
.watchlist-footer { margin-top: var(--s-5); }
.push-unsub-btn { max-width: 100%; white-space: normal; height: auto; padding-top: var(--s-2); padding-bottom: var(--s-2); }
.push-ios-hint { padding: var(--s-3) var(--s-4); border: 1px solid var(--line); background: var(--bg-alt); }
.push-ios-hint[hidden] { display: none; }
.audience { margin: var(--s-5) 0; }
.audience-delta { font-family: var(--mono); font-weight: 500; }
.audience-delta.up { color: var(--up); }
.audience-delta.down { color: var(--down); }
.genre-shares, .comebacks, .country-origin { margin: var(--s-5) 0; }
.origin-bar-wrap { margin: var(--s-2) 0 var(--s-3); }
progress.origin-progress { appearance: none; -webkit-appearance: none; display: block; width: 100%; max-width: 520px; height: 10px; border: 0; background: var(--line); color: var(--ink); }
progress.origin-progress::-webkit-progress-bar { background: var(--line); }
progress.origin-progress::-webkit-progress-value { background: var(--ink); }
progress.origin-progress::-moz-progress-bar { background: var(--ink); }
ul.share-grid { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: var(--s-3); }
ul.share-grid li { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-2); padding: var(--s-3); border: 1px solid var(--line); min-width: 0; }
ul.share-grid li.is-local { border-color: var(--ink); }
ul.share-grid li > .with-flag { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ul.share-grid strong.mono { font-family: var(--mono); font-size: var(--t-small); color: var(--ink); flex: none; }
.adm-enrich { margin-top: var(--s-6); }
.adm-enrich-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: var(--s-4); margin: var(--s-3) 0 var(--s-4); }
.adm-enrich h3 { margin: 0 0 var(--s-3); font-size: var(--t-h3); }
progress.adm-progress { appearance: none; -webkit-appearance: none; width: 96px; height: 8px; vertical-align: middle; margin-right: var(--s-2); border: 0; background: var(--line); color: var(--ink); }
progress.adm-progress::-webkit-progress-bar { background: var(--line); }
progress.adm-progress::-webkit-progress-value { background: var(--ink); }
progress.adm-progress::-moz-progress-bar { background: var(--ink); }
.page-head ul.summary { margin-top: var(--s-5); }
.track-head ul.summary { margin-top: var(--s-4); }
/* ответ на карточке трека: мятная плашка без обложки — текст + цифры */
.band-mint--answer { grid-template-columns: minmax(0, 1fr) auto; }
.band-mint--answer .lead { margin: 0; color: var(--on-mint); }
.band-mint--answer .lead a { text-decoration-thickness: 2px; }
.band-mint ul.summary { margin: 0; gap: var(--s-2) var(--s-5); }
.band-mint ul.summary li { color: var(--on-mint); font-family: var(--mono); font-size: var(--t-label); }
.band-mint ul.summary strong { color: var(--on-mint); }
.listen { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); font-size: 0; }
.listen > * { font-size: var(--t-small); }
.listen .label { margin-right: var(--s-1); }
.track-head .by a:hover { text-decoration: underline; text-underline-offset: 3px; }
ul.summary { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); }
ul.summary li { font-size: var(--t-small); color: var(--muted); }
ul.summary strong { display: block; font: 500 28px/1.1 var(--mono); color: var(--ink); letter-spacing: -0.04em; }
.listen { margin: var(--s-4) 0; }
.appearance { border-top: 1px solid var(--line); padding: var(--s-4) 0; }
.appearance h3 { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); align-items: baseline; margin-top: 0; }
ul.stat-row { list-style: none; margin: var(--s-2) 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-5); font-size: var(--t-small); }
ul.stat-row li { white-space: nowrap; }
ul.stat-row span { color: var(--muted); }
ul.stat-row strong { font-family: var(--mono); font-weight: 500; }
.career { margin: var(--s-5) 0; }
.neighbors { margin: var(--s-3) 0 0; }
ol.neighbor-list { list-style: none; margin: var(--s-2) 0 0; padding: 0; font-size: var(--t-small); }
ol.neighbor-list li { padding: 2px 0; }
ol.neighbor-list .np { display: inline-block; min-width: 40px; font-family: var(--mono); color: var(--muted); }
ol.neighbor-list a:hover { text-decoration: underline; text-underline-offset: 3px; }
ol.neighbor-list .na { color: var(--muted); }
.related { margin-top: var(--s-6); }
ul.related-grid { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: var(--s-4) var(--s-5); }
ul.related-grid li { min-width: 0; }
ul.related-grid li > a:first-child { display: flex; gap: var(--s-3); align-items: center; font-weight: 500; }
ul.related-grid li > a:first-child:hover .rt-title { text-decoration: underline; text-underline-offset: 3px; }
ul.related-grid .thumb { flex: none; width: 48px; height: 48px; object-fit: cover; background: var(--bg-alt); }
ul.related-grid .rt-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ul.related-grid .rt-artist { display: block; margin-left: 60px; font-size: var(--t-small); color: var(--muted); }
.rt-vs { margin-left: 60px; font: 500 var(--t-label) var(--mono); color: var(--muted); }
.rt-vs:hover, ul.related-grid .rt-artist:hover { color: var(--ink); text-decoration: underline; }
ul.related-grid .rt-artist, .rt-vs { padding: 4px 0; }
ul.related-grid .rt-artist { display: inline-block; }

/* Сравнения */
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: var(--s-5) 0; border-top: 3px solid var(--ink); }
.page-head + .cmp-grid { border-top: 0; margin-top: 0; }
.cmp-col { min-width: 0; padding: var(--s-4) var(--s-5) var(--s-4) 0; }
.cmp-col + .cmp-col { padding: var(--s-4) 0 var(--s-4) var(--s-5); border-left: 1px solid var(--line); }
.cmp-col h2 { margin: 0 0 var(--s-2); font-size: var(--t-h2); }
.cmp-head { display: flex; gap: var(--s-4); align-items: center; margin: 0 0 var(--s-2); }
.cmp-head .thumb { display: block; flex: none; width: 64px; height: 64px; object-fit: cover; background: var(--bg-alt); }
.cmp-head h2 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.cmp-col h2 a:hover, .cmp-col p a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cmp-col ul.stat-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); margin-top: var(--s-4); }
.cmp-col ul.stat-row li { white-space: normal; border-top: 1px solid var(--line); padding-top: var(--s-2); }
.cmp-col ul.stat-row span { display: block; font: 500 var(--t-label) var(--mono); }
.cmp-col ul.stat-row strong { display: block; font: 500 32px/1.1 var(--mono); letter-spacing: -0.04em; }
h1 .vs { font: 500 0.5em var(--mono); color: var(--muted); vertical-align: 0.25em; margin: 0 0.15em; }
p.see-also { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); padding-top: var(--s-4); font-size: 0; }
p.see-also a { font-size: var(--t-body); font-weight: 500; text-decoration: none; }
p.see-also a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cmp-graph { margin-top: var(--s-6); }

/* Сводные: СНГ, пульс, статус, архив */
.cis-where { line-height: 2; }
.cis-badge { display: inline-flex; align-items: center; gap: 4px; margin: 0 4px 4px 0; padding: 2px 8px; font: 400 var(--t-label) var(--mono); white-space: nowrap; color: var(--muted); border: 1px solid var(--line); transition: border-color .15s, color .15s; }
.cis-badge b { color: var(--ink); font-weight: 600; }
.cis-badge:hover { border-color: var(--ink); color: var(--ink); }
.cis-multi { margin-left: 6px; font: 600 var(--t-label) var(--mono); color: var(--muted); }
.pulse-block { margin: var(--s-6) 0; }
ul.pulse-list { list-style: none; margin: 0; padding: 0; }
ul.pulse-list li { padding: var(--s-3) 0; border-bottom: 1px solid var(--line); line-height: 1.5; }
ul.pulse-list a:hover { text-decoration: underline; text-underline-offset: 3px; }
.pulse-pos { font-family: var(--mono); font-weight: 500; color: var(--muted); margin-right: var(--s-1); }
.pulse-tag { display: inline-block; margin-left: var(--s-1); padding: 1px 8px; font: 500 var(--t-label) var(--mono); white-space: nowrap; background: var(--bg-alt); color: var(--muted); }
.pulse-tag.new { background: var(--new-bg); color: var(--new-fg); }
.pulse-tag.up { color: var(--up); }
.status-summary { margin: var(--s-3) 0 var(--s-5); }
.st-badge { display: inline-block; padding: 2px 8px; font: 500 var(--t-label) var(--mono); white-space: nowrap; box-shadow: inset 0 0 0 1px currentColor; }
.st-badge.st-ok { color: var(--up); }
.st-badge.st-stale { color: var(--warn); }
.st-badge.st-missing { color: var(--down); }
.st-badge.st-inactive { color: var(--muted); box-shadow: none; background: var(--bg-alt); }
.formula { margin: var(--s-3) 0; font: 500 20px var(--mono); }
.archive-month { margin: 0 0 var(--s-6); }
.archive-month h2 { margin-bottom: var(--s-2); }
.archive-days { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.archive-days a { display: grid; place-items: center; min-width: var(--tap); min-height: var(--tap); font: 500 15px var(--mono); border: 1px solid var(--line); transition: background .15s, color .15s, border-color .15s; }
.archive-days a:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.otd-year { margin: var(--s-2) 0 var(--s-6); }
.country-chart { margin: var(--s-6) 0; }
.country-chart .more { margin: var(--s-3) 0 0; }
.country-artists { margin: var(--s-6) 0; }
.movers, .records { margin: var(--s-6) 0; }
td.viral-signal { white-space: nowrap; font-family: var(--mono); }
td.year-days, th.year-days { text-align: right; font-family: var(--mono); }

/* Поиск и формы */
.search-form { display: flex; gap: var(--s-2); margin: var(--s-4) 0 var(--s-6); max-width: 640px; }
.search-form input { flex: 1; min-width: 0; }
.search-form button { flex: none; }
.search-block { margin: var(--s-5) 0; }
.search-artists { list-style: none; padding: 0; margin: var(--s-2) 0 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.search-artists a { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 40px; padding: 3px var(--s-3) 3px 3px; border: 1px solid var(--line); font-weight: 500; }
.search-artists a:hover { border-color: var(--ink); }
.search-artists .sa-thumb { display: block; flex: none; width: 32px; height: 32px; object-fit: cover; background: var(--bg-alt); }
.suggest-form { display: flex; flex-direction: column; gap: var(--s-2); max-width: 640px; margin: var(--s-4) 0; }
.suggest-form label { margin-top: var(--s-3); }
.suggest-form label .req { color: var(--down); font-weight: 400; }
.suggest-form textarea { min-height: 160px; }
.suggest-form button { align-self: flex-start; margin-top: var(--s-4); }
.hp-field { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.notfound { padding: var(--s-7) 0; }
.notfound .big-date { font-size: clamp(96px, 18vw, 200px); color: var(--ink); margin: 0 0 var(--s-4); }
/* длинный текст (методология) — колонка чтения */
.prose { max-width: 72ch; }
.prose h2 { margin-top: var(--s-6); }
.prose ul { padding-left: var(--s-5); }
.prose li { margin: 0 0 var(--s-2); }
.prose .formula { display: inline-block; padding: var(--s-3) var(--s-4); background: var(--mint); color: var(--on-mint); }

/* 9. Админка — те же токены; плашка шапки та же, что у сайта */
.adm-header { display: flex; align-items: center; gap: var(--s-2) var(--s-5); flex-wrap: wrap; padding: 0 var(--gut); min-height: 64px; background: var(--band); color: var(--on-band); }
.adm-logo { display: inline-flex; align-items: center; gap: var(--s-2); font: 600 20px var(--font); letter-spacing: -0.04em; color: var(--on-band); }
.adm-logo span { font: 400 var(--t-label) var(--mono); color: var(--on-band-muted); letter-spacing: 0; }
.adm-nav { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-5); margin-right: auto; }
.adm-nav a { padding: var(--s-2) 0; font-size: 15px; font-weight: 500; color: var(--on-band-muted); border-bottom: 2px solid transparent; }
.adm-nav a:hover { color: var(--on-band); }
.adm-nav a.on { color: var(--on-band); border-bottom-color: var(--mint); }
.adm-header :focus-visible { outline-color: var(--focus-on-band); }
.adm-logout button { min-height: 36px; padding: 0 var(--s-4); font: 600 14px var(--font); color: var(--on-band); background: transparent; border: 1px solid rgba(255, 255, 255, .6); cursor: pointer; }
.adm-logout button:hover { background: var(--on-band); color: var(--band); }
.adm-actions button, .adm-filter button {
  min-height: 36px; padding: 0 var(--s-4); font: 600 14px var(--font); color: var(--ink);
  background: transparent; border: 1px solid var(--ink); border-radius: var(--r); cursor: pointer; transition: background .15s, color .15s;
}
.adm-actions button:hover, .adm-filter button:hover { background: var(--ink); color: var(--bg); }
.adm-actions button.danger { color: var(--down); border-color: var(--down); }
.adm-actions button.danger:hover { background: var(--down); color: #fff; }
.adm-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: var(--s-4); margin: var(--s-5) 0; }
.adm-card { min-width: 0; padding: var(--s-5); border: 1px solid var(--line); border-top: 3px solid var(--ink); }
.adm-card.hot { border-top-color: var(--mint); }
.adm-card h2 { margin: 0 0 var(--s-3); font: 500 var(--t-label) var(--mono); color: var(--muted); letter-spacing: 0; }
.adm-card h2 a:hover { color: var(--ink); text-decoration: underline; }
.adm-card p { margin: var(--s-1) 0; font-size: var(--t-small); }
.adm-big, .adm-card .adm-big { font: 500 44px/1.1 var(--mono); letter-spacing: -0.05em; }
.adm-unit { font: 400 var(--t-small) var(--font); color: var(--muted); letter-spacing: 0; }
.adm-tabs { display: flex; flex-wrap: wrap; gap: 0; margin: var(--s-4) 0 var(--s-5); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.adm-tabs a { display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--tap); padding: 0 var(--s-4); font-size: var(--t-small); font-weight: 500; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.adm-tabs a:hover { background: var(--bg-alt); }
.adm-tabs a.on { background: var(--ink); color: var(--bg); }
.adm-tabs b { font-family: var(--mono); font-weight: 500; }
ul.adm-suggestions, ul.adm-list { list-style: none; margin: 0; padding: 0; }
ul.adm-list li { margin: var(--s-1) 0; }
.adm-suggestion { margin: 0 0 var(--s-3); padding: var(--s-4); border: 1px solid var(--line); }
.adm-suggestion.s-new { box-shadow: inset 4px 0 0 var(--mint); }
.adm-suggestion.s-spam { opacity: .7; }
.adm-sug-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); font-size: var(--t-small); }
.adm-contact { font-family: var(--mono); font-size: var(--t-label); }
.adm-sug-text { margin: var(--s-3) 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.adm-ua { overflow-wrap: anywhere; }
.adm-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-3) 0 0; }
.adm-pager { display: flex; gap: var(--s-4); align-items: center; margin: var(--s-4) 0; }
.adm-flag .ok { color: var(--up); font-weight: 600; }
.adm-flag .off { color: var(--muted); }
.adm-bar-cell { min-width: 140px; }
.adm-bar { display: inline-block; height: 8px; min-width: 2px; margin-right: var(--s-2); vertical-align: middle; background: var(--ink); }
.adm-upload { margin: var(--s-4) 0 var(--s-5); padding: var(--s-3) var(--s-4); border: 1px solid var(--line); }
.adm-upload summary { cursor: pointer; font-weight: 600; min-height: var(--tap); display: flex; align-items: center; }
.adm-upload select, .adm-upload input, .adm-upload textarea { max-width: 100%; }
.adm-dates { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-2); }
.adm-dates label { display: block; font-size: var(--t-label); }
.adm-filter { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin: var(--s-3) 0; }
.adm-filter input[type="search"] { flex: 1 1 240px; }
.adm-sorts { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); font-size: var(--t-label); color: var(--muted); }
.adm-sorts a.on { color: var(--ink); font-weight: 600; }
.adm-selected { outline: 2px solid var(--ink); outline-offset: -2px; }
.adm-login { max-width: 360px; }
body.admin .content { max-width: 1440px; padding-top: var(--s-6); }
body.admin .content > h1 { margin-bottom: var(--s-3); }
body.admin .content > h1 + .lead { margin-bottom: var(--s-5); }
.adm-logo .logo-mark { width: 26px; height: 26px; color: var(--on-band); }
body.admin table.chart td { font-size: var(--t-small); }
body.admin table.chart td.pos { width: auto; font-size: var(--t-small); white-space: nowrap; }

/* Адаптив */
@media (max-width: 1180px) {
  .main-nav { display: none; }
  .menu { display: block; }
  .header-cta { display: none; }
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  :root {
    --gut: 16px;
    --t-display: 38px; --t-h1: 32px; --t-h2: 24px; --t-h3: 18px; --t-lead: 17px;
    --t-num-xl: 28px; --t-stat: 30px; --header-h: 60px;
  }
  .header-row { flex-wrap: wrap; gap: var(--s-2) var(--s-3); padding-top: var(--s-2); padding-bottom: var(--s-3); min-height: 0; }
  .logo { min-height: var(--tap); }
  .logo-word { font-size: 22px; }
  .logo-mark { width: 28px; height: 28px; }
  .header-tools { display: contents; }
  .menu { order: 2; margin-left: auto; }
  .site-search { order: 3; flex: 1 0 100%; width: 100%; min-width: 0; }
  .page-head--split { grid-template-columns: 1fr; gap: var(--s-4); }
  .page-head { padding-top: var(--s-5); }
  .datebox { display: flex; align-items: center; gap: var(--s-4); text-align: left; }
  .big-date { font-size: 40px; }
  .datebox .date-nav { flex-direction: column; align-items: flex-start; justify-content: flex-start; margin: 0; gap: 2px; }
  .band-mint { grid-template-columns: 72px minmax(0, 1fr); gap: var(--s-4); padding: var(--s-4); align-items: start; }
  .band-mint .cover { width: 72px; height: 72px; }
  .band-mint .stats { display: none; }   /* те же числа — в тексте плашки */
  /* подразделы на телефоне — одна лента с прокруткой внутри себя (как вкладки):
     4 строки ячеек отодвигали таблицу на второй экран; край ленты гаснет, чтобы
     было видно, что она продолжается */
  .derived-nav {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: calc(-1 * var(--gut));
    border-left: 0; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .derived-nav::-webkit-scrollbar { display: none; }
  .derived-nav a { flex: none; padding: 0 var(--s-3); font-size: var(--t-label); border-left: 1px solid var(--line); border-right: 0; }
  .derived-nav a:last-child { border-right: 1px solid var(--line); margin-right: var(--s-7); }
  .track-head { flex-direction: column; align-items: flex-start; gap: var(--s-4); }
  .track-head .cover { width: 96px; height: 96px; }
  .track-head ul.summary { margin-top: var(--s-3); }
  .page-head h1.h1--long { font-size: 28px; }
  .track-head .by { font-size: 17px; }
  .preview-bar { width: 100%; }
  .preview-track { flex: 1 1 80px; width: auto; }
  .band-mint--answer { grid-template-columns: 1fr; }
  .cmp-head .thumb { width: 48px; height: 48px; }
  .cmp-col ul.stat-row strong { font-size: 26px; }
  .cmp-grid { grid-template-columns: 1fr; }
  .cmp-col, .cmp-col + .cmp-col { padding: var(--s-4) 0; border-left: 0; }
  .cmp-col + .cmp-col { border-top: 1px solid var(--line); }
  .search-artists a { min-height: var(--tap); }
  .footer-word { font-size: 44px; }
  .footer-word .logo-mark { width: 40px; height: 40px; }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: var(--s-5); }
  .footer-cols > :last-child { grid-column: 1 / -1; }
  .search-form { flex-direction: column; }
  .cis-where { display: none; }
  .year-days { display: none; }
  .derived-nav a, .see-also-group li a { min-height: var(--tap); }
}

/* 10. Движение: всё замирает, если система просит меньше анимаций */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
