/* shared/fonts.css */
/* Шрифты — те же файлы, что у основного сайта (Google Fonts, OFL), свои копии: CDN режется. */
/* Oswald 700 cyrillic-ext */
@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(shared/fonts/oswald-700-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}
/* Oswald 700 cyrillic */
@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(shared/fonts/oswald-700-cyrillic.woff2) format('woff2');
  unicode-range: U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116;
}
/* Oswald 700 latin-ext */
@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(shared/fonts/oswald-700-latin-ext.woff2) format('woff2');
  unicode-range: U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
/* Oswald 700 latin */
@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(shared/fonts/oswald-700-latin.woff2) format('woff2');
  unicode-range: U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
/* Caveat 500 700 cyrillic-ext */
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url(shared/fonts/caveat-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}
/* Caveat 500 700 cyrillic */
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url(shared/fonts/caveat-cyrillic.woff2) format('woff2');
  unicode-range: U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116;
}
/* Caveat 500 700 latin-ext */
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url(shared/fonts/caveat-latin-ext.woff2) format('woff2');
  unicode-range: U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
/* Caveat 500 700 latin */
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url(shared/fonts/caveat-latin.woff2) format('woff2');
  unicode-range: U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
/* IBM Plex Mono 400 cyrillic-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(shared/fonts/ibm-plex-mono-400-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}
/* IBM Plex Mono 400 cyrillic */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(shared/fonts/ibm-plex-mono-400-cyrillic.woff2) format('woff2');
  unicode-range: U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116;
}
/* IBM Plex Mono 400 latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(shared/fonts/ibm-plex-mono-400-latin-ext.woff2) format('woff2');
  unicode-range: U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
/* IBM Plex Mono 400 latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(shared/fonts/ibm-plex-mono-400-latin.woff2) format('woff2');
  unicode-range: U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
/* IBM Plex Mono 500 cyrillic-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(shared/fonts/ibm-plex-mono-500-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}
/* IBM Plex Mono 500 cyrillic */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(shared/fonts/ibm-plex-mono-500-cyrillic.woff2) format('woff2');
  unicode-range: U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116;
}
/* IBM Plex Mono 500 latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(shared/fonts/ibm-plex-mono-500-latin-ext.woff2) format('woff2');
  unicode-range: U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
/* IBM Plex Mono 500 latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(shared/fonts/ibm-plex-mono-500-latin.woff2) format('woff2');
  unicode-range: U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
/* IBM Plex Mono 700 cyrillic-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(shared/fonts/ibm-plex-mono-700-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}
/* IBM Plex Mono 700 cyrillic */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(shared/fonts/ibm-plex-mono-700-cyrillic.woff2) format('woff2');
  unicode-range: U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116;
}
/* IBM Plex Mono 700 latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(shared/fonts/ibm-plex-mono-700-latin-ext.woff2) format('woff2');
  unicode-range: U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
/* IBM Plex Mono 700 latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(shared/fonts/ibm-plex-mono-700-latin.woff2) format('woff2');
  unicode-range: U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
/* DM Mono 400 latin-ext */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(shared/fonts/dm-mono-400-latin-ext.woff2) format('woff2');
  unicode-range: U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
/* DM Mono 400 latin */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(shared/fonts/dm-mono-400-latin.woff2) format('woff2');
  unicode-range: U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
/* Stardos Stencil 700 latin */
@font-face {
  font-family: 'Stardos Stencil';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(shared/fonts/stardos-stencil-700-latin.woff2) format('woff2');
  unicode-range: U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* shared/tokens.css */
/* Токены оплаты, кабинета и админки. Основа — main site/styles/tokens.css (те же значения),
   плюс продуктовые: поверхности, статусы, размеры для форм. Только тёмная тема. */
:root {
  /* как на основном сайте */
  --bg: #000;
  --fg: #fff;
  --body: #ddd;
  --muted: #a3a3a3;          /* 8.5:1 на чёрном */
  --accent: #ff2d2d;         /* только: главная кнопка, фокус, опасное/внимание, выбранный срок */
  --accent-ink: #000;
  --roughness: 1;
  --grain: 0.08;             /* на продуктовых страницах вдвое слабее, чем на сайте */
  --line: 2px;
  --gutter: clamp(16px, 4vw, 40px);

  /* шрифты */
  --font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --font-hand: 'Caveat', cursive;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --font-logo: 'DM Mono', ui-monospace, monospace;
  --font-stencil: 'Stardos Stencil', var(--font-mono);

  /* продукт */
  --subtle: #8a8a8a;         /* подписи, 5.9:1 — темнее для текста не используем */
  --surface: #0a0a0a;        /* карточки */
  --surface-2: #141414;      /* поля ввода, вложенные блоки */
  --rule: #2a2a2a;           /* тонкие разделители */
  --rule-strong: #4a4a4a;
  --ok: #fff;                /* статусы: цвет одинаковый, различаются иконкой, словом и рамкой */
  --warn: var(--accent);

  --step--1: 0.8125rem;
  --step-0: 0.9375rem;
  --step-1: 1.125rem;
  --step-2: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);   /* заголовок экрана */
  --step-3: clamp(2.2rem, 1.6rem + 2.6vw, 3.6rem);   /* крупные цифры: цена, баланс, дни */

  --tap: 44px;               /* минимальная зона нажатия */
  --radius: 0;               /* углов нет — бумага */
  --header-h: 64px;
  --nav-h: 64px;
  --max: 1120px;
  --speed: 0.32s;
}

/* shared/base.css */
/* База: сброс, типографика, фокус, утилиты. Подключать после fonts.css и tokens.css. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--fg);
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-mono);
  font-size: var(--step-0);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

/* фокус виден всегда: белая обводка + акцентное кольцо; у полей не отключаем */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 1px var(--fg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 700;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* заголовки: сжатый гротеск, капс — как на сайте */
.display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.05;   /* не меньше: «Ё» и «Й» не налезают на строку выше */
  letter-spacing: 0.005em;
  color: var(--fg);
}

/* рукописные пометки — только декоративные, короткие */
.hand {
  font-family: var(--font-hand);
  font-weight: 700;
  line-height: 1.1;
  color: var(--fg);
}

/* цифры денег, дат и сроков — моноширинные, ровные столбцы, без эффектов */
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}

.muted {
  color: var(--muted);
}

/* ксерокс: только заголовки, дудлы, рамки */
.xerox {
  filter: url(#xerox);
}

.xerox-strong {
  filter: url(#xerox-strong);
}

/* иконка из спрайта: <svg class="ic"><use href="#d-check"/></svg> */
.ic {
  width: 1.25em;
  height: 1.25em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

/* второй (тонкий) штрих и заливка облака заданы атрибутами в спрайте (shared/partials/doodles.svg) */

/* зерно поверх страницы — статичный SVG-шум, без WebGL; очень слабое */
.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: calc(var(--grain) * 1.6);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='1' stitchTiles='stitch'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='0 0 0 0 0 0 1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(shared/%23n)'/%3E%3C/svg%3E");
}

/* «печать» при появлении: скрываем ТОЛЬКО если модуль анимаций запустился (html.motion-ok).
   Нет JS, нет GSAP, сбой, reduced-motion — всё видно сразу. */
.motion-ok [data-print] {
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* shared/components.css */
/* Общие компоненты оплаты, кабинета и админки. Витрина всех состояний — tools/kit (node tools/build.mjs kit).
   Правило ксерокса: фильтры только у рамок, дудлов и заголовков. Цены, баланс, даты, ссылки, QR, поля,
   ошибки и юридический текст — всегда чёткие. */

/* ---------- раскладка ---------- */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap, 16px);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--gap, 12px);
  flex-wrap: wrap;
}

.screen-title {
  font-size: var(--step-2);
  margin: 8px 0 4px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 0;
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.note-hand {
  display: inline-block;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.1;
  color: var(--fg);
  transform: rotate(-3deg);
}

/* ---------- шапка ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

.app-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  text-decoration: none;
}

.logo-cloud {
  width: 1.7em;
  height: auto;
  overflow: visible;
}

.logo-word {
  font-family: var(--font-logo);
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- кнопки ---------- */
/* Поведение как на основном сайте (main site: Hero/Pricing):
   главная (акцент) — при наведении мерцает «ступеньками»; контурная — текст и рамка в акцент; белая — текст в акцент.
   Ступени и длительность — переменные: shared/js/motion.js меняет их на каждое наведение (неровный, «живой» FPS). */
.btn {
  --btn-fg: var(--fg);
  --fps-steps: 7;
  --fps-dur: 1s;   /* мерцание ≥ 0.9 с на цикл — меньше трёх вспышек в секунду (WCAG 2.3.1) */
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 12px 20px;
  border: var(--line) solid var(--btn-fg);
  background: transparent;
  color: var(--btn-fg);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  text-wrap: balance;
  cursor: pointer;
  transition: color 0.2s steps(var(--fps-steps)), border-color 0.2s steps(var(--fps-steps)), background 0.2s steps(var(--fps-steps));
}

.btn:hover,
.btn:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

/* главная — единственная акцентная на экране */
.btn--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  border-color: var(--accent);
  color: var(--accent-ink);
  animation: flicker var(--fps-dur) steps(var(--fps-steps)) infinite;
}

