/* Используем общие стили из common.css и beat_list.css */

/* Специальные стили для модального окна редактирования бита */
#editBeatModal {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1001;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.55);
    overflow-y: auto;
    overflow-x: hidden;
}

#editBeatModal.show {
    display: flex;
}

.edit-beat-modal {
    background: var(--card);
    width: min(960px, 96vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px var(--shadow-color);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    margin: 20px auto;
    transition: background-color 0.25s ease;
}

.edit-beat-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 26px 28px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--card);
    z-index: 2;
    flex-shrink: 0;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.edit-beat-modal .modal-title {
    margin: 0;
    font-size: 1.32rem;
    font-weight: 600;
    color: var(--text);
    transition: color 0.25s ease;
}

.edit-beat-modal .close-modal-btn {
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.edit-beat-modal .close-modal-btn:hover {
    background-color: var(--button-hover-bg);
    color: var(--text);
}

.edit-beat-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.edit-beat-form.is-loading {
    opacity: 0.65;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.edit-beat-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 28px;
    padding: 24px 28px 16px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
}

.edit-beat-preview {
    position: sticky;
    top: 24px;
    align-self: flex-start;
}

.edit-beat-preview .preview-card {
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: border-color 0.25s ease;
}

.edit-beat-preview .preview-cover {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: background-color 0.25s ease;
}

.edit-beat-preview .preview-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.edit-beat-preview .preview-info {
    padding: 0;
}

.edit-beat-preview .preview-title {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    transition: color 0.25s ease;
}

.edit-beat-preview .preview-author {
    margin: 0;
    font-size: 0.92rem;
    color: var(--text-muted);
    transition: color 0.25s ease;
}

.edit-beat-preview .preview-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.edit-beat-preview .preview-price {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    background: var(--text);
    color: var(--bg);
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.edit-beat-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
    align-content: start;
}

.edit-beat-fields .form-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edit-beat-fields .form-row.full {
    grid-column: 1 / -1;
}

.edit-beat-fields label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    text-transform: none;
    transition: color 0.25s ease;
}

.edit-beat-fields input[type="text"],
.edit-beat-fields input[type="number"],
.edit-beat-fields input[type="url"],
.edit-beat-fields textarea {
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 0.95rem;
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.25s ease, color 0.25s ease;
}

.edit-beat-fields input[type="text"]:focus,
.edit-beat-fields input[type="number"]:focus,
.edit-beat-fields input[type="url"]:focus,
.edit-beat-fields textarea:focus {
    border-color: var(--text);
    outline: none;
    box-shadow: 0 0 0 2px var(--shadow-color);
}

.edit-beat-fields textarea {
    resize: vertical;
    min-height: 120px;
}

.input-with-prefix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-prefix .input-prefix {
    position: absolute;
    left: 14px;
    font-weight: 600;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.25s ease;
}

.input-with-prefix input {
    padding-left: 32px;
}

.edit-form-errors {
    grid-column: 1 / -1;
    background: rgba(211, 47, 47, 0.1);
    color: #ff4444;
    border: 1px solid rgba(211, 47, 47, 0.3);
    padding: 12px 16px;
    font-size: 0.9rem;
    display: none;
    border-radius: 8px;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.edit-form-errors.show {
    display: block;
}

.edit-form-success {
    grid-column: 1 / -1;
    background: rgba(4, 120, 87, 0.1);
    color: #10b981;
    border: 1px solid rgba(4, 120, 87, 0.3);
    padding: 12px 16px;
    font-size: 0.9rem;
    display: none;
    border-radius: 8px;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.edit-form-success.show {
    display: block;
}

.edit-beat-fields .custom-dropdown {
    position: relative;
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 8px;
    min-height: 46px;
    display: flex;
    align-items: center;
    padding: 0 44px 0 14px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.25s ease;
}

.edit-beat-fields .custom-dropdown:focus-within {
    border-color: var(--text);
    box-shadow: 0 0 0 2px var(--shadow-color);
}

.edit-beat-fields .custom-dropdown .dropdown-input {
    width: 100%;
    font-size: 0.95rem;
    color: var(--text);
    outline: none;
    border: none;
    background: transparent;
    transition: color 0.25s ease;
}

.edit-beat-fields .custom-dropdown .dropdown-input.empty {
    color: var(--text-muted);
}

.edit-beat-fields .custom-dropdown .dropdown-arrow {
    position: absolute;
    right: 16px;
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s ease, color 0.25s ease;
}

.edit-beat-fields .custom-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.edit-beat-fields .custom-dropdown .dropdown-panel {
    position: absolute;
    left: -1px;
    right: -1px;
    top: calc(100% + 6px);
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: 0 12px 32px var(--shadow-color);
    z-index: 10;
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.edit-beat-fields .custom-dropdown.open .dropdown-panel {
    display: flex;
}

.edit-beat-fields .custom-dropdown .dropdown-search {
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    padding: 8px 10px;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: border-color 0.2s ease, background-color 0.25s ease, color 0.25s ease;
}

.edit-beat-fields .custom-dropdown .dropdown-search:focus {
    outline: none;
    border-color: var(--text);
}

.edit-beat-fields .custom-dropdown .dropdown-options {
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.edit-beat-fields .custom-dropdown .dropdown-option {
    padding: 8px 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text);
    transition: background-color 0.2s ease, color 0.25s ease;
}

.edit-beat-fields .custom-dropdown .dropdown-option:hover,
.edit-beat-fields .custom-dropdown .dropdown-option.active {
    background: var(--button-hover-bg);
}

.edit-beat-fields .file-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.edit-beat-fields .file-field input[type="file"] {
    border: 1px dashed var(--border);
    padding: 12px;
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 0.9rem;
    border-radius: 8px;
    transition: border-color 0.2s ease, background-color 0.25s ease, color 0.25s ease;
}

.edit-beat-fields .file-field input[type="file"]:focus {
    outline: none;
    border-color: var(--text);
}

.edit-beat-fields .file-field .file-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.edit-beat-fields .file-field .file-status {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: color 0.25s ease;
}

.edit-beat-fields .file-field .file-status--positive {
    color: var(--text);
    font-weight: 600;
}

.edit-beat-fields .file-remove-btn {
    border: none;
    background: none;
    font-size: 0.85rem;
    color: #b3261e;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    padding: 2px 0;
    align-self: flex-start;
}

.edit-beat-fields .file-remove-btn[disabled] {
    color: var(--text-muted);
    cursor: default;
    text-decoration: none;
    opacity: 0.5;
}

.edit-beat-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px 24px;
    border-top: 1px solid var(--border);
    background: var(--card);
    gap: 16px;
    flex-shrink: 0;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.edit-beat-actions .actions-right {
    display: flex;
    gap: 12px;
}

.ghost-button {
    background: var(--button-secondary-bg);
    color: var(--button-secondary-text);
    border: none;
    padding: 10px 18px;
    font-size: 0.92rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.25s ease;
}

.ghost-button:hover {
    background: var(--button-hover-bg);
}

.ghost-button.delete-beat-modal-btn {
    color: #b3261e;
    background: #fef2f2;
}

.ghost-button.delete-beat-modal-btn:hover {
    background: #fde4e4;
}

.primary-button.save-edit {
    background: var(--button-primary-bg);
    color: var(--button-primary-text);
    border: none;
    padding: 10px 20px;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.25s ease;
}

.primary-button.save-edit:hover {
    opacity: 0.9;
}

.primary-button.save-edit.loading {
    pointer-events: none;
    opacity: 0.8;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.primary-button.save-edit.loading .btn-label {
    color: #ffffff;
}

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite;
}

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

.cancel-edit {
    background: none;
}

@media (max-width: 1024px) {
    .edit-beat-layout {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }

    .edit-beat-preview {
        position: static;
        max-width: 320px;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .edit-beat-modal {
        width: calc(100vw - 16px);
    }

    .edit-beat-layout {
        padding: 20px;
    }

    .edit-beat-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .edit-beat-actions .actions-right {
        justify-content: space-between;
    }

    .ghost-button,
    .primary-button.save-edit {
        width: 100%;
        text-align: center;
    }
}

/* Предотвращение прокрутки страницы под модальным окном */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.profile-container {
    max-width: 1082px;
    margin: 0 auto;
    padding: 0 20px;
}

.profile-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.profile-left, .content-area {
    width: 100%;
}

.profile-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.profile-card {
    background: var(--card);
    border-radius: 8px;
    padding: 0;
    box-sizing: border-box;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: background-color 0.25s ease;
}

.profile-header {
    padding: 0px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
}

.profile-avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 8px;
    border-radius: 50%;
    overflow: visible;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 2;
    display: block;
}

/* Эффект свечения за аватаркой битмейкера в темной теме */
html.dark .profile-avatar-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background-image: var(--avatar-glow-url);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(30px) brightness(1.2);
    opacity: 0.6;
    z-index: 1;
    pointer-events: none;
}

.profile-name {
    font-size: 1.2rem;
    font-weight: 600;
}

.profile-stats {
    display: flex;
    gap: 32px;
    justify-content: center;
    margin-top: 12px;
    text-align: center;
    flex-wrap: nowrap;
    flex-direction: row;
}

.profile-stats > * {
    text-decoration: none;
    color: inherit;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background-color .2s;
}

.profile-stats > a:hover {
    background-color: var(--button-hover-bg);
}

.profile-stats div, .profile-stats a {
    font-size: 0.9rem;
}

.profile-stats span {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
}

.profile-socials {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.social-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text);
    text-decoration: none;
    position: relative;
}

.social-btn:hover {
    background-color: var(--button-hover-bg);
    border-color: var(--border-hover);
    color: var(--text-secondary);
}

.social-btn:focus {
    outline: 2px solid var(--text-secondary);
    outline-offset: 2px;
}

.social-btn:focus:not(:focus-visible) {
    outline: none;
}

.social-btn i {
    font-size: 20px;
    line-height: 1;
    display: block;
    transition: color 0.2s ease;
}

.profile-description {
    text-align: center;
    padding: 0;
    color: var(--text-muted);
    line-height: 1.6;
    transition: color 0.25s ease;
}

.report-btn {
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 10px 16px;
    font-size: 0.95em;
    color: var(--text-muted);
    transition: all 0.25s ease;
}

.report-btn:hover {
    background: var(--button-hover-bg);
    color: var(--text);
}

.report-btn .material-symbols-outlined {
    font-size: 18px;
    color: inherit;
}

.report-btn-bottom {
    position: static;
    width: auto;
    height: auto;
    z-index: auto;
}

.edit-profile-btn, .follow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 200px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    color: var(--text);
    background: var(--card);
    transition: all 0.2s ease;
    font-weight: 500;
    cursor: pointer;
    gap: 8px;
}

.edit-profile-btn:hover, .follow-btn:hover {
    background: var(--button-hover-bg);
}

.follow-btn.following {
    background-color: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

/* Balance action buttons */
.balance-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 20px;
}

.balance-btn {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text);
}

.balance-btn:hover {
    background: var(--button-hover-bg);
    border-color: var(--border-hover);
}

.balance-btn .material-symbols-outlined {
    font-size: 24px;
    color: var(--text);
}

.balance-btn.topup-btn {
    border-color: var(--text);
    color: var(--text);
}

.balance-btn.topup-btn:hover {
    background: var(--text);
    color: var(--bg);
}

