/* ==============================
   profile.css — Omvibe Profile Page
   Loaded AFTER css/styles.css.
   Contains only profile-specific layout
   and components not in styles.css.
============================== */


/* ==============================
   1. AMBIENT GLOWS
============================== */

.glow-purple {
    position: fixed;
    width: 600px; height: 600px; border-radius: 50%;
    background: radial-gradient(circle, rgba(139,92,246,.1) 0%, transparent 70%);
    top: -200px; left: -200px;
    pointer-events: none; z-index: 0;
}

.glow-pink {
    position: fixed;
    width: 500px; height: 500px; border-radius: 50%;
    background: radial-gradient(circle, rgba(236,72,153,.07) 0%, transparent 70%);
    bottom: 0; right: -100px;
    pointer-events: none; z-index: 0;
}


/* ==============================
   2. HEADER EXTRAS
   .app-header, .brand-block, .brand-icon, .brand-logo,
   .brand-tagline, .header-right, .icon-btn, .icon-badge,
   .profile-nav-btn, .profile-nav-avatar
   all come from styles.css — nothing to add here
============================== */

/* brand-block is an <a> tag on profile page — neutralise all default anchor styles */
.brand-block,
.brand-block:visited,
.brand-block:hover,
.brand-block:active {
    color: white;
    text-decoration: none;
}