/* белая залитая (как «оплатить» в ценах на сайте) */
.btn--light {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--bg);
}

.btn--light:hover,
.btn--light:focus-visible {
  border-color: var(--fg);
  color: var(--accent);
}

/* мягкое мерцание: неглубокое (до 0.75) и медленное — заметно, но не «стробит» */
@keyframes flicker {
  0%, 100% { opacity: 1; }
  25% { opacity: 0.75; }
  50% { opacity: 1; }
  75% { opacity: 0.88; }
}

.btn--quiet {
  border-color: var(--rule-strong);
  color: var(--body);
}

.btn--quiet:hover,
.btn--quiet:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--text {
  min-height: var(--tap);
  padding: 8px 4px;
  border: 0;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.btn--text:hover {
  background: transparent;
  color: var(--fg);
}

.btn--danger {
  --btn-fg: var(--accent);
}

.btn--danger:hover,
.btn--danger:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  animation: flicker var(--fps-dur) steps(var(--fps-steps)) infinite;
}

.btn--block {
  width: 100%;
}

.btn--icon {
  width: var(--tap);
  padding: 0;
}

.btn[disabled],
.btn[aria-disabled='true'] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* идёт запрос: текст остаётся, справа «печатаются» точки */
.btn[aria-busy='true']::after {
  content: '';
  width: 1.4em;
  text-align: left;
  animation: busy-dots 1s steps(4) infinite;
}

@keyframes busy-dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

/* ---------- поля ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: var(--line) solid var(--rule-strong);
  background: var(--surface-2);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 1rem;
  border-radius: 0;
}

.input::placeholder {
  color: #6f6f6f;
}

.input:hover {
  border-color: var(--muted);
}

.input:focus {
  border-color: var(--fg);
}

.input[aria-invalid='true'] {
  border-color: var(--accent);
}

.field-hint {
  font-size: var(--step--1);
  color: var(--subtle);
}

.field-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: var(--step--1);
  color: var(--accent);
}

.field-error .ic {
  margin-top: 2px;
}

/* переключатель «регистрация / вход» и т. п. */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  border: var(--line) solid var(--rule-strong);
}

.segmented button {
  min-height: var(--tap);
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.segmented button[aria-pressed='true'],
.segmented button.is-active {
  background: var(--fg);
  color: var(--bg);
}

/* переключатель вкл/выкл */
.switch {
  position: relative;
  display: inline-flex;
  width: 52px;
  height: 30px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  margin: 0;
}

.switch-track {
  width: 100%;
  height: 100%;
  border: var(--line) solid var(--rule-strong);
  background: var(--surface-2);
  pointer-events: none;
}

.switch-track::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  width: 20px;
  height: 20px;
  background: var(--muted);
  transition: transform var(--speed) steps(3), background var(--speed) steps(3);
}

.switch input:checked + .switch-track {
  border-color: var(--fg);
}

.switch input:checked + .switch-track::after {
  transform: translateX(22px);
  background: var(--fg);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- карточки ---------- */
.card {
  position: relative;
  padding: clamp(16px, 3vw, 24px);
  background: var(--surface);
  border: var(--line) solid var(--rule-strong);   /* запасная рамка, пока не нарисована */
  color: var(--body);
}

.card.is-rough {
  border-color: transparent;
}

.rough {
  position: absolute;
  inset: calc(var(--line) * -1);
  width: calc(100% + var(--line) * 2);
  height: calc(100% + var(--line) * 2);
  pointer-events: none;
  overflow: visible;
  color: var(--rule-strong);
}

.card--strong .rough,
.card:hover .rough {
  color: var(--fg);
}

.card--alert .rough {
  color: var(--accent);
}

a.card,
button.card {
  display: block;
  width: 100%;
  text-align: left;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.card-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-1);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--fg);
}

/* пары «подпись — значение» (сводка заказа, данные подписки) */
.kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}

.kv:last-child {
  border-bottom: 0;
}

.kv-label {
  color: var(--muted);
  font-size: var(--step--1);
}

.kv-value {
  color: var(--fg);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.kv--total .kv-value {
  font-size: var(--step-2);
  font-weight: 500;
}

.price-old {
  margin-right: 8px;
  color: var(--subtle);
  text-decoration: line-through;
}

/* ---------- статусы: иконка + слово + рисунок рамки, не только цвет ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border: var(--line) solid var(--fg);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge .ic {
  width: 1em;
  height: 1em;
  stroke-width: 9;
}

.badge--ok {
  background: var(--fg);
  color: var(--bg);
}

.badge--wait {
  border-style: dashed;
  color: var(--fg);
}

.badge--alert {
  border-style: double;
  border-width: 4px;
  border-color: var(--accent);
  color: var(--accent);
  padding: 1px 8px 1px 6px;
}

.badge--neutral {
  border-color: var(--rule-strong);
  color: var(--muted);
}

/* крупный статус экрана: «оплата прошла», «проверяем платёж»… */
.status {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  align-items: center;
}

.status-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: var(--line) solid var(--fg);
  color: var(--fg);
}

.status-icon .ic {
  width: 30px;
  height: 30px;
  stroke-width: 8;
}

.status-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 1.1rem + 1.1vw, 2rem);
  text-transform: uppercase;
  line-height: 1.05;   /* не меньше: «Ё» и «Й» не налезают на строку выше */
  color: var(--fg);
}

.status-text {
  margin: 0;
  color: var(--body);
}

.status[data-kind='ok'] .status-icon {
  background: var(--fg);
  color: var(--bg);
}

.status[data-kind='wait'] .status-icon {
  border-style: dashed;
}

.status[data-kind='wait'] .status-icon .ic {
  animation: tick 2s steps(8) infinite;
}

@keyframes tick {
  to { transform: rotate(360deg); }
}

.status[data-kind='alert'] .status-icon {
  border: 4px double var(--accent);
  color: var(--accent);
}

.status[data-kind='neutral'] .status-icon {
  border-color: var(--rule-strong);
  color: var(--muted);
}

/* ---------- шкала (срок, трафик) ---------- */
.meter {
  position: relative;
  height: 10px;
  border: 1px solid var(--rule-strong);
  background: var(--surface-2);
}

.meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--fg);
}

.meter--alert .meter-fill {
  background: var(--accent);
}

/* без лимита — штриховка вместо заливки */
.meter--unlimited .meter-fill {
  width: 100% !important;
  background: repeating-linear-gradient(-45deg, var(--rule-strong) 0 4px, transparent 4px 9px);
}

/* ---------- строки списков (операции, устройства) ---------- */
.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4px 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}

.list-row:last-child {
  border-bottom: 0;
}

.list-row > .ic {
  color: var(--muted);
}

.list-title {
  color: var(--fg);
}

.list-meta {
  font-size: var(--step--1);
  color: var(--subtle);
}

.list-amount {
  text-align: right;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.list-row.is-canceled .list-title,
.list-row.is-canceled .list-amount {
  color: var(--subtle);
  text-decoration: line-through;
}

/* ---------- пусто / загрузка / ошибка ---------- */
.empty,
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 16px;
  text-align: center;
}

.empty .doodle,
.error-state .doodle {
  width: 72px;
  height: 72px;
  color: var(--fg);
}

.error-state .doodle {
  color: var(--accent);
}

.empty p,
.error-state p {
  margin: 0;
  max-width: 34ch;
}

/* скелет — «бледная ксерокопия»: серые полосы, мигают ступеньками */
.skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-bar {
  height: 14px;
  background: #222;
  animation: skeleton 1.8s steps(6) infinite alternate;
}

.skeleton-bar--title {
  width: 45%;
  height: 28px;
}

.skeleton-bar--short {
  width: 30%;
}

.skeleton-card {
  height: 120px;
  background: var(--surface-2);
  border: var(--line) dashed var(--rule-strong);
  animation: skeleton 1.8s steps(6) infinite alternate;
}

@keyframes skeleton {
  from { opacity: 1; }
  to { opacity: 0.45; }
}

/* ---------- ссылка подписки и QR ---------- */
.copy-field {
  display: flex;
  align-items: stretch;
  border: var(--line) solid var(--rule-strong);
  background: var(--surface-2);
}

.copy-field-value {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  color: var(--fg);
  user-select: all;
}

.copy-field .btn {
  border-width: 0 0 0 var(--line);
  border-color: var(--rule-strong);
}

/* QR — белый квадрат, без фильтров и зерна */
.qr {
  position: relative;
  z-index: 91;
  display: grid;
  place-items: center;
  width: min(260px, 100%);
  aspect-ratio: 1;
  margin: 0 auto;
  padding: 14px;
  background: #fff;
}