.balance-btn.withdraw-btn {
    border-color: var(--text);
    color: var(--text);
}

.balance-btn.withdraw-btn:hover {
    background: var(--text);
    color: var(--bg);
}

.content-area {
    background: var(--card);
    border-radius: 8px;
    box-shadow: none;
    transition: background-color 0.25s ease;
}

/* Основное определение для десктопа */
.beats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto 64px auto;
}

/* Для больших планшетов и ноутбуков */
@media (max-width: 1200px) {
    .beats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* Для планшетов */
@media (max-width: 900px) {
    .beats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* Для мобильных */
@media (max-width: 600px) {
    .beats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-top: 4px;
        padding: 0 4px;
    }
    .beat-card {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        padding: 10px;
    }
    .beat-info {
        padding: 6px 0 0 0;
        min-height: auto;
        max-height: none;
    }
    .beat-text {
        margin-bottom: 8px;
        padding: 6px 0 8px 0;
    }
    .beat-title {
        font-size: 0.85em;
        min-height: 2.4em;
        max-height: 2.4em;
    }
    .beat-user {
        font-size: 0.75em;
        min-height: 24px;
        max-height: 24px;
    }
    .price-btn {
        height: 32px;
        min-width: 0;
        max-width: none;
        flex: 1;
        font-size: 0.85em;
        padding: 0 6px;
    }
    .favorite-btn,
    .favorite-btn.add-to-cart-async {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
        flex-shrink: 0 !important;
    }
    .favorite-btn .material-symbols-outlined {
        font-size: 1.1em;
    }
    .beat-footer {
        gap: 4px;
    }
}

.beat-card {
    background: var(--card) !important;
   
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s, background-color 0.25s ease;
    font-family: 'IBM Plex Mono', monospace;
    opacity: 0;
    transform: translateY(30px);
    animation: beat-fade-in 0.7s cubic-bezier(.4,0,.2,1) forwards;
    margin: 0 !important;
    padding: 18px;
    box-sizing: border-box;
}
.beat-card.visible {
    opacity: 1;
    transform: translateY(0);
}
/* На странице профиля отключаем анимацию, чтобы не мешать скроллу */
.profile-container .beat-card {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}
@keyframes beat-fade-in {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.beat-card:hover {
    border-color: var(--border-hover);
}
.beat-cover {
    position: relative;
    border-radius: 8px;
    overflow: visible;
}

.beat-cover img {
    position: relative;
    z-index: 1;
}
.beat-cover .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: none;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.3s ease;
    z-index: 2;
}
.play-button .material-symbols-outlined {
    font-size: 36px;
}
.beat-card img {
    width: 100%;
    aspect-ratio: 1/1;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    background: var(--bg-secondary);
    display: block;
    border: 1px solid var(--border);
    transition: border-color 0.25s ease;
}
@media (max-width: 700px) {
    .beat-card img {
        aspect-ratio: 1/1;
        width: 100%;
        height: auto;
        border-radius: 8px;
    }
}
.beat-info {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.beat-text {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    margin-bottom: 12px;
    padding: 10px 0 12px 0;
}
.beat-title {
    font-size: 1em;
    font-weight: 500;
    margin: 0 0 4px 0;
    white-space: pre-line;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: var(--text);
    text-decoration: none;
    min-height: 2.6em;
    max-height: 2.6em;
    transition: color 0.25s ease;
}
.beat-user {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.93em;
    margin: 0;
    min-height: 28px;
    max-height: 28px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.25s ease;
}
.beat-info {
    min-height: auto;
    max-height: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.beat-title-link {
    flex-shrink: 0;
}
.beat-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}
.price-btn {
    flex-grow: 1;
    flex-shrink: 1;
    padding: 10px 12px;
    border: 1px solid var(--border) !important;
    border-radius: 5%;
    background-color: var(--card) !important;
    text-align: center;
    text-decoration: none;
    color: var(--text) !important;
    font-weight: 500;
    font-size: 1.1em;
    transition: background-color 0.2s, border-color 0.25s ease, color 0.25s ease;
    height: 42px;
    min-width: 42px;
    max-width: calc(100% - 50px);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.price-btn:hover {
    background-color: var(--button-hover-bg) !important;
}
.favorite-btn {
    background: var(--card) !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px;
    width: 42px;
    height: 42px;
    min-width: 42px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s, border-color 0.25s ease;
    text-decoration: none;
    color: var(--text) !important;
    box-sizing: border-box;
}
.favorite-btn:hover {
    background-color: var(--button-hover-bg) !important;
}
.favorite-btn .material-symbols-outlined {
    font-size: 1.4em;
}
.favorite-btn.favorited {
    color: #e54b4b; /* Keep red color for favorited state */
}
.favorite-btn.add-to-cart-async {
    border: 1px solid var(--border) !important;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    max-width: 42px;
    max-height: 42px;
    border-radius: 5%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0;
    transition: border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease;
    background: var(--card) !important;
    color: var(--text) !important;
    flex-shrink: 0;
}
.delete-beat-btn {
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s, border 0.15s, color 0.25s ease;
    z-index: 3;
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0;
}
.delete-beat-btn:hover {
    background: var(--button-hover-bg);
    border: 1.5px solid var(--border-hover);
}

.sold-info {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    cursor: pointer;
    padding: 8px 14px !important;
    background: var(--card) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    font-size: 1em;
    transition: background 0.15s, border 0.15s;
    white-space: nowrap;
    overflow: hidden;
    color: var(--text);
}
.sold-info:hover {
    background: var(--button-hover-bg) !important;
    border-color: var(--border-hover) !important;
}
.buyer-info {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

.sold-badge {
    background-color: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reviews-container { 
    scrollbar-width: thin; 
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent; 
}
.reviews-container::-webkit-scrollbar { width: 6px; }
.reviews-container::-webkit-scrollbar-track { background: transparent; }
.reviews-container::-webkit-scrollbar-thumb { 
    background-color: rgba(0, 0, 0, 0.2); 
    border-radius: 8px; 
}
.review-item { transition: background-color 0.2s ease; }
.review-item:hover { background-color: rgba(0, 0, 0, 0.01); }
.rating { font-size: 0.9rem; }
.review-text { color: var(--text-muted); line-height: 1.5; }

.reviews-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.reviews-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.overall-rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rating-stars {
    color: #f5b301;
    font-size: 1rem;
    display: flex;
    gap: 2px;
}

.rating-count {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.review-button {
    display: inline-block;
    padding: 8px 20px;
    background-color: var(--text);
    color: var(--bg);
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.review-button:hover {
    background-color: var(--text-secondary);
    color: var(--bg);
}

.reviews-list {
    display: flex;
    flex-direction: row;
    gap: 12px;
    overflow-x: auto;
    max-width: 100%;
    padding: 16px 12px 16px 16px;
    box-sizing: border-box;
}

.reviewer-info {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 10px 12px 10px 10px;
    margin-bottom: 8px;
}

.reviewer-info img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
}

.reviewer-info > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reviewer-details h6 {
    margin: 0 0 1px 0;
    font-size: 0.92em;
    font-weight: 500;
    color: var(--text);
    transition: color 0.25s ease;
}

.reviewer-details small {
    color: var(--text-muted);
    font-size: 0.75em;
    margin: 0;
    padding: 0;
    transition: color 0.25s ease;
}

.review-rating {
    margin-top: 2px;
    font-size: 0.92em;
    color: #f5b301;
}

.review-text {
    margin: 6px 0 0 0;
    font-size: 0.97em;
    color: var(--text);
    line-height: 1.4;
    transition: color 0.25s ease;
}

.no-reviews {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    transition: color 0.25s ease;
}

.no-reviews i {
    font-size: 2.5rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.no-reviews p {
    margin: 0;
    font-size: 0.95rem;
}

.pagination {
    padding: 20px 0;
    display: flex;
    justify-content: center;
}

.pagination-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pagination-item {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease, color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.pagination-item:hover {
    background-color: var(--button-hover-bg);
    color: var(--text);
}

.pagination-item.active {
    background-color: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

/* Стилизация скроллбара */
.reviews-list::-webkit-scrollbar {
    width: 6px;
}

.reviews-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.reviews-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 8px;
}

.reviews-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.reviews-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px; border-bottom: 1px solid var(--border); transition: border-color 0.25s ease; }
.reviews-title { flex-direction: column; align-items: flex-start; gap: 8px; }
.reviews-main-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0; }
.review-plus-btn { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: none; border: none; padding: 0; margin-left: 8px; transition: background 0.15s; }
.review-plus-btn:hover { background: var(--button-hover-bg); }
.review-plus-btn svg { display: block; }

/* Reviews styles */
.reviews-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.review-plus-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.15s;
}

.review-plus-btn:hover {
    background: var(--button-hover-bg);
}

.overall-rating {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rating-stars {
    color: #f5b301;
    display: flex;
    gap: 2px;
}

.rating-count {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.25s ease;
}

.reviews-list {
    max-height: 600px;
    overflow-y: auto;
}

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

.review-header {
    margin-bottom: 12px;
}

.reviewer-info {
    display: flex;
    gap: 16px;
}

.reviewer-info img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.reviewer-details h6 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    transition: color 0.25s ease;
}

.reviewer-details small {
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: color 0.25s ease;
}

.review-rating {
    margin-top: 8px;
    display: flex;
    align-items: center;
}

.review-text {
    color: var(--text);
    line-height: 1.5;
    font-size: 0.95rem;
    margin: 0;
    transition: color 0.25s ease;
}

.no-reviews {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    transition: color 0.25s ease;
}

.pagination {
    padding: 20px;
    display: flex;
    justify-content: center;
    border-top: 1px solid var(--border);
    transition: border-color 0.25s ease;
}

.pagination-container {
    display: flex;
    gap: 8px;
}

.pagination-item {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease, color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.pagination-item:hover {
    background: var(--button-hover-bg);
    color: var(--text);
}

.pagination-item.active {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

/* Модальное окно для отзыва */
.review-modal-center { position: fixed; z-index: 1000; left: 0; top: 0; width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.12); }
.review-modal-window { background: var(--card); border-radius: 16px; max-width: 480px; width: 100%; padding: 32px; box-shadow: 0 4px 24px var(--shadow-color); transition: background-color 0.25s ease; }
.review-modal-header { margin-bottom: 32px; }
.reviewer-profile { display: flex; align-items: center; gap: 16px; }
.reviewer-profile img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.reviewer-info h2 { font-size: 1.25rem; font-weight: 600; margin: 0 0 4px 0; color: var(--text); transition: color 0.25s ease; }
.reviewer-info p { font-size: 0.95rem; color: var(--text-muted); margin: 0; transition: color 0.25s ease; }
.rating-section { margin-bottom: 24px; }
.rating-label { display: block; font-weight: 500; margin-bottom: 12px; color: var(--text); transition: color 0.25s ease; }
.rating-stars { display: flex; flex-direction: row-reverse; justify-content: center; gap: 8px; }
.rating-stars input[type="radio"] { display: none; }
.star-label { font-size: 2.5rem; color: var(--border); cursor: pointer; transition: color 0.2s ease; }
.rating-stars input[type="radio"]:checked ~ label,
.rating-stars label:hover,
.rating-stars label:hover ~ label { color: #f5b301; }
.review-text-section { margin-bottom: 24px; }
.text-label { display: block; font-weight: 500; margin-bottom: 8px; color: var(--text); transition: color 0.25s ease; }
.form-control { width: 100%; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: 12px; font-size: 1rem; min-height: 120px; resize: vertical; transition: all 0.2s ease, background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease; background: var(--card); color: var(--text); }
.form-control:focus { border-color: var(--text); outline: none; box-shadow: 0 0 0 4px var(--shadow-color); }
.review-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 32px; }
.submit-button { background: var(--text); color: var(--bg); border: none; border-radius: 12px; padding: 14px 24px; font-size: 1rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease; width: 100%; }
.submit-button:hover { opacity: 0.9; }
.cancel-button { color: var(--text-muted); text-align: center; text-decoration: none; font-size: 0.95rem; padding: 8px; background: none; border: none; cursor: pointer; transition: color 0.25s ease; }
.cancel-button:hover { color: var(--text); }
.error-message { color: #dc3545; font-size: 0.875rem; margin-top: 8px; }

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.stat-card.balance-card {
    grid-column: span 2;
    padding: 24px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.stat-card.history-card,
.charts-container {
    grid-column: span 4;
}
.stat-card.plays-card, 
.stat-card.followers-card {
    /* Remove specific column span to allow for even distribution */
}
.stat-card {
    background: var(--card) !important;
    border: 1.5px solid var(--border) !important;
    border-radius: 12px;
    text-align: left;
    grid-column: span 1;
    box-shadow: none;
    min-height: 120px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    color: var(--text) !important;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.stat-card h3,
.stat-card h4,
.stat-card p,
.stat-card span,
.stat-card div {
    color: var(--text) !important;
    transition: color 0.25s ease;
}

/* Override inline styles for stat-card borders */
.stat-card[style*="border: 1px solid #e0e0e0"],
.stat-card[style*="border:1px solid #e0e0e0"] {
    border: 1.5px solid var(--border) !important;
}

/* Statistics title and chart filters */
.charts-container h3[style*="margin-bottom"],
.charts-container h3 {
    color: var(--text) !important;
    transition: color 0.25s ease;
}

.charts-container[style*="border: 1px solid #e0e0e0"],
.charts-container[style*="border:1px solid #e0e0e0"] {
    border: 0.5px solid var(--border) !important;
}

.chart-filters {
    color: var(--text);
}

.chart-filter-btn {
    color: var(--text) !important;
}

.stat-card .balance-amount {
    color: var(--text) !important;
}

.stat-card .cardholder-name {
    color: var(--text-muted) !important;
}

/* Buyer action cards */
.buyer-dashboard .action-card {
    text-decoration: none;
    gap: 12px;
    align-items: center;
    flex-direction: row;
    justify-content: flex-start;
}

.buyer-dashboard .action-card:hover,
.buyer-dashboard .action-card:focus {
    text-decoration: none;
}

.buyer-dashboard .action-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 20px;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.buyer-dashboard .action-card-icon i {
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.buyer-dashboard .action-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    text-align: left;
}
.buyer-dashboard .balance-card {
    grid-column: span 2;
}

/* Profile edit card */
.profile-edit-card {
    text-decoration: none;
    margin-top: 16px;
    gap: 12px;
    align-items: center;
    flex-direction: row;
    cursor: pointer;
}

.profile-edit-card:hover,
.profile-edit-card:focus {
    text-decoration: none;
}

.profile-edit-card .action-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 22px;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.profile-edit-card .action-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

/* Charts */
.charts-container { 
    margin-top: 20px; 
    background: transparent;
    border: 0.5px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    /* Hide scrollbar */
    overflow: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    transition: border-color 0.25s ease;
}

.charts-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}
.charts-container h3 {
    margin: 0 0 20px 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    transition: color 0.25s ease;
}
.chart-filters { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 20px; 
}
.chart-filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}
.chart-filter-btn:hover {
    background: var(--button-hover-bg);
    border-color: var(--border-hover);
}
.chart-filter-btn.active {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--text);
    box-shadow: none;
}
.charts-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 0;
    padding: 2px;
    /* Hide scrollbar */
    overflow: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.charts-grid::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}
.chart-container { 
    background: var(--card); 
    padding: 16px; 
    border-radius: 12px; 
    border: 1px solid var(--border);
    height: 190px !important;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px var(--shadow-color);
    margin: 2px;
}
.profit-chart {
    grid-column: 1 / -1;
}
.chart-container h4 { 
    margin: 0 0 15px 0; 
    text-align: center; 
    font-size: 1rem;
    font-weight: 500;
    flex-shrink: 0;
    color: var(--text);
    transition: color 0.25s ease;
}
.chart-container canvas {
    flex: 1;
    max-height: 140px !important;
    width: 100% !important;
}

/* Follower Modal */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.4); }
.modal-content { background-color: var(--card); margin: 15% auto; padding: 20px; border: 1px solid var(--border); width: 80%; max-width: 400px; border-radius: 12px; transition: background-color 0.25s ease, border-color 0.25s ease; }
.follow-list-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 10px; transition: border-color 0.25s ease; }
.follow-list-title { margin: 0; font-size: 1.2rem; }
.close-modal-btn { color: var(--text-muted); float: right; font-size: 28px; font-weight: bold; border: none; background: none; cursor: pointer; transition: color 0.25s ease; }
.close-modal-btn:hover, .close-modal-btn:focus { color: var(--text); text-decoration: none; }
.follow-list-ul { list-style: none; padding: 0; }
.follow-list-item a { display: flex; align-items: center; gap: 12px; padding: 8px; text-decoration: none; color: var(--text); border-radius: 8px; transition: background-color .2s, color 0.25s ease; }
.follow-list-item a:hover { background-color: var(--button-hover-bg); }
.follow-list-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }

.purchases-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 25px; }
.purchase-card { border: 1px solid var(--border); border-radius: 8px; background: var(--card); overflow: hidden; transition: background-color 0.25s ease, border-color 0.25s ease; }
.purchase-card a { display: block; }
.purchase-card img { width: 100%; height: 240px; object-fit: cover; display: block; }
.purchase-info { padding: 12px; }
.purchase-title { font-weight: 500; font-size: 1em; margin: 0; color: var(--text); transition: color 0.25s ease; }
.purchase-user { font-size: 0.8em; color: var(--text-muted); margin: 4px 0; transition: color 0.25s ease; }
.download-link { display: block; margin-top: 10px; font-weight: 500; }

