/* ForumX profile redesign — spacious premium mobile profile header */

.profile-header.card {
    display: block;
    overflow: hidden;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
    border-radius: 22px;
    background:
        radial-gradient(circle at 82% 55%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 32rem),
        linear-gradient(145deg, color-mix(in srgb, var(--card) 96%, var(--accent) 4%), var(--card));
    box-shadow: 0 22px 60px rgba(0, 0, 0, .16);
}

.profile-header .profile-cover {
    min-height: 260px;
    height: clamp(260px, 29vw, 370px);
    padding: 22px 24px;
    border-radius: 0;
    background-position: center;
    background-size: cover;
    isolation: isolate;
}

.profile-header .profile-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        linear-gradient(180deg, rgba(3, 8, 17, .10) 0%, rgba(3, 8, 17, .05) 44%, rgba(3, 8, 17, .62) 100%),
        linear-gradient(90deg, rgba(3, 8, 17, .20), transparent 58%);
    pointer-events: none;
}

.profile-header .profile-cover::after {
    right: 8%;
    bottom: -110px;
    width: 210px;
    height: 210px;
    border-width: 24px;
    border-color: rgba(255, 255, 255, .045);
    opacity: .55;
}

.profile-cover-label,
.profile-online {
    position: relative;
    z-index: 2;
    min-height: 36px;
    padding: 7px 12px;
    border-color: rgba(255, 255, 255, .20);
    background: rgba(5, 15, 29, .54);
    color: rgba(255, 255, 255, .94);
    font-size: .73rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .16);
}

.profile-online i {
    width: 10px;
    height: 10px;
}

.profile-overview {
    min-height: 0;
    display: grid;
    grid-template-columns: 138px minmax(0, 1fr);
    grid-template-areas:
        "avatar identity"
        "avatar actions";
    align-items: start;
    gap: 13px 24px;
    padding: 24px 28px 24px;
    position: relative;
}

.profile-avatar-wrap {
    grid-area: avatar;
    align-self: start;
    justify-self: start;
    margin-top: -88px;
    position: relative;
    z-index: 3;
}

.profile-avatar-wrap .avatar-xl {
    width: 130px;
    height: 130px;
    object-fit: cover;
    border: 5px solid color-mix(in srgb, var(--card) 96%, var(--accent) 4%);
    border-radius: 24px;
    background: var(--card-2);
    box-shadow:
        0 16px 38px rgba(0, 0, 0, .28),
        0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent),
        0 0 28px color-mix(in srgb, var(--accent) 14%, transparent);
}

.profile-avatar-wrap .avatar-online {
    right: 5px;
    bottom: 5px;
    width: 14px;
    height: 14px;
    border: 4px solid var(--card);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--success) 15%, transparent);
}

.profile-identity {
    grid-area: identity;
    min-width: 0;
    padding-top: 3px;
}

.profile-name-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.profile-name-line h1 {
    flex: 0 0 100%;
    margin: 0;
    color: var(--text-strong);
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    line-height: 1.05;
    letter-spacing: -.035em;
}

.profile-name-line .fx-rank-stack-profile,
.profile-name-line > .role-badge,
.profile-name-line > .profile-penalty-badge {
    margin-top: 3px;
}

.profile-name-line .fx-rank-stack-profile {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

.profile-name-line .fx-rank-stack-profile .fx-rank,
.profile-name-line > .role-badge,
.profile-name-line > .profile-penalty-badge {
    min-height: 36px;
    padding: 7px 12px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
}

.profile-header .profile-handle {
    margin: 8px 0 0;
    font-size: .78rem;
}

.profile-header .profile-status {
    max-width: 720px;
    margin: 10px 0 0;
    border-left-width: 3px;
    border-radius: 0 9px 9px 0;
    padding: 7px 10px;
    font-size: .76rem;
}

.profile-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 17px;
    color: var(--muted);
}

.profile-meta span,
.profile-meta a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 0 13px;
    border-right: 1px solid var(--line);
    color: var(--muted);
    font-size: .76rem;
    white-space: nowrap;
}

.profile-meta > :first-child {
    padding-left: 0;
}

.profile-meta > :last-child {
    border-right: 0;
    padding-right: 0;
}

.profile-meta .forumx-icon {
    width: 16px;
    height: 16px;
    color: var(--accent-strong);
}