.qr img,
.qr canvas,
.qr svg {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

/* ---------- шаги оплаты ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-top: 10px;
  border-top: 3px solid var(--rule);
  color: var(--subtle);
  font-size: var(--step--1);
  text-transform: lowercase;
}

.step-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1;
}

.step[aria-current='step'] {
  border-top-color: var(--fg);
  color: var(--fg);
}

.step.is-done {
  border-top-color: var(--rule-strong);
  color: var(--muted);
}

/* ---------- выбор срока ---------- */
.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  min-height: 120px;
  padding: 16px 18px;
  border: var(--line) solid var(--rule-strong);
  background: var(--surface);
  color: var(--body);
  text-align: left;
  cursor: pointer;
}

.choice:hover {
  border-color: var(--fg);
}

.choice-title {
  position: relative;
  align-self: flex-start;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-1);
  text-transform: uppercase;
  color: var(--fg);
}

.choice-price {
  font-size: var(--step-2);
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.choice-price small {
  font-size: var(--step--1);
  color: var(--muted);
}

.choice-total {
  font-size: var(--step--1);
  color: var(--muted);
}

/* выбранный — акцентная рамка и каракуля вокруг названия (акцент разрешён) */
.choice[aria-checked='true'] {
  border-color: var(--accent);
}

.choice .choice-oval {
  position: absolute;
  inset: -10px -18px;
  width: calc(100% + 36px);
  height: calc(100% + 20px);
  color: var(--accent);
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  max-width: none;
  visibility: hidden;
}

.choice[aria-checked='true'] .choice-oval {
  visibility: visible;
}

.choice-tag {
  position: absolute;
  top: 10px;
  right: 12px;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fg);
  transform: rotate(4deg);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 14px;
}

/* ---------- тост и диалог ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom));
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 460px);
  padding: 12px 16px;
  background: var(--fg);
  color: var(--bg);
  font-size: var(--step--1);
  transform: translateX(-50%);
}

.toast[data-kind='alert'] {
  background: var(--bg);
  color: var(--fg);
  border: 4px double var(--accent);
}

.dialog {
  width: min(92vw, 440px);
  padding: 24px;
  border: var(--line) solid var(--fg);
  background: var(--bg);
  color: var(--body);
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
}

.dialog-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-1);
  text-transform: uppercase;
  color: var(--fg);
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* ---------- навигация кабинета ---------- */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg);
  /* «оторванный» верхний край */
  clip-path: polygon(0 6px, 6% 1px, 12% 5px, 19% 0, 27% 4px, 35% 1px, 44% 6px, 52% 2px, 61% 5px, 70% 0, 78% 4px, 87% 1px, 94% 5px, 100% 2px, 100% 100%, 0 100%);
  border-top: 1px solid var(--rule-strong);
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: var(--nav-h);
  color: var(--subtle);
  font-size: 0.75rem;
  text-decoration: none;
}

.bottom-nav a[aria-current='page'] {
  color: var(--fg);
}

.bottom-nav a[aria-current='page'] .ic {
  stroke-width: 9;
}

@media (min-width: 900px) {
  .bottom-nav {
    position: static;
    grid-auto-columns: max-content;
    gap: 24px;
    padding: 0;
    clip-path: none;
    border: 0;
    background: transparent;
  }

  .bottom-nav a {
    flex-direction: row;
    min-height: var(--tap);
    font-size: var(--step--1);
  }
}

/* ---------- таблицы админки ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rule-strong);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}

.table th,
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  white-space: nowrap;
}

.table th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table tbody tr:hover {
  background: var(--surface-2);
}

.table td.num,
.table th.num {
  text-align: right;
}

/* lk.css */
/***********************************
 * melodico cabinet (LK)
 * Токены и базовые компоненты — как в checkout (../custom.css)
 ***********************************/
:root {
    /* 2.0: переменные старого кабинета переназначены на общие токены (shared/tokens.css).
       Экраны постепенно переезжают в cabinet.css; что переехало — удаляется отсюда. */
    --font: var(--font-mono);
    --gap: 16px;
    --border-thickness: var(--line);
    --transition: var(--speed) steps(3);

    --text-0: var(--fg);
    --text-1: var(--fg);
    --text-2: var(--body);
    --text-3: var(--muted);
    --text-4: var(--subtle);
    --text-5: #6f6f6f;   /* только декоративные линии/плейсхолдеры, не текст */

    --bg-1: #1f1f1f;
    --bg-2: var(--surface-2);
    --bg-3: var(--surface);
    --bg-4: var(--bg);

    --hover: rgba(255, 255, 255, 0.06);
    --active: rgba(255, 255, 255, 0.12);
    --border: var(--rule);
    --border-hover: var(--fg);
    --button-border: var(--rule-strong);

    --header-h: 64px;
    --nav-h: 64px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: var(--font);
    font-weight: 300;
    letter-spacing: -0.04ch;
    background: var(--bg-4);
    color: var(--text-3);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.35;
}

::selection {
    background: var(--active);
    color: var(--text-0);
}

button {
    font-family: inherit;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- panel / button (как в checkout) --- */
.panel {
    position: relative;
    background: var(--bg-3);
    border: var(--border-thickness) solid var(--border);
    border-radius: 0;
    padding: var(--gap);
    transition: border-color 0.3s steps(3);
}

.panel:hover {
    border-color: var(--border-hover);
}

/* .btn, .btn:hover — в shared/components.css (как на основном сайте) */
.btn--block {
    width: 100%;
}

/* иконки из макета (assets/icons) через маску — цвет берётся из currentColor */
.mask-icon {
    display: inline-block;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    background-color: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}

.icon-home { --icon: url(assets/icons/home.svg); }
.icon-profile { --icon: url(assets/icons/profile.svg); }
.icon-settings { --icon: url(assets/icons/settings.svg); }
.icon-link { --icon: url(assets/icons/link.png); }
.icon-globe { --icon: url(assets/icons/tariff-globe.svg); }
.status-dot { --icon: url(assets/icons/status-dot.svg); }

/* в макете иконка кошелька отражена по горизонтали */
.icon-wallet {
    --icon: url(assets/icons/wallet.svg);
    transform: scaleX(-1);
}

/***********************************
 * Header
 ***********************************/
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--bg-4) 85%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap);
    min-height: var(--header-h);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text-1);
    text-decoration: none;
    font-weight: 400;
    font-size: 1.05rem;
    transition: color var(--transition);
}

.logo:hover {
    color: var(--text-0);
}

/* тот же глиф и размер, что fa-cloud на лендинге и в checkout */
.logo-icon {
    width: 1.25rem;
    height: 1rem;
    flex-shrink: 0;
}

.theme-toggle,
.lang-toggle,
.icon-btn {
    position: relative;
    min-width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}

.lang-toggle {
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    padding: 0 12px;
}

.icon-btn {
    font-size: 0.9rem;
}

.theme-toggle:hover,
.lang-toggle:hover,
.icon-btn:hover {
    background: var(--hover);
    border-color: var(--border-hover);
    color: var(--text-0);
    /* 2.0: без «прыжка» — как на сайте, отклик цветом */
}

.theme-icon-dark,
.theme-icon-light {
    position: absolute;
    transition: opacity var(--transition), transform var(--transition);
}

.theme-icon-light {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

[data-theme="light"] .theme-icon-dark {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

[data-theme="light"] .theme-icon-light {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/***********************************
 * Layout
 ***********************************/
.site-main {
    position: relative;
    z-index: 1;
    padding-top: calc(var(--header-h) + 32px);
    padding-bottom: calc(var(--nav-h) + 64px + env(safe-area-inset-bottom));
}

.lk-container {
    max-width: 1088px;
}

.view {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.view-title {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-1);
    text-transform: lowercase;
    text-align: center;
}

.view-empty,
.placeholder-panel p {
    font-size: 0.9rem;
    color: var(--text-4);
    line-height: 1.7;
    text-align: center;
}

.placeholder-panel.panel {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 32px;
}

/***********************************
 * Main: subscriptions list
 ***********************************/
.sub-list {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* «новая подписка» и тест под списком — той же ширины, что и список */
#viewMain .renew-link-card {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
}

.sub-row.panel {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.18s steps(3), background-color 0.18s steps(3);
}

.sub-row.panel:hover {
    background: var(--hover);
}

.sub-row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sub-row-name {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-1);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sub-row-meta {
    font-size: 0.8rem;
    color: var(--text-4);
}

.sub-row .tile-arrow {
    color: var(--subtle);   /* текст не темнее #8a8a8a (≥ 4.5:1) */
}

/***********************************
 * Sub page
 ***********************************/
.sub-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sub-nav-title {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-1);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sub-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
    gap: 40px;
}

.sub-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

/* sub info */
.sub-info.panel {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sub-info-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    font-size: 0.75rem;
    text-transform: lowercase;
    letter-spacing: 0.02em;
    color: var(--bg-4);
    background: var(--text-0);
}

.status-chip .status-dot {
    width: 7px;
    height: 7px;
}

.status-chip.is-muted {
    color: var(--text-2);
    background: transparent;
    border: 1px solid var(--border-hover);
}

.sub-tariff {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-3);
}

.sub-tariff .icon-globe {
    width: 15px;
    height: 15px;
    color: var(--text-1);
}

.sub-days {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-top: 6px;
}

.sub-days-value {
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--text-0);
}

