/* ============ ECHO v5 — Premium Dark Theme ============ */
@import url('/fonts/inter.css'); /* Inter served by Echo itself: no request to Google Fonts */

:root {
    --bg: #000000;
    --bg-rgb: 0, 0, 0;
    --surface: #16181c;
    --surface-rgb: 22, 24, 28;
    --surface-hover: #1d1f23;
    --border: rgba(255, 255, 255, .08);
    --text: #e7e9ea;
    --text-secondary: #8b98a5; /* 6.6:1 on black (was #71767b, below WCAG AA) */
    --accent: #1d9bf0;
    --accent-rgb: 29, 155, 240;
    --purple: #8b5cf6;
    --purple-rgb: 139, 92, 246;
    --green: #00c471;
    --red: #f4212e;
    --orange: #ff7a00;
    --gold: #ffd700;
    --radius: 16px;
    --glow: 0 0 20px rgba(var(--accent-rgb), .15);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    transition: background 1s ease;
}

body.positive {
    background: radial-gradient(ellipse at 20% 0%, rgba(0, 196, 113, .04), transparent 60%), var(--bg);
}

body.negative {
    background: radial-gradient(ellipse at 20% 0%, rgba(244, 33, 46, .04), transparent 60%), var(--bg);
}

body.mood-chill {
    background: radial-gradient(ellipse at 50% 0%, rgba(29, 155, 240, 0.1), transparent 60%), var(--bg);
}

body.mood-energetic {
    background: radial-gradient(ellipse at 50% 0%, rgba(139, 92, 246, 0.1), transparent 60%), radial-gradient(ellipse at 20% 100%, rgba(255, 122, 0, 0.07), transparent 50%), var(--bg);
}

body.mood-intense {
    background: radial-gradient(ellipse at 80% 0%, rgba(244, 33, 46, 0.1), transparent 60%), radial-gradient(ellipse at 20% 100%, rgba(139, 92, 246, 0.1), transparent 60%), var(--bg);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.app {
    display: flex;
    max-width: 1280px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    gap: 0;
    align-items: flex-start;
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: 260px;
    min-width: 260px;
    padding: 0 8px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: transparent;
    flex-shrink: 0;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 8px 10px;
}

.logo-img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), .4));
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {

    0%,
    100% {
        filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), .4));
    }

    50% {
        filter: drop-shadow(0 0 16px rgba(var(--accent-rgb), .7));
    }
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 9999px;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    transition: all .15s;
    margin-bottom: 2px;
    position: relative;
}

.nav-item:hover {
    background: rgba(var(--surface-rgb), 0.8);
    text-decoration: none;
}

.nav-item.active {
    font-weight: 700;
    background: rgba(var(--accent-rgb), .06);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--accent), var(--purple));
}

.nav-icon {
    font-size: 1.3rem;
    width: 28px;
    text-align: center;
}

.btn-post {
    padding: 14px;
    border: none;
    border-radius: 9999px;
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    color: #fff;
    cursor: pointer;
    margin: 16px 0;
    font-family: inherit;
    transition: all .2s;
    box-shadow: 0 4px 14px rgba(var(--accent-rgb), .3);
}

.btn-post:hover {
    opacity: .9;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--accent-rgb), .4);
}

.btn-post:active {
    transform: translateY(0);
}

.sidebar-profile {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius);
    transition: background .15s;
    text-decoration: none;
    color: var(--text);
}

.sidebar-profile:hover {
    background: rgba(var(--surface-rgb), 0.8);
    text-decoration: none;
}

.sidebar-profile img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.sidebar-profile .name {
    font-weight: 600;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============ MAIN ============ */
.main {
    flex: 1;
    max-width: 600px;
    min-width: 0;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0;
}

.page-header {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(var(--bg-rgb), .85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border);
}

.page-header h2 {
    font-size: 1.2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-header .sub {
    color: var(--text-secondary);
    font-size: .8rem;
}

/* ============ BADGES ============ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .02em;
    vertical-align: middle;
    margin-left: 4px;
}

.badge-admin {
    background: linear-gradient(135deg, rgba(255, 215, 0, .15), rgba(255, 165, 0, .15));
    color: var(--gold);
    border: 1px solid rgba(255, 215, 0, .2);
    box-shadow: 0 0 12px rgba(255, 215, 0, .1);
    animation: adminGlow 2s ease-in-out infinite;
}

@keyframes adminGlow {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(255, 215, 0, .1);
    }

    50% {
        box-shadow: 0 0 16px rgba(255, 215, 0, .25);
    }
}

.badge-mod {
    background: linear-gradient(135deg, rgba(139, 92, 246, .15), rgba(99, 102, 241, .15));
    color: var(--purple);
    border: 1px solid rgba(139, 92, 246, .2);
    box-shadow: 0 0 8px rgba(139, 92, 246, .1);
}

.badge-ban {
    background: rgba(244, 33, 46, .1);
    color: var(--red);
    border: 1px solid rgba(244, 33, 46, .15);
}

.badge-inline {
    font-size: .85rem;
    vertical-align: middle;
}



/* ============ COMPOSE ============ */
.compose {
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    background: transparent;
    border-bottom: 1px solid var(--border);
    position: relative;
    transition: background 0.2s;
}

.compose:focus-within {
    background: rgba(var(--surface-rgb), 0.15);
}

.compose-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

.compose textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: inherit;
    font-size: 1.1rem;
    resize: none;
    outline: none;
    min-height: 24px;
}

.compose textarea::placeholder {
    color: var(--text-secondary);
}



.compose-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.btn {
    padding: 8px 20px;
    border-radius: 9999px;
    font-weight: 700;
    font-size: .85rem;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all .2s;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    color: #fff;
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), .25);
}

.btn:hover {
    opacity: .9;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-sm {
    padding: 5px 14px;
    font-size: .78rem;
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border);
    box-shadow: none;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, .05);
}

/* ============ POSTS ============ */
.post {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: transparent;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s ease;
    animation: fadeUp .4s ease forwards;
    position: relative;
    content-visibility: auto;
    contain-intrinsic-size: auto 120px;
}

.post:hover {
    background: rgba(var(--surface-rgb), 0.25);
}

/* ============ DYNAMIC AURAS ============ */
.post.aura-pulse {
    background: rgba(var(--accent-rgb), 0.04);
    border-left: 3px solid var(--accent);
    animation: postPulse 2s infinite alternate, fadeUp .3s ease;
}

.post.aura-glow {
    background: rgba(var(--purple-rgb), 0.04);
    border-left: 3px solid var(--purple);
    animation: fadeUp .3s ease;
}

@keyframes postPulse {
    from { background: rgba(var(--accent-rgb), 0.03); }
    to { background: rgba(var(--accent-rgb), 0.07); }
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

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

.post-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.post-name {
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

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

.post-time {
    color: var(--text-secondary);
    font-size: .85rem;
}

.post-text {
    margin-top: 4px;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.post-actions {
    display: flex;
    gap: 16px;
    margin-top: 10px;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 9999px;
    transition: all .15s;
    font-family: inherit;
}

.action-btn:hover {
    color: var(--accent);
    background: rgba(var(--accent-rgb), .08);
}

.action-btn.liked {
    color: var(--red);
}

.action-btn.liked:hover {
    background: rgba(244, 33, 46, .08);
}



.action-delete:hover {
    color: var(--red) !important;
    background: rgba(244, 33, 46, .08) !important;
}

.hashtag {
    color: var(--accent);
    font-weight: 500;
}

.mention {
    color: var(--purple);
    font-weight: 500;
}

.e2e-badge {
    color: var(--green);
    font-size: .8rem;
    font-weight: 600;
    background: rgba(0, 196, 113, .08);
    padding: 4px 10px;
    border-radius: 9999px;
    display: inline-block;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

/* ============ PROFILE ============ */
.profile-banner {
    height: 150px;
    position: relative;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), .3), rgba(var(--purple-rgb), .3));
    overflow: hidden;
}

.profile-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='20' cy='30' r='1.5' fill='rgba(255,255,255,.1)'/%3E%3Ccircle cx='60' cy='20' r='1' fill='rgba(255,255,255,.08)'/%3E%3Ccircle cx='80' cy='60' r='2' fill='rgba(255,255,255,.06)'/%3E%3Ccircle cx='40' cy='70' r='1.2' fill='rgba(255,255,255,.07)'/%3E%3Ccircle cx='90' cy='40' r='.8' fill='rgba(255,255,255,.09)'/%3E%3C/svg%3E");
    background-size: 200px;
    animation: starsFloat 40s linear infinite;
}

@keyframes starsFloat {
    to {
        background-position: 200px -200px;
    }
}

.profile-avatar-wrap {
    position: absolute;
    bottom: -40px;
    left: 20px;
}

.profile-avatar {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
    transition: transform .2s;
}

.profile-avatar:hover {
    transform: scale(1.05);
}

.profile-actions {
    padding: 12px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    min-height: 56px;
}

.profile-info {
    padding: 4px 16px 16px;
}

.profile-info h2 {
    font-size: 1.2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.profile-bio {
    margin-top: 6px;
    color: var(--text);
    font-size: .95rem;
}

.profile-joined {
    color: var(--text-secondary);
    font-size: .85rem;
    margin-top: 6px;
}

.profile-stats {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    font-size: .9rem;
    color: var(--text-secondary);
}

.profile-stats strong {
    color: var(--text);
    font-weight: 700;
}

.profile-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.profile-tab {
    flex: 1;
    text-align: center;
    padding: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: color .15s;
}

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

.profile-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), var(--purple));
}

/* ============ WIDGETS ============ */
.widgets {
    width: 350px;
    min-width: 350px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 16px 16px 24px;
    position: sticky;
    top: 0;
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-shrink: 0;
}

.widgets::-webkit-scrollbar {
    display: none;
}

.widget {
    background: rgba(var(--surface-rgb), 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, .06);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .04);
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}

.widget:hover {
    border-color: rgba(255, 255, 255, .1);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.widget h3 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.widget-item {
    padding: 10px 0;
    border-top: 1px solid var(--border);
    display: block;
    border-radius: 8px;
    padding: 10px;
    margin: 0 -10px;
}

.widget-item:first-of-type {
    border-top: none;
}

.widget-item:hover {
    background: rgba(var(--surface-rgb), .5);
}

.widget-tag {
    font-weight: 700;
}

.widget-count {
    font-size: .8rem;
    color: var(--text-secondary);
}

.widget-about {
    color: var(--text-secondary);
    font-size: .9rem;
}

/* ============ MESSAGES / CHAT ============ */

.convo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: background .15s;
    border-bottom: 1px solid var(--border);
}

.convo-item:hover {
    background: rgba(var(--surface-rgb), .6);
}

.convo-item img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.convo-info {
    flex: 1;
    min-width: 0;
}

.convo-name {
    font-weight: 700;
    font-size: .95rem;
}

.convo-preview {
    color: var(--text-secondary);
    font-size: .85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-area {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.msg-wrap {
    display: flex;
    flex-direction: column;
    animation: fadeUp .2s ease;
}

.msg-wrap.mine {
    align-items: flex-end;
}

.msg-wrap.theirs {
    align-items: flex-start;
}

.chat-bubble {
    padding: 10px 16px;
    border-radius: 20px;
    max-width: 75%;
    font-size: .95rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-bubble.mine {
    background: linear-gradient(135deg, var(--accent), var(--purple));
    color: #fff;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 16px rgba(var(--accent-rgb), .25);
}

.chat-bubble.theirs {
    background: rgba(var(--surface-rgb), 0.7);
    backdrop-filter: blur(8px);
    color: var(--text);
    border-bottom-left-radius: 6px;
    border: 1px solid rgba(255, 255, 255, .07);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.chat-time {
    font-size: .7rem;
    color: var(--text-secondary);
    margin-top: 2px;
    padding: 0 4px;
}

.chat-input-bar {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(var(--bg-rgb), .8);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
}

.chat-input-bar input {
    flex: 1;
    background: rgba(var(--surface-rgb), 0.6);
    border: 1px solid rgba(255, 255, 255, .08);
    color: var(--text);
    padding: 10px 18px;
    border-radius: 9999px;
    font-family: inherit;
    font-size: .9rem;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    backdrop-filter: blur(8px);
}

.chat-input-bar input:focus {
    border-color: rgba(var(--accent-rgb), .5);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .1);
}

/* ============ MODALS ============ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 999;
    justify-content: center;
    align-items: center;
    padding: 16px;
    backdrop-filter: blur(0px);
    transition: background .25s ease, backdrop-filter .25s ease;
}

.modal-overlay.open {
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(4px);
}

.modal-overlay .modal-box {
    transform: translateY(24px) scale(0.96);
    opacity: 0;
    transition: transform .25s cubic-bezier(.16, 1, .3, 1), opacity .25s ease;
}

.modal-overlay.open .modal-box {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-box {
    background: var(--surface);
    border-radius: 20px;
    width: 480px;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 16px 48px rgba(0, 0, 0, .4);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
}

.modal-close:hover {
    background: rgba(255, 255, 255, .08);
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: .85rem;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.form-group textarea,
.form-group input[type="text"] {
    width: 100%;
    background: rgba(var(--bg-rgb), .6);
    border: 1px solid rgba(255, 255, 255, .08);
    color: var(--text);
    padding: 12px 16px;
    border-radius: 12px;
    font-family: inherit;
    font-size: .95rem;
    outline: none;
    resize: vertical;
    transition: border-color .2s, box-shadow .2s;
}

.form-group textarea:focus,
.form-group input[type="text"]:focus {
    border-color: rgba(var(--accent-rgb), .5);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .1);
}

.avatar-upload {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    margin: 0 auto 16px;
}

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

.avatar-upload .overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity .2s;
}

.avatar-upload:hover .overlay {
    opacity: 1;
}

/* ============ SEARCH ============ */
.search-bar {
    display: flex;
    margin-bottom: 0;
}

.search-bar input {
    flex: 1;
    background: rgba(var(--surface-rgb), 0.6);
    border: 1px solid rgba(255, 255, 255, .08);
    color: var(--text);
    padding: 12px 20px;
    border-radius: 9999px;
    font-family: inherit;
    font-size: .95rem;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    backdrop-filter: blur(8px);
}

.search-bar input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .1);
}

/* ============ ADMIN PANEL ============ */
.admin-panel {
    padding: 16px;
}

.admin-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.admin-section h3 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-desc {
    color: var(--text-secondary);
    font-size: .9rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    animation: fadeUp .2s ease;
}

.admin-user:first-child {
    border-top: none;
}

.admin-user-info {
    flex: 1;
}

.admin-user-info strong {
    font-size: .95rem;
}

.admin-user-meta {
    font-size: .8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.admin-user-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: .75rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface-hover);
    color: var(--text);
    font-family: inherit;
    transition: all .15s;
}

.btn-sm:hover {
    background: rgba(var(--accent-rgb), .1);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-danger {
    border-color: rgba(244, 33, 46, .2);
    color: var(--red);
}

.btn-danger:hover {
    background: rgba(244, 33, 46, .1);
    border-color: var(--red);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.stat-card {
    background: var(--bg);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    border: 1px solid var(--border);
    transition: all .2s;
}

.stat-card:hover {
    border-color: rgba(var(--accent-rgb), .3);
    box-shadow: var(--glow);
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-secondary);
    font-size: .8rem;
    font-weight: 600;
    margin-top: 4px;
}

/* ============ EMPTY STATE ============ */
.empty {
    padding: 60px 24px;
    text-align: center;
    color: var(--text-secondary);
    animation: fadeUp .4s ease;
}

.empty h3 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 10px;
    letter-spacing: -.01em;
}

.empty p {
    font-size: .95rem;
    line-height: 1.6;
}

/* ============ MOBILE BOTTOM NAV ============ */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(var(--bg-rgb), .85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    padding: 6px 0;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    z-index: 100;
}

.mobile-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 480px;
    margin: 0 auto;
}

.mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: .65rem;
    font-weight: 600;
    transition: color .15s;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav a.active {
    color: var(--text);
}

.mob-icon {
    font-size: 1.4rem;
    line-height: 1;
}

/* Specific styling for Admin tab in mobile nav */
.mobile-nav a[href="/admin"] .mob-icon {
    color: var(--gold);
    transition: all .2s ease;
}

.mobile-nav a[href="/admin"].active .mob-icon {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, .4));
    transform: scale(1.1);
}

.mobile-nav a[href="/admin"]:hover .mob-icon {
    text-shadow: 0 0 12px var(--gold);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1200px) {
    .widgets {
        width: 300px;
        min-width: 300px;
        padding: 16px 12px 16px 16px;
    }
}

