/* ============================================
   Gacnoba.life – Modern Design System v2.0
   ============================================ */

/* ---- Georgian Fonts ---- */
@font-face {
    font-family: 'BPG Glaho Arial';
    src: url('../fonts/bpg-glaho-arial-webfont.woff2') format('woff2'),
        url('../fonts/bpg-glaho-arial-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'BPG Nino Mtavruli';
    src: url('../fonts/bpg_nino_mtavruli_normal.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Qilka';
    src: url('../fonts/Qilka-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* =============================================
   CSS VARIABLES — Light / Dark theme
   ============================================= */
:root {
    --bg-body: #f4f6fb;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9ff;
    --bg-input: #f5f6fa;
    --bg-sidebar: #ffffff;
    --bg-hover: rgba(0,0,0,.04);
    --text-main: #1e2330;
    --text-muted: #7c8494;
    --text-link: #4f6df5;
    --border-color: #ebeef5;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .04), 0 1px 2px rgba(0, 0, 0, .03);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .07);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, .10);
    --navbar-bg: linear-gradient(135deg, #1a1e36 0%, #232a4a 100%);
    --navbar-border: rgba(255, 255, 255, .06);
    --accent: #4f6df5;
    --accent-hover: #3b57e0;
    --accent-soft: rgba(79,109,245,.10);
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --info: #3b82f6;
    --online-color: #22c55e;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition: .2s cubic-bezier(.4, 0, .2, 1);
    --chat-mine-bg: linear-gradient(135deg, #4f6df5, #7c5ce7);
    --chat-them-bg: #f0f2f8;
    --chat-them-text: #1e2330;
    --card-bg: #ffffff;
}

[data-bs-theme="dark"] {
    --bg-body: #0d0f15;
    --bg-card: #171a28;
    --bg-card-hover: #1e2236;
    --bg-input: #1e2236;
    --bg-sidebar: #171a28;
    --bg-hover: rgba(255,255,255,.05);
    --text-main: #e4e7f0;
    --text-muted: #7d859e;
    --text-link: #7b93f7;
    --border-color: #252840;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .25);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .35);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, .45);
    --navbar-bg: linear-gradient(135deg, #0e1120 0%, #141830 100%);
    --navbar-border: rgba(255, 255, 255, .05);
    --accent: #5b7bf7;
    --accent-hover: #4868e8;
    --accent-soft: rgba(91,123,247,.12);
    --chat-mine-bg: linear-gradient(135deg, #3b57e0, #6d42d9);
    --chat-them-bg: #1e2236;
    --chat-them-text: #e4e7f0;
    --card-bg: #171a28;
}

/* =============================================
   BASE
   ============================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'BPG Glaho Arial', 'Noto Sans Georgian', system-ui, -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    line-height: 1.7;
    letter-spacing: .01em;
    transition: background var(--transition), color var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    flex: 1;
}

h1,
h2,
h3,
h4,
h5,
.navbar-brand {
    font-family: 'BPG Nino Mtavruli', 'BPG Glaho Arial', 'Noto Sans Georgian', sans-serif;
}

a {
    color: var(--text-link);
    transition: color var(--transition);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c0c6d9;
    border-radius: 99px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #3a3f5c;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0a8c0;
}

/* Selection */
::selection {
    background: rgba(37, 99, 235, .25);
}

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
    background: var(--navbar-bg) !important;
    border-bottom: 1px solid var(--navbar-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: .5rem 0;
    transition: background var(--transition);
    overflow: visible;
    box-shadow: 0 2px 20px rgba(0,0,0,.12);
}

/* Push nav-link badges down so they aren't clipped by navbar top edge */
.navbar .nav-link .badge,
.navbar .btn.nav-link .badge {
    top: 4px !important;
    transform: translate(-50%, 0) !important;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: .3px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
    padding: .4rem .6rem !important;
}

.nav-link:hover,
.nav-link:focus {
    background: rgba(255, 255, 255, .12);
}

.navbar .dropdown-menu {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg);
    padding: .4rem;
    /* Force float — Bootstrap sets position:static inside navbar without navbar-expand-* */
    position: absolute !important;
}

.navbar .dropdown-item {
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: .5rem .75rem;
    transition: background var(--transition);
    font-size: .88rem;
}

.navbar .dropdown-item:hover {
    background: var(--bg-card-hover);
    color: var(--accent);
}

.navbar .dropdown-divider {
    border-color: var(--border-color);
}

/* Dark mode toggle button */
#darkToggle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    font-size: .95rem;
}

#darkToggle:hover {
    background: rgba(255, 255, 255, .2);
    transform: rotate(20deg);
}

/* =============================================
   CARDS
   ============================================= */
.card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: box-shadow .25s ease, transform .25s ease, background var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md) !important;
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
    font-weight: 600;
    padding: .85rem 1rem;
}

.card-body {
    padding: 1rem;
}

/* Gradient card headers */
.card-header.gh-primary {
    background: linear-gradient(135deg, #4f6df5, #7c5ce7) !important;
    color: #fff;
    border: none !important;
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

.card-header.gh-success {
    background: linear-gradient(135deg, #059669, #10b981) !important;
    color: #fff;
    border: none !important;
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

.card-header.gh-danger {
    background: linear-gradient(135deg, #dc2626, #f43f5e) !important;
    color: #fff;
    border: none !important;
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

.card-header.gh-warning {
    background: linear-gradient(135deg, #d97706, #f59e0b) !important;
    color: #fff;
    border: none !important;
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

.card-header.gh-info {
    background: linear-gradient(135deg, #0284c7, #38bdf8) !important;
    color: #fff;
    border: none !important;
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

.card-header.gh-dark {
    background: linear-gradient(135deg, #1e293b, #334155) !important;
    color: #fff;
    border: none !important;
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

.card-header.gh-love {
    background: linear-gradient(135deg, #be185d, #f43f5e) !important;
    color: #fff;
    border: none !important;
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

/* =============================================
   INPUTS & FORMS
   ============================================= */
.form-control,
.form-select {
    background: var(--bg-input) !important;
    border: 1.5px solid var(--border-color) !important;
    color: var(--text-main) !important;
    border-radius: var(--radius-sm) !important;
    padding: .6rem .85rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    font-size: .9rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15) !important;
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Input-group: icon + input + toggle seamlessly joined */
.input-group>.input-group-text {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group>.form-control {
    border-left: none !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: var(--radius-sm) !important;
    border-bottom-right-radius: var(--radius-sm) !important;
}

/* When followed by pass-toggle, input has no right radius */
.input-group>.form-control:not(:last-child) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group-text {
    background: var(--bg-input) !important;
    border: 1.5px solid var(--border-color) !important;
    border-right: none !important;
    color: var(--text-muted);
    border-top-left-radius: var(--radius-sm) !important;
    border-bottom-left-radius: var(--radius-sm) !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* Pass-toggle button — right side of input-group */
.input-group .pass-toggle {
    background: var(--bg-input) !important;
    border: 1.5px solid var(--border-color) !important;
    border-left: none !important;
    color: var(--text-muted) !important;
    padding-left: .65rem;
    padding-right: .65rem;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: var(--radius-sm) !important;
    border-bottom-right-radius: var(--radius-sm) !important;
}

.input-group .pass-toggle:hover {
    color: var(--accent) !important;
    background: var(--bg-card) !important;
}

.input-group>.form-control:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15) !important;
    z-index: 3;
}

.form-label {
    font-weight: 600;
    font-size: .85rem;
    color: var(--text-main);
    margin-bottom: .35rem;
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    border-radius: var(--radius-sm) !important;
    font-weight: 600;
    font-size: .88rem;
    transition: transform .15s ease, box-shadow .2s ease, background var(--transition);
    padding: .5rem 1.1rem;
    letter-spacing: .01em;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
}

.btn-primary:hover {
    background: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, .35) !important;
}

.btn-gradient-primary {
    background: linear-gradient(135deg, #4f6df5, #7c5ce7) !important;
    border: none !important;
    color: #fff;
}

.btn-gradient-primary:hover {
    box-shadow: 0 4px 16px rgba(124, 92, 231, .35) !important;
    color: #fff;
}

.btn-gradient-love {
    background: linear-gradient(135deg, #be185d, #f43f5e) !important;
    border: none !important;
    color: #fff;
}

.btn-gradient-love:hover {
    box-shadow: 0 6px 20px rgba(244, 63, 94, .4) !important;
    color: #fff;
}

/* =============================================
   ONLINE INDICATOR
   ============================================= */
.online-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--online-color);
    border: 2px solid var(--bg-card);
    vertical-align: middle;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, .5);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
    }
}

.offline-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #9ca3af;
    border: 2px solid var(--bg-card);
    vertical-align: middle;
}

/* =============================================
   WALL / FEED
   ============================================= */
.wall-post-card {
    border-left: 3px solid transparent !important;
    transition: border-left-color var(--transition), box-shadow var(--transition) !important;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .wall-post-card:hover {
        border-left-color: var(--accent) !important;
        box-shadow: var(--shadow-md) !important;
    }
}

.post-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: .96rem;
    line-height: 1.7;
    color: var(--text-main);
}

.post-actions {
    border-top: 1px solid var(--border-color);
}

/* Like animation */
.like-btn {
    border: none !important;
    background: transparent !important;
    color: var(--text-muted) !important;
}

.like-btn:hover {
    color: var(--danger) !important;
    transform: scale(1.15) !important;
}

.like-btn.liked-anim {
    animation: heartPop .35s cubic-bezier(.36, .07, .19, .97);
}

@keyframes heartPop {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.45) rotate(-8deg);
    }

    70% {
        transform: scale(.95) rotate(4deg);
    }

    100% {
        transform: scale(1);
    }
}

/* =============================================
   CHAT
   ============================================= */
#chat-messages {
    height: 480px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-body);
    border-radius: var(--radius-md);
    scroll-behavior: smooth;
}

.chat-bubble {
    display: inline-block;
    border-radius: 16px;
    padding: .5rem .9rem;
    max-width: 72%;
    word-break: break-word;
    font-size: .92rem;
    line-height: 1.55;
    box-shadow: var(--shadow-sm);
}

.chat-bubble.mine {
    background: var(--chat-mine-bg);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-bubble.theirs {
    background: var(--chat-them-bg);
    color: var(--chat-them-text);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

/* =============================================
   USER CARDS
   ============================================= */
.user-card {
    transition: transform .25s ease, box-shadow .25s ease;
    cursor: pointer;
}

.user-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(79, 109, 245, .12) !important;
}

/* =============================================
   AVATARS
   ============================================= */
.avatar-ring {
    border: 3px solid var(--border-color);
    border-radius: 50%;
    object-fit: cover;
}

.avatar-ring.online {
    border-color: var(--online-color);
}

.avatar-xl {
    width: 90px;
    height: 90px;
    object-fit: cover;
}

.avatar-lg {
    width: 60px;
    height: 60px;
    object-fit: cover;
}

.avatar-md {
    width: 42px;
    height: 42px;
    object-fit: cover;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    object-fit: cover;
}

.avatar-xs {
    width: 26px;
    height: 26px;
    object-fit: cover;
}

/* =============================================
   BADGES & LEVELS
   ============================================= */
.badge {
    border-radius: 6px !important;
}

.level-badge-1 {
    background: #6b7280 !important;
}

.level-badge-2 {
    background: linear-gradient(135deg, #059669, #10b981) !important;
}

.level-badge-3 {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6) !important;
}

.level-badge-4 {
    background: linear-gradient(135deg, #7c3aed, #a78bfa) !important;
}

.level-badge-5 {
    background: linear-gradient(135deg, #f59e0b, #ef4444) !important;
}

/* =============================================
   LIST GROUPS
   ============================================= */
.list-group-item {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-main) !important;
    transition: background var(--transition);
}

.list-group-item-action {
    color: var(--text-main) !important;
}

.list-group-item-action:hover {
    background: var(--bg-card-hover) !important;
    color: var(--accent) !important;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar-online a:hover img {
    transform: scale(1.1);
    transition: transform .2s;
}

.sidebar-widget .list-group-item {
    border: none !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: .55rem .85rem;
}

/* =============================================
   FLASH / TOAST
   ============================================= */
.flash-toast {
    position: fixed;
    top: 68px;
    right: 1rem;
    z-index: 9999;
    min-width: 300px;
    max-width: 420px;
    pointer-events: none;
}

.flash-toast .alert {
    border: none !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
    backdrop-filter: blur(12px);
    pointer-events: all;
    animation: toastIn .35s cubic-bezier(.21, .61, .35, 1);
    font-weight: 500;
}

@keyframes toastIn {
    from {
        transform: translateX(110%) scale(.95);
        opacity: 0;
    }

    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* Legacy flash-alert support */
.flash-alert {
    position: fixed;
    top: 68px;
    right: 1rem;
    z-index: 9999;
    min-width: 300px;
    max-width: 420px;
    animation: toastIn .35s cubic-bezier(.21, .61, .35, 1);
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
}

/* =============================================
   PAGINATION
   ============================================= */
.pagination .page-link {
    border-radius: var(--radius-sm) !important;
    margin: 0 2px;
    color: var(--accent);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: background var(--transition), color var(--transition);
    font-weight: 500;
}

.pagination .page-link:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.pagination .page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 3px 10px rgba(37, 99, 235, .3);
}

/* =============================================
   FORUM
   ============================================= */
.forum-cat-row {
    border-left: 4px solid transparent !important;
    transition: border-color var(--transition), background var(--transition);
}

.forum-cat-row:hover {
    border-left-color: var(--accent) !important;
    background: var(--bg-card-hover) !important;
}

.forum-topic-row:hover {
    background: var(--bg-card-hover) !important;
}

.forum-pinned {
    border-left: 3px solid var(--warning) !important;
}

.forum-locked .topic-title {
    color: var(--text-muted);
}

/* =============================================
   LOVE / MATCH
   ============================================= */
.love-card-wrap {
    perspective: 1000px;
}

.love-card {
    transition: transform .5s cubic-bezier(.23, 1, .32, 1), opacity .35s;
}

.love-card.swipe-left {
    transform: translateX(-140%) rotate(-25deg);
    opacity: 0;
}

.love-card.swipe-right {
    transform: translateX(140%) rotate(25deg);
    opacity: 0;
}

.love-action-like {
    background: linear-gradient(135deg, #10b981, #34d399) !important;
    border: none !important;
    color: #fff;
}

.love-action-skip {
    background: linear-gradient(135deg, #6b7280, #9ca3af) !important;
    border: none !important;
    color: #fff;
}

/* =============================================
   PROFILE
   ============================================= */
.profile-cover {
    height: 200px;
    background: linear-gradient(135deg, #1a1e36 0%, #4f6df5 50%, #7c5ce7 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: relative;
}

.profile-avatar-wrap {
    margin-top: -50px;
    position: relative;
    z-index: 2;
}

.profile-avatar-wrap img {
    border: 4px solid var(--bg-card);
    box-shadow: var(--shadow-md);
}

.profile-stat {
    text-align: center;
    padding: .5rem .75rem;
}

.profile-stat .stat-val {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent);
}

.profile-stat .stat-lbl {
    font-size: .73rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* =============================================
   HERO (landing)
   ============================================= */
.hero-banner {
    background: linear-gradient(135deg, #1a1e36 0%, #4f6df5 40%, #7c5ce7 80%, #a855f7 100%);
    border-radius: var(--radius-lg) !important;
    overflow: hidden;
    position: relative;
}

.hero-banner::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='%23ffffff' fill-opacity='0.04'%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");
}

/* =============================================
   TABS
   ============================================= */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
}

.nav-tabs .nav-link {
    border: none !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    color: var(--text-muted);
    font-weight: 500;
    padding: .55rem 1rem;
    margin-bottom: -2px;
    background: transparent !important;
}

.nav-tabs .nav-link:hover {
    color: var(--accent);
    border-bottom-color: var(--accent) !important;
}

.nav-tabs .nav-link.active {
    color: var(--accent) !important;
    border-bottom-color: var(--accent) !important;
    font-weight: 700;
}

.nav-pills .nav-link {
    border-radius: var(--radius-sm) !important;
    color: var(--text-muted);
    background: transparent;
    font-weight: 500;
}

.nav-pills .nav-link:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
}

.nav-pills .nav-link.active {
    background: var(--accent) !important;
    color: #fff !important;
}

/* =============================================
   ALERTS
   ============================================= */
.alert {
    border: none !important;
    border-radius: var(--radius-sm) !important;
    font-size: .9rem;
}

.alert-success {
    background: rgba(16, 185, 129, .12) !important;
    color: #065f46;
    border-left: 4px solid #10b981 !important;
}

.alert-danger {
    background: rgba(239, 68, 68, .10) !important;
    color: #991b1b;
    border-left: 4px solid #ef4444 !important;
}

.alert-warning {
    background: rgba(245, 158, 11, .10) !important;
    color: #92400e;
    border-left: 4px solid #f59e0b !important;
}

.alert-info {
    background: rgba(59, 130, 246, .10) !important;
    color: #1e40af;
    border-left: 4px solid #3b82f6 !important;
}

[data-bs-theme="dark"] .alert-success {
    color: #6ee7b7 !important;
}

[data-bs-theme="dark"] .alert-danger {
    color: #fca5a5 !important;
}

[data-bs-theme="dark"] .alert-warning {
    color: #fcd34d !important;
}

[data-bs-theme="dark"] .alert-info {
    color: #93c5fd !important;
}

/* =============================================
   TABLE
   ============================================= */
.table {
    color: var(--text-main);
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--bg-card-hover);
    --bs-table-border-color: var(--border-color);
}

.table thead th {
    background: var(--bg-body);
    color: var(--text-muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 2px solid var(--border-color);
    padding: .65rem .85rem;
}

/* =============================================
   FOOTER
   ============================================= */
footer {
    background: var(--bg-card) !important;
    border-top: 1px solid var(--border-color) !important;
    font-size: .85rem;
    color: var(--text-muted);
    margin-top: auto;
}

footer a {
    color: var(--text-muted);
}

footer a:hover {
    color: var(--accent);
}

/* =============================================
   STAR RATING
   ============================================= */
.rating-widget .rate-star {
    transition: transform .15s;
}

.rating-widget .rate-star:hover {
    transform: scale(1.3);
}

/* =============================================
   GIFT CARDS
   ============================================= */
.gift-item {
    cursor: pointer;
    border: 2px solid transparent !important;
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
    text-align: center;
    padding: 1rem .5rem;
}

.gift-item:hover {
    border-color: var(--accent) !important;
    transform: translateY(-4px);
    box-shadow: var(--shadow-md) !important;
}

.gift-item .gift-emoji {
    font-size: 2rem;
}

/* =============================================
   STATUS / MOOD
   ============================================= */
.status-post-card {
    border-left: 3px solid var(--accent) !important;
}

.mood-badge {
    font-size: 1.2rem;
}

/* =============================================
   SEARCH BAR
   ============================================= */
.global-search {
    max-width: 220px;
    transition: max-width .3s ease;
}

.global-search:focus {
    max-width: 320px;
}

/* =============================================
   MODAL
   ============================================= */
.modal-content {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

.btn-close {
    filter: var(--bs-btn-close-white-filter, none);
}

[data-bs-theme="dark"] .btn-close {
    filter: invert(1);
}

/* =============================================
   SPACING HELPERS
   ============================================= */
.gap-xs {
    gap: .35rem !important;
}

.rounded-xl {
    border-radius: var(--radius-xl) !important;
}

/* =============================================
   RESPONSIVE — tablet
   ============================================= */
@media (max-width: 768px) {
    .chat-bubble {
        max-width: 88%;
    }

    #chat-messages {
        height: 380px;
    }

    .global-search {
        max-width: 160px;
    }

    .profile-cover {
        height: 120px;
    }
}

@media (max-width: 576px) {
    body {
        font-size: .9rem;
    }

    .navbar-brand {
        font-size: 1rem;
        margin-right: .5rem !important;
        gap: 3px !important;
    }

    .nb-heart {
        font-size: .95rem;
    }

    .nb-name,
    .nb-tld {
        font-size: .88rem !important;
    }

    .navbar .navbar-nav.flex-row {
        gap: 0 !important;
    }

    .nb-icon {
        width: 30px;
        height: 30px;
    }

    .nb-icon i {
        font-size: .8rem;
    }

    #darkToggle {
        width: 28px;
        height: 28px;
        font-size: .8rem;
    }

    .navbar > .container-fluid {
        padding-left: 8px !important;
        padding-right: 8px !important;
        gap: 4px !important;
    }

    .navbar-toggler {
        padding: 2px !important;
        margin-right: 2px !important;
        font-size: 1.15rem !important;
    }

    .card-body {
        padding: .75rem;
    }

    .global-search {
        display: none !important;
    }
}

/* =============================================
   MOBILE BOTTOM NAVIGATION BAR
   ============================================= */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 767.98px) {

    /* Show bottom nav only on mobile */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: var(--bg-card);
        border-top: 1px solid var(--border-color);
        z-index: 1050;
        align-items: stretch;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, .10);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    body {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }

    .mobile-bottom-nav .mbn-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        text-decoration: none;
        color: var(--text-muted);
        font-size: .58rem;
        font-weight: 600;
        border: none;
        background: transparent;
        cursor: pointer;
        position: relative;
        transition: color var(--transition);
        min-height: 44px;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-bottom-nav .mbn-item i {
        font-size: 1.25rem;
        line-height: 1;
    }

    .mobile-bottom-nav .mbn-item.active,
    .mobile-bottom-nav .mbn-item:active {
        color: var(--accent);
    }

    .mobile-bottom-nav .mbn-item.active i {
        transform: scale(1.12);
    }

    .mobile-bottom-nav .mbn-badge {
        position: absolute;
        top: 4px;
        right: calc(50% - 18px);
        background: var(--danger);
        color: #fff;
        font-size: .5rem;
        font-weight: 700;
        border-radius: 99px;
        padding: 1px 4px;
        min-width: 14px;
        text-align: center;
        line-height: 1.4;
    }

    /* Body padding so content doesn't hide behind bottom nav */
    body {
        padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* ---- Touch-friendly tap targets ---- */
    .btn,
    .nav-link,
    .dropdown-item,
    .list-group-item-action {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .btn {
        justify-content: center;
    }

    /* ---- Forms — prevent iOS auto-zoom (font must be >= 16px) ---- */
    input,
    textarea,
    select,
    .form-control,
    .form-select {
        font-size: 16px !important;
    }

    /* ---- Navbar collapse improvements ---- */
    #navMain {
        padding: .5rem 0 .75rem;
        border-top: 1px solid var(--navbar-border);
        margin-top: .3rem;
    }

    #navMain .nav-link {
        padding: .65rem .75rem !important;
        font-size: .95rem;
    }

    #navMain .dropdown-menu {
        position: static !important;
        transform: none !important;
        box-shadow: none !important;
        border: none !important;
        background: rgba(255, 255, 255, .06) !important;
        border-radius: var(--radius-sm) !important;
        margin: .25rem .5rem !important;
        padding: .3rem !important;
    }

    #navMain .dropdown-item {
        color: rgba(255, 255, 255, .9) !important;
        font-size: .88rem;
        padding: .55rem .85rem;
    }

    #navMain .dropdown-item:hover {
        background: rgba(255, 255, 255, .12) !important;
        color: #fff !important;
    }

    .navbar-toggler {
        order: -1;
    }

    /* ---- Card & layout ---- */
    .card {
        border-radius: var(--radius-sm) !important;
    }

    .row.g-4>* {
        padding-bottom: .5rem;
    }

    /* ---- Chat full-width on mobile ---- */
    #chat-messages {
        height: 55vh;
        border-radius: var(--radius-sm);
    }

    /* Old chat input (NOT inside .chat-app) */
    .chat-input-area:not(.chat-app .chat-input-area) {
        position: sticky;
        bottom: 0;
        background: var(--bg-card);
        padding: .5rem;
        border-top: 1px solid var(--border-color);
        z-index: 10;
    }

    /* ---- Profile cover ---- */
    .profile-cover {
        height: 130px;
    }

    .avatar-xl {
        width: 72px;
        height: 72px;
    }

    .profile-stat .stat-val {
        font-size: 1.1rem;
    }

    /* ---- Flash toast full-width ---- */
    .flash-toast,
    .flash-alert {
        left: .5rem;
        right: .5rem;
        min-width: unset;
        max-width: unset;
        top: 70px;
    }

    /* ---- Hide desktop sidebar on mobile ---- */
    .col-lg-4.d-none.d-lg-block {
        display: none !important;
    }

    /* — Love swipe card full screen feel — */
    .love-card-wrap {
        max-width: 340px;
        margin: 0 auto;
    }

    /* ---- Pagination compact ---- */
    .pagination .page-link {
        padding: .38rem .6rem;
        font-size: .8rem;
    }

    /* ---- Table scroll ---- */
    table.table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* ---- Modal full-screen on mobile ---- */
    .modal-dialog {
        margin: 0;
        max-width: 100%;
    }

    .modal-content {
        border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
    }

    .modal.show .modal-dialog {
        align-items: flex-end;
    }

    .modal {
        --bs-modal-margin: 0;
    }
}

/* =============================================
   MOBILE — active nav highlight (JS will add class)
   ============================================= */
.mobile-bottom-nav .mbn-item .mbn-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 48px;
    height: 36px;
    background: rgba(37, 99, 235, .10);
    border-radius: 18px;
    transition: transform .2s cubic-bezier(.4, 0, .2, 1);
    z-index: -1;
}

.mobile-bottom-nav .mbn-item.active .mbn-bg {
    transform: translate(-50%, -50%) scale(1);
}

/* =============================================
   PWA — standalone mode tweaks
   ============================================= */
@media all and (display-mode: standalone) {
    .navbar {
        padding-top: calc(.45rem + env(safe-area-inset-top, 0px)) !important;
    }

    body {
        padding-bottom: calc(60px + env(safe-area-inset-bottom, 4px)) !important;
    }
}

/* =============================================
   GUEST LANDING — auth-first layout
   ============================================= */
.guest-landing {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
}

@media (max-width: 767.98px) {
    .guest-landing {
        min-height: unset;
        padding: 1.5rem 0 2rem;
    }
}

/* =============================================
   PAGE TRANSITIONS
   ============================================= */
main {
    animation: fadeUp .3s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================
   LOADING SPINNER
   ============================================= */
.spinner-glow {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =============================================
   OFFCANVAS DRAWER
   ============================================= */
.offcanvas {
    background: var(--bg-card) !important;
    border-right: 1px solid var(--border-color) !important;
}

.offcanvas-header {
    background: var(--navbar-bg) !important;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.drawer-section {
    padding: .25rem 0;
    border-bottom: 1px solid var(--border-color);
}

.drawer-section:last-child {
    border-bottom: none;
}

.drawer-section-title {
    padding: .55rem 1rem .2rem;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--text-muted);
    pointer-events: none;
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1.1rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: .91rem;
    font-weight: 500;
    transition: background var(--transition);
    border-radius: 0;
}

.drawer-link:hover,
.drawer-link:active {
    background: var(--bg-body);
    color: var(--accent);
}

.drawer-link i {
    font-size: 1rem;
    flex-shrink: 0;
    width: 1.2rem;
    text-align: center;
}

/* =============================================
   FRIENDS SIDEBAR (Facebook-style)
   ============================================= */
/* ─── Page body: flex row (main + friends sidebar) ─── */
.page-body {
    display: flex;
    align-items: flex-start;
    flex: 1;
    /* push footer to bottom (body is flex column) */
}

.page-body>main {
    flex: 1;
    min-width: 0;
}

#friendsSidebar {
    position: sticky;
    top: var(--navbar-h, 54px);
    width: 260px;
    height: calc(100vh - var(--navbar-h, 54px));
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    box-shadow: -4px 0 12px rgba(0, 0, 0, .08);
    overflow: hidden;
    z-index: 100;
}

.fs-header {
    padding: .6rem .9rem .5rem;
    font-weight: 700;
    font-size: .82rem;
    display: flex;
    align-items: center;
    gap: .45rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--navbar-bg);
    color: #fff;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 2;
}

.fs-header .fs-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 1rem;
    line-height: 1;
}

.fs-header .fs-close:hover {
    color: var(--text-main);
    background: var(--bg-hover);
}

.fs-section-title {
    font-size: .63rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 700;
    color: var(--text-muted);
    padding: .55rem .9rem .2rem;
}

/* ─── Games section (top half of sidebar) ─── */
.fs-header-games {
    background: linear-gradient(135deg, #7c3aed, #4f46e5) !important;
}

.fs-games-body {
    flex-shrink: 0;
    max-height: 40%;
    overflow-y: auto;
    scrollbar-width: thin;
}

.fs-game-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .45rem .9rem;
    cursor: pointer;
    transition: background .15s;
    text-decoration: none;
    color: var(--text-main);
}

.fs-game-item:hover {
    background: var(--bg-hover);
    text-decoration: none;
    color: var(--text-main);
}

.fs-game-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    color: #fff;
    flex-shrink: 0;
}

.fs-game-info {
    flex: 1;
    min-width: 0;
}

.fs-game-name {
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fs-game-time {
    font-size: .62rem;
    color: var(--text-muted);
}

.fs-games-link {
    display: flex;
    align-items: center;
    padding: .5rem .9rem;
    font-size: .75rem;
    font-weight: 600;
    color: #7c3aed;
    text-decoration: none;
    transition: background .15s;
    border-top: 1px solid var(--border-color);
}

.fs-games-link:hover {
    background: var(--bg-hover);
    color: #6d28d9;
    text-decoration: none;
}

.fs-games-empty {
    padding: .8rem .9rem;
    text-align: center;
    font-size: .72rem;
    color: var(--text-muted);
}

.fs-body {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.fs-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .45rem .9rem;
    cursor: pointer;
    transition: background .15s;
    border-radius: 0;
}

.fs-item:hover {
    background: var(--bg-hover);
}

.fs-item .fs-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.fs-item img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.fs-online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.fs-item .fs-nick {
    flex: 1;
    font-size: .82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
}

.fs-item .fs-unread {
    background: var(--danger);
    color: #fff;
    font-size: .62rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 5px;
    min-width: 18px;
    text-align: center;
}

/* Pending request item */
.fs-req-item {
    padding: .5rem .9rem;
    display: flex;
    align-items: center;
    gap: .55rem;
}

.fs-req-item img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.fs-req-info {
    flex: 1;
    overflow: hidden;
}

.fs-req-info .fs-req-nick {
    font-size: .79rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fs-req-actions {
    display: flex;
    gap: .3rem;
    margin-top: .25rem;
}

.fs-req-actions button {
    font-size: .68rem;
    padding: 2px 7px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.btn-accept-req {
    background: var(--accent);
    color: #fff;
}

.btn-accept-req:hover {
    opacity: .85;
}

.btn-decline-req {
    background: var(--bg-hover);
    color: var(--text-muted);
}

.btn-decline-req:hover {
    color: var(--text-main);
}

/* =============================================
   MINI CHAT POPUPS
   ============================================= */
.chat-popup {
    position: fixed;
    bottom: 0;
    width: 320px;
    z-index: 1040;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -6px 32px rgba(0, 0, 0, .2);
    display: flex;
    flex-direction: column;
    transition: transform .22s cubic-bezier(.4, 0, .2, 1);
}

.chat-popup.is-minimized {
    transform: translateY(calc(100% - 44px));
}

.cp-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .8rem;
    background: var(--accent);
    border-radius: 14px 14px 0 0;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
    min-height: 44px;
}

.cp-header img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, .45);
    flex-shrink: 0;
}

.cp-header .cp-profile-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.cp-header .cp-profile-link:hover .cp-nick {
    text-decoration: underline;
}

.cp-header .cp-nick {
    flex: 1;
    font-size: .8rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cp-header .cp-online-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #4ade80;
    border: 2px solid rgba(255, 255, 255, .4);
    flex-shrink: 0;
}

.cp-header .cp-status-text {
    font-size: .65rem;
    color: rgba(255, 255, 255, .7);
    font-weight: 400;
}

.cp-header .cp-close,
.cp-header .cp-minimize {
    background: none;
    border: none;
    color: rgba(255, 255, 255, .8);
    font-size: .95rem;
    line-height: 1;
    padding: 4px 5px;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cp-header .cp-close:hover,
.cp-header .cp-minimize:hover {
    background: rgba(0, 0, 0, .2);
    color: #fff;
}

.cp-header .cp-call-btn {
    background: rgba(255, 255, 255, .18);
    border: none;
    color: #fff;
    font-size: .8rem;
    line-height: 1;
    padding: 5px 6px;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cp-header .cp-call-btn:hover {
    background: rgba(255, 255, 255, .3);
}

.cp-unread-badge {
    background: #ef4444;
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 5px;
    min-width: 17px;
    text-align: center;
    display: none;
    flex-shrink: 0;
}

/* Body */
.cp-body {
    height: 300px;
    overflow-y: auto;
    padding: .6rem .55rem .35rem;
    display: flex;
    flex-direction: column;
    gap: .3rem;
    background: var(--bg-body);
    scroll-behavior: smooth;
}

.cp-body::-webkit-scrollbar {
    width: 4px;
}

.cp-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* Message wrap (bubble + timestamp) */
.cp-msg-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 86%;
}

.cp-msg-wrap.mine {
    align-self: flex-end;
    align-items: flex-end;
}

.cp-msg-wrap.theirs {
    align-self: flex-start;
    align-items: flex-start;
}

/* Bubble */
.cp-msg {
    padding: .4rem .7rem;
    border-radius: 16px;
    font-size: .79rem;
    line-height: 1.45;
    word-break: normal;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 100%;
}

/* Message row: give text wrapper definite width so pm-bubble % max-width resolves */
#msgBox>.d-flex>div,
.cp-body>.cp-msg-wrap {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 36px);
}

/* Private-message bubbles (messages.php) */
.pm-bubble {
    display: inline-block;
    border-radius: 16px;
    padding: .55rem .85rem;
    font-size: .94rem;
    line-height: 1.5;
    word-break: normal;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: min(75%, 520px);
    min-width: 60px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}

/* Media bubbles: tighter padding so images/videos/audio fit cleanly */
.pm-bubble:has(> img),
.pm-bubble:has(> video),
.pm-bubble:has(> audio) {
    padding: 4px;
    white-space: normal;
    min-width: auto;
    overflow: hidden;
}

/* Chat images */
.msg-img-thumb {
    display: block;
    max-width: 260px;
    width: 100%;
    height: auto;
    border-radius: 12px;
    cursor: zoom-in;
    object-fit: contain;
}

/* Chat videos */
.msg-vid-thumb {
    display: block;
    max-width: 280px;
    width: 100%;
    height: auto;
    border-radius: 12px;
    background: #000;
}

.pm-bubble:has(> audio) {
    padding: .4rem .6rem;
}

/* Reel card inside bubble — proper sizing */
.pm-bubble:has(.reel-share-card) {
    padding: 6px;
    white-space: normal;
    min-width: auto;
    max-width: min(92%, 440px);
    overflow: hidden;
}

/* ── Shared Reel Card in messages ── */
.reel-share-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(168, 85, 247, .12), rgba(59, 130, 246, .08));
    border: 1px solid rgba(168, 85, 247, .2);
    text-decoration: none !important;
    color: inherit !important;
    min-width: 180px;
    max-width: 100%;
    transition: transform .15s, box-shadow .15s;
    cursor: pointer;
}