.profile-actions {
    grid-area: actions;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    width: min(100%, 560px);
    max-width: none;
    margin-top: 3px;
    justify-content: stretch;
}

.profile-actions form {
    display: contents;
}

.profile-actions .button,
.profile-actions form .button {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    border-radius: 12px;
    padding: 10px 15px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--card-2) 92%, var(--accent) 8%), var(--card-2));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.profile-actions .button:hover {
    border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
    background: color-mix(in srgb, var(--accent) 9%, var(--card-2));
    transform: translateY(-1px);
}

.profile-actions .button .forumx-icon {
    width: 19px;
    height: 19px;
}

.profile-tabs {
    min-height: 84px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 5px;
    overflow: hidden;
    margin: 0 28px 24px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: color-mix(in srgb, var(--card-2) 84%, transparent);
}

.profile-tabs a {
    min-width: 0;
    min-height: 66px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    position: relative;
    padding: 8px 5px 11px;
    border-radius: 11px;
    color: var(--muted);
    font-size: .73rem;
    font-weight: 760;
    text-align: center;
    white-space: nowrap;
}

.profile-tabs a::before {
    content: "";
    width: 21px;
    height: 21px;
    display: block;
    background: currentColor;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
}

.profile-tabs a:nth-child(1)::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a4 4 0 0 1-4 4H8l-5 3V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a4 4 0 0 1-4 4H8l-5 3V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z'/%3E%3C/svg%3E");
}

.profile-tabs a:nth-child(2)::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3Cpath d='M5 21v-2a7 7 0 0 1 14 0v2'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3Cpath d='M5 21v-2a7 7 0 0 1 14 0v2'/%3E%3C/svg%3E");
}

.profile-tabs a:nth-child(3)::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
}

.profile-tabs a:nth-child(4)::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 21h8M12 17v4M7 4h10v4a5 5 0 0 1-10 0z'/%3E%3Cpath d='M7 6H4v2a4 4 0 0 0 4 4M17 6h3v2a4 4 0 0 1-4 4'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 21h8M12 17v4M7 4h10v4a5 5 0 0 1-10 0z'/%3E%3Cpath d='M7 6H4v2a4 4 0 0 0 4 4M17 6h3v2a4 4 0 0 1-4 4'/%3E%3C/svg%3E");
}

.profile-tabs a:hover,
.profile-tabs a.active {
    color: var(--accent-strong);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.profile-tabs a.active::after {
    right: 20%;
    bottom: 0;
    left: 20%;
    height: 3px;
    border-radius: 999px;
    box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 50%, transparent);
}

@media (max-width: 980px) {
    .profile-header .profile-cover {
        min-height: 260px;
        height: 285px;
        padding: 18px;
    }

    .profile-header .profile-cover::after {
        right: 4%;
        bottom: -98px;
        width: 180px;
        height: 180px;
        border-width: 22px;
        opacity: .30;
    }

    .profile-overview {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0 20px 22px;
    }

    .profile-avatar-wrap {
        margin: -72px 0 0 10px;
    }

    .profile-avatar-wrap .avatar-xl {
        width: 122px;
        height: 122px;
        border-radius: 23px;
    }

    .profile-identity {
        margin-top: 18px;
        padding: 0 10px;
    }

    .profile-name-line h1 {
        font-size: clamp(1.8rem, 7vw, 2.3rem);
    }

    .profile-meta {
        margin-top: 16px;
    }

    .profile-actions {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 20px;
        padding: 0 10px;
    }

    .profile-tabs {
        margin: 0 20px 20px;
    }
}

