/* =====================================================================
   ViberWorld App — base styles
   Dark theme by default, light theme available via .theme-light on <html>.
   Both keep the brand identity (vibe, neon, glass) — light is bright but
   themed, not generic.
   ===================================================================== */

/* ---------- Theme tokens ---------- */
:root,
html.theme-dark {
    --bg:        #0f0c29;
    --bg-2:      #1a1640;
    --panel:     rgba(20, 16, 50, 0.72);
    --panel-2:   rgba(28, 22, 70, 0.55);
    --border:    rgba(168, 139, 250, 0.18);
    --border-h:  rgba(168, 139, 250, 0.32);
    --text:      #e9e2ff;
    --muted:     #a8a2cc;
    --cyan:      #22d3ee;
    --magenta:   #ec4899;
    --gold:      #facc15;
    --green:     #22c55e;
    --pink:      #f472b6;
    --violet:    #a78bfa;
    --blue:      #60a5fa;
    --red:       #f87171;
}
html.theme-light {
    --bg:        #f4f1ff;
    --bg-2:      #ede5ff;
    --panel:     rgba(255, 255, 255, 0.85);
    --panel-2:   rgba(244, 241, 255, 0.92);
    --border:    rgba(124, 58, 237, 0.2);
    --border-h:  rgba(124, 58, 237, 0.4);
    --text:      #1a1135;
    --muted:     #5d4d8a;
    --cyan:      #0e7490;
    --magenta:   #be185d;
    --gold:      #a16207;
    --green:     #15803d;
    --pink:      #be185d;
    --violet:    #7c3aed;
    --blue:      #1d4ed8;
    --red:       #dc2626;
}