.reel-share-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(168, 85, 247, .2);
}

.reel-share-card .rsc-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(168, 85, 247, .3);
}

.reel-share-card .rsc-info {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
}

.reel-share-card .rsc-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #a855f7;
    opacity: .9;
}

.reel-share-card .rsc-title {
    font-size: .84rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reel-share-card .rsc-author {
    font-size: .72rem;
    opacity: .6;
}

.pm-bubble.mine .reel-share-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .06));
    border-color: rgba(255, 255, 255, .2);
}

.pm-bubble.mine .reel-share-card .rsc-label {
    color: rgba(255, 255, 255, .8);
}

/* Mini messenger reel card */
.cp-msg:has(.reel-share-card) {
    padding: 5px;
    white-space: normal;
    min-width: 200px;
}

.cp-msg .reel-share-card {
    max-width: 100%;
    padding: 8px 10px;
    gap: 8px;
}

.cp-msg .reel-share-card .rsc-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
}

.cp-msg .reel-share-card .rsc-title {
    font-size: .78rem;
}

/* ── Mini messenger voice player ── */
.cp-msg:has(.voice-msg) {
    white-space: normal;
    max-width: 90%;
}

.cp-msg .voice-msg {
    min-width: 160px;
}

.cp-msg .voice-msg-play {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform .15s;
}

