/* =========================================================
   River Roleplay — perfil público e comunidade
   ========================================================= */

.page-social {
    --card: rgba(18, 20, 19, 0.88);
    --card-2: rgba(255, 255, 255, 0.035);
    --overlap: 130px;
    background: var(--bg-deep);
}

.page-social .btn-primary { background: var(--accent); }
.page-social .btn-primary:hover { box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 45%, transparent); }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

body:not(.is-own) .own-only { display: none !important; }

/* ---------- Peças comuns ---------- */

.pf-card {
    position: relative;
    border-radius: 18px;
    background: var(--card);
    border: 1px solid var(--stroke);
    backdrop-filter: blur(18px);
}

.pf-box { padding: 22px; }

.box-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.box-head h3 {
    font-family: var(--font-display);
    font-size: 15px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.box-head > span {
    color: rgba(255, 255, 255, 0.45);
    font: 700 14px var(--font-display);
}

.link-btn {
    border: 0;
    background: none;
    color: rgba(255, 255, 255, 0.5);
    font: 700 13px var(--font-text);
    cursor: pointer;
    transition: color 0.2s ease;
}

.link-btn:hover { color: var(--white); }

.icon-btn {
    flex: none;
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: none;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--white);
}

.icon-btn.sm { width: 30px; height: 30px; }

.icon-btn.boxed {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
}

.btn-light {
    background: var(--white);
    color: #0a0c09;
}

.btn-light:hover { box-shadow: 0 10px 26px rgba(255, 255, 255, 0.18); }

.btn-xs {
    height: 34px;
    padding: 0 14px;
    gap: 6px;
    font-size: 13px;
}

.btn-follow {
    background: var(--white);
    color: #0a0c09;
}

