/* Оформление дашборда.

   Визуальный язык — тёмный продуктовый минимализм: почти чёрный фон, много
   воздуха, одна очень крупная цифра на первом экране, тонкие границы вместо
   теней, акцентный цвет используется скупо.

   Цвета рядов данных при этом не «подгонялись под тему»: набор из четырёх
   категориальных оттенков прогнан через проверку на различимость при
   дальтонизме и на контраст к фактической поверхности карточки (#101012).
   Менять их на глаз нельзя — сначала проверка, потом цвет.

   Тёмная тема здесь основная, поэтому её значения лежат в :root, а светлая
   подключается явно: либо системной настройкой, либо переключателем.
   Переключатель должен выигрывать в обе стороны, отсюда две области объявления. */

:root {
  color-scheme: dark;

  --page: #08080a;
  --surface-1: #101012;
  --surface-2: #17171a;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #8b8b94;   /* 5.93:1; было #71717a — 4.14:1 на тексте 11.5px */
  --grid: #232327;
  --axis: #2e2e33;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;

  --seq-100: #cde2fb;
  --seq-250: #86b6ef;
  --seq-400: #3987e5;
  --seq-550: #1c5cab;
  --seq-700: #0d366b;

  --diverge-pos: #d03b3b;
  --diverge-neg: #3987e5;
  --diverge-mid: #232327;

  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --success-text: #0ca30c;

  --accent: #3987e5;
  --radius: 12px;
  --gap: 22px;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --page: #f9f9f7;
    --surface-1: #fcfcfb;
    --surface-2: #f2f2ef;
    --text-primary: #0b0b0b;
    --text-secondary: #52514e;
    --text-muted: #898781;
    --grid: #e1e0d9;
    --axis: #c3c2b7;
    --border: rgba(11, 11, 11, 0.10);
    --border-strong: rgba(11, 11, 11, 0.18);
    --series-1: #2a78d6;
    --series-2: #eb6834;
    --series-3: #1baf7a;
    --series-4: #eda100;
    --diverge-neg: #2a78d6;
    --diverge-mid: #f0efec;
    --success-text: #006300;
    --accent: #2a78d6;
    /* Статусные цвета на светлом фоне переопределяются отдельно: исходные
       задуманы как заливка марок, а здесь ими набирается текст — название
       уровня 36 пикселей, метки, знаки изменения. Жёлтый #fab219 на светлом
       давал контраст 1.74:1 при норме 4.5:1, то есть был практически не виден.
       Значения ниже подобраны по измеренному контрасту, а не на глаз. */
    --good: #046604;      /* 6.85:1 */
    --warning: #8a5f00;   /* 5.36:1 */
    --serious: #a34320;   /* 5.89:1 */
    --critical: #b01d1d;  /* 6.55:1 */
    --text-muted: #6f6d68; /* 4.90:1 — было 3.41:1 */
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --page: #f9f9f7;
  --surface-1: #fcfcfb;
  --surface-2: #f2f2ef;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --border-strong: rgba(11, 11, 11, 0.18);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --diverge-neg: #2a78d6;
  --diverge-mid: #f0efec;
  --success-text: #006300;
  --accent: #2a78d6;
  --good: #046604;
  --warning: #8a5f00;
  --serious: #a34320;
  --critical: #b01d1d;
  --text-muted: #6f6d68;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--page);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-weight: 600; letter-spacing: -0.015em; margin: 0; }
h2 { font-size: 18px; }
h3 { font-size: 14px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px 80px; }

/* ---------------------------------------------------------------- шапка */

header.top {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--page) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.top-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 11px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.brand { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; margin: 0; }
.brand small { display: block; font-weight: 400; font-size: 11.5px; color: var(--text-muted); letter-spacing: 0; }
.top-spacer { flex: 1 1 auto; }

button, select, input {
  font-family: inherit;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 11px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
button:hover, select:hover { border-color: var(--border-strong); color: var(--text-primary); }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
input { cursor: text; color: var(--text-primary); }
button:disabled { opacity: .45; cursor: default; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; padding: 6px 12px; background: transparent; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* ---------------------------------------------------------------- карточки */

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}
section { margin-top: var(--gap); }
.section-head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.section-head p { margin: 0; color: var(--text-muted); font-size: 13px; max-width: 68ch; }

/* ============================================================= первый экран */

/* Первый экран занимает высоту окна целиком, а кнопка раскрытия прижата
   к его низу: так сразу видно, что ниже что-то есть, и при этом верхний блок
   не приходится домысливать по обрезанному краю. */
.hero-screen {
  /* Высота шапки берётся из переменной: она равна 63 пикселям из-за
     второй строки с названием страны, а не 58, как считалось раньше. */
  min-height: calc(100vh - var(--header-h, 63px));
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 2.5vh, 28px) 0 4px;
  margin-top: 0;
  /* Свечение позади цифры намеренно шире своего контейнера. На узком экране
     оно вылезало за край и растягивало страницу вбок; clip обрезает его,
     не создавая при этом контейнера прокрутки, как сделал бы hidden. */
  overflow-x: clip;
}
.hero-body { flex: 1 1 auto; }
.hero-foot { padding: 12px 0 0; display: flex; justify-content: center; }

.expand-btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 22px; border-radius: 999px;
  font-size: 14px; font-weight: 520;
  background: var(--surface-1); border: 1px solid var(--border-strong);
  color: var(--text-primary);
}
.expand-btn:hover { background: var(--surface-2); }
.expand-arrow { font-style: normal; color: var(--text-muted); }