.sub-days-label {
    font-size: 0.85rem;
    color: var(--text-4);
    text-transform: lowercase;
}

.days-bar {
    height: 10px;
    background: var(--bg-1);
}

.days-bar-fill {
    height: 100%;
    width: 0;
    background: var(--text-0);
    transition: width 0.8s steps(3);
}

.sub-until {
    font-size: 0.75rem;
    color: var(--text-4);
    text-transform: lowercase;
}

/* tiles: иконка + стрелка, заголовок, подпись (референс из чата) */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.tile.panel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-height: 148px;
    padding: 24px;
    font-family: inherit;
    text-align: left;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.18s steps(3), background-color 0.18s steps(3), transform 0.18s steps(3);
}

.tile.panel:hover {
    background: var(--hover);
    /* 2.0: без «прыжка» — как на сайте, отклик цветом */
}

.tile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: auto;
    padding-bottom: 20px;
}

.tile-icon {
    font-size: 1.35rem;
    color: var(--text-3);
    transition: color var(--transition);
}

.tile-arrow {
    font-size: 0.8rem;
    color: var(--subtle);   /* текст не темнее #8a8a8a (≥ 4.5:1) */
    transition: color var(--transition), transform var(--transition);
}

.tile:hover .tile-icon,
.tile:hover .tile-arrow,
.sub-row:hover .tile-arrow {
    color: var(--text-0);
}

.tile:hover .tile-arrow,
.sub-row:hover .tile-arrow {
    transform: translateX(3px);
}

.tile-title {
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--text-1);
    text-transform: lowercase;
}

.tile-sub {
    font-size: 0.85rem;
    color: var(--text-4);
}

/* auto renew */
.auto-renew.panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
}

.auto-renew-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text-2);
    text-transform: lowercase;
}

.soon-badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--subtle);   /* текст не темнее #8a8a8a (≥ 4.5:1) */
    padding: 3px 8px;
    border: 1px solid var(--border);
}

.switch {
    position: relative;
    width: 48px;
    height: 24px;
    padding: 2px;
    background: transparent;
    border: 1px solid var(--border-hover);
    cursor: pointer;
}

.switch-knob {
    display: block;
    width: 18px;
    height: 18px;
    background: var(--text-4);
    transition: transform var(--transition), background-color var(--transition);
}

.switch[aria-checked="true"] {
    background: var(--text-0);
    border-color: var(--text-0);
}

.switch[aria-checked="true"] .switch-knob {
    transform: translateX(24px);
    background: var(--bg-4);
}

.switch:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* side: QR + link / apps / settings */
.sub-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qr-panel.panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 24px;
}

/* QR всегда тёмный на белом, чтобы сканировался в любой теме */
.qr-box {
    width: 100%;
    aspect-ratio: 1;
    padding: 14px;
    background: #ffffff;
}

.qr-box svg {
    display: block;
    width: 100%;
    height: 100%;
}

.qr-hint {
    font-size: 0.75rem;
    color: var(--subtle);   /* текст не темнее #8a8a8a (≥ 4.5:1) */
    text-align: center;
}

.side-btn.btn {
    padding: 14px 20px;
    font-size: 0.9rem;
}

/* сдвиг и нажатие у .js-press делает GSAP (lk.js → initPressMotion), CSS transform не трогаем */
.js-press,
.js-press:hover {
    transform: none;
    transition-property: background-color, color, border-color;
    will-change: transform;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.side-btn .mask-icon {
    width: 17px;
    height: 17px;
}

/* иконка apps в макете — четыре квадрата */
.apps-icon {
    display: inline-grid;
    grid-template-columns: repeat(2, 7px);
    gap: 2px;
}

.apps-icon i {
    width: 7px;
    height: 7px;
    background: currentColor;
}

/***********************************
 * Wallet / profile — общие блоки
 ***********************************/
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
}

.section-title,
.side-panel-title {
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--subtle);   /* текст не темнее #8a8a8a (≥ 4.5:1) */
}

.section-count {
    font-size: 0.75rem;
    color: var(--subtle);   /* текст не темнее #8a8a8a (≥ 4.5:1) */
}

/* баланс и бонусные дни */
.stats-panel.panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 24px;
    padding: 24px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.stat + .stat {
    padding-left: 24px;
    border-left: 1px solid var(--border);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-4);
    text-transform: lowercase;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--text-0);
}

.stats-note {
    grid-column: 1 / -1;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-4);
    line-height: 1.6;
}

/* история операций */
.op-list.panel {
    padding: 0 24px;
}

.op-row {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
}

.op-row + .op-row {
    border-top: 1px solid var(--border);
}

.op-icon {
    font-size: 0.9rem;
    color: var(--text-3);
    text-align: center;
}

.op-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.op-title {
    font-size: 0.9rem;
    color: var(--text-1);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.op-meta {
    font-size: 0.75rem;
    color: var(--text-4);
}

.op-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 0.9rem;
    color: var(--text-1);
    white-space: nowrap;
}

.op-status {
    font-size: 0.7rem;
    color: var(--subtle);   /* текст не темнее #8a8a8a (≥ 4.5:1) */
    text-transform: lowercase;
}

.op-row.is-muted .op-title,
.op-row.is-muted .op-amount {
    color: var(--text-4);
}

.op-row.is-muted .op-amount > span:first-child {
    text-decoration: line-through;
}

/* боковая панель со списком */
.side-panel.panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

.check-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.check-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text-2);
}

.check-list i {
    width: 14px;
    font-size: 0.75rem;
    color: var(--text-0);
    text-align: center;
}

.check-list li.is-soon,
.check-list li.is-soon i {
    color: var(--subtle);   /* текст не темнее #8a8a8a (≥ 4.5:1) */
}

.check-list .soon-badge {
    margin-left: auto;
}

/* аккаунт */
.account-panel.panel {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
}

.account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border: 1px solid var(--border-hover);
    color: var(--text-1);
}

.account-avatar .mask-icon {
    width: 24px;
    height: 24px;
}

.account-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.account-name {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text-0);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-since {
    font-size: 0.8rem;
    color: var(--text-4);
}

/* способы входа */
.login-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-row.panel {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 16px 16px 16px 24px;
}

.login-icon {
    font-size: 1.1rem;
    color: var(--text-2);
    text-align: center;
}

.login-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.login-title {
    font-size: 0.75rem;
    color: var(--text-4);
    text-transform: lowercase;
}

.login-value {
    font-size: 0.95rem;
    color: var(--text-1);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.login-row.is-empty .login-value,
.login-row.is-soon .login-value,
.login-row.is-soon .login-icon {
    color: var(--subtle);   /* текст не темнее #8a8a8a (≥ 4.5:1) */
}

.login-action.btn {
    padding: 10px 16px;
    font-size: 0.8rem;
}

.login-row.is-empty .login-action.btn {
    background: var(--text-0);
    border-color: var(--text-0);
    color: var(--bg-4);
}

.login-row.is-empty .login-action.btn:hover {
    background: var(--text-2);
    border-color: var(--text-2);
}

.login-hint {
    margin: -4px 0 4px;
    padding: 0 4px;
    font-size: 0.75rem;
    color: var(--text-4);
    line-height: 1.6;
}

/* реферальная панель */
.ref-panel.panel {
    align-items: stretch;
}

.ref-text {
    font-size: 0.8rem;
    color: var(--text-3);
    line-height: 1.6;
}

.ref-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

.ref-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.ref-stat + .ref-stat {
    border-left: 1px solid var(--border);
}

.ref-stat-value {
    font-size: 1.1rem;
    color: var(--text-0);
}

.ref-stat-label {
    font-size: 0.65rem;
    color: var(--subtle);   /* текст не темнее #8a8a8a (≥ 4.5:1) */
    line-height: 1.3;
}

/***********************************
 * Подстраницы подписки: трафик, устройства, продление, история
 ***********************************/
a.tile.panel {
    text-decoration: none;
}

.sub-nav-section {
    color: var(--text-4);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* использование: трафик / устройства */
.usage-panel.panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
}

.usage-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.usage-value {
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--text-0);
}

.usage-limit {
    font-size: 0.85rem;
    color: var(--text-4);
}

.usage-note {
    font-size: 0.8rem;
    color: var(--text-4);
    line-height: 1.6;
}

/* график по дням: одна серия, монохром, подсказка по наведению */
.chart-panel.panel {
    position: relative;
    margin: 0;
    padding: 24px 24px 16px;
}

.chart {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    align-items: end;
    gap: 2px;
    height: 180px;
    border-bottom: 1px solid var(--border-hover);
}

.chart-col {
    position: relative;
    display: flex;
    align-items: flex-end;
    height: 100%;
    cursor: default;
}

/* зона наведения — весь столбец, не только сам столбик */
.chart-bar {
    width: 100%;
    min-height: 2px;
    background: var(--text-2);
    transition: background-color var(--transition);
}

.chart-col:hover .chart-bar,
.chart-col:focus-visible .chart-bar {
    background: var(--text-0);
}

.chart-col:focus-visible {
    outline: 1px solid var(--border-hover);
    outline-offset: 2px;
}