.cp-msg .voice-msg-play:hover {
    transform: scale(1.08);
}

.cp-msg.mine .voice-msg-play {
    background: rgba(255, 255, 255, .2);
    color: #fff;
}

.cp-msg.theirs .voice-msg-play {
    background: var(--accent, #3b82f6);
    color: #fff;
}

.cp-msg .voice-msg-bars {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    height: 22px;
    cursor: pointer;
    overflow: hidden;
}

.cp-msg .voice-msg-bars span {
    width: 2.5px;
    border-radius: 1.5px;
    flex-shrink: 0;
    height: calc(var(--h) * 2.2px);
    min-height: 3px;
    transition: background .12s;
}

.cp-msg.mine .voice-msg-bars span {
    background: rgba(255, 255, 255, .3);
}

.cp-msg.mine .voice-msg-bars span.played {
    background: #fff;
}

.cp-msg.theirs .voice-msg-bars span {
    background: rgba(0, 0, 0, .15);
}

.cp-msg.theirs .voice-msg-bars span.played {
    background: var(--accent, #3b82f6);
}

[data-bs-theme="dark"] .cp-msg.theirs .voice-msg-bars span {
    background: rgba(255, 255, 255, .15);
}

[data-bs-theme="dark"] .cp-msg.theirs .voice-msg-bars span.played {
    background: var(--accent, #3b82f6);
}

.cp-msg .voice-msg-time {
    font-size: .68rem;
    flex-shrink: 0;
    min-width: 30px;
    text-align: right;
    opacity: .85;
    font-variant-numeric: tabular-nums;
}

/* ── Voice message player (WhatsApp / Messenger style) ── */
.pm-bubble:has(.voice-msg) {
    padding: .5rem .7rem;
    min-width: auto;
    white-space: normal;
    max-width: min(85%, 340px);
}

.voice-msg {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    padding: 2px 0;
    user-select: none;
}

.voice-msg-play {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 1.2rem;
    transition: transform .15s ease, background .2s;
    line-height: 1;
}

.voice-msg-play:hover {
    transform: scale(1.08);
}

.voice-msg-play:active {
    transform: scale(.94);
}

.pm-bubble.mine .voice-msg-play {
    background: rgba(255, 255, 255, .2);
    color: #fff;
}

.pm-bubble.theirs .voice-msg-play {
    background: var(--accent, #3b82f6);
    color: #fff;
}

.voice-msg-bars {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    height: 28px;
    cursor: pointer;
    overflow: hidden;
}

.voice-msg-bars span {
    width: 3px;
    border-radius: 1.5px;
    flex-shrink: 0;
    height: calc(var(--h) * 2.8px);
    min-height: 4px;
    transition: background .12s;
}

.pm-bubble.mine .voice-msg-bars span {
    background: rgba(255, 255, 255, .3);
}

.pm-bubble.mine .voice-msg-bars span.played {
    background: #fff;
}

.pm-bubble.theirs .voice-msg-bars span {
    background: rgba(0, 0, 0, .15);
}

.pm-bubble.theirs .voice-msg-bars span.played {
    background: var(--accent, #3b82f6);
}

[data-bs-theme="dark"] .pm-bubble.theirs .voice-msg-bars span {
    background: rgba(255, 255, 255, .15);
}

[data-bs-theme="dark"] .pm-bubble.theirs .voice-msg-bars span.played {
    background: var(--accent, #3b82f6);
}

.voice-msg-time {
    font-size: .73rem;
    flex-shrink: 0;
    min-width: 34px;
    text-align: right;
    opacity: .85;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
}

/* Upload-in-progress indicator */
.msg-uploading {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    color: rgba(255, 255, 255, .75);
    font-size: .86rem;
}

.pm-bubble.theirs .msg-uploading {
    color: var(--text-muted);
}

.pm-bubble.mine {
    background: var(--chat-mine-bg);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.pm-bubble.theirs {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

/* ── Message Reactions ── */
.msg-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    justify-content: flex-start;
}

.text-end .msg-reactions {
    justify-content: flex-end;
}

.msg-reaction-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .82rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    user-select: none;
    line-height: 1.4;
}

.msg-reaction-badge:hover {
    transform: scale(1.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

.msg-reaction-count {
    font-size: .68rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* ── Message Context Menu ── */
.msg-ctx-overlay {
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(0, 0, 0, .25);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.msg-ctx-menu {
    position: fixed;
    z-index: 1091;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .2), 0 2px 8px rgba(0, 0, 0, .1);
    min-width: 200px;
    overflow: hidden;
    animation: msgCtxIn .18s ease-out;
}

@keyframes msgCtxIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.msg-ctx-reactions {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px 10px;
}

.msg-ctx-emoji {
    width: 42px;
    height: 42px;
    border: none;
    background: var(--bg-body);
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s, background .15s, box-shadow .15s;
}

.msg-ctx-emoji:hover {
    transform: scale(1.25);
    background: rgba(59, 130, 246, .12);
    box-shadow: 0 2px 12px rgba(59, 130, 246, .2);
}

.msg-ctx-emoji:active {
    transform: scale(0.9);
}

.msg-ctx-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0 12px;
}

.msg-ctx-action {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 18px;
    border: none;
    background: none;
    font-size: .85rem;
    color: var(--text-main);
    cursor: pointer;
    transition: background .12s;
    text-align: left;
}

.msg-ctx-action:hover {
    background: var(--bg-hover, rgba(0, 0, 0, .04));
}

.msg-ctx-action i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.cp-msg.mine {
    background: var(--chat-mine-bg, var(--accent));
    color: #fff;
    border-bottom-right-radius: 4px;
}

.cp-msg.theirs {
    background: var(--bg-card);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

.cp-msg a {
    color: inherit;
    text-decoration: underline;
    opacity: .85;
    word-break: break-all;
}

/* Timestamp */
.cp-ts {
    font-size: .58rem;
    color: var(--text-muted);
    padding: 0 .2rem;
    opacity: .7;
}

/* Media inside bubble */
.cp-msg audio {
    max-width: 220px;
    height: 34px;
    border-radius: 8px;
    display: block;
    outline: none;
}

.cp-msg img.cp-img-msg {
    max-width: 220px;
    max-height: 180px;
    border-radius: 10px;
    display: block;
    cursor: zoom-in;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

/* Video embeds */
.cp-embed {
    max-width: 240px;
}

.cp-embed iframe {
    width: 240px;
    height: 135px;
    border-radius: 10px;
    border: none;
    display: block;
}

.cp-embed.cp-tiktok iframe {
    height: 380px;
}

/* Recording indicator */
.cp-rec-row {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex: 1;
    min-width: 0;
}

.cp-rec-label {
    font-size: .71rem;
    color: var(--danger);
    font-weight: 600;
    flex: 1;
}

@keyframes cp-blink {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .25
    }
}

.cp-rec-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--danger);
    animation: cp-blink .9s infinite;
    flex-shrink: 0;
}

/* Footer toolbar */
.cp-footer {
    display: flex;
    align-items: flex-end;
    gap: .3rem;
    padding: .4rem .45rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    background: var(--bg-card);
    border-radius: 0 0 0 0;
}

.cp-btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.05rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s, color .15s;
    padding: 0;
}

.cp-btn-icon:hover {
    background: rgba(37, 99, 235, .1);
    color: var(--accent);
}

.cp-btn-icon.recording {
    color: var(--danger) !important;
    background: rgba(239, 68, 68, .12) !important;
}

.cp-footer textarea {
    flex: 1;
    resize: none;
    min-width: 80px;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: .35rem .75rem;
    font-size: .79rem;
    background: var(--bg-input, var(--bg-body));
    color: var(--text-main);
    line-height: 1.4;
    max-height: 80px;
    outline: none;
    font-family: inherit;
    height: 34px;
    overflow-y: hidden;
    transition: border-color .15s, box-shadow .15s;
}

.cp-footer textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}

.cp-send-btn {
    background: var(--accent);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: .9rem;
    transition: background .15s, transform .1s;
}

.cp-send-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.07);
}

@media (max-width: 991px) {
    #friendsSidebar {
        display: none !important;
    }

    .chat-popup {
        display: none !important;
    }
}

.cp-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .65rem;
    background: var(--accent);
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.cp-header img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, .5);
}

.cp-header .cp-nick {
    flex: 1;
    font-size: .78rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cp-header .cp-online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    border: 1.5px solid rgba(255, 255, 255, .5);
    flex-shrink: 0;
}

.cp-header .cp-close,
.cp-header .cp-minimize {
    background: none;
    border: none;
    color: rgba(255, 255, 255, .85);
    font-size: .9rem;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

.cp-header .cp-close:hover,
.cp-header .cp-minimize:hover {
    background: rgba(0, 0, 0, .2);
    color: #fff;
}

.cp-unread-badge {
    background: #ef4444;
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 5px;
    min-width: 17px;
    text-align: center;
    display: none;
    flex-shrink: 0;
}

.cp-body {
    height: 220px;
    overflow-y: auto;
    padding: .5rem .6rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    background: var(--bg-main);
}

.cp-msg {
    max-width: 85%;
    padding: .35rem .6rem;
    border-radius: 14px;
    font-size: .78rem;
    line-height: 1.45;
    word-break: break-word;
}

.cp-msg.mine {
    align-self: flex-end;
    background: var(--chat-mine-bg, var(--accent));
    color: #fff;
    border-bottom-right-radius: 4px;
}

.cp-msg.theirs {
    align-self: flex-start;
    background: var(--bg-card);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

.cp-footer {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem .5rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.cp-footer textarea {
    flex: 1;
    resize: none;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: .3rem .7rem;
    font-size: .78rem;
    background: var(--bg-main);
    color: var(--text-main);
    line-height: 1.4;
    max-height: 70px;
    outline: none;
}

.cp-footer textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .15);
}

.cp-footer button {
    background: var(--accent);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: .9rem;
}

.cp-footer button:hover {
    opacity: .87;
}

@media (max-width: 991px) {
    #friendsSidebar {
        display: none !important;
    }

    .chat-popup {
        display: none !important;
    }
}


/* ═══════════════════════════════════════════════════════════
   SPA Navigation Progress Bar
   ═══════════════════════════════════════════════════════════ */
.gnb {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #a855f7, #ec4899);
    z-index: 9999;
    transition: width .25s ease, opacity .35s ease;
    pointer-events: none;
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px rgba(168, 85, 247, .5);
}

.gnb--hide {
    opacity: 0;
}

/* ═══════════════════════════════════════════════════════════
   Global Music Player Bar
   ═══════════════════════════════════════════════════════════ */
.g-player {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: var(--card-bg, #fff);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: var(--navbar-h, 56px);
    z-index: 1019;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
    transition: transform .25s ease, opacity .25s ease;
}

.g-player::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, #1db954, #0d6efd, #6610f2, #ec4899);
    background-size: 300% 100%;
    animation: gPlayerShimmer 4s ease infinite;
}

@keyframes gPlayerShimmer {
    0%, 100% { background-position: 0% 0; }
    50% { background-position: 100% 0; }
}

.g-player.gp--hidden {
    display: none;
}

/* Album art */
.g-player-art {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1db954, #0d6efd);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(29, 185, 84, .25);
    animation: gArtPulse 2s ease-in-out infinite;
}

@keyframes gArtPulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(29, 185, 84, .25); }
    50% { box-shadow: 0 2px 14px rgba(29, 185, 84, .45); }
}

.g-player-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Controls group */
.g-player-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.g-player-btn {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.05rem;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 50%;
    line-height: 1;
    flex-shrink: 0;
    transition: background .14s, transform .14s, color .14s;
}

#gPlayPause {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1db954, #0d6efd);
    color: #fff;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 10px rgba(29,185,84,.3);
    transition: transform .15s, box-shadow .15s;
}

#gPlayPause:hover {
    transform: scale(1.12);
    box-shadow: 0 4px 16px rgba(29,185,84,.45);
}

.g-player-btn:hover {
    background: rgba(0,0,0,.06);
    color: var(--accent);
    transform: scale(1.1);
}

.g-player-close {
    opacity: .45;
    font-size: .8rem;
}
.g-player-close:hover {
    opacity: 1;
    color: #e74c3c;
}

.g-player-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.g-player-title {
    font-size: .82rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
    font-family: 'BPG No9', sans-serif;
}

.g-player-track {
    display: flex;
    align-items: center;
    gap: 8px;
}

.g-player-progress {
    width: 100%;
    height: 5px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    flex: 1;
    transition: height .15s;
}

.g-player-progress:hover {
    height: 7px;
}

.g-player-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #1db954;
    cursor: pointer;
    box-shadow: 0 1px 6px rgba(0,0,0,.25);
    margin-top: -4.5px;
    position: relative;
    z-index: 2;
    transition: transform .12s;
}

.g-player-progress:hover::-webkit-slider-thumb {
    transform: scale(1.2);
}

.g-player-progress::-webkit-slider-runnable-track {
    height: 5px;
    border-radius: 3px;
}

.g-player-progress::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #1db954;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 6px rgba(0,0,0,.25);
}

.g-player-progress::-moz-range-track {
    height: 5px;
    border-radius: 3px;
    background: var(--border-color);
}

.g-player-time {
    font-size: .7rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 32px;
    font-variant-numeric: tabular-nums;
}

.g-player-right {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

[data-theme="dark"] .g-player {
    background: var(--card-bg, #1a1a2e);
    box-shadow: 0 4px 20px rgba(0, 0, 0, .35);
}

@media (max-width: 575px) {

    #gPrev,
    #gNext,
    #gVolBtn {
        display: none;
    }

    .g-player {
        padding: 6px 10px;
        gap: 6px;
        flex-wrap: wrap;
    }

    .g-player-art {
        width: 32px;
        height: 32px;
        min-width: 32px;
        border-radius: 8px;
        font-size: .9rem;
    }

    .g-player-controls {
        gap: 0;
    }

    #gPlayPause {
        width: 32px;
        height: 32px;
        font-size: .95rem;
    }

    .g-player-info {
        flex: 1;
        min-width: 0;
    }

    .g-player-title {
        font-size: .75rem;
    }

    .g-player-track {
        gap: 6px;
    }

    .g-player-time {
        font-size: .65rem;
        min-width: 28px;
    }

    .g-player-progress {
        height: 4px;
    }

    .g-player-progress::-webkit-slider-thumb {
        width: 12px;
        height: 12px;
        margin-top: -4px;
    }

    .g-player-right {
        gap: 0;
    }

    .g-player-close {
        font-size: .7rem;
        padding: 4px 6px;
    }
}

/* ═══════════════════════════════════════════════════════════
   Emoji Picker (.gep)
   ═══════════════════════════════════════════════════════════ */
.gep {
    position: fixed;
    z-index: 10100 !important;
    width: 284px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .38);
    display: none;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.gep.gep--open {
    display: flex;
}

.gep-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.gep-mode-btn {
    flex: 1;
    padding: 10px 0;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    font-size: .85rem;
    border-bottom: 2px solid transparent;
    transition: color .2s, border .2s;
}

.gep-mode-btn:hover {
    color: var(--text-main);
}

.gep-mode-btn.active {
    color: var(--text-main);
    border-bottom-color: #0d6efd;
}

.gep-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.gep-tabs {
    display: flex;
    gap: 2px;
    padding: 8px 8px 4px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: none;
}

.gep-tabs::-webkit-scrollbar {
    display: none;
}

