:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --bg: #d5efe8;
    --text: #1a2730;
    --muted: #6c7c84;
    --accent: #ff6f5a;
    --accent-deep: #f05f47;
    --accent-soft: rgba(255, 111, 90, 0.12);
    --accent-soft-strong: rgba(255, 111, 90, 0.18);
    --card: rgba(255, 255, 255, 0.82);
    --card-strong: rgba(255, 255, 255, 0.94);
    --stroke: rgba(160, 200, 190, 0.62);
    --shadow: 0 18px 40px rgba(24, 39, 48, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.4), transparent 35%),
        var(--bg);
    color: var(--text);
}

.page-profile {
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
}

.profile-screen {
    --pavilla-shell-pad-x: clamp(1rem, 5vw, 2.6rem);
    width: min(100%, 860px);
    min-height: 100dvh;
    margin: 0 auto;
    padding: calc(clamp(1.2rem, 3vh, 1.9rem) + 3.5rem) var(--pavilla-shell-pad-x) 1.55rem;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: clamp(1rem, 2.8vh, 1.6rem);
}

.profile-top {
    color: var(--text);
}

.profile-nav-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-nav-group-start {
    justify-self: start;
}

.profile-nav-group-end {
    justify-self: end;
}

.profile-icon {
    width: clamp(26px, 7vw, 36px);
    height: auto;
}

.profile-icon.is-active {
    width: clamp(34px, 9vw, 44px);
}

.profile-notifications-link .profile-icon {
    filter: brightness(0) saturate(100%) invert(68%) sepia(64%) saturate(4642%) hue-rotate(321deg) brightness(103%) contrast(102%);
    margin-left: 0.35rem;
}

.profile-message-link .profile-icon {
    filter: brightness(0) saturate(100%) invert(68%) sepia(64%) saturate(4642%) hue-rotate(321deg) brightness(103%) contrast(102%);
}

.profile-message-link,
.profile-notifications-link,
.profile-explore-link,
.profile-profile-link {
    display: inline-flex;
}

.profile-center {
    justify-self: center;
    display: grid;
    justify-items: center;
    gap: 0.2rem;
}

.profile-title {
    justify-self: center;
    text-align: center;
    font-size: clamp(1.2rem, 4.2vw, 1.9rem);
    font-weight: 800;
    letter-spacing: 0.02em;
}

.profile-explore {
    width: clamp(30px, 7.8vw, 46px);
    height: auto;
    filter: drop-shadow(0 6px 12px rgba(25, 25, 40, 0.2));
    opacity: 0.88;
    margin-right: 0.35rem;
}

.profile-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.46rem;
}

.profile-menu-wrap {
    position: relative;
}

.profile-back,
.profile-menu {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid rgba(160, 200, 190, 0.34);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(245, 251, 249, 0.88));
    color: var(--accent);
    font-size: 0.86rem;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(24, 39, 48, 0.05);
}

.profile-progress {
    display: grid;
    gap: 0.24rem;
    padding: 0.5rem 0.68rem 0.52rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(160, 200, 190, 0.42);
    box-shadow: 0 4px 10px rgba(24, 39, 48, 0.04);
}

.profile-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
}

.profile-progress-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 23px;
    padding: 0.16rem 0.56rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 111, 90, 0.16);
    background: rgba(255, 111, 90, 0.12);
    color: var(--accent);
    font-size: 0.64rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.profile-progress-link.is-disabled {
    color: var(--muted);
    pointer-events: none;
}

.profile-progress-track {
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: rgba(140, 185, 175, 0.3);
    overflow: hidden;
}

.profile-progress-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff8762, #ffb04d);
    transition: width 220ms ease;
}

.profile-progress-text {
    font-size: clamp(0.7rem, 1.9vw, 0.8rem);
    color: var(--text);
    font-weight: 800;
}

.profile-progress-subtext {
    font-size: 0.62rem;
    color: var(--muted);
    line-height: 1.2;
}

.profile-menu-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    border: 1px solid var(--stroke);
    border-radius: 16px;
    padding: 0.45rem;
    min-width: 180px;
    box-shadow: 0 18px 32px rgba(24, 39, 48, 0.14);
    display: none;
    z-index: 10;
}

.profile-menu-dropdown.is-open {
    display: grid;
    gap: 0.25rem;
}

.profile-menu-item {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 0.5rem 0.7rem;
    border-radius: 10px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
}

.profile-menu-item:hover {
    background: rgba(255, 111, 90, 0.12);
}

.profile-menu-logout {
    color: #c43c2a;
}

.profile-card {
    background: var(--card);
    border-radius: 32px;
    padding: clamp(1.25rem, 3.5vw, 2rem);
    border: 1px solid var(--stroke);
    box-shadow: 0 4px 16px rgba(24, 39, 48, 0.07);
    display: grid;
    gap: 1.22rem;
}

