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

/* ─── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* ─── Design Tokens ──────────────────────────────────────────────── */
:root {
    --bg:           #0C0C0C;
    --bg-card:      #141414;
    --bg-elevated:  #1C1C1C;
    --bg-hover:     #222222;

    --border:        #272727;
    --border-subtle: #1A1A1A;

    --primary:       #1DB954;
    --primary-dim:   rgba(29, 185, 84, 0.12);
    --warning:       #fa0;
    --danger:        #e54;

    --text-primary:   #F0F0F0;
    --text-secondary: #707070;
    --text-muted:     #404040;

    --shadow-sm: 0 1px 0 rgba(0,0,0,0.5) inset;
    --shadow-card: 0 0 0 1px rgba(255,255,255,0.03) inset;
    --shadow-glow: 0 0 48px rgba(29, 185, 84, 0.18);
}

html {
    height: 100%;
    overscroll-behavior-y: contain;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior-y: contain;
    min-height: 100%;
}

/* ─── Grain Texture ──────────────────────────────────────────────── */
.grain-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    opacity: 1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}

/* ─── App Container ──────────────────────────────────────────────── */
.app-container {
    position: relative;
    /* Минимальная высота = весь экран больше не задаём: viewportStableHeight в TG часто раздувает
       min-height → под контентом длинный пустой скролл «один фон». Высоту даёт контент + отступ под таббар. */
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

/* Prevent layout shift when scrollbar appears/disappears */
html {
    scrollbar-gutter: stable;
}

/* ─── Navigation ─────────────────────────────────────────────────── */
.nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(12, 12, 12, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    z-index: 1000;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    padding: 7px 36px;
    transition: color 0.18s ease;
    position: relative;
}

.nav-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.75;
    transition: transform 0.18s ease;
}

.nav-btn.active { color: var(--primary); }
.nav-btn.active svg { transform: scale(1.05); }

.nav-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 24px;
    height: 2px;
    background: var(--primary);
    border-radius: 0 0 2px 2px;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn.active::after { transform: translateX(-50%) scaleX(1); }

/* ─── Pages ──────────────────────────────────────────────────────── */
.page { display: none; position: relative; z-index: 1; }
.page.active {
    display: block;
    animation: pageFadeIn 0.25s ease-out;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Header ─────────────────────────────────────────────────────── */
.header {
    padding: 14px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(12, 12, 12, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.header-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 9px;
}

.logo-circle {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    flex-shrink: 0;
}

.logo-circle svg { width: 18px; height: 18px; }

.logo-text {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: var(--text-primary);
}

/* Header status indicator */
.header-right { display: flex; align-items: center; }

.header-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.status-dot {
    width: 7px;
    height: 7px;
    background: var(--primary);
    border-radius: 50%;
    display: inline-block;
    animation: statusPulse 2.5s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ─── Hero ───────────────────────────────────────────────────────── */
.hero-section {
    padding: 40px 24px 36px;
    position: relative;
    overflow: hidden;
}

/* Decorative glow blob */
.hero-blob {
    position: absolute;
    top: -40px;
    right: -60px;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(29, 185, 84, 0.13) 0%, transparent 68%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
    text-align: left;
}

.hero-eyebrow {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    letter-spacing: 0.2px;
    margin-bottom: 18px;
}

.hero-title {
    font-size: 58px;
    font-weight: 900;
    letter-spacing: -3px;
    line-height: 0.93;
    margin-bottom: 22px;
}

.title-line {
    display: block;
    color: var(--text-primary);
}

/* Solid green — no gradient, no background-clip */
.title-line.accent {
    color: var(--primary);
}

.hero-description {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.65;
    margin-bottom: 20px;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Center hero on wide screens (fullscreen) */
@media (min-width: 720px) {
    .hero-content {
        margin: 0 auto;
        text-align: center;
    }
    .hero-meta {
        justify-content: center;
        flex-wrap: wrap;
    }
}

.hero-dot { color: var(--border); }

/* ─── Features — Numbered Rows ───────────────────────────────────── */
.features-list {
    padding: 4px 20px 32px;
    max-width: 620px;
    margin: 0 auto;
    position: relative;
}

.features-list::before {
    content: '';
    position: absolute;
    inset: 0 24px auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.16), transparent);
    opacity: 0.9;
}

.feature-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    margin-top: 8px;
    border-radius: 999px;
    background: radial-gradient(circle at 0 0, rgba(29,185,84,0.18), transparent 55%),
                rgba(10,10,10,0.9);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.02);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.feature-row:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
    background: radial-gradient(circle at 0 0, rgba(29,185,84,0.26), transparent 60%),
                rgba(10,10,10,0.98);
}

