/* Profile stage — controlled reading width on desktop, fluid on smaller screens. */
#view-profile {
    width: min(100%, 1180px);
    margin-inline: auto;
}

#view-profile .profile-shell {
    width: 100%;
    box-shadow: 0 26px 78px rgba(0, 0, 0, .28);
}

#view-profile .profile-cover {
    height: clamp(168px, 14vw, 205px);
    background-position: center;
    background-size: cover;
}

/* Beta profile hub — a compact social backstage, not a generic dashboard. */
.profile-hub {
    width: 100%;
    margin-inline: auto;
    color: var(--jd-text);
}

.profile-hub-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

.profile-hub-card {
    min-width: 0;
    padding: clamp(20px, 2.3vw, 30px);
    overflow: hidden;
    border: 1px solid var(--jd-line);
    border-radius: var(--jd-radius-lg);
    background:
        radial-gradient(circle at 100% 0, rgba(130, 87, 245, .13), transparent 38%),
        linear-gradient(145deg, rgba(26, 30, 49, .97), rgba(15, 18, 31, .97));
    box-shadow: 0 16px 46px rgba(0, 0, 0, .2);
}

.profile-hub-card:nth-child(4n + 2)::before { background: linear-gradient(90deg, var(--jd-pink), var(--jd-yellow)); }
.profile-hub-card:nth-child(4n + 3)::before { background: linear-gradient(90deg, var(--jd-cyan), var(--jd-purple)); }
.profile-hub-card:nth-child(4n + 4)::before { background: linear-gradient(90deg, var(--jd-yellow), var(--jd-pink)); }

.profile-hub-card h2,
.profile-hub-card h3 {
    margin-top: 0;
    color: var(--jd-text);
    letter-spacing: -.035em;
}

.profile-hub-card :where(input, select, textarea) {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--jd-line);
    border-radius: 14px;
    background: rgba(8, 10, 19, .72);
    color: var(--jd-text);
}

.profile-hub-card textarea { min-height: 96px; resize: vertical; }

.profile-hub-card :where(button, .community-open) {
    border-radius: 13px;
    font-weight: 800;
}

.profile-hub-list,
.playlist-song-list,
.community-post-list,
.profile-chat-messages {
    display: grid;
    gap: 10px;
    min-width: 0;
}

:where(.profile-hub-person, .profile-community-row, .profile-playlist-row, .score-submission-row) {
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 16px;
    background: rgba(255, 255, 255, .035);
    transition: border-color .18s ease, transform .18s ease, background .18s ease;
}

:where(.profile-hub-person, .profile-community-row, .profile-playlist-row):hover {
    transform: translateY(-2px);
    border-color: rgba(32, 215, 229, .36);
    background: rgba(32, 215, 229, .055);
}

.profile-hub-avatar {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(32, 215, 229, .5);
    background: var(--jd-surface-raised);
}

.community-detail,
.playlist-settings {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--jd-line);
}

.score-proof-picker {
    border: 1px dashed rgba(32, 215, 229, .5);
    border-radius: 16px;
    background: rgba(32, 215, 229, .045);
}

.profile-chat-messages {
    max-height: 360px;
    overflow: auto;
    overscroll-behavior: contain;
}

#view-profile .people-load-more {
    grid-column: 1 / -1;
    min-height: 46px;
    border: 1px solid rgba(32, 215, 229, .22);
    border-radius: 14px;
    background: rgba(32, 215, 229, .07);
    color: #c8f8ff;
    cursor: pointer;
    font-weight: 850;
}
#view-profile .people-load-more span {
    display: inline-grid;
    min-width: 24px;
    height: 24px;
    margin-left: 7px;
    padding-inline: 6px;
    place-items: center;
    border-radius: 8px;
    background: rgba(255,255,255,.08);
    font-size: .68rem;
}

@media (max-width: 900px) {
    .profile-hub-grid { grid-template-columns: 1fr; }
}

@media (min-width: 1181px) {
    #view-profile .profile-body { padding-inline: 34px; }
    #view-profile .profile-header { margin-inline: 34px; }
}

@media (max-width: 560px) {
    .profile-hub-grid { gap: 14px; }
    .profile-hub-card { padding: 18px 15px; }
    #view-profile .profile-community { padding: 17px 14px; border-radius: 20px; }
    #view-profile .profile-community-intro { gap: 14px; }
    #view-profile .compact-search { width: 100%; max-width: none; }
    #view-profile .person-card { grid-template-columns: 44px minmax(0,1fr); min-width: 0; padding: 12px; }
    #view-profile .person-avatar { width: 44px; height: 44px; }
    #view-profile .person-action { grid-column: 1 / -1; width: 100%; }
}
