/* ══════════════════════════════════════════════════════════════
   Bloody VPN — личный кабинет
   Тёмная тема, фиолетово-розовый градиент как в баннере бота.
   ══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    /* Фон */
    --bg:            #0a0509;
    --bg-2:          #120a12;
    --surface:       rgba(255, 255, 255, .035);
    --surface-2:     rgba(255, 255, 255, .06);
    --border:        rgba(255, 255, 255, .09);
    --border-hover:  rgba(217, 70, 239, .45);

    /* Текст */
    --text:          #f4eef6;
    --text-2:        #b9adc0;
    --muted:         #7d7288;

    /* Акценты (из баннера) */
    --violet:        #a855f7;
    --fuchsia:       #d946ef;
    --pink:          #ec4899;
    --accent-grad:   linear-gradient(135deg, #a855f7 0%, #d946ef 50%, #ec4899 100%);

    --ok:            #34d399;
    --danger:        #f43f5e;
    --warn:          #fbbf24;

    --radius:        18px;
    --radius-sm:     12px;
    --shadow:        0 8px 40px rgba(0, 0, 0, .5);
    --shadow-glow:   0 8px 32px rgba(217, 70, 239, .28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ── Фоновые градиентные сферы (как на баннере) ───────────────── */
.bg-orbs {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}

.bg-orbs::before,
.bg-orbs::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
}

.bg-orbs::before {
    width: 620px;
    height: 620px;
    top: -220px;
    left: -180px;
    background: radial-gradient(circle at 35% 35%, #d946ef 0%, #8b1d9e 45%, transparent 70%);
    opacity: .32;
    animation: float-a 22s ease-in-out infinite;
}

.bg-orbs::after {
    width: 520px;
    height: 520px;
    bottom: -200px;
    right: -160px;
    background: radial-gradient(circle at 60% 40%, #ec4899 0%, #7c2d8f 50%, transparent 72%);
    opacity: .22;
    animation: float-b 27s ease-in-out infinite;
}

/* Шум/зерно поверх — как на баннере */
.bg-noise {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes float-a {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(60px, 50px) scale(1.08); }
}
@keyframes float-b {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-50px, -40px) scale(1.12); }
}

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

/* ── Шапка ────────────────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    background: rgba(10, 5, 9, .72);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 800;
    font-size: 19px;
    letter-spacing: -.02em;
    color: var(--text);
    transition: opacity .2s;
}

.brand:hover { opacity: .85; }

.brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--accent-grad);
    display: grid;
    place-items: center;
    box-shadow: 0 4px 16px rgba(217, 70, 239, .4);
    flex-shrink: 0;
}
.brand-mark svg { width: 17px; height: 17px; }

.brand-text {
    background: linear-gradient(135deg, #fff 0%, #f0abfc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.nav { display: flex; gap: 4px; align-items: center; }

.nav a {
    color: var(--text-2);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 13px;
    border-radius: 10px;
    transition: background .2s, color .2s;
    white-space: nowrap;
}

.nav a:hover { color: var(--text); background: var(--surface-2); }

.nav-ico { display: none; width: 20px; height: 20px; }

.nav a.active {
    color: #fff;
    background: rgba(217, 70, 239, .16);
    box-shadow: inset 0 0 0 1px rgba(217, 70, 239, .3);
}

.nav a.nav-exit { color: var(--muted); }
.nav a.nav-exit:hover { color: var(--danger); background: rgba(244, 63, 94, .1); }

/* ── Контейнер ────────────────────────────────────────────────── */
.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 44px 18px 72px;
}

/* ── Карточки ─────────────────────────────────────────────────── */
.card {
    position: relative;
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    animation: rise .5s cubic-bezier(.16, 1, .3, 1) both;
}

/* Тонкая градиентная нить сверху */
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 22px; right: 22px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(217, 70, 239, .65), transparent);
}

.card + .card { margin-top: 18px; }
.card.center { text-align: center; }

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/* Вторая и последующие карточки появляются с лёгкой задержкой */
.card:nth-of-type(2) { animation-delay: .07s; }
.card:nth-of-type(3) { animation-delay: .14s; }

/* Стаггер плиток статистики */
.stat { animation: rise .45s cubic-bezier(.16, 1, .3, 1) both; }
.stat:nth-child(1) { animation-delay: .08s; }
.stat:nth-child(2) { animation-delay: .14s; }
.stat:nth-child(3) { animation-delay: .20s; }
.stat:nth-child(4) { animation-delay: .26s; }

