:root {
    --bg: #0b0f14;
    --panel: #10161d;
    --panel-2: #141b23;
    --line: #212b35;
    --text: #e7edf3;
    --muted: #7c8a99;
    --accent: #35d9c4;
    --accent-dim: #1c8f81;
    --warm: #ff6b4a;
    --danger: #ff6b6b;
    --radius: 10px;
    --font-display: "Space Grotesk", sans-serif;
    --font-body: "Inter", sans-serif;
    --font-mono: "JetBrains Mono", monospace;
}

[data-theme="light"] {
    --bg: #f5f7fa;
    --panel: #ffffff;
    --panel-2: #eef2f6;
    --line: #dde4ea;
    --text: #101820;
    --muted: #5b6b7a;
    --accent: #0d9488;
    --accent-dim: #0f766e;
    --warm: #d9480f;
    --danger: #d64545;
}

.theme-toggle {
    position: fixed; top: 14px; right: 14px; z-index: 50;
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--panel-2); border: 1px solid var(--line);
    font-size: 15px; display: flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { border-color: var(--accent); }

* { box-sizing: border-box; }

.hidden { display: none !important; }

html, body {
    height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

body {
    background-image:
        radial-gradient(circle at 15% 10%, rgba(53, 217, 196, 0.06), transparent 40%),
        radial-gradient(circle at 85% 90%, rgba(255, 107, 74, 0.05), transparent 40%);
}

a { color: var(--accent); }

button { font-family: inherit; cursor: pointer; }

input, select {
    font-family: var(--font-body);
    background: var(--panel-2);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 8px;
    padding: 11px 12px;
    font-size: 14px;
    outline: none;
    transition: border-color .15s ease;
}

input:focus, select:focus, button:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(53, 217, 196, 0.15);
}

/* ---------- signal-bar mark (signature element) ---------- */
.brand-mark, .gate-mark {
    display: inline-flex;
    align-items: flex-end;
    gap: 3px;
    height: 16px;
}
.brand-mark span, .gate-mark span {
    display: block;
    width: 4px;
    background: var(--accent);
    border-radius: 2px;
    animation: pulse 1.6s ease-in-out infinite;
}
.brand-mark span:nth-child(1), .gate-mark span:nth-child(1) { height: 6px;  animation-delay: 0s; }
.brand-mark span:nth-child(2), .gate-mark span:nth-child(2) { height: 12px; animation-delay: .15s; }
.brand-mark span:nth-child(3), .gate-mark span:nth-child(3) { height: 16px; animation-delay: .3s; }
.brand-mark span:nth-child(4), .gate-mark span:nth-child(4) { height: 9px;  animation-delay: .45s; }
.gate-mark span { width: 6px; }
.gate-mark { height: 24px; margin-bottom: 20px; }

@keyframes pulse {
    0%, 100% { opacity: .45; transform: scaleY(.7); }
    50%      { opacity: 1;   transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
    .brand-mark span, .gate-mark span, .presence-dot { animation: none !important; }
}

/* ---------- entry gate ---------- */
.gate {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 32px 20px;
}

.gate-panel {
    width: 100%;
    max-width: 420px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 36px 32px 28px;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .12em;
    color: var(--accent);
    margin: 0 0 14px;
}

.gate h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 30px;
    line-height: 1.15;
    margin: 0 0 12px;
}

