/* Единая тема для всех страниц сервиса: справочный центр, кабинет, панель владельца.
 *
 * До этого каждая страница везла свою вёрстку внутри себя — четыре набора стилей,
 * четыре разных вида кнопки и таблицы. Здесь одни переменные и один набор
 * компонентов: цвет меняется в одном месте и меняется везде.
 *
 * Тёмная тема — по умолчанию (в ней сидят за терминалом), светлая включается
 * переключателем и запоминается. Переключение — через атрибут data-theme на
 * <html>, поэтому странице достаточно одной строки в <head>, чтобы не мигать
 * светлым при загрузке.
 */

:root {
  --bg: #050505;
  --bg-soft: #0a0a0a;
  --surface: #101010;
  --surface-2: #161616;
  --border: #262626;
  --border-soft: #1c1c1c;
  --text: #f2f2f2;
  --text-dim: #b6b6b6;
  --muted: #8b8b8b;
  /* Тема чёрно-белая: фон чёрный, акценты — оттенки белого. Цветных заливок
     нет намеренно: они спорят с содержимым и на чёрном выглядят дешевле, чем
     сама страница. Цвет остаётся только у смысловых меток — ок, пауза, ошибка
     (--good, --warn, --bad), потому что там он несёт значение. */
  --accent: #e8e8e8;
  --accent-dim: #c6c6c6;
  --accent-soft: rgba(255, 255, 255, 0.08);
  /* Свечение вокруг активной кнопки: белое в тёмной теме, тёмное в светлой. */
  --glow: rgba(255, 255, 255, 0.14);
  /* Главная кнопка — белая с уходом в голубой слева направо: одним цветом она
     выглядела выключенной, а градиент делает её «нажатой» без наведения. */
  --primary-1: #ffffff;
  --primary-2: #a6ccff;
  /* Кнопки в шапке — это переходы, а не подписи: заливка у них постоянная. */
  --nav-1: rgba(255, 255, 255, 0.18);
  --nav-2: rgba(255, 255, 255, 0.05);
  --nav-border: rgba(255, 255, 255, 0.3);
  --accent-2: #8f8f8f;
  --accent-2-soft: rgba(255, 255, 255, 0.05);
  /* Текст поверх акцента: акцент светлый, поэтому надпись на нём — тёмная. */
  --on-accent: #0a0a0a;
  --good: #34d399;
  --good-soft: rgba(52, 211, 153, 0.13);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.13);
  --bad: #fb7185;
  --bad-soft: rgba(251, 113, 133, 0.13);
  --code-bg: #0a0a0a;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.6);
  /* Цвет живёт только на фоне: страница чёрно-белая, пятна — цветные. Набор
     холодный: жёлтый и зелёный на чёрном читаются как светофор, поэтому их тут
     нет. Оттенки специально не соседние, иначе размытие сливает их в одно. */
  --aurora-1: #22d3ee;
  --aurora-2: #38bdf8;
  --aurora-3: #2dd4bf;
  --aurora-4: #fb7185;
  --aurora-5: #f472b6;
  --aurora-6: #60a5fa;
  --radius: 14px;
  --radius-sm: 9px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html[data-theme='light'] {
  --bg: #f7f7f7;
  --bg-soft: #efefef;
  --surface: #ffffff;
  --surface-2: #f4f4f4;
  --border: #e2e2e2;
  --border-soft: #ececec;
  --text: #141414;
  --text-dim: #4b4b4b;
  --muted: #6b6b6b;
  --accent: #1a1a1a;
  --accent-dim: #000000;
  --accent-soft: rgba(0, 0, 0, 0.06);
  --glow: rgba(0, 0, 0, 0.18);
  --primary-1: #141414;
  --primary-2: #1f5fc4;
  --nav-1: rgba(0, 0, 0, 0.1);
  --nav-2: rgba(0, 0, 0, 0.02);
  --nav-border: rgba(0, 0, 0, 0.22);
  --accent-2: #5a5a5a;
  --accent-2-soft: rgba(0, 0, 0, 0.04);
  --on-accent: #ffffff;
  --good: #0f9d68;
  --good-soft: rgba(15, 157, 104, 0.11);
  --warn: #b8790a;
  --warn-soft: rgba(184, 121, 10, 0.12);
  --bad: #dc4a63;
  --bad-soft: rgba(220, 74, 99, 0.1);
  --code-bg: #f3f3f3;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.1);
  --aurora-1: #0e7490;
  --aurora-2: #0369a1;
  --aurora-3: #0f766e;
  --aurora-4: #be123c;
  --aurora-5: #be185d;
  --aurora-6: #1d4ed8;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ── Живой фон ─────────────────────────────────────────────────────────── */

/* Размытые пятна медленно ездят по экрану и дают цвет, которого не даёт
   плоская заливка: сама страница чёрно-белая, цвет живёт только здесь.
   Меняем только transform — он не пересчитывает раскладку, поэтому анимация
   не мешает читать и не греет видеокарту впустую. Шесть пятен, разные скорости
   и отрицательные задержки: к моменту открытия страницы они уже разъехались, и
   картинка не выглядит как один запущенный с нуля цикл. */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.8s ease;
}
/* Кабинет — это цифры и таблицы: там фон уходит на второй план, иначе он
   соревнуется с содержимым. На экране входа он работает в полную силу. */