.gep-tab {
    background: none;
    border: none;
    border-radius: 8px;
    padding: 4px 6px;
    font-size: 1.15rem;
    cursor: pointer;
    opacity: .55;
    flex-shrink: 0;
    transition: opacity .15s, background .15s;
}

.gep-tab:hover,
.gep-tab.active {
    opacity: 1;
    background: rgba(255, 255, 255, .1);
}

.gep-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 1px;
    padding: 6px 8px 10px;
    max-height: 176px;
    overflow-y: auto;
}

.gep-grid::-webkit-scrollbar {
    width: 4px;
}

.gep-grid::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.gep-e {
    background: none;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    padding: 5px 2px;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: background .12s, transform .1s;
}

.gep-e:hover {
    background: rgba(255, 255, 255, .1);
    transform: scale(1.2);
}

.gep-grid-sticker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 6px 8px 10px;
    max-height: 200px;
    overflow-y: auto;
}

.gep-grid-sticker::-webkit-scrollbar {
    width: 4px;
}

.gep-grid-sticker::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.gep-s {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform .1s, background .15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gep-s img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    pointer-events: none;
}

.gep-s:hover {
    background: rgba(255, 255, 255, .1);
    transform: scale(1.15);
}

/* Emoji trigger button (generic) */
.ep-trigger-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--text-muted);
    transition: border-color .15s, color .15s;
}

.ep-trigger-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════
   User Rank Badge
   ═══════════════════════════════════════════════════════════ */
.rank-badge {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid currentColor;
    letter-spacing: .01em;
    vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════
   Reaction Picker
   ═══════════════════════════════════════════════════════════ */
.reaction-wrap {
    display: inline-flex;
}

.reaction-picker {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    background: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 999px;
    padding: 5px 8px;
    gap: 6px;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .15);
    z-index: 200;
    animation: rxFadeIn .15s ease;
}

.reaction-wrap:hover .reaction-picker,
.reaction-wrap.rx-open .reaction-picker {
    display: flex;
}

.reaction-opt {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    padding: 2px;
    line-height: 1;
    transition: transform .15s;
    border-radius: 50%;
}

.reaction-opt:hover {
    transform: scale(1.4) translateY(-4px);
}

@keyframes rxFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════════════
   Verified Badge
   ═══════════════════════════════════════════════════════════ */
.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1d9bf0;
    vertical-align: middle;
    margin-left: 2px;
    cursor: default;
    position: relative;
    top: -0.5px;
    filter: drop-shadow(0 1px 1px rgba(29, 155, 240, .25));
    transition: filter .2s ease, transform .2s ease;
    line-height: 1;
}
.verified-badge:hover {
    filter: drop-shadow(0 1px 4px rgba(29, 155, 240, .45));
    transform: scale(1.1);
}
.verified-badge svg {
    width: .95em;
    height: .95em;
    fill: currentColor;
}

/* ═══════════════════════════════════════════════════════════
   WebRTC Call Overlay
   ═══════════════════════════════════════════════════════════ */
.call-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

.call-overlay--active {
    opacity: 1;
    pointer-events: auto;
}

.call-card {
    position: relative;
    width: 340px;
    max-width: 92vw;
    border-radius: 24px;
    overflow: hidden;
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5), 0 0 80px rgba(99, 102, 241, .15);
    animation: callCardIn .4s ease;
}

/* Fullscreen video mode */
.call-card--video {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    animation: none !important;
}

@keyframes callCardIn {
    from {
        opacity: 0;
        transform: scale(.85) translateY(30px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Close animation */
.call-card--closing {
    animation: callCardOut .45s ease forwards !important;
}

@keyframes callCardOut {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    40% {
        opacity: .8;
        transform: scale(1.03) translateY(-8px);
    }

    100% {
        opacity: 0;
        transform: scale(.7) translateY(60px);
    }
}

.call-bg-anim {
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle at 30% 40%, rgba(99, 102, 241, .15) 0%, transparent 60%),
        radial-gradient(circle at 70% 60%, rgba(59, 130, 246, .12) 0%, transparent 50%);
    animation: callBgPulse 4s ease-in-out infinite alternate;
}

@keyframes callBgPulse {
    0% {
        transform: scale(1) rotate(0deg);
    }

    100% {
        transform: scale(1.15) rotate(8deg);
    }
}

.call-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5rem 2rem 2rem;
    z-index: 1;
}

/* When video is active, content overlays bottom of screen */
.call-card--video .call-content {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.5rem calc(env(safe-area-inset-bottom, 0px) + 1.5rem);
    background: linear-gradient(transparent, rgba(0, 0, 0, .7) 40%);
    z-index: 100;
}

.call-card--video .call-bg-anim {
    display: none;
}

.call-avatar-wrap {
    position: relative;
    margin-bottom: 1.2rem;
}

.call-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, .2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
}

.call-avatar-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(99, 102, 241, .5);
    animation: callRingPulse 2s ease-in-out infinite;
}

@keyframes callRingPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: .5;
    }

    50% {
        transform: scale(1.12);
        opacity: 1;
    }
}

.call-nick {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: .3rem;
    text-align: center;
}

.call-status {
    color: rgba(255, 255, 255, .6);
    font-size: .82rem;
    margin-bottom: .3rem;
    text-align: center;
}

.call-timer {
    color: rgba(255, 255, 255, .85);
    font-size: 1.5rem;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    letter-spacing: .08em;
    margin-bottom: .6rem;
}

/* Video container */
.call-video-container {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 2;
    overflow: hidden;
}

.call-card--video .call-video-container {
    display: block;
    position: fixed;
    inset: 0;
}

.call-video-container video#callRemoteVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.call-video-container video#callLocalVideo {
    position: absolute;
    top: env(safe-area-inset-top, 16px);
    right: 16px;
    width: 100px;
    height: 140px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, .35);
    z-index: 5;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .4);
    transform: scaleX(-1);
}

/* Timer & nick on video */
.call-card--video .call-nick {
    font-size: 1.1rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .7);
}

.call-card--video .call-status {
    text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}

.call-card--video .call-timer {
    font-size: 1.3rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .7);
}

/* Action buttons */
.call-actions {
    display: flex;
    gap: 1.2rem;
    margin-top: .8rem;
    padding-bottom: .5rem;
}

.call-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, background .2s;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .3);
}

.call-btn:hover {
    transform: scale(1.1);
}

.call-btn:active {
    transform: scale(.95);
}

.call-btn-green {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    animation: callBtnPulse 1.5s ease-in-out infinite;
}

@keyframes callBtnPulse {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(34, 197, 94, .4);
    }

    50% {
        box-shadow: 0 4px 30px rgba(34, 197, 94, .7);
    }
}

.call-btn-red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.call-btn-red:hover {
    box-shadow: 0 4px 25px rgba(239, 68, 68, .5);
}

.call-btn-gray {
    background: rgba(255, 255, 255, .15);
    backdrop-filter: blur(4px);
}

.call-btn-gray:hover {
    background: rgba(255, 255, 255, .25);
}

.call-btn-active {
    background: rgba(239, 68, 68, .5) !important;
}

/* Profile/messages call buttons */
.call-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 1rem;
    cursor: pointer;
    transition: all .2s;
}

.call-action-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(99, 102, 241, .08);
    transform: scale(1.08);
}

.call-action-btn.audio-call {
    color: #22c55e;
    border-color: #22c55e44;
}

.call-action-btn.audio-call:hover {
    background: rgba(34, 197, 94, .1);
    color: #16a34a;
    border-color: #22c55e;
}

.call-action-btn.video-call {
    color: #3b82f6;
    border-color: #3b82f644;
}

.call-action-btn.video-call:hover {
    background: rgba(59, 130, 246, .1);
    color: #2563eb;
    border-color: #3b82f6;
}

/* Mobile adjustments */
@media (max-width: 575.98px) {
    .call-card {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        min-height: 100vh;
        justify-content: center;
    }

    .call-content {
        padding-top: 25vh;
    }

    .call-avatar {
        width: 110px;
        height: 110px;
    }

    .call-nick {
        font-size: 1.4rem;
    }

    .call-btn {
        width: 60px;
        height: 60px;
        font-size: 1.4rem;
    }

    .call-video-container video#callLocalVideo {
        top: 12px;
        right: 12px;
        width: 80px;
        height: 110px;
        border-radius: 10px;
    }

    .call-card--video .call-content {
        padding: .8rem 1rem 1.2rem;
    }
}

/* ═══════════════════════════════════════════════════════════
   Group Call Overlay
   ═══════════════════════════════════════════════════════════ */
.gc-overlay {
    z-index: 99998;
}

.gc-card {
    position: relative;
    width: 90vw;
    max-width: 720px;
    max-height: 92vh;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5), 0 0 80px rgba(99, 102, 241, .15);
    animation: callCardIn .4s ease;
    display: flex;
    flex-direction: column;
}

.gc-content {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 1.2rem;
    z-index: 1;
    flex: 1;
    min-height: 0;
}

.gc-header {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin-bottom: 1rem;
    color: #fff;
}

.gc-title {
    font-size: 1.1rem;
    font-weight: 600;
    flex: 1;
}

.gc-timer {
    font-size: 1rem;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    letter-spacing: .06em;
    color: rgba(255, 255, 255, .7);
}

.gc-participants-count {
    font-size: .82rem;
    color: rgba(255, 255, 255, .5);
    background: rgba(255, 255, 255, .1);
    padding: 2px 10px;
    border-radius: 20px;
}

/* Participant Grid */
.gc-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, 1fr);
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.gc-tile {
    position: relative;
    background: rgba(255, 255, 255, .06);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    aspect-ratio: 4/3;
}

.gc-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.gc-tile-self {
    border: 2px solid rgba(99, 102, 241, .4);
}

.gc-tile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, .2);
}

.gc-tile-label {
    position: absolute;
    bottom: 6px;
    left: 8px;
    color: #fff;
    font-size: .75rem;
    font-weight: 500;
    background: rgba(0, 0, 0, .5);
    padding: 1px 8px;
    border-radius: 8px;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Group call action buttons bar */
.gc-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: .5rem 0;
    flex-shrink: 0;
}

/* Invite modal overlay */
.gc-invite-modal {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(6px);
}

.gc-invite-card {
    width: 340px;
    max-width: 90vw;
    max-height: 70vh;
    border-radius: 16px;
    background: var(--bg-card, #1e1e2e);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gc-invite-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .8rem 1rem;
    font-weight: 600;
    color: #fff;
    background: rgba(99, 102, 241, .15);
}

.gc-invite-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
}

.gc-invite-search {
    display: block;
    width: 100%;
    padding: .6rem 1rem;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    background: transparent;
    color: #fff;
    font-size: .9rem;
    outline: none;
}

.gc-invite-search::placeholder {
    color: rgba(255, 255, 255, .35);
}

.gc-invite-list {
    flex: 1;
    overflow-y: auto;
    padding: .5rem;
}

.gc-invite-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .4rem .5rem;
    border-radius: 8px;
    transition: background .15s;
}

.gc-invite-row:hover {
    background: rgba(255, 255, 255, .05);
}

.gc-invite-av {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.gc-invite-nick {
    flex: 1;
    color: #fff;
    font-size: .88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Incoming group call notification */
.gc-invite-notif {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100002;
    animation: gcNotifIn .4s ease;
}

@keyframes gcNotifIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gc-invite-notif-card {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1px solid rgba(99, 102, 241, .3);
    border-radius: 14px;
    padding: 1rem 1.2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .4);
    min-width: 280px;
    max-width: 380px;
}

.gc-invite-notif-text {
    color: #fff;
    font-size: .88rem;
    margin-bottom: .8rem;
}

.gc-invite-notif-btns {
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
}

/* Group call button on profile / chat */
.gc-start-btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .82rem;
    padding: .35rem .7rem;
    border-radius: 20px;
    border: 1.5px solid rgba(139, 92, 246, .4);
    background: rgba(139, 92, 246, .08);
    color: #8b5cf6;
    cursor: pointer;
    transition: all .2s;
}

.gc-start-btn:hover {
    background: rgba(139, 92, 246, .18);
    border-color: #8b5cf6;
    transform: scale(1.03);
}

@media (max-width: 575.98px) {
    .gc-card {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
    }

    .gc-tile {
        min-height: 90px;
    }

    .gc-invite-notif {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .gc-invite-notif-card {
        min-width: auto;
    }
}

/* ═════════ Chat Voice Room (audio/video in chat rooms) ═════════ */
#voicePanel {
    display: none;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
    position: relative;
    overflow: hidden;
}

#voicePanel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(76, 0, 255, .15), transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 200, 255, .1), transparent 50%);
    pointer-events: none;
}

#voicePanel.cv-active {
    display: block;
}

.cv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.cv-header-title {
    color: #fff;
    font-weight: 600;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cv-header-title .cv-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00ff88;
    animation: cvPulse 1.5s infinite;
}

@keyframes cvPulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(0, 255, 136, .6);
    }

    50% {
        opacity: .7;
        box-shadow: 0 0 0 6px rgba(0, 255, 136, 0);
    }
}

#voiceGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    position: relative;
    z-index: 1;
    min-height: 80px;
    max-height: 300px;
    overflow-y: auto;
}

.cv-tile {
    background: rgba(255, 255, 255, .08);
    border-radius: 10px;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, .1);
    transition: border-color .2s, box-shadow .2s;
}

.cv-tile:hover {
    border-color: rgba(0, 200, 255, .4);
    box-shadow: 0 0 12px rgba(0, 200, 255, .15);
}

.cv-tile-local {
    border-color: rgba(0, 255, 136, .3);
}

.cv-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 8px;
}

.cv-avatar-icon {
    font-size: 2rem;
    color: rgba(255, 255, 255, .7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cv-avatar-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, .2);
}

.cv-label {
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: .68rem;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
    padding: 1px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: linear-gradient(transparent, rgba(0, 0, 0, .5));
    border-radius: 0 0 8px 8px;
}

#cvControls {
    display: none;
    gap: 6px;
    justify-content: center;
    margin-top: 10px;
    position: relative;
    z-index: 1;
}

#cvControls .btn {
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    padding: 0;
    transition: transform .15s, background .2s;
}

#cvControls .btn:hover {
    transform: scale(1.1);
}

#cvLeaveBtn {
    background: #dc3545 !important;
    color: #fff !important;
    border: none;
}

.cv-join-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.cv-join-btn {
    font-size: .78rem;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

#cvBadge {
    display: none;
    background: #00ff88;
    color: #1a1a2e;
    font-size: .65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    text-align: center;
    line-height: 18px;
    padding: 0 4px;
}

@media (max-width: 575.98px) {
    #voiceGrid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        max-height: 200px;
    }

    .cv-avatar-img {
        width: 36px;
        height: 36px;
    }

    .cv-tile {
        aspect-ratio: 1;
    }
}

/* =============================================
   MESSAGES CONVERSATION — fullscreen on mobile
   ============================================= */
@media (max-width: 767.98px) {

    body.msg-conversation footer,
    body.msg-conversation #friendsSidebar,
    body.msg-conversation .mobile-bottom-nav,
    body.msg-conversation .navbar {
        display: none !important;
    }

    body.msg-conversation {
        overflow: hidden !important;
    }

    body.msg-conversation .page-body {
        padding: 0 !important;
        margin: 0 !important;
    }

    body.msg-conversation main.py-3 {
        padding: 0 !important;
        margin: 0 !important;
    }

    body.msg-conversation main .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: 100% !important;
    }

    body.msg-conversation .row.g-3 {
        margin: 0 !important;
        gap: 0 !important;
        --bs-gutter-x: 0;
        --bs-gutter-y: 0;
    }

    body.msg-conversation .row.g-3>.col-md-8 {
        padding: 0 !important;
        width: 100% !important;
    }

    body.msg-conversation .card {
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* Fill full screen (navbar + bottom-nav both hidden) */
    body.msg-conversation .row.g-3>.col-md-8>.card {
        display: flex !important;
        flex-direction: column !important;
        height: calc(100vh - env(safe-area-inset-bottom, 0px)) !important;
        height: calc(100dvh - env(safe-area-inset-bottom, 0px)) !important;
        min-height: 0 !important;
        max-height: calc(100dvh - env(safe-area-inset-bottom, 0px)) !important;
    }

    body.msg-conversation #msgBox {
        flex: 1 1 0 !important;
        min-height: 0 !important;
        max-height: none !important;
        height: auto !important;
        overflow-y: auto !important;
    }

    body.msg-conversation .card-header {
        flex-shrink: 0;
        border-radius: 0 !important;
    }

    body.msg-conversation .chat-input-area {
        flex-shrink: 0;
        border-radius: 0 !important;
    }
}

/* =============================================
   MESSAGE ATTACH MENU (+ button popup)
   ============================================= */
.msg-attach-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .18);
    z-index: 100;
    min-width: 150px;
    animation: attachMenuIn .15s ease;
}

@keyframes attachMenuIn {
    from {
        opacity: 0;
        transform: translateY(6px) scale(.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.msg-attach-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}

.msg-attach-item:hover,
.msg-attach-item:active {
    background: rgba(59, 130, 246, .1);
}

.msg-attach-item i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

/* =============================================
   MESSAGE DAY SEPARATOR
   ============================================= */
.msg-day-sep {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 12px;
    user-select: none;
}

.msg-day-sep::before,
.msg-day-sep::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color, rgba(150, 150, 150, .25));
}

