:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #181825;
    --bg-tertiary: #1e1e2e;
    --bg-glass: rgba(30, 30, 46, 0.75);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #a6a6b3;
    --text-muted: #6c6c7e;
    --accent-purple: #a855f7;
    --accent-indigo: #6366f1;
    --accent-pink: #ec4899;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-orange: #f97316;
    --accent-red: #ef4444;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
}

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

html {
    -webkit-tap-highlight-color: transparent;
    min-height: 100%;
    min-height: var(--app-height, 100dvh);
    overscroll-behavior-y: auto;
    overscroll-behavior-x: none;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: var(--app-height, 100dvh);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: auto;
    overscroll-behavior-x: none;
    -webkit-overflow-scrolling: touch;
    -webkit-font-smoothing: antialiased;
    touch-action: pan-y;
}

html.miniapp-root,
body.miniapp-root,
body[data-miniapp-screen] {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html.miniapp-root::-webkit-scrollbar,
body.miniapp-root::-webkit-scrollbar,
body[data-miniapp-screen]::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

body[data-miniapp-screen] .main-content {
    padding: 72px 14px 24px;
}

body.has-profile-tabbar .main-content {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

body[data-miniapp-screen] .mini-app-brand-hero {
    padding: 2px 0 8px;
}

body[data-miniapp-screen] .mini-app-brand-hero .avira-mini-brand__logo {
    height: clamp(72px, 20vw, 104px) !important;
    max-width: min(420px, 92vw) !important;
}

body[data-miniapp-screen] .profile-card {
    padding: 20px 16px 18px;
    margin-bottom: 10px;
}

body[data-miniapp-screen] .profile-section {
    margin-bottom: 10px;
}

body[data-miniapp-screen] .section-title {
    margin-bottom: 10px;
}

#app {
    min-height: 100vh;
    min-height: var(--app-height, 100dvh);
    display: flex;
    flex-direction: column;
    position: relative;
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: env(safe-area-inset-top, 12px) 16px 12px;
    background: linear-gradient(180deg, var(--bg-primary) 0%, rgba(15, 15, 26, 0.92) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
}

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

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

.logo-text {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* Profile */
.profile-dropdown-container {
    position: relative;
}

.profile-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-glass);
    background: var(--bg-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    overflow: hidden;
    padding: 0;
    line-height: 1;
    margin-top: 10px;
}

.profile-btn:active {
    transform: scale(0.92);
    border-color: var(--accent-purple);
}

.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.profile-btn svg {
    display: block;
    margin: auto;
}

/* Dropdown */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 200;
    overflow: hidden;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.dropdown-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

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

.dropdown-username {
    font-size: 12px;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-glass);
    margin: 0 12px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover,
.dropdown-item:active {
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-item.logout {
    color: var(--accent-red);
}

.dropdown-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 80px 16px 100px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.hero-section {
    margin-bottom: 28px;
}

.hero-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 340px;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.card {
    background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.card:active {
    transform: scale(0.98);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-md);
}

.card-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.card-icon-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
}

.image-gradient {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
}

.video-gradient {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
}

.audio-gradient {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-red));
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
}

.pay-gradient {
    background: linear-gradient(135deg, #f59e0b 0%, #eab308 45%, #fbbf24 100%);
}

.gen-gradient {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
}

.card-content {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.card-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 12px;
}

.card-btn {
    display: inline-flex;
    align-items: center;
    padding: 7px 18px;
    border-radius: 20px;
    border: none;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
    color: white;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.card-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
}

.card-btn:active {
    transform: scale(0.95);
    opacity: 0.9;
}

/* Bottom Panel */
.bottom-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(15, 15, 26, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.bottom-panel-content {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 4px;
    max-width: 600px;
    margin: 0 auto;
}

.bottom-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    position: relative;
    text-decoration: none;
}

.bottom-btn.active {
    color: var(--accent-purple);
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.15);
}

.bottom-btn:active {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bottom-btn svg {
    transition: transform 0.2s ease;
}

.bottom-btn:active svg {
    transform: scale(0.9);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-top: 1px solid var(--border-glass);
    box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 12px;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.modal-close:active {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(0.92);
}

.modal-body {
    padding: 0 20px 28px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: auto;
    overscroll-behavior-x: none;
}

/* Form elements in modal */
.modal-form-group {
    margin-bottom: 18px;
}

.modal-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.modal-input,
.modal-textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glass);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
}

.modal-input:focus,
.modal-textarea:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.modal-textarea {
    min-height: 120px;
    resize: vertical;
}

.modal-input::placeholder,
.modal-textarea::placeholder {
    color: var(--text-muted);
}

.modal-submit {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-sm);
    border: none;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
    color: white;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.modal-submit::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
}

.modal-submit:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* Loading */
.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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

/* Responsive */
@media (min-width: 480px) {
    .cards-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .card {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 15px;
    }

    .modal {
        border-radius: var(--radius-xl);
        margin-bottom: 20px;
        max-height: 80vh;
    }

    .modal-overlay {
        align-items: center;
    }
}

