/* EntryVPN — Nocturne skin.
   Подключать СТРОГО после /static/style.css:
   <link rel="stylesheet" href="/static/nocturne.css">
   Файл только переопределяет существующие классы — старая разметка не ломается. */

/* ── Токены ─────────────────────────────────────────────────────────── */
/* Значения взяты со шкал темы Nocturne (neutral / accent, шаги 100–900).
   Светлая тема: грунт neutral-100, текст neutral-900, акцент accent-600. */
:root {
    --bg: #f3f5fe;              /* neutral-100 */
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    --bg-soft: #f3f5fe;         /* neutral-100 */
    --bg-media: #e4e7f5;        /* neutral-200 */
    --border: rgba(41, 43, 49, 0.13);
    --border-soft: rgba(41, 43, 49, 0.08);
    --border-input: rgba(41, 43, 49, 0.22);
    --text: #292b31;            /* neutral-900 */
    --text-dim: #75798c;        /* neutral-600 */
    --text-dim2: #9397ab;       /* neutral-500 */
    --accent: #796cbf;          /* accent-600 */
    --accent-soft: rgba(121, 108, 191, 0.11);
    --accent-line: rgba(121, 108, 191, 0.5);
    --green: #3f8f63;
    --red: #b4485c;
    --radius-card: 16px;
    --radius-sm: 12px;
    --icon-bg: #f3f5fe;
    --icon-bg-hover: #e4e7f5;
    color-scheme: light;
}

/* Тёмная тема: грунт — фон темы, поверхности и текст — шаги шкал,
   акцент поднят до accent-400 (шаг, который система назначает для тёмного грунта). */
[data-theme="dark"] {
    --bg: #12141f;              /* грунт на шаг глубже — карточки читаются как поверхности */
    --bg-elevated: #1e2130;
    --bg-card: #1e2130;
    --bg-soft: #2b2741;         /* accent-900 — тонированная поверхность */
    --bg-media: #171a28;
    --border: rgba(233, 233, 237, 0.13);
    --border-soft: rgba(233, 233, 237, 0.09);
    --border-input: rgba(233, 233, 237, 0.26);
    --text: #f3f5fe;            /* neutral-100 */
    --text-dim: #b2b6ca;        /* neutral-400 */
    --text-dim2: #9397ab;       /* neutral-500 */
    --accent: #b5abfc;          /* accent-400 */
    --accent-soft: rgba(181, 171, 252, 0.15);
    --accent-line: rgba(181, 171, 252, 0.58);
    --green: #7fd0a1;
    --red: #e58a9b;
    --icon-bg: #232532;
    --icon-bg-hover: #2b2741;
    color-scheme: dark;
}

body {
    background:
        radial-gradient(120% 60% at 50% -10%, var(--accent-soft) 0%, transparent 60%),
        var(--bg);
    background-attachment: fixed;
    letter-spacing: 0.005em;
}

.container { max-width: 520px; padding: 12px 16px 120px; }

h1, h2, h3 { font-weight: 500; letter-spacing: -0.015em; }
.card h2 { font-size: 20px; }
.card h3 { font-size: 16px; }

.eyebrow {
    font-size: 11px;
    letter-spacing: 0.14em;
    color: var(--text-dim);
    font-weight: 500;
    margin-bottom: 8px;
}

.muted { color: var(--text-dim); font-size: 13px; }

/* Тонкий скроллбар — системный на тёмном фоне выглядит инородно */
* { scrollbar-width: thin; scrollbar-color: var(--border-input) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-input); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-dim2); }

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, .tariff-option:focus-within {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 10px;
}

/* ── Шапка ──────────────────────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 12px 16px;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: none;
    box-shadow: none;
}
.topbar::after {
    content: "";
    position: absolute;
    left: 48px; right: 48px; bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-input), transparent);
}
.topbar .brand { font-size: 14px; letter-spacing: 0.12em; font-weight: 600; }
.topbar .logout {
    font-size: 13px;
    color: var(--text-dim);
    border: none;
    padding: 0;
}
.topbar .logout:hover { color: var(--text); }
.theme-toggle {
    width: 34px; height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
}
.theme-toggle:hover { background: var(--icon-bg-hover); border-color: var(--border-input); }

/* ── Карточки ───────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 18px;
    margin-bottom: 12px;
    /* На тёмном грунте высота — это светящаяся кромка и амбиентная тень */
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 1px 3px rgba(0, 0, 0, 0.3);
}
.card > h2:first-child { margin-bottom: 4px; }