/* Ensure gradient text on logo is not overridden by anchor color */
.brand-block .brand-logo {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Ensure tagline stays white/muted, not link-coloured */
.brand-block .brand-tagline {
    color: white;
    -webkit-text-fill-color: white;
}

/* CTA button — matches .upgrade-btn gradient + shimmer */
.nav-cta-btn {
    display: inline-block;
    background: linear-gradient(45deg, #9333ea, #ec4899);
    color: white; border: none;
    padding: 10px 18px; border-radius: 8px;
    font-weight: 600; font-size: 14px;
    cursor: pointer; text-decoration: none;
    background-size: 200% 200%;
    animation: shimmer 4s linear infinite;
    transition: 0.2s;
    margin-left: 6px;
}
.nav-cta-btn:hover { transform: translateY(-1px); }
.nav-cta-icon { display: none; }

@media (max-width: 500px) {
  .nav-cta-label { display: none; }
  .nav-cta-icon  { display: inline; }
  .nav-cta-btn   { padding: 8px 12px; font-size: 16px; margin-left: 0; }
}

/* Global Feed nav button */
.nav-feed-btn {
    display: inline-flex;
    align-items: center;
    color: #c4b5fd;
    border: 1px solid rgba(139,92,246,0.35);
    background: rgba(139,92,246,0.08);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s;
}
.nav-feed-btn:hover {
    background: rgba(139,92,246,0.18);
    border-color: rgba(139,92,246,0.6);
    transform: translateY(-1px);
}
@media (max-width: 500px) {
  .nav-feed-label { font-size: 0; }
  .nav-feed-btn::before { content: "🌐"; font-size: 16px; }
  .nav-feed-btn { padding: 8px 10px; }
}


/* ==============================
   3. PAGE WRAPPER
============================== */

.profile-page {
    position: relative; z-index: 1;
    max-width: 1100px; margin: 0 auto;
    padding: 0 20px 80px;
}


/* ==============================
   4. COVER PHOTO
============================== */

.cover {
    height: 220px;
    border-radius: 0 0 18px 18px;
    background: linear-gradient(135deg,
        #1e1b4b 0%, #2d1b69 25%, #1e1040 50%, #0f0a2e 75%, #111827 100%);
    position: relative; overflow: hidden;
}

.cover::before {
    content: ''; position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%238b5cf6' fill-opacity='0.07'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.cover::after {
    content: ''; position: absolute;
    width: 400px; height: 400px; border-radius: 50%;
    background: radial-gradient(circle, rgba(139,92,246,.18) 0%, transparent 60%);
    top: -100px; right: 10%;
}

.cover-glow {
    position: absolute;
    width: 300px; height: 300px; border-radius: 50%;
    background: radial-gradient(circle, rgba(236,72,153,.12) 0%, transparent 60%);
    bottom: -60px; left: 15%;
}


/* ==============================
   5. PROFILE HEADER
============================== */

.profile-header {
    display: flex; align-items: flex-end; gap: 20px;
    padding: 0 20px; margin-top: -52px;
    position: relative; z-index: 2; margin-bottom: 20px;
}

.avatar-wrap { position: relative; flex-shrink: 0; }

.avatar {
    width: 116px; height: 116px; border-radius: 50%;
    border: 4px solid #0b0b0f;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    display: flex; align-items: center; justify-content: center;
    font-size: 38px; font-weight: 700; color: white;
    box-shadow: 0 0 0 2px rgba(139,92,246,.4), 0 10px 40px rgba(139,92,246,.25);
    overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar-online {
    position: absolute; bottom: 8px; right: 6px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #10b981; border: 3px solid #0b0b0f;
}

.profile-info { flex: 1; padding-bottom: 10px; }

.profile-name { font-size: 24px; font-weight: 700; letter-spacing: 0.3px; margin-bottom: 4px; }

.profile-handle { font-size: 13px; opacity: 0.6; margin-bottom: 10px; }

.profile-badges { display: flex; gap: 8px; flex-wrap: wrap; }

/* Badges — use .premium-badge base from styles.css, add colour variants */
.badge { font-size: 10px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.badge-anon    { background: rgba(139,92,246,0.15); border: 1px solid rgba(139,92,246,0.35); color: #c4b5fd; }
.badge-premium { background: linear-gradient(45deg, #9333ea, #ec4899); color: white; }
.badge-verified{ background: rgba(14,165,233,0.15);  border: 1px solid rgba(14,165,233,0.3);  color: #7dd3fc; }
.badge-online  { background: rgba(16,185,129,0.1);   border: 1px solid rgba(16,185,129,0.25); color: #6ee7b7; }
.badge-locked  { background: rgba(100,116,139,0.15); border: 1px solid rgba(100,116,139,0.35); color: #94a3b8; }

.profile-actions {
    display: flex; gap: 10px; align-items: center;
    padding-bottom: 10px; flex-shrink: 0;
}

/* Follow = .upgrade-btn */
.btn-follow {
    background: linear-gradient(45deg, #9333ea, #ec4899);
    color: white; border: none;
    padding: 12px 22px; border-radius: 8px;
    font-weight: 600; font-size: 14px; cursor: pointer;
    background-size: 200% 200%;
    animation: shimmer 4s linear infinite;
    transition: 0.2s; font-family: inherit;
}
.btn-follow:hover { transform: translateY(-1px); }
.btn-follow.following { background: #2a2a35; animation: none; color: #aaa; }

.btn-add-friend {
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
    border: 1px solid rgba(255,255,255,0.12);
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
}

.btn-add-friend:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-1px);
}

.btn-add-friend.following {
    background: rgba(255,255,255,0.08);
    color: #cbd5e1;
}

/* ── Lock toggle button ── */
.btn-lock-toggle {
    background: rgba(255,255,255,0.06);
    color: #94a3b8;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-lock-toggle:hover { background: rgba(255,255,255,0.1); color: #e2e8f0; }
.btn-lock-toggle.locked {
    background: rgba(139,92,246,0.1);
    color: #a78bfa;
    border-color: rgba(139,92,246,0.3);
}

/* ── Locked profile notice ── */
.profile-locked-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 60px 24px;
    text-align: center;
}
.profile-lock-icon { font-size: 48px; }
.profile-lock-title {
    font-size: 18px;
    font-weight: 700;
    color: #e2e8f0;
}
.profile-lock-sub {
    font-size: 14px;
    color: #64748b;
    max-width: 280px;
}

/* Message = .login-btn */
.btn-message {
    background: #2a2a35; color: white; border: none;
    padding: 12px 18px; border-radius: 8px;
    font-size: 14px; cursor: pointer;
    font-family: inherit; transition: 0.2s;
}
.btn-message:hover { background: #3a3a48; }


/* ==============================
   6. STATS BAR
============================== */

.profile-stats {
    display: flex; padding: 0 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 20px;
}

.stat { padding: 0 24px; border-right: 1px solid rgba(255,255,255,0.05); }
.stat:first-child { padding-left: 0; }
.stat:last-child  { border-right: none; }

.stat-value {
    font-size: 22px; font-weight: 700;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    letter-spacing: 0.3px;
}

/* .stat-label matches .section-title from styles.css */
.stat-label {
    font-size: 11px; text-transform: uppercase;
    letter-spacing: 1px; color: #666; margin-top: 2px;
}


/* ==============================
   7. TABS
============================== */

.profile-tabs {
    display: flex; gap: 6px; padding: 0 20px;
    margin-bottom: 22px; overflow-x: auto;
}

.tab {
    padding: 9px 18px; border-radius: 8px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: 0.2s; color: #aaa; border: none;
    background: transparent; font-family: inherit; white-space: nowrap;
}
.tab:hover { background: rgba(255,255,255,0.06); color: white; }
.tab.active {
    background: rgba(139,92,246,0.12); color: #c4b5fd;
    border: 1px solid rgba(139,92,246,0.3);
}


/* ==============================
   8. CONTENT GRID
============================== */

.profile-content {
    display: grid; grid-template-columns: 300px 1fr;
    gap: 22px; padding: 0 20px;
}


/* ==============================
   9. CARDS
   Base .card comes from styles.css.
   profile.css only overrides margin/overflow
   for card usage in this layout context.
============================== */

.card {
    /* Override styles.css .card which sets max-width + margin: auto */
    max-width: none;
    margin: 0 0 12px 0;
    padding: 0;         /* padding handled by .card-head / .card-body */
    overflow: hidden;
}

.card-head {
    padding: 13px 16px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex; align-items: center; justify-content: space-between;
}

/* Matches .section-title */
.card-title {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px; color: #666; margin: 0;
}

.friends-count-badge {
    display: inline-block; margin-left: 6px;
    font-size: 13px; font-weight: 700;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    text-transform: none; letter-spacing: 0;
}

.card-link { font-size: 12px; color: #0ea5e9; cursor: pointer; text-decoration: none; }
.card-link:hover { text-decoration: underline; color: #38bdf8; }

.card-body { padding: 14px 16px; }


/* ==============================
   10. COMMUNITY STATUS
   Uses .premium-card feel from styles.css
============================== */

.status-display {
    padding: 16px; border-radius: 14px;
    background: rgba(147,51,234,0.05);
    border: 1px solid rgba(147,51,234,0.25);
    margin-bottom: 14px; transition: 0.3s;
}
.status-display:hover { border-color: rgba(236,72,153,0.4); }

.status-text { font-size: 14px; color: rgba(255,255,255,0.85); line-height: 1.65; font-style: italic; }

/* matches .helper-text */
.status-time { font-size: 12px; opacity: 0.5; margin-top: 8px; }

.community-tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* Colour variants on top of .tag base from styles.css */
.comm-tag {
    padding: 6px 12px; border-radius: 999px;
    font-size: 13px; display: inline-flex; align-items: center;
    cursor: pointer; transition: 0.2s;
}
.comm-tag-1 { background: rgba(139,92,246,0.12); color: #c4b5fd; border: 1px solid rgba(139,92,246,0.25); }
.comm-tag-2 { background: rgba(14,165,233,0.1);  color: #7dd3fc; border: 1px solid rgba(14,165,233,0.2); }
.comm-tag-3 { background: rgba(236,72,153,0.1);  color: #f9a8d4; border: 1px solid rgba(236,72,153,0.2); }
.comm-tag-4 { background: rgba(16,185,129,0.08); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.18); }
.comm-tag:hover { transform: translateY(-1px); filter: brightness(1.2); }


/* ==============================
   11. FRIENDS GRID
   .friend-avatar from styles.css reused for avatars
============================== */

.friends-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.profile-community-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.status-subtitle,
.status-tags-label {
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.status-tags-label {
  margin: 12px 0 8px;
}

.profile-highlights-section {
    padding: 0 12px 18px;
}

.profile-highlights-card {
    overflow: hidden;
}

.profile-highlights-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.profile-highlight-card {
    min-width: 76px;
    width: 76px;
    flex: 0 0 auto;
    background: transparent;
    border: none;
    color: inherit;
    text-align: center;
    cursor: pointer;
    padding: 0;
}

.profile-highlight-cover {
    width: 76px;
    height: 112px;
    margin: 0 auto 6px;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, rgba(236,72,153,0.75), rgba(139,92,246,0.85));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.profile-highlight-cover-new {
    background: rgba(255,255,255,0.08);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

.profile-highlight-cover img,
.profile-highlight-placeholder {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    background: rgba(15,23,42,0.72);
}

.profile-highlight-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 34px;
    font-weight: 300;
}

.profile-highlight-badge {
    position: absolute;
    left: 7px;
    bottom: 7px;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.45);
}

.profile-highlight-title {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-highlights-empty {
    font-size: 11px;
    color: #94a3b8;
}

.highlight-story-shell {
    width: min(430px, calc(100vw - 8px));
    height: min(96dvh, 860px);
    border-radius: 28px;
    overflow: hidden;
    background: #05070d;
    color: #fff;
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
}

.highlight-story-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3;
    padding: 10px 10px 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.62), rgba(0,0,0,0.1) 72%, rgba(0,0,0,0));
}

.highlight-create-box {
    width: min(520px, calc(100vw - 28px));
}

.highlight-create-note {
    margin-top: 8px;
    font-size: 12px;
    color: #94a3b8;
}

.highlight-viewer-error {
    margin-top: 10px;
    font-size: 12px;
    color: #fda4af;
}

.highlight-story-progress {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 4px;
    margin-bottom: 10px;
    width: 100%;
}

.highlight-story-progress-bar {
    height: 2px;
    border-radius: 999px;
    background: rgba(255,255,255,0.24);
    overflow: hidden;
}

.highlight-story-progress-bar.active::after,
.highlight-story-progress-bar.done::after {
    content: "";
    display: block;
    height: 100%;
    border-radius: inherit;
    background: rgba(255,255,255,0.92);
}

.highlight-story-progress-bar.active::after {
    width: 100%;
    transform-origin: left center;
    animation: highlightStoryFill 5s linear forwards;
}

.highlight-story-progress-bar.done::after {
    width: 100%;
}

@keyframes highlightStoryFill {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.highlight-story-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.highlight-story-owner {
    display: flex;
    align-items: center;
    gap: 0;
    min-width: 0;
    flex: 1 1 auto;
}

.highlight-story-avatar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255,255,255,0.18);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
}

.highlight-story-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.highlight-story-meta {
    min-width: 0;
}

.highlight-story-title {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.highlight-story-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.9);
    margin-top: 0;
    font-weight: 700;
}

.highlight-story-avatar,
.highlight-story-title {
    display: none;
}

.highlight-story-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.highlight-story-count {
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(15,23,42,0.82);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1;
}

.highlight-story-menu-wrap {
    position: relative;
    flex: 0 0 auto;
}

.highlight-story-menu-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 999px;
    background: rgba(15,23,42,0.82);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.highlight-story-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 154px;
    padding: 6px;
    border-radius: 14px;
    background: rgba(9, 11, 18, 0.96);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 18px 48px rgba(0,0,0,0.32);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.highlight-story-menu-item {
    border: none;
    background: transparent;
    color: #f8fafc;
    font-size: 13px;
    text-align: left;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
}

.highlight-story-menu-item:hover {
    background: rgba(255,255,255,0.08);
}

.highlight-story-menu-item.danger {
    color: #fda4af;
}

.highlight-story-body {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
    padding-bottom: 0;
    box-sizing: border-box;
}

.highlight-story-body.has-actions {
    padding-bottom: 82px;
}

.highlight-viewer-actions {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.highlight-viewer-actions.hidden {
    display: none;
}

.highlight-viewer-actions .btn-save,
.highlight-viewer-actions .btn-cancel {
    min-height: 38px;
    padding: 0 16px;
    font-size: 13px;
    flex: 1 1 0;
    min-width: 0;
}

.highlight-delete-confirm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding: 0;
    border: none;
    background: transparent;
}

.highlight-delete-confirm-text {
    font-size: 11px;
    color: #fda4af;
    font-weight: 700;
    margin-right: auto;
}

.highlight-delete-confirm-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.highlight-viewer-grid {
    width: 100%;
    height: 100%;
    min-height: 0;
}

.highlight-gallery-shell {
    position: relative;
    height: 100%;
    min-height: 0;
}

.highlight-gallery-stage {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.highlight-gallery-media {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #05070d;
    border: none;
    cursor: pointer;
}

.highlight-gallery-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: 9 / 16;
}

.highlight-gallery-nav {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: none;
    background: rgba(255,255,255,0.82);
    color: #334155;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.highlight-gallery-nav.prev {
    left: 12px;
}

.highlight-gallery-nav.next {
    right: 12px;
}

.highlight-gallery-nav:disabled {
    opacity: 0.35;
    cursor: default;
}

body.light-mode .profile-highlight-cover-new {
    background: #edf2f7;
    box-shadow: inset 0 0 0 1px rgba(148,163,184,0.28);
}

body.light-mode .profile-highlight-placeholder {
    background: #eef2f7;
    color: #0f172a;
}

body.light-mode .highlight-story-count {
    background: rgba(15,23,42,0.82);
}

.profile-community-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.profile-community-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
}

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

.profile-community-meta {
    min-width: 0;
}

.profile-community-name {
    font-size: 13px;
    font-weight: 600;
}

.profile-community-sub {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

/* matches .helper-text */
.friends-loading { font-size: 12px; opacity: 0.5; grid-column: 1/-1; }

.friend-chip { cursor: pointer; transition: transform 0.2s ease; text-decoration: none; display: block; }
.friend-chip:hover { transform: translateY(-2px); }

.friend-chip-avatar {
    width: 100%; aspect-ratio: 1; border-radius: 12px;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 700; color: white;
    margin-bottom: 5px; position: relative; overflow: visible;
}
.friend-chip-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; overflow: hidden; }

.friend-chip-online {
    position: absolute; bottom: 4px; right: 4px;
    width: 10px; height: 10px; border-radius: 50%;
    background: #10b981; border: 2px solid #14141a;
}

.friend-chip-name { font-size: 11px; opacity: 0.5; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Full grid in Friends tab */
.friends-full-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }

.friend-card {
    background: #14141a; border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    padding: 18px 12px; text-align: center;
    cursor: pointer; transition: 0.25s ease;
    text-decoration: none; display: block;
    border: 1px solid transparent;
}
.friend-card:hover { transform: translateY(-2px); border-color: rgba(139,92,246,0.3); box-shadow: 0 12px 30px rgba(0,0,0,0.55); }

/* matches .friend-avatar from styles.css */
.friend-card-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 18px; color: white;
    margin: 0 auto 10px; position: relative; overflow: visible;
}
.friend-card-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; overflow: hidden; }

.friend-card-online {
    position: absolute; bottom: 0; right: 0;
    width: 12px; height: 12px; border-radius: 50%;
    background: #10b981; border: 2px solid #14141a;
}

.friend-card-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #f8fafc;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.28);
}

.friend-card-tier {
    font-size: 12px;
    color: #c4b5fd;
    opacity: 0.92;
}


/* ==============================
   12. COMPOSE BOX
============================== */

.compose-box {
    background: #14141a; border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    padding: 16px 20px; margin-bottom: 18px;
    display: flex; gap: 14px; align-items: center;
}

/* matches .friend-avatar */
.compose-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px; flex-shrink: 0; overflow: hidden;
}
.compose-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* matches select/input from styles.css */
.compose-input {
    flex: 1; padding: 11px; border-radius: 10px;
    background: #1e1e26; color: #aaa;
    border: none; font-size: 14px; cursor: pointer;
    outline: none; transition: 0.2s; font-family: inherit;
}
.compose-input:hover { box-shadow: 0 0 0 2px #0ea5e9; color: white; }

.profile-feed .compose-box {
    padding: 10px 12px;
    gap: 10px;
    border-radius: 13px;
    margin-bottom: 8px;
    width: 100%;
    box-sizing: border-box;
}

.profile-feed .compose-avatar {
    width: 38px;
    height: 38px;
}

.profile-feed .compose-input {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 13px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.feed-compose-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
}

.feed-compose-fields {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 420px;
    flex-wrap: wrap;
}

.feed-compose-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 0 0 auto;
    margin-left: auto;
}

.feed-compose-count {
    flex: 0 0 auto;
}

.profile-feed .post-avatar {
    width: 34px;
    height: 34px;
    font-size: 14px;
}

.profile-feed .post-head {
    padding: 8px 10px 4px;
}

.profile-feed .post-meta {
    line-height: 1.14;
}

.profile-feed .post-author {
    font-size: 13px;
    margin-bottom: 0;
}

.profile-feed .post-time {
    font-size: 12px;
}

.profile-feed .post-badge {
    font-size: 10px;
    padding: 1px 5px;
    margin-left: 5px;
}

.profile-feed .post-body {
    padding: 0 10px 6px;
    font-size: 13px;
    line-height: 1.42;
}

.profile-feed .post-reactions {
    padding: 1px 10px;
}

.profile-feed .post-actions {
    padding: 3px 10px;
}

.profile-feed .reaction-pill {
    padding: 2px 7px;
    font-size: 11.5px;
}

.profile-feed .action-btn {
    padding: 6px 8px;
    font-size: 12.5px;
    gap: 5px;
}

.profile-feed .post-tag {
    padding: 4px 8px;
    font-size: 12px;
    margin-right: 4px;
}

.profile-feed .post-repost-banner {
    font-size: 12px;
    margin-bottom: 6px;
}

.profile-feed .repost-preview-slot {
    margin-top: 6px;
    padding-left: 6px;
}

.profile-feed .repost-preview-head {
    padding: 6px 8px 2px;
}

.profile-feed .repost-preview-avatar {
    width: 30px;
    height: 30px;
}

.profile-feed .repost-preview-body {
    padding: 0 8px 6px;
}

.profile-feed .repost-preview-body .post-body-text {
    font-size: 13px;
    line-height: 1.32;
}

.profile-feed .repost-preview-image-wrap {
    margin: 0 8px 8px;
}

.profile-feed .post-actions {
    display: flex;
    align-items: center;
}

.profile-feed .post-actions .react-wrap,
.profile-feed .post-actions > .action-btn {
    flex: 1 1 0;
}

.profile-feed .post-actions .react-wrap {
    display: flex;
}

.profile-feed .post-actions .react-wrap .action-btn,
.profile-feed .post-actions > .action-btn {
    width: 100%;
    justify-content: center;
}

#feedComposeTags,
#feedComposeMood,
#feedComposeIntent {
    background: #1e1e26;
    color: #d1d5db;
    border: none;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 8px;
    outline: none;
    font-family: inherit;
    min-width: 0;
    box-sizing: border-box;
}

#feedComposeMood { flex: 1 1 112px; max-width: 140px; }
#feedComposeIntent { flex: 1 1 126px; max-width: 150px; }
#feedComposeTags { flex: 1 1 150px; max-width: 190px; color: #aaa; }

#feedImageBtn {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
}

.feed-load-more-btn {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    color: #9ca3af;
}
.feed-load-more-btn:hover { background: rgba(255,255,255,.09); }


/* ==============================
   13. POSTS
============================== */

.post {
    background: #14141a; border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
    margin-bottom: 10px; overflow: hidden;
    transition: box-shadow 0.2s ease;
    animation: modalFade 0.25s ease-out;
}
.post:hover { box-shadow: 0 24px 60px rgba(0,0,0,0.7); }

.post-head { padding: 10px 14px 6px; display: flex; align-items: center; gap: 9px; }

/* matches .friend-avatar */
.post-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 700; color: white; flex-shrink: 0; overflow: hidden;
}
.post-avatar img { width: 100%; height: 100%; object-fit: cover; }

.post-meta { flex: 1; line-height: 1.2; }
.post-author { font-size: 14px; font-weight: 600; margin-bottom: 1px; }
.post-community-path {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: rgba(255,255,255,0.62);
    font-weight: 500;
}

.post-community-link {
    color: rgba(255,255,255,0.74);
    text-decoration: none;
    font-weight: 600;
}

.post-community-link:hover {
    color: #c4b5fd;
}

.post-time   { font-size: 12px; opacity: 0.5; }

.post-more { color: #6b7280; cursor: pointer; background: none; border: none; font-size: 18px; padding: 4px 8px; transition: color 0.2s; }
.post-more:hover { color: white; }

/* Inline meta badges (pinned, public, friends-only) */
.post-badge {
    font-size: 11px; font-weight: 600; margin-left: 6px;
    padding: 1px 6px; border-radius: 999px; vertical-align: middle;
}
.post-badge-pinned  { background: rgba(167,139,250,0.15); color: #a78bfa; border: 1px solid rgba(167,139,250,0.3); }
.post-badge-friends { background: rgba(96,165,250,0.13);  color: #60a5fa; border: 1px solid rgba(96,165,250,0.25); }
.post-badge-public  { background: rgba(52,211,153,0.1);   color: #6ee7b7; border: 1px solid rgba(52,211,153,0.2);  }
.post-badge-community-role { background: rgba(251,191,36,0.12); color: #fbbf24; border: 1px solid rgba(251,191,36,0.26); text-transform: lowercase; }

.post-body { padding: 0 14px 8px; font-size: 14px; line-height: 1.5; color: rgba(255,255,255,0.88); }
.post-body p { margin-bottom: 8px; }
.post-body p:last-child { margin-bottom: 0; }
.post-mood-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}
.post-mood-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(14,165,233,0.12);
    border: 1px solid rgba(14,165,233,0.22);
    color: #7dd3fc;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.post-intent-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(251,191,36,0.1);
    border: 1px solid rgba(251,191,36,0.22);
    color: #fde68a;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-left: 8px;
}
.post-community-source {
    display: inline-flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(167,139,250,0.12);
    border: 1px solid rgba(167,139,250,0.22);
    color: #c4b5fd;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Post body text — preserve line breaks */
.post-body-text { white-space: pre-wrap; word-break: break-word; }

.post-inline-link {
    color: #7dd3fc;
    text-decoration: none;
    word-break: break-word;
}

.post-inline-link:hover {
    text-decoration: underline;
}

/* Collapsed long posts */
.post-body-collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
}

/* Show more / Show less button */
.post-show-more-btn {
    background: none;
    border: none;
    color: #a78bfa;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 0 4px;
    display: block;
    transition: color 0.15s;
}
.post-show-more-btn:hover { color: #c4b5fd; }

/* matches .tag from styles.css */
.post-tag {
    background: #1f2937; padding: 5px 10px; border-radius: 999px;
    font-size: 12px; color: #d1d5db;
    display: inline-flex; align-items: center;
    margin-right: 5px; cursor: pointer; transition: 0.2s;
}
.post-tag:hover { background: rgba(139,92,246,0.15); color: #c4b5fd; }

.post-reactions { padding: 3px 14px; display: flex; align-items: center; gap: 5px; cursor: pointer; flex-wrap: wrap; }

.reaction-pill {
    display: flex; align-items: center; gap: 5px;
    padding: 3px 8px; border-radius: 999px; font-size: 11px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.06); color: #aaa;
}

.reaction-list-modal {
    width: min(560px, calc(100vw - 28px));
}

.reaction-list-header {
    align-items: center;
}

.reaction-list-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 18px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.reaction-list-tab {
    background: rgba(255,255,255,0.05);
    color: #cbd5e1;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    padding: 8px 12px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.reaction-list-tab.active {
    background: rgba(139,92,246,0.16);
    color: #f5f3ff;
    border-color: rgba(139,92,246,0.32);
}

.reaction-list-tab-count {
    opacity: 0.7;
    font-size: 11px;
}

.reaction-list-body {
    display: grid;
    gap: 10px;
    max-height: min(62vh, 520px);
    overflow-y: auto;
}

.reaction-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 10px 12px;
}

.reaction-list-item:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(139,92,246,0.24);
}

.reaction-list-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    color: #fff;
    font-weight: 700;
}

.reaction-list-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reaction-list-avatar-fallback {
    font-size: 13px;
}

.reaction-list-meta {
    min-width: 0;
    flex: 1;
}

.reaction-list-name {
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
}

.reaction-list-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

.reaction-list-type {
    font-size: 12px;
    color: #cbd5e1;
    font-weight: 700;
    white-space: nowrap;
}

.post-actions { padding: 5px 14px; border-top: 1px solid rgba(255,255,255,0.05); display: flex; gap: 2px; }

.action-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 10px; border-radius: 10px;
    font-size: 12.5px; font-weight: 600; cursor: pointer;
    border: none; background: transparent; color: #aaa;
    font-family: inherit; transition: 0.2s;
}
.action-btn:hover { background: rgba(255,255,255,0.06); color: white; }
.action-btn.liked { color: #f43f5e; }
.action-btn.liked:hover { background: rgba(244,63,94,0.08); }

/* Post images grid */
.post-images {
    display: grid; gap: 3px;
    margin: 0 0 2px; overflow: hidden;
    border-radius: 0 0 4px 4px;
}
.post-images-1 { grid-template-columns: 1fr; }
.post-images-2 { grid-template-columns: 1fr 1fr; }
.post-images-3 { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; }
.post-images-3 .post-image:first-child { grid-column: 1 / -1; }
.post-images-4 { grid-template-columns: 1fr 1fr; }

.post-image {
    width: 100%; height: 220px; object-fit: cover;
    display: block; cursor: zoom-in; transition: opacity 0.2s;
}
.post-images-1 .post-image { height: 320px; border-radius: 0; }
.post-image:hover { opacity: 0.92; }

/* Compose image thumbnails */
.compose-image-grid {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.compose-image-thumb {
    position: relative; width: 80px; height: 80px;
    border-radius: 10px; overflow: hidden; flex-shrink: 0;
}
.compose-image-thumb img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.compose-image-remove {
    position: absolute; top: 3px; right: 3px;
    width: 20px; height: 20px; border-radius: 50%;
    background: rgba(0,0,0,.7); border: none;
    color: white; font-size: 13px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
}


/* ==============================
   14. TAB PANELS
============================== */

.tab-panel { display: none; }
.tab-panel.active { display: block; }


/* ==============================
   15. ABOUT CARD
============================== */

.about-card { max-width: 520px; }

.about-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.about-row:last-child { border-bottom: none; }

/* matches .section-title */
.about-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #666; font-weight: 600; }
.about-value { font-size: 14px; font-weight: 500; }


/* ==============================
   16. EMPTY STATE
============================== */

.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon  { font-size: 42px; margin-bottom: 12px; opacity: 0.4; }
/* matches .helper-text */
.empty-text  { font-size: 12px; opacity: 0.5; }


/* ==============================
   17. STATUS EDIT MODAL
   Base .modal + .modal-content from styles.css.
   .modal-box is a profile-specific alias.
============================== */

.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
    display: flex; justify-content: center; align-items: center;
    z-index: 9999; animation: fadeIn 0.2s ease;
}

/* Same spec as .modal-content */
.modal-box {
    position: relative;
    background: linear-gradient(145deg, #14141a, #101018);
    padding: 48px 42px; border-radius: 24px;
    width: 420px; max-width: 90%;
    box-shadow: 0 25px 60px rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.05);
    animation: modalFade 0.25s ease-out;
    backdrop-filter: blur(20px);
}

.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }

/* matches .modal-content h3 */
.modal-head h3 {
    font-size: 26px; font-weight: 700; letter-spacing: 0.5px;
    background: linear-gradient(45deg, #9333ea, #ec4899);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin: 0;
}

.modal-close { background: none; border: none; color: #6b7280; font-size: 16px; cursor: pointer; padding: 4px 8px; border-radius: 8px; transition: 0.2s; }
.modal-close:hover { background: rgba(255,255,255,0.08); color: white; }

.modal-body { margin-bottom: 20px; }

/* matches .modal-content input */
.status-input {
    width: 100%; box-sizing: border-box;
    background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px; padding: 18px 20px;
    font-size: 15px; color: white;
    transition: all 0.25s ease; outline: none;
    font-family: inherit; min-height: 110px; resize: vertical; line-height: 1.6;
}
.status-input::placeholder { color: rgba(255,255,255,0.45); }
.status-input:focus {
    border-color: rgba(147,51,234,0.6);
    box-shadow: 0 0 0 3px rgba(147,51,234,0.25), 0 12px 35px rgba(147,51,234,0.15);
    transform: translateY(-1px);
}
.status-input:hover { border-color: rgba(255,255,255,0.15); }

/* matches .helper-text */
.status-charcount { text-align: right; font-size: 12px; opacity: 0.5; margin-top: 8px; }

.modal-footer { display: flex; gap: 14px; }

/* matches .modal-cancel */
.btn-cancel {
    flex: 1; padding: 14px; border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.6);
    font-weight: 600; font-size: 14px;
    cursor: pointer; font-family: inherit; transition: 0.2s ease;
}
.btn-cancel:hover { background: rgba(255,255,255,0.08); color: white; }

/* matches .modal-submit */
.btn-save {
    flex: 1; padding: 14px; border-radius: 14px; border: none;
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    color: white; font-size: 15px; font-weight: 700;
    letter-spacing: 0.4px; cursor: pointer; font-family: inherit;
    transition: all 0.25s ease;
    box-shadow: 0 10px 25px rgba(14,165,233,0.25);
    position: relative; overflow: hidden;
}
.btn-save:hover { transform: translateY(-2px); box-shadow: 0 14px 35px rgba(14,165,233,0.35); }
.btn-save::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.2), transparent 70%);
    transform: translateX(-100%); transition: 0.6s ease;
}
.btn-save:hover::after { transform: translateX(100%); }


/* ==============================
   18. TAGS EDIT BUTTON & MODAL
============================== */

.tags-edit-btn {
    display: block; width: 100%; margin-top: 12px;
    padding: 7px 0; border-radius: 8px;
    background: rgba(139,92,246,0.08);
    border: 1px dashed rgba(139,92,246,0.3);
    color: #a78bfa; font-size: 12px; font-weight: 600;
    cursor: pointer; transition: 0.2s; font-family: inherit;
}
.tags-edit-btn:hover {
    background: rgba(139,92,246,0.15);
    border-color: rgba(139,92,246,0.5);
    color: #c4b5fd;
}

.tags-modal-hint {
    font-size: 12px; opacity: 0.5; margin: 0 0 14px;
}

.tags-inputs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }

.tag-input-row {
    display: flex; align-items: center; gap: 8px;
}

.tag-input-row input {
    flex: 1; padding: 10px 14px; border-radius: 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: white; font-size: 14px; outline: none;
    font-family: inherit; transition: 0.2s;
}
.tag-input-row input:focus {
    border-color: rgba(139,92,246,0.5);
    box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}

.tag-remove-btn {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #6b7280; font-size: 14px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
}
.tag-remove-btn:hover { background: rgba(244,63,94,0.15); color: #f87171; border-color: rgba(244,63,94,0.3); }

.tags-add-btn {
    width: 100%; padding: 8px 0; border-radius: 8px;
    background: transparent;
    border: 1px dashed rgba(255,255,255,0.12);
    color: #6b7280; font-size: 13px; cursor: pointer;
    transition: 0.2s; font-family: inherit;
}
.tags-add-btn:hover { border-color: rgba(255,255,255,0.25); color: #aaa; }
.tags-add-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.post-inline-link {
    color: #60a5fa;
    text-decoration: none;
    word-break: break-word;
}
.post-inline-link:hover {
    color: #93c5fd;
    text-decoration: underline;
}

.link-preview-slot {
    margin-top: 8px;
}

.link-preview-card {
    display: flex;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    text-decoration: none;
    color: inherit;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    overflow: hidden;
}

.link-preview-media {
    width: 112px;
    flex: 0 0 112px;
    background: rgba(255,255,255,0.03);
}

.link-preview-media img {
    width: 100%;
    height: 100%;
    min-height: 92px;
    object-fit: cover;
    display: block;
}

.link-preview-content {
    min-width: 0;
    flex: 1;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}

.link-preview-site {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.link-preview-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    color: #f8fafc;
}

.link-preview-desc {
    font-size: 12px;
    line-height: 1.42;
    color: #cbd5e1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.repost-link-preview-slot .link-preview-card {
    margin-top: 2px;
    border-radius: 12px;
}

@media (max-width: 640px) {
    .link-preview-card {
        gap: 8px;
    }

    .link-preview-media {
        width: 84px;
        flex-basis: 84px;
    }

    .link-preview-content {
        padding: 8px 10px;
    }

    .link-preview-title {
        font-size: 13px;
    }

    .link-preview-desc {
        font-size: 11.5px;
    }
}


/* ==============================
   19. EDIT OVERLAYS (avatar + banner)
============================== */

/* Avatar edit button — sits at bottom-right of avatar-wrap */
.avatar-edit-btn {
    position: absolute;
    bottom: 4px; right: 4px;
    width: 24px; height: 24px; border-radius: 0;
    background: transparent;
    border: 0;
    color: white; font-size: 16px; font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, transform 0.15s;
    z-index: 3; padding: 0;
    text-align: center;
    font-family: "Segoe UI Symbol", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}
.avatar-edit-btn:hover {
    transform: scale(1.1);
}

/* Banner edit button — sits inside .cover at bottom-right */
.cover-edit-btn {
    position: absolute;
    bottom: 12px; right: 16px; z-index: 3;
    background: transparent;
    backdrop-filter: none;
    border: 0;
    color: white; font-size: 20px; font-weight: 700;
    width: 28px; height: 28px; padding: 0; border-radius: 0;
    line-height: 1;
    cursor: pointer; transition: background 0.2s, transform 0.15s;
    font-family: inherit;
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    font-family: "Segoe UI Symbol", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}
.cover-edit-btn:hover {
    transform: translateY(-1px);
}

/* "Status" tab is hidden on desktop — shown only on mobile */
.mobile-tab { display: none; }


/* ==============================
   20. IMAGE LIGHTBOX
============================== */

.lightbox-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.93); backdrop-filter: blur(14px);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000; animation: fadeIn 0.2s ease;
    cursor: zoom-out;
}

.lightbox-img {
    max-width: 90vw; max-height: 88vh;
    object-fit: contain; border-radius: 10px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.8);
    cursor: default; pointer-events: none;
    animation: modalFade 0.2s ease-out;
    user-select: none;
}

