.profile-page {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(135deg, #160115 0%, #180236 100%);
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 280px;
    background: rgba(20, 10, 40, 0.6);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(184, 79, 214, 0.2);
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(184, 79, 214, 0.3); border-radius: 4px; }

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(184, 79, 214, 0.2);
}

.logo-small {
    background: linear-gradient(135deg, #b84fd6 0%, #8b2fd1 100%);
    padding: 8px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
}

.lang-switch-small {
    display: flex;
    gap: 5px;
    
    /* 🌟 ИЗМЕНЕНИЯ ТУТ: */
    background: rgba(213, 155, 240, 0.25); /* 1. Увеличили плотность цвета с 0.1 до 0.25 */
    backdrop-filter: blur(12px);          /* 2. Эффект матового стекла (теперь фон под меню размывается) */
    border: 1px solid rgba(213, 155, 240, 0.3); /* 3. Тонкая неоновая граница в тон */
    box-shadow: 0 4px 20px rgba(184, 79, 214, 0.15); /* 4. Мягкое фиолетовое свечение вниз */
    
    padding: 5px; /* Чуть-чуть увеличили паддинг для аккуратности */
    border-radius: 60px;
    width: max-content;
}

.lang-switch-small span {
    padding: 4px 10px;
    border-radius: 60px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
}

.lang-switch-small span.active {
    background: rgba(184, 79, 214, 0.6);
    color: white;
}

.lang-switch-small span:not(.active) {
    color: rgba(255, 255, 255, 0.6);
}

/* Sidebar Nav */
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-divider {
    margin: 12px 0 4px;
    border-top: 1px solid rgba(184, 79, 214, 0.15);
}

.nav-category {
    padding: 8px 16px 4px;
    font-size: 10px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 700;
    letter-spacing: 1px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s;
    font-size: 14px;
}

.nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-link:hover {
    background: rgba(184, 79, 214, 0.1);
    color: white;
}

.nav-link.active {
    background: linear-gradient(135deg, #b84fd6 0%, #8b2fd1 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(184, 79, 214, 0.3);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(184, 79, 214, 0.2);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 95, 86, 0.1);
    border: 1px solid rgba(255, 95, 86, 0.3);
    border-radius: 12px;
    color: #ff5f56;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 600;
}

.logout-btn svg { width: 20px; height: 20px; }

.logout-btn:hover {
    background: rgba(255, 95, 86, 0.2);
    transform: translateX(-4px);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 40px;
}

.content-header h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #b84fd6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 40px;
}

.profile-content { max-width: auto; }

.profile-section { animation: fadeIn 0.3s ease-out; }

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

/* ===== PROFILE CARD ===== */
.profile-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(184, 79, 214, 0.2);
    border-radius: 20px;
    padding: 40px;
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #b84fd6 0%, #8b2fd1 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(184, 79, 214, 0.3);
    flex-shrink: 0;
}

.profile-info h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: white;
}

.profile-email {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 30px;
    font-size: 14px;
}

.profile-stats { display: flex; gap: 40px; }

.stat-item { display: flex; flex-direction: column; gap: 4px; }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #b84fd6;
}

.stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

/* ===== CONNECTED ACCOUNTS ===== */
.connected-accounts {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(184, 79, 214, 0.2);
    border-radius: 20px;
    padding: 30px;
}

.connected-accounts h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: white;
}

.account-list { display: flex; flex-direction: column; gap: 16px; }