/* ---------- Reset / base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    line-height: 1.55;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Vibe background — radial gradient + subtle grid */
.vw-bg {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(800px 600px at 20% 10%, rgba(167, 139, 250, 0.18), transparent 60%),
        radial-gradient(700px 500px at 80% 80%, rgba(34, 211, 238, 0.15), transparent 60%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
html.theme-light .vw-bg {
    background:
        radial-gradient(800px 600px at 20% 10%, rgba(167, 139, 250, 0.25), transparent 60%),
        radial-gradient(700px 500px at 80% 80%, rgba(236, 72, 153, 0.12), transparent 60%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

/* ---------- Top bar ---------- */
.vw-topbar {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px;
    background: var(--panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.vw-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700; font-size: 1.2rem;
    text-decoration: none;
    background: linear-gradient(135deg, var(--violet), var(--cyan), var(--magenta));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    letter-spacing: -0.01em;
}
.vw-nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.vw-nav a, .vw-link-btn {
    font-size: 0.92rem;
    color: var(--text);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.15s ease;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}
.vw-nav a:hover, .vw-link-btn:hover {
    background: var(--panel-2);
    color: var(--violet);
}
.vw-nav .vw-cta {
    background: linear-gradient(135deg, var(--violet), var(--magenta));
    color: #fff;
    font-weight: 600;
}
.vw-nav .vw-cta:hover {
    filter: brightness(1.1);
    color: #fff;
}
.vw-nav-staff {
    border: 1px solid var(--border-h);
}

.vw-logout-form { display: inline; margin: 0; }

/* ---------- Main layout ---------- */
.vw-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 20px 64px;
}

/* ---------- Footer ---------- */
.vw-footer {
    text-align: center;
    padding: 24px 16px;
    color: var(--muted);
    font-size: 0.86rem;
    border-top: 1px solid var(--border);
    margin-top: 64px;
}
.vw-footer a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--border-h); }
.vw-footer a:hover { color: var(--text); }

/* ---------- Flash messages ---------- */
.vw-flash { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.vw-flash-item {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.95rem;
    border: 1px solid var(--border);
}
.vw-flash-ok   { background: rgba(34, 197, 94, 0.1); border-color: rgba(34,197,94,0.3); color: #86efac; }
.vw-flash-err  { background: rgba(248, 113, 113, 0.1); border-color: rgba(248,113,113,0.3); color: #fca5a5; }
.vw-flash-info { background: rgba(99, 102, 241, 0.08); border-color: rgba(99,102,241,0.3); color: var(--violet); }
html.theme-light .vw-flash-ok   { color: #166534; }
html.theme-light .vw-flash-err  { color: #991b1b; }
html.theme-light .vw-flash-info { color: #4338ca; }

/* ---------- Cards / panels ---------- */
.vw-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ---------- Forms ---------- */
.vw-form { display: flex; flex-direction: column; gap: 14px; max-width: 440px; margin: 0 auto; }
.vw-field { display: flex; flex-direction: column; gap: 6px; }
.vw-field label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    color: var(--muted);
    text-transform: uppercase;
}
.vw-field input[type="text"],
.vw-field input[type="email"],
.vw-field input[type="password"],
.vw-field input[type="number"],
.vw-field textarea,
.vw-field select {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    color: var(--text);
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.vw-field input:focus, .vw-field textarea:focus, .vw-field select:focus {
    outline: none;
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18);
}
.vw-help { font-size: 0.82rem; color: var(--muted); }

/* Native <option> elements need explicit colors — many browsers (Win Chrome,
   Win Edge, Linux GTK) render the dropdown popup with system colors and
   ignore the parent <select>'s color, producing white-on-white in dark mode.
   Fix: apply solid hex (rgba doesn't always render correctly on options)
   to every <option> and <optgroup> sitewide, scoped to the theme.            */
html.theme-dark select option,
html.theme-dark select optgroup {
    background-color: #1a1135;
    color: #e9e2ff;
}
html.theme-dark select option:checked,
html.theme-dark select option:hover {
    background-color: #2a1f5a;
    color: #ffffff;
}
html.theme-light select option,
html.theme-light select optgroup {
    background-color: #ffffff;
    color: #1a1135;
}
html.theme-light select option:checked,
html.theme-light select option:hover {
    background-color: #e9d5ff;
    color: #1a1135;
}

/* ---------- Buttons ---------- */
.vw-btn {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    background: linear-gradient(135deg, var(--violet), var(--magenta));
    border: 0;
    padding: 11px 22px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    box-shadow: 0 6px 18px rgba(167, 139, 250, 0.32);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}
.vw-btn:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 10px 24px rgba(167, 139, 250, 0.42); }
.vw-btn:active { transform: translateY(0); }
.vw-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.vw-btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-h);
    box-shadow: none;
}
.vw-btn-ghost:hover { border-color: var(--violet); color: var(--violet); box-shadow: none; }
.vw-btn-danger {
    background: linear-gradient(135deg, var(--red), #dc2626);
    box-shadow: 0 6px 18px rgba(248, 113, 113, 0.32);
}

/* ---------- Headings ---------- */
.vw-h1 {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 700;
    margin: 0 0 8px;
    background: linear-gradient(135deg, var(--violet), var(--cyan));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.vw-h2 { font-size: 1.4rem; font-weight: 700; margin: 0 0 12px; }
.vw-h3 { font-size: 1.1rem; font-weight: 700; margin: 0 0 8px; }
.vw-lead { font-size: 1rem; color: var(--muted); margin: 0 0 24px; }

/* ---------- Inline note (e.g. "check spam folder") ---------- */
.vw-note {
    background: rgba(250, 204, 21, 0.08);
    border-left: 3px solid var(--gold);
    border-radius: 0 10px 10px 0;
    padding: 12px 14px;
    font-size: 0.9rem;
    color: var(--text);
    margin: 14px 0;
}
html.theme-light .vw-note { background: rgba(250, 204, 21, 0.15); }
.vw-note b { color: var(--gold); }

/* ---------- Avatar picker ---------- */
.vw-avatar-pick {
    cursor: pointer;
    padding: 4px;
    border: 2px solid var(--border);
    border-radius: 10px;
    display: block;
    line-height: 0;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.vw-avatar-pick:hover { border-color: var(--violet); transform: translateY(-2px); }
.vw-avatar-pick:has(input:checked) {
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.25);
}
.vw-avatar-pick input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }

/* ---------- Right-click signature modal (deterrent + branding) ---------- */
.vw-ctx {
    position: fixed;
    z-index: 10000;
    width: 280px;
    background: linear-gradient(135deg, rgba(15, 12, 41, 0.97), rgba(36, 22, 70, 0.97));
    border: 1px solid var(--violet);
    border-radius: 14px;
    padding: 14px 16px 10px;
    color: var(--text);
    font-family: 'Space Grotesk', sans-serif;
    box-shadow: 0 12px 40px rgba(167, 139, 250, 0.32),
                0 0 0 1px rgba(167, 139, 250, 0.18) inset;
    animation: vw-ctx-in 0.22s ease-out;
}
html.theme-light .vw-ctx {
    background: linear-gradient(135deg, rgba(255,255,255,0.97), rgba(244,241,255,0.97));
    box-shadow: 0 12px 40px rgba(124, 58, 237, 0.22);
}
.vw-ctx[hidden] { display: none; }
@keyframes vw-ctx-in {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
.vw-ctx-close {
    position: absolute; top: 4px; right: 8px;
    color: var(--violet);
    border: 0; background: transparent;
    font-size: 1.3rem; line-height: 1; cursor: pointer;
    padding: 4px 6px;
    font-family: inherit;
}
.vw-ctx-close:hover { color: var(--magenta); }
.vw-ctx-text {
    font-size: 0.95rem;
    text-align: center;
    padding: 6px 12px 10px;
}
.vw-ctx-text .accent {
    background: linear-gradient(90deg, var(--violet), var(--cyan), var(--magenta));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    font-weight: 700;
}
.vw-ctx-progress {
    height: 2px; border-radius: 1px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}
html.theme-light .vw-ctx-progress { background: rgba(124, 58, 237, 0.14); }
.vw-ctx-progress span {
    display: block; height: 100%;
    background: linear-gradient(90deg, var(--violet), var(--cyan));
    transform-origin: left center;
    animation: vw-ctx-progress 6s linear forwards;
}
@keyframes vw-ctx-progress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* =========================================================================
   POST CARD + ENGAGEMENT (reactions, comments, share, report, polls)
   Used on /u/<handle>, /p/<id>, /dashboard/profile/.
   ========================================================================= */
.vw-post {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 14px;
    transition: border-color .2s ease;
}
.vw-post:hover { border-color: rgba(167, 139, 250, 0.35); }
.vw-post.is-pinned { border-left: 3px solid var(--gold); }
.vw-post-author {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px;
}
.vw-post-avatar {
    width: 40px; height: 40px; border-radius: 10px;
    background: rgba(255,255,255,0.05); padding: 4px; flex: 0 0 40px;
}
.vw-post-name {
    font-weight: 600; color: var(--text); text-decoration: none;
    margin-right: 6px;
}
a.vw-post-name:hover { color: var(--violet); }
.vw-post-handle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem; color: var(--muted);
}
.vw-post-role {
    margin-left: 8px; font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem; padding: 2px 8px; border-radius: 999px;
    background: rgba(167, 139, 250, 0.12); color: var(--violet);
    text-transform: uppercase; letter-spacing: 0.06em;
}
.vw-post-role.role-staff { color: var(--cyan); background: rgba(34, 211, 238, 0.12); }
.vw-post-role.role-admin { color: var(--magenta); background: rgba(232, 121, 249, 0.12); }
.vw-post-role.role-bot   { color: var(--pink);   background: rgba(244, 114, 182, 0.12); }
.vw-post-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem; color: var(--muted);
    margin-bottom: 8px; letter-spacing: 0.04em;
}
.vw-post-time-link { color: inherit; text-decoration: none; }
.vw-post-time-link:hover { color: var(--violet); }
.vw-post-vis {
    padding: 1px 8px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.68rem; text-transform: uppercase;
}
.vw-post-vis.vis-followers { color: var(--cyan); }
.vw-post-vis.vis-private   { color: var(--gold); }
.vw-post-body {
    font-size: 0.96rem; line-height: 1.6;
    color: var(--text); white-space: pre-wrap; word-wrap: break-word;
}
.vw-post-image {
    max-width: 100%; max-height: 600px; border-radius: 10px;
    margin-top: 12px; display: block;
}
.vw-post-audio {
    margin-top: 12px; width: 100%;
}

/* Engage row (reactions / comments / share / report) */
.vw-post-engage {
    margin-top: 14px; padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.vw-react,
.vw-post-action {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent; border: 1px solid var(--border);
    color: var(--text); padding: 6px 12px;
    border-radius: 999px; cursor: pointer;
    font-family: inherit; font-size: 0.82rem;
    text-decoration: none; transition: all .15s ease;
}
.vw-react:hover,
.vw-post-action:hover {
    border-color: var(--violet); color: var(--violet);
    background: rgba(167, 139, 250, 0.08);
}
.vw-react.is-on.vw-react-up {
    border-color: var(--cyan); color: var(--cyan);
    background: rgba(34, 211, 238, 0.12);
}
.vw-react.is-on.vw-react-down {
    border-color: var(--magenta); color: var(--magenta);
    background: rgba(232, 121, 249, 0.12);
}
.vw-react:disabled { opacity: 0.5; cursor: wait; }
.vw-react-icon { font-size: 0.85rem; }
.vw-react-count { font-family: 'JetBrains Mono', monospace; font-weight: 600; }

/* Polls */
.vw-poll {
    margin-top: 14px; padding: 14px;
    border-radius: 12px;
    background: rgba(167, 139, 250, 0.06);
    border: 1px solid rgba(167, 139, 250, 0.18);
}
.vw-poll-q { font-weight: 600; margin-bottom: 10px; }
.vw-poll-options { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.vw-poll-options label {
    display: flex; gap: 10px; align-items: center;
    padding: 8px 12px; border-radius: 8px;
    background: rgba(255,255,255,0.04); cursor: pointer;
    transition: background .15s ease;
}
.vw-poll-options label:hover { background: rgba(167, 139, 250, 0.1); }
.vw-poll-options input { accent-color: var(--violet); }
.vw-poll-results { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.vw-poll-bar {
    position: relative; padding: 8px 12px; border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
    display: flex; justify-content: space-between; gap: 12px;
    font-size: 0.88rem;
}
.vw-poll-bar::before {
    content: ''; position: absolute; inset: 0;
    width: var(--pct, 0%);
    background: linear-gradient(90deg, rgba(167,139,250,0.32), rgba(34,211,238,0.22));
    transition: width .4s ease;
    z-index: 0;
}
.vw-poll-results li.is-mine .vw-poll-bar { outline: 1.5px solid var(--violet); }
.vw-poll-label, .vw-poll-count { position: relative; z-index: 1; }
.vw-poll-label  { font-weight: 500; }
.vw-poll-count  { font-family: 'JetBrains Mono', monospace; color: var(--muted); }
.vw-poll-foot {
    margin-top: 10px; display: flex; gap: 12px; align-items: center;
    font-size: 0.78rem; color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
}
.vw-btn-sm { padding: 5px 14px; font-size: 0.82rem; }

/* Comment thread */
.vw-comment {
    border-left: 2px solid var(--border);
    padding: 10px 0 10px 14px;
    margin-top: 10px;
}
.vw-comment.is-deleted { opacity: 0.5; }
.vw-comment-head {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.86rem; margin-bottom: 4px;
}
.vw-comment-avatar {
    width: 26px; height: 26px; border-radius: 6px;
    background: rgba(255,255,255,0.05); padding: 2px; flex: 0 0 26px;
}
.vw-comment-name { font-weight: 600; color: var(--text); text-decoration: none; }
.vw-comment-name:hover { color: var(--violet); }
.vw-comment-handle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem; color: var(--muted);
}
.vw-comment-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem; color: var(--muted); margin-left: auto;
}
.vw-comment-body {
    font-size: 0.93rem; line-height: 1.55; color: var(--text);
    white-space: pre-wrap; word-wrap: break-word;
}
.vw-comment-actions {
    margin-top: 6px; display: flex; gap: 12px;
    font-size: 0.78rem; color: var(--muted);
}
.vw-comment-actions a, .vw-comment-actions button {
    color: var(--muted); background: transparent; border: 0; padding: 0;
    cursor: pointer; font-family: inherit; font-size: inherit;
    text-decoration: none;
}
.vw-comment-actions a:hover, .vw-comment-actions button:hover { color: var(--violet); }
.vw-comment-children { margin-left: 8px; }

/* Report modal + toast */
.vw-modal {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(15, 12, 41, 0.74);
    backdrop-filter: blur(6px);
    display: grid; place-items: center; padding: 20px;
}
.vw-modal[hidden] { display: none; }
.vw-modal-card {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 16px; padding: 22px 24px;
    width: 100%; max-width: 460px;
    position: relative;
}
.vw-modal-close {
    position: absolute; top: 10px; right: 14px;
    background: transparent; border: 0; color: var(--muted);
    font-size: 1.6rem; cursor: pointer; line-height: 1;
}
.vw-modal-close:hover { color: var(--magenta); }
.vw-toast {
    position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
    background: var(--panel); border: 1px solid var(--violet);
    color: var(--text); padding: 10px 18px; border-radius: 999px;
    font-size: 0.9rem; z-index: 300;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    animation: vw-toast-in .25s ease;
}
.vw-toast-err { border-color: var(--magenta); color: var(--magenta); }
.vw-toast-out { animation: vw-toast-out .35s ease forwards; }
@keyframes vw-toast-in  { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes vw-toast-out { to { opacity: 0; transform: translate(-50%, 16px); } }

/* =========================================================================
   DIRECT MESSAGES (Phase 4c)
   List + thread + composer + voice recorder.
   ========================================================================= */

/* ---- Conversation list ---- */
.vw-conv-list { display: grid; gap: 8px; }
.vw-conv {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: 14px;
    background: var(--panel); border: 1px solid var(--border);
    text-decoration: none; color: var(--text);
    transition: border-color .15s ease, transform .12s ease, background .2s ease;
}
.vw-conv:hover { border-color: var(--violet); background: rgba(167,139,250,0.05); }
.vw-conv.has-unread { border-color: rgba(34, 211, 238, 0.45); }
.vw-conv-avatar {
    width: 44px; height: 44px; flex: 0 0 44px;
    border-radius: 12px; background: rgba(255,255,255,0.05); padding: 4px;
    object-fit: cover;
}
.vw-conv-avatar.lg { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 14px; }
.vw-conv-body { flex: 1; min-width: 0; }
.vw-conv-head {
    display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
    font-size: 0.94rem;
}
.vw-conv-name { font-weight: 600; color: var(--text); }
.vw-conv-handle { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; color: var(--muted); }
.vw-conv-time { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; color: var(--muted); margin-left: auto; }
.vw-conv-muted { font-size: 0.86rem; }
.vw-conv-preview {
    font-size: 0.86rem; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-top: 2px;
}
.vw-conv.has-unread .vw-conv-preview { color: var(--text); font-weight: 500; }
.vw-conv-unread {
    flex: 0 0 auto;
    min-width: 24px; height: 24px;
    padding: 0 8px; border-radius: 999px;
    background: linear-gradient(135deg, var(--violet), var(--cyan));
    color: #0f0c29; font-weight: 700; font-size: 0.82rem;
    display: grid; place-items: center;
}

/* ---- Thread header ---- */
.vw-conv-head-card {
    display: flex; gap: 14px; align-items: center;
    padding: 14px 18px; margin-bottom: 12px;
    flex-wrap: wrap;
}

/* ---- Thread (message list) ---- */
.vw-thread {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 14px; padding: 14px;
    height: 56vh; min-height: 360px; max-height: 700px;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 10px;
    scroll-behavior: smooth;
}
.vw-thread-empty {
    display: grid; place-items: center;
    flex: 1; min-height: 100px;
}
.vw-msg {
    display: flex; gap: 8px; align-items: flex-end;
    max-width: 88%;
}
.vw-msg.theirs { align-self: flex-start; }
.vw-msg.mine   { align-self: flex-end; flex-direction: row-reverse; }
.vw-msg-avatar {
    width: 28px; height: 28px; flex: 0 0 28px;
    border-radius: 8px; background: rgba(255,255,255,0.05); padding: 2px;
}
.vw-msg-bubble {
    padding: 9px 14px; border-radius: 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    line-height: 1.5; font-size: 0.94rem;
    word-wrap: break-word;
    position: relative;
}
.vw-msg.mine .vw-msg-bubble {
    background: linear-gradient(135deg, rgba(167,139,250,0.18), rgba(34,211,238,0.12));
    border-color: rgba(167,139,250,0.32);
}
.vw-msg-body { white-space: pre-wrap; }
.vw-msg-time {
    display: block; margin-top: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.66rem; color: var(--muted); letter-spacing: 0.04em;
}
.vw-msg.is-deleted .vw-msg-bubble { opacity: 0.55; }
.vw-msg-dur {
    display: inline-block; margin-left: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem; color: var(--muted);
    vertical-align: middle;
}

/* ---- Composer ---- */
.vw-composer {
    margin-top: 12px;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 14px; padding: 10px 12px;
    display: grid; gap: 8px;
}
.vw-composer-text textarea {
    width: 100%; resize: none;
    background: transparent; color: var(--text);
    border: 0; outline: 0; padding: 6px 4px;
    font-family: inherit; font-size: 0.95rem; line-height: 1.5;
    min-height: 36px; max-height: 200px;
}
.vw-composer-text textarea:focus { outline: 0; }
.vw-composer-actions {
    display: flex; gap: 8px; justify-content: flex-end;
    border-top: 1px solid var(--border); padding-top: 8px;
}

/* ---- Voice recorder ---- */
.vw-recorder {
    border-top: 1px solid var(--border);
    padding-top: 10px;
}
.vw-rec-status {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.88rem; margin-bottom: 8px;
    color: var(--muted);
}
.vw-rec-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    transition: background .2s ease;
}
.vw-rec-status.is-recording .vw-rec-dot {
    background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    animation: vw-rec-pulse 1.2s ease-out infinite;
}
@keyframes vw-rec-pulse {
    0%   { box-shadow: 0 0 0 0  rgba(239, 68, 68, 0.6); }
    100% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0);   }
}
.vw-rec-controls { display: flex; gap: 8px; flex-wrap: wrap; }

/* Mobile: shrink thread height a bit so the composer is comfortably reachable */
@media (max-width: 720px) {
    .vw-thread { height: 50vh; padding: 10px; }
    .vw-conv-head-card { padding: 10px 12px; gap: 10px; }
}

/* =========================================================================
   PUBLIC CHAT (Phase 4d)
   Rooms grid + per-room thread (smaller, denser than DMs).
   ========================================================================= */

/* ---- Rooms grid ---- */
.vw-room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.vw-room {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    transition: border-color .15s ease, transform .12s ease;
}
.vw-room:hover { transform: translateY(-2px); border-color: var(--violet); }
.vw-room.is-locked { opacity: 0.65; }
.vw-room.is-locked:hover { transform: none; border-color: var(--border); }
.vw-room-kind {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem; letter-spacing: 0.16em;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}
.vw-room.kind-vip   .vw-room-kind { color: var(--gold); }
.vw-room.kind-staff .vw-room-kind { color: var(--cyan); }
.vw-room.kind-admin .vw-room-kind { color: var(--magenta); }
.vw-room-title {
    font-size: 1.25rem; font-weight: 700;
    margin: 2px 0 6px;
}
.vw-room-desc {
    color: var(--muted); font-size: 0.9rem; line-height: 1.5;
    margin: 0 0 14px;
}
.vw-room-lock {
    color: var(--muted); font-size: 0.86rem;
    padding: 8px 10px; border-radius: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px dashed var(--border);
}
.vw-room-slow {
    margin-top: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem; color: var(--muted);
}
.vw-room-kind-badge {
    padding: 2px 8px; border-radius: 999px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem; letter-spacing: 0.14em;
    background: rgba(167,139,250,0.12); color: var(--violet);
}
.vw-room-kind-badge.kind-vip   { background: rgba(250,204,21,0.14);  color: var(--gold); }
.vw-room-kind-badge.kind-staff { background: rgba(34,211,238,0.14);  color: var(--cyan); }
.vw-room-kind-badge.kind-admin { background: rgba(232,121,249,0.14); color: var(--magenta); }

/* ---- Single room header card ---- */
.vw-room-head {
    display: flex; gap: 14px; align-items: center;
    padding: 14px 18px; margin-bottom: 12px;
    flex-wrap: wrap;
}

/* ---- Chat thread (denser than DMs since names are repeated) ---- */
.vw-chat-thread { gap: 4px !important; padding: 14px 16px !important; }

.vw-cmsg {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 4px 0;
    line-height: 1.45;
}
.vw-cmsg-avatar {
    width: 30px; height: 30px; flex: 0 0 30px;
    border-radius: 8px; padding: 2px;
    background: rgba(255,255,255,0.05);
    margin-top: 2px;
}
.vw-cmsg-body { flex: 1; min-width: 0; }
.vw-cmsg-head {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.86rem;
    flex-wrap: wrap;
}
.vw-cmsg-name { color: var(--text); font-weight: 600; text-decoration: none; }
.vw-cmsg-name:hover { color: var(--violet); }
.vw-cmsg-time {
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem; color: var(--muted);
}
.vw-cmsg-text {
    margin-top: 2px;
    font-size: 0.93rem;
    color: var(--text);
    white-space: pre-wrap;
    word-wrap: break-word;
}
.vw-cmsg.is-deleted .vw-cmsg-text { opacity: 0.55; }
.vw-cmsg-del-form { display: inline-block; margin-left: 4px; }
.vw-cmsg-del-form button {
    background: transparent; border: 0;
    color: var(--muted); font-size: 1.1rem; line-height: 1;
    cursor: pointer; padding: 0 4px;
}
.vw-cmsg-del-form button:hover { color: var(--magenta); }

/* On hover, lift the message slightly */
.vw-cmsg:hover { background: rgba(255,255,255,0.02); border-radius: 6px; }

/* When you sent it, subtle accent on the name */
.vw-cmsg.mine .vw-cmsg-name { color: var(--violet); }

/* =========================================================================
   BADGE ANIMATIONS — display-time wrappers (Phase: Badge Suite)
   The badge SVG is static; animations live here so they can change globally
   and travel with the badge wherever it's rendered (admin grid, profile,
   award rows, future leaderboards, etc.).
   ========================================================================= */
.vw-badge-anim-host {
    display: inline-block;
    line-height: 0;        /* prevents <img> baseline gap inside the wrapper */
    transform-origin: center center;
}
.vw-badge-anim-host > img,
.vw-badge-anim-host > svg { display: block; }

/* Pulse — gentle scale up & down */
.vw-badge-anim-pulse        { animation: vw-bdg-pulse 2.4s ease-in-out infinite; }
@keyframes vw-bdg-pulse {
    0%, 100% { transform: scale(1);    }
    50%      { transform: scale(1.06); }
}

/* Glow — soft drop-shadow that breathes through the brand colors */
.vw-badge-anim-glow         { animation: vw-bdg-glow 3s ease-in-out infinite; }
@keyframes vw-bdg-glow {
    0%, 100% { filter: drop-shadow(0 0 4px  rgba(167,139,250,.35)) drop-shadow(0 0 8px rgba(34,211,238,.20)); }
    50%      { filter: drop-shadow(0 0 10px rgba(167,139,250,.75)) drop-shadow(0 0 18px rgba(34,211,238,.45)); }
}

/* Float — gentle Y bob */
.vw-badge-anim-float        { animation: vw-bdg-float 3.4s ease-in-out infinite; }
@keyframes vw-bdg-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
}

/* Shimmer — diagonal shine sweep, drawn via a layered gradient */
.vw-badge-anim-shimmer      { position: relative; overflow: hidden; }
.vw-badge-anim-shimmer::after {
    content: '';
    position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(115deg,
        transparent 30%,
        rgba(255,255,255,0.55) 50%,
        transparent 70%);
    transform: translateX(-100%);
    animation: vw-bdg-shimmer 2.6s linear infinite;
    mix-blend-mode: overlay;
    border-radius: inherit;
}
@keyframes vw-bdg-shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(120%);  }
}