.lightbox-close {
    position: absolute; top: 18px; right: 22px;
    background: rgba(255,255,255,0.1); border: none;
    color: white; font-size: 20px; cursor: pointer;
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s; line-height: 1;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.08); border: none;
    color: white; font-size: 22px; cursor: pointer;
    width: 46px; height: 46px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.18); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-counter {
    position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
    color: rgba(255,255,255,0.65); font-size: 13px;
    background: rgba(0,0,0,0.45); padding: 4px 14px; border-radius: 999px;
    pointer-events: none;
}


/* ==============================
   21. POST DROPDOWN MENU
============================== */

.post-more-wrap {
    position: relative; display: inline-block;
}

.post-dropdown {
    position: fixed;
    background: #1a1a24; border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px; min-width: 210px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.65);
    z-index: 2000; overflow: hidden;
    animation: modalFade 0.15s ease-out;
    padding: 6px;
}

.post-dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px; border-radius: 8px;
    font-size: 13px; font-weight: 500; color: #d1d5db;
    cursor: pointer; border: none; background: none;
    width: 100%; text-align: left; font-family: inherit;
    transition: background 0.15s; line-height: 1.3;
}
.post-dropdown-item:hover { background: rgba(255,255,255,0.07); color: white; }
.post-dropdown-item.danger { color: #f87171; }
.post-dropdown-item.danger:hover { background: rgba(248,113,113,0.1); }
.post-dropdown-item .item-icon { width: 18px; text-align: center; flex-shrink: 0; }

.post-dropdown-divider {
    height: 1px; background: rgba(255,255,255,0.07); margin: 4px 0;
}


/* ==============================
   22. INLINE EDIT
============================== */

.post-edit-area {
    width: 100%; box-sizing: border-box;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(139,92,246,0.45);
    border-radius: 12px; padding: 12px 16px;
    font-size: 14px; color: white; resize: vertical;
    min-height: 80px; font-family: inherit;
    outline: none; line-height: 1.75;
    transition: border-color 0.2s;
}
.post-edit-area:focus { border-color: rgba(139,92,246,0.8); }

.post-edit-actions {
    display: flex; gap: 8px; margin-top: 8px; justify-content: flex-end;
}

.post-edit-save, .post-edit-cancel {
    padding: 7px 18px; border-radius: 9px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    font-family: inherit; transition: 0.2s;
}
.post-edit-save {
    background: linear-gradient(135deg,#8b5cf6,#ec4899);
    border: none; color: white;
}
.post-edit-save:hover { opacity: 0.88; }
.post-edit-cancel {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1); color: #aaa;
}
.post-edit-cancel:hover { background: rgba(255,255,255,0.1); color: white; }


/* ==============================
   23. REACTION PICKER
============================== */

.react-wrap { position: relative; }

.reaction-picker {
    position: absolute;
    bottom: calc(100% + 8px); left: 0;
    background: #1a1a24;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    padding: 6px 8px;
    display: flex; gap: 2px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.55);
    z-index: 600;
    animation: modalFade 0.15s ease-out;
    white-space: nowrap;
}

