.profile-page-container {
    width: min(1440px, calc(100% - 2rem));
}

.public-profile-layout {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr) 210px;
    gap: clamp(0.75rem, 1.4vw, 1.25rem);
    align-items: stretch;
}

.public-profile-layout > .card {
    min-width: 0;
    padding: 0.85rem;
}

.profile-sidebar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    overflow-wrap: anywhere;
    overflow-y: auto;
}

.profile-identity-line {
    margin: 0;
    color: var(--brand);
    max-width: 100%;
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.045em;
}

.public-profile-photo {
    display: grid;
    width: 96px;
    height: 128px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 4px;
    object-fit: cover;
    background: #e8eef4;
    box-shadow: 0 8px 24px rgba(19, 36, 58, 0.11);
}

.profile-photo-placeholder {
    color: var(--muted);
    font-size: 1.6rem;
    font-weight: 850;
}

.profile-presence {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.78rem;
}

.presence-dot {
    width: 0.7rem;
    height: 0.7rem;
    flex: 0 0 auto;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(19, 36, 58, 0.06);
}

.profile-presence-online .presence-dot {
    background: #20a464;
}

.profile-presence-online strong {
    color: #18794e;
}

.profile-presence-offline .presence-dot {
    background: #d92d20;
}

.profile-presence-offline strong {
    color: var(--danger);
}

.profile-activity-dates {
    width: 100%;
    margin: 0;
}

.profile-activity-dates div {
    display: grid;
    gap: 0.05rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--line);
}

.profile-activity-dates dt,
.profile-activity-dates dd {
    min-width: 0;
    font-size: 0.7rem;
    overflow-wrap: anywhere;
}

.profile-activity-dates dt {
    color: var(--muted);
    text-transform: none;
}

.profile-activity-dates dd {
    font-weight: 750;
}

.profile-interest-box {
    width: 100%;
    margin-top: 0.2rem;
    padding: 0.65rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--paper);
}

.profile-interest-box h2,
.profile-feed h2,
.profile-friends h2 {
    margin: 0 0 0.6rem;
    font-size: 0.88rem;
}

.profile-interest-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.profile-interest-list li {
    max-width: 100%;
    padding: 0.22rem 0.42rem;
    border: 1px solid rgba(17, 100, 102, 0.22);
    border-radius: 999px;
    color: var(--brand);
    background: rgba(17, 100, 102, 0.07);
    font-size: 0.68rem;
    overflow-wrap: anywhere;
    font-weight: 750;
}

.profile-empty-text,
.profile-column-placeholder p {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.profile-action {
    width: 100%;
    margin-top: 0.2rem;
}

.profile-sidebar,
.profile-feed,
.profile-friends {
    height: 560px;
    min-height: 560px;
}

.profile-feed {
    overflow-y: auto;
}

.profile-friends {
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.profile-column-placeholder {
    display: grid;
    min-height: 450px;
    place-items: center;
    padding: 1rem;
    border: 1px dashed var(--line);
    border-radius: 4px;
    text-align: center;
    background: linear-gradient(145deg, rgba(244, 247, 251, 0.7), rgba(234, 244, 245, 0.65));
}

@media (max-width: 980px) {
    .public-profile-layout {
        grid-template-columns: 190px minmax(0, 1fr);
    }

    .profile-friends {
        grid-column: 1 / -1;
        width: 100%;
    }

    .profile-friends .profile-column-placeholder {
        min-height: 190px;
    }
}

@media (max-width: 680px) {
    .profile-page-container {
        width: min(100% - 1rem, 1440px);
    }

    .public-profile-layout {
        grid-template-columns: 1fr;
    }

    .profile-friends {
        grid-column: auto;
    }

    .profile-feed,
    .profile-friends,
    .profile-sidebar {
        height: auto;
        min-height: 300px;
    }

    .profile-column-placeholder {
        min-height: 210px;
    }
}

.public-profile-friends-list {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.public-profile-friends-list a {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 9px;
    gap: 0.48rem;
    align-items: center;
    padding: 0.38rem;
    border: 1px solid transparent;
    color: var(--ink);
    text-decoration: none;
}

.public-profile-friends-list a:hover,
.public-profile-friends-list a:focus-visible {
    border-color: var(--line);
    background: var(--paper);
}

.public-profile-friends-list img,
.public-friend-photo-placeholder {
    display: grid;
    width: 30px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 2px;
    object-fit: cover;
    color: var(--muted);
    background: #e8eef4;
    font-size: 0.7rem;
    font-weight: 850;
}

.public-friend-name {
    min-width: 0;
    overflow: hidden;
    font-size: 0.72rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.public-friend-status {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.public-friend-status-online {
    background: #20a464;
}

.public-friend-status-offline {
    background: #d92d20;
}