/* Spin — slow rotation (3 RPM-ish) */
.vw-badge-anim-spin         { animation: vw-bdg-spin 14s linear infinite; }
@keyframes vw-bdg-spin {
    0%   { transform: rotate(0deg);   }
    100% { transform: rotate(360deg); }
}

/* Respect reduced motion — kill all badge animations */
@media (prefers-reduced-motion: reduce) {
    .vw-badge-anim-pulse, .vw-badge-anim-glow, .vw-badge-anim-float, .vw-badge-anim-spin { animation: none !important; }
    .vw-badge-anim-shimmer::after { animation: none !important; opacity: 0; }
}

/* =========================================================================
   ADMIN BADGE SUITE — tabs + generator UI
   ========================================================================= */

/* Tabs */
.vw-tabs {
    display: flex; gap: 4px;
    border-bottom: 1px solid var(--border);
    margin: 6px 0 14px;
}
.vw-tab {
    background: transparent; border: 0;
    color: var(--muted); cursor: pointer;
    padding: 10px 16px;
    font-family: inherit; font-size: 0.92rem; font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}
.vw-tab:hover { color: var(--text); }
.vw-tab.is-on {
    color: var(--violet);
    border-bottom-color: var(--violet);
}
.vw-tab-pane[hidden] { display: none; }