/* Главная карточка подписки */
.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(155deg, var(--bg-soft) 0%, var(--bg-card) 62%);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-card);
    padding: 20px;
    margin-bottom: 12px;
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--accent) 18%, transparent),
        0 2px 10px rgba(0, 0, 0, 0.35);
}
.hero::after {
    content: "";
    position: absolute;
    top: -110px; right: -70px;
    width: 300px; height: 260px;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 26%, transparent), transparent);
    pointer-events: none;
}
.hero-status {
    display: flex; align-items: center; gap: 8px;
    font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--text-dim);
}
.hero-status .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
    animation: hero-pulse 2.4s ease-in-out infinite;
}
.hero-status.off .dot { background: var(--red); animation: none; }
@keyframes hero-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.95; } }
.hero-value {
    margin-top: 12px;
    font-size: 32px; line-height: 1.05; font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--text);
}
.hero-meta { margin-top: 8px; font-size: 13.5px; color: var(--text-dim); }
.hero .btn-row { margin-top: 18px; position: relative; }

/* ── Статистика ─────────────────────────────────────────────────────── */
.grid { grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 12px;
    text-align: left;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 1px 3px rgba(0, 0, 0, 0.3);
}
.stat .stat-icon {
    display: block;
    width: 18px; height: 18px;
    margin-bottom: 10px;
    color: var(--accent);
}
.stat .stat-icon svg { width: 100%; height: 100%; display: block; }
.stat .label {
    font-size: 11.5px; letter-spacing: 0.04em; text-transform: none;
    color: var(--text-dim); font-weight: 400;
}
.stat .value { margin-top: 6px; font-size: 19px; font-weight: 500; letter-spacing: -0.01em; color: var(--text); }

/* Стат с действием: ссылка прижата к низу, чтобы карточки в ряду совпадали */
.stat:has(.stat-action) { display: flex; flex-direction: column; }
.stat-action {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: auto;
    padding-top: 14px;
    font-size: 13.5px;
    color: var(--accent);
    align-self: flex-start;
}
.stat-action:hover { color: var(--text); }
.stat-action .chev { font-size: 15px; line-height: 1; }

/* ── Кнопки ─────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 15px; font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    /* Свет сверху внутри кромки плюс амбиентная тень под кнопкой */
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--accent) 26%, transparent),
        0 1px 2px rgba(0, 0, 0, 0.4);
    transition: background-color 0.16s ease, border-color 0.16s ease,
                box-shadow 0.16s ease, transform 0.12s ease;
}
.btn:hover {
    background: color-mix(in srgb, var(--accent) 24%, transparent);
    border-color: var(--accent);
    color: var(--text);
    opacity: 1;
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--accent) 40%, transparent),
        0 4px 14px color-mix(in srgb, var(--accent) 22%, transparent),
        0 2px 4px rgba(0, 0, 0, 0.45);
}
.btn:active {
    transform: translateY(1px);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }

.btn.secondary {
    border: 1px solid var(--border-input);
    background: transparent;
    color: var(--text);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 1px 2px rgba(0, 0, 0, 0.35);
}
.btn.secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: transparent;
    opacity: 1;
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--accent) 22%, transparent),
        0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn.outline {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
}
.btn.outline:hover { border-color: var(--accent); color: var(--accent); }

.btn.danger {
    border: 1px solid color-mix(in srgb, var(--red) 55%, transparent);
    background: transparent;
    color: var(--red);
}
.btn.danger:hover { background: color-mix(in srgb, var(--red) 12%, transparent); }

.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

.btn-row { gap: 10px; }
.btn-row.horizontal { gap: 8px; }