.msg-day-sep span {
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-muted, #888);
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
    padding: 3px 10px;
    background: var(--bg-body, #f0f2f5);
    border-radius: 10px;
}

/* =============================================
   MESSAGE PHOTO GALLERY LIGHTBOX
   ============================================= */
.msg-gallery-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.msg-gallery-bg {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.msg-gallery-close {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 10;
    background: rgba(255, 255, 255, .12);
    border: none;
    color: #fff;
    font-size: 1.3rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
}

.msg-gallery-close:hover {
    background: rgba(255, 255, 255, .22);
}

.msg-gallery-counter {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    color: rgba(255, 255, 255, .7);
    font-size: .85rem;
    font-weight: 600;
}

.msg-gallery-img-wrap {
    position: relative;
    z-index: 5;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 50px 16px 10px;
    min-height: 0;
}

.msg-gallery-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    user-select: none;
    -webkit-user-drag: none;
    animation: mgFadeIn .2s ease;
}

@keyframes mgFadeIn {
    from {
        opacity: 0;
        transform: scale(.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.msg-gallery-prev,
.msg-gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, .1);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
}

.msg-gallery-prev {
    left: 12px;
}

.msg-gallery-next {
    right: 12px;
}

.msg-gallery-prev:hover,
.msg-gallery-next:hover {
    background: rgba(255, 255, 255, .22);
}

.msg-gallery-thumbs {
    position: relative;
    z-index: 10;
    display: flex;
    gap: 6px;
    padding: 10px 16px 16px;
    overflow-x: auto;
    max-width: 100%;
    justify-content: center;
    scrollbar-width: none;
}

.msg-gallery-thumbs::-webkit-scrollbar {
    display: none;
}

.msg-gallery-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    opacity: .5;
    transition: opacity .2s, border-color .2s;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.msg-gallery-thumb.active {
    opacity: 1;
    border-color: var(--accent, #3b82f6);
}

.msg-gallery-thumb:hover {
    opacity: .85;
}

@media (max-width: 767.98px) {

    .msg-gallery-prev,
    .msg-gallery-next {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }

    .msg-gallery-prev {
        left: 6px;
    }

    .msg-gallery-next {
        right: 6px;
    }

    .msg-gallery-thumbs {
        padding: 8px 8px 12px;
    }

    .msg-gallery-thumb {
        width: 40px;
        height: 40px;
    }
}

/* =============================================
   DESKTOP MSGBOX HEIGHT
   ============================================= */
@media (min-width: 768px) {
    #msgBox {
        max-height: calc(100vh - 260px);
        min-height: 300px;
    }
}

/* ═══════════════════════════════════════════════
   CHAT APP — fullscreen layout (chat.php)
   ═══════════════════════════════════════════════ */
.chat-app {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 160px);
    max-width: 900px;
    margin: 0 auto;
    background: var(--bs-body-bg, #fff);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 24px rgba(0, 0, 0, .08);
}

/* Header */
.chat-app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    flex-shrink: 0;
    min-height: 52px;
    gap: 8px;
}

.chat-back-btn {
    color: #fff;
    font-size: 1.3rem;
    text-decoration: none;
    line-height: 1;
}

.chat-room-name {
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
}

.chat-online-badge {
    font-size: .72rem;
    color: rgba(255, 255, 255, .85);
    white-space: nowrap;
}

.chat-online-badge .bi-circle-fill {
    font-size: .5rem;
    color: #00ff88;
    vertical-align: middle;
}

/* Room tabs desktop */
.chat-room-tabs {
    display: flex;
    gap: 4px;
}

.chat-room-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: .8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, .75);
    text-decoration: none;
    background: rgba(255, 255, 255, .12);
    transition: background .2s, color .2s;
    white-space: nowrap;
}

.chat-room-tab:hover,
.chat-room-tab.active {
    background: rgba(255, 255, 255, .28);
    color: #fff;
}

/* Room tabs mobile */
.chat-room-tabs-mobile {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    overflow-x: auto;
    background: rgba(102, 126, 234, .08);
    flex-shrink: 0;
    scrollbar-width: none;
}

.chat-room-tabs-mobile::-webkit-scrollbar {
    display: none;
}

.chat-room-tabs-mobile .chat-room-tab {
    color: var(--bs-body-color, #333);
    background: var(--bs-tertiary-bg, #f0f0f0);
    padding: 5px 14px;
    font-size: .78rem;
    gap: 4px;
}

.chat-room-tabs-mobile .chat-room-tab.active {
    background: #667eea;
    color: #fff;
}

/* Messages area */
.chat-messages {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Single message */
.chat-msg {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    max-width: 85%;
    animation: chatMsgIn .25s ease-out;
}

@keyframes chatMsgIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-msg-mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-msg-avatar {
    flex-shrink: 0;
}

.chat-msg-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(102, 126, 234, .2);
}

.chat-msg-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.chat-msg-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .72rem;
    color: var(--bs-secondary-color, #888);
    padding: 0 4px;
}

.chat-msg-nick {
    font-weight: 600;
    color: #667eea;
    text-decoration: none;
    font-size: .75rem;
}

.chat-msg-nick:hover {
    text-decoration: underline;
    color: #764ba2;
}

.chat-msg-time {
    font-size: .68rem;
    opacity: .65;
}

.chat-msg-mine .chat-msg-meta {
    flex-direction: row-reverse;
}

/* Bubble */
.chat-msg-bubble {
    padding: 8px 14px;
    border-radius: 18px;
    font-size: .88rem;
    line-height: 1.45;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.chat-msg-bubble.theirs {
    background: var(--bs-tertiary-bg, #f0f2f5);
    color: var(--bs-body-color, #1c1e21);
    border-bottom-left-radius: 6px;
}

.chat-msg-bubble.mine {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-bottom-right-radius: 6px;
}

/* Reply preview */
.chat-reply-preview {
    padding: 5px 10px;
    border-left: 3px solid #667eea;
    border-radius: 6px;
    background: rgba(102, 126, 234, .07);
    font-size: .76rem;
    color: var(--bs-secondary-color, #666);
    cursor: pointer;
    margin-bottom: 2px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background .2s;
}

.chat-reply-preview:hover {
    background: rgba(102, 126, 234, .14);
}

.chat-reply-preview strong {
    color: #667eea;
}

/* Message actions */
.chat-msg-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity .15s;
    padding: 0 4px;
}

.chat-msg:hover .chat-msg-actions {
    opacity: 1;
}

.chat-msg-mine .chat-msg-actions {
    flex-direction: row-reverse;
}

.chat-action-btn {
    background: none;
    border: none;
    padding: 2px 6px;
    font-size: .78rem;
    color: var(--bs-secondary-color, #999);
    cursor: pointer;
    border-radius: 6px;
    transition: background .15s, color .15s;
    line-height: 1;
}

.chat-action-btn:hover {
    background: rgba(102, 126, 234, .1);
    color: #667eea;
}

.chat-action-del:hover {
    background: rgba(220, 53, 69, .1);
    color: #dc3545;
}

/* Highlight for scrollToMsg */
.chat-msg-highlight {
    animation: chatMsgHighlight 1.5s ease-out;
}

@keyframes chatMsgHighlight {
    0% {
        background: rgba(102, 126, 234, .2);
    }

    100% {
        background: transparent;
    }
}

/* Reply bar */
.chat-reply-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    background: rgba(102, 126, 234, .06);
    border-top: 1px solid rgba(102, 126, 234, .1);
    flex-shrink: 0;
    gap: 8px;
}

.chat-reply-bar-content {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    color: #667eea;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-reply-bar-close {
    background: none;
    border: none;
    color: var(--bs-secondary-color, #999);
    font-size: .85rem;
    cursor: pointer;
    padding: 2px 6px;
    flex-shrink: 0;
}

.chat-reply-bar-close:hover {
    color: #dc3545;
}

/* Input area */
.chat-app .chat-input-area {
    padding: 8px 12px;
    background: var(--bs-body-bg, #fff);
    border-top: 1px solid var(--bs-border-color, #dee2e6);
    flex-shrink: 0;
    position: static !important;
}

.chat-input-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-input-emoji {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 2px;
    flex-shrink: 0;
    line-height: 1;
}

.chat-input-field {
    flex: 1;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 22px;
    padding: 8px 16px;
    font-size: .88rem;
    outline: none;
    background: var(--bs-tertiary-bg, #f8f9fa);
    transition: border-color .2s, box-shadow .2s;
}

.chat-input-field:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, .15);
    background: var(--bs-body-bg, #fff);
}

.chat-input-send {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform .15s, box-shadow .2s;
}

.chat-input-send:hover {
    transform: scale(1.08);
    box-shadow: 0 2px 12px rgba(102, 126, 234, .35);
}

/* Mod menu overlay */
.mod-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modOverlayIn .2s ease-out;
}

@keyframes modOverlayIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.mod-menu {
    background: var(--bs-body-bg, #fff);
    border-radius: 16px;
    padding: 8px 0;
    min-width: 260px;
    max-width: 90vw;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .2);
    animation: modMenuIn .2s ease-out;
}

@keyframes modMenuIn {
    from {
        transform: scale(.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.mod-menu-header {
    font-weight: 700;
    padding: 10px 20px;
    font-size: .95rem;
    border-bottom: 1px solid var(--bs-border-color, #eee);
}

.mod-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 20px;
    border: none;
    background: none;
    font-size: .88rem;
    cursor: pointer;
    transition: background .15s;
    text-align: left;
    color: var(--bs-body-color, #333);
}

.mod-menu-item:hover {
    background: rgba(102, 126, 234, .07);
}

.mod-menu-danger {
    color: #dc3545;
}

.mod-menu-danger:hover {
    background: rgba(220, 53, 69, .07);
}

/* ── Voice join buttons in chat header ── */
.chat-app-header .cv-join-bar {
    display: flex;
    gap: 4px;
    align-items: center;
}

.chat-app-header .cv-join-btn {
    font-size: .72rem;
    padding: 3px 10px;
    border-radius: 16px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #fff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .15);
    transition: background .2s;
}

.chat-app-header .cv-join-btn:hover {
    background: rgba(255, 255, 255, .28);
}

.chat-app-header #cvBadge {
    display: inline-block;
    background: #00ff88;
    color: #1a1a2e;
    font-size: .6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    text-align: center;
    line-height: 16px;
    padding: 0 3px;
}

/* voice panel in chat-app context */
.chat-app #voicePanel {
    margin: 0;
    border-radius: 0;
    flex-shrink: 0;
}

/* ── MOBILE FULLSCREEN for chat ── */
@media (max-width: 767.98px) {

    body.chat-fullscreen footer,
    body.chat-fullscreen #friendsSidebar,
    body.chat-fullscreen .mobile-bottom-nav,
    body.chat-fullscreen .navbar {
        display: none !important;
    }

    body.chat-fullscreen {
        overflow: hidden !important;
        padding-bottom: 0 !important;
    }

    body.chat-fullscreen .page-body {
        padding: 0 !important;
        margin: 0 !important;
    }

    body.chat-fullscreen main.py-3 {
        padding: 0 !important;
        margin: 0 !important;
    }

    body.chat-fullscreen main .container {
        padding: 0 !important;
        max-width: 100% !important;
    }

    body.chat-fullscreen .chat-app {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        height: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        z-index: 1050;
    }

    .chat-msg {
        max-width: 92%;
    }

    .chat-msg-avatar img {
        width: 30px;
        height: 30px;
    }

    .chat-msg-bubble {
        font-size: .84rem;
        padding: 7px 12px;
    }

    .chat-input-field {
        font-size: .85rem;
        padding: 7px 14px;
    }

    /* Always show actions on mobile (no hover) */
    .chat-msg-actions {
        opacity: 1;
    }
}

/* ============================================================
   SOCIAL LAYOUT — Left sidebar nav + center content
   ============================================================ */
/* When social-layout is present, remove container constraints */
.container:has(> .social-layout) {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}

.social-layout {
    display: flex;
    gap: 0;
    min-height: calc(100vh - 120px);
    width: 100%;
    margin-top: -1rem;
    margin-bottom: 0;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.social-nav {
    width: 250px;
    flex-shrink: 0;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
    background: var(--bg-card);
    z-index: 10;
    scrollbar-width: thin;
    scrollbar-color: rgba(128,128,128,.2) transparent;
}

.social-nav::-webkit-scrollbar {
    width: 4px;
}
.social-nav::-webkit-scrollbar-track {
    background: transparent;
}
.social-nav::-webkit-scrollbar-thumb {
    background: rgba(128,128,128,.2);
    border-radius: 4px;
}

[data-bs-theme="dark"] .social-nav {
    border-right-color: rgba(255,255,255,.06);
}

.social-nav-inner {
    padding: 1.2rem .7rem 2rem;
}

.social-nav-title {
    font-weight: 900;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    padding: 0 14px 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: .75;
}

.social-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-main);
    font-size: .84rem;
    font-weight: 600;
    transition: all .2s ease;
    margin-bottom: 2px;
    position: relative;
}

.social-nav-link:hover {
    background: rgba(59, 130, 246, .06);
    color: var(--accent);
    transform: translateX(3px);
}

[data-bs-theme="dark"] .social-nav-link:hover {
    background: rgba(59, 130, 246, .1);
}

.social-nav-link.active {
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #7c3aed));
    color: #fff !important;
    box-shadow: 0 3px 12px rgba(59, 130, 246, .25);
    transform: translateX(0);
}

.social-nav-link.active i {
    color: #fff !important;
}

.social-nav-link i {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    transition: transform .2s;
}

.social-nav-link:hover i {
    transform: scale(1.15);
}

.social-nav-link.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    border-radius: 0 4px 4px 0;
    background: #fff;
    opacity: .6;
}

/* ── Content area ───────────────────────────────────────────── */
.social-content {
    flex: 1;
    min-width: 0;
    padding: 1.5rem 2rem 2rem;
}

/* ── Unified Page Components ────────────────────────────────── */
.sp-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sp-header h2 {
    font-weight: 900;
    font-size: 1.45rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--text-main), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sp-header p {
    color: var(--text-muted);
    font-size: .82rem;
    margin: 6px 0 0;
    -webkit-text-fill-color: var(--text-muted);
}

.sp-header .sp-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sp-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 50px;
    font-weight: 800;
    font-size: .78rem;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
}

.sp-tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 1.25rem;
    padding-bottom: .75rem;
    border-bottom: 2px solid var(--border-color);
}

.sp-tab-bar a,
.sp-tab-bar button {
    padding: 6px 16px;
    border-radius: 10px;
    font-size: .78rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all .18s ease;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.sp-tab-bar a:hover,
.sp-tab-bar button:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 2px 8px rgba(59, 130, 246, .1);
    transform: translateY(-1px);
}

.sp-tab-bar a.active,
.sp-tab-bar button.active {
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #7c3aed));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(59, 130, 246, .25);
}

.sp-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 14px);
    transition: all .22s ease;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
}

.sp-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, .08);
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--accent) 30%, var(--border-color));
}

[data-bs-theme="dark"] .sp-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
}

.sp-card-body {
    padding: 1rem 1.25rem;
}

/* Unified grid */
.sp-grid {
    display: grid;
    gap: 16px;
}

.sp-grid--cards {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.sp-grid--wide {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.sp-grid--list {
    grid-template-columns: 1fr;
}

/* Auto-gap for stacked cards not inside a grid */
.social-content>.sp-card+.sp-card {
    margin-top: 10px;
}

.sp-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.sp-empty .icon {
    font-size: 3rem;
    opacity: .25;
}

/* ── Theme-safe utility classes for social pages ─────────── */
.sp-gradient-header {
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #ec4899));
    color: #fff;
    border-radius: var(--radius-md, 14px);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .1);
}

[data-bs-theme="dark"] .sp-gradient-header {
    box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}

.sp-accent-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 12px;
    border-radius: 50px;
    font-size: .75rem;
    font-weight: 700;
    background: rgba(59, 130, 246, .1);
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, .15);
}

[data-bs-theme="dark"] .sp-accent-badge {
    background: rgba(59, 130, 246, .15);
}

.sp-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .76rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 3px 10px;
    border-radius: 8px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
}

/* ── Responsive: Mobile ─────────────────────────────────────── */
@media (max-width: 991.98px) {
    .social-nav {
        display: none;
    }

    .social-layout {
        width: 100%;
    }

    .social-content {
        padding: 1rem .85rem 2rem;
        max-width: 100%;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .social-nav {
        width: 220px;
    }
    .social-nav-link {
        font-size: .8rem;
        padding: 9px 12px;
    }
}

@media (max-width: 575.98px) {
    .social-content {
        padding: .75rem .5rem 2rem;
    }

    .sp-grid--cards {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .sp-grid--wide {
        grid-template-columns: 1fr;
    }

    .sp-header h2 {
        font-size: 1.15rem;
    }

    .sp-grid {
        gap: 10px;
    }

    .sp-tab-bar {
        gap: 4px;
    }

    .sp-tab-bar a,
    .sp-tab-bar button {
        padding: 5px 12px;
        font-size: .74rem;
    }
}

/* ── Site Info Bar (homepage, above feed) ── */
.site-info-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: .45rem 1rem;
    background: var(--navbar-bg);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.06);
}
.sib-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    text-decoration: none;
    color: rgba(255,255,255,.8);
    font-size: .78rem;
    font-weight: 500;
    transition: color .15s;
    padding: .15rem .4rem;
    border-radius: 8px;
}
.sib-link:hover {
    color: #fff;
    background: rgba(255,255,255,.08);
}
.sib-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34,197,94,.5);
    animation: pulse-green 2s infinite;
    flex-shrink: 0;
}
.sib-text {
    font-size: .72rem;
    color: rgba(255,255,255,.5);
    font-weight: 400;
}
.sib-num {
    font-weight: 800;
    font-size: .82rem;
    color: #fff;
}
.sib-icon {
    font-size: .75rem;
    color: rgba(255,255,255,.55);
}
.sib-divider {
    width: 1px;
    height: 14px;
    background: rgba(255,255,255,.15);
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .site-info-bar {
        padding: .25rem .6rem;
        gap: .5rem;
    }
    .sib-num { font-size: .76rem; }
    .sib-text { font-size: .66rem; }
    .sib-link { gap: .2rem; font-size: .72rem; }
}