/* Removed duplicate favorite-btn styles - using styles from beat_list.css above */

.subscription-card {
    background: var(--card);
    border: 2px solid var(--border);
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.subscription-card h3 {
    color: var(--text);
    transition: color 0.25s ease;
}

.subscription-card p {
    margin: 8px 0;
}

@media (max-width: 500px) {
    .player-info {
        display: none;
    }
    .player-controls {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile responsive styles */
@media (max-width: 1200px) {
    .profile-grid {
        grid-template-columns: 280px 1fr;
        gap: 15px;
    }
    
    .beats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (max-width: 900px) {
    .profile-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    .profile-left {
        width: 100%;
        max-width: 100%;
    }
    .profile-card {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        transform: translateY(-2vh) !important;
    }
    
    .content-area {
        order: 2;
        margin-top: 0;
    }
    
    .beats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px 16px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto auto !important;
        gap: 12px !important;
    }
    
    .balance-card {
        grid-column: 1 / -1 !important;
        grid-row: 1 !important;
    }
    
    /* Charts responsive */
    .charts-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    
    .chart-container {
        height: 250px;
        padding: 16px;
    }
    
    .chart-container h4 {
        font-size: 1rem;
        margin-bottom: 12px;
    }
}

@media (max-width: 600px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        position: relative;
    }
    .profile-container,
    .profile-grid,
    .content-area,
    .dashboard-grid,
    .charts-grid,
    .tab-content,
    .beats-grid,
    .kits-grid {
        max-width: 100vw !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    .profile-container {
        margin: 10px auto !important;
        padding: 0 1vw !important;
        max-width: 98vw !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    .profile-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        align-items: center !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .profile-left {
        width: 100% !important;
        max-width: 100% !important;
    }
    .profile-card {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
        transform: translateY(-2vh) !important;
    }
    .dashboard-grid,
    .charts-grid,
    .tab-content {
        width: 100% !important;
        max-width: 420px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        align-items: center !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }
    .stat-card,
    .chart-container {
        width: 100% !important;
        max-width: 420px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        align-items: center !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }
    .profile-header {
        align-items: center !important;
        text-align: center !important;
    }
    .profile-avatar {
        width: 64px;
        height: 64px;
    }
    .profile-name {
        font-size: 1.2rem;
    }
    .profile-stats {
        gap: 18px;
        margin-top: 8px;
        justify-content: center;
    }
    .profile-stats div, .profile-stats a {
        font-size: 0.95rem;
    }
    .profile-stats span {
        font-size: 1.1rem;
    }
    .edit-profile-btn, .follow-btn {
        max-width: 100%;
        padding: 12px 0;
        font-size: 1.1rem;
        border-radius: 8px;
        margin-top: 10px;
    }
    .balance-actions {
        gap: 12px;
        margin-top: 12px;
        justify-content: center;
    }
    .balance-btn {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }
    .balance-btn .material-symbols-outlined {
        font-size: 1.3rem;
    }
    /* Dashboard/stat cards */
    .dashboard-grid:not(.redesigned), .charts-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 18px !important;
        margin-top: 16px;
        align-items: center;
        width: 100%;
        /* max-width убираем */
    }
    
    /* Специальные стили для redesigned dashboard на мобильных */
    .dashboard-grid.redesigned {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto auto !important;
        gap: 12px !important;
    }
    
    .dashboard-grid.redesigned .balance-card {
        grid-column: 1 / -1 !important;
        grid-row: 1 !important;
        margin-bottom: 8px !important;
    }
    
    .dashboard-grid.redesigned .stat-card:not(.balance-card) {
        grid-column: span 1 !important;
    }
    .stat-card {
        width: 100%;
        /* max-width убираем */
        min-width: 0;
        padding: 20px 12px;
        border-radius: 18px;
        min-height: 120px;
        box-shadow: 0 2px 12px var(--shadow-color);
        background: var(--card);
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        text-align: left;
    }
    .stat-card h3 {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    .stat-card p {
        font-size: 2.5rem;
        margin: 0;
        font-weight: 700;
    }
    .chart-container {
        width: 100%;
        /* max-width убираем */
        height: 140px !important;
        padding: 12px;
        min-height: 110px;
        border-radius: 8px;
        box-shadow: none;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .chart-container h4 {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    .chart-container canvas {
        max-height: 90px !important;
    }
    /* Tabs */
    .profile-tabs {
        display: flex;
        gap: 24px;
        border-bottom: 0px solid var(--border);
        margin-bottom: 24px;
        justify-content: center; /* Центрируем табы */
    }
    .tab-link {
        background: none !important;
        border: none !important;
        border-radius: 8px !important;
        color: var(--text) !important;
        font-weight: 400 !important;
        font-size: 1.05rem !important;
        padding: 12px 18px 10px 18px !important;
        margin: 0 !important;
        box-shadow: none !important;
        position: relative;
        transition: color 0.18s;
        outline: none;
    }
    .tab-link.active {
        color: var(--text) !important;
    }
    .tab-link.active::after {
        content: '';
        display: block;
        position: absolute;
        left: 18px;
        right: 18px;
        bottom: 0;
        height: 2.5px;
        background: var(--text);
        border-radius: 2px;
    }
    .tab-link:not(.active):hover {
        color: var(--text-muted) !important;
    }
    .tab-content {
        display: none;
        padding: 24px;
        margin-top: 0;
    }
    .tab-content.active {
        display: block;
        margin-top: 0;
    }
    .dashboard-grid, .charts-grid, .profile-card, .tab-content {
        margin-bottom: 14px;
    }
    .beats-grid,
    .kits-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 20px 12px !important;
        width: 100% !important;
        max-width: 420px !important;
        margin: 0 auto 14px auto !important;
        box-sizing: border-box !important;
    }
    .content-area {
        width: 100% !important;
        max-width: 500px !important;
        margin: 0 auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box !important;
        display: block !important;
    }
    .profile-card {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    .profile-container {
        margin: 16px auto;
        padding: 0 8px;
    }
    
    .profile-left {
        width: 100%;
        max-width: 100%;
    }
    .profile-card {
        margin-top: 20px;
        padding: 0 8px 8px 8px;
        border-radius: 8px;
        width: 100%;
        max-width: 100%;
        transform: translateY(-2vh) !important;
    }
    
    .profile-header {
        padding: 12px;
    }
    
    .profile-avatar {
        width: 50px;
        height: 50px;
    }
    
    .report-btn {
        width: 28px;
        height: 28px;
        top: 15px;
        right: 15px;
    }
    
    .report-btn .material-symbols-outlined {
        font-size: 16px;
    }
    
    .profile-name {
        font-size: 1rem;
    }
    
    .profile-stats {
        gap: 16px;
        margin-top: 6px;
    }
    
    .profile-stats div, .profile-stats a {
        font-size: 0.75rem;
    }
    
    .profile-stats span {
        font-size: 0.9rem;
    }
    
    /* Stat cards для очень маленьких экранов */
    .stat-card {
        padding: 12px;
        min-height: 70px;
    }
    
    .balance-card {
        min-height: 250px;
        padding: 20px;
    }
    
    .balance-card h3 {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }
    
    .balance-card .balance-amount {
        font-size: 3rem;
        margin-bottom: 12px;
    }
    
    .balance-card .cardholder-name {
        font-size: 0.8rem;
        margin-bottom: 16px;
    }
    
    .balance-card .balance-actions {
        gap: 8px;
        margin-top: auto;
    }
    
    .balance-card .balance-btn {
        padding: 10px 16px;
        min-width: 100px;
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    .stat-card h3 {
        font-size: 0.8rem;
        margin-bottom: 6px;
    }
    
    .stat-card p {
        font-size: 2rem;
    }
    
    /* Charts для очень маленьких экранов */
    .charts-grid {
        gap: 8px;
    }
    
    .chart-container {
        height: 160px !important;
        padding: 8px;
        min-height: 140px;
        background: transparent;
        border: none;
        border-radius: 8px;
        box-shadow: none;
    }
    
    .chart-container h4 {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }
    
    .chart-container canvas {
        max-height: 120px !important;
    }
    
    /* Balance actions для очень маленьких экранов */
    .balance-actions {
        gap: 8px;
        margin-top: 12px;
    }
    
    .balance-btn {
        width: 36px;
        height: 36px;
    }
    
    .balance-btn .material-symbols-outlined {
        font-size: 18px;
    }
    
    /* Beat cards для очень маленьких экранов */
    .beat-card img,
    .beat-cover img {
        height: auto !important;
        aspect-ratio: 1 / 1;
        object-fit: cover;
    }
    
    .beat-cover {
        aspect-ratio: 1 / 1;
    }
    
    .beat-info {
        padding: 8px 10px;
    }
    
    .beat-title {
        font-size: 0.9em;
        margin: 8px 0 4px 0;
    }
    
    .beat-user {
        font-size: 0.8em;
        padding: 0;
        margin: 0 0 8px 0;
    }
    
    .price-btn {
        padding: 6px 8px;
        font-size: 0.9em;
    }
    
    .favorite-btn {
        width: 32px;
        height: 32px;
    }
    
    .favorite-btn .material-symbols-outlined {
        font-size: 1.1em;
    }
}

.beat-card .icon-btn {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.4em;
    padding: 0;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    box-shadow: none; /* Убран shadow */
}
.beat-card .icon-btn:hover {
    background-color: var(--button-hover-bg);
    border-color: var(--border);
}
.beat-card .icon-btn .material-symbols-outlined {
    font-size: 1.4em;
}

/* Медиа-запрос для мобильных устройств */
@media (max-width: 600px) {
    .beat-card .icon-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 1.1em !important;
    }
    .beat-card .icon-btn .material-symbols-outlined {
        font-size: 1.1em !important;
    }
}

@media (max-width: 480px) {
    .beats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin-top: 4px;
        padding: 0 4px;
    }
    
    .beat-card {
        padding: 8px;
    }

    .beat-card img { display: block; }

    .beat-info {
        padding: 4px 0 0 0;
        min-height: auto;
        max-height: none;
    }
    
    .beat-text {
        margin-bottom: 6px;
        padding: 4px 0 6px 0;
    }

    .beat-title {
        font-size: 0.8em;
        min-height: 2.2em;
        max-height: 2.2em;
    }

    .beat-user {
        font-size: 0.7em;
        min-height: 20px;
        max-height: 20px;
    }

    .price-btn {
        padding: 4px 5px;
        font-size: 0.8em;
        height: 28px;
        min-width: 0;
        max-width: none;
        flex: 1;
    }

    .favorite-btn {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
        max-width: 28px !important;
        max-height: 28px !important;
        flex-shrink: 0 !important;
    }
    
    .beat-footer {
        gap: 4px;
    }

    .favorite-btn .material-symbols-outlined {
        font-size: 1em;
    }

    .play-button {
        width: 45px;
        height: 45px;
    }

    .play-button .material-symbols-outlined {
        font-size: 26px;
    }
    
    .beat-card .icon-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 1em !important;
    }
    .beat-card .icon-btn .material-symbols-outlined {
        font-size: 1em !important;
    }
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px); /* For Safari */
    display: flex; /* Use flexbox for centering */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
}

.modal-content {
    background-color: var(--card);
    padding: 20px;
    border: 1px solid var(--border);
    width: 80%; /* Could be more responsive */
    max-width: 700px;
    border-radius: 12px;
    box-shadow: 0 5px 15px var(--shadow-color);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    transition: border-color 0.25s ease;
}

.modal-title {
    font-size: 1.5em;
    margin: 0;
    color: var(--text);
    transition: color 0.25s ease;
}

.close-modal-btn {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.25s ease;
}

.close-modal-btn:hover,
.close-modal-btn:focus {
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}

.modal-body {
    padding: 10px 0;
}

/* Form styles for modal - copied and adapted from upload_beat.html styles */
.modal-content .form-box {
    border: none;
    padding: 0;
    margin-bottom: 0;
}

.modal-content .form-box-title {
    font-size: 1.2em;
    margin-bottom: 20px;
}

.modal-content .form-inner-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 24px;
}

.modal-content .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-content .form-group.full-width {
    grid-column: 1 / -1;
}

.modal-content .form-group label {
    font-size: 0.9em;
    color: var(--text-muted);
    transition: color 0.25s ease;
}

.modal-content .product-type-select {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.modal-content .product-type-select label {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.25s ease;
    font-size: 1em;
    color: var(--text);
}

.modal-content .product-type-select input[type="radio"] {
    display: none;
}

.modal-content .product-type-select input[type="radio"]:checked + label {
    background-color: var(--bg-secondary);
    border-color: var(--text);
    font-weight: 500;
}

.modal-content .form-group input, .modal-content .form-group textarea, .modal-content .form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1em;
    box-sizing: border-box;
    background: var(--card);
    color: var(--text);
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.modal-content .form-group input[type="file"] {
    padding: 4px;
    height: 42px;
}

.modal-content .form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.modal-content .form-errors {
    color: #d93025;
    font-size: 0.8em;
    margin-top: 4px;
    list-style-type: none;
    padding: 0;
}

.modal-content .custom-dropdown {
    position: relative;
    width: 100%;
}

.modal-content .dropdown-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1em;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    position: relative;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.modal-content .dropdown-input:focus {
    outline: none;
    border-color: var(--text);
}

.modal-content .dropdown-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    transition: transform 0.2s;
}

.modal-content .dropdown-arrow.open {
    transform: translateY(-50%) rotate(180deg);
}

.modal-content .dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.modal-content .dropdown-options.show {
    display: block;
}

.modal-content .dropdown-search {
    padding: 8px 12px;
    border: none;
    border-bottom: 1px solid var(--border);
    width: 100%;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9em;
    outline: none;
    background: var(--card);
    color: var(--text);
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.modal-content .dropdown-option {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.modal-content .dropdown-option:hover {
    background-color: var(--button-hover-bg);
}

.modal-content .dropdown-option.selected {
    background-color: var(--bg-secondary);
}

.modal-content .dropdown-option.hidden {
    display: none;
}

.modal-content .form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 32px;
}

.modal-content .btn {
    padding: 10px 32px;
    border-radius: 20px;
    border: 1px solid var(--text);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.1em;
    background: var(--card);
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.modal-content .btn-primary {
    background: var(--text);
    color: var(--bg);
}

.modal-content .btn-secondary {
    background: var(--card);
    color: var(--text);
}

/* Responsive styles for modal and history */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 15px;
    }
    .modal-title {
        font-size: 1.3em;
    }
    .close-modal-btn {
        font-size: 24px;
    }
    .modal-content .form-inner-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .modal-content .form-group input, .modal-content .form-group textarea, .modal-content .form-group select,
    .modal-content .dropdown-input {
        font-size: 0.95em;
        padding: 8px 12px;
    }
    .modal-content .product-type-select label {
        padding: 8px;
        font-size: 0.95em;
    }
    .modal-content .form-buttons {
        flex-direction: column;
        gap: 10px;
    }
    .modal-content .btn {
        width: 100%;
        text-align: center;
    }
    
    .history-item {
        font-size: 0.95em;
        padding: 12px 14px;
        gap: 12px;
    }
    
    .history-item span:first-child {
        min-width: 100px;
        max-width: 100px;
    }
    
    .history-item span:nth-child(2) a {
        max-width: 120px;
    }
    
    .history-item span:last-child {
        min-width: 80px;
        max-width: 80px;
    }
}

/* Player styles (адаптировано с beat_list) */
.player-container {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    max-width: 1000px;
    width: calc(100% - 30px);
    background-color: var(--card);
    border: none;
    border-radius: 9999px;
    box-shadow: 0 4px 30px var(--shadow-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 6px 20px 6px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'IBM Plex Mono', monospace;
    transition: bottom 0.3s ease-out, background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}
.player-eq-bg {
    position: absolute;
    inset: -20%;
    z-index: 0;
    background-size: cover;
    background-position: center;
    filter: blur(40px);
    -webkit-filter: blur(40px);
    opacity: 0.45;
    pointer-events: none;
    transform-origin: center center;
}
.player-content { display: flex; align-items: center; width: 100%; cursor: pointer; position: relative; z-index: 1; }
.player-beat-link { display: flex; align-items: center; flex-grow: 1; text-decoration: none; color: inherit; cursor: pointer; }
.player-beat-link:hover { text-decoration: none; color: inherit; }
.player-cover { width: 50px; height: 50px; object-fit: cover; border-radius: 50%; margin-right: 15px; margin-left: 0; background-color: var(--bg-secondary); transition: background-color 0.25s ease; }
.player-info { flex-grow: 1; margin-right: 20px; min-width: 0; }
.player-title { font-size: 1em; font-weight: 500; margin: 0; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.25s ease; }
.player-artist { font-size: 0.85em; color: var(--text-muted); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.25s ease; }
.player-controls { display: flex; align-items: center; gap: 15px; max-width: 500px; flex-grow: 1; justify-content: flex-end; }
.player-play-pause-button { background: none; border: none; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; color: var(--text); transition: color 0.25s ease; }
.player-play-pause-button .material-symbols-outlined { font-size: 40px; }
.current-time, .duration { font-size: 0.9em; color: var(--text-muted); min-width: 40px; text-align: center; transition: color 0.25s ease; }
.progress-bar { flex-grow: 1; -webkit-appearance: none; width: 100%; height: 6px; background: var(--bg-secondary); border-radius: 5px; outline: none; cursor: pointer; margin: 0 10px; transition: background-color 0.25s ease; }
.progress-bar::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--text); cursor: pointer; box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.4); transition: background-color 0.25s ease; }
.progress-bar::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--text); cursor: pointer; box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.4); transition: background-color 0.25s ease; }
.player-volume-button { width: 28px; height: 28px; background: none; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text); transition: color 0.25s ease; }
.player-volume-button:hover { background-color: var(--button-hover-bg); }
.player-volume-button .material-symbols-outlined { font-size: 20px; }
.volume-bar { width: 80px; margin-left: 8px; height: 6px; background: var(--bg-secondary) !important; border-radius: 5px; outline: none; cursor: pointer; transition: background-color 0.25s ease; }
.volume-bar::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--text) !important; cursor: pointer; transition: background-color 0.25s ease; }
.volume-bar::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--text) !important; cursor: pointer; transition: background-color 0.25s ease; }