@media (min-width: 640px) {
    .main-content {
        padding: 90px 24px 110px;
    }

    .header {
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* Subscription Page Styles */
.plans-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 400px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Safe area for bottom panel */
@media (display-mode: standalone) {
    .bottom-panel {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

/* Profile Page */
.profile-card {
    background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 28px 20px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.profile-name-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    width: 100%;
}

.profile-name-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.edit-name-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.08);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.15s ease;
    position: absolute;
    top: 22px;
    right: 20px;
}

.edit-name-btn:active {
    background: rgba(168, 85, 247, 0.2);
    color: var(--accent-purple);
    transform: scale(0.9);
}

/* Stats List (vertical) */
.stats-list {
    padding: 4px 0 8px;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-glass);
    transition: background 0.15s ease;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row:active {
    background: rgba(255,255,255,0.03);
}

.stat-row-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.stat-row-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
}

.stat-row-label {
    flex: 1;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-row-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    min-width: 28px;
    text-align: right;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #6ee7b7;
    background: rgba(110, 231, 183, 0.1);
    border: 1px solid rgba(110, 231, 183, 0.18);
    border-radius: 20px;
    padding: 6px 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 10px;
}

.balance-icon-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.balance-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.balance-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
}

.balance-card {
    padding: 16px;
}

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

.balance-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.balance-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.balance-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.balance-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-purple);
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 20px;
    padding: 4px 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.balance-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.balance-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-indigo));
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.balance-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease;
}

.back-btn:active {
    background: rgba(255,255,255,0.08);
}

.header-spacer {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.header-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0 32px;
}

.profile-avatar-large {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 8px 32px rgba(168, 85, 247, 0.3);
    position: relative;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-img-placeholder {
    font-size: 36px;
    font-weight: 700;
    color: white;
    letter-spacing: 1px;
}

.profile-name {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: 0.2px;
    text-align: center;
}

.profile-username {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 0.1px;
    line-height: 1.4;
}

.profile-section {
    background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    margin-bottom: 24px;
}

.profile-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px 16px 8px;
}

.info-list {
    padding: 0 0 8px;
}

.info-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-glass);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
}

.info-value {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* Страница профиля: градиент «тёмный navy → королевский синий» (фон), карточки — стекло */
body.page-profile {
    background: linear-gradient(
        118deg,
        #000814 0%,
        #00122f 32%,
        #002a6e 68%,
        #0044cc 100%
    );
    background-attachment: fixed;
    background-color: #000814;
}

body.page-profile #app {
    background: transparent;
}

body.page-profile .header {
    background: linear-gradient(
        180deg,
        rgba(0, 8, 20, 0.94) 0%,
        rgba(0, 12, 35, 0.58) 100%
    );
    border-bottom-color: rgba(255, 255, 255, 0.07);
}

body.page-profile .profile-card,
body.page-profile .profile-section {
    background: rgba(4, 10, 28, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

body.page-profile .profile-card::before,
body.page-profile .profile-section::before {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(100, 180, 255, 0.12),
        transparent
    );
}

body.page-profile .profile-avatar-large {
    box-shadow: 0 8px 36px rgba(0, 100, 220, 0.35);
}

body.page-profile .stat-row {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

body.page-profile .info-item {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* Профиль: Подписки / Генерации */
.profile-hub-wrap {
    padding: 0 12px 14px;
}

.profile-hub-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin: 0;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.profile-hub-card--pay {
    background: linear-gradient(
        135deg,
        rgba(245, 158, 11, 0.14) 0%,
        rgba(99, 102, 241, 0.1) 100%
    );
    border-color: rgba(251, 191, 36, 0.22);
}

.profile-hub-card:active,
.profile-nav-item:active {
    background: rgba(255, 255, 255, 0.07);
    transform: scale(0.99);
}

.profile-hub-icon,
.profile-nav-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.profile-hub-icon::after,
.profile-nav-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, transparent 55%);
}

.profile-hub-text,
.profile-nav-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.profile-hub-title,
.profile-nav-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.25;
}

.profile-hub-desc,
.profile-nav-meta {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1.3;
}

.profile-hub-chevron,
.profile-nav-chevron {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
}

.profile-gen-section .section-title {
    padding-bottom: 4px;
}

.profile-gen-group {
    margin-bottom: 4px;
}

.profile-gen-group:last-child {
    margin-bottom: 8px;
}

.profile-gen-group-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.95);
    padding: 10px 16px 6px;
    margin: 0;
}

.profile-nav-list {
    padding: 0 0 4px;
}

.profile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease;
}

.profile-nav-item:last-child {
    border-bottom: none;
}

.profile-gen-empty {
    padding: 12px 16px 18px;
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}

body.page-profile .profile-nav-item {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.profile-menu-list {
    padding: 0 0 6px;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease;
}

.profile-menu-item:last-child {
    border-bottom: none;
}

.profile-menu-item:active,
.profile-menu-item:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

.profile-menu-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.profile-menu-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, transparent 55%);
}