body.logged-in .aurora { opacity: 0.3; }
.aurora i {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(72px);
  will-change: transform;
  /* На чёрном складываем свет: там, где пятна сходятся, получается новый
     оттенок, а не мутная заливка. */
  mix-blend-mode: screen;
}
.aurora i:nth-child(1) {
  width: 44vmax; height: 44vmax;
  left: -10vmax; top: -12vmax;
  background: radial-gradient(circle, var(--aurora-1) 0%, transparent 66%);
  opacity: 0.5;
  animation: aurora-a 19s ease-in-out infinite alternate;
}
.aurora i:nth-child(2) {
  width: 38vmax; height: 38vmax;
  right: -8vmax; top: -6vmax;
  background: radial-gradient(circle, var(--aurora-2) 0%, transparent 64%);
  opacity: 0.42;
  animation: aurora-b 23s ease-in-out -4s infinite alternate;
}
.aurora i:nth-child(3) {
  width: 50vmax; height: 50vmax;
  left: 22vmax; bottom: -22vmax;
  background: radial-gradient(circle, var(--aurora-3) 0%, transparent 68%);
  opacity: 0.4;
  animation: aurora-c 27s ease-in-out -9s infinite alternate;
}
.aurora i:nth-child(4) {
  width: 30vmax; height: 30vmax;
  left: 34vmax; top: 6vmax;
  background: radial-gradient(circle, var(--aurora-4) 0%, transparent 62%);
  opacity: 0.4;
  animation: aurora-d 21s ease-in-out -13s infinite alternate;
}
.aurora i:nth-child(5) {
  width: 34vmax; height: 34vmax;
  left: -6vmax; bottom: 6vmax;
  background: radial-gradient(circle, var(--aurora-5) 0%, transparent 64%);
  opacity: 0.38;
  animation: aurora-e 25s ease-in-out -7s infinite alternate;
}
.aurora i:nth-child(6) {
  width: 26vmax; height: 26vmax;
  right: 10vmax; bottom: -4vmax;
  background: radial-gradient(circle, var(--aurora-6) 0%, transparent 60%);
  opacity: 0.34;
  animation: aurora-f 17s ease-in-out -11s infinite alternate;
}
@keyframes aurora-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(22vmax, 16vmax, 0) scale(1.28); }
}
@keyframes aurora-b {
  from { transform: translate3d(0, 0, 0) scale(1.14); }
  to { transform: translate3d(-24vmax, 18vmax, 0) scale(0.86); }
}
@keyframes aurora-c {
  from { transform: translate3d(0, 0, 0) scale(0.9); }
  to { transform: translate3d(-18vmax, -20vmax, 0) scale(1.3); }
}
@keyframes aurora-d {
  from { transform: translate3d(0, 0, 0) scale(1.05); }
  to { transform: translate3d(-20vmax, 22vmax, 0) scale(0.88); }
}
@keyframes aurora-e {
  from { transform: translate3d(0, 0, 0) scale(0.95); }
  to { transform: translate3d(26vmax, -14vmax, 0) scale(1.24); }
}
@keyframes aurora-f {
  from { transform: translate3d(0, 0, 0) scale(1.1); }
  to { transform: translate3d(-14vmax, -18vmax, 0) scale(0.9); }
}
/* Кому движение мешает — тем показываем ту же картинку, но неподвижную. */
@media (prefers-reduced-motion: reduce) {
  .aurora i { animation: none; }
}
/* Светлая тема: пятна здесь тёмные и умножаются на белом — иначе страница
   выглядит пыльной, а не живой. */
html[data-theme='light'] .aurora i { mix-blend-mode: multiply; opacity: 0.14; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 10px; line-height: 1.25; font-weight: 650; }
h1 { font-size: 27px; letter-spacing: -0.4px; }
h2 { font-size: 21px; letter-spacing: -0.2px; }
h3 { font-size: 17px; }
p { margin: 0 0 12px; }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 12px; padding-left: 22px; }
li { margin-bottom: 6px; }