@media (max-width: 620px) {
    .profile-header.card {
        border-radius: 18px;
    }

    .profile-header .profile-cover {
        min-height: 230px;
        height: 250px;
        padding: 14px;
    }

    .profile-cover-label,
    .profile-online {
        min-height: 32px;
        padding: 6px 9px;
        font-size: .66rem;
    }

    .profile-overview {
        padding: 0 14px 18px;
    }

    .profile-avatar-wrap {
        margin: -64px 0 0 8px;
    }

    .profile-avatar-wrap .avatar-xl {
        width: 108px;
        height: 108px;
        border-width: 4px;
        border-radius: 21px;
    }

    .profile-avatar-wrap .avatar-online {
        width: 12px;
        height: 12px;
        border-width: 3px;
    }

    .profile-identity {
        margin-top: 15px;
        padding: 0 8px;
    }

    .profile-name-line {
        gap: 8px;
    }

    .profile-name-line h1 {
        font-size: 1.78rem;
    }

    .profile-name-line .fx-rank-stack-profile .fx-rank,
    .profile-name-line > .role-badge,
    .profile-name-line > .profile-penalty-badge {
        min-height: 33px;
        padding: 6px 10px;
        border-radius: 11px;
    }

    .profile-meta {
        gap: 7px 0;
    }

    .profile-meta span,
    .profile-meta a {
        min-height: 27px;
        padding: 0 9px;
        font-size: .69rem;
    }

    .profile-meta > :first-child {
        padding-left: 0;
    }

    .profile-meta > :last-child {
        flex-basis: 100%;
        width: 100%;
        border-right: 0;
        padding-left: 0;
    }

    .profile-actions {
        gap: 8px;
        margin-top: 17px;
        padding: 0 8px;
    }

    .profile-actions .button,
    .profile-actions form .button {
        min-height: 45px;
        padding: 8px 9px;
        border-radius: 11px;
        font-size: .76rem;
    }

    .profile-actions .button .forumx-icon {
        width: 17px;
        height: 17px;
    }

    .profile-tabs {
        min-height: 76px;
        gap: 3px;
        margin: 0 14px 16px;
        padding: 6px;
        border-radius: 13px;
    }

    .profile-tabs a {
        min-height: 62px;
        gap: 6px;
        padding: 7px 2px 10px;
        border-radius: 9px;
        font-size: .65rem;
    }

    .profile-tabs a::before {
        width: 19px;
        height: 19px;
    }
}

@media (max-width: 370px) {
    .profile-header .profile-cover {
        min-height: 210px;
        height: 225px;
    }

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

    .profile-tabs {
        overflow-x: auto;
        grid-template-columns: repeat(4, minmax(76px, 1fr));
    }
}

/* ForumX profile mobile alignment hotfix — 2026-08-02 */
@media (max-width: 620px) {
    .profile-header .profile-cover::after {
        right: -34px;
        bottom: -78px;
        width: 150px;
        height: 150px;
        border-width: 18px;
        opacity: .18;
    }

    .profile-overview {
        display: block;
        padding: 0 18px 18px;
    }

    .profile-avatar-wrap {
        display: block;
        width: max-content;
        margin: -64px 0 0 8px;
    }

    .profile-identity {
        width: 100%;
        margin-top: 16px;
        padding: 0 8px;
        text-align: left;
    }

    .profile-name-line {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        text-align: left;
    }

    .profile-name-line h1 {
        flex: 0 0 100%;
        width: 100%;
        margin: 0;
        text-align: left;
        font-size: 1.78rem;
    }

    .profile-name-line .fx-rank-stack-profile {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 4px;
    }

    .profile-name-line .fx-rank-stack-profile .fx-rank,
    .profile-name-line > .role-badge,
    .profile-name-line > .profile-penalty-badge {
        flex: 0 0 auto;
        margin: 0;
    }

    .profile-header .profile-handle,
    .profile-header .profile-status {
        text-align: left;
    }

    .profile-meta {
        display: grid;
        grid-template-columns: max-content minmax(0, max-content);
        justify-content: start;
        align-items: center;
        column-gap: 0;
        row-gap: 7px;
        width: 100%;
        margin-top: 15px;
        text-align: left;
    }

    .profile-meta span,
    .profile-meta a {
        width: auto;
        min-width: 0;
        justify-content: flex-start;
        text-align: left;
    }

    .profile-meta > :last-child {
        grid-column: 1 / -1;
        width: 100%;
        padding-left: 0;
    }

    .profile-actions {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-top: 17px;
        padding: 0 8px;
    }

    .profile-tabs {
        margin-inline: 14px;
    }
}

@media (max-width: 430px) {
    .profile-overview {
        padding-inline: 14px;
    }

    .profile-avatar-wrap,
    .profile-identity,
    .profile-actions {
        margin-left: 0;
        padding-left: 6px;
        padding-right: 6px;
    }

    .profile-name-line h1 {
        font-size: 1.68rem;
    }

    .profile-name-line .fx-rank-stack-profile .fx-rank,
    .profile-name-line > .role-badge,
    .profile-name-line > .profile-penalty-badge {
        min-height: 31px;
        padding: 5px 9px;
        font-size: .72rem;
    }

    .profile-meta {
        grid-template-columns: max-content minmax(0, 1fr);
    }

    .profile-meta span,
    .profile-meta a {
        padding-inline: 8px;
        font-size: .67rem;
    }

    .profile-meta > :first-child,
    .profile-meta > :last-child {
        padding-left: 0;
    }

    .profile-actions .button,
    .profile-actions form .button {
        min-height: 43px;
        padding: 8px 7px;
        font-size: .72rem;
    }
}

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

