/* Palm VPN Cabinet */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
}

:root {
    --bg: #f6f7f6;
    --card: #fff;
    --border: #ececeb;
    --border2: #dededc;
    --accent: #16a34a;
    --accent-d: #15803d;
    --adim: rgba(22, 163, 74, 0.08);
    --ab: rgba(22, 163, 74, 0.22);
    --red: #dc2626;
    --rdim: rgba(220, 38, 38, 0.08);
    --ink: #121413;
    --text: #1b1d1b;
    --t2: #5d625e;
    --t3: #8b908c;
    --yellow-grad: linear-gradient(135deg, #ffe877, #ffec78);
    --font:
        "Roboto", "Inter", -apple-system, BlinkMacSystemFont, system-ui,
        "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
    --r: 16px;
    --r2: 12px;
    --pill: 999px;
    --sh: 0 1px 2px rgba(18, 20, 19, 0.05), 0 1px 1px rgba(18, 20, 19, 0.03);
    --sh2: 0 8px 24px rgba(18, 20, 19, 0.08), 0 2px 6px rgba(18, 20, 19, 0.04);
    --bnav: 60px;
    --hdr: 56px;
    --max: 640px;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-thumb {
    background: var(--border2);
    border-radius: 3px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    letter-spacing: -0.005em;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
}
h1,
h2,
h3,
.card-title,
.login-logo h1,
.stat-box-val,
.buy-total-val {
    color: var(--ink);
    letter-spacing: -0.025em;
}

/* ─── UTILS ─── */
.hidden {
    display: none !important;
}
.mono {
    font-family: var(--mono);
    font-size: 12px;
}
.t2 {
    color: var(--t2);
}
.fs12 {
    font-size: 12px;
}
.mb8 {
    margin-bottom: 8px;
}
.mb12 {
    margin-bottom: 12px;
}
.mb14 {
    margin-bottom: 14px;
}
.spin {
    animation: spinR 1s linear infinite;
    display: inline-block;
}
@keyframes spinR {
    to {
        transform: rotate(360deg);
    }
}

/* ─── LOGIN ─── */
#screen-login {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 16px 32px;
}
.login-wrap {
    width: 100%;
    max-width: 420px;
}
.login-logo {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo-icon {
    width: 52px;
    height: 52px;
    background: var(--adim);
    border: 1px solid var(--ab);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    color: var(--accent);
}
.login-logo-icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
}
.login-logo h1 {
    font-size: 20px;
    font-weight: 700;
}
.login-logo p {
    font-size: 13px;
    color: var(--t2);
    margin-top: 3px;
}

/* ─── APP SHELL ─── */
#screen-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ─── HEADER ─── */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    height: var(--hdr);
}
.header-inner {
    max-width: var(--max);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 16px;
}
.header-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
}
.header-icon {
    width: 32px;
    height: 32px;
    background: var(--adim);
    border: 1px solid var(--ab);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}
.header-icon svg {
    width: 15px;
    height: 15px;
    stroke-width: 1.8;
}
/* Логотип-силуэт, перекрашенный в зелёный через маску (исходный PNG белый) */
.logo-mark {
    display: block;
    background: var(--grad);
    -webkit-mask: url(/static/palmvpn.png?v=3) center/contain no-repeat;
    mask: url(/static/palmvpn.png?v=3) center/contain no-repeat;
}
.login-logo-icon .logo-mark {
    width: 60%;
    height: 60%;
}
.header-icon .logo-mark {
    width: 64%;
    height: 64%;
}
.header-title {
    font-size: 15px;
    font-weight: 700;
}
.header-title span {
    color: var(--accent);
}

/* desktop nav in header */
.header-nav {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.nav-btn {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 12px;
    border: none;
    background: none;
    color: var(--t2);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--r2);
    cursor: pointer;
    transition:
        background 0.15s,
        color 0.15s;
    text-align: center;
    line-height: 1.2;
    white-space: normal;
}
.nav-btn svg {
    width: 14px;
    height: 14px;
    stroke-width: 1.8;
    flex-shrink: 0;
}
.nav-btn:hover {
    background: var(--adim);
    color: var(--text);
}
.nav-btn.active {
    background: var(--adim);
    color: var(--accent);
    font-weight: 600;
}

.btn-logout {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--r2);
    padding: 6px 12px;
    color: var(--t2);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition:
        border-color 0.15s,
        color 0.15s,
        background 0.15s;
}
.btn-logout svg {
    width: 14px;
    height: 14px;
}
.btn-logout:hover {
    border-color: var(--red);
    color: var(--red);
    background: var(--rdim);
}