/* ── Выбор тарифа / сумм ────────────────────────────────────────────── */
.tariff-grid { gap: 8px; margin: 4px 0 16px; }
.tariff-option {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    padding: 14px 12px;
    text-align: center;
    transition: border-color 0.16s ease, background-color 0.16s ease;
}
.tariff-option:hover { border-color: var(--border-input); }
.tariff-option b { font-weight: 500; font-size: 16px; letter-spacing: -0.01em; }
.tariff-option .muted { display: block; margin-top: 2px; font-size: 12.5px; }
.tariff-option.selected, .tariff-option:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* Однорядный вариант: радио-точка слева, цена справа */
.tariff-grid.rows { display: flex; flex-direction: column; }
.tariff-grid.rows .tariff-option {
    display: flex; align-items: center; gap: 12px;
    text-align: left;
    padding: 14px 16px;
}
.tariff-grid.rows .tariff-option::before {
    content: "";
    width: 18px; height: 18px; flex-shrink: 0;
    border-radius: 50%;
    border: 1.5px solid var(--border-input);
    box-shadow: inset 0 0 0 4px transparent;
    transition: box-shadow 0.16s ease, border-color 0.16s ease;
}
.tariff-grid.rows .tariff-option:has(input:checked)::before {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 4px var(--accent);
}
.tariff-grid.rows .tariff-option b { flex: 1; }
.tariff-grid.rows .tariff-option .price { font-size: 16px; font-weight: 500; }
.tariff-grid.rows .tariff-option .save {
    font-size: 11px; color: var(--accent);
    border: 1px solid var(--accent-line);
    border-radius: 6px; padding: 3px 6px;
}

/* ── Списки-строки ──────────────────────────────────────────────────── */
.list {
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--bg-card);
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 1px 3px rgba(0, 0, 0, 0.3);
}
.list-title {
    padding: 14px 16px 4px;
    font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--text-dim);
}
.list-row {
    display: flex; align-items: center; gap: 12px;
    width: 100%;
    padding: 15px 16px;
    border-top: 1px solid var(--border-soft);
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 14.5px;
    text-align: left;
    cursor: pointer;
}
.list-row:first-child, .list-title + .list-row { border-top: none; }
.list-title ~ .list-row { border-top: 1px solid var(--border-soft); }
.list-row:hover { background: var(--bg-soft); }
.list-row .row-mark {
    width: 30px; height: 30px; flex-shrink: 0;
    border-radius: 9px;
    border: 1px solid var(--border-input);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
    font-size: 12px;
}
.list-row .row-mark svg { width: 16px; height: 16px; }
.list-row .row-body { display: block; flex: 1; min-width: 0; }
.list-row .row-title { display: block; font-size: 14.5px; }
.list-row .row-meta { display: block; margin-top: 3px; font-size: 12px; color: var(--text-dim); }
.list-row .row-value { font-size: 13.5px; color: var(--text-dim); flex-shrink: 0; }
.list-row .chev { color: var(--text-dim); flex-shrink: 0; }

/* ── Устройства и статус узлов ──────────────────────────────────────── */
.device-item {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-soft);
    gap: 12px;
}
.device-item .meta { font-size: 12px; color: var(--text-dim); }

/* ── Бейджи ─────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 9px;
    border-radius: 8px;
    border: 1px solid currentColor;
    background: transparent;
    font-size: 12px; font-weight: 500;
    letter-spacing: 0.01em;
}
.badge.ok { color: var(--accent); }
.badge.warn { color: var(--red); }

/* ── Поля ввода ─────────────────────────────────────────────────────── */
input[type=text], input[type=number], input[type=password], select, textarea {
    width: 100%;
    padding: 13px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-input);
    background: var(--bg-card);
    color: var(--text);
    font-size: 15px;
    margin-bottom: 12px;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.field { gap: 6px; margin-bottom: 12px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.field input { margin-bottom: 0; }

code {
    display: block;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text);
    font-size: 12px;
    line-height: 1.5;
    word-break: break-all;
}

/* ── QR и пустые состояния ──────────────────────────────────────────── */
.qr-frame {
    margin: 18px auto 0;
    width: max-content;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
}
.qr-frame img { display: block; max-width: 190px; border: none !important; border-radius: 6px; }