.reaction-option {
    background: none; border: none;
    font-size: 22px; cursor: pointer;
    border-radius: 50%;
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s, background 0.15s;
    padding: 0; line-height: 1;
}
.reaction-option:hover  { transform: scale(1.35) translateY(-4px); }
.reaction-option.active { background: rgba(255,255,255,0.1); }

/* "Reacted" state on the main action button */
.action-btn.reacted {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.12);
  box-shadow: inset 0 0 0 1px rgba(244, 63, 94, 0.35);
  font-weight: 700;
}
.action-btn.reacted:hover {
  background: rgba(244, 63, 94, 0.2);
  box-shadow: inset 0 0 0 1px rgba(244, 63, 94, 0.55);
}


/* ==============================
   24. COMMENT SECTION
============================== */

.comment-section {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 10px 12px 12px;
}

/* Input row */
.comment-input-wrap {
    display: flex; gap: 10px; align-items: flex-start;
    margin-bottom: 10px;
    min-width: 0;
}
.comment-input-right {
    display: flex; flex: 1; flex-direction: column; gap: 6px; align-items: stretch;
    min-width: 0;
}

.comment-composer-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    min-width: 0;
}

.comment-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: white;
    flex-shrink: 0; overflow: hidden;
}
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }

.comment-input {
    flex: 1 1 auto;
    width: auto;
    height: 44px;
    min-height: 44px;
    max-height: 120px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 9px 12px; font-size: 13px;
    color: white; font-family: inherit;
    outline: none; transition: 0.2s;
    resize: none;
    line-height: 1.35;
    box-sizing: border-box;
    overflow-y: auto;
}
.comment-input:focus {
    border-color: rgba(139,92,246,0.5);
    background: rgba(255,255,255,0.08);
}