/* Close button for player - inside content */
.player-close {
    flex-shrink: 0;
    margin-left: 8px;
    background: none;
    border: none;
    color: var(--text);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.25s ease, color 0.25s ease;
}
.player-close:hover {
    background-color: var(--button-hover-bg);
}
@media (max-width: 768px) {
    .player-container { padding: 6px 10px; bottom: 12px; width: calc(100% - 48px); max-width: 360px; border-radius: 9999px; }
    .player-cover { width: 36px; height: 36px; margin-right: 10px; margin-left: 0; border-radius: 50%; }
    .player-title { font-size: 0.85em; }
    .player-artist { font-size: 0.75em; }
    .player-controls { gap: 8px; }
    .player-play-pause-button .material-symbols-outlined { font-size: 28px; }
    .current-time, .duration { font-size: 0.75em; min-width: 35px; }
    .progress-bar { height: 3px; margin: 0 6px; }
    .progress-bar::-webkit-slider-thumb, .progress-bar::-moz-range-thumb { width: 10px; height: 10px; }
    .volume-bar { width: 50px; margin-left: 6px; }
    .player-volume-button { width: 28px; height: 28px; }
    .player-volume-button .material-symbols-outlined { font-size: 20px; }
}

@media (max-width: 700px) {
    .beats-grid {
        overflow-x: hidden;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .beats-grid::-webkit-scrollbar {
        display: none;
    }
}

/* --- Широкие строки истории с отступами и суммой --- */
.stat-card.history-card {
    width: 100%;
    max-width: inherit;
    box-sizing: border-box;
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
}
.history-list {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 1.08em;
    background: transparent;
    box-sizing: border-box;
    gap: 18px;
    transition: border-color 0.25s ease;
}

/* Стили для обрезания длинного текста в истории */
.history-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item span:first-child {
    min-width: 160px;
    max-width: 160px;
    flex-shrink: 0;
}

.history-item span:nth-child(2) {
    flex: 1;
    min-width: 0;
    max-width: none;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.history-item span:nth-child(2) a {
    display: inline-block;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.history-item span:last-child {
    min-width: 120px;
    max-width: 120px;
    flex-shrink: 0;
    text-align: right;
}



@media (max-width: 480px) {
    .history-item {
        font-size: 0.9em;
        padding: 10px 12px;
        gap: 10px;
    }
    
    .history-item span:first-child {
        min-width: 90px;
        max-width: 90px;
    }
    
    .history-item span:nth-child(2) a {
        max-width: 100px;
    }
    
    .history-item span:last-child {
        min-width: 70px;
        max-width: 70px;
    }
}
.history-item:last-child {
    border-bottom: none;
}
.dashboard-history {
    margin-top: 36px;
}
.history-spoiler {
    border: none;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}
.history-spoiler summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    font-size: 1.1em;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: background-color 0.2s;
}
.history-spoiler summary:hover {
    background-color: var(--button-hover-bg);
}
.history-spoiler summary::after {
    content: 'expand_more';
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    transition: transform 0.2s;
}
.history-spoiler[open] > summary::after {
    transform: rotate(180deg);
}
.history-list {
    padding: 0 20px 20px 20px;
    margin: 0;
    list-style: none;
}

@media (min-width: 1000px) {
    /* Только для личного кабинета битмейкера */
    .profile-tabs {
        margin-top: 32px;
    }
    .beats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 520px) {
    .beats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px 16px;
    }
    .beat-card {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
    .beat-card img, .beat-cover > div,
    .beat-cover img {
        height: auto !important;
        aspect-ratio: 1 / 1;
        object-fit: cover;
    }
    
    .beat-cover {
        aspect-ratio: 1 / 1;
    }
}

.beats-grid-public {
    display: grid;
    grid-template-columns: repeat(3, 250px);
    gap: 26px;
    justify-content: center;
    max-width: 802px;
    margin: 0px auto 64px auto;
}
@media (max-width: 1200px) {
    .beats-grid-public {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        max-width: 540px;
    }
}
@media (max-width: 900px) {
    .beats-grid-public {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        max-width: 540px;
    }
}
@media (max-width: 600px) {
    .beats-grid-public {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px 12px;
        margin-top: 20px;
        max-width: 98vw;
    }
}
@media (max-width: 480px) {
    .beats-grid-public {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px 10px;
        max-width: 98vw;
    }
}

    .profile-container {
        max-width: 1000px;
        margin: 40px auto;
        padding: 0 20px;
    }
    .profile-grid {
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .profile-left, .content-area {
        width: 100%;
    }

    .profile-tabs {
        display: flex;
        gap: 24px;
  
        margin-bottom: 24px;
        justify-content: center; /* Центрируем табы */
    }
    .tab-link {
        background: none !important;
        border: none !important;
        border-radius: 8px !important;
        color: var(--text) !important;
        font-weight: 400 !important;
        font-size: 1.05rem !important;
        padding: 12px 18px 10px 18px !important;
        margin: 0 !important;
        box-shadow: none !important;
        position: relative;
        transition: color 0.18s;
        outline: none;
    }
    .tab-link.active {
        color: var(--text) !important;
    }
    .tab-link.active::after {
        content: '';
        display: block;
        position: absolute;
        left: 18px;
        right: 18px;
        bottom: 0;
        height: 2.5px;
        background: var(--text);
        border-radius: 2px;
    }
    .tab-link:not(.active):hover {
        color: var(--text-muted) !important;
    }
    .tab-content {
        display: none;
   
        padding: 0 24px 24px 24px;
    }
    .tab-content.active {
        display: block;
        margin-top: 0;
    }
    .dashboard-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
    .stat-card {
        background: var(--card);
        padding: 24px;
        border-radius: 8px;
        border: 1px solid var(--border);
        text-align: center;
        transition: background-color 0.25s ease, border-color 0.25s ease;
    }
.stat-card h3 {
    margin: 0 0 6px 0;
    font-size: 0.9em;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.25s ease;
}
.stat-number {
    font-size: 2.5rem;
    font-weight: 600;
    line-height: 1.2;
}
.stat-date {
    font-size: 0.95rem;
    color: var(--text-muted) !important;
    margin: 4px 0 0 0;
    font-weight: 400;
}
    .balance-card {
        grid-column: span 2;
        padding: 24px;
    }
    .history-card {
        grid-column: 1 / -1;
        margin-top: 20px;
    }
    .history-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }


    /* Re-using beat card styles from your original file, simplified */
    .beat-card {
        background: var(--card) !important;
      
        border-radius: 12px;
        overflow: hidden;
        transition: background-color 0.25s ease, border-color 0.25s ease;
    }
    .beat-card img {
        width: 100%;
        aspect-ratio: 1 / 1;
        object-fit: cover;
    }
    .beat-info { padding: 12px; }
    .beat-title { font-weight: 500; color: var(--text); transition: color 0.25s ease; }
    .beat-price { color: var(--text-muted); transition: color 0.25s ease; }
    
    /* Mobile responsive styles */
    @media (max-width: 900px) {
        .profile-grid {
            display: flex;
            flex-direction: column;
            gap: 24px;
        }
        
        .profile-left {
            width: 100%;
            max-width: 100%;
        }
        
        .profile-card {
            order: 1;
            margin-top: 40px;
            padding: 0 16px 16px 16px;
        }
        
        .content-area {
            order: 2;
            margin-top: 0;
        }
        
        .beats-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 16px;
        }
        
        .dashboard-grid {
            grid-template-columns: 1fr 1fr !important;
            grid-template-rows: auto auto auto !important;
            gap: 12px !important;
        }
        
        .balance-card {
            grid-column: 1 / -1 !important;
            grid-row: 1 !important;
        }
    }
    
    @media (max-width: 600px) {
        .profile-container {
            margin: 20px auto;
            padding: 0 12px;
        }
        
        .profile-grid {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }
        
        .profile-left {
            width: 100%;
            max-width: 100%;
        }
        
        .profile-card {
            order: 1;
            margin-top: 30px;
            padding: 0 12px 12px 12px;
            border-radius: 12px;
        }
        
        .content-area {
            order: 2;
            margin-top: 0;
        }
        
        .profile-header {
            padding: 16px;
        }
        
        .profile-avatar {
            width: 60px;
            height: 60px;
        }
        
        .profile-name {
            font-size: 1.1rem;
        }
        
        .profile-stats {
            gap: 20px;
            margin-top: 8px;
        }
        
        .profile-stats div, .profile-stats a {
            font-size: 0.8rem;
        }
        
        .profile-stats span {
            font-size: 1rem;
        }
        
        .beats-grid {
            grid-template-columns: 1fr;
            gap: 16px;
            margin-top: 20px;
        }
        
        .beat-card img,
        .beat-cover img {
            height: auto !important;
            aspect-ratio: 1 / 1;
            object-fit: cover;
        }
        
        .beat-cover {
            aspect-ratio: 1 / 1;
        }
        
        .beat-info {
            padding: 10px 12px;
        }
        
        /* Dashboard responsive */
        .dashboard-grid:not(.redesigned) {
            grid-template-columns: 1fr !important;
            grid-template-rows: auto auto auto auto auto !important;
            gap: 10px !important;
        }
        
        .dashboard-grid.redesigned {
            display: grid !important;
            grid-template-columns: 1fr 1fr !important;
            grid-template-rows: auto auto auto !important;
            gap: 10px !important;
        }
        
        .dashboard-grid.redesigned .balance-card {
            grid-column: 1 / -1 !important;
            grid-row: 1 !important;
            padding: 16px !important;
            min-height: 120px !important;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            margin-bottom: 6px !important;
        }
        
        .dashboard-grid.redesigned .stat-card:not(.balance-card) {
            grid-column: span 1 !important;
            padding: 12px !important;
            min-height: 120px !important;
        }
        
        .balance-card {
            grid-column: 1 !important;
            grid-row: 1 !important;
            padding: 16px !important;
            min-height: 120px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }
        
        .stat-card {
            padding: 12px;
            min-height: 120px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: flex-start;
            text-align: left;
        }
        
        .stat-card h3 {
            font-size: 0.85rem;
        }
        
        .stat-card p {
            font-size: 2rem;
        }
        
        /* Charts responsive */
        .charts-grid {
            grid-template-columns: 1fr !important;
            gap: 12px;
        }
        
        .chart-container {
            height: 100px !important;
            padding: 12px;
            background: transparent;
            border: none;
            border-radius: 8px;
            box-shadow: none;
        }
        
        .chart-container h4 {
            font-size: 0.9rem;
            margin-bottom: 10px;
        }
        
        /* Profile tabs responsive */
        .profile-tabs {
            padding: 8px 16px 0;
            gap: 4px;
            overflow-x: auto;
        }
        
        .tab-link {
            padding: 8px 16px;
            font-size: 0.9rem;
            white-space: nowrap;
        }
        
        .tab-content {
            padding: 16px;
        }
        
        /* Balance actions responsive */
        .balance-actions {
            gap: 12px;
            margin-top: 16px;
        }
        
        .balance-btn {
            width: 40px;
            height: 40px;
        }
        
        .balance-btn .material-symbols-outlined {
            font-size: 20px;
        }
        
        /* Social buttons responsive */
        .profile-socials {
            gap: 10px;
            margin-top: 12px;
        }
        
        .social-btn {
            width: 36px;
            height: 36px;
        }
        
        .social-btn i {
            font-size: 18px;
        }
        
        .edit-profile-btn, .follow-btn {
            max-width: 100%;
            padding: 10px 20px;
            font-size: 0.95rem;
        }
        
        /* History responsive */
        .dashboard-history {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        
        .history-card {
            margin-top: 0;
        }
        
        .history-item {
            padding: 10px 0;
            font-size: 0.9rem;
            flex-direction: column;
            gap: 4px;
        }
        
        /* Reviews responsive */
        .reviews-header {
            padding: 16px;
        }
        
        .reviews-title {
            flex-direction: column;
            align-items: flex-start;
            gap: 8px;
        }
        
        .reviews-main-title {
            font-size: 1.1rem;
        }
        
        .reviews-list {
            padding: 12px 8px 12px 12px;
            gap: 8px;
        }
        
        .reviewer-info {
            padding: 8px 10px 8px 8px;
            gap: 10px;
        }
        
        .reviewer-info img {
            width: 28px;
            height: 28px;
        }
        
        .reviewer-details h6 {
            font-size: 0.85em;
        }
        
        .reviewer-details small {
            font-size: 0.7em;
        }
        
        .review-text {
            font-size: 0.9em;
        }
        
        /* Purchases responsive */
        .purchases-grid {
            grid-template-columns: 1fr;
            gap: 16px;
        }
        
        .purchase-card img {
            height: 200px;
        }
        
        .purchase-info {
            padding: 10px;
        }
        
        .purchase-title {
            font-size: 0.95em;
        }
        
        .purchase-user {
            font-size: 0.75em;
        }
        
        /* Modal responsive */
        .modal-content {
            width: 90%;
            margin: 10% auto;
            padding: 16px;
        }
        
        .follow-list-header {
            padding-bottom: 8px;
            margin-bottom: 8px;
        }
        
        .follow-list-title {
            font-size: 1.1rem;
        }
        
        .follow-list-item a {
            padding: 6px;
            gap: 10px;
        }
        
        .follow-list-avatar {
            width: 32px;
            height: 32px;
        }
    }
    
    @media (max-width: 480px) {
        .profile-container {
            margin: 15px auto;
            padding: 0 8px;
        }
        
        .profile-card {
            margin-top: 20px;
            padding: 0 8px 8px 8px;
            border-radius: 8px;
        }
        
        .profile-header {
            padding: 12px;
        }
        
        .profile-avatar {
            width: 50px;
            height: 50px;
        }
        
        .profile-name {
            font-size: 1rem;
        }
        
        .profile-stats {
            gap: 16px;
            margin-top: 6px;
        }
        
        .profile-stats div, .profile-stats a {
            font-size: 0.75rem;
        }
        
        .profile-stats span {
            font-size: 0.9rem;
        }
        
        /* Stat cards для очень маленьких экранов */
        .stat-card {
            padding: 12px;
            min-height: 105px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: flex-start;
            text-align: left;
        }
        
        .stat-card h3 {
            font-size: 0.8rem;
            margin-bottom: 6px;
        }
        
        .stat-card p {
            font-size: 2rem;
        }
        
        /* Charts для очень маленьких экранов */
        .charts-grid {
            gap: 8px;
        }
        
        .chart-container {
            height: 160px !important;
            padding: 8px;
            min-height: 140px;
        }
        
        .chart-container h4 {
            font-size: 0.8rem;
            margin-bottom: 8px;
        }
        
        .chart-container canvas {
            max-height: 120px !important;
        }
        
        /* Balance actions для очень маленьких экранов */
        .balance-actions {
            gap: 8px;
            margin-top: 12px;
        }
        
        .balance-btn {
            width: 36px;
            height: 36px;
        }
        
        .balance-btn .material-symbols-outlined {
            font-size: 18px;
        }
        
        /* Beat cards для очень маленьких экранов */
        .beat-card img,
        .beat-cover img {
            height: auto !important;
            aspect-ratio: 1 / 1;
            object-fit: cover;
        }
        
        .beat-cover {
            aspect-ratio: 1 / 1;
        }
        
        .beat-info {
            padding: 8px 10px;
        }
        
        .beat-title {
            font-size: 0.9em;
            margin: 8px 0 4px 0;
        }
        
        .beat-user {
            font-size: 0.8em;
            padding: 0;
            margin: 0 0 8px 0;
        }
        
        .price-btn {
            padding: 6px 8px;
            font-size: 0.9em;
        }
        
        .favorite-btn {
            width: 32px;
            height: 32px;
        }
        
        .favorite-btn .material-symbols-outlined {
            font-size: 1.1em;
        }
    }


.favorite-btn.add-to-cart-async,
.edit-beat-btn.icon-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    max-width: 42px;
    max-height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0;
}
@media (max-width: 600px) {
    .price-btn {
        height: 32px;
        min-width: 0;
        max-width: none;
        flex: 1;
        font-size: 0.9em;
        padding: 0 8px;
    }
    .favorite-btn.add-to-cart-async,
    .edit-beat-btn.icon-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        max-width: 32px;
        max-height: 32px;
        flex-shrink: 0;
    }
}