.chart-axis {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 2px;
    padding-top: 8px;
    font-size: 0.65rem;
    color: var(--subtle);   /* текст не темнее #8a8a8a (≥ 4.5:1) */
}

.chart-axis span {
    text-align: center;
    white-space: nowrap;
}

.chart-tip {
    position: absolute;
    z-index: 2;
    padding: 8px 10px;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-1);
    background: var(--bg-4);
    border: 1px solid var(--border-hover);
    pointer-events: none;
    white-space: nowrap;
    transform: translate(-50%, calc(-100% - 8px));
}

.chart-tip b {
    font-weight: 400;
    color: var(--text-0);
}

/* доли по серверам */
.share-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.share-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.share-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-2);
}

.share-head span:last-child {
    color: var(--text-4);
    white-space: nowrap;
}

.share-bar {
    height: 4px;
    background: var(--bg-1);
}

.share-bar i {
    display: block;
    height: 100%;
    background: var(--text-2);
}

/* устройства */
.device-list .op-row {
    grid-template-columns: 20px minmax(0, 1fr) auto;
}

.device-remove.btn {
    padding: 10px 14px;
    font-size: 0.8rem;
}

.device-remove.is-confirm {
    background: var(--text-0);
    border-color: var(--text-0);
    color: var(--bg-4);
}

.device-list .op-row.is-removing {
    opacity: 0.4;
    pointer-events: none;
}

/* продление: карточки сроков как в checkout */
.duration-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.duration-card.panel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 24px;
    font-family: inherit;
    text-align: left;
    color: inherit;
    background: transparent;
    cursor: pointer;
    transition: border-color 0.18s steps(3), background-color 0.18s steps(3);
}

.duration-card.panel:hover {
    background: var(--hover);
}

.duration-card.is-selected {
    border-color: var(--text-0);
    background: var(--active);
}

.duration-title {
    font-size: 1.1rem;
    color: var(--text-1);
}

.duration-price {
    font-size: 1.6rem;
    color: var(--text-0);
}

.duration-price small,
.duration-total {
    font-size: 0.8rem;
    color: var(--text-4);
}

.duration-total s {
    color: var(--subtle);   /* текст не темнее #8a8a8a (≥ 4.5:1) */
}

.duration-select {
    margin-top: 6px;
    padding: 5px 10px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--subtle);   /* текст не темнее #8a8a8a (≥ 4.5:1) */
    border: 1px solid var(--border);
}

.duration-card.is-selected .duration-select {
    color: var(--bg-4);
    background: var(--text-0);
    border-color: var(--text-0);
}

.renew-trial-note {
    padding: 14px 18px;
    border: 1px dashed var(--border-hover);
}

.order-card.panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
}

.order-title {
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--text-1);
    text-transform: lowercase;
}

.order-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.85rem;
}

.order-label {
    color: var(--text-4);
    text-transform: lowercase;
}

.order-value {
    color: var(--text-2);
    text-align: right;
}

.order-value--total {
    font-size: 1.3rem;
    color: var(--text-0);
}

.order-value--total s {
    font-size: 0.8rem;
    color: var(--subtle);   /* текст не темнее #8a8a8a (≥ 4.5:1) */
}

.order-divider {
    height: 1px;
    background: var(--border);
}

.order-note {
    font-size: 0.72rem;
    color: var(--subtle);   /* текст не темнее #8a8a8a (≥ 4.5:1) */
    line-height: 1.6;
    text-align: center;
}

/* .btn--primary, .btn:disabled — в shared/components.css */

.stats-panel--side.panel {
    grid-template-columns: minmax(0, 1fr);
}

.stats-panel--side .stat + .stat {
    padding-left: 0;
    padding-top: 16px;
    border-left: 0;
    border-top: 1px solid var(--border);
}

/***********************************
 * Вход, формы, оплата
 ***********************************/
/* гость (вход, продление без входа): без нижнего меню и кнопки выхода */
body.is-guest .bottom-nav,
body.is-guest #logoutButton {
    display: none;
}

body.is-guest .site-main {
    padding-bottom: 64px;
}

.login-wrap {
    width: 100%;
    max-width: 440px;
    margin: 4vh auto 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-card.panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 32px;
}

.login-heading {
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--text-0);
    text-transform: lowercase;
}

.login-lead {
    margin-top: -8px;
    font-size: 0.85rem;
    color: var(--text-4);
    line-height: 1.6;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--subtle);   /* текст не темнее #8a8a8a (≥ 4.5:1) */
}

.field-input {
    width: 100%;
    padding: 14px 16px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-0);
    background: var(--bg-4);
    border: 1px solid var(--border-hover);
    border-radius: 0;
    outline: none;
    transition: border-color var(--transition);
}

.field-input::placeholder {
    color: var(--subtle);   /* текст не темнее #8a8a8a (≥ 4.5:1) */
}

.field-input:focus {
    border-color: var(--text-0);
}

.field-input--code {
    font-size: 1.4rem;
    letter-spacing: 0.4em;
    text-align: center;
}

/* убрать стрелки у number */
.field-input[type="number"] {
    -moz-appearance: textfield;
}

.field-input[type="number"]::-webkit-outer-spin-button,
.field-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.code-step {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.code-actions,
.inline-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.link-btn {
    padding: 0;
    font-family: inherit;
    font-size: 0.78rem;
    color: var(--text-4);
    text-decoration: underline;
    text-underline-offset: 3px;
    background: none;
    border: 0;
    cursor: pointer;
}

.link-btn:hover {
    color: var(--text-0);
}

.link-btn:disabled {
    opacity: 0.5;
    cursor: default;
    text-decoration: none;
}

.form-error {
    padding: 10px 12px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-1);
    border: 1px dashed var(--border-hover);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--subtle);   /* текст не темнее #8a8a8a (≥ 4.5:1) */
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.tg-wait {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.tg-wait-text {
    display: flex;
    gap: 10px;
    align-items: baseline;
    font-size: 0.85rem;
    color: var(--text-3);
    line-height: 1.6;
}

.status-mark {
    display: inline-block;
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    background: var(--text-0);
    border-radius: 50%;
}

.status-mark.online {
    animation: lk-pulse 1.6s ease-in-out infinite;
}

@keyframes lk-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.renew-link-card.panel {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 24px;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.18s steps(3), background-color 0.18s steps(3);
}

.renew-link-card.panel:hover {
    background: var(--hover);
}

.renew-link-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.renew-link-title {
    font-size: 0.95rem;
    color: var(--text-1);
}

.renew-link-sub {
    font-size: 0.78rem;
    color: var(--text-4);
    line-height: 1.5;
}

.renew-link-card:hover .tile-icon,
.renew-link-card:hover .tile-arrow {
    color: var(--text-0);
}

.renew-link-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* способ оплаты */
.pay-methods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.pay-method {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px;
    font-family: inherit;
    font-size: 0.82rem;
    text-align: left;
    text-transform: lowercase;
    color: var(--text-2);
    background: transparent;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color var(--transition), background-color var(--transition);
}

.pay-method:hover {
    border-color: var(--border-hover);
}

.pay-method.is-selected {
    color: var(--text-0);
    border-color: var(--text-0);
    background: var(--active);
}

.pay-method:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pay-method-sub {
    font-size: 0.72rem;
    color: var(--text-4);
}

/* пополнение */
.topup-presets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.topup-preset {
    padding: 12px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-2);
    background: transparent;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color var(--transition), background-color var(--transition), color var(--transition);
}

.topup-preset:hover {
    border-color: var(--border-hover);
}

.topup-preset.is-selected {
    color: var(--bg-4);
    background: var(--text-0);
    border-color: var(--text-0);
}

/* формы привязки в профиле */
.inline-form.panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px 24px;
}

.login-note {
    font-size: 0.78rem;
    color: var(--text-3);
    line-height: 1.6;
}

.login-badge {
    align-self: flex-start;
    margin-top: 2px;
    padding: 2px 6px;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-4);
    border: 1px solid var(--border);
}

.auto-renew-label--stack {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.auto-renew-hint {
    font-size: 0.72rem;
    color: var(--text-4);
    text-transform: none;
    line-height: 1.5;
}

/***********************************
 * Админка
 ***********************************/
body.is-admin .bottom-nav {
    display: none;
}

body.is-admin .site-main {
    padding-bottom: 64px;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.admin-tab {
    padding: 10px 14px;
    font-size: 0.82rem;
    color: var(--text-3);
    text-decoration: none;
    text-transform: lowercase;
    border: 1px solid var(--border);
    transition: color var(--transition), border-color var(--transition), background-color var(--transition);
}

.admin-tab:hover {
    color: var(--text-0);
    border-color: var(--border-hover);
}

.admin-tab.is-active {
    color: var(--bg-4);
    background: var(--text-0);
    border-color: var(--text-0);
}

.admin-tab--exit {
    margin-left: auto;
}

.admin-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 12px 16px;
    font-size: 0.8rem;
    color: var(--text-2);
    border: 1px dashed var(--border-hover);
}

.admin-strip .link-btn {
    margin-left: auto;
}

.node-state {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--text-5);
}