.comment-char-count {
    font-size: 10px;
    color: rgba(255,255,255,0.45);
    text-align: right;
}

.comment-submit-btn {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border: none; border-radius: 999px;
    color: white; font-size: 12px; font-weight: 600;
    padding: 6px 14px; cursor: pointer;
    font-family: inherit; transition: 0.2s; white-space: nowrap;
}
.comment-submit-btn:hover   { opacity: 0.85; }
.comment-submit-btn:disabled { opacity: 0.5; cursor: default; }

/* Comment list */
.comment-list {
    display: flex; flex-direction: column; gap: 8px;
}
.comment-empty, .comment-loading, .comment-error {
    font-size: 13px; opacity: 0.4; text-align: center; padding: 10px 0;
}

.comment-load-more-btn {
    align-self: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: #cbd5e1;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: 0.2s;
}

.comment-load-more-btn:hover {
    background: rgba(255,255,255,0.09);
    color: #fff;
}

/* Individual comment */
.comment-item {
    display: flex; gap: 10px; align-items: flex-start;
    min-width: 0;
}
.comment-reply {
    margin-left: 34px;
}

.comment-content { flex: 1; min-width: 0; }

.comment-bubble {
    background: rgba(255,255,255,0.05);
    border-radius: 14px; padding: 9px 14px;
    display: inline-block; max-width: 100%;
}
.comment-author {
    font-size: 13px; font-weight: 600;
    display: block; margin-bottom: 3px; color: inherit;
}
.comment-body {
    font-size: 13px; color: rgba(255,255,255,0.85);
    line-height: 1.5; word-break: break-word;
}

.post-mention {
    color: #c4b5fd;
    font-weight: 700;
}

/* Comment meta row */
.comment-meta {
    display: flex; align-items: center; gap: 6px;
    margin-top: 4px; padding: 0 4px; flex-wrap: wrap;
}
.comment-react-btn {
    display: inline-flex; align-items: center; gap: 4px;
    background: none; border: none;
    font-size: 12px; color: #9ca3af;
    cursor: pointer; font-family: inherit;
    padding: 2px 5px; border-radius: 6px; transition: 0.2s;
    position: relative;
}
.comment-react-btn:hover   { background: rgba(255,255,255,0.06); color: white; }
.comment-react-btn.reacted { color: #f43f5e; }
.comment-react-btn:disabled { opacity: 0.5; cursor: default; }

.comment-react-emoji {
    line-height: 1;
}

.comment-react-label {
    font-weight: 600;
    line-height: 1;
}

.comment-reaction-summary-wrap {
    display: inline-flex;
    align-items: center;
}

.comment-reaction-summary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.comment-reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.07);
    color: #e5e7eb;
    font-size: 11px;
    line-height: 1;
}

.comment-reaction-pill-emoji {
    line-height: 1;
}

.comment-reaction-pill-count {
    font-weight: 700;
}

.comment-reaction-summary-wrap {
    display: inline-flex;
    align-items: center;
}

.comment-reaction-summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

.comment-reaction-stack {
    display: inline-flex;
    align-items: center;
    padding-left: 2px;
}

.comment-reaction-badge {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #111827;
    border: 2px solid #0b1020;
    box-shadow: 0 1px 3px rgba(0,0,0,0.22);
    margin-left: -5px;
}

.comment-reaction-badge:first-child {
    margin-left: 0;
}

.comment-reaction-badge-emoji {
    font-size: 11px;
    line-height: 1;
}

.comment-reaction-total {
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 700;
}

.comment-like-count { font-size: 12px; }

.comment-reply-btn, .comment-delete-btn {
    background: none; border: none;
    font-size: 12px; font-weight: 600; color: #9ca3af;
    cursor: pointer; font-family: inherit;
    padding: 2px 6px; border-radius: 6px; transition: 0.2s;
}
.comment-reply-btn:hover  { background: rgba(255,255,255,0.06); color: white; }
.comment-delete-btn       { color: #f87171; }
.comment-delete-btn:hover { background: rgba(248,113,113,0.1); }

.comment-time {
    font-size: 11px; opacity: 0.4; margin-left: auto;
}

/* Replies container */
.comment-replies {
    margin-top: 6px;
    padding-left: 10px;
    border-left: 2px solid rgba(255,255,255,0.06);
    display: flex; flex-direction: column; gap: 8px;
}

.comment-thread-toggle {
    align-self: flex-start;
    background: none;
    border: none;
    color: #a78bfa;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 0 0;
    cursor: pointer;
    font-family: inherit;
}

.comment-thread-toggle:hover {
    color: #c4b5fd;
}

/* Reply input */
.reply-input-wrap {
    display: flex; gap: 10px; align-items: flex-start;
    margin-bottom: 6px;
    min-width: 0;
}

.comment-composer-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 4px;
}

.comment-composer-hint {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.3;
}
.reply-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.reply-cancel-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: #9ca3af;
    font-size: 12px; font-weight: 600;
    cursor: pointer;
    padding: 7px 12px; border-radius: 999px; transition: 0.2s;
    font-family: inherit;
}
.reply-cancel-btn:hover { color: white; background: rgba(255,255,255,0.08); }

.comment-skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-skeleton-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.comment-skeleton-avatar,
.comment-skeleton-line {
    position: relative;
    overflow: hidden;
    background: rgba(255,255,255,0.08);
}

.comment-skeleton-avatar::after,
.comment-skeleton-line::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.14) 50%, transparent 100%);
    animation: commentSkeletonShimmer 1.25s ease-in-out infinite;
}

.comment-skeleton-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.comment-skeleton-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 2px;
}

.comment-skeleton-line {
    height: 12px;
    border-radius: 999px;
    width: 100%;
}

.comment-skeleton-line-author {
    width: 34%;
}

.comment-skeleton-line-short {
    width: 58%;
}

.comments-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 1600;
    background: rgba(10, 12, 20, 0.56);
    backdrop-filter: blur(10px);
    display: none;
    align-items: flex-end;
    justify-content: stretch;
}

.comments-sheet {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    background: linear-gradient(180deg, rgba(16,18,30,0.98) 0%, rgba(11,13,24,0.99) 100%);
    border-radius: 0;
    border: none;
    box-shadow: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: commentsSheetUp 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.comments-sheet-handle {
    width: 48px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    margin: 10px auto 6px;
    flex-shrink: 0;
}

.comments-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.comments-sheet-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.comments-sheet-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.18s ease;
}

.comments-sheet-close:hover {
    background: rgba(255,255,255,0.1);
}

.comments-sheet-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
}

@keyframes commentSkeletonShimmer {
    100% { transform: translateX(100%); }
}