.account-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.account-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.account-icon.google { background: rgba(66, 133, 244, 0.15); }
.account-icon.discord { background: rgba(88, 101, 242, 0.15); color: #5865F2; }
.account-icon.telegram { background: rgba(42, 171, 238, 0.15); color: #2AABEE; }
.account-icon.steam { background: rgba(23, 26, 33, 0.8); color: #c5c3c0; }
.account-icon.fortnite { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.account-icon.rocketleague { background: rgba(39, 202, 64, 0.15); color: #27ca40; }

.account-icon svg { width: 24px; height: 24px; }

.account-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-name {
    font-weight: 600;
    color: white;
    font-size: 15px;
}

.account-status {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

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

.connect-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #b84fd6 0%, #8b2fd1 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
    white-space: nowrap;
}

.connect-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.connect-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.connect-btn.check {
    background: linear-gradient(135deg, #27ca40 0%, #1fa832 100%);
}

.connect-btn.check:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 202, 64, 0.4);
}

.connect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(184, 79, 214, 0.4);
}

/* ===== FINANCE ===== */
.finance-balance-card {
    background: linear-gradient(135deg, #b84fd6 0%, #8b2fd1 100%);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(184, 79, 214, 0.3);
}

.finance-balance-amount {
    font-size: 52px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

.finance-balance-label {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
}

.topup-section { margin-bottom: 30px; }

.topup-section h3,
.finance-history h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: white;
}

.topup-amount-input { margin-bottom: 20px; }

.topup-amount-input .form-input {
    max-width: 300px;
    font-size: 18px;
    padding: 16px 20px;
}

.topup-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.topup-method {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(184, 79, 214, 0.2);
    border-radius: 15px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.topup-method:hover {
    border-color: rgba(184, 79, 214, 0.5);
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 25px rgba(184, 79, 214, 0.15);
}

.topup-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.topup-icon.crypto { background: rgba(0, 136, 204, 0.15); color: #0088cc; }
.topup-icon.yoomoney { background: rgba(162, 0, 255, 0.15); color: #a200ff; }

.topup-info { flex: 1; }
.topup-name { font-size: 16px; font-weight: 600; color: white; margin-bottom: 4px; }
.topup-desc { font-size: 13px; color: rgba(255, 255, 255, 0.5); }

.finance-history { margin-top: 30px; }

/* ===== SECTION INTRO ===== */
.section-intro-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(184, 79, 214, 0.2);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
}

.section-intro-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.section-intro-card h3 {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 12px;
}

.section-intro-card p {
    color: rgba(255, 255, 255, 0.6);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ===== SHOP CATEGORIES ===== */
.shop-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.shop-category-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(184, 79, 214, 0.2);
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.shop-category-card:hover {
    border-color: rgba(184, 79, 214, 0.5);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(184, 79, 214, 0.15);
}

.category-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.shop-category-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
}

.shop-category-card p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(184, 79, 214, 0.2);
    border-radius: 20px;
}

.empty-state.small { padding: 40px 20px; }

.empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    color: white;
    margin-bottom: 10px;
}

.empty-state p {
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 20px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}



/* ===== NOTIFICATIONS ===== */
.notifications-list { margin-top: 10px; }

.notification-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(184, 79, 214, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
    transition: all 0.3s;
}

.notification-item:hover {
    border-color: rgba(184, 79, 214, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

.notification-icon {
    font-size: 28px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(184, 79, 214, 0.1);
    border-radius: 10px;
    flex-shrink: 0;
}

.notification-content { flex: 1; }
.notification-content h4 { font-size: 15px; font-weight: 600; margin-bottom: 5px; color: white; }
.notification-content p { font-size: 13px; color: rgba(255, 255, 255, 0.6); margin-bottom: 5px; }
.notification-time { font-size: 12px; color: rgba(255, 255, 255, 0.4); }

/* ===== FORM INPUT ===== */
.form-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 15px;
    transition: all 0.3s;
    outline: none;
}

.form-input:focus {
    border-color: #b84fd6;
    background: rgba(184, 79, 214, 0.05);
    box-shadow: 0 0 0 3px rgba(184, 79, 214, 0.1);
}

.form-input::placeholder { color: rgba(255, 255, 255, 0.3); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .profile-page { flex-direction: column; }

    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
        max-height: none;
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .nav-divider,
    .nav-category { display: none; }

    .nav-link span { display: none; }
    .nav-link { padding: 10px; }

    .main-content { margin-left: 0; padding: 20px; }

    .profile-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-stats { justify-content: center; }

    .finance-balance-amount { font-size: 36px; }

    .topup-methods { grid-template-columns: 1fr; }

    .shop-categories { grid-template-columns: 1fr; }

    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .setting-item .form-input { width: 100%; }

    .account-item {
        flex-wrap: wrap;
    }

    .account-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}



/* ===== PANEL LINKS ===== */
.panel-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(184, 79, 214, 0.15);
    border: 1px solid rgba(184, 79, 214, 0.3);
    border-radius: 10px;
    color: white;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}

.panel-link-btn:hover {
    background: rgba(184, 79, 214, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(184, 79, 214, 0.3);
}

.panel-link-btn svg {
    flex-shrink: 0;
}

/* ===== PANEL ACCESS BUTTONS ===== */
.panel-access-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, rgba(184, 79, 214, 0.2), rgba(139, 47, 209, 0.1));
    border: 1px solid rgba(184, 79, 214, 0.3);
    border-radius: 10px;
    color: white;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel-access-btn:hover {
    background: linear-gradient(135deg, rgba(184, 79, 214, 0.3), rgba(139, 47, 209, 0.2));
    border-color: rgba(184, 79, 214, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(184, 79, 214, 0.3);
}

.panel-access-btn svg {
    flex-shrink: 0;
}

/* ===== PANEL ACCESS SECTION (внизу меню) ===== */
.panel-access-section {
    padding: 10px 16px;
    margin-top: 10px;
}

.panel-access-label {
    font-size: 9px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 600;
}

.panel-mini-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    margin: 4px 0;
    background: rgba(184, 79, 214, 0.1);
    border: 1px solid rgba(184, 79, 214, 0.2);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s;
}

.panel-mini-btn:hover {
    background: rgba(184, 79, 214, 0.2);
    border-color: rgba(184, 79, 214, 0.4);
    color: white;
    transform: translateX(3px);
}

.panel-mini-btn svg {
    flex-shrink: 0;
}
/* ===== SHOWCASE STYLES ===== */
.showcase-banner {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, rgba(184, 79, 214, 0.2), rgba(139, 47, 209, 0.1));
    border-radius: 16px;
    margin-bottom: 60px;
    overflow: hidden;
}

.banner-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.showcase-banner:hover .banner-overlay { opacity: 1; }

.banner-edit-btn, .avatar-edit-btn {
    padding: 10px 20px;
    background: rgba(184, 79, 214, 0.9);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.banner-edit-btn:hover, .avatar-edit-btn:hover {
    background: #b84fd6;
    transform: scale(1.05);
}

.banner-placeholder {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

/* Avatar */
.showcase-profile {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    padding: 0 20px;
    margin-top: -50px;
    position: relative;
    z-index: 10;
}

.showcase-avatar-wrapper {
    position: relative;
}

.showcase-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #0a0a0a;
    background: linear-gradient(135deg, #b84fd6, #8b2fd1);
    object-fit: cover;
}

.avatar-edit-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 50%;
}

.showcase-info {
    flex: 1;
    padding-bottom: 10px;
}

.showcase-info h2 {
    font-size: 28px;
    margin: 0 0 8px 0;
    color: white;
}

.showcase-bio {
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 15px 0;
    font-size: 15px;
    line-height: 1.5;
}

.showcase-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.privacy-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.privacy-label.public { color: #27ca40; }
.privacy-label.private { color: #ff5f56; }

/* Stats */
.showcase-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 20px;
    margin: 20px 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.showcase-stats .stat-card {
    text-align: center;
    padding: 15px;
}

.showcase-stats .stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #b84fd6;
}

.showcase-stats .stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}



/* Settings */
.showcase-settings {
    margin-top: 30px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(184, 79, 214, 0.2);
}

.showcase-settings h3 {
    margin: 0 0 20px 0;
    color: #b84fd6;
}

.showcase-settings .setting-item {
    margin-bottom: 20px;
}

.showcase-settings .setting-item label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.showcase-settings .form-input {
    width: 100%;
    max-width: 400px;
}

/* Streamer Mode */
.streamer-notice {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(245, 124, 0, 0.4);
    animation: slideIn 0.3s ease-out;
}

/* Hide sensitive data in streamer mode */
body.streamer-mode .sensitive-data,
body.streamer-mode .profile-email,
body.streamer-mode #statBalance,
body.streamer-mode .finance-balance-amount,
body.streamer-mode .account-status,
body.streamer-mode [data-sensitive="true"] {
    display: none !important;
}

body.streamer-mode .sensitive-data::after {
    content: "••••••••";
    color: rgba(255, 255, 255, 0.3);
    font-size: 14px;
}

/* File inputs (hidden) */
#bannerFileInput, #avatarFileInput {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .showcase-profile {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .showcase-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .showcase-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ===== уведомления: непрочитанные заметнее ===== */
.notification-item { cursor: pointer; }
.notification-item.unread { border-color: rgba(184, 79, 214, 0.55); background: rgba(184, 79, 214, 0.08); }
.notification-item.read { opacity: .65; }

/* ===== адаптивность: планшет ===== */
@media (max-width: 1024px) and (min-width: 769px) {
    .sidebar { width: 220px; padding: 16px; }
    .main-content { margin-left: 220px; padding: 28px; }
    .profile-card { padding: 28px; }
}

/* ===== адаптивность: телефон — меню сверху горизонтальной лентой ===== */
@media (max-width: 768px) {
    .sidebar {
        position: sticky; top: 0; z-index: 50; padding: calc(10px + env(safe-area-inset-top)) 12px 8px;
        border-right: none; border-bottom: 1px solid rgba(184, 79, 214, 0.2); background: rgba(20, 10, 40, 0.92);
    }
    .sidebar-header { margin-bottom: 10px; padding-bottom: 10px; }
    .sidebar-nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 6px; scrollbar-width: none; padding-bottom: 2px; }
    .sidebar-nav::-webkit-scrollbar { display: none; }
    .nav-link { flex: 0 0 auto; padding: 8px 12px; font-size: 13px; }
    .nav-link span { display: inline; }
    .nav-link svg { width: 16px; height: 16px; }
    .panel-access-section { display: flex !important; align-items: center; gap: 6px; padding: 0; margin: 0; flex: 0 0 auto; }
    .panel-access-section[style*="none"] { display: none !important; }
    .panel-access-label { display: none; }
    .panel-mini-btn { margin: 0; padding: 8px 10px; white-space: nowrap; }
    .main-content { padding: 18px 14px calc(24px + env(safe-area-inset-bottom)); }
    .content-header h1 { font-size: 24px; margin-bottom: 18px; }
    .profile-card { padding: 24px 16px; gap: 16px; }
    .profile-stats { gap: 28px; }
    .connected-accounts { padding: 18px 14px; }
    .account-item { padding: 12px; gap: 12px; }
    .account-item .connect-btn { width: 100%; }
    .finance-balance-card { padding: 28px 16px; }
    .topup-amount-input .form-input { max-width: none; }
    .form-input { font-size: 16px; }
    .notification-item { padding: 14px; }
    .notification-icon { width: 40px; height: 40px; font-size: 22px; }
    .settings-group { margin-bottom: 24px; }
}

/* flex-элемент не должен растягиваться под содержимое (длинные ленты вкладок) */
.main-content { min-width: 0; }

[hidden] { display: none !important; }

/* =====================================================================
   Настройки (profile-security.js)
   ===================================================================== */
.ps-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.ps-card {
    display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: 18px;
    background: rgba(255, 255, 255, .03); border: 1px solid rgba(184, 79, 214, .2);
}
.ps-wide { grid-column: 1 / -1; }
.ps-card h3 { margin: 0; font-size: 17px; }
.ps-field { display: flex; flex-direction: column; gap: 6px; }
.ps-field > span { font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .6); }
.ps-field .form-input { width: 100%; max-width: none; }
.ps-hint { margin: 0; font-size: 13px; color: rgba(255, 255, 255, .5); line-height: 1.5; }
.ps-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ps-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, .06); }
.ps-row:first-of-type { border-top: 0; padding-top: 0; }
.ps-row b { font-size: 14px; }
.ps-link { background: none; border: 0; padding: 0; color: #d59bf0; cursor: pointer; font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.ps-danger { border-color: #ff5f56 !important; color: #ff8a84 !important; }
.ps-danger-fill { background: linear-gradient(135deg, #ef4444, #b91c1c) !important; }
.connect-btn:disabled { opacity: .55; cursor: wait; }
.tfa-on { color: #4ade80; font-weight: 700; }
.tfa-off { color: rgba(255, 255, 255, .55); font-weight: 600; }
.tfa-setup { display: grid; grid-template-columns: 1fr auto; gap: 14px 22px; align-items: start; }
.tfa-steps { margin: 0; padding-left: 18px; color: rgba(255, 255, 255, .75); font-size: 14px; line-height: 1.7; }
.tfa-qr { grid-row: span 3; background: #fff; padding: 10px; border-radius: 14px; }
.tfa-qr img { display: block; width: 168px; height: 168px; }
.tfa-secret { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tfa-secret code { padding: 8px 10px; border-radius: 8px; background: rgba(0, 0, 0, .3); font-size: 13px; letter-spacing: 1px; word-break: break-all; }
.tfa-code { max-width: 200px !important; text-align: center; font-size: 22px !important; letter-spacing: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.tfa-disable { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.p-toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 9999; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
    max-width: min(92vw, 460px); padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; line-height: 1.45;
    background: #2b1e45; border: 1px solid #4a3470; color: #fff; box-shadow: 0 16px 40px rgba(0, 0, 0, .45); transition: .2s;
}
.p-toast.show { opacity: 1; transform: translate(-50%, 0); }
.p-toast.bad { background: #3a1620; border-color: #7f1d1d; }

/* =====================================================================
   Поддержка (profile-support.js)
   ===================================================================== */
.nav-link { position: relative; }
.sp-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 11px; font-style: normal; font-weight: 700; display: inline-grid; place-items: center; }
.sp { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; min-height: 520px; }
.sp-list, .sp-view { background: rgba(255, 255, 255, .03); border: 1px solid rgba(184, 79, 214, .2); border-radius: 18px; }
.sp-list { padding: 12px; display: flex; flex-direction: column; gap: 6px; max-height: calc(100dvh - 180px); overflow-y: auto; }
.sp-list-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 8px; }
.sp-list-head .connect-btn { padding: 8px 14px; font-size: 13px; }
.sp-tg { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; cursor: pointer;
    border: 1px solid rgba(56, 189, 248, .25); background: rgba(56, 189, 248, .07); color: inherit; font: inherit; text-align: left; }
.sp-tg:hover { background: rgba(56, 189, 248, .13); }
.sp-tg > span:first-child { font-size: 20px; }
.sp-tg b { display: block; font-size: 14px; }
.sp-tg small { display: block; font-size: 12px; opacity: .65; }
.sp-item { display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; padding: 12px; border-radius: 12px; border: 1px solid transparent; background: none; color: inherit; cursor: pointer; font: inherit; }
.sp-item:hover { background: rgba(255, 255, 255, .04); }
.sp-item.on { background: rgba(184, 79, 214, .14); border-color: rgba(184, 79, 214, .4); }
.sp-item-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.sp-item-top b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-item-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: rgba(255, 255, 255, .5); flex-wrap: wrap; }
.sp-dot { width: 9px; height: 9px; border-radius: 50%; background: #ef4444; flex: none; }
.sp-st { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.sp-st.st-open { background: rgba(251, 191, 36, .14); color: #fbbf24; }
.sp-st.st-ans { background: rgba(74, 222, 128, .14); color: #4ade80; }
.sp-st.st-closed { background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .55); }
.sp-empty { padding: 10px 6px; }
.sp-view { display: flex; flex-direction: column; min-height: 0; max-height: calc(100dvh - 180px); }
.sp-view > .ps-hint { padding: 20px; }
.sp-view-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.sp-view-head h3 { margin: 0; font-size: 16px; }
.sp-title { flex: 1; min-width: 0; }
.sp-title h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-back { display: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .15); background: none; color: #fff; cursor: pointer; font-size: 16px; flex: none; }
.sp-feed { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; min-height: 240px; }
.sp-msg { max-width: min(78%, 560px); padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; word-break: break-word; }
.sp-msg.me { align-self: flex-end; background: linear-gradient(135deg, #b84fd6, #8b2fd1); border-bottom-right-radius: 5px; }
.sp-msg.them { align-self: flex-start; background: rgba(255, 255, 255, .07); border-bottom-left-radius: 5px; }
.sp-msg time { display: block; margin-top: 4px; font-size: 11px; opacity: .55; text-align: right; }
.sp-msg img { max-width: 100%; max-height: 260px; border-radius: 10px; margin-top: 4px; display: block; }
.sp-author { font-size: 12px; font-weight: 700; color: #d59bf0; margin-bottom: 3px; }
.sp-sys { align-self: center; font-size: 12px; color: rgba(255, 255, 255, .5); padding: 4px 12px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 999px; }
.sp-reply { display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid rgba(255, 255, 255, .06); }
.sp-reply textarea { flex: 1; min-height: 44px; max-height: 140px; resize: vertical; max-width: none; }
.sp-attach { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; cursor: pointer; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); font-size: 18px; }
.sp-foot { padding: 0 16px 14px; }
.sp-closed { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .6); font-size: 14px; }
.sp-new { display: flex; flex-direction: column; gap: 14px; padding: 0 18px 18px; }
.sp-new .sp-view-head { margin: 0 -18px; }
.sp-textarea { min-height: 120px; resize: vertical; }
@media (max-width: 900px) {
    .ps-grid { grid-template-columns: 1fr; }
    .tfa-setup { grid-template-columns: 1fr; }
    .tfa-qr { grid-row: auto; justify-self: center; }
}
@media (max-width: 768px) {
    .sp { grid-template-columns: 1fr; min-height: 0; }
    .sp .sp-view { display: none; }
    .sp.sp-open .sp-list { display: none; }
    .sp.sp-open .sp-view { display: flex; max-height: none; min-height: calc(100dvh - 200px); }
    .sp-back { display: grid; place-items: center; }
    .sp-msg { max-width: 88%; }
    .ps-row { flex-direction: column; align-items: stretch; }
    .ps-row .connect-btn { width: 100%; }
    .ps-field .form-input, .sp-reply textarea { font-size: 16px; }
}
.sp > *, .sp-item, .sp-item-top b, .sp-title { min-width: 0; }
.sp-item-top b { flex: 1; }
.sp-textarea, .sp-reply textarea, .ps-field textarea { font-family: inherit; }

/* ===== финансы: промокод, пополнение, история по страницам ===== */
.fin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.fin-card { background: rgba(255,255,255,.03); border: 1px solid rgba(184,79,214,.18); border-radius: 18px; padding: 22px; min-width: 0; }
.fin-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 14px; color: #fff; }
.fin-promo { display: flex; gap: 10px; margin-bottom: 10px; }
.fin-promo .form-input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .5px; }
.fin-disc-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.fin-disc { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px;
    background: rgba(74,222,128,.08); border: 1px solid rgba(74,222,128,.25); color: inherit; text-decoration: none; }
.fin-disc b { color: #4ade80; font-size: 16px; }
.fin-disc span { font-size: 12px; color: rgba(255,255,255,.65); }
.fin-disc i { font-style: normal; font-size: 12px; color: #4ade80; white-space: nowrap; }
.fin-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.fin-presets button { padding: 8px 6px; white-space: nowrap; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); color: #fff; cursor: pointer; font: inherit; font-weight: 600; }
.fin-presets button:hover { border-color: #b84fd6; }
.fin-amount { width: 100%; margin-bottom: 12px; }
.fin-methods { grid-template-columns: 1fr 1fr; gap: 10px; }
.fin-methods .topup-method { padding: 14px; gap: 12px; text-align: left; color: inherit; font: inherit; width: 100%; }
.fin-methods .topup-method:disabled { opacity: .5; pointer-events: none; }
.fin-methods .topup-icon { width: 42px; height: 42px; font-size: 22px; border-radius: 12px; }
.topup-icon.xrocket { background: rgba(56, 189, 248, .15); }
.fin-methods .topup-info { display: flex; flex-direction: column; min-width: 0; }
.fin-methods .topup-name { font-size: 15px; margin-bottom: 2px; }
.fin-methods .topup-desc { font-size: 12px; }
.fin-pending { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-top: 12px; padding: 10px 12px;
    border-radius: 12px; background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.3); font-size: 13px; }
.fin-pending-act { display: flex; gap: 8px; }
.fin-pending-act .connect-btn { padding: 7px 12px; font-size: 13px; text-decoration: none; }
.fin-consent { margin-top: 10px; font-size: 12px; }
.fin-consent a { color: #d59bf0; }
.finance-history.fin-card { margin-top: 0; }
.fin-hist-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.fin-hist-head h3 { margin: 0; }
.fin-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.05); }
.fin-tabs button { border: 0; background: none; color: rgba(255,255,255,.6); padding: 6px 12px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; }
.fin-tabs button[aria-selected="true"] { background: rgba(184,79,214,.3); color: #fff; }
.fin-list { display: flex; flex-direction: column; }
.fin-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 4px; border-top: 1px solid rgba(255,255,255,.06); }
.fin-row:first-child { border-top: 0; }
.fin-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.05); font-size: 17px; }
.fin-main { min-width: 0; display: flex; flex-direction: column; }
.fin-main b { font-size: 14px; color: #fff; }
.fin-main small, .fin-side small { font-size: 12px; color: rgba(255,255,255,.45); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-side { display: flex; flex-direction: column; align-items: flex-end; }
.fin-side b { font-size: 15px; white-space: nowrap; }
.fin-side b.pos { color: #4ade80; } .fin-side b.neg { color: #f87171; }
.fin-pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; color: rgba(255,255,255,.55); }
.fin-pager .connect-btn { padding: 8px 14px; font-size: 13px; }
.fin-pager .connect-btn:disabled { opacity: .35; pointer-events: none; }
@media (max-width: 900px) { .fin-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) {
    .fin-methods { grid-template-columns: 1fr; }
    .fin-pager span { font-size: 12px; text-align: center; }
    .fin-card { padding: 16px; }
}

.ps-ava { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.ps-ava-img { width: 76px; height: 76px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 30px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, #b84fd6, #8b2fd1) center / cover no-repeat; box-shadow: 0 8px 24px rgba(184,79,214,.3); }
.ps-ava-act { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.ps-ava-up { cursor: pointer; display: inline-flex; }
.ps-ava-act .ps-hint { font-size: 12px; margin: 0; }