/* ForumX profile mobile alignment hotfix v2 — forced override */
@media (max-width: 620px) {
    .profile-header.card .profile-overview {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        width: 100% !important;
        padding: 0 14px 18px !important;
        text-align: left !important;
    }

    .profile-header.card .profile-avatar-wrap {
        align-self: flex-start !important;
        justify-self: auto !important;
        margin: -64px 0 0 28px !important;
        transform: none !important;
    }

    .profile-header.card .profile-identity {
        align-self: stretch !important;
        width: 100% !important;
        max-width: none !important;
        margin: 16px 0 0 !important;
        padding: 0 28px !important;
        text-align: left !important;
        transform: none !important;
    }

    .profile-header.card .profile-name-line {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        justify-items: start !important;
        align-items: start !important;
        width: 100% !important;
        gap: 10px !important;
        margin: 0 !important;
        text-align: left !important;
    }

    .profile-header.card .profile-name-line h1 {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        text-align: left !important;
        justify-self: start !important;
        transform: none !important;
    }

    .profile-header.card .profile-name-line .fx-rank-stack-profile {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        justify-self: start !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 8px !important;
        margin: 0 !important;
        padding: 0 !important;
        text-align: left !important;
        transform: none !important;
    }

    .profile-header.card .profile-name-line .fx-rank-stack-profile .fx-rank,
    .profile-header.card .profile-name-line > .role-badge,
    .profile-header.card .profile-name-line > .profile-penalty-badge {
        flex: 0 1 auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 6px 10px !important;
        font-size: .72rem !important;
        white-space: nowrap !important;
    }

    .profile-header.card .profile-meta {
        display: grid !important;
        grid-template-columns: max-content minmax(0, max-content) !important;
        justify-content: start !important;
        justify-items: start !important;
        align-items: center !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 7px 0 !important;
        margin: 15px 0 0 !important;
        padding: 0 !important;
        text-align: left !important;
        transform: none !important;
    }

    .profile-header.card .profile-meta span,
    .profile-header.card .profile-meta a {
        width: auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        justify-content: flex-start !important;
        padding: 0 9px !important;
        text-align: left !important;
    }

    .profile-header.card .profile-meta > :first-child,
    .profile-header.card .profile-meta > :last-child {
        padding-left: 0 !important;
    }

    .profile-header.card .profile-meta > :last-child {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        border-right: 0 !important;
    }

    .profile-header.card .profile-actions {
        align-self: stretch !important;
        width: auto !important;
        max-width: none !important;
        margin: 17px 28px 0 !important;
        padding: 0 !important;
        transform: none !important;
    }
}