/* Стаггер устройств и кнопок оплаты */
.device-item { animation: rise .45s cubic-bezier(.16, 1, .3, 1) both; }
.device-item:nth-child(1) { animation-delay: .06s; }
.device-item:nth-child(2) { animation-delay: .12s; }
.device-item:nth-child(3) { animation-delay: .18s; }
.device-item:nth-child(4) { animation-delay: .24s; }
.device-item:nth-child(n+5) { animation-delay: .3s; }

.pay-methods .btn { animation: rise .4s cubic-bezier(.16, 1, .3, 1) both; }
.pay-methods .btn:nth-child(1) { animation-delay: .08s; }
.pay-methods .btn:nth-child(2) { animation-delay: .13s; }
.pay-methods .btn:nth-child(3) { animation-delay: .18s; }
.pay-methods .btn:nth-child(4) { animation-delay: .23s; }

/* Прогресс-бары «вырастают» при загрузке */
.progress-fill {
    transform-origin: left center;
    animation: grow .9s cubic-bezier(.16, 1, .3, 1) .35s both;
}
@keyframes grow { from { transform: scaleX(0); } }

/* ── Типографика ──────────────────────────────────────────────── */
h1 {
    margin: 0 0 6px;
    font-size: 27px;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.22;
}

h2 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--muted);
    margin: 30px 0 14px;
}

.grad {
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Заголовки и цена медленно переливаются */
h1 .grad, .price, .pay-amount {
    background-size: 220% 220%;
    animation: grad-shift 7s ease-in-out infinite;
}
@keyframes grad-shift {
    0%, 100% { background-position: 0% 40%; }
    50%      { background-position: 100% 60%; }
}

.muted { color: var(--text-2); margin: 0; }
.error { color: var(--danger); font-weight: 500; }
.success { color: var(--ok); font-weight: 500; }
.hint  { color: var(--muted); font-size: 13px; margin-top: 16px; line-height: 1.5; }

/* ── Бейдж статуса ────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .01em;
}

.badge-ok {
    background: rgba(52, 211, 153, .12);
    color: var(--ok);
    box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .25);
}
.badge-off {
    background: rgba(125, 114, 136, .14);
    color: var(--muted);
    box-shadow: inset 0 0 0 1px rgba(125, 114, 136, .22);
}
.badge-warn {
    background: rgba(251, 191, 36, .12);
    color: var(--warn);
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .25);
}

.dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}
.badge-ok .dot { animation: pulse 2s ease-in-out infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1;  transform: scale(1); }
    50%      { opacity: .45; transform: scale(.82); }
}

/* ── Статистика ───────────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 24px 0 4px;
}

.stat {
    position: relative;
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 15px 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: border-color .2s, transform .2s;
}

.stat:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
}

.stat-value {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.02em;
}

/* Прогресс-бар оставшихся дней */
.progress {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
    overflow: hidden;
    margin-top: 8px;
}
.progress-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--accent-grad);
    box-shadow: 0 0 10px rgba(217, 70, 239, .55);
    transition: width .6s cubic-bezier(.16, 1, .3, 1);
}
.progress-fill.low { background: linear-gradient(135deg, #fbbf24, #f43f5e); box-shadow: 0 0 10px rgba(244, 63, 94, .5); }

/* ── Цена ─────────────────────────────────────────────────────── */
.price-box {
    margin: 22px 0 6px;
    padding: 26px 20px;
    text-align: center;
    border-radius: var(--radius);
    background:
        radial-gradient(ellipse at 50% 0%, rgba(217, 70, 239, .18), transparent 70%),
        var(--surface-2);
    border: 1px solid var(--border);
}

.price {
    font-size: 46px;
    font-weight: 900;
    letter-spacing: -.045em;
    line-height: 1;
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.price-period {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    -webkit-text-fill-color: var(--muted);
}

/* ── Кнопки ───────────────────────────────────────────────────── */
.actions, .pay-methods {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 22px;
}

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 13px 20px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    transition: transform .18s cubic-bezier(.16, 1, .3, 1), border-color .18s, background .18s, box-shadow .18s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn:hover {
    border-color: var(--border-hover);
    background: rgba(217, 70, 239, .09);
    transform: translateY(-2px);
}
.btn:active { transform: translateY(0); }

.btn:focus-visible {
    outline: 2px solid var(--fuchsia);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--accent-grad);
    border-color: transparent;
    color: #fff;
    box-shadow: var(--shadow-glow);
}
.btn-primary:hover {
    background: var(--accent-grad);
    filter: brightness(1.1);
    box-shadow: 0 12px 40px rgba(217, 70, 239, .42);
}

/* Блик по primary-кнопке */
.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .28) 50%, transparent 65%);
    transform: translateX(-110%);
    pointer-events: none;
}
.btn-primary:hover::after { animation: shine .75s ease; }