.empty {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 32px 20px;
    text-align: center;
}
.empty .empty-mark {
    width: 50px; height: 50px;
    border-radius: 14px;
    border: 1px solid var(--border-input);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-dim);
}
.empty .empty-mark svg { width: 22px; height: 22px; }
.empty h3 { margin: 0; font-size: 17px; font-weight: 500; }
.empty p { margin: 0; max-width: 270px; font-size: 13.5px; color: var(--text-dim); line-height: 1.55; text-wrap: pretty; }
.empty .btn { width: auto; margin-top: 4px; }

/* ── Флеши ──────────────────────────────────────────────────────────── */
.flash {
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    padding: 12px 14px;
    font-size: 13.5px;
    margin-bottom: 12px;
}
.flash.error { border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.flash.success { border-color: var(--accent-line); }

.desktop-only, .desktop-only-card { display: none; }

/* ── Нижняя навигация ───────────────────────────────────────────────── */
.bottom-nav {
    left: 10px; right: 10px; bottom: 10px;
    width: auto; max-width: 520px;
    margin: 0 auto;
    display: flex;
    gap: 2px;
    padding: 6px;
    border-radius: var(--radius-card);
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-card) 90%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav-item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 8px 2px;
    border-radius: 11px;
    font-size: 10.5px;
    color: var(--text-dim);
    background: transparent;
    transition: background-color 0.16s ease, color 0.16s ease;
}
.bottom-nav-item::before, .bottom-nav-item::after { display: none !important; }
.bottom-nav-item.active { color: var(--accent); background: var(--accent-soft); }
.bottom-nav-item.active .nav-icon { color: var(--accent); background: transparent; }
.nav-icon {
    width: 20px; height: 20px;
    background: transparent;
    color: inherit;
}
.nav-icon.icon-balance {
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 500;
    background: transparent; color: inherit;
}
.nav-icon.icon-devices span { background: currentColor; }

/* ── Карточка-приглашение привязать Telegram ────────────────────────── */
.contact-card {
    display: flex; align-items: center; gap: 12px;
    border: 1px solid var(--accent-line);
    border-radius: var(--radius-card);
    background: var(--accent-soft);
    padding: 16px;
}
.contact-card .contact-icon {
    width: 34px; height: 34px; flex-shrink: 0;
    border-radius: 10px;
    border: 1px solid var(--accent-line);
    background: transparent;
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
}
.contact-card .contact-icon svg { width: 18px; height: 18px; }
.contact-card .contact-text .title { font-weight: 500; font-size: 14px; }
.contact-card .contact-arrow { color: var(--accent); }

/* ── Таблицы (админка) ──────────────────────────────────────────────── */
th { letter-spacing: 0.12em; font-weight: 500; }
td, th { border-bottom: 1px solid var(--border-soft); }

/* ── Онбординг ──────────────────────────────────────────────────────── */
.onboard-card {
    border-radius: var(--radius-card);
    border: 1px solid var(--border);
    background: var(--bg-card);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
}
.onboard-next {
    border: 1px solid var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: var(--radius-sm);
}
.onboard-skip { color: var(--text-dim); }

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}


/* ═══════════════════════════════════════════════════════════════════════
   ВХОД И РЕГИСТРАЦИЯ
   Лендинг сюда не входит — он остаётся на старом style.css (см. README).
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Вход и регистрация ─────────────────────────────────────────────── */
.simple-topbar {
    border-bottom: none;
    position: relative;
    padding: 16px 20px;
}
.simple-topbar::after {
    content: "";
    position: absolute;
    left: 48px; right: 48px; bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-input), transparent);
}
.simple-topbar .brand { font-weight: 500; font-size: 17px; }

.auth-wrap { max-width: 440px; margin-top: 48px; }
.auth-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--bg-card);
    padding: 28px 24px;
}
.auth-card .eyebrow {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--text-dim);
}
.auth-card h2 { font-size: 27px; font-weight: 500; letter-spacing: -0.02em; margin: 0 0 8px; }
.auth-card > p.muted { margin-bottom: 24px; }