.node-state.is-online {
    background: var(--text-0);
}

.node-state.is-off {
    background: transparent;
    border: 1px solid var(--text-4);
}

.admin-pane {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-pane[hidden] {
    display: none !important;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.admin-stat.panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px 20px;
}

.admin-stat-value {
    font-size: 1.4rem;
    color: var(--text-0);
}

.admin-stat-label {
    font-size: 0.72rem;
    color: var(--text-4);
    text-transform: lowercase;
}

.admin-search,
.admin-filters {
    display: flex;
    gap: 10px;
}

.admin-search .field-input,
.admin-filters .field-input {
    flex: 1;
}

.admin-list .op-row {
    cursor: default;
}

.admin-list a.op-row {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.admin-list a.op-row:hover .op-title {
    color: var(--text-0);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.admin-sub-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.admin-sub-actions .field-input {
    width: 72px;
    padding: 8px 10px;
}

.admin-sub-actions .btn {
    padding: 9px 12px;
    font-size: 0.78rem;
}

.admin-qr {
    max-width: 220px;
    margin: 0 auto;
}

.admin-secret {
    font-size: 0.75rem;
    color: var(--text-4);
    line-height: 1.6;
    word-break: break-all;
}

.admin-secret code {
    color: var(--text-1);
    letter-spacing: 0.08em;
}

.stat-value--text {
    font-size: 0.95rem;
    line-height: 1.4;
    word-break: break-word;
}

.admin-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.admin-pager .btn {
    padding: 9px 14px;
}

.admin-pager-label {
    font-size: 0.8rem;
    color: var(--text-3);
}

.node-geo {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.node-geo[hidden] {
    display: none;
}

.node-geo-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.node-geo-title {
    margin: 8px 0 0;
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-4);
    text-transform: lowercase;
    letter-spacing: 0.08em;
}

.node-geo-message {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-2);
}

.node-geo-map {
    display: block;
    width: 100%;
    height: auto;
    padding: 12px;
    background: #fff;
}

#adminNodeStatus {
    display: inline-flex;
    align-items: center;
}

/* тест бесплатно */
.trial-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}

.trial-facts.panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.trial-facts .stat-value {
    font-size: 1.25rem;
}

.trial-text {
    font-size: 0.88rem;
    color: var(--text-2);
    line-height: 1.7;
}

.trial-block {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.trial-block[hidden] {
    display: none;
}

.trial-block .login-note a,
.login-trial {
    color: var(--text-1);
}

.login-trial {
    padding: 12px 14px;
    font-size: 0.8rem;
    line-height: 1.6;
    border: 1px dashed var(--border-hover);
}

.trial-promo[hidden] {
    display: none;
}

/* условия использования */
.terms-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
}

.terms-back {
    align-self: flex-start;
}

.terms.panel {
    padding: 32px;
    font-size: 0.86rem;
    line-height: 1.75;
    color: var(--text-2);
}

.terms-title {
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--text-0);
}

.terms-meta {
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-4);
}

.terms-toc {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 24px 0 8px;
    padding: 16px 20px;
    border: 1px solid var(--border);
}

.terms-toc a,
.terms a {
    color: var(--text-1);
    text-underline-offset: 3px;
}

.terms section {
    scroll-margin-top: 90px;
}

.terms h2 {
    margin: 28px 0 10px;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-0);
}

.terms p + p {
    margin-top: 8px;
}

.terms ul {
    margin: 8px 0;
    padding-left: 20px;
}

.terms li + li {
    margin-top: 4px;
}

@media (max-width: 600px) {
    .terms.panel {
        padding: 20px 18px;
    }

    .trial-facts.panel {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
        padding: 18px;
    }

    .trial-facts .stat + .stat {
        padding-left: 12px;
    }

    .trial-facts .stat-value {
        font-size: 1rem;
    }
}

/* промокоды */
.promo-panel[hidden],
#promoSubField[hidden] {
    display: none;
}

.promo-input {
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.promo-input::placeholder {
    letter-spacing: 0.08em;
}

.promo-create.panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.promo-create-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 16px;
}

.promo-create .btn {
    align-self: flex-start;
}

.admin-list .op-row.is-muted .op-title {
    color: var(--text-4);
}

@media (max-width: 900px) {
    .promo-create-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .promo-create-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.admin-empty {
    padding: 18px 0;
    font-size: 0.85rem;
    color: var(--text-4);
}

@media (max-width: 600px) {
    .admin-search,
    .admin-filters {
        flex-direction: column;
    }

    .admin-tab--exit {
        margin-left: 0;
    }

    .admin-sub-actions {
        flex-wrap: wrap;
    }
}

/***********************************
 * Bottom navigation
 ***********************************/
.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom));
    z-index: 100;
    display: grid;
    grid-template-columns: repeat(3, 120px);
    transform: translateX(-50%);
    background: color-mix(in srgb, var(--bg-3) 88%, transparent);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.bottom-nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: var(--nav-h);
    font-size: 0.75rem;
    color: var(--text-4);
    text-decoration: none;
    text-transform: lowercase;
    border: 1px solid transparent;
    transition: color var(--transition), background-color var(--transition), border-color var(--transition);
}

.bottom-nav-item + .bottom-nav-item {
    border-left-color: var(--border);
}

.bottom-nav-item .mask-icon {
    width: 20px;
    height: 20px;
}

.bottom-nav-item:hover {
    color: var(--text-1);
    background: var(--hover);
}

.bottom-nav-item.is-active {
    color: var(--text-0);
    background: var(--active);
    border-color: var(--text-0);
}

/***********************************
 * Toast
 ***********************************/
.toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--nav-h) + 40px + env(safe-area-inset-bottom));
    z-index: 110;
    transform: translateX(-50%);
    padding: 12px 18px;
    font-size: 0.8rem;
    color: var(--bg-4);
    background: var(--text-0);
    white-space: nowrap;
}

/***********************************
 * Responsive
 ***********************************/
@media (max-width: 900px) {
    /* нода: действия и сведения — сразу под заголовком, а не после длинного списка пользователей */
    [data-pane="adminNode"] .sub-side {
        order: -1;
    }

    .sub-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .sub-side {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 12px;
    }

    .qr-panel.panel {
        grid-row: span 3;
    }

    .side-panel.panel {
        grid-row: span 2;
    }
}

@media (max-width: 600px) {
    .admin-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .container {
        padding: 0 16px;
    }

    .site-main {
        padding-top: calc(var(--header-h) + 20px);
    }

    .tile-grid {
        gap: 12px;
    }

    .tile.panel {
        min-height: 128px;
        padding: 18px;
    }

    .sub-info.panel,
    .qr-panel.panel {
        padding: 18px;
    }

    .auto-renew.panel {
        padding: 14px 18px;
    }

    .sub-side {
        grid-template-columns: minmax(0, 1fr);
    }

    .stats-panel.panel {
        grid-template-columns: minmax(0, 1fr);
        padding: 18px;
    }

    .duration-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .duration-card.panel,
    .usage-panel.panel,
    .order-card.panel {
        padding: 18px;
    }

    .chart-panel.panel {
        padding: 18px 14px 12px;
    }

    .chart {
        height: 150px;
    }


    .stat + .stat {
        padding-left: 0;
        padding-top: 16px;
        border-left: 0;
        border-top: 1px solid var(--border);
    }

    .op-list.panel {
        padding: 0 18px;
    }

    .account-panel.panel,
    .side-panel.panel {
        padding: 18px;
    }

    .login-row.panel {
        padding: 14px 14px 14px 18px;
        gap: 12px;
    }

    .qr-panel.panel {
        grid-row: auto;
    }

    .qr-box {
        max-width: 240px;
    }

    /* на телефоне меню тоже плавающее, как на десктопе: отступы 16px от краёв и низа */
    .bottom-nav {
        left: 16px;
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom));
        transform: none;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .site-main {
        padding-bottom: calc(var(--nav-h) + 48px + env(safe-area-inset-bottom));
    }

    .toast {
        bottom: calc(var(--nav-h) + 32px + env(safe-area-inset-bottom));
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* cabinet.css */
/* Кабинет 2.0 — стиль основного сайта поверх старой разметки (классы и id из lk.js не меняются).
   Порядок: shared (токены, база, компоненты) → lk.css (старое, переменные переназначены) → этот файл. */

/* шапка */
.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
}

.site-header .logo {
    gap: 10px;
    color: var(--fg);
}

.header-controls button,
.header-controls .lang-toggle,
.header-controls .icon-btn {
    min-width: var(--tap);
    min-height: var(--tap);
    border: var(--line) solid var(--rule-strong);
    border-radius: 0;
    background: transparent;
    color: var(--fg);
}

.header-controls button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ---------- раскладка и заголовки экранов ---------- */
.site-main {
    padding-bottom: calc(var(--nav-h) + 40px + env(safe-area-inset-bottom));
}

.view-title {
    margin: 12px 0 4px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--step-2);
    line-height: 1.05;
    text-transform: uppercase;
    text-align: left;
    color: var(--fg);
    filter: url(#xerox);
}