.withdraw-cancel-btn {
    flex: 0 0 auto;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 1em;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.25s ease;
    font-weight: 500;
    margin-left: 8px;
}
.withdraw-cancel-btn:hover {
    background: var(--button-hover-bg);
    color: var(--text);
    border-color: var(--border);
}

/* Removed duplicate favorite-btn.add-to-cart-async styles - using styles from beat_list.css above */

@keyframes cartSuccess {
    0% {
        transform: scale(1);
        background-color: var(--bg-secondary);
        border-color: var(--border);
        color: var(--text);
    }
    50% {
        transform: scale(1.1);
        background-color: var(--text);
        border-color: var(--text);
        color: var(--bg);
    }
    100% {
        transform: scale(1);
        background-color: var(--text);
        border-color: var(--text);
        color: var(--bg);
    }
}

@keyframes iconBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

.beat-card img {
    width: 100%;
    aspect-ratio: 1/1;
    height: auto;
    object-fit: cover;
    border-radius: 15px 15px 0 0;
    background:rgb(255, 255, 255);
    display: block;
   
}

@media (max-width: 600px) {
    .price-btn {
        height: 32px;
        min-width: 32px;
        font-size: 0.9em;
        padding: 0 8px;
    }
    .favorite-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
    }
    .favorite-btn .material-symbols-outlined {
        font-size: 1.1em !important;
    }
}