@media (max-width: 1050px) {
    .widgets {
        display: none;
    }

    .main {
        border-right: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .mobile-nav {
        display: block;
    }

    .main {
        max-width: 100%;
        border-left: none;
        border-right: none;
        padding-bottom: 70px;
    }

    .app {
        max-width: 100%;
    }

    .compose textarea {
        font-size: 1rem;
    }

    .compose {
        padding: 12px 16px;
    }

    .post {
        padding: 12px 16px;
        gap: 10px;
    }

    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-user {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .admin-user-actions {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 12px 16px;
    }

    .page-header h2 {
        font-size: 1.05rem;
    }

    .post {
        padding: 12px;
        gap: 8px;
    }

    .compose {
        padding: 10px 12px;
    }

    .profile-banner {
        height: 120px;
    }

    .profile-avatar {
        width: 72px;
        height: 72px;
    }

    .chat-bubble {
        max-width: 85%;
    }

    .modal-box {
        border-radius: 16px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-number {
        font-size: 1.4rem;
    }
}

/* ============ USER LIST ============ */
.user-list {
    padding: 0;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    cursor: pointer;
    transition: background .15s;
    border-bottom: 1px solid var(--border);
    animation: fadeUp .2s ease;
}

.user-card:hover {
    background: rgba(var(--surface-rgb), .5);
}

.user-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-card-info {
    flex: 1;
    min-width: 0;
}

.user-card-name {
    font-weight: 700;
    font-size: .95rem;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.user-card-bio {
    color: var(--text-secondary);
    font-size: .85rem;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(var(--accent-rgb), .2), rgba(var(--purple-rgb), .2));
    border-radius: 3px;
}

/* ============ SELECTION ============ */
::selection {
    background: rgba(var(--accent-rgb), .3);
}

/* ============ MOBILE ENHANCEMENTS ============ */
@media (max-width: 768px) {
    .mobile-nav a {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 4px 6px;
        font-size: .6rem;
    }

    .mob-icon {
        font-size: 1.3rem;
    }

    .chat-input-bar {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .chat-area {
        height: calc(100dvh - 57px - 70px);
    }

    .user-card {
        padding: 12px 16px;
    }

    .convo-item {
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .mobile-nav a {
        font-size: .55rem;
        padding: 4px;
    }

    .profile-stats {
        gap: 12px;
        font-size: .85rem;
    }

    .profile-info h2 {
        font-size: 1.05rem;
    }

    .user-card-avatar {
        width: 40px;
        height: 40px;
    }
}

/* ============ POST IMAGES ============ */
.post-image-wrap {
    margin-top: 10px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    max-height: 400px;
}

.post-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    display: block;
    transition: opacity .2s;
    cursor: pointer;
}

.post-image:hover {
    opacity: .92;
}

/* ============ COMPOSE IMAGE PREVIEW ============ */
.image-preview {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    max-height: 250px;
}

.image-preview img {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    display: block;
    border-radius: 16px;
}

.image-preview-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(4px);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: .9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

.image-preview-close:hover {
    background: rgba(244, 33, 46, .8);
    transform: scale(1.1);
}

/* ============ COMPOSE TOOLS ============ */
.compose-tools {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: auto;
}

.compose-icon {
    cursor: pointer;
    font-size: 1.15rem;
    padding: 6px 8px;
    border-radius: 50%;
    transition: all .15s;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.compose-icon:hover {
    background: rgba(var(--accent-rgb), .1);
    transform: scale(1.1);
}

/* ============ NOTIFICATION TOAST ============ */
.notif-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(22, 24, 28, .95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .5), 0 0 0 1px rgba(var(--accent-rgb), .1);
    cursor: pointer;
    max-width: 380px;
    transform: translateX(120%);
    opacity: 0;
    transition: all .3s cubic-bezier(.4, 0, .2, 1);
    animation: none;
}

.notif-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.notif-toast-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(var(--accent-rgb), .3);
}

.notif-toast-body {
    flex: 1;
    min-width: 0;
}

.notif-toast-title {
    font-weight: 700;
    font-size: .9rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-toast-text {
    font-size: .8rem;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: .9rem;
    padding: 4px;
    border-radius: 50%;
    transition: all .15s;
    flex-shrink: 0;
}

.notif-toast-close:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .1);
}

@media (max-width: 768px) {
    .notif-toast {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* ============ NEWS WIDGET ============ */
.widget-news {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.news-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
}

.news-item:first-child {
    border-top: none;
    padding-top: 0;
}

.news-date {
    font-size: .7rem;
    color: var(--accent);
    font-weight: 600;
    white-space: nowrap;
    min-width: 45px;
    padding-top: 2px;
}

.news-text {
    font-size: .82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
/* --- NEW FEATURES CSS --- */
.reply-compose { margin-left: 20px; border-left: 2px solid var(--border); padding-left: 15px; background: transparent; }
.action-reply { color: var(--text-secondary); }
.action-reply:hover { color: var(--accent); background: rgba(var(--accent-rgb), 0.1); }
.action-repost { color: var(--text-secondary); }
.action-repost:hover { color: var(--green); background: rgba(0, 196, 113, 0.1); }
.action-bookmark { color: var(--text-secondary); }
.action-bookmark:hover { color: var(--purple); background: rgba(var(--purple-rgb), 0.1); }
.action-bookmark.bookmarked { color: var(--purple); }
.repost-embed { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-top: 10px; cursor: pointer; }
.repost-embed:hover { background: var(--surface-hover); }
.repost-embed-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.repost-embed-avatar { width: 20px; height: 20px; border-radius: 50%; }
.repost-embed-text { font-size: 0.9rem; color: var(--text-secondary); }
.repost-label { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 4px; font-weight: 600; }

/* POLLS */
.poll-container { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.poll-result { display: flex; flex-direction: column; gap: 8px; }
.poll-bar-bg { background: var(--surface-hover); border-radius: 6px; height: 28px; overflow: hidden; position: relative; }
.poll-bar-fill { height: 100%; transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1); background: linear-gradient(90deg, rgba(var(--accent-rgb), .6), rgba(var(--purple-rgb), .5)); border-radius: 6px; }

/* THEMES */
body.theme-midnight { --bg: #0a1628; --surface: #122136; --surface-hover: #1a2a42; --border: rgba(255,255,255,0.05); }
body.theme-amoled { --bg: #000000; --surface: #000000; --surface-hover: #111111; --border: #222; }
body.theme-cyberpunk { --bg: #0b0c10; --surface: #1f2833; --surface-hover: #2b3a4a; --accent: #66fcf1; --border: rgba(102,252,241,0.2); --text: #c5c6c7; }


.theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.theme-option { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; cursor: pointer; text-align: center; transition: all 0.2s; }
.theme-option:hover { background: var(--surface-hover); }
.theme-option.active { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.1); }
.theme-preview { height: 60px; border-radius: 8px; margin-bottom: 8px; }

/* NOTIFICATIONS & BADGES */
.notif-badge-dot { position: absolute; top: 10px; right: 20px; width: 8px; height: 8px; background: var(--red); border-radius: 50%; box-shadow: 0 0 0 2px var(--bg); }
.post.unread { border-left: 3px solid var(--accent); background: rgba(var(--accent-rgb), 0.03); }

/* TYPING INDICATOR */
.typing-bubble { width: fit-content; padding: 12px 18px; border-radius: 20px; }
.typing-dots { display: flex; gap: 4px; align-items: center; justify-content: center; height: 10px; }
.typing-dots span { width: 6px; height: 6px; background-color: var(--text-secondary); border-radius: 50%; animation: typing 1.4s infinite both; }
.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes typing { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* ============ UPLOAD PROGRESS OVERLAY ============ */
.upload-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.upload-progress-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 40px;
    min-width: 320px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.upload-progress-label {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text);
}
.upload-progress-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, .1);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 10px;
}
.upload-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--purple));
    border-radius: 999px;
    transition: width .15s ease;
}
.upload-progress-pct {
    font-size: .85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ============ NEW POSTS BANNER ============ */
.new-posts-banner {
    display: none;
    text-align: center;
    padding: 12px 16px;
    background: rgba(var(--accent-rgb), .1);
    color: var(--accent);
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background .2s;
    position: sticky;
    top: 49px;
    z-index: 9;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.new-posts-banner:hover {
    background: rgba(var(--accent-rgb), .18);
}

/* ============ ADMIN TABS ============ */
.admin-tab {
    flex: 1;
    padding: 14px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    position: relative;
}
.admin-tab:hover { color: var(--text); background: var(--surface); }
.admin-tab.active { color: var(--text); }
.admin-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), var(--purple));
}

/* ============ REPORTS ============ */
.report-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    transition: border-color .2s;
}
.report-card:hover {
    border-color: rgba(var(--accent-rgb), .3);
}
.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.report-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: .75rem;
    font-weight: 700;
}
.report-badge.pending {
    background: rgba(255, 122, 0, .12);
    color: var(--orange);
    border: 1px solid rgba(255, 122, 0, .2);
}
.report-badge.resolved-del {
    background: rgba(0, 196, 113, .12);
    color: var(--green);
    border: 1px solid rgba(0, 196, 113, .2);
}
.report-badge.resolved-dis {
    background: rgba(var(--accent-rgb), .12);
    color: var(--accent);
    border: 1px solid rgba(var(--accent-rgb), .2);
}
.report-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: .85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.report-info a { font-weight: 600; }
.report-post-preview {
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: .9rem;
    color: var(--text);
    margin-bottom: 12px;
}
.report-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* SVG UI Icons */
.ui-icon {
    width: 20px;
    height: 20px;
    vertical-align: text-bottom;
    display: inline-block;
    flex-shrink: 0;
}
.nav-icon .ui-icon, .mob-icon .ui-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
}
.action-btn .ui-icon {
    width: 18px;
    height: 18px;
    vertical-align: text-bottom;
}
.compose-icon .ui-icon {
    width: 22px;
    height: 22px;
}
.page-header .ui-icon {
    width: 24px;
    height: 24px;
    vertical-align: text-bottom;
}
.admin-tab .ui-icon {
    width: 16px;
    height: 16px;
    vertical-align: text-bottom;
}
/* ============ MOBILE PROMO ============ */
/* Slim "get the app" bar: one row, glass, pushes the page down (see showPromo) */
.mobile-promo {
    position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
    padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
    background: rgba(var(--surface-rgb, 22, 24, 28), .82);
    backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
    border-bottom: 1px solid var(--border);
    animation: slideDown .4s cubic-bezier(.16, 1, .3, 1);
}
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }
.promo-content { display: flex; align-items: center; gap: 10px; max-width: 600px; margin: 0 auto; }
.promo-logo { width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto; box-shadow: 0 3px 10px rgba(var(--accent-rgb), .3); }
.promo-text { flex: 1; min-width: 0; line-height: 1.15; color: var(--text); }
.promo-title { display: flex; align-items: center; gap: 6px; font-size: .9rem; }
.promo-tag { font-size: .62rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; background: rgba(61, 220, 132, .15); color: #3ddc84; }
.promo-help { background: none; border: 0; padding: 0; margin-top: 2px; font: inherit; font-size: .74rem; color: var(--text-secondary); cursor: pointer; }
.promo-help:hover { color: var(--accent); text-decoration: underline; }
.btn-promo {
    background: linear-gradient(135deg, var(--accent), var(--purple)); color: #fff !important;
    padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: .8rem; line-height: 1.2;
    text-decoration: none !important; white-space: nowrap; transition: transform .15s, filter .15s;
}
.btn-promo:hover { filter: brightness(1.1); }
.btn-promo:active { transform: scale(.95); }
.promo-close { background: none; border: none; color: var(--text-secondary); font-size: 1rem; cursor: pointer; padding: 6px; margin-right: -4px; line-height: 1; }
@media (min-width: 768px) { .mobile-promo { display: none !important; } }

/* ============ INSTALL GUIDE ============ */
.install-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 10px;
}

.install-steps > div {
    background: rgba(255, 255, 255, 0.03);
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 0.95rem;
    line-height: 1.4;
}

/* ============ ACCESSIBILITY ============ */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn:focus-visible,
.btn-sm:focus-visible,
.btn-post:focus-visible,
.action-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .15);
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============ TEXT STORY MODAL ============ */
.story-text-modal-body {
    padding: 20px;
}

.story-text-modal-body textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 14px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    resize: none;
    min-height: 80px;
    transition: border-color .2s;
}

.story-text-modal-body textarea:focus {
    border-color: var(--accent);
}

.story-text-charcount {
    text-align: right;
    font-size: .8rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* ============ LIKE COLOR VAR ============ */
.action-btn.liked svg {
    fill: var(--red);
    stroke: var(--red);
}

/* ============ ACTION TOASTS ============ */
.action-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    pointer-events: none;
}

.action-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 14px;
    background: rgba(var(--surface-rgb), .85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .3);
    color: var(--text);
    font-size: .9rem;
    font-weight: 500;
    transform: translateX(120%);
    opacity: 0;
    transition: transform .4s cubic-bezier(.16, 1, .3, 1), opacity .4s ease;
    max-width: 360px;
}

.action-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.action-toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.action-toast.toast-success {
    border-left: 3px solid var(--green);
}
.action-toast.toast-success .action-toast-icon { color: var(--green); }

.action-toast.toast-error {
    border-left: 3px solid var(--red);
}
.action-toast.toast-error .action-toast-icon { color: var(--red); }

.action-toast.toast-info {
    border-left: 3px solid var(--accent);
}
.action-toast.toast-info .action-toast-icon { color: var(--accent); }

@media (max-width: 768px) {
    .action-toast-container {
        bottom: 80px;
        right: 12px;
        left: 12px;
    }
    .action-toast {
        max-width: 100%;
    }
}

/* ============ LIKE EXPLOSION ============ */
@keyframes like-pop {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.35); }
    60%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.action-btn.like-animating svg {
    animation: like-pop .45s cubic-bezier(.17, .67, .21, 1.2);
}

.like-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--red);
    pointer-events: none;
    animation: particle-fly .6s ease-out forwards;
}

@keyframes particle-fly {
    0%   { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--px), var(--py)) scale(0); }
}