@media (max-width: 390px) {
    .profile-header.card .profile-avatar-wrap {
        margin-left: 18px !important;
    }

    .profile-header.card .profile-identity,
    .profile-header.card .profile-actions {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    .profile-header.card .profile-actions {
        width: 100% !important;
    }
}

/* ForumX profile mobile final polish v3 — compact cover, tighter identity, safe bottom area */
@media (max-width: 620px) {
    .profile-header.card {
        margin-bottom: calc(82px + env(safe-area-inset-bottom)) !important;
    }

    .profile-header.card .profile-cover {
        position: relative !important;
        min-height: 220px !important;
        height: 220px !important;
        padding: 12px !important;
        background-position: center center !important;
    }

    .profile-header.card .profile-cover::after {
        right: -42px !important;
        bottom: -58px !important;
        width: 132px !important;
        height: 132px !important;
        border-width: 16px !important;
        opacity: .12 !important;
    }

    .profile-header.card .profile-cover-label,
    .profile-header.card .profile-online {
        position: absolute !important;
        top: 12px !important;
        z-index: 6 !important;
        display: inline-flex !important;
        align-items: center !important;
        width: auto !important;
        max-width: calc(50% - 18px) !important;
        min-height: 31px !important;
        margin: 0 !important;
        padding: 6px 9px !important;
        font-size: .65rem !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }

    .profile-header.card .profile-cover-label {
        left: 12px !important;
        right: auto !important;
    }

    .profile-header.card .profile-online {
        right: 12px !important;
        left: auto !important;
    }

    .profile-header.card .profile-overview {
        padding: 0 14px 14px !important;
    }

    .profile-header.card .profile-avatar-wrap {
        margin: -78px 0 0 28px !important;
    }

    .profile-header.card .profile-avatar-wrap .avatar-xl {
        width: 104px !important;
        height: 104px !important;
        border-width: 4px !important;
        border-radius: 20px !important;
    }

    .profile-header.card .profile-avatar-wrap .avatar-online {
        right: 3px !important;
        bottom: 3px !important;
        width: 12px !important;
        height: 12px !important;
        border-width: 3px !important;
    }

    .profile-header.card .profile-identity {
        margin-top: 7px !important;
        padding: 0 28px !important;
    }

    .profile-header.card .profile-name-line {
        gap: 7px !important;
    }

    .profile-header.card .profile-name-line h1 {
        font-size: 1.64rem !important;
        line-height: 1.02 !important;
    }

    .profile-header.card .profile-name-line .fx-rank-stack-profile {
        gap: 7px !important;
    }

    .profile-header.card .profile-name-line .fx-rank-stack-profile .fx-rank,
    .profile-header.card .profile-name-line > .role-badge,
    .profile-header.card .profile-name-line > .profile-penalty-badge {
        min-height: 30px !important;
        padding: 5px 9px !important;
        border-radius: 10px !important;
        font-size: .70rem !important;
    }

    .profile-header.card .profile-meta {
        gap: 6px 0 !important;
        margin-top: 12px !important;
    }

    .profile-header.card .profile-meta span,
    .profile-header.card .profile-meta a {
        min-height: 25px !important;
        padding: 0 8px !important;
        font-size: .67rem !important;
    }

    .profile-header.card .profile-meta .forumx-icon {
        width: 15px !important;
        height: 15px !important;
    }

    .profile-header.card .profile-actions {
        gap: 8px !important;
        margin: 13px 28px 0 !important;
    }

    .profile-header.card .profile-actions .button,
    .profile-header.card .profile-actions form .button {
        min-height: 42px !important;
        padding: 8px 8px !important;
        border-radius: 10px !important;
        font-size: .72rem !important;
    }

    .profile-header.card .profile-tabs {
        min-height: 68px !important;
        gap: 3px !important;
        margin: 0 14px 12px !important;
        padding: 5px !important;
        border-radius: 12px !important;
    }

    .profile-header.card .profile-tabs a {
        min-height: 54px !important;
        gap: 4px !important;
        padding: 6px 2px 8px !important;
        border-radius: 8px !important;
        font-size: .62rem !important;
    }

    .profile-header.card .profile-tabs a::before {
        width: 18px !important;
        height: 18px !important;
    }

    .profile-header.card .profile-tabs a.active::after {
        height: 3px !important;
    }
}

@media (max-width: 390px) {
    .profile-header.card .profile-cover {
        min-height: 205px !important;
        height: 205px !important;
    }

    .profile-header.card .profile-cover-label,
    .profile-header.card .profile-online {
        top: 10px !important;
        min-height: 29px !important;
        padding: 5px 8px !important;
        font-size: .62rem !important;
    }

    .profile-header.card .profile-cover-label {
        left: 10px !important;
    }

    .profile-header.card .profile-online {
        right: 10px !important;
    }

    .profile-header.card .profile-avatar-wrap {
        margin-top: -74px !important;
        margin-left: 18px !important;
    }

    .profile-header.card .profile-avatar-wrap .avatar-xl {
        width: 100px !important;
        height: 100px !important;
    }

    .profile-header.card .profile-identity {
        margin-top: 6px !important;
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    .profile-header.card .profile-actions {
        margin: 12px 0 0 !important;
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    .profile-header.card .profile-name-line h1 {
        font-size: 1.58rem !important;
    }

    .profile-header.card .profile-actions .button,
    .profile-header.card .profile-actions form .button {
        font-size: .69rem !important;
    }
}

@media (max-width: 350px) {
    .profile-header.card .profile-actions {
        grid-template-columns: 1fr !important;
    }
}

/* ForumX profile mobile metadata spacing fix v4 */
@media (max-width: 620px) {
    .profile-header.card .profile-meta {
        display: flex !important;
        flex-flow: row wrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        justify-items: start !important;
        column-gap: 10px !important;
        row-gap: 7px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .profile-header.card .profile-meta > span,
    .profile-header.card .profile-meta > a {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 10px 0 0 !important;
        justify-self: start !important;
        justify-content: flex-start !important;
        border-right: 1px solid var(--line) !important;
        white-space: nowrap !important;
    }

    .profile-header.card .profile-meta > :first-child {
        padding-left: 0 !important;
    }

    .profile-header.card .profile-meta > :nth-child(2) {
        margin-left: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        border-right: 0 !important;
    }

    .profile-header.card .profile-meta > :last-child {
        flex: 0 0 100% !important;
        width: 100% !important;
        margin-left: 0 !important;
        padding: 0 !important;
        border-right: 0 !important;
    }
}

/* ForumX profile recent activity cleanup v6 */
#profile-posts {
    overflow: hidden;
}

#profile-posts .profile-posts-heading {
    align-items: center;
    gap: 16px;
    margin-bottom: 6px;
}

#profile-posts .profile-posts-heading h2 {
    margin-bottom: 0;
}

#profile-posts .profile-posts-heading .button {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 9px 13px;
    white-space: nowrap;
}