.feature-num {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    background: radial-gradient(circle at 30% 0, rgba(255,255,255,0.35), transparent 55%),
                var(--gradient-primary);
    font-variant-numeric: tabular-nums;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.6), 0 6px 16px rgba(0,0,0,0.7);
}

.feature-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.feature-desc {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
    text-align: right;
    opacity: 0.9;
}

/* ─── Pricing Section ────────────────────────────────────────────── */
.pricing-section {
    padding: 8px 24px 48px;
    max-width: 600px;
    margin: 0 auto;
}

/* ─── FAQ ───────────────────────────────────────────────────────── */
.faq-section {
    padding: 8px 24px 60px;
    max-width: 600px;
    margin: 0 auto;
}

.faq-header {
    margin: 6px 0 14px;
}

.faq-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-top: 6px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
}

.faq-q {
    list-style: none;
    cursor: pointer;
    padding: 14px 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.faq-q::-webkit-details-marker { display: none; }

.faq-q::after {
    content: '';
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23707070' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.18s ease;
}

.faq-item[open] .faq-q::after {
    transform: rotate(180deg);
}

.faq-a {
    padding: 0 16px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.faq-item[open] .faq-q {
    background: var(--bg-elevated);
}

/* Section label — small tracked uppercase */
.section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

/* Keep legacy .section-heading for any JS-injected content */
.section-heading {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.pricing-wrapper {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.pricing-wrapper.catalog-stack {
    display: block;
}

.pricing-wrapper .pricing-card { height: 100%; min-height: 0; }
.pricing-wrapper .pricing-card .pricing-btn { width: 100%; }

.catalog-sections {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.catalog-section {
    scroll-margin-top: 96px;
}

.catalog-section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.catalog-title {
    grid-column: 1 / -1;
    font-weight: 800;
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.catalog-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
}
.catalog-empty-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.catalog-empty-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}
.btn-catalog-refresh {
    padding: 12px 24px;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    color: #000;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}
.btn-catalog-refresh:hover {
    background: #20CC5D;
    box-shadow: 0 4px 16px rgba(29, 185, 84, 0.35);
}

/* Loading */
.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 56px 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    margin: 0 auto 16px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ─── Service Chips ──────────────────────────────────────────────── */
.services-chips {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 8px 10px 10px;
    margin-bottom: 10px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: 8px;
    z-index: 4;
    background: rgba(12, 12, 12, 0.95);
    border: 1px solid var(--border);
    border-radius: 14px;
}
.services-chips::-webkit-scrollbar { display: none; }

.service-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    min-height: 44px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.service-chip:hover { border-color: var(--primary); color: var(--text-primary); }

.service-chip.active {
    border-color: var(--primary);
    background: var(--primary-dim);
    color: var(--primary);
}

.service-chip-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.service-chip-label { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }

/* ─── Service List Buttons ───────────────────────────────────────── */
.services-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    grid-column: 1 / -1;
}

.service-main-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.service-main-btn:hover {
    border-color: var(--primary);
    background: var(--bg-elevated);
}

.service-main-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-elevated);
    flex-shrink: 0;
}

.service-main-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    text-align: left;
}

.service-main-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-main-sub {
    font-size: 11px;
    color: var(--text-secondary);
}

.service-main-arrow {
    font-size: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ─── Pricing Cards ──────────────────────────────────────────────── */
.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset;
}

.pricing-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.pricing-card.featured {
    border-color: rgba(29, 185, 84, 0.35);
    border-left: 3px solid var(--primary);
    background: var(--bg-card);
}

.pricing-card.featured:hover {
    border-left-color: var(--primary);
    border-color: var(--primary);
}

.card-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--primary);
    color: #000;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
}