/* ============ POST ENTERING ============ */
@keyframes post-slide-in {
    0%   { opacity: 0; transform: translateY(-20px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.post-entering {
    animation: post-slide-in .5s cubic-bezier(.16, 1, .3, 1) forwards !important;
}

/* ============ POST DELETING ============ */
@keyframes post-fade-out {
    0%   { opacity: 1; transform: scaleY(1); max-height: 600px; }
    50%  { opacity: 0; transform: scaleY(0.95); }
    100% { opacity: 0; transform: scaleY(0.9); max-height: 0; padding: 0; overflow: hidden; }
}

.post-deleting {
    animation: post-fade-out .45s cubic-bezier(.4, 0, .2, 1) forwards !important;
    pointer-events: none;
}

/* ============ SKELETON LOADING ============ */
.skeleton {
    background: linear-gradient(90deg,
        rgba(var(--surface-rgb), .4) 25%,
        rgba(var(--surface-rgb), .7) 50%,
        rgba(var(--surface-rgb), .4) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

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

.skeleton-post {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: transparent;
    border-bottom: 1px solid var(--border);
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-line {
    height: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
}

.skeleton-line:nth-child(1) { width: 35%; }
.skeleton-line:nth-child(2) { width: 80%; }
.skeleton-line:nth-child(3) { width: 60%; }

/* ============ DM IMAGES ============ */
.dm-msg-image {
    max-width: 240px;
    max-height: 200px;
    border-radius: 12px;
    cursor: pointer;
    display: block;
    margin-bottom: 6px;
    transition: transform .2s;
}
.dm-msg-image:hover {
    transform: scale(1.03);
}

.dm-image-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(var(--surface-rgb), .5);
    border-top: 1px solid var(--border);
}
.dm-image-preview img {
    max-height: 80px;
    border-radius: 8px;
}

/* ============ DM EDIT BANNER ============ */
.dm-edit-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(var(--accent-rgb, 29, 161, 242), .15);
    border-top: 1px solid var(--accent);
    font-size: .85rem;
    color: var(--accent);
}
.dm-edit-banner button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 8px;
}
.dm-edit-banner button:hover {
    color: var(--text);
}

/* ============ DM EDITED / DELETED ============ */
.dm-e2e-badge {
    display: inline;
    font-size: .7rem;
    margin-left: 4px;
    opacity: .6;
    vertical-align: middle;
}

.dm-edited-badge {
    display: inline;
    font-size: .7rem;
    color: var(--text-secondary);
    margin-left: 6px;
    font-style: italic;
}

.dm-deleted-text {
    color: var(--text-secondary);
    font-style: italic;
    font-size: .85rem;
}

.chat-bubble.deleted {
    opacity: .6;
    background: rgba(var(--surface-rgb), .2) !important;
}

/* ============ MESSAGE OPTIONS BUTTON ============ */
.msg-options-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 6px;
    border-radius: 6px;
    opacity: 0;
    transition: opacity .2s, background .2s;
    line-height: 1;
}
.chat-bubble:hover .msg-options-btn {
    opacity: 1;
}
.msg-options-btn:hover {
    background: rgba(255,255,255,.1);
    color: var(--text);
}

.chat-bubble {
    position: relative;
}

/* ============ MESSAGE OPTIONS MENU ============ */
.msg-options-menu {
    position: fixed;
    bottom: 100px;
    right: 24px;
    z-index: 9999;
    background: rgba(var(--surface-rgb), .92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    padding: 6px;
    box-shadow: 0 12px 40px rgba(0,0,0,.4);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 200px;
    transform: translateY(10px) scale(.95);
    opacity: 0;
    transition: transform .25s cubic-bezier(.16,1,.3,1), opacity .25s ease;
}
.msg-options-menu.show {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.msg-options-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    color: var(--text);
    font-size: .88rem;
    cursor: pointer;
    border-radius: 10px;
    transition: background .15s;
    text-align: left;
}
.msg-options-menu button:hover {
    background: rgba(255,255,255,.06);
}
.msg-options-menu button.danger {
    color: var(--red);
}
.msg-options-menu button.danger:hover {
    background: rgba(var(--red-rgb, 249, 24, 128), .1);
}

@media (max-width: 768px) {
    .msg-options-menu {
        bottom: 80px;
        right: 12px;
        left: 12px;
        min-width: unset;
    }
}

/* ============ NOTIFICATION COUNT BADGE ============ */
.notif-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--accent);
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
    border-radius: 9999px;
    vertical-align: middle;
    margin-left: 4px;
    animation: badgePop .3s cubic-bezier(.16, 1, .3, 1);
}

@keyframes badgePop {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ============ CERTIFICATION BADGE ============ */
.badge-cert {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: .7rem;
    font-weight: 700;
    color: var(--accent);
    vertical-align: middle;
    margin-left: 2px;
}

/* ============ STORIES BAR ============ */
.stories-bar {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 12px 20px;
    background: transparent;
    border-bottom: 1px solid var(--border);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.stories-bar::-webkit-scrollbar {
    display: none;
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 64px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.story-item img {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
    background: linear-gradient(var(--bg), var(--bg)) padding-box,
                linear-gradient(135deg, var(--accent), var(--purple)) border-box;
    padding: 2px;
    transition: transform .2s, filter .2s;
    box-shadow: 0 0 16px rgba(var(--accent-rgb), .2);
}

.story-item:hover img {
    transform: scale(1.08);
    filter: brightness(1.1);
}

.story-item span {
    font-size: .72rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
    font-weight: 500;
}

.story-delete-btn {
    position: absolute;
    top: -4px;
    right: -4px;
    background: rgba(244, 33, 46, .9);
    backdrop-filter: blur(4px);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: .65rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: transform .15s, background .15s;
}

.story-delete-btn:hover {
    background: var(--red);
    transform: scale(1.15);
}

/* ============ NOTIFICATION ITEMS ============ */
.notif-list {
    display: flex;
    flex-direction: column;
}

.notif-item {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    cursor: pointer;
    transition: background .15s;
    border-bottom: 1px solid var(--border);
    animation: fadeUp .2s ease;
    position: relative;
}

.notif-item:hover {
    background: rgba(var(--surface-rgb), .4);
}

.notif-item.unread {
    background: rgba(var(--accent-rgb), .04);
    border-left: 3px solid rgba(var(--accent-rgb), .4);
}

.notif-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--accent), var(--purple));
    border-radius: 0 2px 2px 0;
}

.notif-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.notif-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.notif-icon-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .65rem;
}

.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-weight: 700;
    font-size: .92rem;
    color: var(--text);
}

.notif-text {
    font-size: .85rem;
    color: var(--text-secondary);
    margin-top: 3px;
    line-height: 1.4;
}

.notif-time {
    font-size: .78rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-top: 2px;
}

/* ============ CHAT HEADER ============ */
.chat-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: rgba(var(--bg-rgb), .85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.chat-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(var(--accent-rgb), .2);
}

.chat-header-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-header-sub {
    font-size: .78rem;
    color: var(--accent);
    font-weight: 500;
}

.chat-header-back {
    color: var(--text);
    font-size: 1.1rem;
    text-decoration: none;
    padding: 8px;
    border-radius: 50%;
    transition: background .15s;
    display: flex;
    align-items: center;
}

.chat-header-back:hover {
    background: var(--surface);
    text-decoration: none;
}

/* ============ CONVO ITEM IMPROVEMENTS ============ */
.convo-item {
    position: relative;
}

.convo-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(var(--accent-rgb), .5);
}

/* ============ SIDEBAR PROFILE ENHANCEMENTS ============ */
.sidebar-profile {
    border: 1px solid transparent;
}

.sidebar-profile:hover {
    border-color: rgba(255, 255, 255, .06);
}

.sidebar-profile .handle {
    font-size: .8rem;
    color: var(--text-secondary);
}

/* ============ REPOST EMBED IMPROVEMENTS ============ */
.repost-embed {
    background: rgba(var(--surface-rgb), 0.3);
    backdrop-filter: blur(8px);
}

/* ============ REPLY COMPOSE IMPROVEMENTS ============ */
.reply-compose {
    margin-left: 20px;
    border-left: 2px solid rgba(var(--accent-rgb), .2);
    padding-left: 16px;
    background: transparent;
    padding-top: 8px;
    animation: fadeUp .3s ease;
}

/* ============ PROFILE BANNER IMPROVEMENTS ============ */
.profile-banner {
    height: 180px;
}

.profile-info {
    padding: 6px 20px 20px;
}

.profile-info h2 {
    font-size: 1.25rem;
    letter-spacing: -.01em;
}

/* ============ STAT CARD HOVER GLOW ============ */
.stat-card:hover {
    border-color: rgba(var(--accent-rgb), .35);
    box-shadow: 0 0 24px rgba(var(--accent-rgb), .1), var(--glow);
}

/* ============ MOBILE NAV ACTIVE INDICATOR ============ */
.mobile-nav a.active .mob-icon {
    color: var(--accent);
}

/* ============ PAGE HEADER BACK BUTTON ============ */
.page-header-back {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    text-decoration: none;
    font-size: 1.1rem;
    transition: background .15s;
    flex-shrink: 0;
}

.page-header-back:hover {
    background: rgba(255, 255, 255, .08);
    text-decoration: none;
}

/* ============ ADMIN SECTION IMPROVEMENTS ============ */
.admin-section {
    background: rgba(var(--surface-rgb), 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, .06);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .15);
}

/* ============ REPORT CARD IMPROVEMENTS ============ */
.report-card {
    background: rgba(var(--surface-rgb), 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, .06);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

/* ============ MODAL IMPROVEMENTS ============ */
.modal-box {
    box-shadow: 0 24px 64px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .04);
    background: rgba(var(--surface-rgb), 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

/* ============ E2E BADGE IMPROVEMENTS ============ */
.e2e-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--green);
    font-size: .78rem;
    font-weight: 700;
    background: rgba(0, 196, 113, .1);
    border: 1px solid rgba(0, 196, 113, .2);
    padding: 5px 12px;
    border-radius: 9999px;
}

.dm-e2e-badge {
    display: inline-flex;
    align-items: center;
    font-size: .68rem;
    margin-left: 5px;
    opacity: .75;
    vertical-align: middle;
    color: rgba(255, 255, 255, .7);
}

/* ============ GROUPS PAGE ============ */
.group-header {
    position: relative;
    overflow: hidden;
}

/* ============ THEME OPTIONS IMPROVEMENTS ============ */
.theme-option {
    background: rgba(var(--surface-rgb), 0.4);
    backdrop-filter: blur(8px);
    transition: all .2s cubic-bezier(.16, 1, .3, 1);
}

.theme-option:hover {
    background: rgba(var(--surface-rgb), .8);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}

.theme-option.active {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), .1);
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .2);
}

/* ============ INSTALL STEPS IMPROVEMENTS ============ */
.install-steps > div {
    background: rgba(var(--surface-rgb), 0.3);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, .06);
    transition: border-color .2s;
}

.install-steps > div:hover {
    border-color: rgba(var(--accent-rgb), .2);
}

/* ============ RESPONSIVE ADDITIONS ============ */
@media (max-width: 768px) {
    .profile-banner {
        height: 140px;
    }

    .story-item {
        min-width: 56px;
    }

    .story-item img {
        width: 48px;
        height: 48px;
    }

    .notif-item {
        padding: 14px 16px;
    }

    .convo-item img {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .stories-bar {
        padding: 12px 16px;
        border-radius: 16px;
    }

    .stat-card {
        padding: 12px;
    }

    .notif-item {
        gap: 10px;
    }
}

/* ============ SCROLLBAR REFINEMENT ============ */
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(var(--accent-rgb), .4), rgba(var(--purple-rgb), .4));
}

/* ============ INPUT CHECKBOX ============ */
input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ============ SELECT ============ */
select {
    background: rgba(var(--surface-rgb), 0.6);
    border: 1px solid rgba(255, 255, 255, .1);
    color: var(--text);
    border-radius: 10px;
    font-family: inherit;
    font-size: .9rem;
    cursor: pointer;
    outline: none;
    transition: border-color .2s;
}

select:focus {
    border-color: rgba(var(--accent-rgb), .5);
}

/* ============ CONVO LIST ============ */
.convo-list {
    display: flex;
    flex-direction: column;
}

/* ============ NAV TEXT ============ */
.nav-text {
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.2;
}

/* ============ LINK PREVIEW ============ */
.link-preview {
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    display: block;
    transition: border-color .2s, box-shadow .2s;
    background: rgba(var(--surface-rgb), 0.3);
}

.link-preview:hover {
    border-color: rgba(var(--accent-rgb), .3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
    text-decoration: none;
}

.link-preview-image {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    display: block;
}

.link-preview-body {
    padding: 12px 16px;
}

.link-preview-domain {
    font-size: .75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
    margin-bottom: 4px;
}

.link-preview-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
}

/* ============ LOADING DOTS ============ */
.loading-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: typing 1.4s infinite both;
}

.loading-dots span:nth-child(2) { animation-delay: .16s; }
.loading-dots span:nth-child(3) { animation-delay: .32s; }

/* ============ FLOATING ACTION BUTTON ============ */
.fab {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    color: #fff;
    font-size: 1.3rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(var(--accent-rgb), .4);
    align-items: center;
    justify-content: center;
    transition: transform .2s, box-shadow .2s;
    z-index: 90;
}

.fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(var(--accent-rgb), .5);
}

/* ============ PILL TABS ============ */
.pill-tabs {
    display: flex;
    gap: 8px;
    padding: 16px 0 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

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

.pill-tab {
    padding: 7px 18px;
    border-radius: 9999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
    font-family: inherit;
}

.pill-tab:hover {
    background: rgba(var(--surface-rgb), .5);
    color: var(--text);
}

.pill-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), .3);
}

/* ============ FINAL POLISH ============ */
.post-meta a.post-name:hover {
    color: var(--accent);
}

.profile-tab:hover {
    background: rgba(var(--surface-rgb), .3);
}

/* ============ FEED TABS ============ */
.feed-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.feed-tab {
    flex: 1;
    padding: 16px 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: color .2s, border-color .2s;
}

.feed-tab:hover { color: var(--text); background: rgba(var(--surface-rgb), .3); }

.feed-tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

/* ============ CHAR RING ============ */
.char-counter { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.char-counter[hidden] { display: none; }
.char-counter svg { width: 24px; height: 24px; }
.char-ring-bg { stroke: var(--border); }
.char-ring-fill { stroke: var(--accent); transition: stroke-dashoffset .3s ease, stroke .3s ease; }
.char-counter.is-warn { color: #d9a800; } .char-counter.is-warn .char-ring-fill { stroke: #ffd400; }
.char-counter.is-danger { color: var(--red); } .char-counter.is-danger .char-ring-fill { stroke: #f4212e; }
.compose-bar .char-counter { margin-left: auto; margin-right: 10px; }
textarea + .char-counter { display: flex; justify-content: flex-end; margin-top: 6px; }
.thread-part textarea + .char-counter { margin-top: 0; align-self: center; }

/* ============ PUBLISH BUTTON DISABLED ============ */
.btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ============ MENTION AUTOCOMPLETE ============ */
.mention-autocomplete {
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    z-index: 200;
    min-width: 220px;
    overflow: hidden;
    margin-top: 4px;
}

.mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background .15s;
}

.mention-item:hover { background: var(--surface-hover); }

.mention-item img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.mention-name { font-weight: 600; font-size: .9rem; }
.mention-role { font-size: .75rem; color: var(--text-secondary); }

/* ============ SKELETON LOADING ============ */
.skeleton {
    background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite;
    border-radius: 8px;
}

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

.skeleton-bubble {
    height: 48px;
    width: min(240px, 60%);
    border-radius: 18px;
}

/* ============ PROFILE HOVER CARD ============ */
.profile-hover-card {
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,.22);
    padding: 16px;
    width: 280px;
    z-index: 500;
    pointer-events: all;
}

.phc-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 10px;
}

.phc-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg);
}

.phc-follow { font-size: .82rem; padding: 6px 14px; }

.phc-name { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.phc-bio { font-size: .85rem; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.4; }

.phc-stats {
    display: flex;
    gap: 14px;
    font-size: .82rem;
    color: var(--text-secondary);
}

.phc-stats strong { color: var(--text); }
.phc-loading { color: var(--text-secondary); font-size: .9rem; text-align: center; padding: 8px 0; }

/* ============ GROUP CARDS ============ */
#groupsContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding: 16px;
}

.group-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}

.group-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

.group-card-banner {
    height: 70px;
    display: flex;
    align-items: flex-end;
    padding: 0 16px 0;
    position: relative;
}

.group-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 3px solid var(--bg);
    object-fit: cover;
    position: absolute;
    bottom: -20px;
    left: 16px;
}

.group-card-body {
    padding: 28px 16px 16px;
}

.group-card-name { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.group-card-desc { font-size: .82rem; color: var(--text-secondary); margin-bottom: 8px; line-height: 1.4; }
.group-card-meta { font-size: .8rem; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; }

/* ============ PIN MODAL ============ */
.pin-overlay {
    z-index: 1100;
}
.pin-overlay.open {
    background: rgba(0,0,0,.88) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
}
.pin-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 36px 32px;
    width: 340px;
    max-width: 95vw;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.06);
    animation: pinBoxIn .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes pinBoxIn {
    from { transform: scale(.85) translateY(20px); opacity: 0; }
    to { transform: none; opacity: 1; }
}
.pin-lock-icon {
    font-size: 2.8rem;
    margin-bottom: 16px;
    display: block;
    animation: pinBounce .6s ease;
}
@keyframes pinBounce {
    0%,100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
}
.pin-box h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}
.pin-subtitle {
    font-size: .85rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}
.pin-label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-align: left;
}
.pin-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 4px;
}
.pin-digit {
    width: 56px;
    height: 64px;
    border-radius: 14px;
    border: 2px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    -webkit-text-security: disc;
}
.pin-digit:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .2);
}
.pin-digit:not(:placeholder-shown) {
    border-color: rgba(var(--accent-rgb), .4);
}
.pin-error {
    color: var(--red);
    font-size: .83rem;
    margin: 12px 0 4px;
    padding: 8px 12px;
    background: rgba(244,33,46,.08);
    border-radius: 8px;
    border: 1px solid rgba(244,33,46,.15);
    animation: pinShake .3s ease;
}
@keyframes pinShake {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}
.pin-submit-btn {
    width: 100%;
    margin-top: 20px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 9999px;
}
.pin-reset-hint {
    margin-top: 16px;
    font-size: .8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}
.pin-reset-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: .8rem;
    text-decoration: underline;
    padding: 0;
    font-family: inherit;
}