/* ─── MAIN CONTENT ─── */
.app-main {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 20px 16px
        calc(var(--bnav) + 16px + env(safe-area-inset-bottom, 0px));
}
.center-wrap {
    width: 100%;
    max-width: var(--max);
}

/* ─── BOTTOM NAV (mobile) ─── */
.bottomnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--card);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottomnav-track {
    position: relative;
    display: flex;
    flex: 1;
}
/* sliding pill indicator */
.bnav-pill {
    position: absolute;
    top: 6px;
    height: calc(100% - 12px);
    background: var(--adim);
    border-radius: 10px;
    transition:
        left 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 0;
}
.bnav-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: var(--bnav);
    border: none;
    background: none;
    color: var(--t3);
    font-family: var(--font);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
    position: relative;
    z-index: 1;
}
.bnav-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.8;
    transition: transform 0.2s;
}
.bnav-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}
.bnav-item.active {
    color: var(--accent);
}
.bnav-item.active svg {
    transform: scale(1.12);
}
.bnav-item:active svg {
    transform: scale(0.9);
}

/* ─── PAGES ─── */
.page {
    display: none;
}
.page.active {
    display: block;
}

/* ─── CARD ─── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 18px;
    box-shadow: var(--sh);
    margin-bottom: 14px;
}
.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 14px;
}
.card-title svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
    stroke-width: 2;
    flex-shrink: 0;
}
.card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-desc {
    font-size: 13px;
    color: var(--t2);
    line-height: 1.55;
    margin-bottom: 12px;
}

/* ─── FIELD ─── */
.field {
    margin-bottom: 12px;
}
.field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--t2);
    margin-bottom: 5px;
}
.field input,
.field select {
    width: 100%;
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: var(--r2);
    padding: 10px 12px;
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}
.field input:focus,
.field select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}
.field input::placeholder {
    color: var(--t3);
}
.field select option {
    background: #fff;
}

/* ─── BUTTONS ─── */
.btn {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 11px 18px;
    border: none;
    border-radius: var(--pill);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    letter-spacing: -0.01em;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
    transition:
        background 0.15s,
        transform 0.12s,
        border-color 0.15s,
        box-shadow 0.18s,
        filter 0.18s;
}
.btn span {
    min-width: 0;
}
.btn svg {
    width: 15px;
    height: 15px;
    stroke-width: 2;
    flex-shrink: 0;
}
.btn:active {
    transform: scale(0.98);
}
.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background: #15803d;
}
.btn-secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    border-color: var(--border2);
    background: #f9fafb;
}
.btn-danger {
    background: var(--rdim);
    color: var(--red);
    border: 1px solid rgba(220, 38, 38, 0.2);
}
.btn-danger:hover {
    background: rgba(220, 38, 38, 0.14);
}
.btn-ghost {
    background: none;
    color: var(--t2);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    color: var(--text);
    border-color: var(--border2);
    background: #f9fafb;
}
.btn-sm {
    width: auto;
    padding: 6px 12px;
    font-size: 13px;
    min-height: 34px;
}
.btn-tg {
    background: #229ed9;
    color: #fff;
}
.btn-tg:hover {
    background: #1d8bc4;
}
.btn-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 10px;
}
.btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    color: var(--t2);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
    text-align: center;
}
.btn-back svg {
    width: 14px;
    height: 14px;
}
.btn-back:hover {
    color: var(--accent);
}
.btn-action {
    max-width: 320px;
}
.actions-center {
    display: flex;
    justify-content: center;
    width: 100%;
}
.actions-center .btn {
    width: 100%;
    max-width: 320px;
}

/* ─── PAY OVERLAY ─── */
.pay-overlay {
    position: fixed;
    inset: 0;
    z-index: 8000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 39, 0.45);
    backdrop-filter: blur(4px);
    padding: 24px;
}
.pay-overlay-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--sh2);
    padding: 28px 32px;
    text-align: center;
    max-width: 340px;
    width: 100%;
    animation: payPop 0.25s ease;
}
@keyframes payPop {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
.pay-overlay-spinner {
    color: var(--accent);
    margin-bottom: 14px;
}
.pay-overlay-spinner svg {
    width: 36px;
    height: 36px;
    stroke-width: 2;
}
.pay-overlay-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}
.pay-overlay-sub {
    font-size: 13px;
    color: var(--t2);
    line-height: 1.45;
}

