/* === Profile page module === */
.profile-headline {
    margin-bottom: 22px;
}

.profile-stack--compact {
    width: min(100%, 760px);
    margin: 0 auto;
    gap: 16px;
}

.profile-toast {
    width: min(100%, 760px);
    margin: 0 auto 14px;
    padding: 13px 16px;
    border: 1px solid rgba(34, 197, 94, .22);
    border-radius: 18px;
    color: #166534;
    background: rgba(240, 253, 244, .92);
    font-weight: 800;
}

.profile-toast--error {
    color: #b91c1c;
    border-color: rgba(239, 68, 68, .22);
    background: rgba(254, 242, 242, .92);
}

.profile-card--clickless,
.profile-action-card,
.profile-split-card {
    width: 100%;
}

.profile-card--clickless {
    cursor: default;
}

.profile-main-data {
    min-width: 0;
}

.profile-split-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 0;
    overflow: hidden;
}

.profile-split-item {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    min-height: 116px;
    padding: 24px;
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.profile-split-item + .profile-split-item {
    border-left: 1px solid rgba(226, 232, 240, .92);
}

.profile-split-item strong {
    display: block;
    margin-top: 4px;
    color: var(--app-navy, #081535);
    font-size: 23px;
    line-height: 1.1;
    letter-spacing: -.04em;
}

.profile-split-item small {
    display: block;
    margin-top: 7px;
    color: var(--app-muted, #717b93);
    font-size: 13px;
    font-weight: 700;
}

.profile-split-item[data-locked="true"] {
    cursor: default;
}

.profile-soft-icon--blue {
    color: #1264ff;
    background: #eef4ff;
}

.profile-action-card {
    border: 1px solid rgba(213, 221, 237, .86);
    text-align: left;
    cursor: pointer;
}

.profile-action-card:hover,
.profile-split-item:hover {
    transform: translateY(-1px);
}

.profile-action-card p {
    margin-top: 10px;
    font-size: 14px;
}

.copy-line--static {
    width: 100%;
}

.copy-line--static .copy-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 54px;
    color: #667085;
    font-size: 22px;
}

.profile-modal {
    position: fixed;
    z-index: 90;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.profile-modal.is-open {
    display: flex;
}

.profile-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 21, 53, .38);
    backdrop-filter: blur(10px);
}

.profile-modal__panel {
    position: relative;
    z-index: 2;
    width: min(100%, 860px);
    max-height: min(86vh, 860px);
    overflow: auto;
    padding: 28px;
    border: 1px solid rgba(221, 228, 241, .96);
    border-radius: 30px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 30px 90px rgba(8, 21, 53, .22);
}

.profile-modal__panel--small {
    width: min(100%, 520px);
}

.profile-modal__panel h2 {
    margin: 0;
    color: var(--app-navy, #081535);
    font-size: 34px;
    line-height: 1;
    letter-spacing: -.06em;
}

.profile-modal__panel h3 {
    margin: 0 0 16px;
    color: var(--app-navy, #081535);
    font-size: 19px;
}

.profile-modal__panel h4 {
    margin: 0 0 10px;
    color: var(--app-navy, #081535);
    font-size: 15px;
}

.profile-modal__panel p {
    margin: 10px 0 0;
    color: var(--app-muted, #717b93);
    line-height: 1.5;
}

.profile-modal__close {
    position: absolute;
    top: 18px;
    right: 18px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 16px;
    color: #667085;
    background: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.profile-input {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid #dfe6f2;
    border-radius: 16px;
    color: var(--app-navy, #081535);
    background: #fff;
    font: inherit;
    font-weight: 700;
    outline: none;
}

.profile-input:focus {
    border-color: rgba(18, 100, 255, .72);
    box-shadow: 0 0 0 4px rgba(18, 100, 255, .1);
}

.profile-textarea {
    min-height: 120px;
    padding-top: 14px;
    resize: vertical;
}

.city-search {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.city-results {
    display: grid;
    gap: 8px;
}

.city-result-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid #e4eaf5;
    border-radius: 16px;
    color: var(--app-navy, #081535);
    background: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.city-result-btn span {
    color: var(--app-blue, #1264ff);
    font-size: 13px;
}

.profile-note {
    margin-top: 22px;
    padding: 15px;
    border-radius: 18px;
    background: #f7f9fe;
    color: #667085;
    font-weight: 800;
}

.profile-note--locked {
    color: #b45309;
    background: #fffbeb;
}

.gender-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 22px;
}

.gender-choice {
    width: 100%;
    min-height: 78px;
    border: 1px solid #dfe6f2;
    border-radius: 22px;
    color: var(--app-blue, #1264ff);
    background: #f8fbff;
    font: inherit;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
}

.modal-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 22px;
}

.modal-balance-value {
    flex: 0 0 auto;
    padding: 13px 16px;
    border-radius: 18px;
    color: var(--app-blue, #1264ff);
    background: #eef4ff;
    font-size: 23px;
    font-weight: 900;
    letter-spacing: -.05em;
}

.withdraw-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
    gap: 16px;
    align-items: start;
}

.withdraw-form,
.withdraw-status-card,
.withdraw-history {
    border: 1px solid #e4eaf5;
    border-radius: 22px;
    background: #fff;
}

.withdraw-form {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.withdraw-form label {
    display: grid;
    gap: 8px;
    color: var(--app-navy, #081535);
    font-size: 14px;
    font-weight: 900;
}

.profile-primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    border: 0;
    border-radius: 17px;
    color: #fff;
    background: linear-gradient(135deg, #1e7bff, #0757f4);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 15px 34px rgba(18, 100, 255, .24);
}

.withdraw-statuses {
    display: grid;
    gap: 10px;
}

.withdraw-status-card {
    display: grid;
    gap: 5px;
    padding: 16px;
}

.withdraw-status-card b {
    color: #667085;
    font-size: 13px;
}

.withdraw-status-card strong {
    color: var(--app-navy, #081535);
    font-size: 28px;
    line-height: 1;
    letter-spacing: -.06em;
}

.withdraw-status-card span {
    color: var(--app-blue, #1264ff);
    font-weight: 900;
}

.withdraw-status-card--bad span {
    color: #ef4444;
}

.withdraw-history {
    margin-top: 16px;
    padding: 18px;
}

.withdraw-history-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.withdraw-row,
.withdraw-empty {
    display: grid;
    gap: 5px;
    padding: 12px;
    border-radius: 16px;
    background: #f8fbff;
    margin-bottom: 8px;
}

.withdraw-row b {
    color: var(--app-navy, #081535);
    font-size: 13px;
}

.withdraw-row span,
.withdraw-empty {
    color: #667085;
    font-size: 12px;
    line-height: 1.4;
}

.withdraw-row--bad {
    background: #fff7f7;
}

.referral-level-card,
.referral-stats-grid {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.referral-level-card {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.referral-level-card div,
.referral-stats-grid div {
    display: grid;
    gap: 7px;
    padding: 16px;
    border: 1px solid #e4eaf5;
    border-radius: 20px;
    background: #fff;
}

.referral-level-card span,
.referral-stats-grid span {
    color: #667085;
    font-size: 13px;
    font-weight: 800;
}

.referral-level-card strong,
.referral-stats-grid b {
    color: var(--app-navy, #081535);
    font-size: 18px;
    line-height: 1.1;
}

.referral-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.copy-line--modal {
    margin-top: 18px;
}

.copy-line--modal button {
    flex: 0 0 auto;
    min-width: 132px;
    border: 0;
    color: #fff;
    background: var(--app-blue, #1264ff);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

@media (max-width: 760px) {
    .profile-stack--compact,
    .profile-toast {
        width: 100%;
    }

    .profile-split-card,
    .withdraw-grid,
    .withdraw-history-grid,
    .referral-level-card,
    .referral-stats-grid {
        grid-template-columns: 1fr;
    }

    .profile-split-item + .profile-split-item {
        border-left: 0;
        border-top: 1px solid rgba(226, 232, 240, .92);
    }

    .profile-split-item {
        min-height: 102px;
        padding: 20px;
    }

    .profile-split-item strong {
        font-size: 21px;
    }

    .profile-modal {
        align-items: flex-end;
        padding: 0;
    }

    .profile-modal__panel,
    .profile-modal__panel--small {
        width: 100%;
        max-height: 88vh;
        padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
        border-radius: 28px 28px 0 0;
    }

    .profile-modal__panel h2 {
        font-size: 30px;
    }

    .gender-actions,
    .modal-title-row {
        grid-template-columns: 1fr;
        display: grid;
    }

    .modal-balance-value {
        width: max-content;
    }
}

@media (max-width: 420px) {
    .profile-card--user {
        grid-template-columns: auto minmax(0, 1fr);
        padding: 18px;
    }

    .profile-avatar {
        width: 76px;
        height: 76px;
    }

    .profile-title {
        font-size: 25px;
    }

    .profile-split-item {
        gap: 12px;
    }
}