/* ============ DM NOTIFICATION BADGE ============ */
.dm-badge {
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: var(--red);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg);
}
.notif-item[data-type="dm"] {
    border-left: 3px solid var(--accent);
    background: rgba(var(--accent-rgb), .04);
}
.notif-item[data-type="dm"] .notif-icon-badge {
    background: var(--accent);
    color: #fff;
}


/* ============ LIGHT / AUTO THEMES ============ */
body.theme-light {
    --bg: #ffffff; --bg-rgb: 255, 255, 255;
    --surface: #f7f9f9; --surface-rgb: 247, 249, 249;
    --surface-hover: #eff3f4;
    --border: rgba(15, 20, 25, .12);
    --text: #0f1419; --text-secondary: #536471;
    --accent: #1a8cd8; --accent-rgb: 26, 140, 216;
    color-scheme: light;
}
@media (prefers-color-scheme: light) {
    body.theme-auto {
        --bg: #ffffff; --bg-rgb: 255, 255, 255;
        --surface: #f7f9f9; --surface-rgb: 247, 249, 249;
        --surface-hover: #eff3f4;
        --border: rgba(15, 20, 25, .12);
        --text: #0f1419; --text-secondary: #536471;
        --accent: #1a8cd8; --accent-rgb: 26, 140, 216;
        color-scheme: light;
    }
}
body.theme-light .mobile-nav, body.theme-light .sidebar { background: var(--bg); }

/* ============ ACCESSIBILITY ============ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-href] { cursor: pointer; }
button.theme-option { background: none; color: var(--text); font: inherit; width: 100%; }

/* ============ SIDEBAR PROFILE MENU / MOBILE "MORE" ============ */
.sidebar-profile-wrap { margin-top: auto; position: relative; margin-bottom: 12px; }
button.sidebar-profile { width: 100%; background: none; font: inherit; cursor: pointer; text-align: left; margin-top: 0; }
.sidebar-profile-more { margin-left: auto; color: var(--text-secondary); font-size: 1.2rem; }
.profile-menu, .mob-more-menu {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .35); padding: 6px; z-index: 1000; min-width: 200px;
}
.profile-menu { position: absolute; bottom: calc(100% + 8px); left: 0; right: 0; }

.profile-menu[hidden], .mob-more-menu[hidden] { display: none; }
.profile-menu a, .profile-menu button, .mob-more-menu a, .mob-more-menu button {
    display: block; width: 100%; padding: 12px 14px; border-radius: 10px; color: var(--text);
    text-decoration: none; background: none; border: none; font: inherit; text-align: left; cursor: pointer;
}
.profile-menu a:hover, .profile-menu button:hover, .mob-more-menu a:hover, .mob-more-menu button:hover { background: var(--surface-hover); }
.profile-menu .danger, .mob-more-menu .danger { color: var(--red); }


/* ============ SETTINGS PAGE ============ */
.settings { padding: 8px 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.settings-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.settings-section h3 { font-size: 1rem; margin: 0 0 4px; }
.settings-section .theme-grid { width: 100%; grid-template-columns: repeat(3, 1fr); }
.settings-desc { color: var(--text-secondary); font-size: .85rem; margin: 0; }
.settings-input { width: 100%; padding: 10px 14px; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 10px; font: inherit; }
.settings-danger { border-color: rgba(244, 33, 46, .35); }
@media (max-width: 500px) { .settings-section .theme-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============ DIALOGS ============ */
.dialog-box { max-width: 420px; }
.dialog-msg { margin: 0 0 16px; line-height: 1.5; white-space: pre-line; }
.dialog-input { width: 100%; padding: 10px 14px; margin-bottom: 16px; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 10px; font: inherit; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ============ LINKS IN POSTS ============ */
.post-link { color: var(--accent); text-decoration: none; word-break: break-all; }
.post-link:hover { text-decoration: underline; }
.post-image { cursor: zoom-in; }

/* ============ LIGHTBOX ============ */
.lightbox-overlay { background: rgba(0, 0, 0, .92); z-index: 3000; }
.lightbox-img { max-width: 95vw; max-height: 92vh; border-radius: 8px; cursor: zoom-out; }
.lightbox-close, .story-close { position: absolute; top: 16px; right: 16px; background: rgba(255, 255, 255, .12); color: #fff; border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 1.1rem; cursor: pointer; }

/* ============ STORIES ============ */
.story-open { background: none; border: none; color: inherit; font: inherit; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; padding: 0; }
.story-item.seen img { background: linear-gradient(var(--bg), var(--bg)) padding-box, linear-gradient(var(--border), var(--border)) border-box; box-shadow: none; opacity: .75; }
.story-overlay { background: #000; z-index: 3000; }
.story-viewer { position: relative; width: min(420px, 100vw); height: min(90vh, 750px); display: flex; align-items: center; justify-content: center; }
.story-img { max-width: 100%; max-height: 100%; border-radius: 12px; }
.story-progress { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 4px; z-index: 2; }
.story-bar { flex: 1; height: 3px; background: rgba(255, 255, 255, .3); border-radius: 2px; overflow: hidden; }
.story-bar-fill { height: 100%; width: 0; background: #fff; }
.story-bar-fill.done { width: 100%; }
.story-bar-fill.running { animation: storyFill linear forwards; }
@keyframes storyFill { from { width: 0; } to { width: 100%; } }
.story-head { position: absolute; top: 20px; left: 12px; right: 12px; display: flex; align-items: center; gap: 8px; color: #fff; z-index: 2; }
.story-head img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.story-head .story-close { position: static; margin-left: auto; }
.story-nav { position: absolute; top: 60px; bottom: 0; width: 40%; background: none; border: none; cursor: pointer; z-index: 1; }
.story-prev { left: 0; }
.story-next { right: 0; }
@media (prefers-reduced-motion: reduce) { .story-bar-fill.running { animation: none; width: 100%; } }

/* ============ MOD LOG / MISC ============ */
.mod-log { width: 100%; border-collapse: collapse; font-size: .85rem; }
.mod-log td { padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.mod-log-details { color: var(--text-secondary); word-break: break-word; }
.chat-header-sub.e2e-off { color: var(--orange); }
.convo-unread { margin-left: 6px; font-size: .7rem; }
.tabs [hidden], form[hidden] { display: none; }

/* ============ MOBILE: BOTTOM BAR (5 items) + MENU SHEET ============ */
.mobile-nav-inner { justify-content: space-around; }
.mobile-nav-inner > a, .mob-more-btn { flex: 1; display: flex; justify-content: center; align-items: center; min-height: 44px; padding: 6px 0 !important; }
.mob-more-btn { background: none; border: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mob-more-btn img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 2px solid transparent; }
.mob-more-btn[aria-expanded="true"] img { border-color: var(--accent); }

.mob-more-menu {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    border-radius: 20px 20px 0 0; min-width: 0; max-height: 80vh; overflow-y: auto;
    padding: 8px 12px calc(16px + env(safe-area-inset-bottom)); z-index: 1200;
    animation: sheetUp .22s ease-out;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .mob-more-menu { animation: none; } }
body.mob-sheet-open::after { content: ''; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 1150; }
body.mob-sheet-open { overflow: hidden; }
.mob-sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 4px auto 12px; }
.mob-more-menu a.mob-sheet-profile { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 8px; background: var(--bg); border-radius: 14px; }
.mob-sheet-profile img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.mob-sheet-profile span { display: flex; flex-direction: column; }
.mob-sheet-profile small { color: var(--text-secondary); }
.mob-sheet-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 8px; }
.mob-more-menu .mob-sheet-grid a { display: flex; align-items: center; gap: 10px; padding: 14px 12px; background: var(--bg); border-radius: 14px; font-size: .95rem; }
.mob-more-menu .mob-sheet-grid a.active { color: var(--accent); }
.mob-sheet-icon { display: inline-flex; width: 22px; height: 22px; flex-shrink: 0; }
.mob-sheet-icon .ui-icon { width: 22px; height: 22px; }
.mob-more-menu .mob-sheet-logout { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border-radius: 14px; background: var(--bg); }
@media (min-width: 769px) { .mob-more-menu { display: none !important; } body.mob-sheet-open::after { display: none; } }

/* Dialogs must appear above the PIN overlay (z-index 1100) and the menu sheet */
#dialogOverlay { z-index: 2500; }

/* Small phones */
@media (max-width: 380px) {
    .page-header h2 { font-size: 1.05rem; }
    .settings { padding: 8px 10px 40px; }
    .settings-section { padding: 14px; }
    .compose { padding: 10px; }
}

/* 6-digit PIN must fit a 320px screen */
.pin-row { gap: clamp(4px, 1.6vw, 10px); }
.pin-digit { width: clamp(34px, 11vw, 48px); height: clamp(42px, 13vw, 56px); padding: 0; }
.pin-box { width: min(420px, calc(100vw - 24px)); max-width: none; padding: 28px 16px; box-sizing: border-box; }

/* ============ POLLS ============ */
.poll-editor { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.poll-editor[hidden] { display: none; }
.poll-opt { width: 100%; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 10px; font: inherit; }
.poll-editor-actions { display: flex; gap: 8px; justify-content: space-between; }
.poll-editor-actions [hidden] { display: none; }
.poll { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 4px; }
.poll-choice { padding: 10px 14px; border: 1px solid var(--accent); color: var(--accent); background: none; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; text-align: center; }
.poll-choice:hover { background: rgba(var(--accent-rgb), .1); }
.poll-result { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 8px; overflow: hidden; }
.poll-bar { position: absolute; inset: 0 auto 0 0; background: rgba(var(--accent-rgb), .18); border-radius: 8px; transition: width .4s ease; }
.poll-result.mine .poll-bar { background: rgba(var(--accent-rgb), .35); }
.poll-label, .poll-pct { position: relative; }
.poll-pct { font-weight: 700; }
.poll-meta { color: var(--text-secondary); font-size: .8rem; }

/* ============ SEARCH / PASSWORD TOGGLE ============ */
.search-section { padding: 12px 16px 4px; font-size: 1rem; }
a.user-card { text-decoration: none; color: inherit; }
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap input { width: 100%; padding-right: 48px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 1.1rem; cursor: pointer; padding: 6px; line-height: 1; }
.settings-section .pw-wrap .pw-toggle { top: calc(50% - 4px); }

/* ============ LOGO (sidebar, top-left) ============ */
a.logo { text-decoration: none; border-radius: 14px; transition: background .2s; width: fit-content; }
a.logo:hover { background: rgba(var(--accent-rgb), .08); }
.logo-mark {
    width: 38px; height: 38px; flex-shrink: 0;
    filter: drop-shadow(0 4px 14px rgba(var(--accent-rgb), .35));
    transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
a.logo:hover .logo-mark { transform: rotate(-6deg) scale(1.06); }
/* The three waves pulse one after another, like an echo */
.logo-wave { animation: logoEcho 2.4s ease-in-out infinite; }
.logo-wave-2 { animation-delay: .25s; }
.logo-wave-3 { animation-delay: .5s; }
@keyframes logoEcho { 0%, 100% { opacity: .35; } 30% { opacity: 1; } }
.logo .logo-text { letter-spacing: -.03em; line-height: 1; }
@media (prefers-reduced-motion: reduce) {
    .logo-wave { animation: none; opacity: .85; }
    .logo .logo-text { animation: none; }
}

/* ============ UPDATE BANNER ============ */
.update-banner {
    position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 3000;
    background: linear-gradient(135deg, var(--accent), var(--purple)); color: #fff; border: none;
    padding: 10px 18px; border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .35); max-width: calc(100vw - 24px);
}

/* ============ BANNERS ============ */
.profile-banner.has-image, .banner-edit-preview.has-image { background-size: cover; background-position: center; }
.profile-banner.has-image::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 55%, rgba(0, 0, 0, .35)); pointer-events: none; }
.group-banner { height: 120px; }
.banner-edit-preview {
    width: 100%; aspect-ratio: 3 / 1; border-radius: 12px; margin-bottom: 8px;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), .3), rgba(var(--purple-rgb), .3));
}
.banner-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.banner-controls label.btn-sm { cursor: pointer; }
.banner-controls [hidden] { display: none; }
.group-banner + .banner-controls { justify-content: flex-end; padding: 8px 16px 0; }
@media (max-width: 500px) { .profile-banner { height: 120px; } .group-banner { height: 90px; } }

/* ============ PROFILE TABS / EDITED POSTS ============ */
a.profile-tab { text-decoration: none; display: block; }
.profile-tabs { overflow-x: auto; scrollbar-width: none; }
.profile-tab { white-space: nowrap; }
.post-edited { font-style: italic; }
.action-btn.action-edit:hover { color: var(--accent); }
#dialogTextarea { resize: vertical; min-height: 100px; line-height: 1.45; }

/* ============ ANDROID APP UPDATE BAR ============ */
.app-update-bar {
    position: fixed; left: 12px; right: 12px; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 1300;
    display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px;
    background: var(--surface); border: 1px solid rgba(var(--accent-rgb), .5); box-shadow: 0 8px 30px rgba(0, 0, 0, .45);
}
.app-update-bar span { flex: 1; font-size: .9rem; }
.app-update-bar .btn { text-decoration: none; white-space: nowrap; }
.app-update-close { background: none; border: none; color: var(--text-secondary); font-size: 1rem; cursor: pointer; padding: 4px; }
@media (min-width: 769px) { .app-update-bar { left: auto; right: 24px; bottom: 24px; max-width: 420px; } }
.action-btn.action-share:hover { color: var(--green); }

/* ============ PERMANENT "UPDATE THE APP" BUTTON (Android app, only when outdated) ============ */
.app-update-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
    padding: 14px; border: none; border-radius: 14px; cursor: pointer; font: inherit; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    box-shadow: 0 4px 18px rgba(var(--accent-rgb), .35);
    animation: updatePulse 2.4s ease-in-out infinite;
}
.app-update-btn.in-sheet { margin-bottom: 10px; }
@keyframes updatePulse { 0%, 100% { box-shadow: 0 4px 18px rgba(var(--accent-rgb), .3); } 50% { box-shadow: 0 4px 26px rgba(var(--accent-rgb), .65); } }
.settings-update { border-color: rgba(var(--accent-rgb), .6); }
/* Dot on the menu (avatar) button while an update is waiting */
.mob-more-btn { position: relative; }
body.app-outdated .mob-more-btn::after {
    content: ''; position: absolute; top: 6px; right: calc(50% - 18px); width: 10px; height: 10px; border-radius: 50%;
    background: var(--accent); border: 2px solid var(--bg);
}
@media (prefers-reduced-motion: reduce) { .app-update-btn { animation: none; } }

/* ============ MULTI-IMAGE POSTS ============ */
.post-images { display: grid; gap: 3px; margin-top: 10px; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 10; }
.post-images.n2 { grid-template-columns: 1fr 1fr; }
.post-images.n3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.post-images.n3 img:first-child { grid-row: span 2; }
.post-images.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.post-images img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0; border-radius: 0; max-height: none; }
/* Composer preview */
.image-preview.multi, .image-preview { gap: 6px; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); position: relative; }
.preview-thumb { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--surface); }
.image-preview:not(.multi) .preview-thumb { aspect-ratio: auto; max-height: 320px; }
.preview-thumb img, .preview-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-preview:not(.multi) .preview-thumb img, .image-preview:not(.multi) .preview-thumb video { object-fit: contain; max-height: 320px; }
.preview-thumb-remove {
    position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: none;
    background: rgba(0, 0, 0, .7); color: #fff; cursor: pointer; font-size: .8rem;
}
.image-preview .image-preview-close { display: none; }

/* ============ PINNED POSTS ============ */
.pinned-label { color: var(--text-secondary); font-size: .8rem; font-weight: 600; margin-bottom: 2px; }
.action-btn.action-pin.pinned { color: var(--accent); }
.action-btn.action-pin:hover { color: var(--accent); }

/* ============ FOLLOW SUGGESTIONS ============ */
.suggest-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.suggest-user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-decoration: none; color: var(--text); }
.suggest-user img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.suggest-user > span { display: flex; flex-direction: column; min-width: 0; }
.suggest-name { display: flex; align-items: center; gap: 4px; min-width: 0; }
.suggest-name .badge { flex-shrink: 0; }
.suggest-user strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-user small { color: var(--text-secondary); font-size: .8rem; }
.home-suggest { padding: 8px 16px; border-bottom: 1px solid var(--border); }
.home-suggest .widget { margin: 0; background: none; border: none; padding: 0; }
@media (min-width: 1051px) { .home-suggest { display: none; } } /* the side widget already shows them */