/* ─── TRIAL CARD ─── */
.trial-card {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border-color: #bbf7d0;
}
.trial-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}
.trial-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    background: #fff;
    border: 1px solid #bbf7d0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}
.trial-card-icon svg {
    width: 22px;
    height: 22px;
}
.trial-card-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
}
.trial-card-desc {
    font-size: 12px;
    color: var(--t2);
}

/* ─── TG LINK BANNER ─── */
.tg-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #e0f2fe, #f0fdf4);
    border: 1px solid #bae6fd;
    border-radius: var(--r);
    padding: 14px 16px;
    margin-bottom: 14px;
}
.tg-banner-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #229ed9;
    flex-shrink: 0;
    border: 1px solid #bae6fd;
}
.tg-banner-icon svg {
    width: 20px;
    height: 20px;
}
.tg-banner-text {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    color: var(--t2);
    line-height: 1.45;
}
.tg-banner-text b {
    display: block;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 2px;
}
.tg-banner-btn {
    width: auto !important;
    max-width: none !important;
    flex-shrink: 0;
    padding: 8px 14px !important;
    min-height: 36px !important;
}

/* ─── DIVIDER ─── */
.divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    color: var(--t3);
    font-size: 12px;
}
.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ─── MSG ─── */
.msg {
    font-size: 13px;
    margin-top: 8px;
    min-height: 18px;
}
.msg.err {
    color: var(--red);
}
.msg.ok {
    color: var(--accent);
}

/* ─── SUBSCRIPTION CARD ─── */
.sub-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}
.sub-label {
    font-size: 12px;
    color: var(--t2);
    margin-bottom: 4px;
}

/* ─── STATS ─── */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}
.stat-box {
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: var(--r2);
    padding: 14px 12px;
}
.stat-box-lbl {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--t2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}
.stat-box-lbl svg {
    width: 13px;
    height: 13px;
    color: var(--accent);
    stroke-width: 2;
}
.stat-box-val {
    font-size: 20px;
    font-weight: 700;
}

/* ─── BADGE ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-green {
    background: var(--adim);
    color: var(--accent);
    border: 1px solid var(--ab);
}
.badge-trial {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fcd34d;
}
.badge svg {
    width: 11px;
    height: 11px;
    stroke-width: 2;
}

/* ─── DASHBOARD ACTIONS ─── */
.dash-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: stretch;
}
.dash-actions .btn {
    flex: 1 1 0;
    min-width: min(100%, 148px);
    max-width: 220px;
}
.dash-trial-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: var(--t2);
    line-height: 1.45;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--r2);
    padding: 10px 12px;
    margin-bottom: 12px;
}
.dash-trial-hint svg {
    width: 14px;
    height: 14px;
    color: #d97706;
    flex-shrink: 0;
    margin-top: 1px;
}
.dash-trial-hint.hidden {
    display: none !important;
}

/* ─── PBAR ─── */
.pbar-wrap {
    margin-top: 12px;
}
.pbar-track {
    height: 4px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
}
.pbar-fill {
    height: 100%;
    width: 0;
    border-radius: 4px;
    background: var(--accent);
    transition: width 0.8s ease;
}
.pbar-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 11px;
    color: var(--t3);
    font-family: var(--mono);
}

/* ─── INFO ROWS ─── */
.info-list {
    border-top: 1px solid var(--border);
}
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.info-key {
    color: var(--t2);
    display: flex;
    align-items: center;
    gap: 6px;
}
.info-key svg {
    width: 13px;
    height: 13px;
    color: var(--t3);
    stroke-width: 2;
}
.info-val {
    font-weight: 500;
}
.info-val.mono {
    font-family: var(--mono);
    font-size: 12px;
}

/* ─── URL BOX ─── */
.url-box {
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: var(--r2);
    padding: 10px 12px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--t2);
    word-break: break-all;
    line-height: 1.5;
    margin-bottom: 12px;
}

/* ─── STEPS ─── */
.step {
    display: flex;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.step:last-child {
    border-bottom: none;
}
.step-n {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    min-width: 20px;
    padding-top: 1px;
}
.step-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}
.step-desc {
    font-size: 12px;
    color: var(--t2);
    line-height: 1.5;
}
.step-desc strong {
    color: var(--text);
}

.platform-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.platform-link {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--r2);
    border: 1px solid var(--border);
    background: #f9fafb;
    color: var(--t2);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    transition:
        border-color 0.15s,
        color 0.15s;
}
.platform-link svg {
    width: 13px;
    height: 13px;
    stroke-width: 1.8;
}
.platform-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.platform-link.current {
    border-color: var(--ab);
    color: var(--accent);
    background: var(--adim);
}