/* === Stories Slider === */
.stories-slider { position:relative; }
.stories-track { overflow-x:auto; scrollbar-width:none; -ms-overflow-style:none; }
.stories-track::-webkit-scrollbar { display:none; }
.stories-arrow {
    position:absolute; top:50%; transform:translateY(-50%);
    width:28px; height:28px; border-radius:50%;
    background:var(--card-bg,#fff); border:1px solid var(--border-color,#ddd);
    display:flex; align-items:center; justify-content:center;
    font-size:.75rem; cursor:pointer; z-index:5;
    box-shadow:0 1px 4px rgba(0,0,0,.1); color:var(--text-color,#333);
    transition:opacity .2s;
}
.stories-arrow--left { left:2px; }
.stories-arrow--right { right:2px; }
.stories-arrow:hover { background:var(--accent-color,#4361ee); color:#fff; }
@media (max-width:576px) {
    .stories-arrow { display:none; }
    .stories-track { overflow-x:auto !important; }
}

/* === VIP User Cards === */
.vip-user-card {
    transition:transform .2s;
    padding:6px;
    border-radius:12px;
}
.vip-user-card:hover {
    transform:translateY(-2px);
    background:var(--hover-bg,rgba(0,0,0,.03));
}

/* @mention links */
.mention-link {
    color: #0d6efd;
    background: rgba(13,110,253,.08);
    padding: 0 3px;
    border-radius: 4px;
}
.mention-link:hover {
    background: rgba(13,110,253,.15);
    color: #0a58ca;
}

/* #hashtag links */
.hashtag-link {
    color: #6f42c1;
    font-weight: 600;
}
.hashtag-link:hover {
    color: #5a32a3;
    text-decoration: underline !important;
}

/* Typing indicator animation */
.typing-dots {
    animation: typingPulse 1.2s ease-in-out infinite;
}
@keyframes typingPulse {
    0%, 100% { opacity: .4; }
    50% { opacity: 1; }
}

/* =============================================
   V3 — VISUAL REFINEMENTS
   ============================================= */

/* ── Improved sidebar with collapsible sections ── */
.idx-sb {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.idx-sb-title {
    padding: 11px 14px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    cursor: pointer;
    user-select: none;
    transition: background .15s;
}
.idx-sb-title:hover { background: var(--bg-hover); }
.idx-sb-title .sb-chevron {
    margin-left: auto;
    font-size: .6rem;
    transition: transform .25s ease;
    color: var(--text-muted);
}
.idx-sb-title.collapsed .sb-chevron { transform: rotate(-90deg); }
.idx-sb-nav {
    display: flex; flex-direction: column;
    overflow: hidden;
    transition: max-height .3s ease;
}
.idx-sb-nav.collapsed { max-height: 0 !important; }
.idx-sb-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 14px;
    color: var(--text-main);
    text-decoration: none;
    font-size: .84rem;
    font-weight: 500;
    transition: background .15s, padding-left .15s;
    border-left: 3px solid transparent;
}
.idx-sb-nav a:hover {
    background: var(--bg-hover);
    border-left-color: var(--accent);
    padding-left: 17px;
}
[data-bs-theme="dark"] .idx-sb-nav a:hover {
    background: rgba(255,255,255,.05);
}
.idx-sb-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
}

/* ── Site info bar (online count) ── */
.site-info-bar {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .9rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    font-size: .82rem;
}
.sib-link {
    display: flex;
    align-items: center;
    gap: .4rem;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    transition: color .15s;
}
.sib-link:hover { color: var(--accent); }
.sib-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--online-color);
    animation: pulse-green 2s infinite;
}
.sib-text { color: var(--text-muted); }
.sib-num { font-weight: 700; color: var(--accent); }
.sib-icon { font-size: .9rem; color: var(--accent); }
.sib-divider {
    width: 1px;
    height: 18px;
    background: var(--border-color);
    flex-shrink: 0;
}

/* ── Smoother card transitions ── */
.wall-post-card {
    border-left: 3px solid transparent !important;
    transition: border-left-color .2s ease, box-shadow .25s ease !important;
}

/* ── Better scrollbar for sidebar ── */
.idx-sb-nav::-webkit-scrollbar { width: 3px; }
.idx-sb-nav::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 99px; }

/* ── Navbar brand refinement ── */
.navbar-brand {
    font-weight: 700;
    letter-spacing: .02em;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ── Improved drawer links ── */
.drawer-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: .88rem;
    font-weight: 500;
    transition: background .15s, padding-left .15s;
    border-radius: 0;
    border-left: 3px solid transparent;
}
.drawer-link:hover,
.drawer-link:active {
    background: var(--bg-hover);
    color: var(--accent);
    padding-left: 1.2rem;
    border-left-color: var(--accent);
}

/* ── Stories track spacing ── */
.stories-track { gap: .5rem; padding: .25rem .5rem; }

/* ── Post composer refinement ── */
#wallPostForm textarea {
    border-radius: var(--radius-sm) !important;
    resize: none;
    font-size: .9rem;
    min-height: 48px;
}

/* ── VIP users card refinement ── */
.vip-user-card {
    transition: transform .2s ease;
    padding: .35rem;
    border-radius: var(--radius-sm);
}
.vip-user-card:hover {
    transform: translateY(-3px);
    background: var(--bg-hover);
}

/* ── Reaction picker refinement ── */
.reaction-picker {
    border-radius: var(--radius-md);
    padding: .35rem;
    box-shadow: var(--shadow-lg);
}

/* ── Mobile improvements ── */
@media (max-width: 767.98px) {
    /* Cleaner card spacing on mobile */
    .card { border-radius: var(--radius-sm) !important; }
    .card-body { padding: .85rem; }

    /* Sidebar hidden on mobile by default — shown as drawer */
    .col-lg-3.order-lg-1 { display: none; }

    /* Better touch targets */
    .idx-sb-nav a { padding: 11px 14px; min-height: 44px; }
}

/* ── Subtle page load animation ── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.index-layout { animation: fadeIn .4s ease; }

/* ── Navbar icon hover effect ── */
.navbar .nav-link {
    position: relative;
    border-radius: 8px;
    transition: background .15s ease;
    padding: .4rem .55rem !important;
}
.navbar .nav-link:hover {
    background: rgba(255,255,255,.1);
}
.navbar .nav-link i { font-size: 1.05rem; }

/* ── Better dropdown styling ── */
.navbar .dropdown-menu {
    padding: .4rem;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    min-width: 220px;
}
.navbar .dropdown-item {
    border-radius: 8px;
    padding: .5rem .7rem;
    font-size: .85rem;
    transition: background .12s;
}
.navbar .dropdown-item:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

/* ── Flash toast refinement ── */
.flash-toast .alert {
    border-radius: var(--radius-md) !important;
    font-size: .87rem;
    backdrop-filter: blur(16px);
}

/* =============================================
   V4 — MOBILE POLISH & SIMPLIFICATION
   ============================================= */

/* ── 1. Bottom Nav — cleaner, bigger targets ── */
@media (max-width: 767.98px) {
    .mobile-bottom-nav {
        height: 56px;
        background: var(--bg-card);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -2px 16px rgba(0,0,0,.08);
        gap: 0;
    }
    [data-bs-theme="dark"] .mobile-bottom-nav {
        box-shadow: 0 -2px 16px rgba(0,0,0,.3);
    }
    .mobile-bottom-nav .mbn-item {
        font-size: .62rem;
        gap: 3px;
        letter-spacing: .01em;
        font-weight: 600;
        color: var(--text-muted);
    }
    .mobile-bottom-nav .mbn-item i {
        font-size: 1.2rem;
        transition: transform .15s ease, color .15s ease;
    }
    .mobile-bottom-nav .mbn-item.active {
        color: var(--accent);
    }
    .mobile-bottom-nav .mbn-item.active i {
        transform: scale(1.15);
    }
    .mobile-bottom-nav .mbn-item img {
        width: 22px;
        height: 22px;
        border-radius: 50%;
        border: 2px solid var(--accent);
    }
    .mobile-bottom-nav .mbn-badge {
        top: 2px;
        right: calc(50% - 16px);
        font-size: .55rem;
        padding: 1px 5px;
        min-width: 16px;
        border: 2px solid var(--bg-card);
    }
    body {
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* ── 2. Drawer — cleaner sections, compact ── */
.drawer-section-title {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    padding: .55rem 1rem .2rem;
    user-select: none;
    opacity: .7;
}
.drawer-link {
    padding: .5rem 1rem !important;
    font-size: .85rem !important;
    gap: .6rem !important;
    min-height: 42px;
    border-left: 3px solid transparent;
}
.drawer-link i {
    width: 20px;
    text-align: center;
    font-size: .9rem;
    flex-shrink: 0;
}
.drawer-link .badge {
    font-size: .58rem !important;
    padding: 2px 6px;
    border-radius: 99px;
}
/* Drawer search (new) */
.drawer-search {
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--border-color);
}
.drawer-search input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: .4rem .75rem .4rem 2rem;
    font-size: .82rem;
    background: var(--bg-body);
    color: var(--text-main);
    outline: none;
    transition: border-color .15s;
}
.drawer-search input:focus {
    border-color: var(--accent);
}
.drawer-search-wrap {
    position: relative;
}
.drawer-search-wrap i {
    position: absolute;
    left: .65rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: .78rem;
    color: var(--text-muted);
    pointer-events: none;
}

/* ── 3. Mobile feed cards — edge-to-edge images ── */
@media (max-width: 575.98px) {
    .container {
        padding-left: .5rem !important;
        padding-right: .5rem !important;
    }
    main.py-3 {
        padding-top: .5rem !important;
        padding-bottom: .5rem !important;
    }
    /* Post cards full-bleed on small screens */
    .wall-post-card,
    .card {
        border-radius: 12px !important;
        border-left: none !important;
    }
    .card-body {
        padding: .7rem !important;
    }
    /* Post images edge-to-edge inside card */
    .wall-post-card .card-img-top,
    .wall-post-card img.w-100,
    .post-image-grid img {
        border-radius: 0 !important;
        margin-left: -.7rem;
        margin-right: -.7rem;
        width: calc(100% + 1.4rem) !important;
        max-width: none !important;
    }
    /* Stories strip tighter */
    .stories-track {
        gap: .35rem !important;
        padding: .2rem .3rem !important;
    }
    /* Tighter section gaps */
    .row.g-3 { --bs-gutter-y: .5rem; }
    .mb-3 { margin-bottom: .5rem !important; }
    .mb-4 { margin-bottom: .75rem !important; }
}

/* ── 4. Navbar mobile — compact & clean ── */
@media (max-width: 767.98px) {
    .navbar {
        padding: .3rem .6rem !important;
    }
    .navbar-brand {
        font-size: 1rem !important;
    }
    .navbar .nav-link {
        padding: .35rem .4rem !important;
    }
    .navbar .nav-link i {
        font-size: 1rem !important;
    }
    .navbar .badge {
        font-size: .5rem !important;
        padding: 1px 4px !important;
        min-width: 14px !important;
    }
    /* Hide search on very small */
    .global-search {
        display: none !important;
    }
    /* Dropdown: full-width on mobile */
    .navbar .dropdown-menu {
        position: fixed !important;
        top: auto !important;
        bottom: 60px !important;
        left: .5rem !important;
        right: .5rem !important;
        width: auto !important;
        max-width: none !important;
        transform: none !important;
        border-radius: var(--radius-md) !important;
        box-shadow: 0 -4px 24px rgba(0,0,0,.15) !important;
        max-height: 60vh;
        overflow-y: auto;
        animation: slideUp .2s ease;
    }
    @keyframes slideUp {
        from { opacity: 0; transform: translateY(10px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}

/* ── 5. Mobile profile improvements ── */
@media (max-width: 575.98px) {
    .profile-cover {
        height: 140px !important;
        border-radius: 0 !important;
    }
    .avatar-xl {
        width: 68px !important;
        height: 68px !important;
        margin-top: -36px;
        border: 3px solid var(--bg-card);
    }
    .profile-stat {
        padding: .3rem 0;
    }
    .profile-stat .stat-val {
        font-size: 1rem;
    }
    .profile-stat .stat-label {
        font-size: .68rem;
    }
    /* Profile action buttons stack */
    .profile-actions {
        flex-wrap: wrap;
        gap: .35rem;
    }
    .profile-actions .btn {
        font-size: .78rem;
        padding: .35rem .65rem;
    }
}

/* ── 6. Mobile forms — bigger, friendlier ── */
@media (max-width: 767.98px) {
    .form-control,
    .form-select {
        border-radius: 10px !important;
        padding: .55rem .85rem;
    }
    .btn {
        border-radius: 10px;
    }
    /* Post composer */
    #wallPostForm textarea {
        min-height: 44px;
        padding: .5rem .75rem !important;
    }
    /* Cookie consent compact */
    #cookieConsent {
        padding: 10px 14px !important;
    }
    #cookieConsent p {
        font-size: .78rem !important;
    }
}

/* ── 7. Swipe hint for horizontal scrolls ── */
@media (max-width: 575.98px) {
    .stories-track,
    .chat-room-tabs-mobile,
    .msg-gallery-thumbs {
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    .stories-track > * {
        scroll-snap-align: start;
    }
}

/* ── 8. Pull-to-refresh indicator ── */
.ptr-indicator {
    display: none;
    justify-content: center;
    padding: .5rem 0;
}
.ptr-indicator .spinner-glow {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

/* ── 9. Mobile guest landing ── */
@media (max-width: 575.98px) {
    .guest-landing {
        padding: 1rem 0 !important;
    }
    .guest-landing h1,
    .guest-landing .display-5 {
        font-size: 1.4rem !important;
    }
    .guest-landing .lead {
        font-size: .88rem !important;
    }
    .guest-landing .nav-tabs .nav-link {
        font-size: .82rem;
        padding: .5rem .7rem;
    }
    /* Auth form tight */
    .guest-landing .card {
        border-radius: 14px !important;
    }
    .guest-landing .card-body {
        padding: 1rem !important;
    }
}

/* ── 10. Image lightbox touch-friendly ── */
@media (max-width: 767.98px) {
    .msg-gallery-img-wrap {
        padding: 40px 8px 8px !important;
    }
    .msg-gallery-close {
        top: 8px;
        right: 8px;
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
}

/* ── 11. User cards grid on mobile ── */
@media (max-width: 575.98px) {
    .row.row-cols-2 > *,
    .row.row-cols-sm-3 > * {
        padding-left: .3rem;
        padding-right: .3rem;
    }
    .user-card,
    .friend-card {
        border-radius: 10px !important;
    }
    .user-card img,
    .friend-card img {
        width: 48px !important;
        height: 48px !important;
    }
}

/* ── 12. Better notification panel on mobile ── */
@media (max-width: 575.98px) {
    .notification-item {
        padding: .5rem .6rem !important;
        font-size: .82rem;
        gap: .5rem;
    }
    .notification-item img {
        width: 36px !important;
        height: 36px !important;
    }
}

/* ── 13. VIP cards mobile ── */
@media (max-width: 575.98px) {
    .vip-user-card {
        padding: .25rem !important;
    }
    .vip-user-card img {
        width: 42px !important;
        height: 42px !important;
    }
    .vip-label {
        font-size: .65rem;
    }
}

/* ── 14. Love/dating card mobile ── */
@media (max-width: 575.98px) {
    .love-card-wrap {
        max-width: 100% !important;
        padding: 0 .5rem;
    }
    .love-card-wrap .card {
        border-radius: 16px !important;
    }
}

/* ── 15. Mobile keyboard push-up fix ── */
@media (max-width: 767.98px) {
    body.keyboard-open .mobile-bottom-nav {
        display: none !important;
    }
    body.keyboard-open {
        padding-bottom: 0 !important;
    }
}

/* ── 16. Smooth page transitions on mobile ── */
@media (max-width: 767.98px) {
    main {
        animation: mFadeIn .25s ease;
    }
    @keyframes mFadeIn {
        from { opacity: 0; }
        to   { opacity: 1; }
    }
}

/* ── 17. Modal bottom-sheet style on mobile ── */
@media (max-width: 575.98px) {
    .modal-dialog:not(.modal-fullscreen) {
        margin: 0 !important;
        max-width: 100% !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
    }
    .modal-content {
        border-radius: 16px 16px 0 0 !important;
        border: none !important;
    }
    .modal-content::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: var(--border-color);
        border-radius: 2px;
        margin: 8px auto 0;
    }
    .modal-header {
        padding: .5rem 1rem !important;
        border-bottom: 1px solid var(--border-color);
    }
    .modal-body {
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* ── 18. Active drawer link highlight ── */
.drawer-link.active {
    background: var(--accent-soft) !important;
    color: var(--accent) !important;
    border-left-color: var(--accent) !important;
    font-weight: 600 !important;
}

/* ── 19. Better site-info-bar mobile ── */
@media (max-width: 575.98px) {
    .site-info-bar {
        flex-wrap: wrap;
        justify-content: center;
        padding: .3rem .5rem !important;
        gap: .3rem !important;
        font-size: .75rem;
    }
    .sib-divider {
        display: none;
    }
}

/* ── 20. Offcanvas drawer backdrop ── */
.offcanvas-backdrop.show {
    opacity: .4;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* =============================================
   V5 — DESKTOP CLARITY & SIMPLIFICATION
   ============================================= */

/* ── 1. Navbar text labels on desktop ── */
.nav-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .82rem !important;
    font-weight: 500;
    white-space: nowrap;
    padding: .4rem .65rem !important;
    color: rgba(255,255,255,.8) !important;
    transition: color .15s, background .15s;
    border-radius: 8px;
}
.nav-label:hover,
.nav-label:focus {
    color: #fff !important;
    background: rgba(255,255,255,.1);
}
.nav-label i {
    font-size: .9rem;
}
/* Active page highlight in navbar */
.nav-label.active-page {
    background: rgba(255,255,255,.12);
    color: #fff !important;
}
/* Hide labels on medium screens, keep icons */
@media (max-width: 1199.98px) and (min-width: 992px) {
    .nav-label span {
        display: none;
    }
    .nav-label {
        padding: .4rem .5rem !important;
    }
}

/* ── 2. Desktop sidebar polish ── */
.idx-sb {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}
.idx-sb + .idx-sb {
    margin-top: 0 !important;
}
.idx-sb-title {
    padding: 8px 10px;
    font-size: .68rem;
    border-bottom: none !important;
    color: var(--text-muted);
    opacity: .8;
    border-radius: 8px;
}
.idx-sb-title:hover {
    background: var(--bg-hover);
    opacity: 1;
}
.idx-sb-nav a {
    padding: 7px 10px;
    font-size: .82rem;
    gap: 9px;
    border-radius: 8px;
    border-left: none !important;
}
.idx-sb-nav a:hover {
    background: var(--bg-hover);
    padding-left: 10px;
}
.idx-sb-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    font-size: .7rem;
    box-shadow: none;
}

/* ── 3. Left sidebar container (scroll handled by .v6-sidebar) ── */
.col-lg-3.order-lg-1 {
    position: static;
    overflow: visible;
    max-height: none;
    padding-right: .5rem !important;
}

/* ── 4. Post cards — cleaner hierarchy ── */
.wall-post-card {
    border: 1px solid var(--border-color) !important;
    border-left: none !important;
    border-radius: var(--radius-md) !important;
    transition: box-shadow .2s ease !important;
}
.wall-post-card:hover {
    box-shadow: var(--shadow-md) !important;
}
.post-text {
    font-size: .9rem;
    line-height: 1.65;
    color: var(--text-main);
    word-break: break-word;
}
.post-actions {
    border-top: 1px solid var(--border-color);
    padding-top: .5rem !important;
    margin-top: 0 !important;
}
.post-actions .btn {
    font-size: .8rem !important;
    padding: .3rem .6rem !important;
    border-radius: 8px !important;
    font-weight: 500;
}
.post-actions .btn:hover {
    background: var(--bg-hover);
}

/* ── 5. Site info bar — less prominent ── */
.site-info-bar {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: .3rem 0 !important;
    font-size: .78rem;
    gap: .75rem !important;
}
.sib-num {
    font-weight: 700;
    color: var(--accent) !important;
}

/* ── 6. Post composer polish ── */
#wallPostForm textarea {
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    transition: border-color .15s, box-shadow .15s;
}
#wallPostForm textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: var(--bg-card);
}
#wallPostForm .btn-gradient-primary {
    background: linear-gradient(135deg, var(--accent), #7c5ce7) !important;
    border: none;
    color: #fff;
    border-radius: 20px !important;
    padding: .35rem 1rem !important;
    font-size: .8rem !important;
    font-weight: 600;
    transition: opacity .15s, transform .1s;
}
#wallPostForm .btn-gradient-primary:hover {
    opacity: .9;
    transform: translateY(-1px);
}