.profile-echo-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(160, 200, 190, 0.36);
}

.profile-echo-copy {
    display: grid;
    gap: 0.28rem;
}

.profile-echo-copy strong {
    font-size: 0.95rem;
    letter-spacing: 0.08em;
}

.profile-echo-copy span {
    color: var(--muted);
    font-size: 0.82rem;
}

.profile-echo-actions {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.profile-photo {
    width: clamp(130px, 36vw, 170px);
    height: clamp(130px, 36vw, 170px);
    margin: 0 auto;
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(255, 111, 90, 0.2), rgba(255, 176, 77, 0.28));
    box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.55);
}

.profile-photo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.profile-photo.has-image .profile-photo-image {
    display: block;
}

.profile-photo.has-image .profile-photo-initials {
    display: none;
}

.profile-photo-initials {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: clamp(2rem, 8vw, 3.1rem);
    font-weight: 800;
    color: rgba(26, 39, 48, 0.78);
    letter-spacing: 0.06em;
}

.profile-name {
    display: grid;
    gap: 0.35rem;
    justify-items: center;
    text-align: center;
}

.profile-name h2 {
    font-size: clamp(1.35rem, 4.4vw, 1.72rem);
    font-weight: 800;
    line-height: 1.15;
}

.profile-verify-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0.28rem 0.72rem;
    border-radius: 999px;
    background: rgba(26, 39, 48, 0.08);
    color: #52626a;
    font-size: 0.78rem;
    font-weight: 800;
}

.profile-verify-badge.is-verified {
    background: rgba(66, 211, 160, 0.16);
    color: #2a5f52;
}

.profile-subline {
    color: var(--muted);
    font-size: clamp(0.86rem, 2.6vw, 1rem);
    font-weight: 600;
}

.profile-trust-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
}

.profile-trust-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0.22rem 0.66rem;
    border-radius: 999px;
    background: rgba(26, 39, 48, 0.06);
    color: #53646c;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}

.profile-trust-chip.tone-strong {
    background: rgba(66, 211, 160, 0.16);
    color: #2a5f52;
}

.profile-trust-chip.tone-steady {
    background: rgba(255, 122, 96, 0.12);
    color: #9f4838;
}

.profile-subline-sep {
    display: inline-block;
    margin: 0 0.28rem;
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
}

.profile-social-links {
    justify-self: center;
    margin-top: 0.12rem;
    margin-bottom: 0.1rem;
}

.profile-likes-card {
    display: grid;
    justify-items: center;
    gap: 0.4rem;
    padding: 0.95rem 0.9rem 0.9rem;
    text-align: center;
    position: relative;
    border-radius: 24px;
    background:
        radial-gradient(circle at top, rgba(255, 111, 90, 0.12), transparent 42%),
        linear-gradient(180deg, rgba(255, 250, 248, 0.96), rgba(255, 255, 255, 0.82));
    border: 1px solid rgba(255, 111, 90, 0.14);
    box-shadow: 0 16px 32px rgba(24, 39, 48, 0.06);
    overflow: hidden;
}

.profile-like-heart-wrap {
    position: relative;
    width: 78px;
    height: 78px;
    display: inline-grid;
    place-items: center;
}

.profile-like-heart-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 14px 22px rgba(255, 111, 90, 0.24));
}

.profile-like-heart-count {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding-top: 0.08rem;
    color: #fff;
    font-size: 1rem;
    font-weight: 900;
    text-shadow: 0 2px 6px rgba(24, 39, 48, 0.22);
}

.profile-like-heart-count.is-animating {
    animation: profile-like-count-pop 420ms ease;
}

.profile-likes-faces {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(160, 200, 190, 0.24);
}

.profile-likes-face {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 1.5px solid rgba(255, 255, 255, 0.92);
    background: linear-gradient(135deg, rgba(255, 122, 96, 0.94), rgba(255, 176, 160, 0.92));
    box-shadow: 0 4px 10px rgba(24, 39, 48, 0.1);
    margin-left: -4px;
}

.profile-likes-face:first-child {
    margin-left: 0;
}

.profile-likes-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
}

.profile-likes-subtitle {
    max-width: 26ch;
    font-size: 0.78rem;
    line-height: 1.45;
    font-weight: 400;
    color: var(--muted);
}

.profile-likes-private-note {
    font-size: 0.72rem;
    line-height: 1.4;
    color: var(--muted);
}