@media (max-width: 480px) {
    .favorite-btn .material-symbols-outlined {
        font-size: 1em !important;
    }
}

/* Beatmaker dashboard — redesign overrides */
.profile-tabs { display: flex; gap: 9px; margin: 0; }
.profile-tabs .tab-link { padding: 8px 14px; border: none; border-radius: 10px; background: var(--bg-secondary); color: var(--text); text-decoration: none; transition: background-color 0.25s ease, color 0.25s ease; }
.profile-tabs .tab-link.active { background: var(--text); color: var(--bg); }

/* Desktop dashboard grid */
.dashboard-grid.redesigned { 
    display: grid; 
    grid-template-columns: 2fr 1fr 1fr; 
    grid-template-rows: auto auto;
    grid-auto-rows: minmax(120px, auto); 
    gap: 16px; 
}

.dashboard-grid.redesigned .balance-card { 
    grid-column: 1; 
    grid-row: 1 / span 2; 
}

.dashboard-grid.redesigned .profit-card { 
    grid-column: 2; 
    grid-row: 1; 
}

.dashboard-grid.redesigned .sales-card { 
    grid-column: 3; 
    grid-row: 1; 
}

.dashboard-grid.redesigned .premium-card { 
    grid-column: 2; 
    grid-row: 2; 
}

.dashboard-grid.redesigned .beats-card { 
    grid-column: 3; 
    grid-row: 2; 
}