.lede {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
    margin: 0 0 26px;
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field label { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.error { font-size: 12px; color: var(--danger); min-height: 14px; }
.form-errors { color: var(--danger); font-size: 13px; padding-left: 18px; margin: 0 0 14px; }

.btn-primary {
    width: 100%;
    background: var(--accent);
    color: #06110f;
    border: none;
    border-radius: 8px;
    padding: 13px;
    font-weight: 600;
    font-size: 14px;
    transition: transform .1s ease, background .15s ease;
}
.btn-primary:hover:not(:disabled) { background: #4fe8d4; }
.btn-primary:active:not(:disabled) { transform: scale(.98); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }

.fineprint {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    margin: 14px 0 0;
}

/* ---------- chat app layout ---------- */
.app {
    height: 100%;
    display: grid;
    grid-template-columns: 240px 1fr 220px;
    grid-template-rows: 100%;
}

@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    .rail, .presence { display: none; }
}

.rail, .presence {
    background: var(--panel);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.presence { border-right: none; border-left: 1px solid var(--line); }

.rail-top { padding: 18px 16px; border-bottom: 1px solid var(--line); }
.brand {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-display); font-weight: 700; font-size: 16px;
}
.me { margin-top: 14px; display: flex; flex-direction: column; gap: 2px; }
.me-name { font-weight: 600; font-size: 14px; }
.me-tag { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

.rail-section { padding: 14px 16px; }
.rail-section-head {
    display: flex; align-items: center; justify-content: space-between;
    font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em;
    color: var(--muted); text-transform: uppercase; margin-bottom: 10px;
}
.icon-btn {
    background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
    width: 22px; height: 22px; border-radius: 6px; font-size: 14px; line-height: 1;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

.room-list, .user-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.room-list li, .user-list li {
    padding: 8px 10px; border-radius: 8px; font-size: 13px; cursor: default;
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.room-list li { cursor: pointer; color: var(--muted); }
.room-list li:hover { background: var(--panel-2); color: var(--text); }
.room-list li.active { background: rgba(53, 217, 196, .12); color: var(--accent); font-weight: 600; }
.room-list li .hash { font-family: var(--font-mono); opacity: .6; margin-right: 4px; }

.new-room-form { padding: 0 16px 16px; display: flex; gap: 6px; }
.new-room-form.hidden { display: none; }
.new-room-form input { flex: 1; padding: 8px 10px; font-size: 13px; }
.btn-small {
    background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
    border-radius: 6px; padding: 8px 12px; font-size: 12px; white-space: nowrap;
}
.btn-small:hover { border-color: var(--accent); color: var(--accent); }

.user-list li { flex-direction: column; align-items: flex-start; gap: 2px; }
.user-tile { width: 100%; display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border-radius: 8px; }
.user-tile:hover { background: var(--panel-2); cursor: pointer; }
.user-name { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.presence-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1.8s ease-in-out infinite; flex-shrink: 0; }
.user-meta { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

/* ---------- main room ---------- */
.room { display: flex; flex-direction: column; min-width: 0; }
.room-header {
    padding: 16px 24px; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
}
.room-header h1 { font-family: var(--font-display); font-size: 18px; margin: 0; }
.status { font-family: var(--font-mono); font-size: 11px; padding: 4px 10px; border-radius: 20px; }
.status-connecting { color: var(--muted); background: var(--panel-2); }
.status-connected { color: var(--accent); background: rgba(53,217,196,.12); }
.status-error { color: var(--danger); background: rgba(255,107,107,.12); }

.messages { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 10px; }

.msg { display: flex; gap: 10px; max-width: 640px; }
.msg-avatar {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    background: var(--panel-2); border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-size: 16px; color: var(--accent);
}
.msg-body { display: flex; flex-direction: column; gap: 2px; }
.msg-head { display: flex; align-items: baseline; gap: 8px; }
.msg-name { font-weight: 600; font-size: 13px; }
.msg-tag { font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.msg-time { font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.msg-text { font-size: 14px; line-height: 1.5; word-wrap: break-word; }

.msg.system { color: var(--muted); font-size: 12px; font-family: var(--font-mono); max-width: none; padding-left: 40px; }
.msg.error { color: var(--danger); font-size: 12px; font-family: var(--font-mono); padding-left: 40px; }

.composer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); }
.composer input { flex: 1; padding: 12px 14px; }
.composer .btn-primary { width: auto; padding: 12px 22px; }

/* ---------- private message dock ---------- */
.dm-dock {
    position: fixed; bottom: 0; right: 232px; display: flex; gap: 10px;
    align-items: flex-end; z-index: 20;
}
@media (max-width: 900px) { .dm-dock { right: 12px; } }

.dm-window {
    width: 260px; background: var(--panel); border: 1px solid var(--line);
    border-bottom: none; border-radius: 10px 10px 0 0; display: flex; flex-direction: column;
    box-shadow: 0 -8px 24px rgba(0,0,0,.35);
}
.dm-window-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; border-bottom: 1px solid var(--line);
    font-size: 13px; font-weight: 600; color: var(--warm);
}
.dm-close { background: none; border: none; color: var(--muted); font-size: 16px; line-height: 1; }
.dm-close:hover { color: var(--text); }
.dm-messages { height: 200px; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.dm-messages .mine { color: var(--accent); }
.dm-messages .theirs { color: var(--text); }
.dm-messages .line-meta { font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-right: 4px; }
.dm-composer { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.dm-input { flex: 1; padding: 8px 10px; font-size: 12px; }

/* ================= three-panel chat layout v2 ================= */
.app {
    grid-template-columns: 260px 1fr 260px;
}

.panel-left, .panel-right {
    background: var(--panel);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 16px;
}
.panel-left { border-right: 1px solid var(--line); }
.panel-right { border-left: 1px solid var(--line); }

.mobile-panel-toggles { display: none; }
.panel-overlay { display: none; }

@media (max-width: 980px) {
    .app { grid-template-columns: 1fr; }

    .mobile-panel-toggles { display: flex; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); }

    .panel-left, .panel-right {
        position: fixed;
        top: 0;
        bottom: 0;
        width: 82%;
        max-width: 320px;
        z-index: 60;
        transition: transform .25s ease;
        box-shadow: 0 0 40px rgba(0,0,0,.5);
    }
    .panel-left { left: 0; transform: translateX(-100%); border-right: 1px solid var(--line); }
    .panel-right { right: 0; transform: translateX(100%); border-left: 1px solid var(--line); }
    .panel-left.open, .panel-right.open { transform: translateX(0); }

    .panel-overlay.open {
        display: block;
        position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 55;
    }
}

.optional { font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; }

/* ---------- profile card (left) ---------- */
.profile-card {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
}
.profile-card-empty { justify-content: center; min-height: 140px; }
.empty-hint { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0; }

.profile-avatar {
    width: 56px; height: 56px; border-radius: 50%;
    background: linear-gradient(135deg, rgba(53,217,196,.25), rgba(255,107,74,.2));
    border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-size: 26px; color: var(--accent);
    margin-bottom: 4px;
}
.profile-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.profile-meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.hobby-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; }
.chip {
    background: rgba(53,217,196,.1); border: 1px solid rgba(53,217,196,.25);
    color: var(--accent); font-size: 11px; padding: 4px 9px; border-radius: 20px;
}

.profile-actions { display: flex; gap: 8px; margin-top: 12px; width: 100%; }
.profile-actions .btn-small { flex: 1; }

.btn-primary-outline {
    background: transparent; border: 1px solid var(--accent); color: var(--accent);
}
.btn-primary-outline:hover { background: rgba(53,217,196,.1); }
.btn-danger { border-color: rgba(255,107,107,.4); color: var(--danger); }
.btn-danger:hover { background: rgba(255,107,107,.1); }
.btn-muted { border-color: var(--line); color: var(--muted); }
.btn-muted:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- gender badge ---------- */
.gender-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 50%; font-size: 11px; flex-shrink: 0;
}
.gender-male { background: rgba(79,163,255,.18); color: #4fa3ff; }
.gender-female { background: rgba(255,107,168,.18); color: #ff6ba8; }
.gender-other { background: rgba(185,140,255,.18); color: #b98cff; }
.gender-unspecified { background: var(--panel-2); color: var(--muted); }

/* ---------- roster (right) ---------- */
.online-count {
    font-family: var(--font-mono); background: rgba(53,217,196,.12); color: var(--accent);
    font-size: 10px; padding: 2px 7px; border-radius: 10px; margin-left: 4px;
}
.roster-search {
    margin: 4px 0 12px; padding: 9px 10px; font-size: 12px;
}
.user-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.user-tile { display: flex; flex-direction: column; gap: 3px; padding: 8px 9px; border-radius: 8px; cursor: pointer; }
.user-tile:hover, .user-tile.active { background: var(--panel-2); }
.user-tile.active { outline: 1px solid rgba(53,217,196,.3); }
.user-name { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.user-meta { font-family: var(--font-mono); font-size: 11px; color: var(--muted); padding-left: 24px; }
.blocked-tag {
    font-family: var(--font-mono); font-size: 9px; color: var(--danger);
    border: 1px solid rgba(255,107,107,.4); border-radius: 8px; padding: 1px 6px; margin-left: 4px;
}

/* ---------- tab strip (center) ---------- */
.tabstrip {
    display: flex; align-items: center; gap: 8px; padding: 10px 16px;
    border-bottom: 1px solid var(--line); overflow-x: auto; flex-wrap: nowrap;
}
.tab-group { display: flex; gap: 6px; }
.tab-sep { width: 1px; height: 20px; background: var(--line); flex-shrink: 0; }

.tab-pill {
    display: flex; align-items: center; gap: 6px;
    background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
    font-size: 12px; padding: 6px 10px; border-radius: 20px; white-space: nowrap;
}
.tab-pill:hover { color: var(--text); }
.tab-pill.active { background: rgba(53,217,196,.14); border-color: rgba(53,217,196,.4); color: var(--accent); font-weight: 600; }
.tab-pill-private.active { background: rgba(255,107,74,.14); border-color: rgba(255,107,74,.4); color: var(--warm); }
.tab-pill .hash { opacity: .6; }
.unread-badge {
    background: var(--warm); color: #1a0e0a; font-size: 10px; font-weight: 700;
    border-radius: 10px; padding: 1px 6px; font-family: var(--font-mono);
}
.tab-close { opacity: .5; font-size: 14px; line-height: 1; padding-left: 2px; }
.tab-close:hover { opacity: 1; color: var(--danger); }

/* ---------- room header extras ---------- */
.room-header-right { display: flex; align-items: center; gap: 10px; }
.typing-indicator {
    display: block; font-family: var(--font-mono); font-size: 11px; color: var(--accent);
    min-height: 14px; margin-top: 2px;
}

/* ---------- sticker messages ---------- */
.sticker { font-size: 48px; line-height: 1; display: inline-block; }

@keyframes stickerBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes stickerPop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
@keyframes stickerPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes stickerShake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
@keyframes stickerFlicker { 0%,100% { transform: scale(1) rotate(0); opacity: 1; } 50% { transform: scale(1.1) rotate(-4deg); opacity: .85; } }
@keyframes stickerWave { 0%,100% { transform: rotate(0); } 20% { transform: rotate(18deg); } 40% { transform: rotate(-14deg); } 60% { transform: rotate(10deg); } 80% { transform: rotate(-6deg); } }
@keyframes stickerFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes stickerLaunch { 0% { transform: translateY(6px) scale(.9); opacity: .6; } 100% { transform: translateY(-10px) scale(1); opacity: 1; } }
@keyframes stickerDrop { 0% { transform: translateY(-14px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }

.sticker-bounce  { animation: stickerBounce 1.1s ease-in-out infinite; display: inline-block; }
.sticker-pop     { animation: stickerPop .5s ease-out; display: inline-block; }
.sticker-pulse   { animation: stickerPulse 1.2s ease-in-out infinite; display: inline-block; }
.sticker-shake   { animation: stickerShake .6s ease-in-out infinite; display: inline-block; }
.sticker-flicker { animation: stickerFlicker .9s ease-in-out infinite; display: inline-block; }
.sticker-wave    { animation: stickerWave 1.4s ease-in-out infinite; display: inline-block; transform-origin: 70% 70%; }
.sticker-float   { animation: stickerFloat 2.2s ease-in-out infinite; display: inline-block; }
.sticker-launch  { animation: stickerLaunch .6s ease-out; display: inline-block; }
.sticker-drop    { animation: stickerDrop .5s ease-out; display: inline-block; }

/* ---------- picker dock (emoji + stickers) ---------- */
.picker-dock {
    border-top: 1px solid var(--line); background: var(--panel);
    max-height: 240px; display: flex; flex-direction: column;
}
.picker-dock.hidden { display: none; }
.picker-tabs { display: flex; gap: 4px; padding: 8px 12px 0; }
.picker-tab {
    background: none; border: none; color: var(--muted); font-size: 12px;
    padding: 8px 12px; border-bottom: 2px solid transparent;
}
.picker-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.picker-panel { overflow-y: auto; padding: 10px 12px 14px; }
.picker-panel.hidden { display: none; }
.picker-category {
    font-family: var(--font-mono); font-size: 10px; color: var(--muted);
    text-transform: uppercase; letter-spacing: .06em; margin: 8px 0 4px;
}
.picker-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.emoji-btn {
    background: none; border: none; font-size: 20px; padding: 4px; border-radius: 6px; line-height: 1;
}
.emoji-btn:hover { background: var(--panel-2); }
.sticker-grid { gap: 8px; }
.sticker-btn {
    background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
    padding: 10px; font-size: 26px; width: 56px; height: 56px;
    display: flex; align-items: center; justify-content: center;
}
.sticker-btn:hover { border-color: var(--accent); }

/* ---------- composer extras ---------- */
.composer-btn { flex-shrink: 0; font-size: 16px; }

/* ================= v3 additions: sign-off bar, admin, reply, menu ================= */

.me-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; border-bottom: 1px solid var(--line);
    font-size: 13px;
}
.me-bar-name { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.admin-badge {
    font-family: var(--font-mono); font-size: 10px; letter-spacing: .05em;
    background: rgba(255,107,74,.15); color: var(--warm);
    border: 1px solid rgba(255,107,74,.35); border-radius: 6px; padding: 2px 7px;
}
.sign-off-link { margin-left: auto; color: var(--muted); font-size: 12px; text-decoration: none; }
.sign-off-link:hover { color: var(--danger); }

.member-count { font-family: var(--font-mono); font-size: 11px; color: var(--muted); font-weight: 400; }

/* ---------- message name click target ---------- */
.msg-name-clickable { cursor: pointer; }
.msg-name-clickable:hover { text-decoration: underline; }

/* ---------- floating user menu ---------- */
.user-menu {
    position: absolute; z-index: 40;
    background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,.4); overflow: hidden; min-width: 170px;
}
.user-menu.hidden { display: none; }
.user-menu-item {
    display: block; width: 100%; text-align: left; background: none; border: none;
    color: var(--text); font-size: 13px; padding: 10px 14px;
}
.user-menu-item:hover { background: var(--panel-2); color: var(--accent); }

/* ---------- reply banner + inline reply quote ---------- */
.reply-banner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 16px; background: rgba(53,217,196,.08);
    border-top: 1px solid var(--line); font-size: 12px; color: var(--accent);
}
.reply-banner.hidden { display: none; }
.reply-cancel { background: none; border: none; color: var(--muted); font-size: 16px; line-height: 1; }
.reply-cancel:hover { color: var(--danger); }

.reply-quote {
    font-size: 11px; color: var(--muted); border-left: 2px solid var(--accent-dim);
    padding-left: 8px; margin-bottom: 4px;
}


/* ================= v4: avatars, consent, reports, guidelines ================= */

/* ---------- avatar picker grid (shared: reservation form + in-chat popover) ---------- */
.avatar-picker {
    display: flex; flex-wrap: wrap; gap: 6px;
    background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
    padding: 10px; max-height: 160px; overflow-y: auto;
}
.avatar-option {
    background: none; border: 1px solid transparent; border-radius: 8px;
    font-size: 20px; width: 36px; height: 36px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.avatar-option:hover { background: var(--panel); }
.avatar-option.selected { border-color: var(--accent); background: rgba(53,217,196,.12); }

/* ---------- editable avatar button (chat header) ---------- */
.my-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    background: var(--panel-2); border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; line-height: 1;
}
.my-avatar:hover { border-color: var(--accent); }

.avatar-popover {
    position: absolute; z-index: 40; margin-top: 44px;
    box-shadow: 0 10px 30px rgba(0,0,0,.4); border-radius: 10px; overflow: hidden;
}
.avatar-popover.hidden { display: none; }
.avatar-popover .avatar-picker { max-height: 200px; width: 260px; }

/* ---------- roster row avatar glyph ---------- */
.roster-avatar { font-size: 14px; margin-right: 2px; }

/* ---------- consent checkbox ---------- */
.consent-row {
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 12px; color: var(--muted); line-height: 1.5; margin: 4px 0 4px;
    cursor: pointer;
}
.consent-row input[type="checkbox"] { margin-top: 2px; accent-color: var(--accent); }
.consent-row a { color: var(--accent); }

/* ---------- guidelines page ---------- */
.guidelines-panel { max-width: 480px; text-align: left; }
.guidelines-list { padding-left: 20px; margin: 0 0 18px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; line-height: 1.6; }
.guidelines-list li::marker { color: var(--accent); }

/* ---------- admin reports table ---------- */
.reports-panel { max-width: 720px; text-align: left; }
.reports-table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 10px 0 18px; }
.reports-table th {
    text-align: left; font-family: var(--font-mono); font-size: 10px; color: var(--muted);
    text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.reports-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }

/* ---------- user menu danger item ---------- */
.user-menu-danger { color: var(--danger); }
.user-menu-danger:hover { background: rgba(255,107,107,.1); }

/* ================= v5: text style popover ================= */
.style-popover {
    position: absolute; z-index: 40; margin-top: 44px; margin-left: 42px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,.4); padding: 12px; width: 220px;
}
.style-popover.hidden { display: none; }
.style-popover-section { margin-bottom: 12px; }
.style-popover-section:last-child { margin-bottom: 0; }
.style-popover-label {
    display: block; font-family: var(--font-mono); font-size: 10px; color: var(--muted);
    text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px;
}
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.color-swatch {
    width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent;
    cursor: pointer; padding: 0;
}
.color-swatch-default { border: 1px solid var(--line); }
.color-swatch.selected { border-color: var(--text); box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--accent); }
.size-options { display: flex; gap: 6px; }
.size-option {
    flex: 1; background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
    border-radius: 8px; padding: 8px 0; font-size: 13px; font-weight: 600;
}
.size-option.selected { border-color: var(--accent); color: var(--accent); background: rgba(53,217,196,.1); }

/* ---------- landing page FAQ (crawlable content matching FAQPage schema) ---------- */
.faq-panel {
    width: 100%;
    max-width: 520px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 28px 32px;
}
.faq-panel h2 {
    font-family: var(--font-display);
    font-size: 16px;
    margin: 0 0 18px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.faq-item { margin-bottom: 16px; }
.faq-item:last-child { margin-bottom: 0; }
.faq-item h3 {
    font-size: 14px;
    margin: 0 0 4px;
    color: var(--text);
}
.faq-item p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
}

/* ================= v8: reactions, nudge, icebreaker ================= */

.msg-footer {
    display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap;
}
.msg-reactions { display: flex; gap: 4px; flex-wrap: wrap; }

.reaction-pill {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--panel-2); border: 1px solid var(--line); border-radius: 20px;
    padding: 2px 8px; font-size: 12px; line-height: 1.6;
}
.reaction-pill span { font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.reaction-pill:hover { border-color: var(--accent); }
.reaction-pill.mine { background: rgba(53,217,196,.14); border-color: rgba(53,217,196,.45); }
.reaction-pill.mine span { color: var(--accent); }

.msg-react-trigger {
    background: none; border: none; color: var(--muted); font-size: 12px;
    opacity: 0; transition: opacity .15s ease; padding: 2px 4px;
}
.msg:hover .msg-react-trigger { opacity: .7; }
.msg-react-trigger:hover { opacity: 1 !important; color: var(--accent); }

.quick-react-bar {
    display: none; gap: 4px; margin-top: 6px;
    background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
    padding: 6px; width: fit-content;
}
.quick-react-bar.open { display: flex; }
.quick-react-btn {
    background: none; border: none; font-size: 16px; padding: 4px 6px; border-radius: 6px; line-height: 1;
}
.quick-react-btn:hover { background: var(--panel); transform: scale(1.15); }

/* ---------- nudge shake ---------- */
@keyframes roomShake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-8px); }
    30% { transform: translateX(7px); }
    45% { transform: translateX(-6px); }
    60% { transform: translateX(5px); }
    75% { transform: translateX(-3px); }
    90% { transform: translateX(2px); }
}
.room.shake { animation: roomShake .5s ease; }