@keyframes profile-like-count-pop {
    0% {
        transform: scale(0.82);
        opacity: 0.72;
    }
    55% {
        transform: scale(1.14);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.profile-edit {
    border: 1px solid rgba(255, 111, 90, 0.38);
    background: rgba(255, 255, 255, 0.82);
    color: var(--accent);
    font-weight: 700;
    border-radius: 999px;
    padding: 0.58rem 1.04rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.profile-action-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 20px rgba(240, 95, 71, 0.24);
}

.profile-action-secondary {
    min-width: 126px;
}

.profile-section {
    display: grid;
    gap: 0.7rem;
    padding: 0.1rem 0;
}

.profile-section-head {
    display: grid;
    gap: 0;
}

.profile-section-title {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(26, 39, 48, 0.55);
}

.profile-section-hint {
    font-size: 0.82rem;
    color: var(--muted);
}

.profile-bio {
    background: var(--card-strong);
    border-radius: 20px;
    padding: 0.98rem 1.05rem;
    color: #50616a;
    font-size: clamp(0.86rem, 2.8vw, 0.98rem);
    line-height: 1.45;
    border: 1px solid rgba(160, 200, 190, 0.28);
}

.profile-bio.is-empty,
.meta-card.is-empty,
.profile-interests.is-empty {
    border-style: dashed;
    border-color: rgba(255, 111, 90, 0.28);
    background: rgba(255, 255, 255, 0.66);
}

.profile-empty-copy {
    color: rgba(79, 95, 103, 0.92);
}

.profile-empty-link {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

body.theme-super-admin .profile-bio {
    color: rgba(238, 246, 241, 0.86);
    border-color: rgba(160, 200, 190, 0.18);
}

body.theme-super-admin .profile-bio.is-empty,
body.theme-super-admin .meta-card.is-empty,
body.theme-super-admin .profile-interests.is-empty {
    background: rgba(15, 24, 31, 0.84);
    border-color: rgba(255, 122, 96, 0.26);
}

body.theme-super-admin .profile-empty-copy {
    color: rgba(238, 246, 241, 0.78);
}

body.theme-super-admin .profile-empty-link {
    color: #ff9b85;
}

.profile-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
}

.meta-card {
    min-height: 88px;
    border-radius: 18px;
    padding: 0.9rem 0.85rem;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(160, 200, 190, 0.42);
    display: grid;
    align-content: start;
    gap: 0.45rem;
}

.meta-card span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.meta-card strong {
    font-size: 1rem;
    line-height: 1.3;
}

.meta-card strong .profile-empty-link {
    display: inline;
}

@media (hover: hover) and (pointer: fine) {
    .profile-edit:hover,
    .profile-menu-item:hover {
        transform: translateY(-1px);
    }

    .profile-action-primary:hover {
        box-shadow: 0 14px 24px rgba(240, 95, 71, 0.24);
    }
}

.profile-interests {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.profile-interests .interest-chip {
    border-radius: 999px;
    padding: 0.42rem 0.82rem;
    background: #fff;
    border: 1px solid rgba(145, 188, 178, 0.58);
    font-size: clamp(0.72rem, 2.4vw, 0.9rem);
    font-weight: 600;
    color: #3b4a52;
}

.profile-interests .interest-chip.is-hidden {
    display: none;
}

.profile-interests-toggle {
    justify-self: start;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
    font-size: 0.86rem;
}

.profile-posts-list {
    display: grid;
    gap: 0.62rem;
}

.profile-feed-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-bottom: 1px solid rgba(160, 200, 190, 0.34);
    background: rgba(255, 255, 255, 0.42);
    border-radius: 18px 18px 0 0;
    overflow: hidden;
}

.profile-feed-tab {
    min-height: 44px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
}

.profile-feed-tab.is-active {
    border-bottom-color: var(--accent);
    color: var(--text);
    background: rgba(255, 255, 255, 0.54);
}

.profile-post-card,
.profile-post-empty {
    display: grid;
    gap: 0.52rem;
    padding: 0.92rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(160, 200, 190, 0.34);
    color: var(--text);
    text-decoration: none;
}

.profile-post-card {
    padding: 0.86rem 0.92rem;
}

.profile-post-card:active {
    transform: scale(0.99);
}

.profile-post-card-head,
.profile-post-card-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.profile-post-card-head {
    align-items: flex-start;
    text-transform: none;
    letter-spacing: 0;
}

.profile-post-card-author,
.profile-post-card-link {
    color: inherit;
    text-decoration: none;
}

.profile-post-card-author {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 0.55rem;
}

.profile-post-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(255, 111, 90, 0.2), rgba(255, 176, 77, 0.26));
    color: #31434c;
    font-size: 0.72rem;
    font-weight: 900;
}

.profile-post-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.profile-post-card-author-copy {
    display: grid;
    min-width: 0;
    gap: 0.08rem;
}