.auth-checklist {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    padding: 14px 16px;
    gap: 10px;
}
.auth-checklist li { font-size: 13.5px; line-height: 1.55; color: var(--text-dim); }
.auth-checklist b { font-weight: 500; }
.auth-checklist .check { color: var(--accent); }

.field { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.remember-row { font-size: 13px; color: var(--text-dim); }
.remember-row input[type=checkbox] { accent-color: var(--accent); }
.remember-row a { color: var(--text-dim); border-bottom-color: var(--border-input); }
.remember-row a:hover { color: var(--accent); }

.auth-switch a { color: var(--accent); font-weight: 400; }
.auth-divider { color: var(--text-dim2); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.auth-divider::before, .auth-divider::after { background: var(--border); }
.btn-arrow span { opacity: 0.7; }


/* ═══════════════════════════════════════════════════════════════════════
   ПК-ВЕРСИЯ КАБИНЕТА (от 900px)
   Нижняя навигация переезжает наверх и становится вторым ярусом шапки.
   Разметку менять не нужно — те же .topbar / .container / .bottom-nav.
   В Telegram Mini App окно уже, поэтому там остаётся мобильный вид.
   ═══════════════════════════════════════════════════════════════════════ */

@media (min-width: 900px) {
    /* App-shell: скроллится только колонка контента. Sticky здесь не годится —
       style.css задаёт html, body { overflow-x: hidden }, из-за чего body сам
       становится скролл-контейнером и прилипание не срабатывает. */
    body:has(.bottom-nav) {
        height: 100vh;
        overflow: hidden;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto minmax(0, 1fr);
        min-height: 100vh;
    }

    /* ── Шапка ── */
    /* Шапка, навигация и контент стоят на одной центрированной колонке —
       иначе на широком мониторе всё виснет у левого края. */
    body:has(.bottom-nav) .topbar {
        grid-row: 1;
        width: 100%;
        max-width: 1260px;
        margin: 0 auto;
        padding: 16px 40px 12px;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    body:has(.bottom-nav) .topbar::after { display: none; }

    /* ── Верхняя навигация: вкладки с акцентной подчёркивающей меткой ── */
    body:has(.bottom-nav) .bottom-nav {
        position: relative;
        left: auto; right: auto; bottom: auto;
        grid-row: 2;
        width: 100%;
        max-width: 1260px;
        margin: 0 auto;
        display: flex;
        flex-direction: row;
        align-items: stretch;
        justify-content: center;
        gap: 4px;
        padding: 0 40px;
        border: none;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
    }
    body:has(.bottom-nav) .bottom-nav-item {
        flex: 0 0 auto;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 9px;
        padding: 12px 16px 11px;
        font-size: 14.5px;
        border-radius: 0;
        background: transparent;
        border-bottom: 2px solid transparent;
        margin-bottom: -1px;
    }
    body:has(.bottom-nav) .bottom-nav-item:hover { background: transparent; color: var(--text); }
    body:has(.bottom-nav) .bottom-nav-item.active {
        background: transparent;
        color: var(--accent);
        border-bottom-color: var(--accent);
    }
    body:has(.bottom-nav) .nav-icon { width: 18px; height: 18px; flex-shrink: 0; }

    /* Разделы, у которых на мобильном нет своей вкладки: наверху они пункты меню,
       и продублированные строки списка на главной прячутся. */
    body:has(.bottom-nav) .desktop-only { display: flex; }
    body:has(.bottom-nav) .desktop-only-card { display: block; }
    body:has(.bottom-nav) .mobile-only,
    body:has(.bottom-nav) .mobile-only-card { display: none; }

    /* Две сводки на главной стоят в ряд */
    body:has(.bottom-nav) .container > .list.pair { flex: 1 1 420px; }

    /* ── Контент ── */
    body:has(.bottom-nav) .container {
        grid-row: 3;
        width: 100%;
        max-width: 1260px;
        margin: 0 auto;
        padding: 26px 40px 56px;
        overflow-y: auto;
    }
    body:has(.bottom-nav) .container > * { max-width: none; }

    /* Плитки и списки дышат шире */
    body:has(.bottom-nav) .hero { padding: 30px 32px; }
    body:has(.bottom-nav) .hero-value { font-size: 46px; }
    body:has(.bottom-nav) .hero-meta { font-size: 14.5px; }
    body:has(.bottom-nav) .hero .btn-row { margin-top: 24px; }
    body:has(.bottom-nav) .hero .btn-row.horizontal .btn { max-width: 220px; }
    body:has(.bottom-nav) .card { padding: 24px 26px; }
    body:has(.bottom-nav) .grid { gap: 14px; }
    body:has(.bottom-nav) .stat { padding: 20px 22px; }
    body:has(.bottom-nav) .stat .value { font-size: 24px; }
    body:has(.bottom-nav) .list-row { padding: 16px 22px; }
    body:has(.bottom-nav) .qr-frame img { max-width: 220px; }

    /* Парные карточки встают в две колонки: QR рядом со ссылкой подписки,
       две реферальные ссылки рядом — иначе правая половина экрана пустует. */
    body:has(.bottom-nav) .container {
        display: flex;
        flex-wrap: wrap;
        align-content: flex-start;
        gap: 14px;
    }
    body:has(.bottom-nav) .container > * { flex: 0 0 100%; margin-bottom: 0; }
    body:has(.bottom-nav) .container > .card:has(.qr-frame) { flex: 1 1 300px; }
    body:has(.bottom-nav) .container > .card:has(code) { flex: 1 1 420px; }

    /* На широком экране вертикальная колонка кнопок не нужна — ставим в ряд */
    body:has(.bottom-nav) .btn-row:not(.horizontal) {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
    }
    body:has(.bottom-nav) .btn-row .btn { width: auto; min-width: 200px; }
}

@media (min-width: 1400px) {
    body:has(.bottom-nav) .container,
    body:has(.bottom-nav) .topbar,
    body:has(.bottom-nav) .bottom-nav { max-width: 1400px; }
}


/* ═══════════════════════════════════════════════════════════════════════
   ДВИЖЕНИЕ
   Сдержанное: появление контента, отклик на наведение, дыхание свечения.
   Правило prefers-reduced-motion выше гасит всё это целиком.
   ═══════════════════════════════════════════════════════════════════════ */

@keyframes evpn-rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}
@keyframes evpn-drift {
    0%, 100% { transform: none; opacity: 0.85; }
    50%      { transform: translate3d(-16px, 10px, 0) scale(1.06); opacity: 1; }
}

/* Контент появляется лесенкой — четыре шага, дальше без задержки */
.container > * { animation: evpn-rise 0.4s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.container > *:nth-child(1) { animation-delay: 0s; }
.container > *:nth-child(2) { animation-delay: 0.05s; }
.container > *:nth-child(3) { animation-delay: 0.1s; }
.container > *:nth-child(4) { animation-delay: 0.15s; }
.container > *:nth-child(n + 5) { animation-delay: 0.2s; }

/* Свечение в главной карточке медленно дышит */
.hero::after { animation: evpn-drift 14s ease-in-out infinite; }

/* Карточки и статы отзываются на курсор */
.card, .stat, .list, .hero { transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease; }
.stat:hover {
    border-color: var(--border-input);
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--accent) 20%, transparent),
        0 8px 20px rgba(0, 0, 0, 0.4);
}

/* Строка списка: подсветка метки и шеврон уезжает вправо */
.list-row .row-mark { transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease; }
.list-row .chev { transition: transform 0.18s ease, color 0.18s ease; }
.list-row:hover .row-mark { border-color: var(--accent-line); background: var(--accent-soft); }
.list-row:hover .chev { transform: translateX(3px); color: var(--accent); }

/* Ссылка внутри стата — та же логика */
.stat-action .chev { transition: transform 0.18s ease; }
.stat-action:hover .chev { transform: translateX(3px); }

/* Точка статуса в шапке карточки пульсирует (задано выше), кольцо — её эхо */
.hero-status .dot { box-shadow: 0 0 0 0 var(--accent-soft); }

/* Вкладки наверху: подчёркивание разъезжается, а не появляется скачком */
.bottom-nav-item { transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease; }