/* RaverChatRoom Dark Theme */
:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-card: #242424;
    --bg-input: #1e1e1e;
    --accent: #e040fb;
    --accent-hover: #ce39e0;
    --accent-secondary: #7c4dff;
    --text-primary: #f0f0f0;
    --text-muted: #888;
    --border: #333;
    --danger: #ff4444;
    --success: #4caf50;
    --scrollbar-thumb: #444;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; font-family: "Segoe UI", system-ui, sans-serif; background-color: var(--bg-primary); color: var(--text-primary); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem 1rem; border-radius: 6px; border: none; cursor: pointer; font-size: .9rem; font-weight: 500; transition: all .15s; line-height: 1; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #cc3333; }
.btn-sm { padding: .25rem .6rem; font-size: .8rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input[type="text"], input[type="email"], input[type="password"], input[type="color"], input[type="url"], textarea, select { background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; color: var(--text-primary); padding: .5rem .75rem; width: 100%; font-size: .9rem; outline: none; transition: border-color .15s; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
select option { background: var(--bg-card); }
label { display: block; font-size: .85rem; color: var(--text-muted); margin-bottom: .25rem; }
.form-group { margin-bottom: 1rem; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; }
.badge { display: inline-block; padding: .15rem .45rem; border-radius: 4px; font-size: .75rem; font-weight: 600; }
.badge-admin { background: var(--accent); color: #fff; }
.badge-mod { background: var(--accent-secondary); color: #fff; }
.badge-member { background: var(--bg-secondary); color: var(--text-muted); }
.app-shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.top-nav { display: flex; align-items: center; gap: 1rem; padding: .4rem 1rem; min-height: 52px; background: var(--bg-secondary); border-bottom: 1px solid var(--border); flex-shrink: 0; z-index: 100; flex-wrap: wrap; }
.top-nav .brand { font-size: 1.2rem; font-weight: 700; color: var(--accent); text-decoration: none; display: flex; align-items: center; gap: .5rem; }
.brand-logo { height: 28px; width: auto; object-fit: contain; }
.auth-logo  { height: 40px; width: auto; object-fit: contain; vertical-align: middle; margin-right: .4rem; }
.auth-channel-logo-img { height: 40px; width: auto; max-width: 140px; object-fit: contain; border-radius: 6px; }
.auth-logos-row { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-bottom: .5rem; }
.auth-logos-divider { color: var(--text-muted); font-size: 1rem; opacity: .5; }
.home-logo  { height: 48px; width: auto; object-fit: contain; vertical-align: middle; margin-right: .5rem; }
.top-nav .nav-links { display: flex; gap: .25rem; margin-left: auto; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }
.top-nav .nav-links a, .top-nav .nav-links button { color: var(--text-muted); background: none; border: none; cursor: pointer; font-size: .9rem; padding: .3rem .5rem; border-radius: 5px; transition: color .15s, background .15s; text-decoration: none; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .1rem; }
.top-nav .nav-links a:hover, .top-nav .nav-links button:hover { color: var(--text-primary); background: var(--bg-card); }
.top-nav .nav-links .nav-icon { font-size: 1.1rem; line-height: 1; }
.top-nav .nav-links .nav-label { font-size: .7rem; line-height: 1; text-align: center; white-space: nowrap; }
.top-nav .nav-links a.btn, .top-nav .nav-links button.btn { flex-direction: column; align-items: center; justify-content: flex-start; gap: .1rem; padding: .3rem .5rem; }
.station-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; padding: 1.5rem; overflow-y: auto; flex: 1; align-items: start; }
.station-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; transition: transform .15s, border-color .15s; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.station-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.station-card-header { height: 100px; background: linear-gradient(135deg, #1a0a2e 0%, #16213e 100%); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; background-size: contain; background-repeat: no-repeat; background-position: center; }
.station-card-body { padding: 1rem; }
.station-card-name { font-weight: 700; font-size: 1.05rem; margin-bottom: .3rem; }
.station-card-desc { color: var(--text-muted); font-size: .85rem; }
.chat-room { display: flex; flex-direction: column; flex: 1; overflow: hidden; position: relative; background-size: cover; background-position: center; }
.chat-body { display: flex; flex: 1; overflow: hidden; position: relative; z-index: 10; }
.chat-main { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.chat-room-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.65); pointer-events: none; z-index: 1; }
.chat-room-video-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; z-index: 0; }
.chat-header { position: relative; display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; background: rgba(15,15,15,.85); border-bottom: 1px solid var(--border); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); flex-shrink: 0; z-index: 10; }
.chat-header-title { font-size: 1.1rem; font-weight: 700; }
.chat-header-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.chat-messages {
    position: relative;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.chat-message {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    border-radius: 6px;
    padding: .2rem .4rem;
    margin: 0 -.4rem;
    transition: background .15s;
    width: fit-content;
    max-width: calc(100% + .8rem);
}

.chat-message:hover { background: rgba(255,255,255,.06); }
.chat-message:hover .msg-actions { opacity: 1; }
.chat-message--align-right { flex-direction: row-reverse; justify-content: flex-start; align-self: flex-end;}
.chat-message--align-right .chat-message-body {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.chat-message--align-right .msg-header { justify-content: flex-end; }
.chat-message--align-right .msg-actions { margin-left: 0; margin-right: auto; order: -1; padding-right: 5px; }
.chat-message--align-right .msg-content { display: flex; justify-content: flex-end; width: 100%; }
.chat-message--align-right .chat-img-thumb { margin-left: auto; }
.chat-message--align-right .msg-reactions { justify-content: flex-start; align-self: flex-start; }
.chat-message--align-right .msg-reply-quote { border-left: 0; border-right: 2px solid var(--accent); border-radius: 4px 0 0 4px; align-self: flex-end; }

/* Always show on touch devices — no hover available */
@media (hover: none) {
    .msg-actions {
        opacity: 1;
    }
}
.chat-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-card); border: 1px solid var(--border); flex-shrink: 0; object-fit: cover; cursor: pointer; }
.chat-avatar-placeholder { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-secondary); display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700; flex-shrink: 0; color: #fff; cursor: pointer; }
.avatar-role--admin        { border: 2px solid #FFD700 !important; box-shadow: 0 0 4px rgba(255,215,0,.45); }
.avatar-role--station-admin { border: 2px solid #C0C0C0 !important; box-shadow: 0 0 4px rgba(192,192,192,.45); }
.avatar-role--moderator    { border: 2px solid #CD7F32 !important; box-shadow: 0 0 4px rgba(205,127,50,.45); }
.chat-message-body {
    min-width: 0;
    overflow: hidden;
}

.chat-img-thumb {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    border-radius: 6px;
    border: 1px solid var(--border);
    display: block;
    cursor: zoom-in;
    object-fit: contain;
}

.msg-header {
    display: flex;
    align-items: center;
    gap: .35rem;
    margin-bottom: .15rem;
    flex-wrap: nowrap;
    min-width: 0;
}

.msg-username {
    font-weight: 600;
    font-size: .9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex-shrink: 1;
    cursor: pointer;
}

.msg-time {
    font-size: .75rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.msg-actions {
    opacity: 0;
    transition: opacity .15s;
    display: flex;
    gap: .2rem;
    margin-left: auto;
    flex-shrink: 0;
    align-items: center;
}
.chat-message--align-right .msg-actions {
    margin-left: 0;
    margin-right: auto;
}

.chat-message--align-left .msg-actions {
    padding-left: 5px;
}

.msg-actions button {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 4px;
    padding: .15rem .4rem;
    font-size: .95rem;
    cursor: pointer;
    line-height: 1;
}

.msg-actions button:hover {
    color: var(--accent);
}

.msg-delete-btn:hover { color: var(--danger) !important; border-color: var(--danger) !important; background: rgba(255,68,68,.15) !important; }
/* Reply quote shown inside a message */
.msg-reply-quote { display: flex; gap: .4rem; align-items: baseline; background: rgba(255,255,255,.06); border-left: 2px solid var(--accent); border-radius: 0 4px 4px 0; padding: .2rem .5rem; margin-bottom: .25rem; cursor: pointer; max-width: 100%; overflow: hidden; }
.msg-reply-quote:hover { background: rgba(255,255,255,.1); }
.msg-reply-author { font-size: .75rem; font-weight: 600; color: var(--accent); white-space: nowrap; flex-shrink: 0; }
.msg-reply-preview { font-size: .75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Banner above the input when replying */
.reply-banner { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .3rem .6rem; background: rgba(255,255,255,.06); border-left: 2px solid var(--accent); border-radius: 4px; margin-bottom: .35rem; font-size: .82rem; color: var(--text-muted); }
.reply-banner strong { color: var(--accent); }
.reply-banner-cancel { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: .9rem; padding: 0 .2rem; line-height: 1; flex-shrink: 0; }
.reply-banner-cancel:hover { color: var(--danger); }
.msg-highlight { animation: msg-flash .6s ease 2; }
@keyframes msg-flash { 0%,100% { background: transparent; } 50% { background: rgba(255,255,255,.12); } }
.mention { color: var(--accent); font-weight: 600; }
.mention-self { color: var(--accent); font-weight: 700; background: rgba(224,64,251,.18); border-radius: 3px; padding: 0 .15rem; }
.chat-link { color: var(--accent); text-decoration: underline; word-break: break-all; }
.chat-link:hover { opacity: .8; }
.mention-dropdown { position: absolute; bottom: 100%; left: 0; right: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; margin-bottom: .35rem; z-index: 50; overflow: hidden; max-height: 220px; overflow-y: auto; box-shadow: 0 -4px 16px rgba(0,0,0,.4); }
.mention-dropdown-item { display: flex; align-items: center; gap: .5rem; padding: .4rem .75rem; cursor: pointer; font-size: .88rem; transition: background .1s; }
.mention-dropdown-item:hover, .mention-dropdown-item.mention-active { background: rgba(255,255,255,.1); }
.mention-dropdown-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.mention-dropdown-avatar-placeholder { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-secondary); display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.chat-input-area { position: relative; padding: .5rem .75rem; background: rgba(15,15,15,.9); border-top: 1px solid var(--border); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); flex-shrink: 0; z-index: 10; }
.chat-input-toolbar { display: flex; align-items: center; gap: .5rem; }
.toolbar-btn { background: none; border: 1px solid var(--border); color: var(--text-muted); border-radius: 6px; padding: .3rem .6rem; cursor: pointer; font-size: .85rem; transition: all .15s; display: inline-flex; align-items: center; line-height: 1; }
.toolbar-btn:hover, .toolbar-btn.active { color: var(--accent); border-color: var(--accent); }
.now-playing { font-size: .95rem; font-weight: 600; color: var(--text-primary); white-space: normal; word-break: break-word; }
.now-playing-bar { display: flex; justify-content: center; align-items: center; padding: .3rem 1rem; background: #0f0f0f; border-bottom: 1px solid var(--border); flex-shrink: 0; text-align: center; position: relative; z-index: 2; }
.chat-input-row { display: flex; gap: .5rem; align-items: center; }
.chat-input-row textarea { flex: 1; resize: none; min-height: 36px; max-height: 120px; overflow-y: auto; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; padding: .4rem .65rem; font-size: .9rem; color: var(--text-primary); line-height: 1.4; width: auto; }
.chat-input-row textarea:focus { border-color: var(--accent); outline: none; }

/* ── Message input wrapper with character counter ── */
.msg-input-wrap { position: relative; flex: 1; display: flex; min-width: 0; }
.msg-input-wrap textarea { flex: 1; resize: none; min-height: 36px; max-height: 120px; overflow-y: auto; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; padding: .4rem .65rem .4rem .65rem; font-size: .9rem; color: var(--text-primary); line-height: 1.4; width: 100%; transition: border-color .15s; }
.msg-input-wrap textarea:focus { border-color: var(--accent); outline: none; }
.msg-input-wrap textarea.msg-overlimit { border-color: var(--danger, #e05); box-shadow: 0 0 0 2px rgba(220,53,69,.25); }
.msg-char-counter { align-self: center; font-size: .7rem; color: var(--text-muted); line-height: 1; padding: 2px 0 0; pointer-events: none; padding-left: 7px; }
.msg-char-counter--warn { color: #f5a623; }
.msg-char-counter--over { color: var(--danger, #e05); font-weight: 700; }
.send-btn { background: var(--accent); border: none; color: #fff; border-radius: 8px; padding: .5rem .9rem; font-size: 1.1rem; cursor: pointer; transition: background .15s; height: 36px; display: flex; align-items: center; }
.send-btn:hover { background: var(--accent-hover); }
.send-btn:disabled { opacity: .5; cursor: not-allowed; }
.gif-picker { position: absolute; bottom: 100%; left: 0; right: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: .75rem; margin-bottom: .5rem; z-index: 50; max-height: 320px; display: flex; flex-direction: column; gap: .5rem; }
.gif-provider-tabs { display: flex; gap: .35rem; justify-content: flex-start; }
.gif-provider-tab { width: 72px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; color: var(--text-muted); font-size: .75rem; font-weight: 600; padding: .25rem .5rem; cursor: pointer; transition: background .15s, color .15s; text-align: center; }
.gif-provider-tab.active, .gif-provider-tab:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.gif-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .4rem; overflow-y: auto; flex: 1; }
.gif-grid img { width: 100%; height: 90px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; transition: border-color .15s; }
.gif-grid img:hover { border-color: var(--accent); }
/* ── GIF tile: wraps thumbnail + heart overlay ── */
.gif-tile { position: relative; border-radius: 6px; overflow: hidden; min-height: 90px; }
.gif-tile img { display: block; width: 100%; height: 90px; object-fit: cover; cursor: pointer; border: 2px solid transparent; transition: border-color .15s; border-radius: 6px; }
.gif-tile img:hover { border-color: var(--accent); }
.gif-fav-btn { position: absolute; top: 3px; right: 3px; background: rgba(0,0,0,.45); border: none; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: .85rem; line-height: 1; padding: 0; transition: background .15s, transform .1s; z-index: 2; }
.gif-fav-btn:hover { background: rgba(0,0,0,.7); transform: scale(1.15); }
.gif-fav-btn--active { color: #e05; }
.gif-fav-sentinel { height: 1px; }
.image-preview { display: inline-block; position: relative; margin-bottom: .5rem; }
/* ── User list panel (desktop sidebar) ── */
.users-panel { display: none; flex-direction: column; width: 0; overflow: hidden; background: rgba(15,15,15,.92); border-left: 1px solid var(--border); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: width .2s ease; flex-shrink: 0; position: relative; z-index: 10; }
.users-panel.open { display: flex; width: 200px; }
.users-panel-header { display: flex; align-items: center; justify-content: space-between; padding: .6rem .75rem; font-size: .8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.users-panel-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: .9rem; line-height: 1; padding: 0; }
.users-panel-close:hover { color: var(--text-primary); }
.users-panel-list { flex: 1; overflow-y: auto; padding: .5rem; display: flex; flex-direction: column; gap: .35rem; }
.users-panel-item { display: flex; align-items: center; gap: .5rem; padding: .3rem .4rem; border-radius: 6px; }
.users-panel-item:hover { background: var(--bg-card); }
.users-panel-name { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.avatar-wrap { position: relative; flex-shrink: 0; }
.presence-dot { position: absolute; bottom: 1px; right: 1px; width: 14px; height: 14px; border-radius: 50%; background: #3ddc84; border: 2px solid rgba(15,15,15,.92); box-shadow: 0 0 6px #3ddc8499; }
.presence-dot--active  { background: #3ddc84; box-shadow: 0 0 6px #3ddc8499; }
.presence-dot--idle    { background: #f5a623; box-shadow: 0 0 6px #f5a62399; }
.presence-dot--recent  { background: #6b7280; box-shadow: none; }
.chat-message .presence-dot { width: 11px; height: 11px; }
.listening-icon { font-size: .95rem; margin-right: .15rem; opacity: .85; }
.users-panel-item--offline .chat-avatar, .users-panel-item--offline .chat-avatar-placeholder { opacity: .5; }
.users-panel-name-wrap { display: flex; flex-direction: column; overflow: hidden; }
.users-panel-lastseen { font-size: .7rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.users-panel-section { font-size: .7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; padding: .45rem .4rem .2rem; }
.users-panel-section-anonymous { position: absolute; bottom: 5px; }

/* ── Mobile drawer (slides up from bottom) ── */
.users-drawer-backdrop {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 40;
}
.users-drawer { display: none; position: absolute; bottom: 0; left: 0; right: 0; max-height: 55%; background: var(--bg-secondary); border-top: 1px solid var(--border); border-radius: 14px 14px 0 0; z-index: 41; flex-direction: column; }
/* On mobile, show the drawer; hide the sidebar panel */
@media (max-width: 640px) {
    .users-panel, .users-panel.open { display: none !important; }
    .users-drawer-backdrop { display: block; }
    .users-drawer { display: flex; }
}
.image-preview img { max-width: 200px; max-height: 150px; border-radius: 6px; border: 1px solid var(--border); }
.image-preview .remove-btn { position: absolute; top: -6px; right: -6px; background: var(--danger); border: none; color: #fff; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; font-size: .7rem; display: flex; align-items: center; justify-content: center; }
.setup-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; min-height: 100dvh; padding: 2rem; background: radial-gradient(ellipse at center, #1a0a2e 0%, #0f0f0f 70%); }
.setup-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 2.5rem; width: 100%; max-width: 480px; }
.setup-logo { text-align: center; margin-bottom: 1.25rem; }
.setup-logo h1 { font-size: 2rem; color: var(--accent); margin: 0; }
.setup-logo p { color: var(--text-muted); margin: .5rem 0 0; }
.auth-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; gap: 0; }
.auth-tab { flex: 1; text-align: center; padding: .6rem 1rem; font-size: .95rem; font-weight: 500; color: var(--text-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.auth-tab:hover { color: var(--text); text-decoration: none; }
.auth-tab--active { color: var(--accent); border-bottom-color: var(--accent); }
.page-container { flex: 1; overflow-y: auto; padding: 1.5rem; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.page-header h1 { margin: 0; font-size: 1.5rem; }
.profile-layout { display: grid; grid-template-columns: 200px 1fr; gap: 1.5rem; max-width: 700px; }
.avatar-upload { text-align: center; }
.avatar-upload img, .avatar-placeholder { width: 140px; height: 140px; border-radius: 50%; border: 3px solid var(--accent); object-fit: cover; display: block; margin: 0 auto .75rem; }
.avatar-placeholder { background: var(--accent-secondary); display: flex; align-items: center; justify-content: center; font-size: 3rem; font-weight: 700; color: #fff; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th { background: var(--bg-secondary); padding: .6rem .75rem; text-align: left; color: var(--text-muted); font-weight: 500; border-bottom: 1px solid var(--border); }
.admin-table td { padding: .6rem .75rem; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: middle; color: var(--text-primary); }
.admin-table tr:hover td { background: rgba(255,255,255,.03); }
.admin-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; flex-wrap: wrap; }
.admin-tab { background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-muted); cursor: pointer; font-size: .9rem; padding: .55rem .9rem; margin-bottom: -1px; border-radius: 4px 4px 0 0; transition: color .15s, border-color .15s; }
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.app-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; z-index: 1055; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.app-modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 1.75rem; width: 100%; max-width: 480px; position: relative; }
.app-modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.app-modal-header h3 { margin: 0; font-size: 1.1rem; }
.app-modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.2rem; }
.app-modal-footer { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }
.color-picker-row { display: flex; align-items: center; gap: .75rem; }
.color-picker-row input[type="color"] { width: 48px; height: 36px; padding: 2px; cursor: pointer; }
.alert { padding: .75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: .9rem; }
.alert-success { background: rgba(76,175,80,.15); border: 1px solid rgba(76,175,80,.4); color: #81c784; }
.alert-danger { background: rgba(255,68,68,.15); border: 1px solid rgba(255,68,68,.4); color: #ef9a9a; }
.alert-info { background: rgba(124,77,255,.15); border: 1px solid rgba(124,77,255,.4); color: #b39ddb; }
.loading-spinner { display: flex; align-items: center; justify-content: center; padding: 3rem; color: var(--text-muted); gap: .75rem; }
.spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.spinner-sm { width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
.upload-progress { opacity: .7; cursor: default; min-width: 32px; justify-content: center; }
@keyframes spin { to { transform: rotate(360deg); } }
.text-muted { color: var(--text-muted) !important; }
.text-accent { color: var(--accent) !important; }
.text-danger { color: var(--danger) !important; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; } .align-center { align-items: center; } .gap-1 { gap: .5rem; }
.w-100 { width: 100%; }
.banned-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 1rem; z-index: 10; }
.banned-overlay h2 { color: var(--danger); margin: 0; }
.upload-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.70); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 1rem; z-index: 20; pointer-events: all; }
.upload-overlay-progress-ring { position: relative; width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; }
.upload-overlay-progress-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.upload-overlay-progress-ring svg .track { fill: none; stroke: rgba(255,255,255,.2); stroke-width: 5; }
.upload-overlay-progress-ring svg .fill { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 175.9; transition: stroke-dashoffset .3s ease; }
.upload-overlay-pct { position: relative; color: #fff; font-size: 1rem; font-weight: 700; }
.upload-overlay-label { color: #fff; font-size: 1.1rem; font-weight: 600; letter-spacing: .04em; }
.timeout-notice { position: relative; z-index: 10; background: rgba(255,165,0,.15); border: 1px solid rgba(255,165,0,.4); color: #ffb74d; padding: .5rem 1rem; text-align: center; font-size: .85rem; }
.connection-status-banner { position: relative; z-index: 10; text-align: center; font-size: .85rem; padding: .4rem 1rem; animation: pulse-fade 2s ease-in-out infinite; }
.connection-status-reconnecting { background: rgba(255,165,0,.15); border-bottom: 1px solid rgba(255,165,0,.4); color: #ffb74d; }
.connection-status-failed { background: rgba(220,53,69,.15); border-bottom: 1px solid rgba(220,53,69,.4); color: #f77; }
@keyframes pulse-fade { 0%,100% { opacity: 1; } 50% { opacity: .6; } }
@media (max-width: 600px) { .profile-layout { grid-template-columns: 1fr; } .station-list { grid-template-columns: 1fr; padding: 1rem; } }
#blazor-error-ui { background: var(--bg-card); border: 1px solid var(--danger); color: var(--text-primary); padding: .5rem 1rem; position: fixed; bottom: 1rem; left: 1rem; right: 1rem; border-radius: 8px; z-index: 1000; display: none; }
#blazor-error-ui .reload { color: var(--accent); margin-left: .5rem; }
#blazor-error-ui .dismiss { float: right; cursor: pointer; }
h1:focus { outline: none; }
.embed-loading { display:flex; align-items:center; justify-content:center; height:100vh; height:100dvh; background:var(--bg-primary); }
.embed-error { display:flex; align-items:center; justify-content:center; height:100vh; height:100dvh; color:var(--text-muted); font-size:.9rem; }

/* ── Embed chat header – fluid/mobile layout ── */
.embed-chat-header {
    flex-wrap: wrap;
    gap: .4rem !important;
}

.embed-header-brand {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-shrink: 0;
}

.embed-chat-header .chat-header-actions {
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
    justify-content: flex-end;
    gap: .3rem;
}

.embed-volume-slider {
    width: 70px;
    accent-color: var(--accent);
}

/* On very narrow iframes: collapse button labels to icon-only, shrink controls */
@media (max-width: 440px) {
    .embed-btn-label {
        display: none;
    }

    .embed-volume-slider {
        width: 44px;
    }

    .embed-chat-header .toolbar-btn {
        padding: .25rem .45rem;
    }

    .embed-chat-header .btn-sm {
        padding: .2rem .45rem;
        font-size: .78rem;
    }
}

/* ── Reactions ── */
.msg-reactions { display:flex; flex-wrap:wrap; gap:.3rem; margin-top:.3rem; }
.chat-message--align-right .msg-reactions { justify-content: flex-end; }
.reaction-bubble { display:inline-flex; align-items:center; gap:.25rem; background:rgba(255,255,255,.07); border:1px solid var(--border); border-radius:20px; padding:.1rem .45rem; font-size:.85rem; cursor:pointer; transition:background .15s, border-color .15s; line-height:1.4; }
.reaction-bubble:hover { background:rgba(255,255,255,.13); border-color:var(--accent); }
.reaction-bubble.reacted { background:rgba(224,64,251,.18); border-color:var(--accent); }
.reaction-count { font-size:.75rem; color:var(--text-muted); font-weight:600; }
.reaction-bubble.reacted .reaction-count { color:var(--accent); }
.reaction-custom-img { width:18px; height:18px; object-fit:contain; border-radius:2px; }

/* ── Emoji Picker ── */
.emoji-picker { position:absolute; bottom:100%; left:0; right:0; background:var(--bg-card); border:1px solid var(--border); border-radius:10px; padding:.6rem; margin-bottom:.5rem; z-index:55; max-height:340px; display:none; flex-direction:column; gap:.4rem; }
.emoji-picker.open { display:flex; }
.emoji-picker-search input { width:100%; background:var(--bg-input); border:1px solid var(--border); border-radius:6px; color:var(--text-primary); padding:.35rem .6rem; font-size:.85rem; outline:none; }
.emoji-picker-search input:focus { border-color:var(--accent); }
.emoji-picker-scroll { overflow-y:auto; flex:1; display:flex; flex-direction:column; gap:.25rem; }
.emoji-section-label { font-size:.7rem; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.05em; padding:.25rem 0 .1rem; }
.emoji-grid { display:flex; flex-wrap:wrap; gap:.2rem; }
.emoji-btn { background:none; border:none; cursor:pointer; font-size:1.3rem; padding:.15rem .2rem; border-radius:5px; line-height:1; transition:background .1s; }
.emoji-btn:hover { background:rgba(255,255,255,.1); }
.emoji-btn-custom img { width:24px; height:24px; object-fit:contain; border-radius:3px; display:block; }
.picker-backdrop { position:fixed; inset:0; z-index:54; }

/* ── Admin emoji grid ── */
.emoji-admin-grid { display:flex; flex-wrap:wrap; gap:.6rem; }
.emoji-admin-item { display:flex; flex-direction:column; align-items:center; gap:.25rem; background:var(--bg-secondary); border:1px solid var(--border); border-radius:8px; padding:.5rem .6rem; width:80px; }
.emoji-admin-item img { width:36px; height:36px; object-fit:contain; }
.emoji-admin-name { font-size:.7rem; color:var(--text-muted); word-break:break-all; text-align:center; }

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* ── Lightbox ── */
.lightbox-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, .92);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: lightbox-fade .15s ease;
}

@keyframes lightbox-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lightbox-img {
    max-width: 92vw;
    max-height: 88vh;
    border-radius: 10px;
    box-shadow: 0 8px 48px rgba(0,0,0,.8);
    cursor: default;
    object-fit: contain;
}

.lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1.25rem;
    z-index: 1001;
    background: rgba(30,30,30,.85);
    color: #fff;
    border: 2px solid rgba(255,255,255,.35);
    border-radius: 50%;
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1.3rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .15s;
}

.lightbox-close:hover {
    background: rgba(220, 50, 50, .9);
    border-color: #fff;
    transform: scale(1.1);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* ---- Account Settings Modal ---- */
.settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .65);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.settings-modal {
    position: relative;
    z-index: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: min(560px, 95vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0,0,0,.6);
    animation: settings-pop .18s ease;
}

@keyframes settings-pop {
    from { opacity: 0; transform: scale(.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1)  translateY(0); }
}

.settings-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.4rem .9rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.settings-modal-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-modal-close {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
    padding: .2rem .4rem;
    border-radius: 5px;
    text-decoration: none;
    transition: color .15s, background .15s;
}

.settings-modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.settings-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.4rem 1.4rem;
}

/* ---- Settings Tab Nav ---- */
.settings-nav {
    display: flex;
    gap: .25rem;
    padding: .6rem 1.4rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.settings-nav-link {
    padding: .35rem .9rem;
    border-radius: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: .875rem;
    transition: background .15s, color .15s;
}

.settings-nav-link:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.settings-nav-link.active {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

/* tighten up Bootstrap grid inside the modal */
.settings-modal-body .row { margin: 0; }
.settings-modal-body .col-xl-6,
.settings-modal-body .col-md-6 { padding: 0; max-width: 100%; flex: unset; width: 100%; }
.settings-modal-body .w-100.btn-lg { font-size: .9rem; padding: .5rem 1rem; }

/* fix Bootstrap .form-control overriding the dark theme */
.settings-modal-body .form-control,
.settings-modal-body .form-control:disabled,

/* ── Maintenance Banners ──────────────────────────────────────────────────── */
.maintenance-banner {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem 1rem;
    font-size: .85rem;
    font-weight: 500;
    z-index: 50;
}
.maintenance-banner--active {
    background: rgba(255, 68, 68, .18);
    border-bottom: 1px solid rgba(255, 68, 68, .5);
    color: #ffaaaa;
}
.maintenance-banner--scheduled {
    background: rgba(255, 165, 0, .15);
    border-bottom: 1px solid rgba(255, 165, 0, .45);
    color: #ffd080;
}

/* ── Maintenance Holding Page ─────────────────────────────────────────────── */
.maintenance-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
    padding: 2rem;
}
.maintenance-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    max-width: 520px;
    width: 100%;
    text-align: center;
}
.maintenance-icon { font-size: 3rem; margin-bottom: 1rem; }
.maintenance-card h1 { font-size: 1.6rem; margin: 0 0 .75rem; }
.maintenance-message { color: var(--text-muted); margin-bottom: 1rem; }
.maintenance-eta { font-size: .9rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.maintenance-footer { display: flex; justify-content: center; gap: .75rem; }

/* ── Maintenance state badges ─────────────────────────────────────────────── */
.maintenance-state-badge { display:inline-flex; align-items:center; gap:.3rem; padding:.2rem .55rem; border-radius:20px; font-size:.78rem; font-weight:600; }
.maintenance-state-badge--active    { background:rgba(255,68,68,.2);   color:#ff8888; }
.maintenance-state-badge--scheduled { background:rgba(255,165,0,.2);   color:#ffd080; }
.maintenance-state-badge--completed { background:rgba(76,175,80,.2);   color:#80c883; }
.maintenance-state-badge--cancelled { background:rgba(136,136,136,.2); color:#aaa; }

/* ── Generic data table ───────────────────────────────────────────────────── */
.data-table { width:100%; border-collapse:collapse; font-size:.875rem; }
.data-table th { text-align:left; padding:.5rem .75rem; border-bottom:1px solid var(--border); color:var(--text-muted); font-weight:600; white-space:nowrap; }
.data-table td { padding:.5rem .75rem; border-bottom:1px solid rgba(255,255,255,.05); vertical-align:middle; }
.data-table tr:last-child td { border-bottom:none; }
.settings-modal-body .form-control[readonly] {
    background-color: var(--bg-input);
    border-color: var(--border);
    color: var(--text-primary);
}
.settings-modal-body .form-control:focus {
    background-color: var(--bg-input);
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 0 0 2px rgba(224,64,251,.25);
}
.settings-modal-body .form-floating > label {
    color: var(--text-muted);
}
.settings-modal-body .form-floating > .form-control:not(:placeholder-shown) ~ label,
.settings-modal-body .form-floating > .form-control:focus ~ label {
    color: var(--accent);
}
.settings-modal-body .input-group-text {
    background-color: var(--bg-card);
    border-color: var(--border);
    color: var(--success);
}

/* personal data button row */
.personal-data-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
}

/* load-older-messages row shown at top of chat history */
.load-older-row {
    display: flex;
    justify-content: center;
    padding: .5rem 0;
}

/* ── Private messaging ─────────────────────────────────────────────────────── */
/* Badge on the DM header icon */
.dm-icon-btn { position: relative; }
.dm-unread-badge {
    position: absolute; top: -5px; right: -6px;
    background: var(--danger, #e05); color: #fff;
    font-size: .65rem; font-weight: 700; line-height: 1;
    padding: 2px 5px; border-radius: 20px; pointer-events: none;
}

/* DM button in user list rows */
.dm-user-btn {
    background: none; border: 1px solid var(--border); color: var(--text-muted);
    border-radius: 5px; padding: 2px 6px; cursor: pointer; font-size: .8rem;
    flex-shrink: 0; margin-left: auto; opacity: 0; transition: opacity .15s;
}
.users-panel-item:hover .dm-user-btn { opacity: 1; }

/* DM slide-over panel */
.dm-panel-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200;
}
.dm-panel {
    position: fixed; top: 0; right: 0; bottom: 0; width: 320px; max-width: 92vw;
    background: var(--bg-secondary); border-left: 1px solid var(--border);
    display: flex; flex-direction: column; z-index: 201;
    box-shadow: -4px 0 24px rgba(0,0,0,.4);
}
.dm-panel-header {
    display: flex; align-items: center; gap: .5rem;
    padding: .65rem .75rem; border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.dm-panel-header-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dm-panel-title { font-weight: 700; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); }
.dm-panel-subtitle { font-size: .72rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.dm-close-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0; }
.dm-close-btn:hover { color: var(--text-primary); }
.dm-back-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0; }
.dm-back-btn:hover { color: var(--text-primary); }

/* Conversation list */
.dm-conversation-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.dm-empty { color: var(--text-muted); font-size: .85rem; padding: 1rem; text-align: center; }
.dm-conversation-item {
    display: flex; align-items: center; gap: .6rem;
    padding: .6rem .75rem; cursor: pointer; border-bottom: 1px solid var(--border);
    transition: background .12s;
}
.dm-conversation-item:hover { background: var(--bg-card); }
.dm-conversation-item.dm-unread { background: rgba(var(--accent-rgb, 90,120,255),.08); }
.dm-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.dm-avatar-placeholder {
    width: 36px; height: 36px; border-radius: 50%; background: var(--bg-card);
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem; font-weight: 700; color: var(--text-muted); flex-shrink: 0;
}
.dm-conversation-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dm-conversation-name { font-size: .88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-conversation-preview { font-size: .78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-unread-count {
    background: var(--danger, #e05); color: #fff;
    font-size: .7rem; font-weight: 700; border-radius: 12px;
    padding: 2px 6px; flex-shrink: 0;
}

/* Open conversation */
.dm-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .4rem; padding: .6rem .75rem; }
.dm-msg { display: flex; flex-direction: column; max-width: 80%; }
.dm-msg--mine { align-self: flex-end; align-items: flex-end; }
.dm-msg--theirs { align-self: flex-start; align-items: flex-start; }
.dm-msg-bubble {
    padding: .4rem .7rem; border-radius: 14px; font-size: .88rem; word-break: break-word;
}
.dm-msg--mine .dm-msg-bubble { background: var(--accent, #5a78ff); color: #fff; border-bottom-right-radius: 4px; }
.dm-msg--theirs .dm-msg-bubble { background: var(--bg-card); color: var(--text-primary); border-bottom-left-radius: 4px; }
.dm-msg-sender { font-size: .7rem; font-weight: 600; color: var(--text-muted); margin-bottom: 2px; padding: 0 2px; }
.dm-msg-time { font-size: .68rem; color: var(--text-muted); margin-top: 2px; }

/* DM compose row */
.dm-input-row {
    display: flex; align-items: flex-end; gap: .4rem;
    padding: .5rem .6rem; border-top: 1px solid var(--border); flex-shrink: 0;
}
.dm-input {
    flex: 1; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-primary);
    border-radius: 8px; padding: .45rem .6rem; font-size: .88rem; resize: none;
    max-height: 120px; overflow-y: auto; line-height: 1.4;
}
.dm-input:focus { outline: none; border-color: var(--accent, #5a78ff); }
.dm-send-btn {
    background: var(--accent, #5a78ff); color: #fff; border: none;
    border-radius: 8px; padding: .45rem .75rem; cursor: pointer; font-size: 1rem; flex-shrink: 0;
}
.dm-send-btn:disabled { opacity: .45; cursor: not-allowed; }

/* Delete button on conversation list items */
.dm-delete-btn {
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    font-size: .85rem; padding: .2rem .3rem; border-radius: 4px; opacity: 0; transition: opacity .15s, color .15s; flex-shrink: 0;
}
.dm-conversation-item:hover .dm-delete-btn { opacity: 1; }
.dm-delete-btn:hover { color: var(--danger); }

/* Block / Report action buttons in open-DM header */
.dm-action-btn {
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    font-size: 1rem; padding: .2rem .4rem; border-radius: 4px; transition: color .15s;
}
.dm-action-btn:hover { color: var(--text-primary); }
.dm-action-btn.active { color: var(--accent); }

/* Generic modal */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 1100; pointer-events: none;
}
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 1100;
    display: flex; align-items: center; justify-content: center;
}
.modal-dialog {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
    width: min(420px, 90vw); z-index: 1101; display: flex; flex-direction: column; gap: 0;
}
/* Native <dialog> report modal — renders in browser top-layer, above all z-index/overflow */
.report-dialog {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
    width: min(420px, 90vw); padding: 0; color: var(--text-primary);
}
.report-dialog[open] {
    display: flex; flex-direction: column;
}
.report-dialog::backdrop {
    background: rgba(0,0,0,.6);
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .75rem 1rem; border-bottom: 1px solid var(--border); font-weight: 600;
}
.modal-close {
    background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem;
}
.modal-body { padding: .75rem 1rem; display: flex; flex-direction: column; gap: .5rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: .5rem; padding: .6rem 1rem; border-top: 1px solid var(--border); }
/* User profile popup dialog */
.user-profile-dialog {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    width: min(340px, 92vw); padding: 0; color: var(--text-primary);
}
.user-profile-dialog[open] { display: flex; flex-direction: column; }
.user-profile-dialog::backdrop { background: rgba(0,0,0,.55); }
.user-profile-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .65rem 1rem; border-bottom: 1px solid var(--border);
}
.user-profile-body { padding: 1rem; display: flex; flex-direction: column; gap: .75rem; }
.user-profile-avatar-row { display: flex; align-items: center; gap: .85rem; }
.user-profile-avatar-lg { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); flex-shrink: 0; }
.user-profile-avatar-placeholder-lg {
    width: 60px; height: 60px; border-radius: 50%; background: var(--bg-secondary);
    border: 2px solid var(--border); display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; font-weight: 700; color: var(--text-muted); flex-shrink: 0;
}
.user-profile-name { font-weight: 700; font-size: 1.05rem; }
.user-profile-role-badge {
    display: inline-block; padding: .1rem .45rem; border-radius: 4px;
    font-size: .72rem; font-weight: 600; margin-top: .15rem;
}
.user-profile-role-badge--admin { background: var(--accent); color: #fff; }
.user-profile-role-badge--station-admin { background: var(--accent-secondary); color: #fff; }
.user-profile-role-badge--moderator { background: #2563eb; color: #fff; }
.user-profile-bio { font-size: .85rem; color: var(--text-muted); white-space: pre-wrap; }
.user-profile-actions { display: flex; flex-direction: column; gap: .4rem; }
.user-profile-action-btn {
    display: flex; align-items: center; gap: .5rem;
    padding: .45rem .75rem; border-radius: 7px; border: 1px solid var(--border);
    background: var(--bg-secondary); color: var(--text-primary); cursor: pointer;
    font-size: .88rem; transition: background .15s;
}
.user-profile-action-btn:hover { background: var(--border); }
.user-profile-action-btn--danger { border-color: rgba(255,68,68,.4); color: var(--danger); }
.user-profile-action-btn--danger:hover { background: rgba(255,68,68,.12); }
.user-profile-action-btn--warn { border-color: rgba(245,158,11,.4); color: #f59e0b; }
.user-profile-action-btn--warn:hover { background: rgba(245,158,11,.1); }
.user-profile-section-divider {
    border: none; border-top: 1px solid var(--border); margin: .1rem 0;
}
.chat-avatar { cursor: pointer; }
.chat-avatar-placeholder { cursor: pointer; }

/* ── Landing page ─────────────────────────────────────────────────────────── */
.landing-page {
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(124,77,255,.18), transparent 28%), radial-gradient(circle at top right, rgba(224,64,251,.16), transparent 24%), linear-gradient(180deg, #12091f 0%, #0f0f0f 42%, #0f0f0f 100%);
}

.landing-container {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
}

.landing-section {
    padding: 4.5rem 0;
}

.landing-section--alt {
    background: rgba(255,255,255,.02);
    border-top: 1px solid rgba(255,255,255,.04);
    border-bottom: 1px solid rgba(255,255,255,.04);
}

.landing-section--tight {
    padding-top: 2.5rem;
    padding-bottom: 4.5rem;
}

.landing-hero {
    padding: 5.5rem 0 4rem;
}

.landing-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
    gap: 2rem;
    align-items: center;
}

.landing-eyebrow {
    display: inline-block;
    margin-bottom: .9rem;
    color: #d6b3ff;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.landing-hero-copy h1,
.landing-section-heading h2,
.landing-final-cta h2 {
    margin: 0 0 1rem;
    line-height: 1.05;
    letter-spacing: -.03em;
}

.landing-hero-copy h1 {
    font-size: clamp(2.6rem, 6vw, 4.6rem);
    max-width: 12ch;
}

.landing-lead,
.landing-section-heading p,
.landing-final-cta p,
.landing-card p,
.landing-value-card p,
.landing-scenario-panel p,
.landing-preview-placeholder p {
    color: #c7c7d1;
    font-size: 1.02rem;
    line-height: 1.7;
}

.landing-cta-row {
    display: flex;
    gap: .85rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.landing-cta {
    min-height: 44px;
    padding-inline: 1.15rem;
}

.landing-proof-strip {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.5rem;
}

.landing-proof-item {
    padding: .65rem .85rem;
    border-radius: 999px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    color: var(--text-primary);
    font-size: .88rem;
}

.landing-hero-panel,
.landing-card,
.landing-value-card,
.landing-scenario-panel,
.landing-preview-frame-shell,
.landing-final-cta {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
}

.landing-hero-panel {
    padding: 1.5rem;
}

    .landing-hero-panel h2,
    .landing-card h3,
    .landing-value-card h3,
    .landing-scenario-panel h3,
    .landing-preview-placeholder h3 {
        margin-top: 0;
        margin-bottom: .8rem;
    }

.landing-highlight {
    margin-top: 1rem;
    padding: 1rem 1.05rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(224,64,251,.16), rgba(124,77,255,.14));
    border: 1px solid rgba(224,64,251,.18);
}

    .landing-highlight strong {
        display: block;
        margin-bottom: .45rem;
        color: #fff;
    }

    .landing-highlight p {
        margin: 0;
        color: #ddd;
    }

.landing-section-heading {
    max-width: 760px;
    margin-bottom: 1.8rem;
}

.landing-grid {
    display: grid;
    gap: 1rem;
}

.landing-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.landing-card,
.landing-value-card {
    padding: 1.4rem;
}

.landing-split-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.landing-value-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.8rem;
    height: 2.8rem;
    margin-bottom: .85rem;
    border-radius: 14px;
    background: rgba(224,64,251,.14);
    font-size: 1.3rem;
}

.landing-bullet-list {
    margin: 0;
    padding-left: 1.2rem;
    color: #d5d5dd;
    line-height: 1.7;
}

    .landing-bullet-list li + li {
        margin-top: .45rem;
    }

.landing-preview-grid {
    display: grid;
    grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.landing-preview-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.landing-scenario-list {
    display: grid;
    gap: .75rem;
}

.landing-scenario {
    width: 100%;
    text-align: left;
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
    color: var(--text-primary);
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

    .landing-scenario:hover,
    .landing-scenario.is-active {
        transform: translateY(-1px);
        border-color: rgba(224,64,251,.45);
        background: rgba(224,64,251,.08);
    }

.landing-scenario-title {
    display: block;
    font-weight: 700;
    margin-bottom: .25rem;
}

.landing-scenario-subtitle {
    display: block;
    color: var(--text-muted);
    font-size: .88rem;
}

.landing-scenario-panel {
    padding: 1.25rem;
}

.landing-stat-card {
    display: grid;
    gap: .25rem;
    margin: 1rem 0 1.15rem;
    padding: .95rem 1rem;
    border-radius: 16px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.07);
}

.landing-stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
}

.landing-stat-label {
    color: var(--text-muted);
    font-size: .9rem;
    line-height: 1.5;
}

.landing-mini-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.landing-mini-heading {
    display: inline-block;
    margin-bottom: .35rem;
    color: #f0cfff;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.landing-preview-frame-shell {
    overflow: hidden;
    min-height: 680px;
}

.landing-preview-frame-header {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .8rem 1rem;
    background: rgba(0,0,0,.26);
    border-bottom: 1px solid rgba(255,255,255,.06);
    color: #d7d7de;
    font-size: .92rem;
}

.landing-preview-dot {
    width: .72rem;
    height: .72rem;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
}

.landing-preview-frame {
    display: block;
    width: 100%;
    height: calc(680px - 49px);
    border: 0;
    background: #000;
}

.landing-preview-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: .5rem;
    min-height: calc(680px - 49px);
    padding: 2rem;
    background: radial-gradient(circle at top right, rgba(224,64,251,.14), transparent 28%), linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
}

.landing-preview-placeholder-note {
    color: var(--text-muted);
    font-size: .92rem;
}

.landing-final-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.5rem;
}

.landing-cta-row--stack-mobile {
    justify-content: flex-end;
}

@media (max-width: 980px) {
    .landing-hero-grid,
    .landing-split-grid,
    .landing-preview-grid,
    .landing-mini-columns,
    .landing-final-cta {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .landing-grid-3 {
        grid-template-columns: 1fr;
    }

    .landing-preview-frame-shell {
        min-height: 560px;
    }

    .landing-preview-frame,
    .landing-preview-placeholder {
        height: calc(560px - 49px);
        min-height: calc(560px - 49px);
    }

    .landing-final-cta {
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .landing-hero {
        padding-top: 4rem;
    }

    .landing-section {
        padding: 3.5rem 0;
    }

    .landing-container {
        width: min(100% - 1rem, 1180px);
    }

    .landing-cta-row,
    .landing-cta-row--stack-mobile {
        flex-direction: column;
        align-items: stretch;
    }

        .landing-cta-row .btn {
            justify-content: center;
        }

    .landing-preview-frame-shell {
        min-height: 500px;
    }

    .landing-preview-frame,
    .landing-preview-placeholder {
        height: calc(500px - 49px);
        min-height: calc(500px - 49px);
    }
}

.chat-room-watermark {
    align-self: flex-end;
    margin: 0 .85rem .35rem auto;
    font-size: .68rem;
    line-height: 1.2;
    color: rgba(255,255,255,.22);
    text-shadow: 0 1px 2px rgba(0,0,0,.45);
    letter-spacing: .02em;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    z-index: 10;
}

/* ── OBS Browser Source Overlay ──────────────────────────────────── */
/* When accessed via /obs/{key} the page is composited directly in OBS.
   Transparent background lets stream video show through.
   The dark overlay is suppressed so chat text reads cleanly over any scene. */
.obs-mode html,
.obs-mode body {
    background: transparent !important;
}
.obs-mode .chat-room-overlay { display: none; }
.obs-mode .chat-room { background: transparent !important; }
.obs-mode .chat-messages {
    padding: .5rem .75rem;
    gap: .35rem;
    /* Fade older messages out at the top */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 20%);
}
.obs-mode .chat-message { background: transparent !important; }
.obs-mode .chat-message:hover { background: transparent !important; }
.obs-mode .msg-actions { display: none !important; }