.profile-post-card-author-copy strong {
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-post-card-author-copy small {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.profile-post-delete {
    min-height: 30px;
    padding: 0.28rem 0.62rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 111, 90, 0.38);
    background: rgba(255, 255, 255, 0.78);
    color: var(--accent);
    font: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.profile-post-delete:disabled {
    opacity: 0.62;
    cursor: wait;
}

.profile-post-card-link {
    display: grid;
    gap: 0.52rem;
}

.profile-post-card-body {
    color: #334750;
    font-size: 0.92rem;
    line-height: 1.42;
    overflow-wrap: anywhere;
}

.profile-post-card-body.is-empty,
.profile-post-empty {
    color: var(--muted);
}

.profile-post-card-image {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid rgba(160, 200, 190, 0.28);
}

.profile-toast {
    position: fixed;
    left: 50%;
    bottom: 1.2rem;
    transform: translate(-50%, 12px);
    background: rgba(26, 39, 48, 0.78);
    color: #fff;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
    z-index: 1000;
}

.profile-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.profile-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    z-index: 30;
}

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

.profile-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 33, 38, 0.42);
    backdrop-filter: blur(3px);
}

.profile-modal-card {
    position: relative;
    z-index: 1;
    width: min(100%, 380px);
    display: grid;
    justify-items: center;
    gap: 0.85rem;
    padding: 1.5rem 1.2rem 1.2rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(160, 200, 190, 0.55);
    box-shadow: 0 24px 48px rgba(24, 39, 48, 0.18);
    text-align: center;
}

.profile-modal-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(255, 111, 90, 0.18), rgba(255, 176, 77, 0.22));
    color: var(--accent);
    font-size: 1.75rem;
    font-weight: 800;
    box-shadow: inset 0 0 0 1px rgba(255, 111, 90, 0.1), 0 14px 24px rgba(24, 39, 48, 0.08);
}

.profile-modal-title {
    font-size: clamp(1.05rem, 4vw, 1.3rem);
    font-weight: 800;
    line-height: 1.2;
}

.profile-modal-copy {
    max-width: 28ch;
    font-size: 0.92rem;
    color: var(--muted);
    line-height: 1.4;
}

.profile-modal-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.profile-modal-cancel,
.profile-modal-confirm {
    border: 0;
    border-radius: 14px;
    padding: 0.72rem 1rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.profile-modal-cancel {
    background: rgba(26, 39, 48, 0.06);
    color: #495962;
    box-shadow: inset 0 0 0 1px rgba(160, 200, 190, 0.22);
}

.profile-modal-confirm {
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    color: #fff8f5;
    box-shadow: 0 14px 22px rgba(255, 111, 90, 0.24);
}

.profile-credit {
    text-align: center;
    color: rgba(255, 113, 94, 0.85);
    font-size: clamp(0.72rem, 2vw, 0.9rem);
}

@media (min-width: 1024px) {
    .profile-screen {
        width: min(100%, 1200px);
        padding: calc(clamp(1.4rem, 3vh, 2.2rem) + 3.8rem) clamp(2rem, 7vw, 4rem) 1.4rem;
    }

    .profile-card {
        padding: clamp(1.4rem, 2.2vw, 2.2rem);
    }
}

@media (max-width: 640px) {
    .profile-screen {
        gap: 0.9rem;
        padding:
            calc(clamp(1rem, 3vh, 1.25rem) + 3rem)
            0.95rem
            1rem;
    }

    .profile-top {
        gap: 0.55rem;
        padding: 0.52rem 0.95rem;
    }

    .profile-nav-group {
        gap: 0.8rem;
    }

    .profile-title {
        font-size: 1.55rem;
    }

    .profile-head {
        gap: 0.42rem;
    }

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

    .profile-card {
        padding: 1rem;
        border-radius: 22px;
    }
}

@media (max-width: 420px) {
    .profile-screen {
        width: 100%;
        gap: 0.82rem;
        padding:
            calc(clamp(0.95rem, 2.8vh, 1.15rem) + 2.9rem)
            0.82rem
            0.95rem;
    }

    .profile-top {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        padding: 0.4rem 0.82rem;
    }

    .profile-nav-group {
        gap: 0.6rem;
    }

    .profile-icon {
        width: 30px;
    }

    .profile-explore {
        width: 32px;
        margin-right: 0;
    }

    .profile-title {
        font-size: 1.18rem;
    }

    .profile-head {
        grid-template-columns: auto 1fr auto;
        align-items: start;
        gap: 0.34rem;
    }

    .profile-message-link,
    .profile-back {
        justify-self: start;
    }

    .profile-profile-link,
    .profile-menu-wrap {
        justify-self: end;
    }

    .profile-progress {
        min-width: 0;
        padding: 0.44rem 0.54rem 0.46rem;
        gap: 0.2rem;
        border-radius: 16px;
    }

    .profile-progress-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.32rem;
    }

    .profile-progress-link {
        min-height: 21px;
        padding: 0.12rem 0.46rem;
        font-size: 0.58rem;
    }

    .profile-progress-track {
        height: 6px;
    }

    .profile-progress-text {
        font-size: 0.68rem;
    }

    .profile-progress-subtext {
        font-size: 0.58rem;
        line-height: 1.16;
    }

    .profile-card {
        width: 100%;
        border-radius: 22px;
        padding: 0.88rem;
        gap: 0.92rem;
    }

    .profile-photo {
        width: 108px;
        height: 108px;
    }

    .profile-actions {
        flex-direction: column;
    }

    .profile-edit {
        width: 100%;
    }

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

    .profile-progress,
    .profile-echo-card,
    .profile-likes-card,
    .meta-card {
        border-radius: 18px;
    }

    .profile-name h2,
    .profile-section-title {
        font-size: 0.98rem;
    }

    .profile-likes-card {
        padding: 0.82rem 0.78rem 0.8rem;
        gap: 0.34rem;
    }

    .profile-like-heart-wrap {
        width: 72px;
        height: 72px;
    }

    .profile-likes-title {
        font-size: 0.92rem;
    }

    .profile-likes-subtitle {
        font-size: 0.74rem;
        max-width: 24ch;
    }

    .profile-name {
        gap: 0.26rem;
    }

    .profile-name h2 {
        line-height: 1.18;
    }

    .profile-verify-badge {
        min-height: 24px;
        padding: 0.2rem 0.62rem;
        font-size: 0.72rem;
    }

    .profile-subline {
        font-size: 0.8rem;
        line-height: 1.35;
    }

    .profile-actions,
    .profile-echo-actions {
        gap: 0.5rem;
    }

    .profile-edit {
        min-height: 44px;
        font-size: 0.88rem;
    }

    .profile-section {
        gap: 0.58rem;
    }

    .profile-section-hint,
    .profile-bio,
    .profile-echo-copy span,
    .profile-likes-subtitle,
    .profile-likes-private-note {
        font-size: 0.78rem;
        line-height: 1.34;
    }

    .profile-echo-card {
        gap: 0.72rem;
        padding: 0.82rem;
        align-items: stretch;
        flex-direction: column;
    }

    .profile-echo-copy {
        gap: 0.22rem;
    }

    .profile-echo-copy strong {
        font-size: 0.88rem;
        letter-spacing: 0.05em;
    }

    .profile-echo-actions {
        width: 100%;
        flex-direction: column;
    }

    .profile-echo-actions .profile-edit {
        width: 100%;
    }

    .meta-card {
        min-height: 74px;
        padding: 0.76rem 0.8rem;
        gap: 0.3rem;
    }

    .meta-card span {
        font-size: 0.72rem;
    }

    .meta-card strong {
        font-size: 0.9rem;
    }

    .profile-interests {
        gap: 0.45rem;
    }

    .profile-interests .interest-chip {
        padding: 0.36rem 0.68rem;
        font-size: 0.78rem;
    }

    .profile-post-card,
    .profile-post-empty {
        padding: 0.82rem;
        border-radius: 16px;
    }

    .profile-post-card-head,
    .profile-post-card-stats {
        flex-wrap: wrap;
        justify-content: flex-start;
        font-size: 0.68rem;
    }
}