/* ─── QR ─── */
.qr-wrap {
    margin-top: 12px;
    text-align: center;
}
.qr-img {
    width: 120px;
    height: 120px;
    border-radius: var(--r2);
    border: 1px solid var(--border);
    display: block;
    margin: 0 auto 6px;
}
.qr-lbl {
    font-size: 11px;
    color: var(--t3);
}

/* ─── DEVICES ─── */
.device-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.device-row:last-child {
    border-bottom: none;
}
.device-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.device-info svg {
    width: 14px;
    height: 14px;
    color: var(--t3);
    stroke-width: 1.8;
    margin-top: 2px;
    flex-shrink: 0;
}
.device-ip {
    font-family: var(--mono);
    font-size: 12px;
}
.device-seen {
    font-size: 11px;
    color: var(--t3);
}
.empty-msg {
    font-size: 13px;
    color: var(--t3);
    padding: 8px 0;
}

/* ─── CHIPS ─── */
.chip-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 4px 0 14px;
}
.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    min-width: 92px;
    padding: 7px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: #f9fafb;
    color: var(--t2);
    font-size: 13px;
    text-align: center;
    cursor: pointer;
    transition:
        border-color 0.15s,
        color 0.15s,
        background 0.15s;
}
.chip:hover {
    border-color: var(--border2);
    color: var(--text);
}
.chip.selected {
    border-color: var(--accent);
    background: var(--adim);
    color: var(--accent);
    font-weight: 600;
}

/* ─── STEPPER ─── */
.stepper-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin: 16px 0 8px;
}
.stepper-info {
    font-size: 13px;
    color: var(--t2);
}
.stepper-info b {
    color: var(--text);
}
.stepper {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--r2);
    overflow: hidden;
    background: #f9fafb;
}
.stepper-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--t2);
    cursor: pointer;
    transition:
        background 0.15s,
        color 0.15s;
}
.stepper-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
}
.stepper-btn:hover:not(:disabled) {
    background: var(--adim);
    color: var(--accent);
}
.stepper-btn:disabled {
    color: var(--t3);
    cursor: default;
}
.stepper-val {
    width: 56px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    height: 44px;
    line-height: 44px;
    font-family: var(--mono);
}
.stepper-hint {
    font-size: 12px;
    color: var(--t3);
    margin-bottom: 8px;
}
.price-summary {
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: var(--r2);
    padding: 12px 14px;
    margin: 8px 0 14px;
}
.price-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--t2);
    padding: 3px 0;
}
.price-row.total {
    border-top: 1px solid var(--border);
    margin-top: 8px;
    padding-top: 10px;
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
}
.price-row.total b {
    color: var(--accent);
}

/* ─── BUY TOTAL ─── */
.buy-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 12px 0;
}
.buy-total-val {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

/* ─── RESEND TIMER ─── */
.resend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--t3);
}
.resend-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-family: var(--font);
    font-weight: 600;
    color: var(--accent);
    padding: 0;
    transition: opacity 0.15s;
}
.resend-btn:disabled {
    color: var(--t3);
    cursor: default;
}

/* ─── DEVICE OS BADGE ─── */
.device-os {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--t3);
    margin-top: 2px;
}
.device-os svg {
    width: 11px;
    height: 11px;
    stroke-width: 1.8;
}
.cookie-banner {
    position: fixed;
    bottom: calc(var(--bnav) + 8px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 600px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--sh2);
    z-index: 500;
    padding: 14px 16px;
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 14px;
}
.cookie-text {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    font-size: 13px;
    color: var(--t2);
    line-height: 1.55;
}
.cookie-icon {
    width: 16px;
    height: 16px;
    color: #d97706;
    flex-shrink: 0;
    margin-top: 1px;
}
.cookie-btn {
    flex-shrink: 0;
    padding: 8px 18px;
    background: var(--text);
    color: #fff;
    border: none;
    border-radius: var(--r2);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
}
.cookie-btn:hover {
    opacity: 0.85;
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */

/* ── Tablet / Desktop: hide bottom nav, show header nav ── */
@media (min-width: 700px) {
    :root {
        --bnav: 0px;
        --max: 680px;
        --hdr: 60px;
    }
    .bottomnav {
        display: none !important;
    }
    .header-nav {
        display: flex;
    }
    .app-main {
        padding: 28px 24px;
    }
    .cookie-banner {
        bottom: 16px;
    }
    .btn-logout span {
        display: inline;
    }
    /* vertically center login */
    #screen-login {
        align-items: center;
        padding: 0 24px;
    }
    .login-wrap {
        max-width: 460px;
    }
    .card {
        padding: 22px;
    }
    .stat-box-val {
        font-size: 22px;
    }
}