@keyframes shine { to { transform: translateX(110%); } }

.btn-pay {
    justify-content: flex-start;
    background: var(--surface-2);
    color: var(--text);
}
.btn-pay:hover { background: rgba(217, 70, 239, .1); }
.btn-pay .pay-ico { font-size: 17px; line-height: 1; }
.btn-pay .pay-arrow { margin-left: auto; color: var(--muted); transition: transform .18s, color .18s; }
.btn-pay:hover .pay-arrow { transform: translateX(3px); color: var(--fuchsia); }

.btn-small {
    width: auto;
    padding: 9px 13px;
    font-size: 13px;
    flex-shrink: 0;
}

.btn-danger {
    color: var(--danger);
    background: rgba(244, 63, 94, .08);
    border-color: rgba(244, 63, 94, .25);
}
.btn-danger:hover {
    background: rgba(244, 63, 94, .16);
    border-color: rgba(244, 63, 94, .5);
}

/* ── Виджет Telegram-логина ───────────────────────────────────── */
.login-hero {
    width: 66px;
    height: 66px;
    margin: 0 auto 20px;
    border-radius: 20px;
    background: var(--accent-grad);
    display: grid;
    place-items: center;
    box-shadow: 0 12px 40px rgba(217, 70, 239, .4);
    animation: bob 3.5s ease-in-out infinite;
}
.login-hero svg { width: 34px; height: 34px; }

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

.widget-wrap {
    margin-top: 26px;
    display: flex;
    justify-content: center;
    min-height: 46px;
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: var(--muted);
    font-size: 12px;
}
.divider::before, .divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}
.form-stack .error, .form-stack .success { text-align: center; margin: 0 0 2px; }

.login-features {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}

.feature {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    padding: 6px 11px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

/* ── Устройства ───────────────────────────────────────────────── */
.device-list { list-style: none; padding: 0; margin: 20px 0 0; }

.device-item {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 11px;
    transition: border-color .2s;
}
.device-item:hover { border-color: var(--border-hover); }

.device-head {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 12px;
}

.device-ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(217, 70, 239, .13);
    display: grid;
    place-items: center;
    font-size: 17px;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(217, 70, 239, .22);
}

.device-name {
    font-weight: 600;
    font-size: 15px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.device-config { margin-bottom: 12px; }

.device-config summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--fuchsia);
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    padding: 4px 0;
}
.device-config summary::-webkit-details-marker { display: none; }
.device-config summary::before {
    content: '▸';
    transition: transform .2s;
    display: inline-block;
}
.device-config[open] summary::before { transform: rotate(90deg); }
.device-config summary:hover { color: var(--pink); }

.config-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-top: 10px;
}

.config-url {
    flex: 1;
    min-width: 0;
    display: block;
    padding: 11px 13px;
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-2);
    background: rgba(0, 0, 0, .35);
    border: 1px solid var(--border);
    border-radius: 10px;
    word-break: break-all;
    max-height: 92px;
    overflow-y: auto;
}

.device-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
}

input[type="text"], input[type="password"], input[type="email"], select {
    flex: 1;
    min-width: 0;
    width: 100%;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: rgba(0, 0, 0, .3);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 13px;
    transition: border-color .2s, box-shadow .2s;
}

input[type="text"]::placeholder, input[type="password"]::placeholder, input[type="email"]::placeholder {
    color: var(--muted);
}

input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus, select:focus {
    outline: none;
    border-color: var(--fuchsia);
    box-shadow: 0 0 0 3px rgba(217, 70, 239, .16);
}

select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d7288' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 15px;
}

select option { background: #16101a; color: var(--text); }

.add-form { display: flex; gap: 10px; align-items: center; }
.add-form select { flex: 1; }
.add-form .btn { width: auto; flex-shrink: 0; }

/* ── Пустое состояние ─────────────────────────────────────────── */
.empty {
    text-align: center;
    padding: 34px 20px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--muted);
}
.empty-ico { font-size: 32px; display: block; margin-bottom: 10px; opacity: .55; }