/* Generator layout — left: pickers, right: live preview */
.vw-bgen {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 18px;
    margin-top: 8px;
}
@media (max-width: 860px) {
    .vw-bgen { grid-template-columns: 1fr; }
}
.vw-bgen-pickers { display: grid; gap: 14px; }
.vw-bgen-section h4 {
    margin: 0 0 8px;
    font-size: 0.84rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-family: 'JetBrains Mono', monospace;
}
.vw-bgen-section h4 small {
    font-family: inherit;
    color: rgba(255,255,255,0.4);
    font-weight: 500;
    margin-left: 4px;
    text-transform: none;
    letter-spacing: 0;
}

/* Tile grids (frames + icons) */
.vw-bgen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 6px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px;
}
.vw-bgen-icons {
    max-height: 220px;
    overflow-y: auto;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
}
.vw-bgen-tile {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    padding: 6px;
    color: var(--text);
    display: grid; place-items: center;
    transition: all .15s ease;
    aspect-ratio: 1;
}
.vw-bgen-tile:hover {
    background: rgba(167,139,250,0.12);
    border-color: var(--violet);
    transform: translateY(-1px);
}
.vw-bgen-tile.is-on {
    background: rgba(167,139,250,0.22);
    border-color: var(--violet);
    box-shadow: 0 0 0 2px rgba(167,139,250,0.35);
}