/* ── Mobile: hide header nav, show bottom nav ── */
@media (max-width: 699px) {
    .header-nav {
        display: none;
    }
    .btn-logout span {
        display: none;
    }
    .btn-logout {
        padding: 6px 9px;
    }
    .app-main {
        padding-left: 14px;
        padding-right: 14px;
    }
    /* center login content */
    #screen-login {
        padding-top: 40px;
    }
}

@media (max-width: 520px) {
    .btn-row {
        grid-template-columns: 1fr;
    }
    .platform-row {
        grid-template-columns: 1fr;
    }
    .stepper-row {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    .stepper {
        align-self: center;
    }
}

/* ── Wider desktop: more breathing room ── */
@media (min-width: 960px) {
    :root {
        --max: 760px;
        --hdr: 64px;
    }
    .header-inner {
        font-size: 15px;
    }
    .nav-btn {
        font-size: 14px;
        padding: 8px 14px;
    }
    .nav-btn svg {
        width: 15px;
        height: 15px;
    }
    .app-main {
        padding-top: 32px;
        padding-bottom: 32px;
    }
    .card {
        padding: 24px;
    }
    .stat-box-val {
        font-size: 24px;
    }
    body {
        font-size: 15px;
    }
}

/* ── Narrow phone ── */
@media (max-width: 360px) {
    .app-main {
        padding-left: 10px;
        padding-right: 10px;
    }
    .card {
        padding: 16px;
    }
    .btn {
        padding-left: 12px;
        padding-right: 12px;
    }
    .bnav-item {
        font-size: 9px;
    }
    .bnav-item svg {
        width: 18px;
        height: 18px;
    }
    .cookie-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .cookie-btn {
        width: 100%;
        text-align: center;
    }
}

/* ── Landscape phone ── */
@media (max-height: 480px) and (orientation: landscape) {
    :root {
        --bnav: 50px;
    }
    .bnav-item {
        flex-direction: row;
        gap: 8px;
        font-size: 11px;
        min-height: 50px;
    }
    .bnav-item span {
        display: inline;
    }
}

@media print {
    .app-header,
    .bottomnav,
    .btn-logout,
    .cookie-banner {
        display: none !important;
    }
    .app-main {
        padding: 0;
    }
}

/* ════════════════════════════════════════════════
   POLISH LAYER — градиенты, свечение, мягкие анимации
   ════════════════════════════════════════════════ */
:root {
    --accent2: #22c55e;
    --grad: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
}

/* Мягкий ambient-фон */
body {
    background:
        radial-gradient(
            720px 360px at 90% -6%,
            rgba(34, 197, 94, 0.1),
            transparent 70%
        ),
        radial-gradient(
            560px 320px at 0% 2%,
            rgba(76, 233, 245, 0.06),
            transparent 65%
        ),
        var(--bg);
}

/* Логотип/иконки — градиентная подложка */
.login-logo-icon,
.header-icon {
    background: linear-gradient(
        135deg,
        rgba(34, 197, 94, 0.15),
        rgba(22, 163, 74, 0.06)
    );
}
.login-logo-icon svg {
    width: 26px;
    height: 26px;
    stroke-width: 1.6;
}
.header-icon svg {
    width: 18px;
    height: 18px;
}

/* Кнопки — градиент + объём */
.btn-primary {
    background: var(--grad);
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.26);
    transition:
        filter 0.15s,
        transform 0.1s,
        box-shadow 0.15s;
}
.btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.32);
}
.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

/* Карточки — мягкий подъём при наведении (только на устройствах с курсором) */
@media (hover: hover) {
    .card {
        transition:
            box-shadow 0.18s ease,
            transform 0.18s ease,
            border-color 0.18s;
    }
    .card:hover {
        box-shadow: var(--sh2);
        border-color: var(--ab);
    }
}

/* Логин — плавное появление */
.login-wrap {
    animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* Активная вкладка нав — градиентный акцент */
.nav-btn.active {
    background: linear-gradient(
        135deg,
        rgba(34, 197, 94, 0.16),
        rgba(22, 163, 74, 0.07)
    );
}

@media (prefers-reduced-motion: reduce) {
    .login-wrap {
        animation: none;
    }
    .btn-primary:hover,
    .card:hover {
        transform: none;
    }
}