.card-glow { display: none; }

.product-image-wrapper {
    width: 100%;
    aspect-ratio: 16 / 10;
    min-height: 86px;
    max-height: 118px;
    margin: -2px -2px 10px -2px;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    background: var(--bg-elevated);
    flex-shrink: 0;
}

.product-card-image { width: 100%; height: 100%; object-fit: cover; }

.pricing-header { margin-bottom: 10px; flex-shrink: 0; }

.pricing-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.price-display {
    display: flex;
    align-items: baseline;
    gap: 2px;
    margin-bottom: 2px;
}

.price-value {
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.price-currency {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.price-period, .price-savings { font-size: 12px; color: var(--text-secondary); }

.pricing-description {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-shrink: 0;
}

.pricing-features { margin-bottom: 14px; flex: 1; min-height: 0; }

.feature-check {
    padding: 4px 0;
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
}

.feature-check::before {
    content: '✓';
    color: var(--primary);
    font-weight: 800;
    font-size: 12px;
    flex-shrink: 0;
}

.feature-check.highlight { color: var(--primary); font-weight: 600; }

.pricing-btn {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.pricing-btn:hover { background: var(--bg-hover); border-color: var(--primary); }
.pricing-btn:active { transform: scale(0.98); }

.pricing-btn svg { width: 16px; height: 16px; stroke-width: 2.5; }
.pricing-btn span, .pricing-btn svg { position: relative; z-index: 1; }

.pricing-btn.primary {
    background: var(--primary);
    border-color: transparent;
    color: #000;
    font-weight: 800;
}

.pricing-btn.primary:hover {
    background: #20CC5D;
    box-shadow: 0 4px 16px rgba(29, 185, 84, 0.35);
}

@media (max-width: 560px) {
    .catalog-section-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .service-chip {
        min-height: 40px;
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* ─── Profile Page ───────────────────────────────────────────────── */
.profile-header {
    text-align: center;
    padding: 36px 24px 24px;
}

.legal-page-header {
    position: relative;
    padding-top: calc(36px + env(safe-area-inset-top, 0px));
    padding-left: 48px;
    padding-right: 48px;
}

.legal-page-close {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    left: auto;
    z-index: 2;
}

.profile-avatar {
    position: relative;
    display: inline-block;
    margin-bottom: 14px;
}

.avatar-glow {
    position: absolute;
    inset: -16px;
    background: radial-gradient(circle, rgba(29,185,84,0.2) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.avatar-circle {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: #000;
    position: relative;
    z-index: 1;
}

.profile-name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.4px;
    margin-bottom: 8px;
}

.profile-status {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 5px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    display: inline-block;
    font-weight: 500;
}

.profile-content {
    padding: 0 24px 44px;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-card);
}

.btn-support {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}
.btn-support:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.card-header { margin-bottom: 16px; }

.card-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.subscription-empty,
.history-empty {
    text-align: center;
    padding: 28px 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

.subscription-empty p,
.history-empty p { color: var(--text-secondary); font-size: 13px; }

.order-history-list {
    list-style: none;
}
.order-history-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.order-history-item:last-child { border-bottom: none; }
.order-history-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.order-history-plan {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
}
.order-history-date {
    font-size: 12px;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.order-history-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}
.order-history-amount {
    font-weight: 700;
    color: var(--primary);
}
.order-history-bonus {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}
.order-history-status {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}
.order-history-status.status-pending { background: rgba(255, 170, 0, 0.2); color: var(--warning); }
.order-history-status.status-active { background: rgba(29, 185, 84, 0.2); color: var(--primary); }
.order-history-status.status-completed { background: rgba(79, 172, 254, 0.2); color: #4facfe; }
.order-history-status.status-cancelled { background: rgba(238, 85, 68, 0.2); color: var(--danger); }
.order-history-credentials {
    margin-top: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.45;
}
.order-history-credentials strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.empty-icon { font-size: 36px; margin-bottom: 10px; opacity: 0.5; }

.btn-get-premium {
    margin-top: 14px;
    padding: 11px 22px;
    background: var(--primary);
    border: none;
    border-radius: 10px;
    color: #000;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.btn-get-premium:hover {
    background: #20CC5D;
    box-shadow: 0 4px 16px rgba(29, 185, 84, 0.35);
}

/* ─── Modal — Bottom Sheet ───────────────────────────────────────── */
#paymentWaitModal {
    z-index: 10060;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 2000;
    display: none;
    align-items: flex-end;
}

.modal-overlay.active {
    display: flex;
    animation: overlayIn 0.2s ease;
}

@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-radius: 20px 20px 0 0;
    padding: 14px 24px calc(28px + env(safe-area-inset-bottom));
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    animation: sheetUp 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    scrollbar-width: none;
}

.modal-content::-webkit-scrollbar { display: none; }

@keyframes sheetUp {
    from { opacity: 0; transform: translateY(100%); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-drag {
    width: 32px;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 18px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.modal-close {
    width: 30px;
    height: 30px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background 0.15s, transform 0.2s;
}

.modal-close:hover { background: var(--bg-hover); transform: rotate(90deg); }

.modal-close svg { width: 14px; height: 14px; stroke-width: 2.5; }

.checkout-step-details { display: flex; flex-direction: column; gap: 14px; }

.checkout-review-block {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 4px;
}
.checkout-review-lead {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-secondary);
}
.checkout-review-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.checkout-review-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
}
.checkout-review-k { color: var(--text-secondary); flex-shrink: 0; }
.checkout-review-v { font-weight: 700; text-align: right; word-break: break-word; }
.checkout-review-total {
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 15px;
}
.checkout-review-total .checkout-review-v { color: var(--primary); font-size: 17px; }
.checkout-review-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}
.btn-checkout-back {
    width: 100%;
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.btn-checkout-back:active { opacity: 0.9; }

/* ─── Checkout pay — отдельная полноэкранная страница ───────────── */
.checkout-pay-page {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    padding-top: env(safe-area-inset-top);
    animation: checkoutPayIn 0.28s ease;
}
.checkout-pay-page[hidden] {
    display: none !important;
}
@keyframes checkoutPayIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.app-container.checkout-pay-open .nav-bar {
    visibility: hidden;
    pointer-events: none;
}
.checkout-pay-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 12px;
    border-bottom: 1px solid var(--border);
}
.checkout-pay-back {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s;
}
.checkout-pay-back:active { opacity: 0.85; }
.checkout-pay-back svg { width: 22px; height: 22px; }
.checkout-pay-title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.3px;
    flex: 1;
    text-align: center;
}
.checkout-pay-spacer {
    width: 44px;
    flex-shrink: 0;
}
.checkout-pay-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 22px 24px calc(28px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
}
.checkout-pay-lead {
    margin: 0 0 20px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}
.checkout-pay-card {
    margin-bottom: 8px;
}
.checkout-pay-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}
.checkout-pay-actions .submit-btn {
    position: relative;
    overflow: hidden;
}

.payment-wait-modal { text-align: center; }
.payment-wait-title {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 8px;
    letter-spacing: -0.3px;
    text-align: left;
}
.payment-wait-lead {
    margin: 0 0 22px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
    text-align: left;
}
.payment-wait-spinner-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 0 24px;
    min-height: 52px;
}
.payment-wait-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(29, 185, 84, 0.2);
    border-top-color: var(--primary, #1db954);
    border-radius: 50%;
    box-sizing: border-box;
    animation: paymentWaitSpin 0.78s linear infinite;
}
.payment-wait-spinner-wrap.is-paused .payment-wait-spinner {
    animation: none;
    opacity: 0.38;
    border-top-color: rgba(29, 185, 84, 0.35);
}
@keyframes paymentWaitSpin {
    to { transform: rotate(360deg); }
}
.payment-wait-hint {
    margin: -8px 0 18px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-muted, var(--text-secondary));
    text-align: left;
}
.btn-payment-wait-cancel {
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}
.btn-payment-wait-cancel:active {
    opacity: 0.88;
}

/* ─── Form ───────────────────────────────────────────────────────── */
.subscription-form { display: flex; flex-direction: column; gap: 14px; }

.account-type-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.radio-label {
    display: flex;
    align-items: center;
    gap: 0;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    border-radius: 10px;
    overflow: hidden;
}
.radio-label input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.radio-label span {
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.radio-label input:checked + span {
    color: #000;
    background: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

.own-account-fields[hidden],
.form-field.own-account-fields[hidden] {
    display: none !important;
}

.wallet-checkout-block[hidden] {
    display: none !important;
}

.wallet-inline-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.wallet-inline-desc strong {
    color: var(--primary);
}

.btn-wallet-toggle {
    width: 100%;
    margin-top: 4px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-wallet-toggle.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
}

.checkout-prices {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 8px 0 0;
    line-height: 1.45;
}

.checkout-prices .pay-strong {
    color: var(--text-primary);
    font-weight: 700;
}

.promo-inline-row {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.promo-inline-row #promoCodeInput {
    flex: 1 1 auto;
    min-width: 0;
}

.promo-inline-row .btn-wallet-toggle {
    width: auto !important;
    margin-top: 0 !important;
    padding: 10px 12px;
}

.promo-apply-btn {
    flex: 0 0 auto;
    min-width: 98px;
    height: 42px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

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

.form-field label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.form-field input,
.form-field select {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 13px 14px;
    font-size: 15px;
    color: var(--text-primary);
    font-family: inherit;
    font-weight: 500;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
    -webkit-appearance: none;
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.1);
}

.form-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23707070' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-field input[readonly] {
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: not-allowed;
    border-color: var(--border-subtle);
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    color: #000;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    position: relative;
    overflow: hidden;
    margin-top: 4px;
}

.submit-btn:hover {
    background: #20CC5D;
    box-shadow: 0 6px 24px rgba(29, 185, 84, 0.35);
}

.submit-btn:active { transform: scale(0.98); }

.btn-loader {
    width: 17px;
    height: 17px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.submit-btn.loading .btn-loader { display: block; }
.submit-btn.loading span { opacity: 0.7; }

/* ─── Success Modal ──────────────────────────────────────────────── */
.success-modal { text-align: center; padding-top: 8px; }

.success-animation { margin-bottom: 16px; }

.success-checkmark {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    color: var(--primary);
}

.success-checkmark svg {
    width: 100%;
    height: 100%;
    stroke-dasharray: 100;
    stroke-dashoffset: 0;
    animation: checkDraw 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.15s backwards;
}

@keyframes checkDraw {
    from { stroke-dashoffset: 100; opacity: 0; }
    to   { stroke-dashoffset: 0;   opacity: 1; }
}

.success-modal h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.4px;
    margin-bottom: 8px;
}

.success-modal p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.55;
}

.btn-primary {
    display: inline-block;
    padding: 13px 32px;
    background: var(--primary);
    border: none;
    border-radius: 10px;
    color: #000;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
    background: #20CC5D;
    box-shadow: 0 4px 16px rgba(29, 185, 84, 0.35);
}

/* ─── Credits ────────────────────────────────────────────────────── */
.credits {
    padding: 16px 16px calc(8px + env(safe-area-inset-bottom));
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.credits-link {
    color: var(--text-primary);
    font-weight: 800;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.18);
}

.credits-link:hover {
    color: var(--primary);
    border-bottom-color: rgba(29,185,84,0.5);
}

.credits-legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 4px;
    margin-bottom: 10px;
}