/* ============ POST ACTIONS: 4 main icons + "⋯" menu ============ */
.post-actions { justify-content: space-between; max-width: 460px; }
.post-more { position: relative; }
/* .post uses content-visibility:auto (paint containment) which clips anything overflowing the card:
   lift it for the post whose menu is open so the menu can spill over the neighbouring posts */
.post.menu-open { position: relative; z-index: 30; content-visibility: visible; contain: none; overflow: visible; }
.post-more-menu {
    position: absolute; right: 0; top: calc(100% + 4px); z-index: 50; min-width: 200px; padding: 6px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
    display: flex; flex-direction: column; gap: 2px;
}
.post-more-menu[hidden] { display: none; }
.post-more-menu.up { top: auto; bottom: calc(100% + 4px); }
.post-more-menu .action-btn {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 10px;
    justify-content: flex-start; font-size: .92rem; color: var(--text);
}
.post-more-menu .action-btn:hover { background: var(--surface-hover); }
/* Label = the button's aria-label (no duplicated markup) */
.post-more-menu .action-btn::after { content: attr(aria-label); font-weight: 500; }
.post-more-menu .action-btn .ui-icon { width: 18px; height: 18px; flex-shrink: 0; }
.post-more-menu .action-delete, .post-more-menu .action-report { color: var(--red); }
@media (max-width: 500px) {
    .post-actions .action-btn { padding: 6px 8px; }
}

/* ============ ADD TO LIST PICKER ============ */
.list-picker { max-width: 420px; }
.list-picker-items { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; margin-bottom: 14px; }
.list-picker-item {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 12px; cursor: pointer;
    background: var(--bg); border: 1px solid var(--border); color: var(--text); font: inherit; text-align: left;
}
.list-picker-item.on { border-color: var(--accent); background: rgba(var(--accent-rgb), .08); }
.list-picker-check {
    width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border); display: inline-flex;
    align-items: center; justify-content: center; font-weight: 800; color: #fff; flex-shrink: 0;
}
.list-picker-item.on .list-picker-check { background: var(--accent); border-color: var(--accent); }
.list-picker-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-picker-new { display: flex; gap: 8px; }
.list-picker-new input { flex: 1; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 10px; font: inherit; }

/* ============ NEWS ============ */
.news-more { display: block; margin-top: 8px; font-size: .85rem; color: var(--accent); text-decoration: none; }
.news-more:hover { text-decoration: underline; }
.news-page { padding: 4px 16px 40px; }
.news-page .news-item { padding: 14px 0; }
.news-page .news-text { font-size: .95rem; line-height: 1.5; }
.news-icon { margin-right: 2px; }

/* ============ GROUPED NOTIFICATIONS ============ */
.notif-avatars { display: flex; }
.notif-avatars img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid var(--bg); }
.notif-avatars img + img { margin-left: -12px; }

/* ============ PROFILE ACTIONS: message + follow + "⋯" (mute / block) ============ */
.profile-actions { flex-wrap: nowrap; align-items: center; }
.profile-actions > .btn, .profile-actions > a.btn { white-space: nowrap; }
.profile-more-btn { padding: 10px 14px; display: inline-flex; align-items: center; justify-content: center; }
.profile-more .post-more-menu { top: calc(100% + 6px); }
.post-more-menu .action-btn.labeled::after { content: none; }
@media (max-width: 500px) {
    .profile-actions { gap: 6px; padding: 10px 12px; }
    .profile-actions .btn { padding: 10px 16px; font-size: .9rem; }
}

/* ============ EXPLORE (empty search) ============ */
.explore-section { padding: 12px 16px 4px; }
.explore-section h3 { font-size: 1.05rem; margin-bottom: 10px; }
.explore-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.explore-tag {
    display: flex; flex-direction: column; padding: 10px 14px; border-radius: 14px; text-decoration: none;
    background: var(--surface); border: 1px solid var(--border); color: var(--text); min-width: 110px;
}
.explore-tag:hover { border-color: var(--accent); }
.explore-tag small { color: var(--text-secondary); font-size: .78rem; }
.explore-suggest .widget { margin: 0; background: none; border: none; padding: 0; }
@media (min-width: 1051px) { .explore-suggest { display: none; } } /* already in the side column */

/* ============ DM READ RECEIPTS + REACTIONS ============ */
.chat-time { display: flex; align-items: center; gap: 4px; }
.msg-wrap.mine .chat-time { justify-content: flex-end; }
.dm-status { font-size: .72rem; color: var(--text-secondary); letter-spacing: -2px; font-weight: 700; }
.dm-status.seen { color: var(--accent); }
.dm-reactions { display: flex; gap: 4px; margin-top: -6px; position: relative; z-index: 1; }
.dm-reactions:empty { display: none; }
.msg-wrap.mine .dm-reactions { justify-content: flex-end; padding-right: 8px; }
.msg-wrap.theirs .dm-reactions { padding-left: 8px; }
.dm-reaction {
    display: inline-flex; align-items: center; gap: 2px; padding: 2px 6px; border-radius: 999px; font-size: .9rem;
    background: var(--surface); border: 1px solid var(--border);
}
.dm-reaction.mine { border-color: var(--accent); background: rgba(var(--accent-rgb), .12); }
.dm-reaction small { font-size: .7rem; color: var(--text-secondary); }
#chatMessages .chat-bubble { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dm-reaction-bar {
    position: fixed; z-index: 2600; display: flex; gap: 2px; padding: 6px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border); box-shadow: 0 8px 26px rgba(0, 0, 0, .45);
    animation: reactPop .15s ease-out;
}
.dm-reaction-bar button { background: none; border: none; font-size: 1.5rem; line-height: 1; padding: 6px; border-radius: 50%; cursor: pointer; transition: transform .1s; }
.dm-reaction-bar button:hover, .dm-reaction-bar button:focus-visible { transform: scale(1.2); }
.dm-reaction-bar button.active { background: rgba(var(--accent-rgb), .2); }
@keyframes reactPop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dm-reaction-bar { animation: none; } }

/* ============ PROFILE EXTRAS / PRIVATE ACCOUNTS ============ */
.profile-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--text-secondary); font-size: .9rem; margin: 8px 0; }
.profile-meta a { color: var(--accent); text-decoration: none; }
.profile-meta a:hover { text-decoration: underline; }
.profile-stats a { color: var(--text-secondary); text-decoration: none; margin-right: 16px; }
.profile-stats a:hover { text-decoration: underline; }
.profile-stats a strong { color: var(--text); }
.private-lock { color: var(--text-secondary); }
.private-empty-icon .ui-icon { width: 40px !important; height: 40px !important; }
.switch-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.switch-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.switch-row span { display: flex; flex-direction: column; }
.switch-row small { color: var(--text-secondary); font-size: .8rem; }
.follow-requests { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.follow-requests h3 { font-size: 1rem; margin-bottom: 8px; }
.follow-request { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.follow-request .suggest-user { flex: 1; }

/* ============ POSTS: CW, THREADS, LINK CARDS, DRAFTS, LIKES ============ */
.like-count { padding: 4px 2px; border-radius: 6px; }
.like-count:hover { text-decoration: underline; }
.cw-box { margin-top: 6px; }
.cw-toggle {
    width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; cursor: pointer; font: inherit; font-size: .9rem;
    background: rgba(255, 170, 0, .1); border: 1px solid rgba(255, 170, 0, .35); color: var(--text);
}
.cw-toggle span { color: var(--accent); font-weight: 600; }
.cw-content { margin-top: 6px; }
.thread-badge { display: inline-block; margin-top: 8px; font-size: .85rem; color: var(--accent); text-decoration: none; font-weight: 600; }
.thread-badge:hover { text-decoration: underline; }
.link-card { display: block; margin-top: 10px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--text); }
.link-card:hover { background: var(--surface-hover); }
.link-card img { display: block; width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; }
.link-card-body { padding: 10px 12px; }
.link-card-site { font-size: .78rem; color: var(--text-secondary); }
.link-card-title { font-weight: 700; margin: 2px 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.link-card-desc { font-size: .85rem; color: var(--text-secondary); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.compose-more { display: inline-flex; }
.compose-more-btn { background: none; border: none; color: var(--accent); font-size: 1.3rem; font-weight: 700; cursor: pointer; padding: 2px 8px; line-height: 1; }
.compose-more .post-more-menu { left: 0; right: auto; }
.cw-editor { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 170, 0, .08); border: 1px solid rgba(255, 170, 0, .3); }
.cw-editor[hidden] { display: none; }
.cw-editor input { flex: 1; background: none; border: none; color: var(--text); font: inherit; outline: none; }
.thread-parts { display: flex; flex-direction: column; gap: 8px; }
.thread-part { position: relative; border-left: 2px solid var(--accent); padding-left: 10px; margin-top: 8px; }
.thread-part textarea { width: 100%; background: none; border: none; color: var(--text); font: inherit; resize: none; outline: none; padding-right: 28px; }
.thread-part-remove { position: absolute; top: 2px; right: 0; background: none; border: none; color: var(--text-secondary); cursor: pointer; }
.list-modal { max-width: 440px; }
.list-modal .modal-body { max-height: 65vh; overflow-y: auto; }
.draft-save { margin-bottom: 10px; }
.draft-item { display: flex; gap: 8px; align-items: stretch; margin-top: 8px; }
.draft-use { flex: 1; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; cursor: pointer; white-space: pre-wrap; }
.draft-use small { display: block; color: var(--text-secondary); margin-top: 4px; font-size: .75rem; }
.draft-del { background: none; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; padding: 0 12px; }

/* ============ DM: REPLIES, VOICE, PRESENCE, GROUPS ============ */
.dm-reply-quote {
    display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; margin-bottom: 6px; padding: 6px 8px;
    border: none; border-left: 3px solid var(--accent); border-radius: 8px; background: rgba(0, 0, 0, .18); color: inherit; font: inherit; cursor: pointer;
}
.dm-reply-quote strong { font-size: .78rem; }
.dm-reply-quote span { font-size: .82rem; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-reply-banner { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border); border-left: 3px solid var(--accent); background: var(--surface); }
.dm-reply-banner[hidden] { display: none; }
.dm-reply-banner div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dm-reply-banner strong { font-size: .8rem; color: var(--accent); }
.dm-reply-banner span { font-size: .85rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-reply-banner button { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 1rem; }
.msg-wrap.flash .chat-bubble { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .6); transition: box-shadow .3s; }
.dm-audio { display: block; width: min(260px, 100%); height: 40px; margin: 2px 0; }
.voice-btn { background: none; border: none; color: var(--accent); cursor: pointer; padding: 4px; display: inline-flex; }
.voice-recorder { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border); background: var(--surface); }
.voice-recorder[hidden] { display: none; }
.voice-recorder #voiceTimer { flex: 1; font-variant-numeric: tabular-nums; }
.voice-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: recBlink 1s infinite; }
@keyframes recBlink { 50% { opacity: .3; } }
.chat-presence { margin-right: 8px; }
.chat-presence.online { color: var(--green); }
.chat-presence:empty { display: none; }
.group-sender { font-size: .75rem; color: var(--text-secondary); margin: 0 0 2px 8px; }
.group-e2e-note { display: block; margin: 8px 12px; text-align: center; }
.ng-list { max-height: 45vh; overflow-y: auto; margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.ng-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; }
.ng-item:hover { background: var(--surface-hover); }
.ng-item input { width: 18px; height: 18px; accent-color: var(--accent); }
.ng-item img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.dm-reaction-bar .dm-reply-btn { border-left: 1px solid var(--border); border-radius: 0 50% 50% 0; }