/* ── 7. Stories strip polish ── */
.stories-slider .stories-track {
    gap: .4rem;
    padding: .15rem .3rem;
}

/* ── 8. VIP section less flashy ── */
.card-header[style*="f59e0b"] {
    background: linear-gradient(135deg, #f59e0b, #f97316) !important;
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

/* ── 9. Guest landing auth card ── */
.guest-landing .card {
    border: 1px solid var(--border-color);
}
.guest-landing .nav-pills .nav-link {
    border-radius: 10px;
    font-size: .85rem;
    padding: .5rem .75rem;
}
.guest-landing .nav-pills .nav-link.active {
    background: var(--accent);
}
.guest-landing .input-group-text {
    background: var(--bg-body);
    border-color: var(--border-color);
    color: var(--text-muted);
}
.guest-landing .form-control {
    border-color: var(--border-color);
}

/* ── 10. Pagination cleaner ── */
.pagination {
    gap: 3px;
}
.pagination .page-link {
    border-radius: 8px !important;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: .82rem;
    padding: .35rem .65rem;
    transition: background .15s;
}
.pagination .page-link:hover {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent);
}
.pagination .active .page-link {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}

/* ── 11. Reaction picker — less intrusive ── */
.reaction-picker {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: .3rem .4rem;
    gap: 2px;
}
.reaction-picker .reaction-opt {
    padding: 4px 6px;
    border-radius: 8px;
    transition: transform .15s, background .15s;
}
.reaction-picker .reaction-opt:hover {
    transform: scale(1.2);
    background: var(--bg-hover);
}

/* ── 12. Comment section cleaner ── */
.post-comments-section {
    background: transparent;
}
.post-comment-input {
    border-radius: 20px !important;
    padding-left: .85rem !important;
    font-size: .84rem;
}

/* ── 13. Username / level badge spacing ── */
.online-badge {
    font-size: .5rem !important;
    vertical-align: middle;
}

/* ── 14. Desktop container width ── */
@media (min-width: 1400px) {
    .index-layout .container-fluid {
        max-width: 1200px;
    }
}
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .index-layout .container-fluid {
        max-width: 1100px;
    }
}

/* ── 15. Breadcrumb-style page title ── */
.page-heading {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: .75rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.page-heading i {
    color: var(--accent);
    font-size: 1rem;
}

/* ── 16. Better empty states ── */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 2.5rem;
    opacity: .3;
    display: block;
    margin-bottom: .75rem;
}
.empty-state p {
    font-size: .88rem;
    margin: 0;
}

/* ── 17. Card header standardization ── */
.card > .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: .88rem;
    padding: .6rem .85rem;
}

/* ── 18. Focus visible for accessibility ── */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    box-shadow: none !important;
}

/* ── 19. Smooth hover on all interactive cards ── */
.card {
    transition: box-shadow .2s ease, transform .15s ease;
}
.card:hover {
    box-shadow: var(--shadow-md);
}

/* ═══════════════════════════════════════════════════
   V6 — HEADER + LEFT SIDEBAR + RIGHT SIDEBAR REDESIGN
   2026-04-06
   ═══════════════════════════════════════════════════ */

/* ── V6-1. Navbar redesign ── */
.navbar {
    background: var(--navbar-bg) !important;
    padding: .45rem 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1030;
}
.nb-heart {
    font-size: 1.2rem;
    filter: drop-shadow(0 0 6px rgba(239,68,68,.35));
    margin-right: 2px;
}
.nb-name {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -.3px;
}
.nb-tld {
    color: #a78bfa;
    font-size: 1.05rem;
    font-weight: 700;
}
.nb-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: .4rem .7rem !important;
    color: rgba(255,255,255,.7) !important;
    font-size: .8rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all .15s ease;
    white-space: nowrap;
}
.nb-link i {
    font-size: .85rem;
}
.nb-link:hover {
    color: #fff !important;
    background: rgba(255,255,255,.08);
}
.nb-link.active,
.nb-link.active-page {
    color: #fff !important;
    background: rgba(79,109,245,.3);
}
.nb-count {
    background: #22c55e;
    color: #fff;
    font-size: .55rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
    margin-left: 2px;
}

/* Search bar in navbar */
.nb-search {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 20px;
    padding: 0 10px;
    height: 32px;
    min-width: 160px;
    max-width: 220px;
    transition: all .2s ease;
}
.nb-search:focus-within {
    background: rgba(255,255,255,.14);
    border-color: rgba(79,109,245,.5);
    min-width: 220px;
}
.nb-search i {
    color: rgba(255,255,255,.4);
    font-size: .75rem;
    margin-right: 6px;
    flex-shrink: 0;
}
.nb-search input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: .78rem;
    width: 100%;
    padding: 0;
}
.nb-search input::placeholder {
    color: rgba(255,255,255,.35);
}

/* Icon buttons in navbar */
.nb-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: rgba(255,255,255,.7) !important;
    transition: all .15s ease;
    padding: 0 !important;
}
.nb-icon:hover {
    color: #fff !important;
    background: rgba(255,255,255,.1);
}
.nb-icon i {
    font-size: .9rem;
}
.nb-badge {
    position: absolute;
    top: 1px;
    right: 0;
    font-size: .5rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 8px;
    line-height: 1.2;
    min-width: 14px;
    text-align: center;
}
.nb-badge-warn {
    background: #f59e0b;
    color: #000;
}
.nb-badge-danger {
    background: #ef4444;
    color: #fff;
}

/* Avatar dropdown button */
.nb-avatar-btn img {
    transition: border-color .15s ease;
}
.nb-avatar-btn:hover img {
    border-color: rgba(255,255,255,.8) !important;
}

/* Dropdown menu */
.nb-dropdown {
    min-width: 220px;
    border-radius: 12px !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 8px 30px rgba(0,0,0,.15) !important;
    overflow: hidden;
    padding: .25rem 0 !important;
}
.nb-dropdown-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: .6rem .9rem .5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
}
.nb-dropdown .dropdown-item {
    font-size: .82rem;
    padding: .4rem .9rem;
    border-radius: 0;
}
.nb-dropdown .dropdown-item:hover {
    background: var(--accent-soft);
}

/* Auth buttons */
.nb-auth-btn {
    border-radius: 20px;
    padding: .3rem .9rem;
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
}
.nb-auth-primary {
    background: linear-gradient(135deg, #4f6df5, #7c5ce7);
    border: none;
    color: #fff;
}
.nb-auth-primary:hover {
    background: linear-gradient(135deg, #3b57e0, #6d4ed6);
    color: #fff;
}

/* ── V6-2. Left sidebar redesign ── */
.v6-sidebar {
    position: sticky;
    top: 62px;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,.1) transparent;
}
.v6-sidebar::-webkit-scrollbar {
    width: 4px;
}
.v6-sidebar::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,.12);
    border-radius: 2px;
}

/* User mini-card */
.v6-user-card {
    background: var(--bg-card);
    border-radius: 14px;
    padding: .7rem .8rem;
    margin-bottom: .6rem;
    border: 1px solid var(--border-color);
}
.v6-user-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}
.v6-user-link:hover {
    color: inherit;
}
.v6-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    flex-shrink: 0;
}
.v6-user-info {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}
.v6-user-nick {
    font-weight: 700;
    font-size: .88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.v6-user-level {
    font-size: .68rem;
    opacity: .65;
}

/* Quick action row */
.v6-quick-row {
    display: flex;
    gap: 2px;
    margin-bottom: .6rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 4px;
}
.v6-quick {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .45rem 0;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: .88rem;
    text-decoration: none;
    transition: all .15s ease;
    position: relative;
}
.v6-quick:hover {
    background: var(--accent-soft);
    color: var(--accent);
}
.v6-quick-badge {
    position: absolute;
    top: 2px;
    right: 4px;
    background: #ef4444;
    color: #fff;
    font-size: .48rem;
    font-weight: 700;
    padding: 1px 3px;
    border-radius: 6px;
    min-width: 12px;
    text-align: center;
    line-height: 1.2;
}

/* Navigation */
.v6-nav {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: .4rem;
    overflow: hidden;
}
.v6-nav-label {
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-muted);
    padding: .55rem .6rem .2rem;
    opacity: .55;
}
.v6-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: .4rem .6rem;
    border-radius: 8px;
    color: var(--text-body);
    text-decoration: none;
    font-size: .8rem;
    font-weight: 500;
    transition: all .12s ease;
}
.v6-nav-item:hover {
    background: var(--accent-soft);
    color: var(--accent);
}
.v6-nav-item i {
    font-size: .82rem;
    width: 20px;
    text-align: center;
    color: var(--text-muted);
    transition: color .12s ease;
    flex-shrink: 0;
}
.v6-nav-item:hover i {
    color: var(--accent);
}
.v6-nav-item span {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.v6-badge {
    background: #ef4444;
    color: #fff;
    font-size: .52rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
    flex-shrink: 0;
}

/* ── V6-3. Right sidebar redesign ── */
#friendsSidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 62px;
    height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    border-radius: 14px 0 0 14px;
    margin-top: 8px;
}

/* Section wrapper */
.v6-fs-section {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.v6-fs-friends-section {
    flex: 1;
    min-height: 0;
    border-top: 1px solid var(--border-color);
}

/* Section headers */
.v6-fs-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: .55rem .75rem;
    font-size: .75rem;
    font-weight: 700;
    color: var(--text-body);
    flex-shrink: 0;
}
.v6-fs-header i:first-child {
    font-size: .8rem;
    color: var(--accent);
}
.v6-fs-see-all {
    margin-left: auto;
    color: var(--text-muted);
    font-size: .7rem;
    opacity: .55;
    transition: opacity .15s;
}
.v6-fs-see-all:hover {
    opacity: 1;
    color: var(--accent);
}
.v6-fs-pending-count {
    background: #ef4444;
    color: #fff;
    font-size: .52rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 7px;
    margin-left: 2px;
}

/* Games area */
.v6-fs-games {
    padding: 0 .5rem .5rem;
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* Keep existing .fs-game-item but refine */
.fs-game-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: .35rem .45rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-body);
    font-size: .75rem;
    transition: background .12s ease;
}
.fs-game-item:hover {
    background: var(--accent-soft);
    color: var(--accent);
}
.fs-game-item img {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    object-fit: cover;
    flex-shrink: 0;
}

/* Friends list area */
.v6-fs-friends {
    flex: 1;
    overflow-y: auto;
    padding: 0 .5rem .5rem;
    scrollbar-width: thin;
}
.v6-fs-sub-label {
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--text-muted);
    padding: .35rem .2rem;
    opacity: .55;
}

/* Friend items — override existing .fs-item */
.fs-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: .35rem .4rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-body);
    cursor: pointer;
    transition: background .12s ease;
}
.fs-item:hover {
    background: var(--accent-soft);
}
.fs-item img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.fs-nick {
    font-size: .76rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
.fs-online-dot {
    width: 7px;
    height: 7px;
    background: #22c55e;
    border-radius: 50%;
    flex-shrink: 0;
}
.fs-unread {
    background: #ef4444;
    color: #fff;
    font-size: .48rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 6px;
    flex-shrink: 0;
}

/* Request items */
.fs-req-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: .3rem .4rem;
    border-radius: 8px;
    font-size: .75rem;
}
.fs-req-item img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}
.fs-req-accept,
.fs-req-decline {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .6rem;
    cursor: pointer;
    transition: all .15s;
    flex-shrink: 0;
}
.fs-req-accept {
    background: var(--accent);
    color: #fff;
}
.fs-req-decline {
    background: rgba(239,68,68,.1);
    color: #ef4444;
}

/* ── V6-4. Dark mode adjustments ── */
[data-theme="dark"] .nb-search {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.08);
}
[data-theme="dark"] .v6-user-card,
[data-theme="dark"] .v6-quick-row,
[data-theme="dark"] .v6-nav {
    background: var(--bg-card);
    border-color: var(--border-color);
}
[data-theme="dark"] #friendsSidebar {
    background: var(--bg-card);
    border-color: var(--border-color);
}
[data-theme="dark"] .nb-dropdown {
    background: var(--bg-card) !important;
}

/* ── V6-5. Hide old sidebar styles (idx-sb) ── */
.idx-sb { display: none !important; }

/* ── V6-6. Fix navbar vertical alignment ── */
#darkToggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: rgba(255,255,255,.7);
    font-size: .9rem;
    cursor: pointer;
    padding: 0;
    transition: all .15s ease;
}
#darkToggle:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
}

/* ── V6-7. Container-fluid adjustment for index layout ── */
.index-layout {
    padding-top: .5rem;
}

/* ── V6-8. Responsive: hide right sidebar on smaller screens ── */
@media (max-width: 1199px) {
    #friendsSidebar {
        display: none !important;
    }
}

/* ── V6-9. Old nav-label hide in favor of nb-link ── */
.nav-label { display: none !important; }

/* ═══════════════════════════════════════════════════
   V6.1 — BPG FONTS + LEFT SIDEBAR COLOR REFRESH
   2026-04-06
   ═══════════════════════════════════════════════════ */

/* ── V6.1-1. Font usage: BPG No9 for headings, BPG QuadroSquare for brand ── */
.nb-name,
.nb-tld {
    font-family: "BPG QuadroSquare Caps 2013", sans-serif;
    font-size: 1.1rem;
    letter-spacing: .3px;
}
.nb-link span {
    font-family: "BPG No9", sans-serif;
}
.v6-nav-label {
    font-family: "BPG No9", sans-serif !important;
    font-size: .65rem !important;
    letter-spacing: .8px;
}
.v6-nav-item span {
    font-family: "BPG No9", sans-serif;
}
.v6-user-nick {
    font-family: "BPG No9", sans-serif;
}
.v6-fs-header span {
    font-family: "BPG No9", sans-serif;
}
.v6-fs-sub-label {
    font-family: "BPG No9", sans-serif;
}
.nb-dropdown .dropdown-item {
    font-family: "BPG No9", sans-serif;
}
.site-info-bar {
    font-family: "BPG No9", sans-serif;
}