.muted { color: var(--muted); }
.dim { color: var(--text-dim); }
.mono { font-family: var(--mono); font-size: 13px; }
.hide { display: none !important; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.wrap-any { overflow-wrap: anywhere; }
.small { font-size: 13.5px; }

/* ── Каркас страницы ───────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  /* Перенос строки обязателен: на телефоне название сервиса, состояние связи и
     две кнопки в одну строку не влезают, а без переноса шапка распирала бы всю
     страницу по ширине — таблицы внутри карточек начинают прокручиваться, но
     переполнение шапки тянет за собой всю страницу. */
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

/* Логотип — просто имя продавца: буква в квадратике рядом дублировала его же,
   а квадратик смотрелся как кнопка, которой не за что нажимать. Раскраска
   сине-белая: на чёрном фоне она читается как свет, а не как ещё одна плашка. */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
  background: linear-gradient(96deg, #ffffff 0%, #d3e8ff 45%, #74b6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.brand:hover { text-decoration: none; filter: brightness(1.12); }
html[data-theme='light'] .brand {
  background: linear-gradient(96deg, #08386f 0%, #1c66c4 55%, #4b9ff5 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.topbar .spacer { flex: 1; }

.layout {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 26px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 22px 70px;
  align-items: start;
  /* Содержимое выше живого фона: иначе пятна просвечивают сквозь карточки. */
  position: relative;
  z-index: 1;
}
.layout.wide { grid-template-columns: minmax(0, 1fr); max-width: 1080px; }

.sidebar {
  position: sticky;
  top: 74px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 4px;
}

.sidebar-group { margin-bottom: 18px; }
.sidebar-title {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 8px 10px;
}
.sidebar a {
  display: block;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 2px;
}
.sidebar a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.sidebar a.on { background: var(--accent-soft); color: var(--text); font-weight: 600; }

.content { min-width: 0; }
.page-head { margin-bottom: 20px; }
.page-head .lead { color: var(--text-dim); max-width: 74ch; }

/* ── Карточки ──────────────────────────────────────────────────────────── */

.card {
  /* Карточка чуть прозрачная: под ней живой фон, и оттенок пятна на поверхности
     отличает соседние карточки друг от друга. Размытие небольшое — иначе
     страница с десятком карточек начинает тормозить при прокрутке. */
  background: color-mix(in srgb, var(--surface) 93%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 18px;
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.card-head h2, .card-head h3 { margin: 0; }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px; }
.card-body > :last-child { margin-bottom: 0; }
.card.tight .card-body { padding: 14px 18px; }
.card.plain { background: transparent; border: none; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

/* ── Кнопки и поля ─────────────────────────────────────────────────────── */

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.06s;
}
/* Наведение подсвечивает, а не затемняет: на чёрном фоне затемнение читается
   как «кнопка стала неактивной», хотя человек её как раз выбрал. */
.btn:hover { border-color: var(--accent-dim); background: var(--accent-soft); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: default; }
/* Главное действие страницы. Светлая заливка с уходом в голубой идёт слева
   направо: так кнопка выглядит активной сама по себе, а не только под
   курсором. Наведение добавляет свечение, а не меняет цвет. */
.btn.primary {
  position: relative;
  overflow: hidden;
  /* Три остановки вместо двух: градиент шире кнопки, поэтому его сдвиг
     зацикливается без рывка — на краях снова тот же цвет. */
  background: linear-gradient(90deg, var(--primary-1), var(--primary-2), var(--primary-1));
  background-size: 200% 100%;
  animation: btn-flow 6s linear infinite;
  border-color: transparent;
  color: var(--on-accent);
  font-weight: 600;
}
/* Блик проходит по кнопке раз в цикл: движение видно боковым зрением, но не
   мешает читать надпись. */
.btn.primary::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 38%, rgba(255, 255, 255, 0.5) 50%, transparent 62%);
  transform: translateX(-130%);
  animation: btn-shine 6s ease-in-out infinite;
}
.btn.primary:hover {
  filter: brightness(1.07);
  box-shadow: 0 0 0 3px var(--glow), 0 8px 22px var(--glow);
}
@keyframes btn-flow {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}
@keyframes btn-shine {
  0%, 45% { transform: translateX(-130%); }
  100% { transform: translateX(130%); }
}
.btn.ghost { background: transparent; }
/* Кнопки в шапке («Справочник», «Кабинет», «Выйти») — это переходы, поэтому у
   них постоянная заливка, а не серая рамка. Перетекает она медленнее: в шапке
   движение не должно перетягивать внимание с содержимого. */
header .btn.ghost {
  background: linear-gradient(90deg, var(--nav-1), var(--nav-2), var(--nav-1));
  background-size: 200% 100%;
  animation: btn-flow 9s linear infinite;
  border-color: var(--nav-border);
  color: var(--text);
}
.btn.ghost:hover { background: var(--accent-soft); border-color: var(--accent-dim); color: var(--text); }
/* Кому движение мешает — тем кнопки остаются, но замирают. */
@media (prefers-reduced-motion: reduce) {
  .btn.primary,
  .btn.primary::after,
  header .btn.ghost { animation: none; }
}
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn.wide { width: 100%; justify-content: center; }
/* Цветные кнопки-действия: «Пополнить» и «Получить бонус» ведут на FunPay,
   поэтому должны отличаться от переходов внутри страницы. */
.btn.buy { background: var(--accent-soft); border-color: var(--accent-dim); color: var(--accent); font-weight: 600; }
.btn.buy:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.bonus { background: var(--good-soft); border-color: var(--good); color: var(--good); font-weight: 600; }
.btn.bonus:hover { background: var(--good); border-color: var(--good); color: #08131c; }

.input, .select {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
}
.input:focus, .select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent-dim); }
.select { cursor: pointer; }

.field { margin-bottom: 12px; }
.field > label {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 5px;
  letter-spacing: 0.02em;
}
.field-row { display: flex; gap: 8px; }

/* ── Метки состояния ───────────────────────────────────────────────────── */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--good-soft);
  color: var(--good);
  white-space: nowrap;
}
.tag.pause { background: var(--warn-soft); color: var(--warn); }
.tag.err { background: var(--bad-soft); color: var(--bad); }
.tag.info { background: var(--accent-soft); color: var(--accent); }
.tag.plain { background: var(--surface-2); color: var(--text-dim); }