body.theme-super-admin .profile-screen,
body.theme-super-admin .profile-top,
body.theme-super-admin .profile-head,
body.theme-super-admin .profile-card,
body.theme-super-admin .profile-progress,
body.theme-super-admin .profile-menu-dropdown,
body.theme-super-admin .profile-modal-card,
body.theme-super-admin .meta-card {
    background: linear-gradient(160deg, rgba(12, 18, 25, 0.96), rgba(18, 26, 34, 0.9)) !important;
    border-color: rgba(160, 200, 190, 0.16) !important;
    color: var(--text) !important;
    box-shadow: 0 18px 40px rgba(2, 8, 12, 0.24) !important;
}

body.theme-super-admin .profile-back,
body.theme-super-admin .profile-menu,
body.theme-super-admin .profile-progress-link,
body.theme-super-admin .profile-echo-card,
body.theme-super-admin .profile-action-secondary,
body.theme-super-admin .profile-action-primary,
body.theme-super-admin .profile-empty-link,
body.theme-super-admin .profile-menu-item,
body.theme-super-admin .profile-verify-badge,
body.theme-super-admin .profile-trust-chip {
    background: rgba(18, 26, 34, 0.92) !important;
    border-color: rgba(160, 200, 190, 0.16) !important;
    color: var(--text) !important;
}

body.theme-super-admin .profile-action-primary {
    background: linear-gradient(135deg, #ff7a60, #ff5f47) !important;
    border-color: transparent !important;
    color: #fff7f3 !important;
    box-shadow:
        0 0 0 1px rgba(255, 122, 96, 0.18),
        0 16px 32px rgba(255, 122, 96, 0.28),
        0 0 24px rgba(255, 122, 96, 0.2) !important;
}

body.theme-super-admin .profile-action-secondary,
body.theme-super-admin .profile-empty-link {
    background: rgba(160, 200, 190, 0.08) !important;
    color: var(--text) !important;
}

body.theme-super-admin .profile-action-secondary {
    background: rgba(18, 26, 34, 0.96) !important;
}

body.theme-super-admin .profile-likes-title,
body.theme-super-admin .profile-echo-copy strong,
body.theme-super-admin .profile-likes-subtitle {
    color: var(--text) !important;
}

body.theme-super-admin .profile-likes-card {
    background:
        radial-gradient(circle at top, rgba(255, 122, 96, 0.14), transparent 42%),
        linear-gradient(180deg, rgba(18, 26, 34, 0.96), rgba(12, 18, 25, 0.94)) !important;
    border-color: rgba(255, 122, 96, 0.18) !important;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24) !important;
}