/* Mode tabs (icon / monogram) */
.vw-bgen-mode-tabs {
    display: flex; gap: 4px;
    margin-bottom: 8px;
}
.vw-bgen-mode {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 6px 14px;
    font-family: inherit; font-size: 0.84rem; font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s ease;
}
.vw-bgen-mode:hover { color: var(--text); border-color: var(--violet); }
.vw-bgen-mode.is-on {
    background: rgba(167,139,250,0.18);
    color: var(--violet);
    border-color: var(--violet);
}

/* Monogram picker */
.vw-bgen-monogram {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    display: grid; gap: 10px;
}
.vw-bgen-mono-text {
    font-size: 1.4rem;
    text-align: center;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.08em;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: 8px 12px;
}
.vw-bgen-mono-styles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}
.vw-bgen-mono-style {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    padding: 8px;
    color: var(--text);
    text-align: center;
    transition: all .15s ease;
    display: grid; gap: 2px;
}
.vw-bgen-mono-style small {
    font-size: 0.7rem; color: var(--muted);
}
.vw-bgen-mono-style:hover {
    background: rgba(167,139,250,0.1);
    border-color: var(--violet);
}
.vw-bgen-mono-style.is-on {
    background: rgba(167,139,250,0.22);
    border-color: var(--violet);
}