.pill {
  display: inline-block;
  font-size: 12.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

/* ── Полоса расхода ────────────────────────────────────────────────────── */

.bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  border: 1px solid var(--border-soft);
}
.bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: 999px;
  transition: width 0.4s ease;
}
.bar.warn > i { background: var(--warn); }
.bar.bad > i { background: var(--bad); }
.bar.slim { height: 6px; }

/* ── Карточка ключа в кабинете ─────────────────────────────────────────── */

.key-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.key-title { margin: 4px 0 0; font-size: 30px; font-weight: 680; letter-spacing: -0.6px; }
.key-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.key-tile {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
}
.key-tile .label {
  font-size: 11.5px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.key-tile .value { font-size: 22px; font-weight: 660; letter-spacing: -0.4px; }

.progress-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 22px 0 8px;
}
.progress-head .pct { font-size: 19px; font-weight: 680; color: var(--accent); }

/* Строки «подпись — значение»: значение прижато вправо, как в таблице
   характеристик. Разделители вместо рамок — так список читается спокойнее. */
.kv.rows { grid-template-columns: max-content minmax(0, 1fr); gap: 0; }
.kv.rows > dt,
.kv.rows > dd {
  padding: 11px 0;
  border-top: 1px solid var(--border-soft);
}
.kv.rows > dd { text-align: right; }

/* ── Таблицы ───────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.table td { padding: 9px 12px; border-bottom: 1px solid var(--border-soft); }
table.table tbody tr:last-child td { border-bottom: none; }
table.table tbody tr:hover { background: var(--surface-2); }
table.table td.empty { text-align: center; color: var(--muted); padding: 22px; }

/* ── Выноски ───────────────────────────────────────────────────────────── */

.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  margin-bottom: 14px;
  font-size: 14px;
}
.callout > :last-child { margin-bottom: 0; }
.callout-title { font-weight: 650; margin-bottom: 4px; }
.callout.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.callout.bad { border-left-color: var(--bad); background: var(--bad-soft); }
.callout.good { border-left-color: var(--good); background: var(--good-soft); }

/* Свёрнутый блок: подробности для тех, кто захочет проверить, — обычный
   покупатель их не открывает, и на экране он их не видит. */
details.more {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2, var(--surface));
  padding: 10px 12px;
  margin-bottom: 14px;
}
details.more > summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before {
  content: '▸';
  display: inline-block;
  width: 14px;
  color: var(--muted);
}
details.more[open] > summary::before { content: '▾'; }
details.more > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
details.more > :not(summary) { margin-top: 10px; }