.hero-chart-block { margin: clamp(12px, 2vh, 20px) 0 12px; }
.hero-chart-block .section-head { margin-bottom: 8px; }

/* --------------------------------------------------------- шкала уровней */

.levelbar { margin: clamp(12px, 2vh, 22px) 0 0; }
.levelbar-wrap { position: relative; padding-top: 20px; }
.levelbar-track {
  display: flex; gap: 2px; height: 10px;
  border-radius: 5px; overflow: hidden;
}
.levelbar-seg { opacity: .32; transition: opacity .2s; }
.levelbar-seg.is-current { opacity: 1; }

/* Отметка текущего значения. transform сдвигает её на половину собственной
   ширины, чтобы центр указателя приходился ровно на позицию по шкале. */
.levelbar-marker {
  position: absolute; top: 0; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
}
.levelbar-marker::after {
  content: ''; width: 2px; height: 16px; background: var(--text-primary);
  border-radius: 1px; margin-top: 2px;
}
.levelbar-value {
  font-size: 12px; font-weight: 620; font-variant-numeric: tabular-nums;
  background: var(--text-primary); color: var(--page);
  border-radius: 5px; padding: 1px 7px; line-height: 1.5;
}

.levelbar-labels { display: flex; gap: 2px; margin-top: 7px; }
/* Подписи уровней не обрезаются по ширине сегмента: «Экстремально» стоит над
   самым узким сегментом (5% шкалы) и раньше сжималось до трёх букв — именно
   тот уровень, ради которого на шкалу и смотрят. Перенос по словам сохраняет
   слово целиком за счёт двух строк. */
.levelbar-label {
  font-size: 11px; color: var(--text-muted); text-align: center;
  line-height: 1.25; word-break: break-word; min-width: 0;
}
.levelbar-labels { align-items: start; }
.levelbar-label.is-current { color: var(--text-primary); font-weight: 560; }
.levelbar-next { margin-top: 7px; font-size: 12.5px; color: var(--text-muted); }

@media (max-width: 560px) {
  .levelbar-label { font-size: 10px; }
}

/* Знак вопроса делает подсказку заметной: без него никто не догадается,
   что у показателя есть пояснение. */
.q-mark {
  display: inline-grid; place-items: center;
  width: 14px; height: 14px; margin-left: 5px;
  border: 1px solid var(--border-strong); border-radius: 50%;
  font-size: 9.5px; font-style: normal; line-height: 1;
  color: var(--text-muted); vertical-align: text-top;
}
.tile-clickable:hover .q-mark { border-color: var(--accent); color: var(--accent); }

.hero-eyebrow {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: clamp(10px, 2vh, 22px);
}
.hero-eyebrow .sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }

.hero-main {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(280px, 1fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
}
@media (max-width: 780px) { .hero-main { grid-template-columns: 1fr; gap: 24px; } }

.hero-num-wrap { position: relative; display: flex; align-items: baseline; gap: 14px; }

/* Мягкое свечение позади цифры, окрашенное в цвет текущего уровня.
   Это единственное декоративное пятно на странице — оно задаёт настроение
   первого экрана, не притворяясь при этом данными. */
.hero-glow {
  position: absolute;
  left: -12%; top: 50%; transform: translateY(-50%);
  width: 125%; aspect-ratio: 1 / 1;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .17;
  pointer-events: none;
  transition: background .4s ease;
  z-index: 0;
}
:root[data-theme="light"] .hero-glow { opacity: .13; }

.hero-num {
  position: relative; z-index: 1;
  /* Размер ограничен и шириной, и высотой окна: на невысоком экране цифра,
     подобранная только по ширине, выталкивала кнопку «Подробнее» за сгиб,
     и первый экран переставал быть первым экраном. */
  font-size: clamp(52px, min(15vw, 13.5vh), 148px);
  line-height: .84;
  font-weight: 600;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
}
.hero-scale {
  position: relative; z-index: 1;
  font-size: clamp(14px, 2vw, 17px);
  color: var(--text-muted);
  letter-spacing: -0.01em;
  display: flex; flex-direction: column; gap: 2px;
}
.hero-scale small { font-size: 11px; line-height: 1.3; max-width: 11ch; display: block; }

/* Строка «выше, чем в N днях из 100» стоит прямо под цифрой: без неё
   «80 из 100» чаще всего прочитывается как «80 процентов чего-то». */
.hero-scale-note {
  margin: 14px 0 0; font-size: 13.5px; color: var(--text-secondary); max-width: 62ch;
}
.hero-hold { margin: 5px 0 0; font-size: 12.5px; color: var(--text-muted); }

.hero-made-of {
  display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center;
  margin-top: 11px; font-size: 12.5px; color: var(--text-secondary);
}
.hero-made-of .made-label { color: var(--text-muted); }
.made-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

.what-is-it-text {
  margin: 0; font-size: 14px; line-height: 1.65;
  color: var(--text-secondary); max-width: 80ch;
}
.chart-note { font-size: 12px; color: var(--text-muted); margin: 8px 0 0; max-width: 78ch; }

.hero-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hero-level {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 620;
  letter-spacing: -0.03em;
  line-height: 1.08;
}
.hero-desc {
  margin: 0; color: var(--text-secondary); font-size: 15px; max-width: 46ch;
}
.hero-delta {
  display: flex; gap: 18px; flex-wrap: wrap;
  font-size: 13.5px; color: var(--text-secondary);
  padding-top: 4px;
}
.hero-delta b { font-variant-numeric: tabular-nums; color: var(--text-primary); font-weight: 580; }

.provenance {
  margin-top: 12px; font-size: 11.5px; color: var(--text-muted);
  max-width: 96ch; line-height: 1.5;
}

/* ---------------------------------------------------------------- плитки */

.tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  margin: 0;
}
.tile { background: var(--surface-1); padding: 11px 14px; }
.tile dt { font-size: 11.5px; color: var(--text-muted); margin: 0 0 4px; letter-spacing: .01em; }
.tile dd { margin: 0; font-size: 20px; font-weight: 580; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.tile .hint { font-size: 11px; color: var(--text-muted); font-weight: 400; letter-spacing: 0; margin-top: 1px; line-height: 1.35; }

.tile-clickable { cursor: pointer; transition: background .15s; }
.tile-clickable:hover { background: var(--surface-2); }
.tile-clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tile-explain {
  margin-top: 9px; font-size: 12px; line-height: 1.5; color: var(--text-secondary);
  border-top: 1px solid var(--border); padding-top: 8px; font-weight: 400; letter-spacing: 0;
}

/* ---------------------------------------------------------------- режимы */

.regime-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 13px; border-radius: 999px;
  font-size: 13px; font-weight: 540;
  border: 1px solid var(--border); background: var(--surface-2);
  width: fit-content;
}
.regime-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* ---------------------------------------------------------------- уровни */