/* ── V6.1-2. Left sidebar color refresh ── */
.v6-user-card {
    background: linear-gradient(135deg, #1a1e36 0%, #232a4a 100%) !important;
    border: 1px solid rgba(79,109,245,.2) !important;
    color: #fff;
}
.v6-user-link:hover { color: #fff; }
.v6-user-nick { color: #fff !important; }
.v6-user-level { color: rgba(255,255,255,.55) !important; }
.v6-user-avatar {
    border-color: rgba(167,139,250,.6) !important;
}

.v6-quick-row {
    background: linear-gradient(135deg, #1e2340 0%, #272e52 100%) !important;
    border: 1px solid rgba(79,109,245,.15) !important;
}
.v6-quick {
    color: rgba(255,255,255,.6) !important;
}
.v6-quick:hover {
    background: rgba(79,109,245,.2) !important;
    color: #a78bfa !important;
}

.v6-nav {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
}
.v6-nav-label {
    color: var(--accent) !important;
    opacity: .75 !important;
    font-weight: 800 !important;
    border-bottom: 1px solid rgba(79,109,245,.08);
    padding-bottom: .35rem !important;
    margin: .15rem .3rem 0;
}
.v6-nav-item i {
    color: var(--accent) !important;
    opacity: .6;
}
.v6-nav-item:hover i {
    opacity: 1;
    color: var(--accent) !important;
}
.v6-nav-item:hover {
    background: linear-gradient(135deg, rgba(79,109,245,.08), rgba(124,92,231,.08)) !important;
    color: var(--accent) !important;
}

/* ── V6.1-3. Dark mode adjustments for new sidebar colors ── */
[data-theme="dark"] .v6-user-card {
    background: linear-gradient(135deg, #0f1225 0%, #171c38 100%) !important;
    border-color: rgba(79,109,245,.15) !important;
}
[data-theme="dark"] .v6-quick-row {
    background: linear-gradient(135deg, #12162a 0%, #1a1f3a 100%) !important;
    border-color: rgba(79,109,245,.1) !important;
}

/* ═══════════════════════════════════════════════════════════
   INDEX DASHBOARD — v8 minimal, cohesive design
   ═══════════════════════════════════════════════════════════ */

/* ── Card & hover ── */
.idx-card { border:none; border-radius:var(--radius-lg); overflow:hidden; box-shadow:0 1px 4px rgba(0,0,0,.05); transition:box-shadow .2s,transform .2s; }
.idx-card:hover { box-shadow:0 4px 16px rgba(0,0,0,.1); transform:translateY(-2px); }

/* ── Section head (minimal icon + title + link) ── */
.idx-head { display:flex; align-items:center; gap:10px; padding:12px 14px; border-bottom:1px solid var(--border-color); }
.idx-head-icon { width:32px; height:32px; border-radius:10px; background:var(--hc); color:#fff; display:flex; align-items:center; justify-content:center; font-size:.82rem; flex-shrink:0; }
.idx-head-title { font-weight:700; font-size:.85rem; color:var(--text-main); font-family:'BPG No9',sans-serif; }
.idx-head-link { margin-left:auto; font-size:.7rem; color:var(--accent); font-weight:600; text-decoration:none; display:flex; align-items:center; gap:3px; opacity:.75; transition:opacity .2s; }
.idx-head-link:hover { opacity:1; color:var(--accent); }
.idx-head-link .bi { font-size:.55rem; }

/* ── Wall banner ── */
.idx-wall-banner { position:relative; border-radius:var(--radius-lg); overflow:hidden; background:linear-gradient(135deg,rgba(79,109,245,.08),rgba(124,92,231,.08)); border:1px solid rgba(79,109,245,.12); }
.idx-wall-glow { position:absolute; top:-30%; right:-20%; width:200px; height:200px; background:radial-gradient(circle,rgba(79,109,245,.12) 0%,transparent 70%); pointer-events:none; }
.idx-wall-inner { display:flex; align-items:center; gap:12px; padding:14px 16px; position:relative; z-index:1; }
.idx-wall-icon { width:44px; height:44px; border-radius:12px; background:linear-gradient(135deg,#4f6df5,#7c5ce7); color:#fff; display:flex; align-items:center; justify-content:center; font-size:1.2rem; flex-shrink:0; }
.idx-wall-title { font-weight:700; font-size:.88rem; color:var(--text-main); font-family:'BPG No9',sans-serif; }
.idx-wall-sub { font-size:.72rem; color:var(--text-muted); margin-top:1px; }
.idx-wall-arrow { width:32px; height:32px; border-radius:50%; background:var(--accent); color:#fff; display:flex; align-items:center; justify-content:center; font-size:1.1rem; flex-shrink:0; transition:transform .2s; }
.idx-wall-banner:hover .idx-wall-arrow { transform:translateX(3px); }

/* ── Slider shared ── */
.idx-slider { position:relative; }
.idx-slider-track { display:flex; gap:10px; overflow-x:auto; scroll-behavior:smooth; -webkit-overflow-scrolling:touch; padding:6px 2px; scrollbar-width:none; }
.idx-slider-track::-webkit-scrollbar { display:none; }
.idx-slider-arr { position:absolute; top:50%; transform:translateY(-50%); z-index:5; width:28px; height:28px; border-radius:50%; border:none; background:var(--card-bg,#fff); box-shadow:0 2px 8px rgba(0,0,0,.15); color:var(--text-main); font-size:.75rem; display:flex; align-items:center; justify-content:center; cursor:pointer; opacity:0; transition:opacity .2s; }
.idx-slider:hover .idx-slider-arr { opacity:.8; }
.idx-slider-arr:hover { opacity:1!important; }
.idx-slider-arr.l { left:-6px; }
.idx-slider-arr.r { right:-6px; }

/* ── Avatar card (VIP / new users / bday) ── */
.idx-avatar-card { display:flex; flex-direction:column; align-items:center; flex-shrink:0; width:74px; text-align:center; padding:4px 0; transition:transform .15s; }
.idx-avatar-card:hover { transform:translateY(-3px); }
.idx-av-ring { width:56px; height:56px; border-radius:50%; padding:2px; background:linear-gradient(135deg,#4f6df5,#7c5ce7); position:relative; }
.idx-av-ring.vip { background:linear-gradient(135deg,#f59e0b,#e67e22); }
.idx-av-ring.online::after { content:''; position:absolute; bottom:2px; right:2px; width:11px; height:11px; border-radius:50%; background:#10b981; border:2px solid var(--card-bg,#fff); z-index:2; }
.idx-av-ring.bday { background:linear-gradient(135deg,#f43f5e,#ec4899); }
.idx-av-ring.bday.today { animation:bdayGlow 2s infinite; }
.idx-av-ring img { width:100%; height:100%; border-radius:50%; object-fit:cover; border:2px solid var(--card-bg,#fff); }
.idx-av-nick { font-size:.68rem; font-weight:600; color:var(--text-main); max-width:70px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:4px; }
.idx-av-meta { font-size:.58rem; color:var(--text-muted); }
.idx-bday-badge { position:absolute; top:-4px; right:-4px; font-size:.75rem; z-index:2; }

@keyframes bdayGlow {
    0%,100% { box-shadow:0 0 6px rgba(244,63,94,.3); }
    50% { box-shadow:0 0 18px rgba(244,63,94,.5); }
}

/* ── Video card ── */
.idx-vid-card { display:flex; flex-direction:column; flex-shrink:0; width:160px; transition:transform .15s; }
.idx-vid-card:hover { transform:translateY(-3px); }
.idx-vid-thumb { position:relative; width:160px; height:90px; border-radius:10px; overflow:hidden; background:#111; }
.idx-vid-thumb img { width:100%; height:100%; object-fit:cover; transition:transform .25s; }
.idx-vid-card:hover .idx-vid-thumb img { transform:scale(1.05); }
.idx-vid-ph { width:100%; height:100%; display:flex; align-items:center; justify-content:center; color:#555; font-size:2rem; }
.idx-vid-badge { position:absolute; top:5px; left:5px; background:rgba(0,0,0,.7); color:#fff; font-size:.58rem; font-weight:700; padding:2px 6px; border-radius:6px; }
.idx-vid-play { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:#fff; font-size:1.5rem; opacity:0; transition:opacity .2s; background:rgba(0,0,0,.25); }
.idx-vid-card:hover .idx-vid-play { opacity:1; }
.idx-vid-meta { padding:5px 2px 0; }
.idx-vid-title { font-size:.72rem; font-weight:600; color:var(--text-main); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.idx-vid-meta small { font-size:.62rem; color:var(--text-muted); }

/* ── Song row ── */
.idx-song { display:flex; align-items:center; gap:12px; padding:11px 14px; border-bottom:1px solid var(--border-color); transition:background .15s; }
.idx-song.last { border-bottom:none; }
.idx-song:hover { background:var(--bg-hover,rgba(0,0,0,.02)); }
.idx-song-num { width:22px; height:22px; border-radius:50%; background:linear-gradient(135deg,#8b5cf6,#6d28d9); color:#fff; font-size:.65rem; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.idx-song-bars { display:flex; align-items:flex-end; gap:2px; height:16px; flex-shrink:0; }
.idx-song-bars span { display:block; width:3px; border-radius:2px; background:var(--accent); }
.idx-song-bars span:nth-child(1) { height:8px; animation:songBar .8s ease-in-out infinite alternate; }
.idx-song-bars span:nth-child(2) { height:14px; animation:songBar .8s .15s ease-in-out infinite alternate; }
.idx-song-bars span:nth-child(3) { height:10px; animation:songBar .8s .3s ease-in-out infinite alternate; }
@keyframes songBar { to { height:4px; } }
.idx-song-body { flex:1; min-width:0; }
.idx-song-name { font-size:.82rem; font-weight:600; color:var(--text-main); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.idx-song-stats { display:flex; gap:8px; flex-shrink:0; font-size:.68rem; color:var(--text-muted); }

/* ── List row (groups, blogs) ── */
.idx-list-row { display:flex; align-items:center; gap:10px; padding:10px 14px; border-bottom:1px solid var(--border-color); transition:background .15s; }
.idx-list-row.last { border-bottom:none; }
.idx-list-row:hover { background:var(--bg-hover,rgba(0,0,0,.02)); }
.idx-list-icon { width:40px; height:40px; border-radius:10px; overflow:hidden; background:var(--hc,#7c3aed); color:#fff; display:flex; align-items:center; justify-content:center; font-size:1.1rem; flex-shrink:0; }
.idx-list-icon img { width:100%; height:100%; object-fit:cover; }
.idx-list-av { width:36px; height:36px; border-radius:50%; object-fit:cover; flex-shrink:0; }
.idx-list-body { flex:1; min-width:0; }
.idx-list-title { font-size:.82rem; font-weight:600; color:var(--text-main); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.idx-list-time { font-size:.62rem; flex-shrink:0; }

/* ── Games grid ── */
.idx-games { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.idx-game { display:flex; flex-direction:column; align-items:center; text-align:center; padding:12px 4px 10px; border-radius:12px; background:var(--bg-hover,rgba(0,0,0,.02)); transition:background .15s,transform .15s,box-shadow .15s; }
.idx-game:hover { transform:translateY(-3px); box-shadow:0 4px 12px rgba(0,0,0,.08); }
.idx-game-icon { width:40px; height:40px; border-radius:12px; background:var(--gc); color:#fff; display:flex; align-items:center; justify-content:center; font-size:1.1rem; margin-bottom:6px; transition:transform .2s; }
.idx-game:hover .idx-game-icon { transform:scale(1.1); }
.idx-game-name { font-size:.7rem; font-weight:600; color:var(--text-main); margin-bottom:2px; }
.idx-game-player { font-size:.58rem; color:var(--text-muted); display:flex; align-items:center; gap:3px; }
.idx-game-av { width:14px; height:14px; border-radius:50%; object-fit:cover; }
@media(max-width:576px) { .idx-games { grid-template-columns:repeat(3,1fr); } }

/* ── Reel card ── */
.idx-reel { display:flex; flex-direction:column; flex-shrink:0; width:120px; transition:transform .15s; }
.idx-reel:hover { transform:translateY(-3px); }
.idx-reel-thumb { position:relative; width:120px; height:170px; border-radius:12px; overflow:hidden; background:#111; }
.idx-reel-thumb img { width:100%; height:100%; object-fit:cover; transition:transform .25s; }
.idx-reel:hover .idx-reel-thumb img { transform:scale(1.05); }
.idx-reel-ph { width:100%; height:100%; display:flex; align-items:center; justify-content:center; color:#555; font-size:2rem; }
.idx-reel-overlay { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(0,0,0,.2); color:#fff; font-size:1.8rem; opacity:0; transition:opacity .2s; }
.idx-reel:hover .idx-reel-overlay { opacity:1; }
.idx-reel-views { position:absolute; bottom:4px; left:4px; background:rgba(0,0,0,.65); color:#fff; font-size:.58rem; padding:2px 6px; border-radius:6px; }
.idx-reel-nick { font-size:.68rem; font-weight:600; color:var(--text-main); text-align:center; margin-top:5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* ── Shop grid ── */
.idx-shop { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.idx-shop-card { display:flex; flex-direction:column; align-items:center; text-align:center; padding:14px 6px 10px; border-radius:12px; background:var(--bg-hover,rgba(0,0,0,.02)); transition:background .15s,transform .15s,box-shadow .15s; }
.idx-shop-card:hover { transform:translateY(-3px); box-shadow:0 4px 12px rgba(0,0,0,.08); }
.idx-shop-icon { width:44px; height:44px; border-radius:50%; background:var(--sc); color:#fff; display:flex; align-items:center; justify-content:center; font-size:1.15rem; margin-bottom:6px; transition:transform .2s; }
.idx-shop-card:hover .idx-shop-icon { transform:scale(1.1) rotate(8deg); }
.idx-shop-name { font-size:.72rem; font-weight:600; color:var(--text-main); margin-bottom:3px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100%; }
.idx-shop-price { font-size:.7rem; color:#f59e0b; font-weight:700; display:flex; align-items:center; gap:3px; }
@media(max-width:576px) { .idx-shop { grid-template-columns:repeat(2,1fr); } }

/* ── Dark mode refinements ── */
[data-theme="dark"] .idx-card { box-shadow:0 1px 4px rgba(0,0,0,.2); }
[data-theme="dark"] .idx-card:hover { box-shadow:0 4px 20px rgba(0,0,0,.3); }
[data-theme="dark"] .idx-wall-banner { background:linear-gradient(135deg,rgba(79,109,245,.1),rgba(124,92,231,.1)); border-color:rgba(79,109,245,.2); }
[data-theme="dark"] .idx-game { background:rgba(255,255,255,.04); }
[data-theme="dark"] .idx-game:hover { background:rgba(255,255,255,.08); box-shadow:0 4px 12px rgba(0,0,0,.2); }
[data-theme="dark"] .idx-shop-card { background:rgba(255,255,255,.04); }
[data-theme="dark"] .idx-shop-card:hover { background:rgba(255,255,255,.08); }
[data-theme="dark"] .idx-slider-arr { background:var(--card-bg,#1e1e2e); }
[data-theme="dark"] .idx-head { border-bottom-color:rgba(255,255,255,.06); }
[data-theme="dark"] .idx-song { border-bottom-color:rgba(255,255,255,.06); }
[data-theme="dark"] .idx-list-row { border-bottom-color:rgba(255,255,255,.06); }

/* ── Song play button ── */
.idx-song-play { width:28px; height:28px; border-radius:50%; background:linear-gradient(135deg,#1db954,#0d6efd); color:#fff; border:none; display:flex; align-items:center; justify-content:center; font-size:.85rem; cursor:pointer; flex-shrink:0; transition:transform .15s,box-shadow .15s; padding:0; }
.idx-song-play:hover { transform:scale(1.15); box-shadow:0 2px 8px rgba(29,185,84,.4); }
.idx-song.playing { background:linear-gradient(135deg,rgba(29,185,84,.06),rgba(13,110,253,.04)); }
.idx-song.playing .idx-song-bars span { animation-play-state:running!important; }

/* ── Desktop: bigger avatar cards ── */
@media(min-width:992px){
    .idx-avatar-card { width:82px; }
    .idx-av-ring { width:62px; height:62px; }
    .idx-av-nick { max-width:78px; font-size:.72rem; }
}

/* ── Games: slider on mobile ── */
@media(max-width:767px){
    .idx-games { display:flex!important; overflow-x:auto; scroll-behavior:smooth; -webkit-overflow-scrolling:touch; gap:10px; scrollbar-width:none; padding:4px 0; }
    .idx-games::-webkit-scrollbar { display:none; }
    .idx-game { flex-shrink:0; width:80px; }
}

/* ── Marquee auto-scroll for sliders ── */
.idx-slider-track.marquee { animation:idxMarquee 25s linear infinite; }
.idx-slider-track.marquee:hover { animation-play-state:paused; }
@keyframes idxMarquee { 0% { transform:translateX(0); } 100% { transform:translateX(-50%); } }