/* ── Ожидание оплаты ──────────────────────────────────────────── */
.pay-amount {
    font-size: 40px;
    font-weight: 900;
    letter-spacing: -.04em;
    margin: 18px 0 4px;
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.spinner {
    width: 42px;
    height: 42px;
    margin: 0 auto 18px;
    border: 3px solid rgba(217, 70, 239, .18);
    border-top-color: var(--fuchsia);
    border-radius: 50%;
    animation: spin .85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.spinner.done {
    border: none;
    animation: none;
    background: rgba(52, 211, 153, .14);
    display: grid;
    place-items: center;
    color: var(--ok);
    font-size: 22px;
    box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .3);
}

/* ── Тост (копирование) ───────────────────────────────────────── */
.toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translate(-50%, 24px);
    padding: 11px 20px;
    border-radius: 999px;
    background: rgba(20, 12, 22, .95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-hover);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-glow);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Подвал ───────────────────────────────────────────────────── */
.footer {
    text-align: center;
    padding: 26px 18px 40px;
    color: var(--muted);
    font-size: 12.5px;
}
.footer a {
    color: var(--text-2);
    text-decoration: none;
    font-weight: 500;
    transition: color .2s;
}
.footer a:hover { color: var(--fuchsia); }

/* ── Мобильные ────────────────────────────────────────────────── */
@media (max-width: 560px) {
    /* backdrop-filter создаёт containing block для fixed-потомков —
       таб-бар прилипал бы к шапке. На мобилке блюр меняем на плотный фон. */
    .topbar {
        padding: 12px 16px;
        justify-content: center;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(12, 6, 11, .95);
    }
    .brand { font-size: 17px; gap: 8px; }
    .brand-mark { width: 27px; height: 27px; border-radius: 8px; }

    /* Навигация переезжает вниз — таб-бар, как в приложениях */
    .nav {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 60;
        justify-content: space-around;
        gap: 0;
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
        background: rgba(10, 5, 9, .82);
        backdrop-filter: blur(22px) saturate(140%);
        -webkit-backdrop-filter: blur(22px) saturate(140%);
        border-top: 1px solid var(--border);
        animation: tab-in .45s cubic-bezier(.16, 1, .3, 1) both;
    }

    .nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        flex: 1;
        min-height: 48px;              /* полноценный тап-таргет */
        justify-content: center;
        padding: 6px 4px;
        font-size: 11px;
        font-weight: 500;
        border-radius: 12px;
    }

    .nav-ico { display: block; }
    .nav a.active { background: rgba(217, 70, 239, .14); box-shadow: none; }
    .nav a.active .nav-ico { filter: drop-shadow(0 0 6px rgba(217, 70, 239, .7)); }

    /* Контент не прячется под таб-баром */
    .container { padding: 24px 14px calc(84px + env(safe-area-inset-bottom)); }
    .footer { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

    .card { padding: 22px 18px; border-radius: 16px; }

    h1 { font-size: 23px; }
    .price { font-size: 38px; }
    .stat-grid { gap: 10px; }
    .stat-value { font-size: 17px; }

    /* 16px на инпутах — иначе iOS Safari зумит страницу при фокусе */
    input[type="text"], select { font-size: 16px; padding: 12px 14px; }
    select { padding-right: 38px; }

    .btn { min-height: 48px; }
    .btn-small { min-height: 42px; }

    .device-actions { flex-direction: column; align-items: stretch; }
    .device-actions .btn-small { width: 100%; }
    .inline-form { width: 100%; flex-direction: column; align-items: stretch; }
    .inline-form input[type="text"] { width: 100%; flex: none; }

    .add-form { flex-direction: column; align-items: stretch; }
    .add-form .btn { width: 100%; }

    .config-row { flex-direction: column; }
    .config-row .btn-small { width: 100%; }

    /* Тяжёлые фоновые эффекты на телефонах ужимаем — экономия батареи/GPU */
    .bg-orbs::before { width: 420px; height: 420px; filter: blur(70px); }
    .bg-orbs::after  { width: 360px; height: 360px; filter: blur(70px); }
}

@keyframes tab-in {
    from { transform: translateY(100%); }
    to   { transform: none; }
}

@media (max-width: 380px) {
    .nav a span { font-size: 10px; }
    h1 { font-size: 21px; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
}

/* ── Лендинг (публичная главная) ──────────────────────────────── */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 16px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0 4px;
}