/* ---------- карточки: нарисованная рамка (shared/js/rough-border.js по data-rough-auto=".panel") ---------- */
.panel {
    position: relative;
    background: var(--surface);
    border: var(--line) solid var(--rule-strong);
    border-radius: 0;
}

.panel.is-rough {
    border-color: transparent;
}

.panel > .rough {
    color: var(--rule-strong);
    transition: color var(--speed) steps(3);
}

a.panel:hover > .rough,
button.panel:hover > .rough,
.panel:focus-visible > .rough {
    color: var(--fg);
}

a.panel:hover,
button.panel:hover {
    background: var(--surface);
}

.tile-icon,
.tile-arrow {
    color: var(--muted);
}

.ic.tile-icon {
    width: 26px;
    height: 26px;
}

a.panel:hover .tile-arrow {
    color: var(--fg);
}

/* строка подписки на главной */
.sub-row.panel {
    gap: 16px;
}

.sub-row-name {
    /* никнейм — данные пользователя: как есть, без капса и эффектов */
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: var(--step-1);
    color: var(--fg);
}

.sub-row-meta {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.status-chip.badge {
    font-size: 0.72rem;
    text-transform: uppercase;
}

.renew-link-title {
    color: var(--fg);
    font-weight: 500;
}

.renew-link-sub {
    color: var(--muted);
}

/* ---------- нижняя навигация ---------- */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: auto;
    padding-bottom: env(safe-area-inset-bottom);
    transform: none;
    background: var(--bg);
    border: 0;
    border-top: 1px solid var(--rule-strong);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    clip-path: polygon(0 6px, 6% 1px, 12% 5px, 19% 0, 27% 4px, 35% 1px, 44% 6px, 52% 2px, 61% 5px, 70% 0, 78% 4px, 87% 1px, 94% 5px, 100% 2px, 100% 100%, 0 100%);
}

.bottom-nav-item {
    gap: 4px;
    height: var(--nav-h);
    border: 0;
    color: var(--subtle);
    font-size: 0.75rem;
}

.bottom-nav-item + .bottom-nav-item {
    border-left: 0;
}

.bottom-nav-item .ic {
    width: 22px;
    height: 22px;
}

.bottom-nav-item:hover {
    background: transparent;
    color: var(--fg);
}

.bottom-nav-item.is-active {
    background: transparent;
    color: var(--fg);
    border: 0;
}

/* активная вкладка — подчёркнута нарисованной линией */
.bottom-nav-item.is-active::after {
    content: '';
    position: absolute;
    left: 28%;
    right: 28%;
    bottom: 8px;
    height: 3px;
    background: var(--fg);
    clip-path: polygon(0 40%, 20% 0, 45% 60%, 70% 10%, 100% 50%, 100% 100%, 0 100%);
}

@media (min-width: 900px) {
    .bottom-nav {
        left: 50%;
        right: auto;
        bottom: 20px;
        grid-template-columns: repeat(3, 132px);
        transform: translateX(-50%);
        border: var(--line) solid var(--rule-strong);
        clip-path: none;
    }
}

/* ---------- подписка ---------- */
.sub-nav {
    gap: 12px;
}

.sub-nav .icon-btn,
.icon-btn {
    display: inline-grid;
    place-items: center;
    min-width: var(--tap);
    min-height: var(--tap);
    border: var(--line) solid var(--rule-strong);
    border-radius: 0;
    background: transparent;
    color: var(--fg);
}

.icon-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: transparent;
}

.sub-nav-title {
    /* никнейм — данные: моно, без капса */
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: var(--step-1);
    color: var(--fg);
}

.sub-tariff {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.sub-days-value {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: var(--step-3);
    line-height: 1;
    color: var(--fg);
    font-variant-numeric: tabular-nums;
}

.sub-days-label,
.sub-until {
    color: var(--muted);
}

.days-bar {
    height: 10px;
    padding: 0;
    border: 1px solid var(--rule-strong);
    background: var(--surface-2);
}

.days-bar-fill {
    height: 100%;
    background: var(--fg);
}

/* плитки: трафик, устройства, продлить, история */
.tile-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--step-1);
    line-height: 1.05;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--fg);
}

.tile-sub {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.tile-sub.is-alert {
    color: var(--accent);
}

/* истекла / отключена */
.sub-alert {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px 14px;
    align-items: start;
    padding: 18px;
}

.sub-alert > .rough {
    color: var(--accent);
}

.sub-alert-icon.ic {
    width: 28px;
    height: 28px;
    color: var(--accent);
}

.sub-alert-title {
    margin: 0 0 4px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--step-1);
    line-height: 1.05;
    text-transform: uppercase;
    color: var(--fg);
}

.sub-alert-text {
    margin: 0;
    color: var(--body);
}

.sub-alert .btn {
    grid-column: 1 / -1;
}

/* автопродление */
.auto-renew-hint {
    color: var(--muted);
}

.auto-renew-hint.is-alert {
    color: var(--accent);
}

.auto-renew-topup {
    align-self: flex-start;
    padding-left: 0;
    color: var(--fg);
}

/* переключатель (кнопка role=switch из старой разметки) */
.switch {
    width: 52px;
    height: 30px;
    padding: 4px;
    border: var(--line) solid var(--rule-strong);
    background: var(--surface-2);
}

.switch-knob {
    width: 18px;
    height: 18px;
    background: var(--muted);
    transition: transform var(--speed) steps(3), background var(--speed) steps(3);
}

.switch[aria-checked="true"] {
    background: var(--surface-2);
    border-color: var(--fg);
}

.switch[aria-checked="true"] .switch-knob {
    transform: translateX(22px);
    background: var(--fg);
}

/* QR — чистый белый квадрат поверх зерна, без фильтров */
.qr-box {
    position: relative;
    z-index: 91;
    background: #fff;
    border-radius: 0;
}

.qr-hint {
    color: var(--muted);
}

/* кнопки сбоку: ссылка, приложения, настройки */
.side-btn {
    min-height: var(--tap);
    border: var(--line) solid var(--rule-strong);
    border-radius: 0;
    background: transparent;
    color: var(--fg);
    font-family: var(--font-mono);
}

.side-btn:hover,
.side-btn:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
    background: transparent;
}

/* текстовая кнопка: старый .btn из lk.css не должен давать ей рамку */
.btn.btn--text {
    min-height: var(--tap);
    padding: 8px 0;
    border: 0;
    background: transparent;
    color: var(--fg);
    font-family: var(--font-mono);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.btn.btn--text:hover {
    background: transparent;
    color: var(--fg);
}

/* статус-бейджи: старый .status-chip.is-muted не должен перебивать рисунок рамки */
.status-chip.badge {
    padding: 3px 10px 3px 8px;
    gap: 6px;
    background: transparent;
    border: var(--line) solid var(--fg);
    color: var(--fg);
}

.status-chip.badge--ok {
    background: var(--fg);
    color: var(--bg);
}

.status-chip.badge--wait {
    border-style: dashed;
}

.status-chip.badge--alert,
.status-chip.badge--alert.is-muted {
    padding: 1px 8px 1px 6px;
    border: 4px double var(--accent);
    color: var(--accent);
}

.status-chip.badge--neutral,
.status-chip.badge--neutral.is-muted {
    border-color: var(--rule-strong);
    color: var(--muted);
}

/* ---------- заголовки страниц и блоков ---------- */
/* названия страниц (у них data-i18n), вход, условия — как заголовки сайта; никнейм остаётся моно */
.sub-nav-title[data-i18n],
.login-heading,
.terms-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--step-2);
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: 0.005em;
    color: var(--fg);
    filter: url(#xerox);
}

.sub-nav-section {
    color: var(--muted);
}

.order-title,
.side-panel-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--step-1);
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--fg);
}

.section-title {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: var(--step--1);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- выбор срока (продление) ---------- */
.duration-card.panel {
    text-align: left;
}

.duration-title {
    position: relative;
    align-self: flex-start;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--step-1);
    line-height: 1.05;
    text-transform: uppercase;
    color: var(--fg);
}

.duration-price {
    color: var(--fg);
    font-variant-numeric: tabular-nums;
}

.duration-price small,
.duration-total {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.duration-card.is-selected {
    background: var(--surface);
}

.duration-card.is-selected > .rough {
    color: var(--accent);
}

.duration-card.is-selected .duration-select {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-ink);
}

.ic.duration-oval {
    position: absolute;
    inset: -10px -16px;
    width: calc(100% + 32px);
    max-width: none;
    height: calc(100% + 20px);
    color: var(--accent);
    stroke-width: 3;
    pointer-events: none;
}

/* показатели (срок / трафик / устройства, баланс / бонусы): на узком экране — столбиком,
   разделитель сверху, без отступа слева (раньше вторая и третья строки съезжали вправо) */
@media (max-width: 520px) {
    .stats-panel.panel,
    .trial-facts.panel {
        grid-template-columns: minmax(0, 1fr);
    }

    .stats-panel .stat + .stat,
    .trial-facts .stat + .stat {
        padding-left: 0;
        padding-top: 14px;
        border-left: 0;
        border-top: 1px solid var(--rule);
    }
}