@keyframes commentsSheetUp {
    from {
        transform: translateY(100%);
        opacity: 0.88;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}


/* ==============================
   19. RESPONSIVE
============================== */

@media (max-width: 860px) {
    .profile-content { grid-template-columns: 1fr; }
    .profile-sidebar  { display: none; }   /* hidden by default on mobile */
    .profile-sidebar.mobile-shown { display: block; }
    .profile-feed     { order: 1; }
    .mobile-tab { display: block; }        /* show Status tab on mobile */
    .comments-sheet-overlay {
        display: flex;
        align-items: stretch;
    }
    .comments-sheet-handle {
        width: 42px;
        height: 4px;
        margin: 8px auto 4px;
    }
    .comments-sheet-header {
        padding: calc(6px + env(safe-area-inset-top, 0px)) 12px 10px;
    }
    .comments-sheet-header h3 {
        font-size: 16px;
    }
    .comments-sheet-close {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
    .comments-sheet .comment-section {
        border-top: none;
        min-height: 100%;
        padding: 10px 10px 14px;
    }
    .comments-sheet .comment-input {
        font-size: 16px;
        min-height: 40px;
        height: 40px;
        padding: 8px 11px;
        border-radius: 12px;
    }
    .comments-sheet .comment-input-wrap {
        position: sticky;
        top: 0;
        z-index: 2;
        gap: 8px;
        padding-bottom: 8px;
        margin-bottom: 8px;
        background: inherit;
    }
    .comments-sheet .comment-avatar {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    .comments-sheet .comment-composer-row {
        gap: 6px;
    }
    .comments-sheet .comment-submit-btn {
        padding: 0 12px;
        min-height: 36px;
        font-size: 11px;
    }
    .comments-sheet .comment-composer-meta {
        margin-top: 2px;
        gap: 8px;
    }
    .comments-sheet .comment-char-count {
        font-size: 9px;
    }
    .comments-sheet .comment-composer-hint {
        display: none;
    }
    .comments-sheet .comment-list {
        gap: 6px;
    }
    .comments-sheet .comment-item {
        gap: 8px;
    }
    .comments-sheet .comment-reply {
        margin-left: 28px;
    }
    .comments-sheet .comment-bubble {
        padding: 7px 10px;
        border-radius: 12px;
    }
    .comments-sheet .comment-author,
    .comments-sheet .comment-body {
        font-size: 12px;
    }
    .comments-sheet .comment-meta {
        margin-top: 2px;
        gap: 4px;
        padding: 0 2px;
    }
    .comments-sheet .comment-react-btn,
    .comments-sheet .comment-reply-btn,
    .comments-sheet .comment-delete-btn,
    .comments-sheet .comment-like-count {
        font-size: 11px;
    }
    .comments-sheet .comment-time {
        font-size: 10px;
    }
    .comments-sheet .comment-load-more-btn {
        padding: 7px 12px;
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    .modal-overlay#highlightViewerModal {
        align-items: stretch;
        justify-content: stretch;
    }
    .profile-page { padding: 0 8px 80px; }
    .profile-header { flex-wrap: wrap; padding: 0 8px; margin-top: -40px; }
    .profile-actions { width: 100%; }
    .profile-stats { padding: 0 8px 14px; flex-wrap: wrap; }
    .profile-highlights-section { padding: 0 8px 16px; }
    .stat { padding: 8px 12px; }
    .stat-value { font-size: 17px; }
    .profile-tabs { padding: 0 8px; }
    .profile-content { padding: 0 4px; }
    .cover { height: 150px; }
    .avatar { width: 84px; height: 84px; font-size: 28px; }
    .modal-box { padding: 32px 24px; }
    .details-field-row { flex-direction: column; gap: 0; }
    .details-modal-box { padding: 28px 18px; }
    .profile-highlight-card { min-width: 72px; width: 72px; }
    .profile-highlight-cover { width: 72px; height: 106px; }
    .highlight-story-shell {
        width: 100vw;
        height: 100dvh;
        border-radius: 0;
    }
    .highlight-story-top {
        padding: calc(8px + env(safe-area-inset-top, 0px)) 8px 0;
    }
    .highlight-story-body {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .highlight-story-body.has-actions {
        padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    }
    .highlight-viewer-actions {
        left: 8px;
        right: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        gap: 8px;
    }
    .highlight-viewer-actions .btn-save,
    .highlight-viewer-actions .btn-cancel {
        min-height: 34px;
        padding: 0 10px;
        font-size: 12px;
    }
    .highlight-gallery-nav { width: 42px; height: 42px; font-size: 24px; }
}

/* Stacked profile header on small phones — prevents name overlapping the banner */
@media (max-width: 480px) {
    .profile-page { padding: 0 0 80px; }
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-top: -42px;
        gap: 6px;
        margin-bottom: 12px;
        padding: 0 10px;
    }
    .profile-info { padding-bottom: 0; }
    .profile-badges { justify-content: center; }
    .profile-actions { width: auto; justify-content: center; }
    .profile-stats { padding: 0 10px 12px; }
    .profile-highlights-section { padding: 0 10px 14px; }
    .stat { padding: 8px 8px; }
    .stat-value { font-size: 15px; }
    .stat-label { font-size: 11px; }
    .profile-tabs { padding: 0 10px; }
    .profile-content { padding: 0 8px; }
    .cover { height: 130px; border-radius: 0; }
    .card { border-radius: 12px; }
    .profile-highlight-card { min-width: 72px; width: 72px; }
    .profile-highlight-cover { width: 72px; height: 106px; }
    .modal-overlay#highlightViewerModal {
        align-items: stretch;
        justify-content: stretch;
    }
    .highlight-story-shell { width: 100vw; height: 100dvh; border-radius: 0; }
    .highlight-story-top { padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
    .highlight-story-body { padding-bottom: env(safe-area-inset-bottom, 0px); }
    .highlight-story-body.has-actions { padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
    .highlight-viewer-actions { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); width: auto; gap: 8px; }
    .highlight-viewer-actions .btn-save,
    .highlight-viewer-actions .btn-cancel { flex: 1; min-height: 34px; padding: 0 10px; }
    .highlight-story-head { align-items: flex-start; }
}

@media (max-width: 560px) {
    /* Tighter compose box so the action row has room */
    .compose-box { padding: 12px; gap: 10px; box-shadow: none; margin-bottom: 4px; border-radius: 12px; }
    .profile-feed .compose-box {
        width: 100%;
        min-width: 0;
        padding: 9px 10px;
        gap: 8px;
        align-items: flex-start;
        border-radius: 12px;
        box-sizing: border-box;
    }
    .profile-feed .compose-avatar {
        width: 34px;
        height: 34px;
    }
    .profile-feed .compose-box > div:last-child {
        min-width: 0;
        flex: 1;
    }
    .profile-feed .compose-input {
        width: 100% !important;
        min-width: 0;
        min-height: 44px;
        padding: 10px 11px;
        font-size: 13px;
        white-space: normal;
        box-sizing: border-box;
    }
    .profile-feed .post {
        border-radius: 12px;
    }
    .profile-feed .post-head {
        padding: 8px 9px 4px;
    }
    .profile-feed .post-body {
        padding: 0 9px 6px;
    }
    .profile-feed .post-reactions,
    .profile-feed .post-actions {
        padding-left: 9px;
        padding-right: 9px;
    }
    .post { box-shadow: none; margin-bottom: 4px; border-radius: 12px; }
    .post:hover { box-shadow: none; }

    /* Wrap the actions row onto two lines instead of overflowing */
    #feedComposeActions {
        flex-wrap: wrap;
        gap: 8px;
        align-items: start;
    }

    #feedComposeActions > div { min-width: 0; }

    #feedComposeActions > div:first-child {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
        width: 100%;
        flex: 1 1 100%;
    }

    /* Shrink the tags input — still comfortable at 90px */
    #feedComposeTags {
        width: 100% !important;
        max-width: 110px;
        min-width: 0;
    }

    /* Right-align Cancel/Post when they wrap onto their own line */
    #feedComposeActions > div:last-child {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        width: 100%;
        flex: 1 1 100%;
        margin-left: 0;
    }

    #feedComposeActions > div:last-child .btn-cancel,
    #feedComposeActions > div:last-child .btn-save {
        flex: 1 1 0;
        min-width: 0;
    }
}


/* ==============================
   23. PERSONAL DETAILS MODAL
============================== */

.about-bio {
    white-space: pre-wrap; word-break: break-word;
    max-width: 340px; text-align: right;
}

/* Cooldown notice inside the Personal Details card */
.cooldown-notice {
    margin-top: 14px; padding: 10px 14px;
    border-radius: 10px;
    background: rgba(251,191,36,0.08);
    border: 1px solid rgba(251,191,36,0.2);
    color: #fbbf24; font-size: 12px; line-height: 1.5;
}

/* Wider modal for the details form */
.details-modal-box {
    width: 480px; max-width: 94%;
    padding: 40px 38px;
}

/* Each field group */
.details-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.details-field:last-child { margin-bottom: 0; }

/* Side-by-side row for gender + birthdate */
.details-field-row { display: flex; gap: 16px; }

.details-label {
    font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.8px; color: #9ca3af; font-weight: 600;
}
.details-required { color: #f87171; }

/* Shared input/select/textarea style */
.details-input {
    width: 100%; box-sizing: border-box;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 12px; padding: 11px 16px;
    font-size: 14px; color: white;
    outline: none; font-family: inherit; transition: border-color 0.2s;
}
.details-input:focus {
    border-color: rgba(139,92,246,0.6);
    box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}
.details-input::placeholder { color: rgba(255,255,255,0.3); }

/* @ prefix on username field */
.details-input-wrap { position: relative; }
.details-at {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: #6b7280; font-size: 14px; pointer-events: none;
}
.details-input-at { padding-left: 28px; }

/* Textarea */
.details-textarea { resize: vertical; min-height: 80px; line-height: 1.6; }

/* Select arrow */
.details-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}
.details-select option { background: #1e1e2a; color: white; }

/* Date input — hide default chrome styling */
.details-input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.5); cursor: pointer;
}