/* Color pickers */
.vw-bgen-colors {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.vw-bgen-colors label {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.84rem;
}
.vw-bgen-colors label span { color: var(--muted); flex: 1; }
.vw-bgen-colors input[type="color"] {
    width: 36px; height: 24px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
}

/* Animation select */
.vw-bgen-anim {
    width: 100%;
    padding: 8px 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.92rem;
}

/* Preview stage */
.vw-bgen-preview-wrap {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    position: sticky;
    top: 16px;
    align-self: start;
}
.vw-bgen-preview-wrap h4 {
    margin: 0 0 12px;
    font-size: 0.84rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-family: 'JetBrains Mono', monospace;
    text-align: center;
}
.vw-bgen-preview-stage {
    display: grid; place-items: center;
    background:
        linear-gradient(135deg, rgba(167,139,250,0.06), rgba(34,211,238,0.04)),
        repeating-conic-gradient(rgba(255,255,255,0.02) 0% 25%, transparent 0% 50%) 0 0/16px 16px;
    border-radius: 10px;
    padding: 24px;
    min-height: 200px;
}
.vw-bgen-preview {
    width: 144px; height: 144px;
    display: grid; place-items: center;
}
.vw-bgen-preview svg {
    width: 100%; height: 100%; max-width: 144px; max-height: 144px;
    filter: drop-shadow(0 6px 18px rgba(0,0,0,0.4));
}

/* =========================================================================
   POST OWNER CONTROLS — pin/unpin · visibility · delete
   Disclosure-style menu: small "⋯ Manage" pill that expands a popover.
   ========================================================================= */
.vw-post-owner { position: relative; display: inline-block; }
.vw-post-owner-menu summary {
    list-style: none;
    cursor: pointer;
}
.vw-post-owner-menu summary::-webkit-details-marker { display: none; }
.vw-post-owner-menu[open] summary {
    background: rgba(167,139,250,0.18);
    border-color: var(--violet);
    color: var(--violet);
}
.vw-post-owner-pop {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    z-index: 20;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    min-width: 220px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.45);
    display: grid;
    gap: 8px;
}
.vw-post-owner-pop form { margin: 0; }
.vw-post-owner-pop button[type="submit"] {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 7px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.86rem;
    text-align: left;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.vw-post-owner-pop button[type="submit"]:hover {
    background: rgba(167,139,250,0.1);
    border-color: var(--violet);
    color: var(--violet);
}
.vw-post-owner-pop button.vw-post-owner-del:hover {
    background: rgba(232,121,249,0.12);
    border-color: var(--magenta);
    color: var(--magenta);
}
.vw-post-owner-vis {
    display: grid;
    gap: 4px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
}
.vw-post-owner-vis label {
    font-size: 0.72rem;
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding-left: 4px;
}
.vw-post-owner-vis select {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 8px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.86rem;
}

/* Visibility chip colors so the redefined labels read clearly */
.vw-post-vis.vis-public    { background: rgba(34,197,94,0.14);  color: #4ade80; }
.vw-post-vis.vis-followers { background: rgba(34,211,238,0.14); color: var(--cyan); }
.vw-post-vis.vis-private   { background: rgba(250,204,21,0.14); color: var(--gold); }

/* =========================================================================
   ONLINE: # pill (nav) + modal (M5, 2026-04-30)
   ========================================================================= */
.vw-online-pill {
    background: rgba(34, 211, 238, 0.10);
    border: 1px solid rgba(34, 211, 238, 0.32);
    color: var(--cyan);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    padding: 5px 12px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 14px 0 4px;
    transition: background .15s ease, border-color .15s ease, transform .12s ease;
    flex-shrink: 0;
}
.vw-online-pill:hover {
    background: rgba(34, 211, 238, 0.18);
    border-color: var(--cyan);
    transform: translateY(-1px);
}
.vw-online-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    animation: vw-online-dot-pulse 2s ease-out infinite;
}
@keyframes vw-online-dot-pulse {
    0%   { box-shadow: 0 0 0 0  rgba(34, 197, 94, 0.6); }
    100% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); }
}