/* ── Блоки кода ────────────────────────────────────────────────────────── */

.code {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  overflow: hidden;
  margin-bottom: 14px;
}
.code-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--muted);
}
.code-head .spacer { flex: 1; }
.code-head .name { font-family: var(--mono); color: var(--text-dim); }
.code pre {
  margin: 0;
  padding: 13px 15px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.8px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre;
  tab-size: 2;
}
.code pre.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ── Шаги ──────────────────────────────────────────────────────────────── */

.steps { list-style: none; padding: 0; counter-reset: step; margin: 0; }
.steps > li {
  position: relative;
  padding-left: 38px;
  margin-bottom: 16px;
}
.steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.steps > li > .step-title { font-weight: 650; margin-bottom: 6px; }

/* ── Выбор (чипы и плитки) ─────────────────────────────────────────────── */

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-dim);
  font-family: var(--mono);
}
.chip:hover { border-color: var(--accent-dim); color: var(--text); }
.chip.on { background: var(--accent-soft); border-color: var(--accent-dim); color: var(--text); font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 9px; }
.tile {
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  cursor: pointer;
  color: var(--text);
  font: inherit;
}
.tile:hover { border-color: var(--accent-dim); }
.tile.on { border-color: var(--accent); background: var(--accent-soft); }
.tile .t { font-weight: 640; font-size: 14px; }
.tile .s { font-size: 12.5px; color: var(--muted); }
.tile .b { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ── Поиск в справочнике ───────────────────────────────────────────────── */

.search { position: relative; flex: 1; max-width: 380px; }
.search input { width: 100%; }
.search-results {
  position: absolute;
  top: 46px;
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 40;
  max-height: 320px;
  overflow-y: auto;
}
.search-results a { display: block; padding: 9px 13px; color: var(--text-dim); border-bottom: 1px solid var(--border-soft); }
.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.search-results .none { padding: 12px 13px; color: var(--muted); }

/* ── Переходы по страницам ─────────────────────────────────────────────── */

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  border-top: 1px solid var(--border-soft);
  padding-top: 16px;
}
.pager a { display: block; }
/* Подпись «Далее»/«Назад» стоит своей строкой над названием раздела: в одну
   строку они слипались в «ДалееКоды ошибок» — между словами нет пробела, а
   разделять их пробелом нельзя, иначе он потеряется при переводе. */
.pager .dir { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 3px; }

/* ── Служебное ─────────────────────────────────────────────────────────── */

.center-card {
  max-width: 430px;
  margin: 0 auto;
  /* До входа на странице одна карточка, поэтому она стоит по центру экрана, а
     не у верхнего края: пустое поле снизу выглядело как недогруженная страница. */
  text-align: center;
}
/* Поле и подпись к нему остаются слева: подпись по центру читается как
   заголовок, а не как приглашение к вводу. */
.center-card .field { text-align: left; }
body:not(.logged-in) .layout.wide {
  display: flex;
  align-items: center;
  justify-content: center;
  /* Высоту считаем от шапки, а не «на глаз»: иначе карточка уезжает кверху и
     снизу остаётся полоса пустого экрана. */
  min-height: calc(100vh - 60px);
  padding-bottom: 24px;
}
.foot {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 10px 0 26px;
}
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: inline-block; }
.live.on i { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

/* Переключатель языка: две буквы в одной рамке, выбранная подсвечена. Это
   радиокнопки, а не ссылки: язык меняется на месте, страница не перезагружается. */
.lang {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}
.lang button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 6px 10px;
  cursor: pointer;
}
.lang button + button { border-left: 1px solid var(--border); }
.lang button.on { background: var(--accent-soft); color: var(--text); }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.loading { color: var(--muted); font-size: 14px; }

@media (max-width: 920px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: static;
    max-height: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
  }
  .sidebar-group { margin: 0; }
  .sidebar-title { display: none; }
  .sidebar a { margin: 0; }
  .hero-main .num { font-size: 32px; }
}

/* На узком экране в шапке оставляем только то, без чего нельзя обойтись:
   название сервиса, значок состояния и кнопки. Подпись раздела и слова о
   состоянии связи — пояснения, и на телефоне они дороже места, чем стоят. */
@media (max-width: 760px) {
  .topbar { padding: 10px 14px; gap: 10px; }
  .hide-narrow { display: none; }
  .layout { padding: 18px 14px 60px; }
  .card-body, .card-head { padding-left: 14px; padding-right: 14px; }
}

@media print {
  .topbar, .sidebar, .pager, .code-head button { display: none; }
  .layout { grid-template-columns: minmax(0, 1fr); }
}