/* ============ ACCENT COLOUR / HIDE LIKES / STORIES ============ */
.accent-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.accent-swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; box-shadow: 0 0 0 1px var(--border); }
.accent-swatch.auto { background: var(--surface); color: var(--text-secondary); font-weight: 700; }
.accent-swatch.active { border-color: var(--text); }
body.hide-likes .like-count { display: none; }
.story-footer { position: absolute; left: 12px; right: 12px; bottom: 14px; z-index: 3; display: flex; justify-content: center; }
.story-viewers-btn { background: rgba(0, 0, 0, .55); color: #fff; border: none; border-radius: 999px; padding: 8px 16px; font: inherit; cursor: pointer; }
.story-viewers-btn[hidden], .story-reply[hidden] { display: none; }
.story-reply { display: flex; gap: 8px; width: 100%; }
.story-reply input { flex: 1; padding: 12px 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .5); background: rgba(0, 0, 0, .45); color: #fff; font: inherit; outline: none; }
.story-reply input::placeholder { color: rgba(255, 255, 255, .75); }
.story-reply button { width: 44px; border-radius: 50%; border: none; background: var(--accent); color: #fff; font-size: 1.1rem; cursor: pointer; }
.story-nav { bottom: 70px; }

/* ============ MOBILE OVERFLOW FIXES ============ */
/* Flex children must be allowed to shrink, otherwise inputs push the Post button off-screen */
.compose-right, .post-body, .compose-bar, .cw-editor, .thread-part { min-width: 0; }
.compose-right { max-width: 100%; }
.cw-editor input, .poll-opt, .thread-part textarea { min-width: 0; width: 100%; }
.cw-editor .btn-sm { flex-shrink: 0; }
.compose-bar { flex-wrap: nowrap; }
.compose-bar .btn { flex-shrink: 0; }
.compose-tools { min-width: 0; flex-wrap: nowrap; }
.image-preview, .post-images, .link-card, .dm-audio { max-width: 100%; }
/* Compact name + badges line so the time stays on the same line */
.post-meta { gap: 4px; row-gap: 0; }
.post-meta .badge { padding: 0 2px; margin: 0; background: none; border: none; }
.post-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
@media (max-width: 500px) {
    .compose { padding: 12px; gap: 10px; }
    .compose > img { width: 36px !important; height: 36px !important; }
    .compose-bar .btn { padding: 8px 16px; }
    .post-meta .ui-icon, .post-meta .badge .ui-icon { width: 15px !important; height: 15px !important; }
}
/* Safety net: nothing may widen the page sideways on phones (clip keeps position:sticky working) */
html, body { overflow-x: clip; }

/* ============ CHAT INPUT BAR: always fits the screen ============ */
.chat-input-bar { align-items: center; min-width: 0; }
.chat-input-bar input { min-width: 0; }
.chat-input-bar .compose-icon, .chat-input-bar .voice-btn { flex-shrink: 0; }
.chat-send { width: 44px; height: 44px; padding: 0; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.chat-send .ui-icon { width: 20px; height: 20px; }
.chat-header-sub { display: flex; flex-wrap: wrap; gap: 0 8px; font-size: .78rem; line-height: 1.3; }
@media (max-width: 500px) {
    .chat-input-bar { gap: 6px; padding: 8px 10px; }
    .chat-area { height: auto; } /* set by fitChatArea() */
    #chatE2EStatus { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
}

/* ============ VISUAL FIXES (checked on a 390px screen) ============ */
/* Profile photo overlaps the banner instead of being cut in half (stars use background-position, no overflow needed) */
.profile-banner { overflow: visible; }
.profile-banner.has-image::after { border-radius: inherit; }
/* Auto badges (🌱 🐣 …): no pill padding, no big gaps */
.page-header h2 .badge, .profile-info h2 .badge { vertical-align: middle; }
/* Suggestions embedded in the feed / explore: no widget frame */
.home-suggest .widget, .explore-suggest .widget { border: 0 !important; box-shadow: none !important; background: none !important; }
.home-suggest .widget::before, .home-suggest .widget::after, .explore-suggest .widget::before, .explore-suggest .widget::after { display: none !important; }

/* ── Voice message player ───────────────────────── */
.vplayer { display: flex; align-items: center; gap: 10px; width: 240px; max-width: 100%; padding: 4px 2px; }
.vplayer-play { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
    display: grid; place-items: center; background: var(--accent); color: #fff; transition: transform .12s; }
.vplayer-play:active { transform: scale(.92); }
.vplayer-play svg { width: 18px; height: 18px; fill: currentColor; }
.vplayer-play .vp-i-pause, .vplayer.playing .vp-i-play { display: none; }
.vplayer.playing .vp-i-pause { display: block; }
.vplayer-wave { flex: 1; min-width: 0; height: 30px; display: flex; align-items: center; gap: 2px; cursor: pointer; outline: none; }
.vplayer-wave i { flex: 1; min-width: 2px; border-radius: 2px; background: rgba(var(--accent-rgb), .35); transition: background .15s; }
.vplayer-wave i.on { background: var(--accent); }
.vplayer-wave:focus-visible { box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .5); border-radius: 4px; }
.vplayer-time { flex: 0 0 auto; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-secondary); min-width: 30px; }
.vplayer-speed { flex: 0 0 auto; border: 0; cursor: pointer; font-family: inherit; font-size: 11px; font-weight: 600; line-height: 1; padding: 4px 6px; border-radius: 10px;
    background: rgba(var(--accent-rgb), .15); color: var(--accent); }
.vplayer.error { opacity: .6; }
/* On my own (gradient) bubbles: white player */
.chat-bubble.mine .vplayer-play { background: #fff; color: var(--accent); }
.chat-bubble.mine .vplayer-wave i { background: rgba(255,255,255,.4); }
.chat-bubble.mine .vplayer-wave i.on { background: #fff; }
.chat-bubble.mine .vplayer-time { color: rgba(255,255,255,.85); }
.chat-bubble.mine .vplayer-speed { background: rgba(255,255,255,.2); color: #fff; }
.chat-bubble:has(.vplayer) { min-width: min(250px, 100%); }
@media (max-width: 380px) { .vplayer { width: 210px; gap: 8px; } }
/* Private (encrypted) DM photos: placeholder while decrypting */
.dm-msg-image.sealed-media:not(.loaded) { display: block; width: 200px; max-width: 100%; height: 150px; border-radius: 12px;
    background: linear-gradient(90deg, rgba(var(--surface-rgb), .6), rgba(var(--accent-rgb), .12), rgba(var(--surface-rgb), .6));
    background-size: 200% 100%; animation: sealedShimmer 1.2s linear infinite; color: var(--text-secondary); font-size: 12px; }
.dm-msg-image.sealed-media.error { animation: none; height: 60px; display: grid; place-items: center; }
@keyframes sealedShimmer { to { background-position: -200% 0; } }
.vplayer.loading .vplayer-wave i { animation: sealedPulse 1s ease-in-out infinite alternate; }
@keyframes sealedPulse { to { opacity: .35; } }

/* Modals never taller than the screen: header (close / save) stays visible, the body scrolls */
.modal-box { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; }
.modal-box > .modal-header { flex: 0 0 auto; }
.modal-box > .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
/* Links inside my own (gradient) bubble: readable */
.chat-bubble.mine a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
/* "Private account" checkbox next to its text (form-group label/input rules were stacking them) */
.form-group label.switch-row { display: flex; align-items: flex-start; gap: 12px; text-transform: none; }
.form-group .switch-row input[type="checkbox"] { width: 22px; height: 22px; min-width: 22px; padding: 0; margin: 2px 0 0; flex: 0 0 22px; }
.form-group .switch-row strong { color: var(--text); }

/* ── Group rules: invitations, roles, members panel ───────── */
.group-invites { padding: 12px 16px; border-bottom: 1px solid var(--border); background: rgba(var(--accent-rgb), .06); }
.group-invites-title { font-size: .95rem; margin: 0 0 8px; }
.group-invite { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.group-invite img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 40px; }
.group-invite-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.group-invite-text strong, .group-invite-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-invite-text small { color: var(--text-secondary); font-size: .8rem; }
.group-invite .btn-sm { flex: 0 0 auto; }
.gm-section { margin-bottom: 16px; }
.gm-section h3 { font-size: .9rem; color: var(--text-secondary); margin: 0 0 6px; font-weight: 600; }
.gm-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.gm-row:last-child { border-bottom: 0; }
.gm-row img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: 0 0 36px; }
.gm-name { font-weight: 600; color: var(--text); text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-sub { color: var(--text-secondary); font-size: .78rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-role { font-size: .75rem; color: var(--text-secondary); white-space: nowrap; margin-left: auto; }
.gm-role.owner, .gm-role.admin { color: var(--accent); font-weight: 600; }
.gm-row .btn-sm:first-of-type { margin-left: auto; }
.gm-row .gm-role ~ .btn-sm { margin-left: 0; }
.gm-action { flex: 0 0 auto; width: 44px; height: 32px; border-radius: 16px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 16px; text-align: center; cursor: pointer; padding: 0 4px; }
.gm-invite { display: flex; gap: 8px; margin-bottom: 16px; }
.gm-invite .settings-input { flex: 1; min-width: 0; margin: 0; }
.gm-setting { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; font-size: .85rem; color: var(--text-secondary); }
.gm-setting .settings-input { margin: 0; }
.gm-setting select:disabled { opacity: .6; }
.gm-help { margin-top: 12px; font-size: .78rem; line-height: 1.5; }
.chat-readonly { padding: 14px 16px; text-align: center; color: var(--text-secondary); font-size: .88rem; border-top: 1px solid var(--border); }
.role-badge { margin-left: 4px; font-size: .9em; }
.count-pill { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; margin-left: 4px; }
.profile-stats span + span { margin-left: 12px; }

/* ── Android app mode ─────────────────────────────── */
/* in-app: any version of the app. native-tabs: app 3.0+, which draws its own tab bar. */
.in-app { -webkit-tap-highlight-color: transparent; }
.in-app body { overscroll-behavior-y: none; }
.in-app button, .in-app .action-btn, .in-app .nav-item, .in-app .profile-tab { -webkit-user-select: none; user-select: none; }
.in-app .mobile-promo, .in-app #mobilePromo { display: none !important; }
.native-tabs .mobile-nav { display: none !important; }
@media (max-width: 700px) {
    .native-tabs .main { padding-bottom: 16px; }
    .native-tabs .app-update-bar { bottom: calc(12px + env(safe-area-inset-bottom)); }
    .in-app .page-header { min-height: 52px; padding-top: 8px; padding-bottom: 8px; }
    .in-app .page-header h2 { font-size: 1.15rem; }
}
.app-menu-btn { display: none; }
.native-tabs .app-menu-btn { display: grid; place-items: center; margin-left: auto; width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; color: var(--text); cursor: pointer; }
.native-tabs .app-menu-btn:active { background: var(--surface-hover); }
.native-tabs .app-menu-btn .ui-icon { width: 24px; height: 24px; }
/* Page-to-page transition (only pages opened in the app opt in, see the <head> script) */
::view-transition-old(root) { animation: 140ms ease-out both echo-vt-out; }
::view-transition-new(root) { animation: 220ms cubic-bezier(.2, .8, .2, 1) both echo-vt-in; }
@keyframes echo-vt-out { to { opacity: 0; } }
@keyframes echo-vt-in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { ::view-transition-old(root), ::view-transition-new(root) { animation: none; } }

/* ── Android app: tidier, one place for each thing ──────────────────── */
.app-logo { display: none; }
/* Each thing lives in one place in the app:
   - who to follow → Search tab       - your profile → "Me" tab
   - settings → ☰ menu                - encryption status → each conversation's header */
.native-tabs .home-suggest,
.native-tabs .mob-sheet-profile,
.native-tabs .edit-settings-link,
.native-tabs .convo-e2e-note,
.native-tabs .settings-update { display: none !important; } /* app update: the notice bar + the ☰ menu entry */
@media (max-width: 700px) {
    /* Headers: one clean style everywhere (title only, no decorative icons) */
    .in-app .page-header { padding-left: 16px; padding-right: 12px; border-bottom-color: rgba(var(--accent-rgb), .08); }
    .in-app .page-header h2 { font-weight: 800; letter-spacing: -.01em; }
    .in-app .page-header h2 > .ui-icon { display: none; }
    /* Home: the Echo logo instead of the word "Accueil" (the tab bar already says where you are) */
    .native-tabs .home-header { justify-content: center; }
    .native-tabs .home-header h2 { display: none; }
    .native-tabs .home-header .app-logo { display: block; width: 30px; height: 30px; }
    /* Stories: smaller bubbles, the feed starts higher */
    .in-app #storiesContainer { padding: 10px 12px !important; gap: 10px !important; }
    .in-app .story-item { min-width: 58px !important; }
    .in-app .story-item img, .in-app .story-item > div:first-child { width: 54px !important; height: 54px !important; }
    .in-app .story-item span { font-size: .72rem; }
    /* Feed tabs stay under the header while scrolling */
    .native-tabs .feed-tabs { position: sticky; top: 52px; z-index: 9; background: rgba(var(--bg-rgb), .9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
    /* Posts: a bit more air, rounder media */
    .in-app .post { padding: 14px 16px; }
    .in-app .post-images img, .in-app .post-image, .in-app .link-card { border-radius: 16px; }
    .in-app .post-actions { margin-top: 6px; }
    /* Search field with a magnifier */
    .in-app .search-bar input { padding-left: 44px; background-repeat: no-repeat; background-position: 16px center; background-size: 18px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b98a5' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E"); }
    /* Groups: compact cards */
    .in-app .group-card-banner { height: 44px; }
    .in-app .group-card-icon { width: 40px; height: 40px; border-radius: 10px; bottom: -18px; }
    .in-app .group-card-body { padding: 26px 14px 12px; }
    /* ☰ menu: a proper sheet with big, evenly spaced tiles */
    .native-tabs .mob-more-menu { border-radius: 24px 24px 0 0; padding-top: 6px; }
    .native-tabs .mob-sheet-grid { gap: 8px; }
    .native-tabs .mob-more-menu .mob-sheet-grid a { flex-direction: column; justify-content: center; gap: 6px; padding: 14px 8px; min-height: 76px; text-align: center; font-size: .85rem; font-weight: 600; background: rgba(var(--surface-rgb), .9); }
    .native-tabs .mob-sheet-grid { grid-template-columns: repeat(3, 1fr); }
    .native-tabs .mob-more-menu .mob-sheet-grid a .mob-sheet-icon { color: var(--accent); }
    /* Cards and inputs: one radius, comfortable touch targets */
    .in-app .settings-section { border-radius: 18px; }
    .in-app .btn, .in-app .btn-sm { min-height: 36px; }
    .in-app .settings-input { min-height: 44px; }
}

/* ── Android app: "liquid glass" ────────────────────────────────────────
   Translucent surfaces that blur what's behind them, a thin bright edge and a soft top reflection.
   Only in the app (html.in-app); the website keeps its own look. */
.in-app {
    --glass-fill: rgba(var(--surface-rgb), .55);
    --glass-fill-strong: rgba(var(--surface-rgb), .72);
    --glass-edge: rgba(255, 255, 255, .12);
    --glass-shine: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, 0) 60%);
    --glass-blur: blur(26px) saturate(180%);
    --glass-shadow: 0 18px 50px rgba(0, 0, 0, .40), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.in-app .theme-light, .in-app body.theme-light {
    --glass-edge: rgba(0, 0, 0, .08);
    --glass-shine: linear-gradient(180deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0) 60%);
    --glass-shadow: 0 18px 50px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .8);
}
/* Bars that float over the page */
.in-app .page-header, .native-tabs .feed-tabs {
    background: linear-gradient(180deg, rgba(var(--bg-rgb), .78), rgba(var(--bg-rgb), .52));
    backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-edge);
}
/* Floating panels: dialogs, ☰ sheet, ⋯ menus, notices */
.in-app .modal-box, .in-app .mob-more-menu, .in-app .post-more-menu, .in-app .profile-menu,
.in-app .action-toast, .in-app .app-update-bar, .in-app .hover-card {
    background: var(--glass-shine), var(--glass-fill-strong) !important;
    backdrop-filter: var(--glass-blur) !important; -webkit-backdrop-filter: var(--glass-blur) !important;
    border: 1px solid var(--glass-edge) !important;
    box-shadow: var(--glass-shadow) !important;
}
.in-app .modal-overlay.open, .in-app .modal-overlay[style*="flex"] { background: rgba(0, 0, 0, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
/* Cards sitting on the page */
.in-app .settings-section, .in-app .group-card, .in-app .link-card, .in-app .explore-tag,
.in-app .mob-more-menu .mob-sheet-grid a, .in-app .mob-more-menu .mob-sheet-logout, .in-app .group-invites {
    background: var(--glass-shine), var(--glass-fill) !important;
    border: 1px solid var(--glass-edge) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
/* Buttons: glossy pills that sink a little under the finger */
.in-app .btn { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 18px rgba(var(--accent-rgb), .30); }
.in-app .btn-outline, .in-app .btn-sm:not(.btn), .in-app .chat-input-bar input, .in-app #dmInput {
    background: var(--glass-shine), rgba(var(--surface-rgb), .5) !important;
    border: 1px solid var(--glass-edge) !important;
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.in-app .btn-outline { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.in-app button, .in-app .btn, .in-app .action-btn, .in-app .mob-more-menu a, .in-app .theme-option, .in-app .accent-swatch, .in-app .feed-tab {
    transition: transform .14s cubic-bezier(.3, .7, .4, 1.5), background-color .2s, box-shadow .2s, opacity .2s;
}
.in-app button:active:not(:disabled), .in-app .btn:active, .in-app .mob-more-menu a:active, .in-app .theme-option:active, .in-app .accent-swatch:active { transform: scale(.94); }
.in-app .action-btn:active { transform: scale(.86); }
/* Chat input bar and bubbles */
.in-app .chat-input-bar { background: linear-gradient(180deg, rgba(var(--bg-rgb), .4), rgba(var(--bg-rgb), .8)); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-top: 1px solid var(--glass-edge); }
.in-app .chat-bubble.theirs { background: var(--glass-shine), var(--glass-fill); border: 1px solid var(--glass-edge); }
.in-app .chat-bubble.mine { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 6px 18px rgba(var(--accent-rgb), .25); }

/* App 3.2+: the tab bar floats over the page — leave room for it */
@media (max-width: 700px) {
    .float-tabs .main { padding-bottom: 100px; }
    .float-tabs .app-update-bar { bottom: 92px; }
    .float-tabs .action-toast-container { bottom: 96px; }
}
@media (max-width: 700px) {
    /* Search field: glass + magnifier */
    .in-app .search-bar input {
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b98a5' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 16px center / 18px, var(--glass-shine), rgba(var(--surface-rgb), .5);
        border: 1px solid var(--glass-edge);
    }
}
/* Notices must stay readable over any content */
.in-app .action-toast { background: var(--glass-shine), rgba(var(--surface-rgb), .9) !important; }
.lightbox-save { position: absolute; top: 16px; right: 68px; display: grid; place-items: center; background: rgba(255, 255, 255, .12); color: #fff; border: none; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; }
.lightbox-save .ui-icon { width: 20px; height: 20px; }
.lightbox-save:disabled { opacity: .5; }
.in-app .lightbox-close, .in-app .lightbox-save { background: rgba(255, 255, 255, .16); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255, 255, 255, .18); }

/* ── Website (computer) ─────────────────────────────────── */
/* Right column: widgets keep their full height (they were squashed and cut); the column scrolls */
.widgets > .widget { flex-shrink: 0; }
/* News in the sidebar: 3 latest, 3 lines each (the full text is on /news) */
.widget-news-short .news-text { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* Who to follow: in the right column on wide screens, in the feed only when that column is hidden */
@media (min-width: 1051px) { .home-suggest { display: none; } }
/* Search field with a magnifier (everywhere) */
.search-bar input { padding-left: 44px; background-repeat: no-repeat; background-position: 16px center; background-size: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b98a5' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E"); }
/* Page titles: one style everywhere (text only) */
.page-header h2 > .ui-icon { display: none; }
/* Left menu: everything fits on shorter screens (account & logout at the bottom stay visible) */
@media (min-width: 701px) and (max-height: 900px) {
    .sidebar .nav-item { padding: 8px 14px; font-size: 1rem; margin-bottom: 0; }
    .sidebar .logo { padding-top: 8px; padding-bottom: 8px; }
}
/* Group cards: compact everywhere (a thin colour band instead of a tall banner) */
.group-card-banner { height: 44px; }
.group-card-icon { width: 40px; height: 40px; border-radius: 10px; bottom: -18px; }
.group-card-body { padding: 26px 14px 12px; }

/* ── Group chats: sender photo next to their messages + profile card ── */
.msg-wrap.group-row { flex-direction: row; align-items: flex-end; gap: 8px; }
.msg-wrap.group-row + .msg-wrap.group-row.grouped { margin-top: -6px; }
.group-avatar { flex: 0 0 32px; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; overflow: hidden; background: none; cursor: pointer; align-self: flex-start; margin-top: 18px; }
.group-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.group-avatar-space { flex: 0 0 32px; }
.group-msg-col { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; max-width: calc(100% - 40px); }
.group-msg-col .chat-bubble { max-width: 100%; }
button.group-sender { background: none; border: 0; padding: 0; margin: 0 0 3px 6px; font: inherit; font-size: .78rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
button.group-sender:hover { color: var(--accent); }
.user-card-box .modal-header h2:empty { display: none; }
.ucard { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 4px 4px 8px; }
.ucard-avatar { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(var(--accent-rgb), .5); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.ucard-name { font-size: 1.3rem; font-weight: 800; margin-top: 4px; }
.ucard-bio { margin: 0; color: var(--text-secondary); line-height: 1.45; white-space: pre-wrap; word-break: break-word; max-width: 360px; }
.ucard-stats { display: flex; gap: 16px; font-size: .88rem; color: var(--text-secondary); }
.ucard-stats strong { color: var(--text); }
.ucard-open { margin-top: 8px; width: 100%; max-width: 320px; text-align: center; padding: 12px 20px; text-decoration: none; display: block; }

/* ── @mentions in group chats ── */
.mention-picker { display: flex; flex-direction: column; gap: 2px; margin: 0 12px 6px; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); max-height: 240px; overflow-y: auto; }
.mention-picker[hidden] { display: none; }
.mention-option { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.mention-option img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.mention-option.active, .mention-option:hover { background: rgba(var(--accent-rgb), .14); }
.chat-bubble.mentions-me { box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .55); }
.chat-bubble .mention { font-weight: 600; }
.in-app .mention-picker { background: var(--glass-shine), var(--glass-fill-strong); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-color: var(--glass-edge); }

/* ── Certifications (colour levels) ── */
.cert-badge { flex-shrink: 0; }
.cert-badge.cert-gold { filter: drop-shadow(0 0 3px rgba(245, 181, 10, .55)); }
.cert-badge.cert-bot { filter: drop-shadow(0 0 3px rgba(16, 185, 129, .45)); }
/* Gold level: a gold ring around the profile picture */
.gold-ring { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #f5b50a, 0 0 14px rgba(245, 181, 10, .45) !important; }
.profile-avatar.gold-ring { box-shadow: 0 0 0 4px #f5b50a, 0 0 24px rgba(245, 181, 10, .5) !important; }
/* Long posts (purple/gold: up to 2 000 characters) are folded in lists */
.post-text.post-long { max-height: 13.5em; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
.read-more { background: none; border: 0; padding: 4px 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
/* 5 to 8 images: 3-column grid */
.post-images.n5, .post-images.n6, .post-images.n7, .post-images.n8 { grid-template-columns: repeat(3, 1fr); aspect-ratio: auto; }
.post-images.n5 img, .post-images.n6 img, .post-images.n7 img, .post-images.n8 img { aspect-ratio: 1; }
/* Admin picker */
.cert-option { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; margin-top: 8px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.cert-option.active { border-color: var(--accent); background: rgba(var(--accent-rgb), .1); }
.cert-option-badge { display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; font-size: 1rem; color: var(--text-secondary); }
.cert-option-badge .cert-badge { width: 26px !important; height: 26px !important; }
.cert-option-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cert-option-text small { color: var(--text-secondary); font-size: .8rem; }
/* White certification: a faint outline so it shows on light themes too */
.cert-badge.cert-white { filter: drop-shadow(0 0 1px rgba(0, 0, 0, .7)); }

/* ── Android app: polish of the small places ─────────────────────── */
/* ⋯ menus must be readable over any post: nearly opaque glass */
.in-app .post-more-menu, .in-app .profile-menu { background: var(--glass-shine), rgba(var(--surface-rgb), .97) !important; }
/* Empty pages: a soft glass icon above the text instead of bare text */
.empty { padding-top: 48px; }
.empty::before {
    content: ''; display: block; width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 24px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l1.9 5.8H20l-4.9 3.6 1.9 5.8-5-3.6-5 3.6 1.9-5.8L4 8.8h6.1z'/%3E%3C/svg%3E") center / 32px no-repeat,
        linear-gradient(135deg, rgba(var(--accent-rgb), .9), rgba(var(--purple-rgb), .9));
    box-shadow: 0 12px 30px rgba(var(--accent-rgb), .30), inset 0 1px 0 rgba(255, 255, 255, .35);
    animation: emptyFloat 3.2s ease-in-out infinite;
}
.empty h3 { color: var(--text); font-size: 1.15rem; margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }
@keyframes emptyFloat { 50% { transform: translateY(-5px); } }
/* Messaging PIN: a real lock icon instead of the emoji */
.in-app .pin-lock-icon {
    font-size: 0; width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 26px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2.5'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3Ccircle cx='12' cy='16' r='1.2' fill='%23ffffff'/%3E%3C/svg%3E") center / 36px no-repeat,
        linear-gradient(135deg, var(--accent), var(--purple));
    box-shadow: 0 14px 34px rgba(var(--accent-rgb), .35), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.in-app .pin-digit { border-radius: 14px; background: rgba(var(--surface-rgb), .6); transition: border-color .15s, box-shadow .15s, transform .12s; }
.in-app .pin-digit:focus { transform: translateY(-2px); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .25); }
/* "New story" bubbles: glass with an accent ring instead of dashed borders */
.in-app #storiesContainer .story-item[data-action] > div:first-child {
    border: 0 !important;
    background: var(--glass-shine), rgba(var(--accent-rgb), .12) !important;
    box-shadow: inset 0 0 0 1.5px rgba(var(--accent-rgb), .55), 0 6px 16px rgba(var(--accent-rgb), .18);
}
/* Conversations have no tab bar: no room to leave for it (it made the page scroll and show an empty band) */
@media (max-width: 700px) { .float-tabs .main:has(.chat-area) { padding-bottom: 0; } }
/* Group photo in the members & settings panel */
.gm-photo-row { display: flex; align-items: center; gap: 14px; margin: 4px 0 12px; }
.gm-photo { width: 64px; height: 64px; border-radius: 18px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); }
.gm-photo-actions { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.gm-photo-actions .btn-sm { cursor: pointer; }
.chat-header-avatar { object-fit: cover; }

/* ── Spinners: "loading" screens and the photo check notice ── */
.spinner { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(var(--accent-rgb), .25); border-top-color: var(--accent); animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty.is-loading::before, .in-app .empty.is-loading::before {
    content: ''; display: block; width: 34px; height: 34px; margin: 0 auto 14px; border-radius: 50%;
    background: none; box-shadow: none; border: 3px solid rgba(var(--accent-rgb), .22); border-top-color: var(--accent);
    animation: spin .8s linear infinite;
}
.image-check-notice {
    position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 10001; transform: translate(-50%, 20px);
    display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-radius: 999px; max-width: calc(100vw - 32px);
    background: rgba(var(--surface-rgb), .95); border: 1px solid var(--border); box-shadow: 0 12px 34px rgba(0, 0, 0, .4);
    color: var(--text); font-size: .9rem; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.image-check-notice.show { opacity: 1; transform: translate(-50%, 0); }
.in-app .image-check-notice { background: var(--glass-shine), rgba(var(--surface-rgb), .9); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-color: var(--glass-edge); }
@media (min-width: 701px) { .image-check-notice { bottom: 32px; } }
.image-check-notice { width: max-content; white-space: nowrap; }
@media (max-width: 380px) { .image-check-notice { white-space: normal; } }

/* ── YouTube cards ── */
.yt-card { margin-top: 10px; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: #000; max-width: 100%; }
.yt-thumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; background: #000; cursor: pointer; }
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s, filter .3s; }
.yt-thumb:hover img { transform: scale(1.03); filter: brightness(.85); }
.yt-play { position: absolute; inset: 0; display: grid; place-items: center; }
.yt-play svg { width: 68px; height: 48px; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .5)); transition: transform .15s; }
.yt-thumb:active .yt-play svg { transform: scale(.92); }
.yt-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.yt-info { padding: 10px 14px; background: var(--surface); border-top: 1px solid var(--border); }
.yt-title { font-weight: 600; font-size: .92rem; color: var(--text); }
.yt-src { margin-top: 2px; font-size: .74rem; color: var(--text-secondary); }

/* ── Time capsules ─────────────────────────────────────── */
.capsule-card {
    position: relative; overflow: hidden; margin-top: 10px; display: flex; align-items: center; gap: 16px; padding: 18px;
    border-radius: 20px; border: 1px solid rgba(var(--accent-rgb), .35);
    background: radial-gradient(120% 140% at 0% 0%, rgba(var(--accent-rgb), .22), transparent 60%), radial-gradient(120% 140% at 100% 100%, rgba(var(--purple-rgb), .25), transparent 60%), var(--surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.capsule-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .08) 50%, transparent 60%); animation: capsuleShine 3.5s ease-in-out infinite; pointer-events: none; }
@keyframes capsuleShine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.capsule-orb { flex: 0 0 56px; height: 56px; display: grid; place-items: center; font-size: 28px; border-radius: 18px;
    background: linear-gradient(135deg, var(--accent), var(--purple)); box-shadow: 0 10px 26px rgba(var(--accent-rgb), .35), inset 0 1px 0 rgba(255, 255, 255, .35);
    animation: capsuleFloat 3s ease-in-out infinite; }
@keyframes capsuleFloat { 50% { transform: translateY(-4px) rotate(-6deg); } }
.capsule-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.capsule-info strong { font-size: .95rem; }
.capsule-count { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em;
    background: linear-gradient(90deg, var(--accent), var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.capsule-info small { color: var(--text-secondary); font-size: .8rem; }
/* Opening: the orb shakes and bursts, then the real post appears */
.capsule-card.opening .capsule-orb { animation: capsuleShake .45s ease-in-out 2; }
.capsule-card.opening { animation: capsuleBurst .9s ease-in forwards .45s; }
@keyframes capsuleShake { 25% { transform: rotate(-14deg) scale(1.08); } 75% { transform: rotate(14deg) scale(1.08); } }
@keyframes capsuleBurst { 60% { transform: scale(1.04); opacity: 1; filter: brightness(1.6); } to { transform: scale(.9); opacity: 0; } }
.post.capsule-reveal { animation: capsuleReveal .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes capsuleReveal { from { opacity: 0; transform: translateY(12px) scale(.98); filter: blur(4px); } }
.capsule-owner { margin-top: 8px; padding: 8px 12px; border-radius: 12px; font-size: .82rem; color: var(--text-secondary); background: rgba(var(--accent-rgb), .08); border: 1px dashed rgba(var(--accent-rgb), .35); }
.capsule-preview { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding: 8px 12px; border-radius: 12px; font-size: .85rem; color: var(--accent); background: rgba(var(--accent-rgb), .1); }
.capsule-preview[hidden] { display: none; }
.capsule-preview button { background: none; border: 0; color: var(--text-secondary); cursor: pointer; font-size: .9rem; }
.capsule-modal { text-align: center; }
.capsule-hero { width: 72px; height: 72px; margin: 4px auto 12px; display: grid; place-items: center; font-size: 34px; border-radius: 24px; background: linear-gradient(135deg, var(--accent), var(--purple)); box-shadow: 0 12px 30px rgba(var(--accent-rgb), .35); animation: capsuleFloat 3s ease-in-out infinite; }
.capsule-presets { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 6px; }
.capsule-modal .gm-setting { text-align: left; }
@media (prefers-reduced-motion: reduce) { .capsule-card::after, .capsule-orb, .capsule-hero { animation: none; } }

/* ── UX: code screen "later", new-message pill, undo delete, feed end, people search ── */
.pin-later-btn { display: block; margin: 10px auto 0; background: none; border: 0; color: var(--text-secondary); font: inherit; font-weight: 600; cursor: pointer; padding: 8px 14px; border-radius: 999px; }
.pin-later-btn:hover { color: var(--text); background: rgba(var(--accent-rgb), .08); }
#chatE2EStatus.e2e-unlock { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.chat-area { position: relative; }
.new-msg-pill { position: absolute; left: 50%; bottom: 84px; transform: translate(-50%, 16px); z-index: 5; padding: 8px 16px; border: 0; border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--purple)); color: #fff; font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer;
    box-shadow: 0 8px 24px rgba(var(--accent-rgb), .4); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.new-msg-pill.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.post.post-removing { opacity: .25; filter: grayscale(1); pointer-events: none; transition: opacity .25s, filter .25s; }
.undo-toast { gap: 12px; position: relative; overflow: hidden; }
.undo-btn { margin-left: 6px; background: none; border: 0; color: var(--accent); font: inherit; font-weight: 800; cursor: pointer; padding: 4px 6px; }
.undo-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--accent); transform-origin: left; animation: undoBar 5s linear forwards; }
@keyframes undoBar { to { transform: scaleX(0); } }
.feed-end { padding: 28px 16px 36px; text-align: center; color: var(--text-secondary); font-weight: 600; }
.search-bar { position: relative; }
.search-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 14px 34px rgba(0, 0, 0, .4); }
.search-suggest[hidden] { display: none; }
.search-suggest-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; color: var(--text); text-decoration: none; }
.search-suggest-item:hover, .search-suggest-item:focus { background: rgba(var(--accent-rgb), .1); }
.search-suggest-item img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.search-suggest-item span { display: flex; flex-direction: column; min-width: 0; }
.search-suggest-item small { color: var(--text-secondary); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.in-app .search-suggest { background: var(--glass-shine), rgba(var(--surface-rgb), .95); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-color: var(--glass-edge); }

/* ── Echo video player ─────────────────────────────── */
.post-image-wrap.has-vplay { max-height: none; border: 0; overflow: visible; }
.vplay { --vp-glass: rgba(18, 18, 24, .5); position: relative; margin-top: 10px; border-radius: 18px; overflow: hidden; background: #000; max-width: 100%; line-height: 0;
    user-select: none; -webkit-user-select: none; isolation: isolate; box-shadow: 0 0 0 1px var(--border); }
.post-image-wrap.has-vplay .vplay { margin-top: 0; }
.vplay-video { display: block; width: 100%; max-height: min(72vh, 640px); object-fit: contain; background: #000; cursor: pointer; }
.vplay-video:hover { opacity: 1; }
.vplay :is(button, .vplay-chip) { -webkit-tap-highlight-color: transparent; font-family: inherit; }
/* Soft shade while paused so the controls stay readable */
.vplay-shade { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, rgba(0,0,0,.28), rgba(0,0,0,.05) 60%), linear-gradient(transparent 55%, rgba(0,0,0,.55));
    opacity: 0; transition: opacity .3s; pointer-events: none; }
.vplay.paused .vplay-shade { opacity: 1; pointer-events: auto; cursor: pointer; }
.vplay.show-ui .vplay-shade { opacity: 1; }
/* Big centred button: accent gradient like the voice player, glass once started */
.vplay-big { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
    display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--purple));
    box-shadow: 0 10px 30px rgba(var(--accent-rgb), .45), inset 0 1px 0 rgba(255,255,255,.35); transition: transform .2s cubic-bezier(.2,.9,.3,1.4), opacity .25s; z-index: 2; }
.vplay-big svg { width: 26px; height: 26px; fill: currentColor; margin-left: 3px; }
.vplay.ended .vplay-big svg { margin-left: 0; }
.vplay-big:hover { transform: scale(1.06); }
.vplay-big:active { transform: scale(.9); }
.vplay.playing .vplay-big { opacity: 0; transform: scale(.6); pointer-events: none; }
.vplay.started .vplay-big { background: var(--vp-glass); backdrop-filter: blur(14px) saturate(1.6); -webkit-backdrop-filter: blur(14px) saturate(1.6);
    box-shadow: 0 8px 26px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.22), inset 0 1px 0 rgba(255,255,255,.3); }
/* Tap feedback: the icon pops in the middle and fades */
.vplay-flash { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; display: grid; place-items: center;
    color: #fff; background: rgba(0,0,0,.4); opacity: 0; pointer-events: none; z-index: 2; }
.vplay-flash svg { width: 26px; height: 26px; fill: currentColor; }
.vplay-flash.go { animation: vpFlash .55s ease-out; }
.vplay.paused .vplay-flash { display: none; }
@keyframes vpFlash { 0% { opacity: .95; transform: scale(.7); } 100% { opacity: 0; transform: scale(1.35); } }
/* Buffering */
.vplay-spinner { position: absolute; left: 50%; top: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%;
    border: 3px solid rgba(255,255,255,.2); border-top-color: var(--accent); animation: spin .8s linear infinite; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 2; }
.vplay.buffering.playing .vplay-spinner { opacity: 1; }
/* Double-tap seek hint */
.vplay-seek-hint { position: absolute; top: 50%; margin-top: -17px; height: 34px; padding: 0 16px; display: flex; align-items: center; border-radius: 999px;
    background: var(--vp-glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: #fff; font-size: .85rem; font-weight: 700;
    opacity: 0; transform: scale(.8); pointer-events: none; transition: opacity .2s, transform .2s; z-index: 2; }
.vplay-seek-hint.left { left: 10%; } .vplay-seek-hint.right { right: 10%; }
.vplay-seek-hint.show { opacity: 1; transform: none; }
/* Small glass chips while playing: time left + sound */
.vplay-chip { position: absolute; bottom: 12px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; border: 0; color: #fff;
    background: var(--vp-glass); backdrop-filter: blur(12px) saturate(1.5); -webkit-backdrop-filter: blur(12px) saturate(1.5);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1;
    transition: opacity .25s, transform .25s; z-index: 1; }
.vplay-remain { left: 12px; padding: 0 10px; pointer-events: none; }
.vplay-remain:empty { display: none; }
.vplay-chip-btn { right: 12px; width: 32px; height: 32px; bottom: 10px; padding: 0; cursor: pointer; }
.vplay-chip-btn svg { width: 17px; height: 17px; fill: currentColor; }
.vplay-chip-btn:active { transform: scale(.88); }
.vplay:not(.started) .vplay-mute-chip { display: none; }
.vplay.show-ui .vplay-chip, .vplay.paused.started .vplay-chip { opacity: 0; transform: translateY(6px); pointer-events: none; }
/* Thin progress line at the very bottom while playing */
.vplay-line { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.18); opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 1; }
.vplay-line i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--purple)); box-shadow: 0 0 8px rgba(var(--accent-rgb), .8); }
.vplay.started .vplay-line { opacity: 1; }
.vplay.show-ui .vplay-line, .vplay.paused .vplay-line { opacity: 0; }
/* Floating glass control bar */
.vplay-bar { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; align-items: center; gap: 2px; padding: 4px 6px; border-radius: 999px; line-height: 1;
    background: var(--vp-glass); backdrop-filter: blur(18px) saturate(1.8); -webkit-backdrop-filter: blur(18px) saturate(1.8);
    box-shadow: 0 8px 24px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.14), inset 0 1px 0 rgba(255,255,255,.18);
    opacity: 0; transform: translateY(10px) scale(.98); transition: opacity .25s, transform .3s cubic-bezier(.2,.9,.3,1.2); pointer-events: none; z-index: 3; }
.vplay.started.show-ui .vplay-bar, .vplay.paused.started .vplay-bar, .vplay.scrubbing .vplay-bar { opacity: 1; transform: none; pointer-events: auto; }
.vplay-btn { flex: 0 0 34px; width: 34px; height: 34px; border: 0; padding: 0; border-radius: 50%; background: none; color: #fff; cursor: pointer; display: grid; place-items: center; transition: background .15s, transform .15s; }
.vplay-btn svg { width: 19px; height: 19px; fill: currentColor; }
.vplay-btn:hover { background: rgba(255,255,255,.12); }
.vplay-btn:active { transform: scale(.88); }
.vplay-speed { flex-basis: 38px; width: 38px; border-radius: 12px; font-size: .75rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.vplay.is-fast .vplay-speed { color: var(--accent); }
.vplay-track { position: relative; flex: 1; min-width: 40px; height: 34px; margin: 0 6px; cursor: pointer; touch-action: none; outline: none; }
.vplay-rail { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; background: rgba(255,255,255,.2); overflow: hidden; transition: height .15s, margin .15s; }
.vplay-buffer, .vplay-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 4px; }
.vplay-buffer { background: rgba(255,255,255,.3); }
.vplay-fill { background: linear-gradient(90deg, var(--accent), var(--purple)); }
.vplay-thumb { position: absolute; top: 50%; left: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff;
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .35), 0 2px 6px rgba(0,0,0,.4); transition: transform .15s; }
.vplay-track:hover .vplay-rail, .vplay.scrubbing .vplay-rail { height: 6px; margin-top: -3px; }
.vplay.scrubbing .vplay-thumb, .vplay-track:focus-visible .vplay-thumb { transform: scale(1.3); }
.vplay-time { flex: 0 0 auto; padding: 0 4px; color: rgba(255,255,255,.92); font-size: .74rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vplay-error .vplay-big { opacity: .35; pointer-events: none; }
/* Fullscreen (real, or in-page overlay inside the app) */
.vplay.is-full { border-radius: 0; box-shadow: none; display: flex; align-items: center; justify-content: center; }
.vplay.is-full .vplay-video { max-height: 100%; height: 100%; }
.vplay.is-fake-full { position: fixed; inset: 0; z-index: 10000; margin: 0; }
.vplay.is-full .vplay-bar { left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); }
body.vplay-lock { overflow: hidden; }
@media (max-width: 380px) { .vplay-time { display: none; } .vplay-speed { flex-basis: 34px; width: 34px; } }

/* ── Users page: filter, sort chips, richer cards ── */
.users-tools { padding: 10px 16px 12px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.users-filter { display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 42px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-secondary); transition: border-color .15s, box-shadow .15s; }
.users-filter:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18); }
.users-filter .ui-icon { width: 18px; height: 18px; flex-shrink: 0; }
.users-filter input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: .92rem; outline: none; }
.users-sort { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.users-sort::-webkit-scrollbar { display: none; }
.users-sort .chip { flex-shrink: 0; border: 1px solid var(--border); background: none; color: var(--text-secondary); font: inherit; font-size: .82rem; font-weight: 600; padding: 6px 14px; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.users-sort .chip:hover { color: var(--text); }
.users-sort .chip.active { background: rgba(var(--accent-rgb), .15); border-color: rgba(var(--accent-rgb), .5); color: var(--accent); }
#userList .user-card { gap: 12px; }
#userList .user-card > .btn, .user-card-me { flex-shrink: 0; }
.user-card-handle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#userList .user-card-name { flex-wrap: nowrap; }
#userList .user-card-name .badge { flex-shrink: 0; }
.user-card-meta { color: var(--text-secondary); font-size: .78rem; margin-top: 3px; }
.user-card-me { font-size: .78rem; font-weight: 700; color: var(--accent); padding: 4px 10px; border-radius: 999px; background: rgba(var(--accent-rgb), .12); }

/* ── Stats page ── */
.stats-page { padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 560px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { --c: var(--accent); position: relative; overflow: hidden; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); animation: fadeUp .3s ease both; }
.stat-card::after { content: ''; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%); pointer-events: none; }
.stat-ico { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.stat-ico .ui-icon { width: 16px; height: 16px; }
.stat-value { margin-top: 10px; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-label { margin-top: 2px; font-size: .78rem; color: var(--text-secondary); }
.c-likes { --c: #f91880; } .c-rate { --c: #00ba7c; } .c-followers { --c: var(--purple); } .c-replies { --c: #1d9bf0; } .c-reposts { --c: #00ba7c; }
.stat-grid .stat-card:nth-child(2) { animation-delay: .04s; } .stat-grid .stat-card:nth-child(3) { animation-delay: .08s; }
.stat-grid .stat-card:nth-child(4) { animation-delay: .12s; } .stat-grid .stat-card:nth-child(5) { animation-delay: .16s; } .stat-grid .stat-card:nth-child(6) { animation-delay: .2s; }
.stat-section { padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.stat-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; margin-bottom: 12px; }
.stat-section-head h3 { font-size: 1rem; font-weight: 800; margin: 0; }
.stat-section-head small { color: var(--text-secondary); font-size: .78rem; }
.stat-delta { font-size: .8rem; font-weight: 700; color: var(--text-secondary); white-space: nowrap; }
.stat-delta.up { color: #00ba7c; } .stat-delta.down { color: #f4212e; }
.stat-delta small { font-weight: 500; }
.stat-chart { display: flex; align-items: stretch; gap: 4px; height: 140px; }
.chart-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: default; }
.chart-bar { position: relative; flex: 1; width: 100%; max-width: 22px; border-radius: 6px; background: rgba(var(--accent-rgb), .07); overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.chart-views, .chart-inter { display: block; width: 100%; transform-origin: bottom; animation: barGrow .6s cubic-bezier(.2,.9,.3,1) both; }
.chart-views { background: linear-gradient(180deg, var(--accent), rgba(var(--accent-rgb), .55)); }
.chart-inter { background: var(--purple); }
.chart-col:hover .chart-bar { background: rgba(var(--accent-rgb), .14); }
@keyframes barGrow { from { transform: scaleY(0); } }
.chart-day { font-size: .68rem; color: var(--text-secondary); text-transform: uppercase; line-height: 1; }
.chart-day.is-today { color: var(--accent); font-weight: 800; }
.chart-legend { display: flex; gap: 14px; margin-top: 12px; font-size: .75rem; color: var(--text-secondary); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.chart-legend .lg-inter { background: var(--purple); }
.stat-post { display: flex; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; border-radius: 10px; transition: background .15s; }
.stat-section-head + .stat-post { border-top: 0; }
.stat-post:hover { background: rgba(var(--accent-rgb), .06); }
.stat-rank { flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 800; color: var(--text-secondary); background: rgba(var(--accent-rgb), .08); }
.stat-post:nth-of-type(1) .stat-rank { color: #fff; background: linear-gradient(135deg, var(--accent), var(--purple)); }
.stat-post-body { flex: 1; min-width: 0; }
.stat-post-text { font-size: .9rem; line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stat-post-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: .78rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.stat-post-meta span { display: inline-flex; align-items: center; gap: 4px; }
.stat-post-meta .ui-icon { width: 13px; height: 13px; }
.stat-post-meta time { margin-left: auto; }
.stat-section .empty { padding: 24px 0 8px; }
.stat-section .empty::before { display: none; }

/* Legal links (settings + about widget) */
.settings-legal, .about-legal { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: .82rem; }
.about-legal { margin-top: 10px; font-size: .78rem; }
.settings-legal a, .about-legal a { color: var(--text-secondary); text-decoration: none; }
.settings-legal a:hover, .about-legal a:hover { color: var(--accent); text-decoration: underline; }

/* Admin: contact / notice messages */
.admin-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; }
.contact-msg { padding: 14px; margin-bottom: 10px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.contact-msg.is-open { border-color: rgba(var(--accent-rgb), .45); }
.contact-msg-head { font-size: .9rem; }
.contact-msg-url { display: block; margin-top: 4px; font-size: .82rem; overflow-wrap: anywhere; }
.contact-msg-text { margin: 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.contact-msg-from { font-size: .8rem; color: var(--text-secondary); margin-bottom: 8px; overflow-wrap: anywhere; }

/* Danger button: solid red (it was drawing on top of the blue gradient of .btn) */
.btn.btn-danger { background: rgba(244, 33, 46, .12); border: 1px solid rgba(244, 33, 46, .45); color: var(--red); box-shadow: none; }
.btn.btn-danger:hover { background: var(--red); color: #fff; }
/* Admin tabs scroll sideways on phones instead of overflowing */
.admin-tabs { overflow-x: auto; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab { flex: 1 0 auto; white-space: nowrap; }

.settings-session-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.settings-session-actions [hidden] { display: none; }

/* Thread: the posts a reply answers, joined by a line between the avatars */
.thread-ancestor { border-bottom: 0; padding-bottom: 0; }
.thread-ancestor .post-body { padding-bottom: 14px; }
.thread-ancestor + .post { padding-top: 4px; }
.thread-avatar-col { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.thread-line { flex: 1; width: 2px; min-height: 14px; margin-top: 4px; border-radius: 2px; background: linear-gradient(var(--border), rgba(var(--accent-rgb), .45)); }
.thread-gone-dot { width: 40px; height: 40px; border-radius: 50%; border: 2px dashed var(--border); }
.thread-gone-text { color: var(--text-secondary); font-size: .9rem; font-style: italic; margin: 10px 0 0; }
.thread-gone { cursor: default; }
.thread-main { scroll-margin-top: 64px; }
.reply-to-link { display: inline-flex; align-items: center; gap: 4px; margin: 2px 0 4px; font-size: .82rem; color: var(--text-secondary); text-decoration: none; }
.reply-to-link strong { color: var(--accent); font-weight: 600; }
a.reply-to-link:hover strong { text-decoration: underline; }
.reply-to-link.is-gone { font-style: italic; }
.reply-to-link .ui-icon { width: 14px; height: 14px; }
/* Room under a reply so its page can open on the reply itself even when nothing follows */
.main:has(.thread-ancestor)::after { content: ''; display: block; height: 65vh; }

/* Admin dashboard (reuses the stats page cards and charts) */
#dashboard { display: flex; flex-direction: column; gap: 16px; }
.dash-sub { margin-top: 4px; font-size: .74rem; color: var(--text-secondary); }
.dash-todos { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-todo { border: 1px solid rgba(244, 33, 46, .4); background: rgba(244, 33, 46, .1); color: var(--text); font: inherit; font-weight: 700; font-size: .88rem; padding: 10px 14px; border-radius: 14px; cursor: pointer; }
.dash-alert { padding: 12px 14px; border-radius: 14px; font-size: .9rem; line-height: 1.5; margin-bottom: 10px; }
.dash-alert.ok { background: rgba(0, 186, 124, .1); border: 1px solid rgba(0, 186, 124, .3); }
.dash-alert.bad { background: rgba(244, 33, 46, .1); border: 1px solid rgba(244, 33, 46, .35); }
.dash-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--border); color: var(--text-secondary); text-decoration: none; font-size: .9rem; }
.stat-section-head + .dash-row { border-top: 0; }
.dash-row strong { color: var(--text); font-weight: 700; text-align: right; }
a.dash-row:hover span:first-child { color: var(--accent); }
.dash-bad { color: var(--red) !important; }
.dash-chart { height: 110px; }
.dash-backups { list-style: none; padding: 0; margin: 10px 0; }
.dash-backups li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: .88rem; }
.dash-backups li span:first-child { flex: 1; }
#dashBackups .settings-desc { overflow-wrap: anywhere; }

/* Search in a conversation */
.chat-search-btn { flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; border: 0; background: none; color: var(--text); display: grid; place-items: center; cursor: pointer; }
.chat-search-btn:hover { background: var(--surface); }
.chat-search-btn .ui-icon { width: 20px; height: 20px; }
.chat-search { display: flex; align-items: center; gap: 6px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--border); background: rgba(var(--bg-rgb), .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: fadeUp .2s ease; flex-shrink: 0; }
.chat-search > .ui-icon { width: 18px; height: 18px; color: var(--text-secondary); flex-shrink: 0; }
.chat-search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: .95rem; outline: none; padding: 6px 0; }
.chat-search-count { font-size: .8rem; font-weight: 700; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chat-search-count.none { color: var(--red); font-weight: 600; }
.chat-search-nav, .chat-search-close { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; border: 0; background: none; color: var(--text); display: grid; place-items: center; cursor: pointer; font-size: 1rem; }
.chat-search-nav:hover, .chat-search-close:hover { background: var(--surface); }
.chat-search-nav .ui-icon { width: 18px; height: 18px; }
mark.chat-hit { background: rgba(255, 212, 0, .35); color: inherit; border-radius: 3px; padding: 0 1px; }
mark.chat-hit.current { background: #ffd400; color: #000; box-shadow: 0 0 0 2px rgba(255, 212, 0, .35); }
@media (max-width: 380px) { .chat-search-count { display: none; } }
.chat-bubble.mine mark.chat-hit:not(.current) { background: rgba(255, 255, 255, .32); }

/* Muted words */
.muted-add { display: flex; gap: 8px; margin-top: 10px; }
.muted-add .settings-input { flex: 1; min-width: 0; margin: 0; }
.muted-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.muted-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px; border-radius: 999px; background: rgba(var(--accent-rgb), .12); border: 1px solid rgba(var(--accent-rgb), .35); font-size: .88rem; font-weight: 600; }
.muted-chip button { width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .25); color: var(--text); cursor: pointer; font-size: .7rem; display: grid; place-items: center; }
.post.is-muted { cursor: default; }
.post.is-muted > :not(.muted-banner) { display: none; }
.muted-banner { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .88rem; color: var(--text-secondary); }
.muted-banner button { flex-shrink: 0; border: 1px solid var(--border); background: none; color: var(--text); font: inherit; font-size: .82rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; cursor: pointer; }

/* ============ PASSKEYS (settings) ============ */
.passkey-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px; }
.passkey-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.passkey-icon { font-size: 1.2rem; }
.passkey-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.passkey-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.passkey-info small { color: var(--text-secondary, #8b98a5); font-size: .8rem; }
.passkey-del { flex-shrink: 0; }
.passkey-add, .passkey-list { align-self: stretch; }
.passkey-add .btn { margin-top: 8px; }