.btn-follow.is-on {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

.btn-follow.is-on:hover {
    border-color: rgba(255, 77, 109, 0.55);
    color: #ff8fa3;
}

.muted-line {
    padding: 6px 0;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    line-height: 1.45;
}

.pf-tag {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 4px 12px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
    color: color-mix(in srgb, var(--accent) 55%, #ffffff);
    font: 700 13px var(--font-text);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pf-tag[hidden] { display: none; }

.pf-tag.sm {
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 10.5px;
    max-width: 160px;
}

/* Avatar redondo */

.av {
    --size: 44px;
    flex: none;
    width: var(--size);
    height: var(--size);
    display: grid;
    place-items: center;
    border-radius: 50%;
    background-color: #1d1d1f;
    background-image: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--accent) 55%, #1d1d1f), #1d1d1f 72%);
    background-size: cover;
    background-position: center;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent);
    color: var(--white);
    font: 700 calc(var(--size) * 0.36) var(--font-display);
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease;
}

a.av:hover { transform: scale(1.06); }

.av-more {
    border: 0;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
    font: 700 13px var(--font-text);
    cursor: pointer;
}

/* =========================================================
   Perfil
   ========================================================= */

.pf-cover {
    position: relative;
    height: clamp(210px, 25vw, 340px);
    overflow: hidden;
    background:
        radial-gradient(ellipse 55% 110% at 80% 0%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%),
        radial-gradient(ellipse 50% 90% at 10% 100%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
        #121214;
    transition: background 0.5s ease;
}

.pf-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.16;
    background-image: radial-gradient(circle, #ffffff 1.6px, transparent 2px);
    background-size: 16px 16px;
    -webkit-mask-image: radial-gradient(ellipse 45% 80% at 22% 30%, #000 20%, transparent 75%);
    mask-image: radial-gradient(ellipse 45% 80% at 22% 30%, #000 20%, transparent 75%);
}

.pf-cover-img {
    position: absolute;
    inset: 0;
    background: center / cover no-repeat;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 0.6s ease, transform 1s var(--ease-out);
}

.pf-cover-img.has-image {
    opacity: 1;
    transform: none;
}

.pf-cover-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, var(--bg-deep) 0%, rgba(10, 12, 9, 0.35) 45%, rgba(10, 12, 9, 0.1) 100%),
        linear-gradient(to right, rgba(10, 12, 9, 0.5), transparent 30%, transparent 70%, rgba(10, 12, 9, 0.5));
}

.pf-cover-btn {
    position: absolute;
    top: 18px;
    right: var(--gutter);
    z-index: 2;
}

.pf {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    max-width: 1240px;
    margin: calc(var(--overlap) * -1) auto 0;
    padding: 0 var(--gutter) 160px;
    animation: rise 0.8s var(--ease-out) both;
}

.pf-side {
    display: grid;
    gap: 16px;
    padding-top: 74px;
}

/* Cartão de identidade */

.pf-id {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 22px 24px;
    text-align: center;
}

.pf-avatar {
    position: relative;
    width: 152px;
    height: 152px;
    margin: -76px 0 16px;
    padding: 4px;
    border-radius: 50%;
    background: conic-gradient(from 200deg, var(--accent), color-mix(in srgb, var(--accent) 30%, #ffffff), var(--accent), color-mix(in srgb, var(--accent) 60%, #000000), var(--accent));
    box-shadow: 0 0 46px color-mix(in srgb, var(--accent) 45%, transparent), 0 20px 50px rgba(0, 0, 0, 0.55);
}

.is-own .pf-avatar { cursor: pointer; }

.pf-avatar-img {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 5px solid #121413;
    background-color: #1d1d1f;
    background-image: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--accent) 45%, #1d1d1f), #1d1d1f 70%);
    background-size: cover;
    background-position: center;
    font: 700 50px var(--font-display);
}

.pf-avatar-hover {
    position: absolute;
    inset: 9px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    font-size: 14px;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.is-own .pf-avatar:hover .pf-avatar-hover,
.is-own .pf-avatar:focus-within .pf-avatar-hover { opacity: 1; }

.pf-id h1 {
    max-width: 100%;
    font-family: var(--font-display);
    font-size: 28px;
    line-height: 1.05;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.pf-user {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 15px;
}

.pf-id .pf-tag { margin-top: 12px; }

.pf-bio {
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.pf-bio.empty {
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
}

.pf-actions {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--stroke);
}

.pf-follow-slot { display: contents; }

.pf-actions .btn {
    flex: 1;
    border-radius: 12px;
    padding: 0 14px;
}

.pf-counts {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 18px;
}

.pf-counts button {
    border: 0;
    background: none;
    color: rgba(255, 255, 255, 0.5);
    font: 400 15px var(--font-text);
    cursor: pointer;
    transition: color 0.2s ease;
}

.pf-counts button:hover { color: var(--white); }

.pf-counts b {
    color: var(--white);
    font-family: var(--font-display);
}

.pf-since {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 14px;
}

/* Seguidores */

.pf-followers { padding: 20px 22px; }

.avatar-stack {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding-left: 10px;
}

.avatar-stack .av {
    margin-left: -10px;
    border: 3px solid #121413;
    box-sizing: content-box;
}

.avatar-stack .muted-line { margin-left: -10px; }

/* Abas */

.pf-main {
    min-width: 0;
    padding-top: calc(var(--overlap) + 16px);
}

.pf-tabs {
    display: flex;
    gap: 4px;
    padding: 0 10px;
    border-radius: 14px;
    background: var(--card);
    border: 1px solid var(--stroke);
    overflow-x: auto;
    scrollbar-width: none;
}

.pf-tabs::-webkit-scrollbar { display: none; }

.pf-tabs button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 56px;
    padding: 0 18px;
    border: 0;
    background: none;
    color: rgba(255, 255, 255, 0.45);
    font: 700 14px var(--font-display);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.25s ease;
}

.pf-tabs button::after {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.35s var(--ease-out);
}

.pf-tabs button:hover { color: rgba(255, 255, 255, 0.8); }
.pf-tabs button.active { color: var(--white); }
.pf-tabs button.active::after { transform: scaleX(1); }

.pf-pane {
    display: none;
    margin-top: 20px;
}

.pf-pane.active {
    display: block;
    animation: rise 0.45s var(--ease-out);
}

.pf-pane > * + * { margin-top: 20px; }

.pf-geral {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 20px;
    align-items: start;
}

/* Estatísticas */

.pf-stats-top {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 18px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--stroke);
}

.pf-stats-big {
    font: 700 52px/1 var(--font-display);
    color: var(--white);
}

.pf-stats-top strong {
    display: block;
    font-size: 15px;
}

.pf-stats-top span:not(.pf-stats-big) {
    color: rgba(255, 255, 255, 0.45);
    font-size: 13px;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px;
    border-radius: 12px;
    background: var(--card-2);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.stat b {
    font: 700 26px/1 var(--font-display);
}

.stat span {
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.pf-stats-foot {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 13px;
}

/* Editar */

.pf-edit {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 20px;
    align-items: start;
}

.pf-edit .panel { background: var(--card); }
.pf-edit .panel-side { position: static; }

/* Perfil não encontrado */

.pf-missing {
    display: grid;
    justify-items: center;
    gap: 14px;
    padding: 120px var(--gutter);
    text-align: center;
}

.pf-missing[hidden] { display: none; }
.pf-missing img { width: 90px; opacity: 0.5; }
.pf-missing h1 { font: 700 34px var(--font-display); }
.pf-missing p { color: var(--muted); margin-bottom: 8px; }

/* =========================================================
   Posts
   ========================================================= */

.post-list { display: grid; }

.post {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
    padding: 18px 0;
    border-top: 1px solid var(--stroke);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.post:first-child { border-top: 0; padding-top: 4px; }
.post.fresh { animation: rise 0.5s var(--ease-out); }
.post.removing { opacity: 0; transform: translateX(-10px); }

.post-body { min-width: 0; }

.post-pin {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.post-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 7px;
    min-height: 30px;
}

.post-name {
    font-weight: 700;
    font-size: 15.5px;
    overflow-wrap: anywhere;
}

.post-name:hover { text-decoration: underline; text-underline-offset: 3px; }

.post-user,
.post-dot,
.post-time {
    color: rgba(255, 255, 255, 0.42);
    font-size: 14px;
}

.post-user:hover { color: rgba(255, 255, 255, 0.75); }

.post-menu {
    position: relative;
    margin-left: auto;
}

.post-menu-list {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 5;
    min-width: 190px;
    padding: 6px;
    border-radius: 12px;
    background: #1a1c1b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.25s var(--ease-out), visibility 0.2s;
}

.post-menu.open .post-menu-list {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.post-menu-list button {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--white);
    font: 700 14px var(--font-text);
    text-align: left;
    cursor: pointer;
}

.post-menu-list button:hover { background: rgba(255, 255, 255, 0.07); }
.post-menu-list .danger { color: #ff7b91; }

.post-text {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 15.5px;
    line-height: 1.55;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.hashtag { color: color-mix(in srgb, var(--accent) 65%, #ffffff); font-weight: 700; }
.mention { color: color-mix(in srgb, var(--accent) 65%, #ffffff); font-weight: 700; }
.mention:hover { text-decoration: underline; text-underline-offset: 3px; }

.post-media {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin-top: 12px;
    padding: 0;
    border: 1px solid var(--stroke);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    cursor: zoom-in;
}

.post-media img {
    display: block;
    max-width: 100%;
    max-height: 520px;
    min-height: 120px;
    min-width: 160px;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.6s var(--ease-out);
}

.post-media.loaded img { opacity: 1; }
.post-media:hover img { transform: scale(1.015); }

.feed-empty {
    padding: 26px 0;
    color: rgba(255, 255, 255, 0.42);
    font-size: 15px;
    text-align: center;
}

.feed-more {
    display: flex;
    margin: 16px auto 0;
}

.feed-more[hidden] { display: none; }

/* Carregando */

.post.skeleton .av {
    box-shadow: none;
    background: rgba(255, 255, 255, 0.06);
}

.post.skeleton i {
    display: block;
    height: 12px;
    margin: 8px 0;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.05));
    background-size: 200% 100%;
    animation: shimmer 1.3s linear infinite;
}

.post.skeleton i:nth-child(1) { width: 38%; }
.post.skeleton i:nth-child(2) { width: 92%; }
.post.skeleton i:nth-child(3) { width: 64%; }

@keyframes shimmer {
    to { background-position: -200% 0; }
}

/* Criar post */

.composer {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
    padding: 18px 20px;
    border-radius: 18px;
    background: var(--card);
    border: 1px solid var(--stroke);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.composer.active {
    border-color: color-mix(in srgb, var(--accent) 40%, transparent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent);
}

.composer-main { min-width: 0; }

.composer textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 0 4px;
    border: 0;
    background: none;
    color: var(--white);
    font: 400 17px/1.5 var(--font-text);
    resize: none;
    outline: none;
}

.composer textarea::placeholder { color: rgba(255, 255, 255, 0.35); }

.composer-preview {
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin-top: 10px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--stroke);
    animation: rise 0.35s var(--ease-out);
}

.composer-preview[hidden] { display: none; }

.composer-preview img {
    display: block;
    max-width: 100%;
    max-height: 340px;
}

.composer-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(10, 12, 9, 0.7);
    color: var(--white);
    backdrop-filter: blur(8px);
}

.composer-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--stroke);
}

.composer-bar label.icon-btn { color: color-mix(in srgb, var(--accent) 70%, #ffffff); }

.composer .counter {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.35);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.composer .counter.warn { color: #ff8fa3; }

/* Pessoas */

.people-list { display: grid; }
.people-list[hidden] { display: none; }

.person {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

.person + .person { border-top: 1px solid rgba(255, 255, 255, 0.04); }

.person-info {
    display: grid;
    min-width: 0;
    line-height: 1.3;
}

.person-info strong,
.person-info span,
.person-info small {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.person-info strong { font-size: 14.5px; }
.person-info span { color: rgba(255, 255, 255, 0.45); font-size: 13px; }
.person-info small { color: rgba(255, 255, 255, 0.32); font-size: 12px; }
.person-info:hover strong { text-decoration: underline; text-underline-offset: 3px; }

/* Modal */

.sx-modal {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
    padding: 24px;
    visibility: hidden;
    pointer-events: none;
}

.sx-modal.open {
    visibility: visible;
    pointer-events: auto;
}

.sx-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 6, 5, 0.78);
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sx-modal.open .sx-modal-backdrop { opacity: 1; }

.sx-modal-card {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: min(80vh, 680px);
    overflow-y: auto;
    padding: 6px 22px 16px;
    border-radius: 20px;
    background: #121413;
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateY(18px) scale(0.98);
    transition: opacity 0.3s ease, transform 0.45s var(--ease-out);
    scrollbar-width: none;
}

.sx-modal.open .sx-modal-card {
    opacity: 1;
    transform: none;
}

.sx-modal-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    background: #121413;
}

.sx-modal-head h3 {
    font: 700 17px var(--font-display);
    overflow-wrap: anywhere;
}

.sx-modal.bare .sx-modal-card {
    max-width: none;
    width: auto;
    max-height: none;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    overflow: visible;
}

.sx-modal.bare .sx-modal-head {
    position: fixed;
    top: 16px;
    right: 16px;
    padding: 0;
    background: none;
}

.sx-modal.bare .sx-modal-head .icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(10, 12, 9, 0.7);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.sx-lightbox-img {
    max-width: min(92vw, 1600px);
    max-height: 88vh;
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

/* =========================================================
   Comunidade
   ========================================================= */

.cm {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
    max-width: 1340px;
    margin: 0 auto;
    padding: 28px var(--gutter) 140px;
    animation: rise 0.8s var(--ease-out) both;
}

.cm-left,
.cm-right {
    position: sticky;
    top: 100px;
    display: grid;
    gap: 16px;
}

.cm-feed { min-width: 0; }
.cm-feed > * + * { margin-top: 18px; }

.cm-head h1 {
    margin-top: 0;
    font: 700 clamp(36px, 4vw, 52px)/1 var(--font-display);
}

.cm-head p {
    max-width: 560px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.4;
}

.cm-tabs button {
    flex: 1;
    justify-content: center;
}

.cm-list { padding: 18px 22px 22px; }

/* Você */

.cm-me {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 20px;
    overflow: hidden;
    text-align: center;
}

.cm-me-cover {
    align-self: stretch;
    height: 86px;
    background:
        radial-gradient(ellipse 70% 120% at 80% 0%, color-mix(in srgb, var(--accent) 60%, transparent), transparent 70%),
        #151517;
    background-size: cover;
    background-position: center;
}

.cm-me-av {
    margin-top: -36px;
    border: 4px solid #121413;
    box-sizing: content-box;
}

.cm-me-name {
    margin-top: 10px;
    padding: 0 16px;
    font: 700 19px var(--font-display);
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.cm-me .pf-user { font-size: 14px; }

.cm-me-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    align-self: stretch;
    margin: 16px 16px 14px;
}

.cm-me-stats .stat {
    align-items: center;
    padding: 10px 4px;
}

.cm-me-stats .stat b { font-size: 19px; }
.cm-me-stats .stat span { font-size: 9.5px; letter-spacing: 0.05em; }

.cm-me > .btn { width: calc(100% - 32px); }

.cm-guest {
    gap: 10px;
    padding: 28px 22px;
}

.cm-guest-logo { width: 64px; margin-bottom: 4px; }
.cm-guest h3 { font: 700 20px var(--font-display); }
.cm-guest p { margin-bottom: 8px; color: var(--muted); font-size: 14px; line-height: 1.45; }

/* Busca */

.cm-search {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.4);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.cm-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.cm-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: none;
    color: var(--white);
    font: 400 15px var(--font-text);
    outline: none;
}

.cm-search input::-webkit-search-cancel-button { filter: invert(1); opacity: 0.5; }
.cm-search + .people-list { margin-top: 10px; }

.cm-foot {
    padding: 0 6px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 12.5px;
    line-height: 1.6;
}

.cm-foot a:hover { color: var(--white); }

/* =========================================================
   Responsivo
   ========================================================= */

@media (max-width: 1180px) {
    .cm { grid-template-columns: minmax(0, 1fr) 300px; }
    .cm-left { display: none; }
    .pf-geral,
    .pf-edit { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .page-social { --overlap: 90px; }

    .pf {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .pf-side { padding-top: 76px; }
    .pf-main { padding-top: 20px; }

    .pf-followers { display: none; }

    .cm { grid-template-columns: 1fr; }
    .cm-right { position: static; }
}

@media (max-width: 640px) {
    .page-social .topbar-links {
        display: flex;
        gap: 14px;
    }

    .page-social .topbar-links a { font-size: 14px; }
    .page-social .topbar .logo span { display: none; }
    .page-social .topbar .nav-name { display: none; }
    .page-social .topbar .nav-account { padding: 0 4px; height: 40px; }
    .page-social .topbar .nav-account:not(.is-user) { padding: 0 14px; }

    .pf-avatar { width: 128px; height: 128px; margin-top: -64px; }
    .pf-side { padding-top: 64px; }
    .pf-id h1 { font-size: 24px; }

    .pf-box,
    .cm-list { padding: 18px 16px; }

    .pf-tabs button { padding: 0 12px; height: 52px; font-size: 13px; }

    .post { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; }
    .post .av { --size: 40px !important; }

    .composer { grid-template-columns: 40px minmax(0, 1fr); padding: 16px; gap: 12px; }
    .composer > .av { --size: 40px !important; }

    .sx-modal { padding: 0; align-items: end; }
    .sx-modal-card { max-width: none; border-radius: 22px 22px 0 0; }
    .sx-modal.bare { align-items: center; padding: 12px; }
}

@media (max-width: 380px) {
    .page-social .topbar-links a:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .pf, .cm, .pf-pane.active, .post.fresh { animation: none; }
}

/* barra de salvar some de verdade quando não há alterações */
.page-social .savebar:not(.show) {
    visibility: hidden;
    transition: transform 0.55s var(--ease-out), visibility 0s 0.55s;
}


/* =========================================================
   Ajustes v2
   ========================================================= */

/* Botões "Remover foto / Remover banner" sempre cabem */
.side-actions {
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}

.side-actions .btn {
    min-width: 0;
    white-space: normal;
    line-height: 1.15;
    text-align: center;
}

/* Status (balão sobre a foto) */
.pf-avatar-wrap {
    position: relative;
    margin: -76px 0 16px;
}

.pf-avatar-wrap .pf-avatar { display: block; margin: 0; }

.pf-status {
    position: absolute;
    left: calc(100% - 34px);
    top: 2px;
    z-index: 3;
    max-width: 190px;
    width: max-content;
    padding: 9px 14px;
    border: 0;
    border-radius: 18px;
    background: #2b2d2c;
    color: var(--white);
    font: 700 14px/1.3 var(--font-text);
    text-align: left;
    overflow-wrap: anywhere;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    cursor: default;
    animation: status-in 0.5s 0.2s var(--ease-out) both;
}

/* bolinhas do balão de pensamento */
.pf-status::before,
.pf-status::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: #2b2d2c;
}

.pf-status::before {
    left: 6px;
    bottom: -7px;
    width: 12px;
    height: 12px;
}

.pf-status::after {
    left: -3px;
    bottom: -15px;
    width: 7px;
    height: 7px;
}

.pf-status[hidden] { display: none; }

.is-own .pf-status { cursor: pointer; }
.is-own .pf-status:hover { background: #343736; }
.is-own .pf-status:hover::before,
.is-own .pf-status:hover::after { background: #343736; }

.pf-status.empty {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
}

@keyframes status-in {
    from { opacity: 0; transform: translateY(6px) scale(0.92); }
    to { opacity: 1; transform: none; }
}

/* Curtir */
.post-foot {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 -6px -8px;
}

.post-like {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: rgba(255, 255, 255, 0.45);
    font: 700 13.5px var(--font-text);
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.post-like:hover {
    color: #ff4d7d;
    background: rgba(255, 77, 125, 0.1);
}

.post-like.is-on { color: #ff3d71; }
.post-like.is-on svg { fill: currentColor; }
.post-like span:empty { display: none; }
.post-like.pop svg { animation: like-pop 0.45s var(--ease-out); }

@keyframes like-pop {
    0% { transform: scale(1); }
    35% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* Botão de perigo */
.btn-danger {
    background: #e5334f;
    color: var(--white);
}

.btn-danger:hover { box-shadow: 0 10px 28px rgba(229, 51, 79, 0.4); }

/* Confirmação */
.sx-modal.dialog .sx-modal-card {
    max-width: 420px;
    padding: 10px 24px 24px;
}

.sx-modal.dialog .sx-modal-head h3 { font-size: 20px; }

.sx-confirm-text {
    color: rgba(255, 255, 255, 0.62);
    font-size: 15px;
    line-height: 1.5;
}

.sx-confirm-label {
    display: block;
    margin: 18px 0 8px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
}

.sx-confirm-label b { color: var(--white); }

.sx-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.sx-confirm-actions .btn { min-width: 110px; }

@media (max-width: 640px) {
    .pf-avatar-wrap { margin-top: -64px; }
    .pf-status { max-width: 150px; font-size: 13px; left: calc(100% - 26px); }
    .sx-confirm-actions .btn { flex: 1; }
}

/* =========================================================
   Comentários e compartilhar
   ========================================================= */

.post-foot { gap: 18px; }

.post-comment-btn,
.post-share {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: rgba(255, 255, 255, 0.45);
    font: 700 13.5px var(--font-text);
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.post-comment-btn:hover,
.post-comment-btn.is-on {
    color: #6aa8ff;
    background: rgba(106, 168, 255, 0.1);
}

.post-share:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.07);
}

.post-comment-btn span:empty { display: none; }

.post-thread {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--stroke);
    animation: rise 0.35s var(--ease-out);
}

.post-thread[hidden] { display: none; }

.comment-list { display: grid; gap: 14px; }

.comment {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    transition: opacity 0.25s ease;
}

.comment.fresh { animation: rise 0.35s var(--ease-out); }
.comment.removing { opacity: 0; }

.comment-body {
    min-width: 0;
    padding: 9px 13px 10px;
    border-radius: 4px 14px 14px 14px;
    background: rgba(255, 255, 255, 0.045);
}

.comment-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
}

.comment-head .post-name { font-size: 14px; }
.comment-head .post-user,
.comment-head .post-dot,
.comment-head .post-time { font-size: 13px; }

.comment-del {
    margin-left: auto;
    border: 0;
    background: none;
    color: rgba(255, 255, 255, 0.35);
    font: 700 12px var(--font-text);
    cursor: pointer;
    transition: color 0.2s ease;
}

.comment-del:hover { color: #ff7b91; }

.comment-text {
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14.5px;
    line-height: 1.5;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.comment-empty {
    color: rgba(255, 255, 255, 0.38);
    font-size: 14px;
}

.comment-form {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
    margin-top: 14px;
}

.comment-form textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--white);
    font: 400 14.5px/1.45 var(--font-text);
    resize: none;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comment-form textarea::placeholder { color: rgba(255, 255, 255, 0.32); }

.comment-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.comment-form .btn { height: 40px; border-radius: 12px; }
.comment-form .btn.loading svg { display: none; }
.comment-form .btn.loading span::before { margin-right: 0; }
.comment-form .btn.loading span { font-size: 0; }
.comment-form .btn.loading span::before { content: ''; display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }

.comment-login {
    display: inline-block;
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 14px;
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-underline-offset: 4px;
}

.comment-login:hover { color: var(--white); }

/* Publicação aberta por link compartilhado */
.sx-modal.large .sx-modal-card { max-width: 680px; max-height: 88vh; }
.sx-modal.large .post { border-top: 0; padding-top: 4px; }

@media (max-width: 640px) {
    .post-foot { gap: 6px; }
    .comment-form { grid-template-columns: minmax(0, 1fr) auto; }
    .comment-form > .av { display: none; }
    .comment-form .btn span { display: none; }
    .comment-form .btn { width: 40px; padding: 0; }
}