/* Hint text below field */
.details-hint { font-size: 11px; color: #6b7280; margin-top: 2px; }

/* Char count */
.details-charcount { font-size: 11px; color: #6b7280; text-align: right; margin-top: 3px; }

/* Error banner inside modal */
.details-save-error {
    margin-top: 12px; padding: 10px 14px;
    border-radius: 10px;
    background: rgba(248,113,113,0.08);
    border: 1px solid rgba(248,113,113,0.25);
    color: #f87171; font-size: 13px; line-height: 1.5;
}


/* ==============================
   DM WINDOW — Friend Direct Messaging
============================== */

/* Message button on friend items in the panel */
.dm-friend-btn {
    background: rgba(167,139,250,0.12);
    border: 1px solid rgba(167,139,250,0.2);
    border-radius: 8px;
    color: #a78bfa;
    font-size: 15px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.dm-friend-btn:hover  { background: rgba(167,139,250,0.25); border-color: rgba(167,139,250,0.4); }
.dm-friend-btn.dm-has-unread {
    background: rgba(167,139,250,0.3);
    border-color: #a78bfa;
    animation: dm-pulse 1.8s ease-in-out infinite;
}
@keyframes dm-pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(167,139,250,0.4); }
    50%      { box-shadow: 0 0 0 5px rgba(167,139,250,0); }
}

/* ── Floating DM window ── */
.dm-window {
    position: fixed;
    bottom: 16px;
    right: 16px;   /* default; JS overrides for multi-window positioning */
    width: 300px;
    background: #0f172a;
    border: 1px solid rgba(167,139,250,0.2);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 520px;
    transition: box-shadow 0.15s;
}
.dm-window.hidden { display: none; }

/* Header */
.dm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(167,139,250,0.07);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.dm-header-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dm-header-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a78bfa, #ec4899);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: #fff;
    flex-shrink: 0;
    overflow: hidden; /* clips the img to the circle */
}
.dm-header-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.dm-header-name {
    font-size: 14px; font-weight: 600; color: #f1f5f9;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dm-header-status { font-size: 11px; color: #64748b; }
.dm-header-btns { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

/* Unread count badge shown inside header when window is minimized (desktop) */
.dm-win-badge {
    background: #ef4444;
    color: #fff;
    font-size: 10px; font-weight: 700;
    min-width: 18px; height: 18px;
    border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 5px;
    margin-right: 2px;
    animation: pulse-badge 1.2s ease infinite;
}
.dm-win-badge.hidden { display: none; }

.dm-close, .dm-minimize {
    background: none; border: none; color: #64748b;
    cursor: pointer; line-height: 1;
    padding: 4px 6px; border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.dm-close    { font-size: 22px; }
.dm-minimize { font-size: 16px; font-weight: 700; }
.dm-close:hover, .dm-minimize:hover { color: #f1f5f9; background: rgba(255,255,255,0.07); }

/* Minimized state — fully hidden on all screen sizes; bubble tray takes over */
.dm-window.dm-minimized { display: none !important; }

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.15); }
}

/* Message body — fixed height so the window never grows/shrinks */
.dm-body {
    height: 280px;
    overflow-y: auto;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    scroll-behavior: smooth;
}

/* "Loading older messages…" indicator prepended at top during pagination */
.dm-load-more-indicator {
    font-size: 11px;
    color: #64748b;
    text-align: center;
    padding: 6px 0;
    flex-shrink: 0;
}
.dm-body::-webkit-scrollbar { width: 4px; }
.dm-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.dm-loading, .dm-empty {
    color: #475569; font-size: 13px;
    text-align: center; margin: auto; padding: 20px 0;
}

/* Message bubbles */
.dm-msg { display: flex; flex-direction: column; max-width: 82%; }
.dm-mine   { align-self: flex-end;   align-items: flex-end; }
.dm-theirs { align-self: flex-start; align-items: flex-start; }

.dm-bubble {
    padding: 6px 10px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}
.dm-mine   .dm-bubble { background: #a78bfa;               color: #fff;     border-bottom-right-radius: 4px; }
.dm-theirs .dm-bubble { background: rgba(255,255,255,0.08); color: #cbd5e1;  border-bottom-left-radius:  4px; }

.dm-time { font-size: 10px; color: #475569; margin-top: 3px; padding: 0 2px; }

/* Typing indicator */
.dm-typing-hint {
    padding: 2px 14px 0;
    font-size: 11px; color: #64748b; font-style: italic;
    flex-shrink: 0;
}
.dm-typing-hint.hidden { display: none; }

/* Footer / input */
.dm-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.dm-input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 6px 10px;
    font-size: 13px;
    color: #f1f5f9;
    outline: none;
    font-family: inherit;
    resize: none;
    overflow: hidden;
    min-height: 32px;
    max-height: 80px;
    line-height: 1.4;
    transition: border-color 0.15s;
}
.dm-input::placeholder { color: #475569; }
.dm-input:focus { border-color: rgba(167,139,250,0.45); }

/* ── Quick Reply button ── */
.dm-qr-btn {
    background: rgba(167,139,250,0.15);
    color: #a78bfa;
    border: 1px solid rgba(167,139,250,0.3);
    border-radius: 50%;
    width: 30px; height: 30px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
}
.dm-qr-btn:hover {
    background: rgba(167,139,250,0.28);
    border-color: rgba(167,139,250,0.55);
}
.dm-qr-btn:active { transform: scale(0.93); }

/* ── Quick Reply popup ── */
.dm-qr-popup {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 8px 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
}
.dm-qr-popup.hidden { display: none; }
.dm-qr-chip {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(167,139,250,0.12);
    border: 1px solid rgba(167,139,250,0.25);
    color: #c4b5fd;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s, border-color 0.12s;
    user-select: none;
}
.dm-qr-chip:hover {
    background: rgba(167,139,250,0.25);
    border-color: rgba(167,139,250,0.5);
    color: #fff;
}

/* ── Image footer icon button ── */
.dm-img-btn {
    background: none;
    border: none;
    padding: 0;
    width: 28px; height: 28px;
    font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    color: #94a3b8;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s;
    line-height: 1;
}
.dm-img-btn:hover { background: rgba(255,255,255,0.08); color: #e2e8f0; }
.dm-img-btn:active { transform: scale(0.92); }

/* ── Textarea + emoji btn wrapper (Messenger style) ── */
.dm-input-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}
/* Override textarea to leave room for emoji btn on the right */
.dm-input-wrap .dm-input {
    flex: 1;
    padding-right: 32px;
}

/* Emoji button sits inside the right edge of the input-wrap */
.dm-emoji-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    width: 24px; height: 24px;
    font-size: 15px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    color: #64748b;
    transition: color 0.12s, background 0.12s;
    line-height: 1;
    flex-shrink: 0;
}
.dm-emoji-btn:hover { color: #e2e8f0; background: rgba(255,255,255,0.08); }
.dm-emoji-btn:active { transform: translateY(-50%) scale(0.88); }

/* ── Emoji picker panel ── */
.dm-emoji-picker {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 8px;
    width: 276px;
    background: #1e2535;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.55);
    z-index: 200;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.dm-emoji-picker.hidden { display: none; }

.dm-emoji-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding: 4px 6px 0;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
}
.dm-emoji-tabs::-webkit-scrollbar { display: none; }

.dm-emoji-tab {
    background: none;
    border: none;
    border-radius: 8px 8px 0 0;
    padding: 5px 8px;
    font-size: 16px;
    cursor: pointer;
    color: #64748b;
    transition: background 0.12s, color 0.12s;
    flex-shrink: 0;
    line-height: 1;
}
.dm-emoji-tab:hover { background: rgba(255,255,255,0.07); color: #e2e8f0; }
.dm-emoji-tab.active { background: rgba(139,92,246,0.18); color: #c4b5fd; }

.dm-emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 8px;
    max-height: 175px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.dm-emoji-grid::-webkit-scrollbar { width: 4px; }
.dm-emoji-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

.dm-emoji-item {
    background: none;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    padding: 3px 1px;
    cursor: pointer;
    text-align: center;
    line-height: 1;
    transition: background 0.1s, transform 0.1s;
}
.dm-emoji-item:hover { background: rgba(255,255,255,0.09); transform: scale(1.22); }

/* ── Image preview strip (above footer) ── */
.dm-img-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
}
.dm-img-preview.hidden { display: none; }

.dm-img-preview-thumb {
    width: 44px; height: 44px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.12);
    flex-shrink: 0;
}
.dm-img-preview-remove {
    background: rgba(239,68,68,0.18);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 50%;
    width: 20px; height: 20px;
    font-size: 10px;
    color: #f87171;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background 0.12s;
}
.dm-img-preview-remove:hover { background: rgba(239,68,68,0.35); }

/* ── Compact image bubble in message list ── */
.dm-bubble-img {
    line-height: 0;    /* kills phantom space below inline-block img */
    margin-bottom: 2px;
}
.dm-img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 10px;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
    transition: opacity 0.15s;
}
.dm-img:hover { opacity: 0.85; }

/* ── In-app image lightbox ── */
.dm-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dm-lightbox.hidden { display: none; }
.dm-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(4px);
}
.dm-lightbox-img {
    position: relative;
    max-width: 90vw;
    max-height: 88vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    object-fit: contain;
}
.dm-lightbox-close {
    position: absolute;
    top: 16px; right: 16px;
    background: rgba(255,255,255,0.12);
    border: none;
    border-radius: 50%;
    width: 38px; height: 38px;
    font-size: 20px;
    color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
    z-index: 1;
}
.dm-lightbox-close:hover { background: rgba(255,255,255,0.22); }

/* ── Light mode overrides ── */
html[data-theme="light"] .dm-img-btn { color: #64748b; }
html[data-theme="light"] .dm-img-btn:hover { background: rgba(0,0,0,0.06); color: #0f172a; }
html[data-theme="light"] .dm-emoji-btn { color: #94a3b8; }
html[data-theme="light"] .dm-emoji-btn:hover { background: rgba(0,0,0,0.06); color: #0f172a; }
html[data-theme="light"] .dm-emoji-picker {
    background: #ffffff;
    border-color: rgba(0,0,0,0.1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
html[data-theme="light"] .dm-emoji-tabs { border-bottom-color: rgba(0,0,0,0.08); }
html[data-theme="light"] .dm-emoji-tab { color: #94a3b8; }
html[data-theme="light"] .dm-emoji-tab:hover { background: rgba(0,0,0,0.05); color: #374151; }
html[data-theme="light"] .dm-emoji-tab.active { background: rgba(139,92,246,0.1); color: #6d28d9; }
html[data-theme="light"] .dm-emoji-item:hover { background: rgba(0,0,0,0.07); }
html[data-theme="light"] .dm-img-preview {
    border-top-color: rgba(0,0,0,0.07);
    background: rgba(0,0,0,0.02);
}
html[data-theme="light"] .dm-img-preview-thumb { border-color: rgba(0,0,0,0.1); }

/* ── Minimized chat bubble circles (right-side tray) — desktop + mobile ── */
.dm-bubbles-tray {
    display: flex;
    position: fixed;
    right: 12px;
    bottom: 16px;
    flex-direction: column-reverse;
    gap: 8px;
    z-index: 1095;
    pointer-events: none;
}
.dm-chat-bubble {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    border: 2px solid rgba(255,255,255,0.15);
    box-shadow: 0 3px 10px rgba(0,0,0,0.4);
    cursor: pointer;
    position: relative;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s;
    user-select: none;
    pointer-events: all;
    /* overflow: visible so the badge corner isn't clipped */
    overflow: visible;
}
/* Clip only the avatar image/initial inside the circle, not the badge */
.dm-chat-bubble > img,
.dm-chat-bubble > .dm-bubble-initial {
    border-radius: 50%;
    overflow: hidden;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.dm-chat-bubble:hover  { transform: scale(1.1); box-shadow: 0 5px 16px rgba(0,0,0,0.5); }
.dm-chat-bubble:active { transform: scale(0.94); }
.dm-bubble-initial {
    font-size: 15px; font-weight: 700; color: #fff; line-height: 1;
}
.dm-bubble-badge {
    position: absolute;
    top: -2px; right: -2px;
    background: #ef4444;
    color: #fff;
    font-size: 9px; font-weight: 700;
    min-width: 15px; height: 15px;
    border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px;
    border: 2px solid #0f172a;
    animation: pulse-badge 1.2s ease infinite;
}

/* ── Friends button dropdown ── */
.friends-btn-dropdown {
    position: fixed;
    background: #1e1e2e;
    border: 1px solid rgba(167,139,250,0.25);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.55);
    z-index: 9000;
    min-width: 160px;
    overflow: hidden;
    animation: fadeInDown 0.12s ease;
}
.fbd-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 11px 16px;
    font-size: 14px;
    color: #e2e8f0;
    cursor: pointer;
    transition: background 0.12s;
}
.fbd-item:hover { background: rgba(167,139,250,0.12); }
.fbd-danger { color: #f87171; }
.fbd-danger:hover { background: rgba(248,113,113,0.12); }

/* ── Unfriend confirmation modal ── */
.unfriend-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}
.unfriend-modal {
    background: #1e1e2e;
    border: 1px solid rgba(167,139,250,0.25);
    border-radius: 16px;
    padding: 28px 28px 24px;
    max-width: 360px;
    width: calc(100% - 40px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.6);
    animation: scaleIn 0.15s ease;
}
.unfriend-modal-title {
    font-size: 17px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 10px;
}
.unfriend-modal-body {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.5;
    margin-bottom: 22px;
}
.unfriend-modal-body strong { color: #e2e8f0; }
.unfriend-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.unfriend-cancel {
    background: rgba(255,255,255,0.07);
    color: #cbd5e1;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}
.unfriend-cancel:hover { background: rgba(255,255,255,0.12); }
.unfriend-confirm {
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.unfriend-confirm:hover { background: #dc2626; }
.unfriend-confirm:disabled { opacity: 0.6; cursor: not-allowed; }

@keyframes scaleIn {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

/* Mobile: full-screen overlay + circles for minimized */
@media (max-width: 600px) {
    .dm-window {
        right: 0 !important; bottom: 0; left: 0;
        width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 75vh;
    }
    /* On mobile, bubbles tray shifts up to avoid bottom bar */
    .dm-bubbles-tray { bottom: 70px; right: 8px; }
}

/* ==============================
   REPORT POST MODAL
============================== */

.report-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.report-modal {
    background: var(--card-bg, #1e1e2e);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 14px;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.report-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
    font-weight: 600;
    font-size: 15px;
    color: var(--text, #f0f0f0);
}

.report-modal-close {
    background: none;
    border: none;
    color: var(--muted, #888);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.15s;
}
.report-modal-close:hover { background: rgba(255,255,255,0.08); }

.report-modal-body {
    padding: 16px;
}

.report-modal .status-input,
.report-modal .repost-quote-input {
    width: 100%;
    box-sizing: border-box;
}

.repost-share-target {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
}

.repost-share-label {
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.repost-share-select {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 12px;
    padding: 10px 12px;
    color: #e5e7eb;
    font: inherit;
    outline: none;
}

.repost-share-select:focus {
    border-color: rgba(139,92,246,0.55);
    box-shadow: 0 0 0 3px rgba(139,92,246,0.12);
}

.repost-share-hint {
    margin: -4px 0 12px;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.4;
}

.repost-modal {
    width: min(560px, calc(100vw - 24px));
    max-height: min(78vh, 720px);
    display: flex;
    flex-direction: column;
}

.repost-modal .report-modal-body {
    overflow-y: auto;
    padding: 14px 16px;
}

.repost-modal .report-modal-footer {
    flex-shrink: 0;
}

.repost-quote-input-compact {
    min-height: 92px;
    max-height: 180px;
    resize: vertical;
}

.report-modal-desc {
    font-size: 13px;
    color: var(--muted, #999);
    margin: 0 0 12px;
}

.report-reason-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.report-reason-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text, #f0f0f0);
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}
.report-reason-item:hover { background: rgba(255,255,255,0.05); }
.report-reason-item input[type="radio"] { accent-color: #e84040; cursor: pointer; }
.report-reason-item:has(input:checked) {
    background: rgba(232,64,64,0.1);
    border-color: rgba(232,64,64,0.35);
}

.report-hide-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    font-size: 13px;
    color: var(--text, #e0e0e0);
    cursor: pointer;
}
.report-hide-row input[type="checkbox"] { accent-color: #e84040; cursor: pointer; }

.report-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border, rgba(255,255,255,0.08));
}

.report-cancel-btn {
    background: none;
    border: 1px solid var(--border, rgba(255,255,255,0.12));
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 13px;
    color: var(--muted, #aaa);
    cursor: pointer;
    transition: background 0.15s;
}
.report-cancel-btn:hover { background: rgba(255,255,255,0.06); }

.report-submit-btn {
    background: #e84040;
    border: none;
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.15s;
}
.report-submit-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.report-submit-btn:not(:disabled):hover { opacity: 0.85; }

.report-modal .repost-preview-link {
    text-decoration: none;
    color: inherit;
}

.report-modal .repost-shell {
    margin: 0;
}

.report-post-preview {
    margin-bottom: 12px;
}

.repost-preview-slot {
    margin-top: 12px;
    padding-left: 10px;
    border-left: 2px solid rgba(255,255,255,0.10);
}

.repost-preview-slot-compact {
    margin-top: 8px;
}

.repost-shell {
    position: relative;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    box-shadow: none;
}

.repost-shell-compact {
    border-radius: 14px;
}

.repost-preview-link,
.repost-preview-link:hover,
.repost-preview-link .post-author,
.repost-preview-link .post-time,
.repost-preview-link .post-body {
    text-decoration: none;
}

.repost-preview-head {
    padding: 8px 10px 4px;
    gap: 8px;
}

.repost-preview-avatar {
    width: 30px;
    height: 30px;
}

.repost-preview-body {
    padding: 0 10px 8px;
}

.repost-preview-body .post-body-text {
    font-size: 13px;
    line-height: 1.42;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.repost-preview-image-wrap {
    margin: 0 10px 10px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
}

/* ==============================
   SKELETON LOADING
============================== */

@keyframes skel-shimmer {
    0%   { background-position: 200% center; }
    100% { background-position: -200% center; }
}

.skel {
    background: linear-gradient(90deg,
        var(--skel-base,  rgba(255,255,255,0.05)) 25%,
        var(--skel-shine, rgba(255,255,255,0.13)) 50%,
        var(--skel-base,  rgba(255,255,255,0.05)) 75%);
    background-size: 200% 100%;
    animation: skel-shimmer 1.4s ease-in-out infinite;
    border-radius: 8px;
    color: transparent !important;
    pointer-events: none;
    user-select: none;
}
.skel * { visibility: hidden !important; }

/* Avatar keeps its circular shape */
.avatar.skel { border-radius: 50%; box-shadow: none; }

/* Stat values need a minimum size to shimmer visibly */
.stat-value.skel    { display: inline-block; min-width: 36px; min-height: 20px; }
.gf-stat-value.skel { display: inline-block; min-width: 28px; min-height: 16px; border-radius: 4px; }
.gf-profile-name.skel { min-width: 100px; min-height: 18px; }

/* Skeleton post card */
.skel-post {
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 10px;
    background: var(--skel-base, rgba(255,255,255,0.05));
    border: 1px solid rgba(255,255,255,0.04);
}
.skel-post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.skel-circle    { border-radius: 50% !important; flex-shrink: 0; }
.skel-lines     { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.skel-line      { border-radius: 5px; height: 11px; }
.skel-body      { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.skel-foot      { display: flex; gap: 8px; }
.skel-btn       { border-radius: 8px; height: 26px; width: 60px; }

html[data-theme="light"] .reaction-list-item {
    background: #f8fafc;
    border-color: rgba(148,163,184,0.18);
}

html[data-theme="light"] .reaction-list-tab {
    background: #f8fafc;
    color: #475569;
    border-color: rgba(148,163,184,0.22);
}

html[data-theme="light"] .reaction-list-tab.active {
    background: #ede9fe;
    color: #5b21b6;
    border-color: rgba(139,92,246,0.22);
}

html[data-theme="light"] .reaction-list-item:hover {
    background: #ffffff;
    border-color: rgba(139,92,246,0.24);
}

html[data-theme="light"] .reaction-list-name {
    color: #0f172a;
}

html[data-theme="light"] .reaction-list-sub {
    color: #64748b;
}

html[data-theme="light"] .reaction-list-type {
    color: #475569;
}

html[data-theme="light"] .profile-highlight-placeholder {
    background: #f8fafc;
    border-color: rgba(148,163,184,0.18);
}

html[data-theme="light"] .highlight-photo-remove {
    background: rgba(255,255,255,0.92);
    color: #334155;
    box-shadow: 0 4px 12px rgba(15,23,42,0.08);
}

html[data-theme="light"] .profile-highlights-empty,
html[data-theme="light"] .highlight-create-note {
    color: #64748b;
}

html[data-theme="light"] .highlight-viewer-error {
    color: #dc2626;
}

html[data-theme="light"] .highlight-delete-confirm-text {
    color: #dc2626;
}