.feature-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    transition: border-color .2s, transform .2s;
}
.feature-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.feature-card .feature-ico { font-size: 20px; display: block; margin-bottom: 8px; }
.feature-card h3 { margin: 0 0 4px; font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
.feature-card p { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.5; }

.steps { list-style: none; margin: 20px 0 4px; padding: 0; counter-reset: step; }
.steps li {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.steps li:last-child { border-bottom: none; }
.steps li::before {
    counter-increment: step;
    content: counter(step);
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-grad);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: grid;
    place-items: center;
    box-shadow: var(--shadow-glow);
}
.steps p { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.steps strong { color: var(--text); }

.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 4px 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 14.5px;
    list-style: none;
    padding: 12px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    flex-shrink: 0;
    color: var(--fuchsia);
    font-size: 18px;
    font-weight: 400;
    transition: transform .2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin: 0 0 14px; color: var(--text-2); font-size: 13.5px; line-height: 1.6; }

@media (max-width: 560px) {
    .feature-grid { grid-template-columns: 1fr; }
}

/* ── Фиксы ───────────────────────────────────────────────────── */
.price-period {
    letter-spacing: normal;
    font-weight: 500;
    line-height: 1.4;
    word-spacing: normal;
}

.stat .progress {
    margin-top: 10px;
    margin-bottom: 2px;
}

.progress-fill {
    min-width: 4px;
}

/* Блик primary-кнопки должен обрезаться её границами */
.btn { overflow: hidden; }

/* ══════════════════════════════════════════════════════════════
   Лендинг v2 — awawa-style
   ══════════════════════════════════════════════════════════════ */

/* Якорная навигация */
.landing-nav {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    justify-content: center; margin: 0 0 22px;
}
.landing-nav a {
    color: var(--text-2); text-decoration: none; font-size: 13.5px;
    font-weight: 600; padding: 8px 14px; border-radius: 999px;
    border: 1px solid transparent; transition: .2s;
}
.landing-nav a:hover { color: var(--text); background: var(--surface-2); }
.landing-nav-cta {
    color: #fff !important; background: var(--accent-grad);
    box-shadow: var(--shadow-glow);
}

/* Hero */
.hero {
    display: block; text-align: center; padding: 40px 30px 34px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    margin-bottom: 18px;
}
.hero h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.12; margin: 14px 0 12px; font-weight: 900; letter-spacing: -.02em; }
.hero-note { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; }
.hero-note a { color: var(--fuchsia); }

/* Бегущая строка */
.marquee { overflow: hidden; margin: 0 0 18px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 10px; width: max-content; animation: marquee 28s linear infinite; }
.marquee-track span { white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 8px 16px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Статы */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0; }
.stat { text-align: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 10px; }
.stat b { display: block; font-size: 26px; font-weight: 900; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font-size: 12px; color: var(--muted); }

/* Спидтест */
.speed-test { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }
.speed-row { display: grid; grid-template-columns: 220px 1fr 120px; gap: 14px; align-items: center; }
.speed-label { font-size: 13px; color: var(--text-2); font-weight: 600; }
.speed-num { font-size: 13px; font-weight: 800; text-align: right; }
.speed-bar { height: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.speed-bar i { display: block; height: 100%; border-radius: 999px; background: var(--muted); }
.speed-bar-on i { background: var(--accent-grad); box-shadow: 0 0 14px rgba(217,70,239,.5); animation: grow-bar 1.4s cubic-bezier(.2,.8,.2,1) both; }
@keyframes grow-bar { from { width: 0 !important; } }

/* Прайс-карта */
.price-card { position: relative; max-width: 460px; margin: 18px auto 0; background: var(--surface-2); border: 1px solid var(--border-hover); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-glow); }
.price-hit { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent-grad); color: #fff; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: 4px 14px; border-radius: 999px; }
.price-name { margin: 4px 0 6px; font-size: 22px; }

/* Финальный CTA */
.cta-final { background: linear-gradient(160deg, rgba(168,85,247,.10), rgba(236,72,153,.06)); border-color: var(--border-hover); }

@media (max-width: 860px) {
    .hero { padding: 26px 20px; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .speed-row { grid-template-columns: 1fr; gap: 6px; }
    .speed-num { text-align: left; }
}

.hero .actions { justify-content: center; }
.hero .muted { max-width: 620px; margin-left: auto; margin-right: auto; }