body.theme-super-admin .profile-likes-private-note {
    color: rgba(223, 236, 242, 0.72) !important;
}

body.theme-super-admin .profile-likes-face {
    border-color: rgba(18, 26, 34, 0.9);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.18);
}

body.theme-super-admin .profile-likes-faces {
    background: rgba(18, 26, 34, 0.78) !important;
    border-color: rgba(160, 200, 190, 0.12) !important;
}

body.theme-super-admin .profile-post-card,
body.theme-super-admin .profile-post-empty,
body.theme-super-admin .profile-feed-tabs {
    background: rgba(18, 26, 34, 0.9) !important;
    border-color: rgba(160, 200, 190, 0.16) !important;
    color: var(--text) !important;
}

body.theme-super-admin .profile-post-card-body,
body.theme-super-admin .profile-post-card-head,
body.theme-super-admin .profile-post-card-stats,
body.theme-super-admin .profile-feed-tab,
body.theme-super-admin .profile-post-card-author-copy strong,
body.theme-super-admin .profile-post-card-author-copy small {
    color: var(--text) !important;
}

body.theme-super-admin .profile-feed-tab.is-active {
    background: rgba(255, 122, 96, 0.1) !important;
    border-bottom-color: #ff7a60;
}

body.theme-super-admin .profile-post-delete {
    background: rgba(18, 26, 34, 0.92) !important;
    border-color: rgba(255, 122, 96, 0.34) !important;
    color: #ffb09d !important;
}

body.theme-super-admin .profile-echo-copy span {
    color: #9ab0b8 !important;
}

body.theme-super-admin .profile-like-heart-count {
    color: #fff8f4 !important;
}

body.theme-super-admin .profile-menu-item:hover {
    background: rgba(255, 120, 94, 0.12) !important;
}

body.theme-super-admin .profile-modal-card {
    background:
        radial-gradient(circle at top, rgba(255, 122, 96, 0.08), transparent 38%),
        linear-gradient(160deg, rgba(12, 18, 25, 0.98), rgba(18, 26, 34, 0.94)) !important;
    border-color: rgba(160, 200, 190, 0.18) !important;
    box-shadow: 0 26px 52px rgba(2, 8, 12, 0.34) !important;
}

body.theme-super-admin .profile-modal-icon {
    background: linear-gradient(135deg, rgba(255, 122, 96, 0.18), rgba(255, 122, 96, 0.08)) !important;
    color: #ffd1c7 !important;
    box-shadow:
        inset 0 0 0 1px rgba(255, 122, 96, 0.1),
        0 16px 28px rgba(2, 8, 12, 0.24) !important;
}

body.theme-super-admin .profile-modal-copy {
    color: rgba(223, 236, 242, 0.8) !important;
}

body.theme-super-admin .profile-modal-cancel {
    background: rgba(18, 26, 34, 0.96) !important;
    border: 1px solid rgba(160, 200, 190, 0.16) !important;
    color: var(--text) !important;
    box-shadow: none !important;
}

body.theme-super-admin .profile-modal-confirm {
    background: linear-gradient(135deg, #ff7a60, #ff5f47) !important;
    color: #fff7f3 !important;
    box-shadow:
        0 0 0 1px rgba(255, 122, 96, 0.14),
        0 16px 28px rgba(255, 122, 96, 0.24) !important;
}

body.theme-super-admin .profile-card p,
body.theme-super-admin .profile-progress-subtext,
body.theme-super-admin .meta-card span,
body.theme-super-admin .meta-card strong,
body.theme-super-admin .profile-empty-text,
body.theme-super-admin .profile-card .profile-section-copy {
    color: var(--text) !important;
}

@media (max-width: 820px) {
    .profile-top,
    .profile-card,
    .profile-likes-card,
    .profile-progress-link,
    .profile-echo-card,
    .profile-modal-card {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: 0 8px 18px rgba(24, 39, 48, 0.08) !important;
    }

    .profile-icon,
    .profile-explore {
        filter: none !important;
    }

    .profile-action-primary,
    .profile-action-secondary,
    .profile-empty-link {
        box-shadow: 0 8px 16px rgba(24, 39, 48, 0.08) !important;
    }

    .profile-notifications-link .profile-icon {
        filter: brightness(0) saturate(100%) invert(68%) sepia(64%) saturate(4642%) hue-rotate(321deg) brightness(103%) contrast(102%) !important;
    }
}

/* ── Pavilla Pro promo card (profile page) ── */
.profile-pro-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    background: linear-gradient(135deg, #0d1420 0%, #16202e 60%, #1a2a1c 100%);
    border: 1.5px solid rgba(255, 120, 78, .3);
    border-radius: 22px;
    padding: 1.2rem 1.1rem 1.2rem 1.25rem;
    margin: 0 0 0.9rem;
    box-shadow: 0 8px 28px rgba(0,0,0,.14), 0 2px 6px rgba(255,120,78,.1);
    transition: transform 130ms, border-color 130ms;
    -webkit-tap-highlight-color: transparent;
}

.profile-pro-card:active { transform: scale(0.98); }
.profile-pro-card:hover { border-color: rgba(255, 120, 78, .55); }

.profile-pro-card-left { flex: 1; min-width: 0; }

.profile-pro-card-kicker {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: rgba(255,180,48,.9);
    margin: 0 0 0.3rem;
}

.profile-pro-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.25rem;
    line-height: 1.25;
}