/* Online modal — uses .vw-modal base from earlier; adds list-specific bits */
.vw-online-card { max-width: 420px; }
.vw-online-title {
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.12em;
    background: linear-gradient(90deg, var(--cyan), var(--violet));
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
}
.vw-online-list {
    max-height: 420px;
    overflow-y: auto;
    border-top: 1px solid var(--border);
    padding-top: 8px;
    display: grid;
    gap: 4px;
}
.vw-online-list::-webkit-scrollbar { width: 8px; }
.vw-online-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.vw-online-list::-webkit-scrollbar-thumb:hover { background: var(--violet); }

.vw-online-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 8px;
    text-decoration: none; color: var(--text);
    transition: background .12s ease, transform .12s ease;
}
.vw-online-row.is-friend {
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.08), rgba(167, 139, 250, 0.05));
    border: 1px solid rgba(34, 211, 238, 0.24);
}
.vw-online-row.is-friend:hover {
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.18), rgba(167, 139, 250, 0.12));
    transform: translateX(2px);
}
.vw-online-row.is-self {
    background: rgba(167, 139, 250, 0.06);
    border: 1px dashed rgba(167, 139, 250, 0.24);
}
.vw-online-avatar {
    width: 32px; height: 32px; flex: 0 0 32px;
    border-radius: 8px; background: rgba(255,255,255,0.05); padding: 3px;
    object-fit: cover;
}
.vw-online-avatar-blank {
    background: rgba(255,255,255,0.06);
    display: inline-block;
}
.vw-online-meta {
    flex: 1; min-width: 0;
    display: grid; gap: 2px;
}
.vw-online-meta strong {
    font-weight: 600; font-size: 0.92rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vw-online-meta small {
    font-size: 0.74rem;
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
}

/* =========================================================================
   FRIEND CHIP (used on /u/<handle>) and SHARED USER LIST (social settings)
   ========================================================================= */
.vw-friend-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 999px;
    background: rgba(167, 139, 250, 0.12);
    border: 1px solid var(--violet);
    color: var(--violet);
    font-size: 0.85rem; font-weight: 600;
}
.vw-user-list {
    list-style: none; padding: 0; margin: 0;
    display: grid; gap: 6px;
}
.vw-user-list li {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
}
.vw-user-row {
    display: flex; align-items: center; gap: 10px;
    flex: 1; min-width: 0;
    text-decoration: none; color: var(--text);
}
.vw-user-row img {
    width: 36px; height: 36px; flex: 0 0 36px;
    border-radius: 8px; background: rgba(255,255,255,0.05); padding: 3px;
    object-fit: cover;
}
.vw-user-row-avatar-blank {
    width: 36px; height: 36px; flex: 0 0 36px;
    border-radius: 8px; background: rgba(255,255,255,0.06);
    display: inline-block;
}
.vw-user-row-meta {
    flex: 1; min-width: 0;
    display: grid; gap: 2px;
}
.vw-user-row-meta strong { font-weight: 600; }
.vw-user-row-meta small { color: var(--muted); font-family: 'JetBrains Mono', monospace; font-size: 0.74rem; }
.vw-user-row-actions {
    display: flex; gap: 6px; flex-wrap: wrap;
}
.vw-user-row-actions form { margin: 0; display: inline; }

/* Pending friend requests panel on /dashboard/ */
.vw-friend-pending {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.06), rgba(167, 139, 250, 0.04));
    border-color: rgba(34, 211, 238, 0.32);
}

/* Soft-danger button variant for inline Block buttons in search results */
.vw-btn.vw-btn-danger-soft {
    border-color: rgba(232, 121, 249, 0.32);
    color: var(--magenta);
}
.vw-btn.vw-btn-danger-soft:hover {
    background: rgba(232, 121, 249, 0.10);
    border-color: var(--magenta);
}

/* =========================================================================
   VIBEBOARD (Phase: VB, 2026-04-30)
   Public blog layout + warning system + news tag.
   ========================================================================= */