.credits-sep {
    color: rgba(255, 255, 255, 0.25);
    user-select: none;
}

.credits-legal-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 11px;
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.credits-legal-link:hover {
    color: var(--text-primary);
}

.credits-dev {
    margin: 0;
}

/* ─── Legal documents (оферта и др.) ─────────────────────────────── */
.legal-doc .legal-doc-subtitle {
    margin: -4px 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.legal-doc .legal-doc-date {
    margin: 0 0 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.legal-doc .legal-doc-h {
    margin: 18px 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.legal-doc .legal-doc-h:first-of-type {
    margin-top: 8px;
}

.legal-doc .legal-doc-list {
    margin: 6px 0 12px;
    padding-left: 20px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.55;
}

.legal-doc .legal-doc-list li {
    margin-bottom: 4px;
}

.legal-doc p {
    font-size: 13px;
    line-height: 1.55;
}

.legal-doc a {
    color: var(--primary);
}

/* ─── Browser Notice ─────────────────────────────────────────────── */
.browser-notice {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.notice-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px 28px;
    text-align: center;
    max-width: 340px;
}

.notice-icon {
    font-size: 48px;
    margin-bottom: 14px;
}

.notice-content h3 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.3px;
    margin-bottom: 8px;
}

.notice-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.btn-telegram {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: var(--primary);
    border: none;
    border-radius: 10px;
    color: #000;
    font-weight: 800;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.15s, box-shadow 0.15s;
    cursor: pointer;
}

.btn-telegram:hover { background: #20CC5D; box-shadow: 0 4px 16px rgba(29, 185, 84, 0.35); }
.btn-telegram svg { width: 18px; height: 18px; }

/* ─── Referral Section ───────────────────────────────────────────── */
.referral-section { padding: 2px 0; }

.referral-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    line-height: 1.5;
}

.referral-link-container { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }

.referral-link-input {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 11px;
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Fira Code', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.referral-link-input:focus { outline: none; border-color: var(--primary); }

.referral-buttons { display: flex; gap: 8px; }

.btn-copy,
.btn-share {
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-copy {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-copy:hover { border-color: var(--primary); background: var(--bg-hover); }

.btn-share {
    background: var(--primary);
    border: none;
    color: #000;
    font-weight: 800;
}

.btn-share:hover { background: #20CC5D; box-shadow: 0 3px 12px rgba(29, 185, 84, 0.3); }

.btn-copy svg, .btn-share svg { width: 14px; height: 14px; stroke-width: 2; flex-shrink: 0; }

.referral-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.stat-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 14px;
    text-align: center;
}

/* Stat value — solid color, no gradient */
.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -1px;
    color: var(--primary);
    margin-bottom: 4px;
}

.stat-label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ─── Settings toggle (legacy support) ──────────────────────────── */
.settings-list { display: flex; flex-direction: column; gap: 14px; }
.setting-item { display: flex; justify-content: space-between; align-items: center; }
.setting-info { display: flex; flex-direction: column; gap: 3px; }
.setting-label { font-weight: 600; font-size: 14px; }
.setting-desc { font-size: 12px; color: var(--text-secondary); }
.toggle-switch { position: relative; width: 46px; height: 26px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    transition: 0.2s;
    border-radius: 26px;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.2s;
    border-radius: 50%;
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); border-color: var(--primary); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }

/* ─── Ripple ─────────────────────────────────────────────────────── */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    transform: scale(0);
    animation: rippleAnim 0.5s ease-out;
    pointer-events: none;
}

@keyframes rippleAnim { to { transform: scale(4); opacity: 0; } }

.pricing-btn,
.submit-btn,
.btn-primary,
.btn-get-premium { position: relative; overflow: hidden; }

/* ─── Subscription Active State (JS-injected) ────────────────────── */
.subscription-active { text-align: center; padding: 16px 0; }

.subscription-plan {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--primary);
    letter-spacing: -0.3px;
}

.subscription-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.subscription-status {
    display: inline-block;
    padding: 5px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subscription-status.active {
    background: var(--primary-dim);
    border-color: rgba(29, 185, 84, 0.25);
    color: var(--primary);
}

/* ─── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .hero-title { font-size: 48px; letter-spacing: -2.5px; }
    .referral-buttons { flex-direction: column; }
    .btn-copy, .btn-share { width: 100%; }
}