.profile-menu-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.profile-menu-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-menu-desc {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1.35;
}

.profile-menu-chevron {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
}

.profile-menu-item--pay {
    background: linear-gradient(
        90deg,
        rgba(245, 158, 11, 0.06) 0%,
        transparent 72%
    );
}

.profile-menu-item--gen {
    background: linear-gradient(
        90deg,
        rgba(99, 102, 241, 0.08) 0%,
        transparent 72%
    );
}

.page-profile-sub .mini-app-brand-hero {
    display: none;
}

.profile-sub-hint {
    margin: 0 4px 14px;
    padding: 0 12px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-muted);
    text-align: center;
}

.profile-gen-section--page .section-title {
    display: none;
}

.profile-gen-section--page {
    margin-bottom: 24px;
}

.profile-gen-section--page .profile-gen-group:first-child .profile-gen-group-label {
    padding-top: 4px;
}

/* Top-up Balance Button */
.topup-section {
    padding: 16px 20px 0;
    margin-bottom: 16px;
}

.topup-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    border: none;
    cursor: pointer;
}

.topup-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.topup-btn:active {
    transform: translateY(0);
}

.topup-btn svg {
    flex-shrink: 0;
}

/* --- Telegram Mini App: Avira logo (1000×500, 2:1), без рамки — только картинка крупнее --- */
.avira-mini-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.avira-mini-brand__logo {
    height: 48px;
    width: auto;
    max-width: min(280px, 92vw);
    display: block;
    object-fit: contain;
}

@media (min-width: 380px) {
    .avira-mini-brand__logo {
        height: 54px;
        max-width: min(300px, 94vw);
    }
}

/* Компактный логотип в узкой шапке (главная) */
.logo .avira-mini-brand {
    margin-bottom: 0;
}

.logo .avira-mini-brand__logo {
    height: 40px;
    max-width: min(210px, 74vw);
}

@media (min-width: 380px) {
    .logo .avira-mini-brand__logo {
        height: 46px;
        max-width: min(232px, 80vw);
    }
}

.pay-brand-bar {
    display: flex;
    justify-content: center;
    margin: 4px 0 10px;
}

.page-profile-brand {
    text-align: center;
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 16px 4px;
}

/* Логотип под фиксированной шапкой: профиль, аудио, картинки, видео (не перекрывается .header) */
.mini-app-brand-hero {
    text-align: center;
    padding: 8px 0 22px;
}
.mini-app-brand-hero .avira-mini-brand {
    justify-content: center;
    margin-bottom: 0;
}
.mini-app-brand-hero .avira-mini-brand__logo {
    height: clamp(104px, 30vw, 152px) !important;
    width: auto !important;
    max-width: min(560px, 98vw) !important;
    object-fit: contain;
    filter:
        drop-shadow(0 0 22px rgba(56, 189, 248, 0.45))
        drop-shadow(0 4px 16px rgba(0, 0, 0, 0.55));
}

/* Нижняя навигация профиля */
body.has-profile-tabbar .mini-app-brand-hero {
    padding-bottom: 12px;
}

.profile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 2px;
    max-width: 600px;
    margin: 0 auto;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(
        180deg,
        rgba(0, 8, 20, 0.72) 0%,
        rgba(0, 10, 28, 0.96) 38%,
        rgba(0, 12, 32, 0.98) 100%
    );
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
}

.profile-tabbar-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    border-radius: 14px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.52);
    transition: color 0.18s ease, background 0.18s ease, transform 0.15s ease;
}

.profile-tabbar-item:active {
    transform: scale(0.97);
}

.profile-tabbar-item.is-active {
    color: #c7d2fe;
    background: rgba(99, 102, 241, 0.16);
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.28);
}

.profile-tabbar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.profile-tabbar-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}

.profile-tabbar-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.1;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main-content--partnership {
    padding-top: 72px;
}

.ref-section {
    padding: 0;
}

.ref-card {
    text-align: left;
    padding: 22px 18px 20px;
}

.ref-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.ref-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 14px;
    line-height: 1.45;
}

.ref-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.ref-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ref-stat-icon-wrap {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a5b4fc;
}

.ref-stat-icon-wrap svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

.ref-stat-value {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.1;
}

.ref-stat-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.25;
}

.ref-stat-unit {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.ref-bonus-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.18);
    border: 1px solid rgba(99, 102, 241, 0.35);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 14px;
}

.ref-link-wrap {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 10px;
}

.ref-link-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ref-link-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.ref-mini-btn {
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.ref-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.ref-action-btn {
    border: none;
    border-radius: 12px;
    padding: 11px 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.ref-action-btn.secondary {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ref-note {
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

@media (max-width: 380px) {
    .profile-tabbar-label {
        font-size: 10px;
    }

    .profile-tabbar-item {
        padding: 7px 4px;
    }
}