.stat-label {
    color: var(--muted);
}

.stat-value {
    color: var(--fg);
    font-variant-numeric: tabular-nums;
}

/* удаление устройства: спокойная кнопка → по первому нажатию «точно удалить?» акцентом (логика в lk.js) */
.btn.device-remove {
    border-color: var(--rule-strong);
    background: transparent;
    color: var(--body);
}

.btn.device-remove:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: transparent;
}

.btn.device-remove.is-confirm {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-ink);
}

.op-title {
    color: var(--fg);
}

.op-meta {
    color: var(--subtle);
}

/* главная: заголовок по колонке списка (список и карточки — 680px по центру) */
#viewMain > .view-title,
#viewTrial > .view-title {
    width: 100%;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

/* =========================================================================
   Дашборд подписки (референс — сетка карточек; данные — только те, что отдаёт API)
   ========================================================================= */
#viewSub {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
}

.sub-nav-title--big {
    font-size: var(--step-2);
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.dash {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.dash-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    min-width: 0;
}

.dash-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dash-title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--step-1);
    line-height: 1.05;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--fg);
}

.dash-title small {
    margin-left: 6px;
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: var(--step--1);
    letter-spacing: 0;
    text-transform: none;
    color: var(--muted);
}

.dash-title small.is-alert {
    color: var(--accent);
}

.dash-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: var(--tap);
    color: var(--muted);
    font-size: var(--step--1);
    text-decoration: none;
}

.dash-more:hover {
    color: var(--fg);
}

.dash-more .ic {
    width: 14px;
    height: 14px;
}

.dash-rows {
    margin: 0;
}

.dash-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--rule);
}

.dash-row dt {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}

.dash-row dt .ic {
    width: 16px;
    height: 16px;
}

.dash-row dd {
    margin: 0;
    color: var(--fg);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.dash-overview .sub-days {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.dash-overview .sub-days-value {
    font-size: clamp(2rem, 1.5rem + 2vw, 2.8rem);
}

.dash-renew {
    flex-direction: column;
    gap: 2px;
    border-color: var(--fg);
}

.dash-renew-price {
    color: var(--muted);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

.dash-renew:hover .dash-renew-price {
    color: inherit;
}

.dash-note,
.dash-state {
    margin: 0;
    color: var(--muted);
    font-size: var(--step--1);
}

.dash-sub-label {
    margin: 4px 0 0;
    font-size: var(--step--1);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--subtle);
}

.dash-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.dash-big {
    margin: 0;
    font-size: clamp(2rem, 1.5rem + 2vw, 2.8rem);
    line-height: 1;
    color: var(--fg);
    font-variant-numeric: tabular-nums;
}

.dash-big small {
    font-size: var(--step-0);
    color: var(--muted);
}

/* мини-график: те же столбики, что на странице трафика */
.dash-chart-wrap {
    position: relative;
}

.dash-chart.chart {
    height: 110px;
}

.dash-connect .qr-box {
    width: min(220px, 100%);
    margin: 0 auto;
}

.dash-globe {
    width: 96px;
    height: 96px;
    margin: 4px auto;
    color: var(--fg);
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
}

.share-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-head {
    display: flex;
    justify-content: space-between;
    color: var(--body);
    font-size: var(--step--1);
    font-variant-numeric: tabular-nums;
}

.share-bar {
    height: 6px;
    margin-top: 4px;
    background: var(--surface-2);
    border: 1px solid var(--rule);
}

.share-bar i {
    display: block;
    height: 100%;
    background: var(--fg);
}

.dash-settings .auto-renew {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

/* телефон: колонки «растворяются», карточки — по важности */
.dash-col {
    display: contents;
}

.dash-overview { order: 1; }
.dash-connect { order: 2; }
.dash-traffic { order: 3; }
.dash-devices { order: 4; }
.dash-countries { order: 5; }
.dash-history { order: 6; }
.dash-settings { order: 7; }

/* планшет / узкий ноутбук: две колонки по тому же порядку */
@media (min-width: 760px) {
    .dash {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-flow: row dense;
    }
}

/* широкий экран: три настоящие колонки, карточки друг под другом без дыр (как в референсе) */
@media (min-width: 1280px) {
    .dash {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dash-col {
        display: flex;
        flex-direction: column;
        gap: 16px;
        min-width: 0;
    }
}

/* =========================================================================
   Боковое меню (широкий экран) — вместо нижней навигации
   ========================================================================= */
.side-nav {
    display: none;
}

@media (min-width: 1100px) {
    body:not(.is-guest) {
        padding-left: 240px;
    }

    body:not(.is-guest) .side-nav {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 120;   /* выше шапки (z 100 в lk.css) */
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 240px;
        padding: 24px 18px;
        background: var(--bg);
        border-right: 1px solid var(--rule);
    }

    body:not(.is-guest) .bottom-nav {
        display: none;
    }

    /* в шапке остаются язык и выход; логотип — в меню */
    body:not(.is-guest) .site-header .logo {
        visibility: hidden;
    }

    body:not(.is-guest) .site-header {
        border-bottom: 0;
    }
}

.side-nav-logo {
    margin: 0 0 18px 6px;
}

.side-nav-label {
    margin: 0 0 6px 8px;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--subtle);
}

.side-nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.side-nav .side-nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    height: auto;
    min-height: var(--tap);
    padding: 10px 12px;
    border: var(--line) solid transparent;
    color: var(--muted);
    font-size: var(--step-0);
}

.side-nav .side-nav-item:hover {
    color: var(--fg);
}

.side-nav .side-nav-item.is-active {
    border-color: var(--fg);
    color: var(--fg);
}

.side-nav .side-nav-item.is-active::after {
    content: none;
}

.side-nav-help {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: auto;
    padding: 14px 12px;
    border-top: 1px solid var(--rule);
    color: var(--muted);
    font-size: var(--step--1);
    text-decoration: none;
}

.side-nav-help b {
    display: block;
    color: var(--fg);
    font-weight: 500;
}

.side-nav-help:hover b {
    text-decoration: underline;
}

/* перенос в кнопках — ровными строками («₽» не уезжает на отдельную строку) */
.btn {
    text-wrap: balance;
}

/* =========================================================================
   Админка
   ========================================================================= */

/* группа «админка» в боковом меню — только внутри админки */
.side-nav-admin {
    display: none !important;
}

body.is-admin .side-nav-admin {
    display: flex !important;
}

body.is-admin p.side-nav-admin {
    display: block !important;
    margin-top: 14px;
}

/* вкладки сверху: на телефоне — полоса с прокруткой; на широком экране разделы в боковом меню */
.admin-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0 0 8px;
    padding: 0 0 10px;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--rule);
}

.admin-nav .admin-tab {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: var(--tap);
    padding: 8px 14px;
    border: var(--line) solid var(--rule-strong);
    background: transparent;
    color: var(--muted);
    font-size: var(--step--1);
    text-decoration: none;
    white-space: nowrap;
}

.admin-nav .admin-tab:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.admin-nav .admin-tab.is-active {
    border-color: var(--fg);
    background: var(--fg);
    color: var(--bg);
}

@media (min-width: 1100px) {
    body.is-admin .admin-nav .admin-tab:not(.admin-tab--exit) {
        display: none;
    }

    body.is-admin .admin-nav {
        border-bottom: 0;
        justify-content: flex-end;
    }
}

/* «режим администратора» над подпиской пользователя — заметно, акцентом */
.admin-strip {
    border: 4px double var(--accent);
    background: transparent;
    color: var(--fg);
}

.admin-strip .ic {
    color: var(--accent);
}

/* сводка: плотные плитки, крупные цифры */
.admin-stat.panel {
    padding: 16px 18px;
}

.admin-stat-label {
    color: var(--muted);
    font-size: var(--step--1);
}

.admin-stat-value {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
    color: var(--fg);
    font-variant-numeric: tabular-nums;
}

/* статус узла — бейдж (иконка + слово + рамка) */
.node-badge {
    align-self: flex-start;
    margin-bottom: 6px;
    font-size: 0.68rem;
}

.op-main > .node-badge + .op-title {
    margin-top: 2px;
}

.admin-empty {
    color: var(--muted);
}

/* разделы админки на телефоне — карточки-ряды переносятся */
@media (max-width: 640px) {
    .admin-sub-actions {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

/* пункты админки в боковом меню — как остальные пункты меню (старые .admin-tab из lk.css не действуют) */
.side-nav .admin-tab.side-nav-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    min-height: var(--tap);
    padding: 10px 12px;
    border: var(--line) solid transparent;
    background: transparent;
    color: var(--muted);
    font-size: var(--step-0);
    text-decoration: none;
}

.side-nav .admin-tab.side-nav-item:hover {
    color: var(--fg);
    background: transparent;
}

.side-nav .admin-tab.side-nav-item.is-active {
    border-color: var(--fg);
    background: transparent;
    color: var(--fg);
}

.side-nav .admin-tab.side-nav-item .ic {
    width: 20px;
    height: 20px;
}