.stat-card { border: none; border-radius: 12px; background: var(--card); padding: 16px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; text-align: left; transition: background-color 0.25s ease; }
.stat-card h3 { margin: 0 0 8px 0; font-size: 0.95em; color: var(--text-muted); transition: color 0.25s ease; }
.stat-number { font-size: 2.5rem; font-weight: 600; margin: 0; }
.stat-date {
    font-size: 0.95rem;
    color: var(--text-muted) !important;
    margin: 4px 0 0 0;
    font-weight: 400;
}
.balance-card { 
    padding: 24px; 
    background: #000;
    border-radius: 16px;
    color: #fff;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    text-align: center;
    align-items: center;
}
.balance-card h3 { 
    margin: 0 0 8px 0; 
    font-size: 0.9em; 
    color: rgba(255, 255, 255, 0.8); 
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    align-self: flex-start;
}
.balance-amount { 
    font-size: 4rem; 
    line-height: 1; 
    color: #fff;
    font-weight: 700;
    margin: 0 0 8px 0;
    align-self: flex-start;
}
.cardholder-name {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: flex-start;
    margin-bottom: auto;
}
.mastercard-logo {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 25px;
    display: flex;
    align-items: center;
    gap: 2px;
}
.mastercard-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}
.mastercard-red {
    background: #666;
}
.mastercard-orange {
    background: #ccc;
    margin-left: -8px;
}
.balance-actions { 
    display: flex; 
    gap: 20px; 
    margin-top: auto;
    justify-content: center;
}
.balance-btn { 
    padding: 12px 20px;
    border-radius: 50px; 
    border: 1px solid var(--border) !important; 
    background: var(--card) !important; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    color: var(--text) !important;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    gap: 8px;
    min-width: 120px;
    white-space: nowrap;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.balance-btn .material-symbols-outlined {
    color: var(--text) !important;
    font-size: 20px;
    transition: color 0.25s ease;
}
.balance-btn:hover {
    background: var(--button-hover-bg) !important;
    border-color: var(--border) !important;
}
/* Make withdraw button width adapt to its text, keep buttons on one line */
.dashboard-grid.redesigned .balance-card .balance-actions { flex-wrap: nowrap; }
.dashboard-grid.redesigned .balance-card .balance-actions .balance-btn { width: auto; min-width: 0; }
.dashboard-grid.redesigned .balance-card .balance-actions .balance-btn span { white-space: nowrap; }
/* Buyer: make balance card narrower and rectangular */
#purchases .balance-card {
    max-width: 360px;
    width: 100%;
    margin: 0 auto;
    border-radius: 8px;
    padding: 24px 20px;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#purchases .balance-card h3 {
    margin-bottom: 12px;
    font-size: 0.9rem;
}

#purchases .balance-card .balance-amount {
    font-size: 3rem;
    margin-bottom: 16px;
    line-height: 1;
}

#purchases .balance-card .cardholder-name {
    margin-bottom: 20px;
    font-size: 0.9rem;
}

#purchases .balance-card .balance-actions {
    margin-top: auto;
    gap: 12px;
}
/* Modern Charts Container */
.charts-container { 
    background: transparent; 
    border: none; 
    border-radius: 8px; 
    padding: 10px 5px; 
    margin-top: 20px;
    /* Hide scrollbar */
    overflow: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.charts-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.charts-container h3 {
    margin: 0 0 20px 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
    transition: color 0.25s ease;
}

/* Beautiful Chart Filters - Tabler Style */
.chart-filters { 
    display: flex; 
    gap: 6px; 
    margin-bottom: 24px;
    padding: 4px;
    background: var(--bg-secondary);
    border-radius: 12px;
    width: fit-content;
    transition: background-color 0.25s ease;
}

.chart-filter-btn { 
    padding: 8px 16px; 
    border: none; 
    background: transparent; 
    border-radius: 8px; 
    cursor: pointer; 
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s ease;
    position: relative;
}

.chart-filter-btn:hover { 
    background: var(--button-hover-bg);
    color: var(--text);
}

.chart-filter-btn.active { 
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--text);
    box-shadow: none;
}

/* Modern Charts Grid */
.charts-grid { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 16px;
    padding: 0;
}

.chart-container { 
    background: var(--card); 
    border: none;
    border-radius: 12px; 
    padding: 20px;
    padding-bottom: 50px;
    padding-right: 10px;
    min-height: 250px;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px var(--shadow-color);
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

.chart-container h4 {
    margin: 0 0 16px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.25s ease;
}

.chart-container h4::before {
    content: '';
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: var(--text);
    transition: background-color 0.25s ease;
}

.chart-container canvas,
.chart-container .apex-chart-container {
    flex: 1;
    width: 100% !important;
    min-height: 200px;
    position: relative;
    overflow: visible;
    margin-right: -10px;
}

/* Убеждаемся, что даты видны */
.chart-container .apexcharts-canvas {
    overflow: visible !important;
}

.chart-container .apexcharts-xaxis {
    padding-bottom: 0 !important;
}

.chart-container .apexcharts-svg {
    overflow: visible !important;
}

/* Skeleton loader для графиков */
.chart-skeleton {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    padding: 20px 0;
    height: 200px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.skeleton-line {
    height: 20px;
    background: linear-gradient(90deg, 
        var(--bg-secondary) 0%, 
        var(--border) 50%, 
        var(--bg-secondary) 100%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    opacity: 0.6;
}

.skeleton-line:nth-child(1) {
    width: 100%;
}

.skeleton-line:nth-child(2) {
    width: 85%;
    margin-left: auto;
}

.skeleton-line:nth-child(3) {
    width: 70%;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.apex-chart-container {
    position: relative;
}

.profit-chart {
    background: var(--card);
}

.profit-chart h4::before {
    background: var(--text);
}

/* Bank-style History */
.dashboard-history { 
    margin-top: 24px; 
}

.dashboard-history > h3 {
    margin: 0 0 16px 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
    transition: color 0.25s ease;
}

.history-spoiler { 
    margin: 0 0 12px 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    overflow: visible;
    transition: all 0.2s ease;
}

.history-spoiler:hover {
    background: transparent;
}

.history-spoiler > summary { 
    list-style: none; 
    cursor: pointer; 
    padding: 16px 0; 
    background: transparent;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease, color 0.25s ease;
}

.history-spoiler > summary:hover {
    background: transparent;
    color: var(--text);
}

.history-spoiler > summary::after {
    content: '';
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e") no-repeat center;
    background-size: 16px 16px;
    transition: transform 0.2s ease;
}

.history-spoiler[open] > summary::after {
    transform: rotate(180deg);
}

.history-card { 
    border: none;
    border-radius: 8px;
    padding: 0;
    background: transparent;
}

.history-list { 
    list-style: none; 
    margin: 0; 
    padding: 0;
}

/* Bank-style History Items */
.history-item { 
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s ease, border-color 0.25s ease;
}

.history-item:hover {
    background: transparent;
}

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

.history-item .date {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    min-width: 80px;
    transition: color 0.25s ease;
}

.history-item .description {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 500;
    transition: color 0.25s ease;
}

.history-item .description a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
}

.history-item .description a:hover {
    text-decoration: underline;
}

.amount-positive { 
    color: #059669;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.amount-positive::before {
    content: '↗';
    font-size: 1.1rem;
    color: #10b981;
}

.amount-negative { 
    color: #dc2626;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.amount-negative::before {
    content: '↙';
    font-size: 1.1rem;
    color: #ef4444;
}

/* Modern Status Badges */
.status-badge { 
    padding: 4px 10px; 
    border-radius: 20px; 
    font-size: 0.8rem; 
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-pending { 
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border: 1px solid #f59e0b;
}

.status-badge.status-approved { 
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border: 1px solid #10b981;
}

.status-badge.status-rejected { 
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border: 1px solid #ef4444;
}
@media (max-width: 1000px) { 
    .dashboard-grid.redesigned { 
        grid-template-columns: 1fr 1fr; 
    } 
}
/* Mobile dashboard - 700px and below */
@media (max-width: 700px) { 
    .dashboard-grid.redesigned { 
        display: grid !important;
        grid-template-columns: 1fr 1fr !important; 
        grid-template-rows: auto auto auto !important;
        gap: 12px !important;
    } 
    
    /* Balance card spans full width at top */
    .dashboard-grid.redesigned .balance-card {
        grid-column: 1 / -1 !important;
        grid-row: 1 !important;
        order: 1 !important;
    }
    
    /* Other cards in 2x2 grid below balance */
    .dashboard-grid.redesigned .profit-card {
        grid-column: 1 !important;
        grid-row: 2 !important;
        order: 2 !important;
    }
    
    .dashboard-grid.redesigned .sales-card {
        grid-column: 2 !important;
        grid-row: 2 !important;
        order: 3 !important;
    }
    
    .dashboard-grid.redesigned .premium-card {
        grid-column: 1 !important;
        grid-row: 3 !important;
        order: 4 !important;
    }
    
    .dashboard-grid.redesigned .beats-card {
        grid-column: 2 !important;
        grid-row: 3 !important;
        order: 5 !important;
    }
    
    .history-item { 
        grid-template-columns: 90px 1fr auto; 
    }
    .stat-card {
        box-shadow: none;
    }
}

/* Mobile dashboard - 480px and below */
@media (max-width: 480px) { 
    .dashboard-grid.redesigned { 
        display: grid !important;
        grid-template-columns: 1fr 1fr !important; 
        grid-template-rows: auto auto auto !important;
        gap: 10px !important;
    } 
    
    /* Balance card spans full width at top */
    .dashboard-grid.redesigned .balance-card {
        grid-column: 1 / -1 !important;
        grid-row: 1 !important;
        order: 1 !important;
        padding: 16px !important;
        min-height: 120px !important;
    }
    
    /* Other cards in 2x2 grid below balance */
    .dashboard-grid.redesigned .profit-card {
        grid-column: 1 !important;
        grid-row: 2 !important;
        order: 2 !important;
        padding: 12px !important;
        min-height: 100px !important;
    }
    
    .dashboard-grid.redesigned .sales-card {
        grid-column: 2 !important;
        grid-row: 2 !important;
        order: 3 !important;
        padding: 12px !important;
        min-height: 100px !important;
    }
    
    .dashboard-grid.redesigned .premium-card {
        grid-column: 1 !important;
        grid-row: 3 !important;
        order: 4 !important;
        padding: 12px !important;
        min-height: 100px !important;
    }
    
    .dashboard-grid.redesigned .beats-card {
        grid-column: 2 !important;
        grid-row: 3 !important;
        order: 5 !important;
        padding: 12px !important;
        min-height: 100px !important;
    }
    
    .dashboard-grid.redesigned .stat-card h3 {
        font-size: 0.85em !important;
        margin-bottom: 4px !important;
    }
    .dashboard-grid.redesigned .stat-number {
        font-size: 2rem !important;
    }
    .balance-amount {
        font-size: 2rem !important;
    }
    /* Mobile Charts */
    .charts-container {
        padding: 16px;
        margin-top: 16px;
    }
    
    .charts-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    
    .chart-filters {
        gap: 4px;
        padding: 3px;
    }
    
    .chart-filter-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    /* Mobile History */
    .history-spoiler > summary {
        padding: 12px 0;
        font-size: 0.95rem;
    }
    
    .history-item {
        padding: 12px 0;
        gap: 12px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .history-item .date {
        font-size: 0.8rem;
        min-width: auto;
    }
    
    .history-item .description {
        font-size: 0.9rem;
        order: -1;
    }
    
    .amount-positive,
    .amount-negative {
        font-size: 0.9rem;
        align-self: flex-end;
    }
}
/* оверлей */
#topUpModal {
  display: flex;
  position: fixed;
  
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  /* без overflow */
}

/* сама карточка */
#topUpModal > div {
  background: var(--card) !important;
  border-radius: 12px;
  max-width: 440px;
  width: 94vw;
  max-height: 92vh;
  overflow-y: auto;
  padding: 20px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--text);
  transition: background-color 0.25s ease, color 0.25s ease;
  box-sizing: border-box;  /* учитываем padding в высоте */
}

/* Withdraw Modal */
#withdrawModal {
  display: flex;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}
.topup-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.topup-status-paid {
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.topup-status-pending {
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.topup-status-failed {
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

/* Withdraw Modal Styles */
.withdraw-modal-content {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.withdraw-modal-content::-webkit-scrollbar {
  width: 6px;
}

.withdraw-modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.withdraw-modal-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
  transition: background-color 0.25s ease;
}

.withdraw-form-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Payment method options in Withdraw Modal (same look as TopUp) */
#withdrawModal .payment-section {
  padding-top: 0;
  border-top: none;
}

#withdrawModal .withdraw-payment-methods-list.payment-methods-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 0;
}

#withdrawModal .withdraw-method-option.payment-method-option {
  display: block;
  cursor: pointer;
  position: relative;
}

#withdrawModal .withdraw-method-option .payment-method-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

#withdrawModal .withdraw-method-option .payment-method-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg-secondary);
  transition: all 0.2s ease;
}