.profile-pro-card-copy {
    font-size: 0.78rem;
    color: rgba(255,255,255,.5);
    margin: 0 0 0.65rem;
    line-height: 1.45;
}

.profile-pro-card-perks {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.profile-pro-card-perks span {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,.65);
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 20px;
    padding: 0.2rem 0.6rem;
}

.profile-pro-card-arrow {
    font-size: 1.1rem;
    color: rgba(255,120,78,.7);
    flex-shrink: 0;
}

[data-theme="super-admin"] .profile-pro-card {
    background: linear-gradient(135deg, #0a1018 0%, #101c28 100%);
}

.profile-screen {
    padding-top: 0 !important;
}

.profile-top.pavilla-shared-topbar {
    position: sticky !important;
    top: 0 !important;
}

.profile-head {
    grid-template-columns: minmax(0, 1fr) auto;
}

/* ── Touch & performance optimizations ── */
.profile-back,
.profile-menu,
.profile-feed-tab,
.profile-menu-item,
.profile-edit,
.profile-modal-cancel,
.profile-modal-confirm,
.profile-interests-toggle,
.profile-interests-toggle,
.profile-post-delete,
.profile-progress-link,
.profile-pro-card { touch-action: manipulation; }

/* Remove modal backdrop blur on mobile — saves GPU on low-end devices */
@media (max-width: 820px) {
    .profile-modal-backdrop {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(20, 33, 38, 0.62);
    }
}

/* ════════════════════════════════════════════════════════════════
   ✦ COMPACT, STRUCTURED PROFILE  (appended last — wins the cascade)
   Tighter rhythm + a horizontal identity header (avatar + name in a
   row) so the page reads as a structured card stack, not a long
   centered column.
   ════════════════════════════════════════════════════════════════ */
.profile-screen { gap: clamp(0.7rem, 2vh, 1.1rem); }

.profile-card {
    border-radius: 22px;
    padding: 1.05rem 1rem 1.2rem;
    gap: 0.8rem;
}

/* Identity header — small avatar beside the name, left-aligned */
.profile-identity {
    display: flex;
    align-items: center;
    gap: 0.95rem;
}
.profile-photo {
    width: 76px;
    height: 76px;
    margin: 0;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.6);
}
.profile-photo-initials { font-size: 1.7rem; }

.profile-name {
    justify-items: start;
    text-align: left;
    gap: 0.2rem;
    min-width: 0;
}
.profile-name h2 { font-size: 1.32rem; }
.profile-verify-badge {
    min-height: 22px;
    padding: 0.14rem 0.56rem;
    font-size: 0.68rem;
}
.profile-subline { font-size: 0.85rem; }

.profile-trust-row { justify-content: flex-start; gap: 0.34rem; }
.profile-trust-row:empty { display: none; }

/* Primary action spans the card — feels like a real CTA */
.profile-actions { display: block; }
.profile-actions .profile-edit {
    width: 100%;
    padding: 0.72rem 1rem;
    font-size: 0.92rem;
}

/* Tighter content sections */
.profile-section { gap: 0.45rem; }
.profile-bio {
    padding: 0.78rem 0.9rem;
    border-radius: 14px;
    font-size: 0.9rem;
}
.profile-meta { gap: 0.5rem; }
.meta-card {
    min-height: auto;
    padding: 0.62rem 0.72rem;
    border-radius: 13px;
    gap: 0.22rem;
}
.meta-card span { font-size: 0.64rem; }
.meta-card strong { font-size: 0.9rem; }
.profile-interests { gap: 0.42rem; }

/* Likes card — slimmer */
.profile-likes-card {
    padding: 0.82rem 0.85rem;
    border-radius: 18px;
    gap: 0.28rem;
}
.profile-like-heart-wrap { width: 58px; height: 58px; }
.profile-likes-subtitle { font-size: 0.74rem; }