#profile-posts .profile-activity-list {
    display: grid;
}

#profile-posts .profile-activity-list > .profile-activity-item {
    display: grid !important;
    grid-template-columns: 38px minmax(0, 1fr) 18px;
    align-items: center !important;
    gap: 12px;
    min-width: 0;
    padding: 15px 0 !important;
    border-bottom: 1px solid var(--line);
    transition: background-color .18s ease, transform .18s ease;
}

#profile-posts .profile-activity-list > .profile-activity-item:hover {
    background: color-mix(in srgb, var(--accent) 6%, transparent);
}

#profile-posts .profile-activity-list > .profile-activity-item:last-child {
    border-bottom: 0;
}

#profile-posts .activity-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
    border-radius: 11px;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 13%, var(--card-2));
}

#profile-posts .activity-icon .forumx-icon {
    width: 18px;
    height: 18px;
}

#profile-posts .activity-copy {
    display: grid !important;
    min-width: 0;
    gap: 4px;
    color: inherit;
    white-space: normal !important;
}

#profile-posts .activity-copy strong {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: .96rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap !important;
}

#profile-posts .activity-copy small {
    display: -webkit-box;
    overflow: hidden;
    color: var(--muted);
    font-size: .84rem;
    line-height: 1.45;
    white-space: normal !important;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

#profile-posts .activity-copy time {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    margin-top: 2px;
    color: var(--muted);
    font-size: .75rem;
    line-height: 1.2;
}

#profile-posts .activity-copy time .forumx-icon {
    width: 13px;
    height: 13px;
}

#profile-posts .activity-open {
    display: grid;
    place-items: center;
    color: color-mix(in srgb, var(--muted) 75%, transparent);
}

#profile-posts .activity-open .forumx-icon {
    width: 16px;
    height: 16px;
}

@media (max-width: 620px) {
    #profile-posts {
        padding: 19px 18px 18px !important;
    }

    #profile-posts .profile-posts-heading {
        align-items: flex-start;
        margin-bottom: 12px;
    }

    #profile-posts .profile-posts-heading .button {
        min-height: 38px;
        padding: 8px 11px;
        font-size: .75rem;
    }

    #profile-posts .profile-activity-list > .profile-activity-item {
        grid-template-columns: 34px minmax(0, 1fr) 14px;
        gap: 10px;
        padding: 14px 0 !important;
    }

    #profile-posts .activity-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    #profile-posts .activity-icon .forumx-icon {
        width: 16px;
        height: 16px;
    }

    #profile-posts .activity-copy strong {
        font-size: .90rem;
    }

    #profile-posts .activity-copy small {
        font-size: .78rem;
        line-height: 1.4;
    }

    #profile-posts .activity-copy time {
        font-size: .70rem;
    }

    .profile-layout {
        padding-bottom: 110px;
    }
}

@media (max-width: 390px) {
    #profile-posts .profile-posts-heading {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
    }

    #profile-posts .profile-posts-heading .button {
        padding-inline: 9px;
        font-size: .69rem;
    }
}