.level-row {
  display: grid;
  grid-template-columns: 12px 62px 1fr auto auto;
  gap: 14px; align-items: center;
  padding: 11px 12px 11px 6px; border-radius: 9px;
}
.level-row + .level-row { border-top: 1px solid var(--grid); }
.level-active { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.level-swatch { width: 12px; height: 12px; border-radius: 3px; }
.level-band { font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.level-name { font-size: 14px; font-weight: 550; }
.level-index { font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.level-here { border-color: var(--accent); color: var(--accent); font-weight: 600; }
@media (max-width: 640px) {
  .level-row { grid-template-columns: 12px 56px 1fr; }
  .level-index { grid-column: 2 / -1; }
}

/* ---------------------------------------------------------------- текст */

.narrative p { margin: 0 0 11px; max-width: 76ch; color: var(--text-secondary); }
.narrative p:last-child { margin-bottom: 0; }

.flag {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px; border-radius: 9px; font-size: 13.5px;
  border: 1px solid var(--border); margin-top: 11px; background: var(--surface-2);
}
.flag-icon { flex: none; font-weight: 700; line-height: 1.5; }
.flag-warn { border-color: color-mix(in srgb, var(--warning) 45%, transparent); }
.flag-warn .flag-icon { color: var(--warning); }
.flag-info .flag-icon { color: var(--text-muted); }

/* ---------------------------------------------------------------- графики */

.chart { width: 100%; overflow: hidden; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-secondary); margin-top: 9px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 11px; height: 11px; border-radius: 3px; flex: none; border: 1px solid var(--border); }
.swatch-line { width: 15px; height: 3px; border-radius: 2px; }

.regime-strip { display: flex; height: 8px; border-radius: 3px; overflow: hidden; margin-top: 5px; }

/* Выбор фазы: показать на графике только её. */
.regime-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.regime-filter .rf-label { font-size: 12px; color: var(--text-muted); margin-right: 2px; }
.rf-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; padding: 5px 11px; border-radius: 999px;
}
.rf-btn i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.rf-btn[aria-pressed="true"] { border-color: var(--text-primary); color: var(--text-primary); }
.rf-stats {
  flex-basis: 100%; font-size: 12.5px; color: var(--text-secondary);
  font-variant-numeric: tabular-nums; margin-top: 2px;
}
.regime-strip i { display: block; height: 100%; }

.small-multiples {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.sm { background: var(--surface-1); padding: 16px 18px; }
.sm-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sm-name { font-size: 13px; font-weight: 550; display: flex; align-items: center; gap: 8px; }
.sm-value { font-size: 19px; font-weight: 580; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.sm-sub { font-size: 11.5px; color: var(--text-muted); }

/* ---------------------------------------------------------------- вклады */

.contrib { display: flex; flex-direction: column; gap: 11px; }
.contrib-row { display: grid; grid-template-columns: minmax(120px, 200px) 1fr auto; gap: 14px; align-items: center; }
.contrib-name { font-size: 13px; display: flex; align-items: center; gap: 8px; }
.contrib-track { height: 16px; background: var(--grid); border-radius: 5px; overflow: hidden; }
.contrib-fill { height: 100%; border-radius: 5px; }
.contrib-val { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text-secondary); min-width: 46px; text-align: right; }

/* ---------------------------------------------------------------- таблицы */

.scroll-x { overflow-x: auto; max-width: 100%; }
.scroll-x > table { min-width: 460px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-weight: 500; color: var(--text-muted); font-size: 11.5px;
  letter-spacing: .04em; text-transform: uppercase;
  padding: 0 10px 9px 0; border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--grid); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.row-clickable { cursor: pointer; }
.row-clickable:hover td { background: var(--surface-2); }
.row-clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.bar { position: relative; height: 14px; background: var(--grid); border-radius: 4px; min-width: 90px; }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; display: block; }
.bar-label { font-size: 11.5px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.tag {
  font-size: 11px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-muted); white-space: nowrap;
}
.tag-stale { border-color: color-mix(in srgb, var(--warning) 45%, transparent); color: var(--warning); }
.tag-manual { border-color: var(--border-strong); }

/* ---------------------------------------------------------------- матрица */

.matrix { border-collapse: separate; border-spacing: 3px; font-size: 12px; }
.matrix td.cell { width: 64px; height: 42px; text-align: center; border-radius: 6px; font-variant-numeric: tabular-nums; }
.matrix th { padding: 4px 7px; font-size: 11px; text-transform: none; letter-spacing: 0; }

/* ---------------------------------------------------------------- аналоги */

.analogs { display: grid; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr)); gap: 12px; }
.analog { border: 1px solid var(--border); border-radius: 10px; padding: 15px 17px; background: var(--surface-2); }
.analog-date { font-weight: 570; font-size: 14px; letter-spacing: -0.01em; }
.analog dl { margin: 10px 0 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 12.5px; }
.analog dt { color: var(--text-muted); margin: 0; }
.analog dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- новости */