/* Pro card — trimmer to match the compact rhythm */
.profile-pro-card {
    padding: 0.95rem 1rem;
    border-radius: 18px;
    margin: 0;
}

/* ════════════════════════════════════════════════════════════════
   ✦ NO-SCROLL TIGHTENING  (appended last — final word)
   ════════════════════════════════════════════════════════════════ */

/* Likes card → slim single-line strip (was a tall centered block) */
.profile-likes-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-items: initial;
    text-align: left;
    gap: 0.7rem;
    padding: 0.55rem 0.85rem;
    border-radius: 16px;
}
.profile-like-heart-wrap { width: 38px; height: 38px; }
.profile-like-heart-count { font-size: 0.8rem; }
.profile-likes-title { font-size: 0.95rem; font-weight: 800; }
.profile-likes-faces,
.profile-likes-subtitle { display: none; }

/* Pro card → light, coral, on-brand (was a dark navy/green gradient) */
.profile-pro-card {
    background: linear-gradient(135deg, #fff3ee 0%, #fff9f7 100%);
    border: 1px solid rgba(255, 111, 90, 0.22);
    box-shadow: 0 4px 14px rgba(255, 111, 90, 0.08);
    padding: 0.85rem 0.95rem;
    border-radius: 18px;
}
.profile-pro-card:hover { border-color: rgba(255, 111, 90, 0.4); }
.profile-pro-card-kicker { color: var(--accent-deep); }
.profile-pro-card-title  { color: var(--text); }
.profile-pro-card-copy   { color: var(--muted); }
.profile-pro-card-perks span {
    color: #9f4838;
    background: rgba(255, 111, 90, 0.10);
    border: 1px solid rgba(255, 111, 90, 0.18);
}
.profile-pro-card-arrow { color: var(--accent); }

/* Trim section padding so the card stack fits without scrolling */
.profile-card { gap: 0.7rem; padding: 1rem 0.95rem 1.1rem; }
.profile-section { gap: 0.4rem; }
.meta-card { padding: 0.55rem 0.65rem; }

/* ════ Details as compact inline pills (no more tall boxed cards) ════ */
.profile-meta {
    display: flex;
    flex-wrap: wrap;
    grid-template-columns: none;   /* drop the 3-col grid */
    gap: 0.4rem;
}
.meta-card {
    display: inline-flex;
    align-items: baseline;
    gap: 0.34rem;
    min-height: 0;
    padding: 0.34rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(160, 200, 190, 0.42);
}
.meta-card span {
    font-size: 0.58rem;
    letter-spacing: 0.05em;
}
.meta-card strong { font-size: 0.82rem; line-height: 1.1; }

/* Trim the repeated section headers so the stack is shorter */
.profile-section-title { font-size: 0.64rem; }
.profile-section { gap: 0.35rem; }
.profile-card { gap: 0.6rem; }

/* Drop the bottom social row into the page — it's optional, keep it tiny */
.profile-social-links { margin-top: 0; }

/* ── School card: always full-width, stacked, rectangular ──────────────
   School names can be very long and wrap badly inside a pill. Give it
   its own row with a label-above-value layout instead.
   ──────────────────────────────────────────────────────────────────── */
.meta-card:has(#profile-school) {
    flex-basis: 100%;
    flex-shrink: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.18rem;
    border-radius: 12px;
    padding: 0.56rem 0.82rem;
}

/* ── Likes strip: title absorbs remaining space so there's no dead gap ── */
.profile-likes-title { flex: 1; }

/* ── Likes strip: show the subtitle as a soft right-side note ── */
.profile-likes-subtitle {
    display: block;
    font-size: 0.7rem;
    color: var(--muted);
    text-align: right;
    max-width: 18ch;
    line-height: 1.3;
}

/* Empty detail pills carry a longer prompt — give them their own row */
.meta-card.is-empty { flex-basis: 100%; border-radius: 12px; }

/* ════ Loader as floating overlay + completion banner inside card ════ */

/* Loader no longer occupies a layout row — it floats over the page */
.page-profile .page-loader {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 3.1rem);
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: max-content;
    padding: 0;
    z-index: 60;
    grid-column: auto;
}

/* Completion banner now lives at the top of the card — blend it in */
.profile-card .profile-progress {
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(160, 200, 190, 0.32);
    border-radius: 0;
    box-shadow: none;
    padding: 0 0.1rem 0.7rem;
    margin: 0;
    gap: 0.3rem;
    text-decoration: none;
    color: inherit;
}
.profile-card .profile-progress .profile-progress-text { font-size: 0.82rem; }
.profile-card .profile-progress .profile-progress-subtext { font-size: 0.68rem; }

/* Menu button sits in the topbar now — keep the dropdown above everything */
.profile-top .profile-menu-wrap { position: relative; }
.profile-top .profile-menu-dropdown { z-index: 200; }