#withdrawModal .withdraw-method-option:hover .payment-method-content {
  border-color: var(--text-secondary);
  background: var(--card);
}

#withdrawModal .withdraw-method-option.is-selected .payment-method-content {
  border-color: var(--text-secondary);
  background: var(--card);
}

#withdrawModal .withdraw-method-option .payment-method-logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}

#withdrawModal .withdraw-method-option .payment-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
}

#withdrawModal .withdraw-method-option .payment-method-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#withdrawModal .withdraw-method-option .payment-method-name {
  font-weight: 600;
  font-size: 1em;
  color: var(--text);
  transition: color 0.25s ease;
}

/* SBP bank buttons in withdraw modal */
#withdrawModal .withdraw-sbp-bank-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#withdrawModal .withdraw-sbp-bank-btn {
  padding: 10px 16px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 0.95em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

#withdrawModal .withdraw-sbp-bank-btn:hover {
  border-color: var(--text-secondary);
  background: var(--card);
}

#withdrawModal .withdraw-sbp-bank-btn.selected {
  border-color: var(--button-primary-bg);
  background: var(--button-primary-bg);
  color: var(--button-primary-text);
}

.withdraw-method-form {
  display: none;
}

.withdraw-history-section {
  margin-top: 8px;
}

.withdraw-history-list {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.withdraw-history-list::-webkit-scrollbar {
  width: 6px;
}

.withdraw-history-list::-webkit-scrollbar-track {
  background: transparent;
}

.withdraw-history-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
  transition: background-color 0.25s ease;
}

.withdraw-history-item {
  transition: background-color 0.2s;
}

.withdraw-history-item:hover {
  background: var(--button-hover-bg) !important;
}

.withdraw-status-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.withdraw-status-pending {
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
}

.withdraw-status-approved {
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
}

html:not(.dark) .withdraw-status-approved {
  background: #f5f5f5;
  color: #000;
}

html.dark .withdraw-status-approved {
  background: #2a2a2a;
  color: #fff;
}

.withdraw-status-rejected {
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
}

html:not(.dark) .withdraw-status-rejected {
  background: #f5f5f5;
  color: #000;
}

html.dark .withdraw-status-rejected {
  background: #2a2a2a;
  color: #fff;
}

/* .withdraw-btn-primary - анимация затемнения при наведении убрана */

.withdraw-btn-light:hover {
    background: var(--button-hover-bg) !important;
}

.withdraw-cancel-btn:hover {
    background: var(--button-hover-bg) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

/* TopUp Modal Styles */
.topup-modal-content {
  scrollbar-width: none;
  overflow-y: auto;
}

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

.topup-history-section {
  margin-top: 0;
  width: 100%;
  padding-right: 0;
}

.topup-history-list {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  width: 100%;
  padding-right: 0 !important;
  margin-right: 0 !important;
}

.topup-history-list::-webkit-scrollbar {
  width: 6px;
}

.topup-history-list::-webkit-scrollbar-track {
  background: transparent;
}

.topup-history-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
  transition: background-color 0.25s ease;
}

.topup-history-item {
  transition: background-color 0.2s;
}

.topup-history-item:hover {
  background: var(--button-hover-bg) !important;
}

/* Modal close button hover */
#withdrawModal button[onclick="closeWithdrawModal()"]:hover,
#topUpModal button[onclick="closeTopUpModal()"]:hover {
  background-color: var(--button-hover-bg) !important;
}

/* SBP Bank Selection Modal */
#sbpBankModal {
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.55);
    align-items: center;
    justify-content: center;
    display: none;
}

#sbpBankModal[style*="display:flex"],
#sbpBankModal.show {
    display: flex !important;
}

#sbpBankModal .sbp-bank-modal-content {
    background: var(--card);
    border-radius: 12px;
    max-width: 400px;
    width: 92vw;
    padding: 28px 24px;
    box-shadow: 0 12px 32px var(--shadow-color);
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: background-color 0.25s ease;
}

#sbpBankModal .sbp-bank-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

#sbpBankModal .sbp-bank-modal-title {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text);
    transition: color 0.25s ease;
}

#sbpBankModal .sbp-bank-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.25s ease;
}

#sbpBankModal .sbp-bank-modal-close:hover {
    background-color: var(--button-hover-bg);
    color: var(--text);
}

#sbpBankModal .sbp-bank-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sbp-bank-btn {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    text-align: left;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.25s ease;
    color: var(--text);
}

.sbp-bank-btn:hover {
    background-color: var(--button-hover-bg);
    border-color: var(--border);
}

.sbp-bank-btn:active {
    background-color: var(--bg-secondary);
}

.add-to-cart-preview {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    max-width: 42px;
    max-height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0;
}

/* Override inline styles for modals */
.topup-modal-content,
.withdraw-modal-content {
    background: var(--card) !important;
    color: var(--text) !important;
}

.topup-modal-content h3,
.withdraw-modal-content h3,
.topup-modal-content h4,
.withdraw-modal-content h4 {
    color: var(--text) !important;
}

.topup-modal-content label,
.withdraw-modal-content label {
    color: var(--text) !important;
}

.topup-modal-content input,
.withdraw-modal-content input,
.topup-modal-content select,
.withdraw-modal-content select {
    background: var(--card) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

.topup-modal-content input::placeholder,
.withdraw-modal-content input::placeholder {
    color: var(--text-muted) !important;
}

.region-tab.active {
    background: var(--card) !important;
    color: var(--text) !important;
}

.region-tab {
    color: var(--text) !important;
}

.topup-history-section {
    border-top: none !important;
}

/* Payment Methods in TopUp Modal */
#topUpModal .payment-section {
    padding-top: 0;
    border-top: none;
}

#topUpModal .payment-section-title {
    margin: 0 0 8px 0;
    padding-top: 7px;
    padding-bottom: 7px;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text);
    transition: color 0.25s ease;
}

#topUpModal .payment-methods-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 0;
}

#topUpModal .payment-method-option {
    display: block;
    cursor: pointer;
    position: relative;
}

#topUpModal .payment-method-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

#topUpModal .payment-method-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-secondary);
    transition: all 0.2s ease;
}

#topUpModal .payment-method-option:hover .payment-method-content {
    border-color: var(--text-secondary);
    background: var(--card);
}

#topUpModal .payment-method-option.is-selected .payment-method-content {
    border-color: var(--text-secondary);
    background: var(--card);
}

#topUpModal .payment-method-logo {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg);
}

#topUpModal .payment-logo-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 8px;
}

#topUpModal .payment-method-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#topUpModal .payment-method-name {
    font-weight: 600;
    font-size: 1em;
    color: var(--text);
    transition: color 0.25s ease;
}

#topUpModal .payment-panels {
    margin-top: -6px;
    min-height: 100px;
}

#topUpModal .payment-panel {
    display: none;
    min-height: 90px;
}

#topUpModal .payment-panel.is-active,
#topUpModal .payment-panel[style*="display:block"] {
    display: block !important;
}

#topUpModal .payment-note {
    margin-top: 12px;
    font-size: 0.85em;
    color: var(--text-muted);
    text-align: center;
    transition: color 0.25s ease;
}

.topup-history-item,
.withdraw-history-item {
    background: var(--bg-secondary) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

.topup-history-item span,
.withdraw-history-item span {
    color: var(--text) !important;
}

.topup-history-item span[style*="color:#666"],
.withdraw-history-item span[style*="color:#666"] {
    color: var(--text-muted) !important;
}

.withdraw-btn-light {
    background: var(--card) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

.sbp-bank-btn {
    background: var(--card) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

#ruSbpCalc,
#ruSbpCalc div {
    color: var(--text) !important;
    min-height: 20px;
    line-height: 1.4;
}

#ruSbpCalc {
    margin-top: 8px !important;
    margin-bottom: 0 !important;
}

#ruSbpStatus {
    color: var(--text-muted) !important;
}

/* Additional modal overrides for inline styles */
.topup-modal-content div[style*="background:#fff"],
.topup-modal-content div[style*="background: #fff"],
.withdraw-modal-content div[style*="background:#fff"],
.withdraw-modal-content div[style*="background: #fff"] {
    background: var(--card) !important;
}

.topup-modal-content div[style*="color:#000"],
.topup-modal-content div[style*="color: #000"],
.topup-modal-content div[style*="color:#666"],
.topup-modal-content div[style*="color: #666"],
.withdraw-modal-content div[style*="color:#000"],
.withdraw-modal-content div[style*="color: #000"],
.withdraw-modal-content div[style*="color:#666"],
.withdraw-modal-content div[style*="color: #666"] {
    color: var(--text) !important;
}

.topup-modal-content div[style*="border"],
.withdraw-modal-content div[style*="border"] {
    border-color: var(--border) !important;
}

.topup-modal-content div[style*="border-top"],
.topup-modal-content div[style*="border-bottom"],
.withdraw-modal-content div[style*="border-top"],
.withdraw-modal-content div[style*="border-bottom"] {
    border-top: none !important;
    border-bottom: none !important;
}

.topup-modal-content button[style*="background:#fff"],
.topup-modal-content button[style*="background: #fff"],
.withdraw-modal-content button[style*="background:#fff"],
.withdraw-modal-content button[style*="background: #fff"] {
    background: var(--card) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

.topup-modal-content button[style*="color:#666"],
.topup-modal-content button[style*="color: #666"],
.withdraw-modal-content button[style*="color:#666"],
.withdraw-modal-content button[style*="color: #666"] {
    color: var(--text) !important;
}

.topup-modal-content div[style*="background:#f4f4f5"],
.topup-modal-content div[style*="background: #f4f4f5"],
.topup-modal-content div[style*="background:#f9f9f9"],
.topup-modal-content div[style*="background: #f9f9f9"],
.withdraw-modal-content div[style*="background:#f9f9f9"],
.withdraw-modal-content div[style*="background: #f9f9f9"],
.topup-modal-content div[style*="background:#fff"],
.topup-modal-content div[style*="background: #fff"],
.withdraw-modal-content div[style*="background:#fff"],
.withdraw-modal-content div[style*="background: #fff"] {
    background: var(--bg-secondary) !important;
}

.topup-modal-content,
.withdraw-modal-content {
    box-shadow: none !important;
}

/* Адаптивные стили для topup modal */
@media (max-width: 768px) {
    #topUpModal > div {
        max-height: 96vh;
        width: 96vw;
        padding: 16px;
    }
}

@media (max-width: 480px) {
    #topUpModal > div {
        max-height: 98vh;
        width: 98vw;
        padding: 12px;
        border-radius: 8px;
    }
}

@media (max-width: 600px) {
    .mobile-menu-item.balance .balance-amount,
    .mobile-menu .balance-amount {
        font-size: 0.9em !important;
        line-height: 1.2;
        font-weight: 500 !important;
    }
}