.headlines { display: flex; flex-direction: column; gap: 2px; }
.headline-row {
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: baseline;
  padding: 11px 0; border-bottom: 1px solid var(--grid);
}
.headline-row:last-child { border-bottom: 0; }
.headline-rank { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.headline-title { font-size: 14px; line-height: 1.45; }
.headline-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }

/* ---------------------------------------------------------------- служебное */

.muted { color: var(--text-muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.hidden { display: none !important; }
.spinner { color: var(--text-muted); padding: 56px 0; text-align: center; }

details.diag > summary { cursor: pointer; font-weight: 550; padding: 4px 0; }
details.diag[open] > summary { margin-bottom: 14px; }

.invite-link {
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; word-break: break-all; user-select: all;
}

/* ---------------------------------------------------------------- вход */

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 390px; }
.auth-card h1 { font-size: 21px; margin-bottom: 5px; letter-spacing: -0.02em; }
.auth-card p.sub { color: var(--text-muted); font-size: 13px; margin: 0 0 22px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 15px; }
.field label { font-size: 12.5px; color: var(--text-secondary); }
.field input { padding: 10px 12px; font-size: 14px; }
.btn-primary {
  width: 100%; padding: 11px; background: var(--accent); color: #fff;
  border-color: transparent; font-weight: 550; font-size: 14px;
}
.btn-primary:hover { opacity: .9; border-color: transparent; color: #fff; }
.error {
  color: var(--critical); font-size: 13px; margin: 0 0 13px;
  border-left: 3px solid var(--critical); padding-left: 11px;
}

/* ---------------------------------------------------- подсказка uPlot */

.u-tooltip {
  position: absolute; pointer-events: none; z-index: 10;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 9px 12px; font-size: 12.5px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45); white-space: nowrap;
}
.u-tooltip b { font-variant-numeric: tabular-nums; }
.u-tooltip .t-date { color: var(--text-muted); font-size: 11.5px; display: block; margin-bottom: 4px; }
.uplot, .u-wrap { max-width: 100%; }
.u-legend { display: none; }

/* На невысоком окне первый экран физически не вмещает всё. Вместо того чтобы
   выталкивать кнопку «Подробнее» под сгиб, убираем оттуда то, что не обязано
   быть на первом экране: строка о происхождении данных переезжает вниз. */
/* На окне ниже примерно тысячи пикселей всё содержимое первого экрана
   физически не помещается. Вместо того чтобы выталкивать кнопку «Подробнее»
   под сгиб, оттуда убирается то, что не обязано быть на первом экране:
   строка о происхождении данных и пояснение под графиком. Оба текста
   остаются доступными — первый в подробностях, второй в легенде. */
@media (max-height: 980px) {
  .provenance, .chart-note { display: none; }
  .hero-chart-block { margin: 10px 0 8px; }
  .hero-scale-note { margin-top: 10px; font-size: 13px; }
  .hero-hold { margin-top: 3px; }
  .hero-made-of { margin-top: 8px; }
  .levelbar { margin-top: 12px; }
  .levelbar-wrap { padding-top: 16px; }
  .levelbar-labels { margin-top: 5px; }
  .levelbar-next { margin-top: 4px; }
  .hero-eyebrow { margin-bottom: 10px; }
  .tile { padding: 9px 13px; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 16px 56px; }
  .card { padding: 17px 18px; }
  .hero-screen { padding: 28px 0 32px; }
}