/* Listing page: main column + right sidebar */
.vw-board-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
}
@media (max-width: 960px) {
    .vw-board-layout { grid-template-columns: 1fr; }
}
.vw-board-main { min-width: 0; }
.vw-board-sidebar {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    align-self: start;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}
.vw-board-list {
    list-style: none; padding: 0; margin: 0;
    display: grid; gap: 6px;
}
.vw-board-list li {
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
}
.vw-board-list li:last-child { border-bottom: 0; }
.vw-board-list a {
    display: block;
    padding: 6px 8px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    transition: background .12s ease;
}
.vw-board-list a:hover {
    background: rgba(167, 139, 250, 0.08);
}
.vw-board-list-title {
    display: block;
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.35;
    margin-bottom: 2px;
    /* Truncate to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.vw-board-list-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--muted);
}
.vw-board-list li.is-warned a {
    border-left: 3px solid var(--magenta);
    padding-left: 5px;
    background: rgba(248, 113, 113, 0.04);
}

/* Board post — title (only when board='vibeboard' AND title set) */
.vw-post-title {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 4px 0 8px;
}
.vw-post-title a {
    color: var(--text);
    text-decoration: none;
}
.vw-post-title a:hover {
    color: var(--violet);
}

/* News tag */
.vw-news-tag {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    background: linear-gradient(90deg, var(--gold), var(--magenta));
    color: #0f0c29;
    padding: 3px 10px;
    border-radius: 999px;
    vertical-align: middle;
    margin-right: 8px;
    font-weight: 700;
}
.vw-post.is-news {
    border-color: rgba(250, 204, 21, 0.32);
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.04), rgba(232, 121, 249, 0.03)),
                var(--panel);
}

/* Warning system — red outline + banner */
.vw-post.is-warned {
    border: 2px solid var(--magenta) !important;
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.3), 0 0 24px rgba(248, 113, 113, 0.18);
}
.vw-warn-banner {
    margin: 0 0 10px;
    padding: 10px 14px;
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.32);
    border-radius: 10px;
    font-size: 0.88rem;
}
.vw-warn-banner-label {
    color: var(--magenta);
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    margin-right: 8px;
}
.vw-warn-details summary {
    cursor: pointer;
    color: var(--magenta);
    font-weight: 600;
    font-size: 0.84rem;
    list-style: none;
}
.vw-warn-details summary::-webkit-details-marker { display: none; }
.vw-warn-details[open] summary { margin-bottom: 6px; }
.vw-warn-note {
    margin: 6px 0;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.18);
    border-radius: 6px;
    color: var(--text);
    line-height: 1.5;
    white-space: pre-wrap;
}
.vw-warn-details small { color: var(--muted); font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; }

/* ============================================================
   Notification bell — top-nav button + dropdown
   ============================================================ */
.vw-bell-wrap { position: relative; }
.vw-bell {
    background: transparent; border: 1px solid var(--border); color: var(--text);
    width: 36px; height: 36px; border-radius: 10px; cursor: pointer; padding: 0;
    font-size: 18px; line-height: 1; position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.vw-bell:hover { background: rgba(255,255,255,0.05); border-color: var(--violet); }
.vw-bell-badge {
    position: absolute; top: -5px; right: -5px;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 10px;
    background: #ef4444; color: #fff;
    font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    line-height: 1; box-shadow: 0 0 0 2px rgba(15,12,41,1);
}
/* Force [hidden] to actually hide — display:inline-flex above otherwise wins */
.vw-bell-badge[hidden],
.vw-bell-badge.vw-bell-badge-hidden { display: none !important; }
.vw-bell-pop[hidden]                { display: none !important; }
.vw-bell-pop {
    position: absolute; top: calc(100% + 6px); right: 0;
    width: 360px; max-width: 92vw;
    background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.4);
    z-index: 1000; overflow: hidden;
}
.vw-bell-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 14px; border-bottom: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace; font-size: 0.78rem;
    letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.vw-bell-list { max-height: 60vh; overflow-y: auto; }
.vw-bell-list .vw-bell-row {
    display: block; padding: 10px 14px; border-bottom: 1px solid var(--border);
    text-decoration: none; color: var(--text);
    transition: background 0.12s ease;
}
.vw-bell-list .vw-bell-row:last-child { border-bottom: 0; }
.vw-bell-list .vw-bell-row:hover { background: rgba(255,255,255,0.03); }
.vw-bell-list .vw-bell-row.is-unread { background: rgba(167,139,250,0.06); }
.vw-bell-list .vw-bell-row.is-unread::before {
    content: ""; display: inline-block; width: 6px; height: 6px;
    border-radius: 50%; background: var(--violet);
    margin-right: 8px; vertical-align: middle;
}
.vw-bell-row .vw-bell-title { font-weight: 600; font-size: 0.9rem; }
.vw-bell-row .vw-bell-body { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }
.vw-bell-row .vw-bell-when { color: var(--muted); font-size: 0.74rem; font-family: 'JetBrains Mono', monospace; margin-top: 4px; }
.vw-bell-empty { padding: 24px 14px; text-align: center; color: var(--muted); font-size: 0.88rem; }

/* ============================================================
   Notification bell — dismiss + footer (added 2026-05-08)
   ============================================================ */
.vw-bell-list .vw-bell-row {
    position: relative;
    display: flex;
    align-items: stretch;
    padding: 0;                          /* link/dismiss children pad themselves */
}
.vw-bell-list .vw-bell-row .vw-bell-row-link {
    flex: 1; min-width: 0;
    padding: 10px 14px;
    display: block;
    text-decoration: none;
    color: var(--text);
}
.vw-bell-list .vw-bell-row .vw-bell-row-link:hover { color: var(--text); }
.vw-bell-list .vw-bell-row .vw-bell-dismiss {
    background: transparent;
    border: 0;
    color: rgba(255,255,255,0.4);
    font-size: 18px;
    line-height: 1;
    width: 32px; min-width: 32px;
    cursor: pointer;
    transition: color 0.12s ease, background 0.12s ease;
}
.vw-bell-list .vw-bell-row .vw-bell-dismiss:hover {
    color: #fca5a5;
    background: rgba(248, 113, 113, 0.08);
}
.vw-bell-foot {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px; border-top: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace; font-size: 0.74rem;
    background: rgba(0,0,0,0.18);
}
.vw-bell-foot-link { color: var(--violet); text-decoration: none; }
.vw-bell-foot-link:hover { text-decoration: underline; }
.vw-bell-foot-link.vw-bell-clear { color: #fca5a5; }
