:root {
  /* ── Dark (default) — Linear/GitHub-direction neutral palette ──────────
     Layers separated by luminance, not by shadows. Cards read through
     contrast with the page, not through glow. Shadows stay minimal and
     pure black — never tinted — so nothing haloes around surfaces. */
  --bg:     #0a0a0d;   /* page — deepest layer */
  --bg2:    #16161b;   /* card surface — clear step up from page */
  --bg3:    #2a2a31;   /* border / divider — sits above card */
  --bg4:    #1e1e24;   /* nested / inset surface (inputs, tables) */
  --purple: #9147ff; --purp2: #7c35e6; --purp-glow: rgba(145,71,255,.15);
  --text:   #f2f2f5; --text2: #b4b4c0; --text3: #75758a;
  --green:  #22c55e; --red: #ef4444; --yellow: #f59e0b; --spotify: #1db954;
  --border:      rgba(255,255,255,.08);
  --border-hov:  rgba(145,71,255,.28);
  /* Neutral, two-layer shadows. No color, no large blurs. Borders do
     the edge work; shadow only hints at lift. */
  --card-shadow: 0 1px 0 rgba(0,0,0,.3);
  --card-shadow-hover: 0 1px 0 rgba(0,0,0,.3), 0 4px 12px rgba(0,0,0,.25);
  --glow-purple: 0 0 0 transparent;
  --overlay: rgba(0,0,0,.55);
  --scrim:   rgba(11,11,14,.85);
  /* Unified aliases that mirror public.css semantic names — new code should
     prefer these; legacy --bg/--text/--purple keep working unchanged. */
  --surface:     var(--bg2);
  --surface-2:   var(--bg4);
  --surface-3:   var(--bg3);
  --line:        var(--border);
  --line-2:      var(--border-hov);
  --ink:         var(--text);
  --ink-2:       var(--text2);
  --ink-3:       var(--text3);
  --accent:      var(--purple);
  --accent-2:    var(--purp2);
  --accent-ink:  #ffffff;
  --accent-soft: var(--purp-glow);
  --accent-ring: rgba(145,71,255,.35);
  /* Legacy aliases — a handful of rules (notably the Guide tab) reference
     these names. Without them they fell back to browser defaults. */
  --text1:      var(--text);
  --text-muted: var(--text3);
  color-scheme: dark;
}
html[data-theme="light"] {
  /* ── Light — cool neutrals (Linear/Stripe direction) ─────────────────
     Single cool undertone across bg / cards / borders / text so warm
     cards don't fight cold borders. Accent tuned for AA on white. */
  --bg:     #f7f8fa;       /* page bg — slight cool tint */
  --bg2:    #ffffff;       /* cards — pure white */
  --bg3:    #e5e7eb;       /* card borders / row hover */
  --bg4:    #f1f3f5;       /* nested surface / table header */
  --purple: #7c3aed;       /* violet-600, balanced saturation */
  --purp2:  #6d28d9;       /* darker hover */
  --purp-glow: rgba(124,58,237,.12);
  --text:   #0f172a;       /* slate-900 */
  --text2:  #475569;       /* slate-600 */
  --text3:  #94a3b8;       /* slate-400 */
  --green:  #16a34a;
  --red:    #dc2626;
  --yellow: #ca8a04;
  --spotify:#1db954;
  --border:      rgba(15,23,42,.08);
  --border-hov:  rgba(124,58,237,.28);
  --card-shadow: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
  --card-shadow-hover: 0 2px 6px rgba(15,23,42,.05), 0 10px 22px rgba(15,23,42,.08);
  --glow-purple: 0 0 0 transparent;
  --overlay: rgba(15,23,42,.40);
  --scrim:   rgba(247,248,250,.85);
  --accent-ring: rgba(124,58,237,.28);
  color-scheme: light;
}
/* Smooth theme switch — only transitions colors, not layout, to avoid jank. */
html, body, .sidebar, .topbar, .card, .bot-card, .modal, .site-footer {
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
@media (prefers-reduced-motion: reduce) {
  html, body, .sidebar, .topbar, .card, .bot-card, .modal, .site-footer {
    transition: none !important;
  }
}
/* Sidebar surfaces use rgba in the base stylesheet — override explicitly for light */
html[data-theme="light"] .sidebar {
  background: rgba(255,255,255,.85) !important;
  border-right-color: var(--border) !important;
  box-shadow: 1px 0 4px rgba(18,18,22,.04) !important;
}
html[data-theme="light"] .bot-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
}
html[data-theme="light"] .site-footer {
  box-shadow: 0 -1px 2px rgba(18,18,22,.04);
}
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: #cbd5e1; }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: var(--purple); }
html[data-theme="light"] .badge.bg-gray { background: #e5e7eb !important; color: var(--text2) !important; }
html[data-theme="light"] .modal-backdrop { background: var(--overlay) !important; }
html[data-theme="light"] input, html[data-theme="light"] select, html[data-theme="light"] textarea {
  background: #fff !important; color: var(--text) !important;
  border-color: var(--border) !important;
}
html[data-theme="light"] input:focus, html[data-theme="light"] select:focus, html[data-theme="light"] textarea:focus {
  border-color: var(--purple) !important; box-shadow: 0 0 0 3px var(--purp-glow) !important;
}
/* Search wrappers own the border — don't double up on the inner <input> */
html[data-theme="light"] .sidebar-search-input:focus,
html[data-theme="light"] .dash-sc-search-input:focus,
.sidebar-search-input:focus,
.dash-sc-search-input:focus {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}
html[data-theme="light"] .btn-ghost { border-color: var(--border) !important; color: var(--text2) !important; }
html[data-theme="light"] .btn-ghost:hover { border-color: var(--purple) !important; color: var(--purple) !important; }
html[data-theme="light"] code, html[data-theme="light"] pre { background: var(--bg4) !important; color: var(--text) !important; }

/* ─── Light-mode component fixes (sidebar search, modules filter, sniper tracker, premium lounge, multichat) ───── */
/* Sidebar search: make the idle border visible and softer on focus */
html[data-theme="light"] .sidebar-search-box {
  background: #fff !important;
  border-color: var(--border) !important;
}
html[data-theme="light"] .sidebar-search-box:focus-within {
  border-color: var(--purple) !important;
  box-shadow: none !important;
}
html[data-theme="light"] .sidebar-search-input { color: var(--text) !important; }
/* Dashboard Quick-Search (Sniper) — same treatment as sidebar search */
html[data-theme="light"] .dash-sc-search-box {
  background: #fff !important;
  border: 1px solid var(--border) !important;
}
html[data-theme="light"] .dash-sc-search-box:focus-within {
  border-color: var(--purple) !important;
  box-shadow: none !important;
}
html[data-theme="light"] .dash-sc-search-input { color: var(--text) !important; background: transparent !important; }
html[data-theme="light"] .dash-sc-search-input::placeholder { color: var(--text3) !important; }
html[data-theme="light"] .dash-sc-search-box svg { color: var(--text3) !important; }
html[data-theme="light"] .dash-sc-search-box:focus-within svg { color: var(--purple) !important; }

/* Modules platform filter: "Alle" pill uses var(--accent) which isn't set — fall back */
html[data-theme="light"] .mod-filter-pill {
  background: #e5e7eb !important; color: var(--text2) !important;
  border: 1px solid var(--border);
}
html[data-theme="light"] .mod-filter-pill.active {
  background: var(--purple) !important; color: #fff !important;
  border-color: var(--purple) !important;
}
html[data-theme="light"] .mod-filter-pill.mod-plat-twitch  { background: #9146FF !important; color: #fff !important; }
html[data-theme="light"] .mod-filter-pill.mod-plat-kick    { background: #53FC18 !important; color: #0e0e10 !important; }
html[data-theme="light"] .mod-filter-pill.mod-plat-youtube { background: #FF0000 !important; color: #fff !important; }
/* Same fix for dark mode when "Alle" is active (was invisible on dark bg too) */
.mod-filter-pill { background: var(--bg3); color: var(--text2); border: 1px solid var(--border); transition: background .15s, color .15s; }
.mod-filter-pill:not(.mod-plat-twitch):not(.mod-plat-kick):not(.mod-plat-youtube).active {
  background: var(--purple); color: #fff; border-color: var(--purple);
}

/* Sniper Server/Spieler Tracker: new-player sub-table needs visible row backgrounds */
html[data-theme="light"] .sc-detect-row td {
  border-top-color: var(--border) !important;
}
html[data-theme="light"] table { color: var(--text); }
html[data-theme="light"] table thead th,
html[data-theme="light"] .tbl-wrap thead th {
  background: var(--bg4) !important;
  color: var(--text2) !important;
  border-bottom: 1px solid var(--border) !important;
}
html[data-theme="light"] table tbody tr:hover,
html[data-theme="light"] .tbl-wrap tbody tr:hover { background: var(--bg4) !important; }
html[data-theme="light"] table tbody tr,
html[data-theme="light"] .tbl-wrap tbody tr { border-bottom-color: var(--border) !important; }
/* Orange "neue Spieler" playtime indicator — keep colour but darker for contrast */
html[data-theme="light"] .sc-new-hours { color: #ca8a04 !important; }
html[data-theme="light"] a { color: var(--purple); }
html[data-theme="light"] a:hover { color: var(--purp2); }

/* Premium page: keep badge tint warm in light mode; the new editorial header
   uses solid type + a single accent rule and needs no theme override. */
html[data-theme="light"] .badge-donator { background: rgba(194,145,8,.14) !important; color: #8a6608 !important; }

/* Multi-Chat: all the panels use bg2/bg4 borders which are now light, but the
   chat feed, sidebar sections and event panel need explicit overrides so the
   nested cards don't disappear into the page background. */
html[data-theme="light"] .mc-tab-panel  { background: var(--bg) !important; }
html[data-theme="light"] .mc-main,
html[data-theme="light"] .mc-alerts-panel {
  background: var(--bg2) !important;
  border-color: var(--border) !important;
  box-shadow: var(--card-shadow);
}
html[data-theme="light"] .mc-alerts-header { border-bottom-color: var(--border) !important; color: var(--text2) !important; }
html[data-theme="light"] .mc-auth-card,
html[data-theme="light"] .mc-channels-card,
html[data-theme="light"] .mc-activity-card,
html[data-theme="light"] .mc-settings-card,
html[data-theme="light"] .mc-monitor-card {
  background: var(--bg2) !important; border: 1px solid var(--border) !important;
}
html[data-theme="light"] .mc-channel-row { border-color: var(--border) !important; }
html[data-theme="light"] .mc-channel-row:hover { background: var(--bg4) !important; }
html[data-theme="light"] .mc-alert:hover { background: var(--bg4) !important; }
html[data-theme="light"] .mc-resize-handle::after { background: #d4d4dc !important; }
html[data-theme="light"] .mc-alerts-clear:hover { color: var(--text) !important; }
/* Event-category labels in the right panel need dark text in light mode */
html[data-theme="light"] .mc-alert-filter-btn { color: var(--text2) !important; border-color: var(--border) !important; }
html[data-theme="light"] .mc-alert-filter-btn.active { color: var(--text) !important; background: var(--bg4) !important; }
/* Channel "LIVE" pill keeps its red for both modes (readable on either bg) */

/* Generic: any inline style="background:var(--bg2)" etc. that already matches dark
   will now correctly resolve to the light token — no change needed.
   The remaining gap was components hard-coding rgba(24,24,27,.xx) which we
   explicitly patched above. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', sans-serif; font-size: 14px; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple); }

.sc-detect-row td { border-top: 1px solid var(--border); }


/* ── Sidebar Nav ── */
/* ── Sidebar (refined) ──────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 220px;
  z-index: 100;
  display: flex; flex-direction: column;
  background: var(--bg2);
  border-right: 1px solid var(--bg3);
  transition: width .25s cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
  isolation: isolate;
}
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 260px;
  background: radial-gradient(ellipse 80% 100% at 50% 0%, rgba(145,70,255,.10) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.sidebar > * { position: relative; z-index: 1; }

.sidebar-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 14px 12px;
  flex-shrink: 0;
}
.sidebar-logo {
  font-size: 16px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
  letter-spacing: -.02em;
  cursor: pointer;
  white-space: nowrap; overflow: hidden;
  transition: color .2s;
}
.sidebar-logo:hover { color: var(--purple); }
.sidebar-logo img {
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--bg3), 0 6px 16px -6px rgba(145,70,255,.45);
  transition: box-shadow .2s;
}
.sidebar-logo:hover img {
  box-shadow: 0 0 0 1px var(--purple), 0 8px 22px -6px rgba(145,70,255,.65);
}

.sidebar-toggle {
  background: none; border: none; color: var(--text3);
  cursor: pointer;
  padding: 7px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: color .15s, background .15s;
}
.sidebar-toggle:hover { color: var(--purple); background: rgba(145,70,255,.08); }

.sidebar-search { padding: 0 12px 10px; flex-shrink: 0; }
.sidebar-search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg3);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 12px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.sidebar-search-box:focus-within {
  border-color: var(--purple);
  background: var(--bg);
  box-shadow: 0 0 0 3px rgba(145,70,255,.12);
}
.sidebar-search-icon { color: var(--text3); flex-shrink: 0; transition: color .2s; }
.sidebar-search-box:focus-within .sidebar-search-icon { color: var(--purple); }
.sidebar-search-input { background: none; border: none; outline: none; color: var(--text); font-size: 12px; font-family: inherit; padding: 9px 0; width: 100%; }
.sidebar-search-input::placeholder { color: var(--text3); }

.sidebar-user {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  margin: 4px 0;
  padding: 8px 10px;
  border-radius: 10px;
  flex-shrink: 0;
  overflow: hidden;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--bg3);
  transition: border-color .2s;
}
.sidebar-user:hover { border-color: rgba(145,70,255,.25); }
.sidebar-user .nav-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg3);
  flex-shrink: 0;
  transition: border-color .2s;
}
.sidebar-user:hover .nav-avatar { border-color: var(--purple); }
.sidebar-user .nav-name {
  font-weight: 600; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.sidebar-user .nav-badge {
  font-size: 9px; font-weight: 700;
  background: var(--purple); color: #fff;
  border-radius: 999px;
  padding: 2px 7px;
  letter-spacing: .06em;
  text-transform: uppercase;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(145,70,255,.30);
}

.nav-tabs {
  display: flex; flex-direction: column; gap: 1px;
  padding: 8px 10px;
  flex: 1;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-gutter: stable;
}

.tab-btn {
  position: relative;
  background: none; border: none;
  border-left: 2px solid transparent;
  cursor: pointer;
  color: var(--text3);
  font-size: 13px; font-weight: 500;
  font-family: inherit;
  padding: 9px 14px;
  height: auto;
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 0 10px 10px 0;
  transition: color .2s, background .2s, border-color .2s;
}
.tab-btn::before {
  content: "";
  position: absolute;
  left: -2px; top: 50%;
  width: 2px;
  height: 0;
  background: var(--purple);
  border-radius: 0 2px 2px 0;
  transform: translateY(-50%);
  transition: height .25s cubic-bezier(.2,.8,.2,1);
}
.tab-btn:hover { color: var(--text); background: rgba(145,70,255,.06); }
.tab-btn:hover::before { height: 50%; }
.tab-btn.active {
  color: var(--purple);
  border-left-color: var(--purple);
  font-weight: 600;
  background: linear-gradient(90deg, rgba(145,70,255,.14), rgba(145,70,255,.04) 80%, transparent);
}
.tab-btn.active::before { height: 0; }
.tab-btn .tab-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: .7;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .2s, filter .2s;
}
.tab-btn.active .tab-icon {
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(145,70,255,.45));
}

.sidebar-label { overflow: hidden; white-space: nowrap; transition: opacity .15s; }

.sidebar-bottom {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--bg3);
  background: linear-gradient(180deg, transparent, rgba(145,70,255,.04));
  display: flex; flex-direction: column; gap: 8px;
  flex-shrink: 0;
}
.sidebar-bottom .nav-lang-btns {
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

.nav-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid var(--bg3); }
.nav-name { font-weight: 600; }
.nav-badge { font-size: 11px; font-weight: 700; background: var(--purple); color: #fff; border-radius: 20px; padding: 2px 8px; }

.nav-btn {
  background: none;
  border: 1px solid var(--bg3);
  border-radius: 8px;
  color: var(--text3);
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  padding: 7px 12px;
  cursor: pointer;
  transition: all .2s;
  width: 100%;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
}
.nav-btn-logout:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(244,67,54,.08);
  box-shadow: 0 2px 8px rgba(244,67,54,.15);
}
.nav-btn-feedback:hover {
  border-color: var(--purple);
  color: var(--purple);
  background: rgba(145,70,255,.08);
  box-shadow: 0 2px 8px rgba(145,70,255,.20);
}

.nav-lang-btns { display: flex; align-items: center; gap: 4px; }
.nav-sc-input { width: 100%; height: 28px; font-size: 12px; padding: 0 8px; border-radius: 6px; }
.nav-sc-btn { height: 28px; padding: 0 10px; font-size: 12px; }

.nav-flag-btn {
  background: none;
  border: 2px solid transparent;
  border-radius: 5px;
  padding: 2px;
  cursor: pointer;
  opacity: .45;
  transition: opacity .15s, border-color .15s, transform .15s;
  display: flex; align-items: center;
}
.nav-flag-btn:hover { opacity: .9; transform: translateY(-1px); }
.nav-flag-btn.active { opacity: 1; border-color: var(--purple); }

.lang-btn {
  background: none;
  border: 2px solid transparent;
  border-radius: 5px;
  padding: 2px;
  cursor: pointer;
  opacity: .45;
  transition: opacity .15s, border-color .15s;
  display: inline-flex; align-items: center;
}
.lang-btn:hover { opacity: .9; }
.lang-btn.active { opacity: 1; border-color: var(--purple); }

/* ── Sidebar collapsed ── */
.sidebar.collapsed { width: 56px; }
.sidebar.collapsed .sidebar-label { display: none !important; }
/* Hide nav-tabs scrollbar in collapsed — visible scrollbar would
   shift tab icons left versus search/toggle (no scrollbar). */
.sidebar.collapsed .nav-tabs {
  scrollbar-width: none;
  -ms-overflow-style: none;
  scrollbar-gutter: auto;
}
.sidebar.collapsed .nav-tabs::-webkit-scrollbar { width: 0; height: 0; display: none; }
.sidebar-search-collapsed-btn { display: none; }
.sidebar.collapsed .sidebar-search { display: flex !important; justify-content: center; align-items: center; padding: 0; margin: 0 auto 4px; width: 100%; }
.sidebar.collapsed .sidebar-search-box { display: none; }
.sidebar.collapsed .sidebar-search-collapsed-btn { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: none; border: none; color: var(--text3); cursor: pointer; transition: color .15s, background .15s; }
.sidebar.collapsed .sidebar-search-collapsed-btn:hover { color: var(--purple); background: rgba(145,70,255,.08); }
.sidebar.collapsed .sidebar-user .nav-name,
.sidebar.collapsed .sidebar-user .nav-badge { display: none; }
.sidebar.collapsed .sidebar-top { flex-direction: column; align-items: center; padding: 10px 0 2px; gap: 2px; }
.sidebar.collapsed .sidebar-logo { justify-content: center; }
.sidebar.collapsed .sidebar-logo img { width: 32px !important; height: 32px !important; }
.sidebar.collapsed .sidebar-logo span { display: none; }
.sidebar.collapsed .sidebar-toggle { width: 38px; height: 38px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 10px; margin: 0 auto; }
.sidebar.collapsed .sidebar-search-collapsed-btn { margin: 0 auto; }
.sidebar.collapsed .nav-tabs { padding: 4px 0; align-items: center; justify-content: flex-start; gap: 1px; width: 100%; }
.sidebar.collapsed .tab-btn {
  position: static;
  justify-content: center;
  padding: 0;
  width: 38px; height: 38px;
  min-width: 38px; max-width: 38px;
  border-left: none;
  border-radius: 10px;
  gap: 0;
  margin: 0;
  box-sizing: border-box;
  flex-shrink: 0;
}
.sidebar.collapsed .tab-btn::before { display: none; }
.sidebar.collapsed .tab-btn.active { border-left: none; background: rgba(145,70,255,.16); box-shadow: inset 0 0 0 1px rgba(145,70,255,.30); }
.sidebar.collapsed .tab-btn .tab-icon,
.sidebar.collapsed .tab-btn .tab-icon svg { margin: 0 auto; }
.sidebar.collapsed .tab-btn .tab-icon { width: 18px; height: 18px; }
.sidebar.collapsed .tab-btn .tab-icon svg { width: 18px; height: 18px; display: block; margin: 0 auto; }
.sidebar.collapsed .sidebar-bottom { padding: 8px 0 12px; align-items: center; gap: 4px; }
.sidebar.collapsed .sidebar-user { justify-content: center; padding: 2px 0; }
.sidebar.collapsed .nav-lang-btns { flex-direction: column; gap: 2px; }
.sidebar.collapsed .nav-btn { font-size: 0; padding: 0; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border: none; border-radius: 10px; gap: 0; }
.sidebar.collapsed .nav-btn .sidebar-label { display: none; }
.sidebar.collapsed .nav-btn-feedback { display: flex; }
.sidebar.collapsed .nav-btn-feedback svg { width: 18px; height: 18px; }
.sidebar.collapsed .nav-btn-feedback:hover { background: rgba(145,70,255,.1); }
.sidebar.collapsed .nav-btn-logout::before { content: ''; display: block; width: 18px; height: 18px; flex-shrink: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b6b7b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E") no-repeat center; }
.sidebar.collapsed .nav-btn-logout:hover { border: none; background: rgba(244,67,54,.08); }
body.sidebar-collapsed #page-app { padding-left: 56px; }
body.sidebar-collapsed .site-footer.has-sidebar { margin-left: 56px; }
body.sidebar-collapsed .mc-tab-panel { left: 56px; }
body.sidebar-collapsed .modal-backdrop:not(.modal-inline) { left: 56px; }
body.sidebar-collapsed #sc-profile { left: 56px !important; }

/* ── Footer (refined to match public landing) ── */
.site-footer {
  position: relative;
  background: var(--bg2);
  border-top: 1px solid var(--bg3);
  padding: 7px 24px;
  font-size: 11px;
  color: var(--text3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px 18px;
  flex-wrap: wrap;
  flex-shrink: 0;
  transition: margin-left .25s cubic-bezier(.2,.8,.2,1);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: -1px; left: 50%;
  transform: translateX(-50%);
  width: min(480px, 60%);
  height: 1px;
  background: linear-gradient(to right,
    transparent,
    rgba(145,70,255,.40),
    transparent);
  pointer-events: none;
}
.site-footer.has-sidebar { margin-left: 220px; }
.site-footer span { letter-spacing: .005em; }
.site-footer a {
  position: relative;
  color: var(--text3);
  text-decoration: none;
  font-weight: 500;
  transition: color .2s;
}
.site-footer a:hover { color: var(--purple); }
.site-footer a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--purple);
  opacity: 0;
  transform: scaleX(.3);
  transform-origin: center;
  transition: opacity .2s, transform .25s cubic-bezier(.2,.8,.2,1);
}
.site-footer a:hover::after { opacity: .6; transform: scaleX(1); }

/* ── Layout ── */
#page-app { display: flex; flex-direction: column; flex: 1; padding-left: 220px; overflow: hidden; }
#sc-profile { display: flex; flex-direction: column; }
.main { width: 100%; max-width: 100%; padding: 20px 32px; flex: 1; overflow-y: auto; outline: none; min-height: 0; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.chat-tab-panel.active { display: flex; flex-direction: column; }

/* ── Cards ── */
.card { background: var(--bg2); border: 1px solid var(--bg3); border-radius: 14px; padding: 18px; transition: border-color .25s, box-shadow .25s; box-shadow: var(--card-shadow); }
.card:hover { border-color: rgba(145,70,255,.2); box-shadow: var(--card-shadow-hover); }
.card-title { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 12px; }

/* ── Stats ── */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--bg2); border: 1px solid var(--bg3); border-radius: 14px; padding: 16px 18px; transition: border-color .25s, box-shadow .25s, transform .2s; box-shadow: var(--card-shadow); position: relative; overflow: hidden; }
.stat::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--purple), rgba(145,70,255,.2)); opacity: 0; transition: opacity .25s; }
.stat:hover { border-color: rgba(145,70,255,.25); box-shadow: var(--card-shadow-hover); transform: translateY(-2px); }
.stat:hover::before { opacity: 1; }
.stat-label { font-size: 11px; color: var(--text3); margin-bottom: 6px; font-weight: 500; letter-spacing: .02em; }
.stat-val { font-size: 24px; font-weight: 800; background: linear-gradient(135deg, var(--text), var(--purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-sub { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* ── Bot status card ── */
.bot-card { background: linear-gradient(135deg, var(--bg2) 0%, rgba(24,24,27,.95) 100%); border: 1px solid var(--bg3); border-radius: 14px; padding: 14px 20px; display: flex; align-items: center; gap: 16px; margin-bottom: 16px; box-shadow: var(--card-shadow); transition: border-color .25s, box-shadow .25s; }
.bot-card:hover { border-color: rgba(145,70,255,.2); box-shadow: var(--card-shadow-hover); }
.dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; transition: all .4s; }
.dot-on  { background: var(--green); box-shadow: 0 0 12px rgba(0,200,83,.5), 0 0 4px rgba(0,200,83,.8); }
.dot-off { background: var(--text3); box-shadow: none; }
.dot-wait { background: var(--yellow); animation: blink 1s ease-in-out infinite; box-shadow: 0 0 8px rgba(255,167,38,.4); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }
.bot-info { flex: 1; }
.bot-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.bot-sub { font-size: 13px; color: var(--text3); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: none; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; font-family: inherit; padding: 8px 16px; transition: all .2s; white-space: nowrap; }
.btn-purple  { background: var(--purple); color: #fff; box-shadow: 0 2px 8px rgba(145,70,255,.25); }
.btn-purple:hover { background: var(--purp2); box-shadow: 0 4px 16px rgba(145,70,255,.35); transform: translateY(-1px); }
.btn-green   { background: var(--green); color: #fff; box-shadow: 0 2px 8px rgba(0,200,83,.2); }
.btn-green:hover { filter: brightness(1.12); box-shadow: 0 4px 12px rgba(0,200,83,.3); transform: translateY(-1px); }
.btn-red     { background: var(--red); color: #fff; box-shadow: 0 2px 8px rgba(244,67,54,.2); }
.btn-red:hover { filter: brightness(1.12); box-shadow: 0 4px 12px rgba(244,67,54,.3); transform: translateY(-1px); }
.btn-yellow  { background: var(--yellow); color: #fff; }
.btn-yellow:hover { filter: brightness(1.12); }
.btn-ghost   { background: transparent; color: var(--text2); border: 1px solid var(--bg3); }
.btn-ghost:hover { border-color: rgba(145,70,255,.3); color: var(--text); background: rgba(145,70,255,.04); }
.btn-danger  { background: transparent; color: var(--red); border: 1px solid transparent; }
.btn-danger:hover { border-color: var(--red); background: rgba(244,67,54,.08); }
.btn-danger-filled { background: var(--red); color: #fff; border: 1px solid var(--red); }
.btn-danger-filled:hover { background: #d32f2f; border-color: #d32f2f; }
.btn-spotify { background: var(--spotify); color: #fff; }
.btn-sm { font-size: 12px; padding: 5px 12px; border-radius: 6px; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none !important; }

/* ── Section header ── */
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.sec-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; background: linear-gradient(135deg, var(--text), var(--purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ── Inputs ── */
.input { background: var(--bg); border: 1px solid var(--bg3); border-radius: 8px; color: var(--text); font-size: 14px; font-family: inherit; padding: 8px 12px; transition: border-color .2s, box-shadow .2s; width: 100%; }
.input::placeholder { color: var(--text3); }
.input:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(145,70,255,.12); }
select.input { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6b7b' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; appearance: none; }
.input-row { display: flex; gap: 10px; align-items: center; }

/* ── Table ── */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--bg3); }
tbody tr { border-bottom: 1px solid var(--bg3); transition: background .15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(145,70,255,.04); }
tbody td { padding: 12px; vertical-align: middle; }

/* ── Toggle ── */
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: #484852; border-radius: 11px; transition: background .25s; }
.toggle-slider::after { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .25s cubic-bezier(.4,.0,.2,1); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.toggle input:checked + .toggle-slider { background: var(--purple); box-shadow: 0 0 8px rgba(145,70,255,.3); }
.toggle input:checked + .toggle-slider::after { transform: translateX(18px); }
.toggle.toggle-sm { width: 32px; height: 18px; }
.toggle.toggle-sm .toggle-slider { border-radius: 9px; }
.toggle.toggle-sm .toggle-slider::after { width: 12px; height: 12px; left: 3px; top: 3px; }
.toggle.toggle-sm input:checked + .toggle-slider::after { transform: translateX(14px); }

/* ── Variable info popup ── */
.var-info-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(145,70,255,.12);
  border: 1px solid rgba(145,70,255,.28);
  border-radius: 6px;
  color: var(--purple);
  font-size: 11px; font-family: inherit; font-weight: 600;
  letter-spacing: .3px;
  padding: 3px 10px;
  cursor: pointer; flex-shrink: 0;
  transition: background-color .12s, border-color .12s;
}
.var-info-btn:hover { background: rgba(145,70,255,.22); border-color: rgba(145,70,255,.5); }
.var-info-btn-icon {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; opacity: .85; letter-spacing: -1px;
}
.var-popup { position: absolute; z-index: 200; background: var(--bg2); border: 1px solid var(--bg3); border-radius: 10px; padding: 14px 16px; width: 300px; box-shadow: 0 4px 12px rgba(0,0,0,.2), 0 10px 24px rgba(0,0,0,.25); }
.var-popup-title { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.var-row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 7px; }
.var-tag { font-family: monospace; font-size: 12px; background: var(--bg3); color: var(--purple); border-radius: 4px; padding: 2px 6px; white-space: nowrap; flex-shrink: 0; cursor: pointer; user-select: none; transition: background-color .12s, transform .08s; }
.var-tag:hover { background: rgba(145,70,255,.22); }
.var-tag:active { transform: scale(.96); }
.var-desc { font-size: 12px; color: var(--text2); line-height: 1.4; }

/* ── Variable info popup (Commands tab + generic) — refined ── */
#var-popup, #mod-var-popup {
  width: 380px;
  max-height: min(70vh, 520px);
  padding: 0;
  border-radius: 14px;
  background: var(--bg2);
  border: 1px solid var(--bg3);
  box-shadow: 0 10px 32px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.25);
  display: flex; flex-direction: column;
  overflow: hidden;
}
#var-popup .var-popup-title,
#mod-var-popup .var-popup-title {
  margin: 0;
  padding: 14px 18px 10px;
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .9px;
  color: var(--text2);
  background: var(--bg2);
  border-bottom: 1px solid var(--bg3);
}
#var-popup .var-popup-title::before,
#mod-var-popup .var-popup-title::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 0 3px rgba(145,70,255,.18);
  flex-shrink: 0;
}
#var-popup .var-popup-title::after,
#mod-var-popup .var-popup-title::after {
  content: attr(data-hint);
  margin-left: auto;
  font-size: 10px; font-weight: 500; letter-spacing: .3px;
  text-transform: none; color: var(--text3);
  opacity: .85;
}
#var-popup .var-row,
#mod-var-popup .var-row {
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr;
  gap: 12px;
  align-items: center;
  margin: 0;
  padding: 8px 14px;
  border-radius: 0;
  border-top: 1px solid var(--bg3);
  transition: background-color .12s;
}
#var-popup .var-row:first-of-type,
#mod-var-popup .var-row:first-of-type { border-top: 0; padding-top: 10px; }
#var-popup .var-row:hover,
#mod-var-popup .var-row:hover { background: rgba(145,70,255,.06); }
#var-popup .var-tag,
#mod-var-popup .var-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: rgba(145,70,255,.12);
  color: var(--purple);
  border: 1px solid rgba(145,70,255,.28);
  border-radius: 6px;
  padding: 3px 9px;
  justify-self: start;
  transition: background-color .12s, border-color .12s, transform .08s, box-shadow .12s;
}
#var-popup .var-tag:hover,
#mod-var-popup .var-tag:hover {
  background: rgba(145,70,255,.22);
  border-color: rgba(145,70,255,.5);
  box-shadow: 0 0 0 3px rgba(145,70,255,.08);
}
#var-popup .var-tag:active,
#mod-var-popup .var-tag:active { transform: scale(.96); }
#var-popup .var-desc,
#mod-var-popup .var-desc { font-size: 12px; color: var(--text2); line-height: 1.5; }
#var-popup .var-popup-rows,
#mod-var-popup .var-popup-rows {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 0 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--bg3) transparent;
}
#var-popup .var-popup-rows::-webkit-scrollbar,
#mod-var-popup .var-popup-rows::-webkit-scrollbar { width: 8px; }
#var-popup .var-popup-rows::-webkit-scrollbar-track,
#mod-var-popup .var-popup-rows::-webkit-scrollbar-track { background: transparent; }
#var-popup .var-popup-rows::-webkit-scrollbar-thumb,
#mod-var-popup .var-popup-rows::-webkit-scrollbar-thumb {
  background: var(--bg3);
  border-radius: 4px;
  opacity: .7;
}
#var-popup .var-popup-rows::-webkit-scrollbar-thumb:hover,
#mod-var-popup .var-popup-rows::-webkit-scrollbar-thumb:hover { background: var(--bg3); }

/* ── Badge ── */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 6px; white-space: nowrap; letter-spacing: .02em; }
.bg-green   { background: rgba(0,200,83,.13); color: var(--green); }
.bg-red     { background: rgba(244,67,54,.13); color: var(--red); }
.bg-purple  { background: rgba(145,70,255,.13); color: var(--purple); }
.bg-gray    { background: var(--bg3); color: var(--text3); }
.bg-yellow  { background: rgba(255,167,38,.13); color: var(--yellow); }
.bg-spotify { background: rgba(29,185,84,.13); color: var(--spotify); }
.ch-pill { display: inline-flex; align-items: center; font-size: 12px; color: var(--purple); font-weight: 600; background: rgba(145,70,255,.1); border-radius: 20px; padding: 3px 10px; }
.ch-live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 7px; flex-shrink: 0; }
.ch-live-dot.live { background: #3ddc3d; box-shadow: 0 0 5px #3ddc3d99; }
.ch-live-dot.offline { background: var(--text3); }

/* ── Log ── */
.log-list { display: flex; flex-direction: column; gap: 1px; }
.log-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 8px; transition: background .15s; font-size: 13px; }
.log-row:hover { background: rgba(145,70,255,.04); }
.log-time { color: var(--text3); font-size: 11px; white-space: nowrap; min-width: 78px; padding-top: 2px; }
.log-ch { color: var(--purple); font-size: 11px; font-weight: 600; min-width: 90px; padding-top: 2px; }
.log-msg { flex: 1; color: var(--text2); }

/* ── Settings rows ── */
.srow { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.slabel { font-weight: 600; }
.sdesc  { font-size: 12px; color: var(--text3); margin-top: 3px; }

/* ── Shared overlay-editor patterns (Spotify, Subathon, Win Challenge, Multichat) ── */
.editor-section-title {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text3);
  margin: 18px 0 8px;
}
.editor-section-title:first-child { margin-top: 6px; }
.editor-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px 14px; margin-bottom: 14px;
}
.editor-grid .editor-field { margin: 0; }
.editor-grid .editor-field.span-2 { grid-column: span 2; }
.editor-field > span { display: block; font-size: 12px; color: var(--text2); margin-bottom: 4px; }
.editor-field > .input { width: 100%; }
.editor-field > input[type=color].input { height: 34px; padding: 2px; }
.editor-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-bottom: 14px; }
.editor-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 6px 10px;
  background: var(--bg2); border: 1px solid var(--bg3); border-radius: 8px;
  font-size: 13px; color: var(--text2);
}
.editor-toggle-row > span { flex: 1; min-width: 0; }

/* Bubble controls — shared color-swatch + opacity-slider pattern (Subathon, Multichat, Spotify, Win Challenge) */
.editor-bubble-controls {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px;
  background: var(--bg2); border: 1px solid var(--bg3); border-radius: 8px;
  margin-top: 6px;
}
.editor-color-swatch {
  position: relative; flex: 0 0 auto;
  width: 28px; height: 28px;
  border-radius: 6px; border: 1px solid var(--bg3);
  cursor: pointer; background: #000;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}
.editor-color-swatch:hover { border-color: var(--purple); transform: scale(1.05); }
.editor-color-swatch input[type="color"] {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: none; padding: 0; margin: 0;
  background: transparent; cursor: pointer; opacity: 0;
}
.editor-color-swatch[data-disabled="1"] { opacity: 0.4; pointer-events: none; }

.editor-opacity-control {
  flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0;
}
.editor-opacity-control input[type="range"] {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; background: var(--bg3); border-radius: 2px;
  cursor: pointer; margin: 0; padding: 0;
}
.editor-opacity-control input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--purple) 0%, var(--purple) var(--editor-opa, 100%), var(--bg3) var(--editor-opa, 100%), var(--bg3) 100%);
}
.editor-opacity-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; margin-top: -5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  cursor: pointer; transition: transform 0.12s;
}
.editor-opacity-control input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
.editor-opacity-control input[type="range"]::-moz-range-track {
  height: 4px; background: var(--bg3); border-radius: 2px; border: none;
}
.editor-opacity-control input[type="range"]::-moz-range-progress {
  height: 4px; background: var(--purple); border-radius: 2px;
}
.editor-opacity-control input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4); cursor: pointer;
}
.editor-opacity-control input[type="range"]:disabled { opacity: 0.4; cursor: not-allowed; }
.editor-opacity-control > span {
  font-size: 11px; color: var(--text2);
  font-variant-numeric: tabular-nums;
  min-width: 32px; text-align: right; letter-spacing: 0.3px;
}

/* ── OBS browser-source URL masking — eye toggle button ── */
.btn-eye {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; padding: 0 !important;
  flex: 0 0 auto;
  line-height: 1;
  color: var(--text2);
}
.btn-eye:hover { color: var(--text); }
.btn-eye svg { width: 16px; height: 16px; display: block; }
.btn-eye .icon-eye-open  { display: none; }
.btn-eye .icon-eye-shut  { display: block; }
.btn-eye.revealed .icon-eye-open  { display: block; }
.btn-eye.revealed .icon-eye-shut  { display: none; }
.btn-eye.revealed { color: var(--purple); }
/* Password fields rendering URLs: tighten the dot tracking so the masked
   blob doesn't visually balloon to twice the URL length. */
input[type="password"].input { letter-spacing: 0.05em; }

/* ── User cards (admin panel) ── */
.user-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--bg3); flex-wrap: wrap; }
.user-row:last-child { border-bottom: none; }
.user-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.user-info { min-width: 120px; }
.user-name { font-weight: 700; }
.user-sub  { font-size: 12px; color: var(--text3); margin-top: 2px; }
.user-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.user-channels-list { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.user-ch-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; background: rgba(145,70,255,.1); color: var(--purple); border-radius: 20px; padding: 2px 8px; }
.user-ch-tag button { background: none; border: none; cursor: pointer; color: var(--text3); font-size: 12px; padding: 0 2px; }
.user-ch-tag button:hover { color: var(--red); }
.alias-wrap {
  display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center; align-content: center;
  padding: 7px 10px;
  background: var(--bg1);
  border: 1px solid var(--bg3);
  border-radius: 10px;
  min-height: 42px; max-height: 132px;
  overflow-y: auto;
  cursor: text;
  scrollbar-width: thin; scrollbar-color: var(--bg3) transparent;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.alias-wrap:hover { border-color: var(--bg3); background: var(--bg2); }
.alias-wrap::-webkit-scrollbar { width: 4px; }
.alias-wrap::-webkit-scrollbar-track { background: transparent; }
.alias-wrap::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 4px; }
.alias-wrap:focus-within {
  border-color: var(--purple);
  background: var(--bg2);
  box-shadow: 0 0 0 3px rgba(145,70,255,.12);
}
.alias-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; line-height: 1;
  height: 26px;
  background: rgba(145,70,255,.14);
  color: var(--purple);
  border: 1px solid rgba(145,70,255,.32);
  border-radius: 8px;
  padding: 0 4px 0 10px;
  white-space: nowrap;
  transition: background-color .12s, border-color .12s, transform .08s;
}
.alias-pill:hover { background: rgba(145,70,255,.2); border-color: rgba(145,70,255,.5); }
.alias-pill code {
  background: transparent; padding: 0; color: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; font-weight: 600; letter-spacing: .2px;
}
.alias-pill button {
  background: transparent; border: none; cursor: pointer;
  color: var(--purple); opacity: .7;
  font-size: 16px; line-height: 1; font-weight: 400;
  width: 18px; height: 18px; border-radius: 50%;
  padding: 0; display: inline-flex; align-items: center; justify-content: center;
  transition: background-color .12s, color .12s, opacity .12s;
}
.alias-pill button:hover { background: var(--red); color: #fff; opacity: 1; }
.alias-bare-input {
  background: transparent; border: none; outline: none;
  color: var(--text1); font-size: 13px;
  min-width: 120px; flex: 1; padding: 0;
  height: 26px; line-height: 26px;
}
.alias-bare-input:focus,
.alias-bare-input:focus-visible {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}
.alias-bare-input::placeholder { color: var(--text3); opacity: .85; }

/* ── Spotify card ── */
.spotify-card { background: linear-gradient(135deg, rgba(29,185,84,.06), rgba(29,185,84,.02)); border: 1px solid rgba(29,185,84,.2); border-radius: 14px; padding: 20px; display: flex; align-items: center; gap: 16px; transition: border-color .2s, box-shadow .2s; }
.spotify-card:hover { border-color: rgba(29,185,84,.35); box-shadow: 0 4px 20px rgba(29,185,84,.1); }

/* ── Empty state ── */
.empty { text-align: center; padding: 56px 20px; color: var(--text3); }
.empty-icon { font-size: 40px; margin-bottom: 14px; opacity: .8; }
.empty-title { font-weight: 700; color: var(--text2); margin-bottom: 6px; font-size: 15px; }
.empty-sub { font-size: 13px; color: var(--text3); line-height: 1.5; }

/* ── Login / Pending pages ── */
.auth-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(145,70,255,.08) 0%, var(--bg) 65%); position: relative; overflow: hidden; }
.auth-wrap::before { content: ''; position: absolute; width: 600px; height: 600px; border-radius: 50%; background: radial-gradient(circle, rgba(145,70,255,.06) 0%, transparent 70%); top: -200px; right: -100px; pointer-events: none; }
.auth-wrap::after { content: ''; position: absolute; width: 400px; height: 400px; border-radius: 50%; background: radial-gradient(circle, rgba(145,70,255,.04) 0%, transparent 70%); bottom: -100px; left: -50px; pointer-events: none; }
.auth-card { background: rgba(24,24,27,.9); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(42,42,46,.7); border-radius: 20px; padding: 48px 40px; text-align: center; max-width: 420px; width: 100%; box-shadow: 0 4px 16px rgba(0,0,0,.25), 0 16px 40px rgba(0,0,0,.35); position: relative; z-index: 1; }
.auth-logo { width: 150px; height: 150px; margin: 0 auto 20px; background: none; border-radius: 0; display: flex; align-items: center; justify-content: center; }
.auth-logo img { filter: drop-shadow(0 4px 16px rgba(145,70,255,.25)); transition: transform .3s; }
.auth-logo img:hover { transform: scale(1.05); }
.auth-title { font-size: 24px; font-weight: 800; margin-bottom: 8px; letter-spacing: -.02em; }
.auth-sub { color: var(--text3); font-size: 14px; margin-bottom: 28px; line-height: 1.6; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text3); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--bg3); }
.login-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 13px; border-radius: 12px; font-size: 15px; font-weight: 700; font-family: inherit; border: none; cursor: pointer; transition: all .25s; }
.login-btn-twitch { background: linear-gradient(135deg, var(--purple), var(--purp2)); color: #fff; box-shadow: 0 4px 16px rgba(145,70,255,.3); }
.login-btn-twitch:hover { box-shadow: 0 6px 24px rgba(145,70,255,.45); transform: translateY(-2px); }
.pw-row { display: flex; gap: 8px; }
.pw-row .input { border-radius: 8px; }
.auth-note { margin-top: 18px; font-size: 11px; color: var(--text3); line-height: 1.7; }
.auth-lang-row { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.err-box { background: rgba(244,67,54,.08); border: 1px solid rgba(244,67,54,.3); border-radius: 8px; padding: 10px 14px; color: var(--red); font-size: 13px; margin-bottom: 18px; text-align: left; }
.warn-box { background: rgba(255,167,38,.08); border: 1px solid rgba(255,167,38,.3); border-radius: 8px; padding: 14px 16px; color: var(--yellow); font-size: 13px; margin-bottom: 18px; text-align: left; line-height: 1.7; }
.warn-box code { background: rgba(0,0,0,.3); border-radius: 4px; padding: 1px 5px; font-family: Consolas, monospace; font-size: 11px; }
/* Pending page */
.pending-icon { font-size: 56px; margin-bottom: 16px; }
.pending-name { color: var(--purple); font-weight: 700; }

/* ── Toast ── */
#toasts { position: fixed; bottom: 24px; right: 24px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 4px 12px rgba(0,0,0,.2), 0 12px 28px rgba(0,0,0,.25);
  animation: tin .3s cubic-bezier(.4,.0,.2,1);
  max-width: 360px;
  backdrop-filter: blur(8px);
}
.toast.ok   { border-left: 3px solid var(--green);  background: linear-gradient(90deg, rgba(0,200,83,.08),  var(--bg2) 45%); }
.toast.err  { border-left: 3px solid var(--red);    background: linear-gradient(90deg, rgba(244,67,54,.08), var(--bg2) 45%); }
.toast.info { border-left: 3px solid var(--purple); background: linear-gradient(90deg, rgba(145,70,255,.08), var(--bg2) 45%); }
@keyframes tin { from { opacity:0; transform:translateY(8px) scale(.97); } to { opacity:1; transform:translateY(0) scale(1); } }

.mb16 { margin-bottom: 16px; }
.timer-active-item { background: var(--bg3); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; transition: opacity .3s; }
.timer-active-item:last-child { margin-bottom: 0; }
.mb24 { margin-bottom: 16px; }
.flex { display: flex; align-items: center; }
.gap6 { gap: 6px; }
.gap10 { gap: 10px; }
.admin-only { display: none; }

/* ── Global page loader spinner ── */
@keyframes spin { to { transform: rotate(360deg); } }
#page-loader {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 99999; pointer-events: none;
  opacity: 0; transition: opacity 0.15s ease;
}
#page-loader.active { opacity: 1; }
#page-loader::after {
  content: '';
  width: 44px; height: 44px;
  border: 3px solid var(--bg3);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  box-shadow: 0 0 20px rgba(145,70,255,.15);
}

/* ── Dashboard skeleton loader ── */
@keyframes shimmer { 0%{background-position:-400px 0} 100%{background-position:400px 0} }
.dash-skeleton { border-radius: 12px; background: linear-gradient(90deg,var(--bg3) 25%,rgba(145,70,255,.06) 50%,var(--bg3) 75%); background-size: 800px 100%; animation: shimmer 1.6s ease infinite; }

/* ── Page fade-in ── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.tab-panel.active { animation: fadeInUp .3s ease; }

/* ── Dashboard channel cards ── */
/* ── Dashboard ── */
.dash-section-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; margin-bottom: 12px; color: var(--text2); }
.dash-section-head svg { color: var(--purple); flex-shrink: 0; }
.dash-section-head .btn { margin-left: auto; }
.dash-requests-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.dash-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
.dash-sc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dash-sc-search-box { display: flex; align-items: center; gap: 8px; background: var(--bg3); border: 1px solid transparent; border-radius: 10px; padding: 0 12px; transition: border-color .2s; }
.dash-sc-search-box:focus-within { border-color: var(--purple); }
.dash-sc-search-box svg { color: var(--text3); flex-shrink: 0; transition: color .2s; }
.dash-sc-search-box:focus-within svg { color: var(--purple); }
.dash-sc-search-input { background: none; border: none; outline: none; color: var(--text); font-size: 13px; font-family: inherit; padding: 10px 0; width: 100%; }
.dash-sc-search-input::placeholder { color: var(--text3); }

.dash-channel-grid { display: flex; flex-direction: column; gap: 10px; }
.dash-ch-card { background: var(--bg2); border: 1px solid var(--bg3); border-radius: 14px; padding: 14px 18px; box-shadow: var(--card-shadow); transition: border-color .25s, box-shadow .25s, transform .2s; }
.dash-ch-card:hover { border-color: rgba(145,70,255,.2); box-shadow: var(--card-shadow-hover); transform: translateY(-1px); }
.dash-ch-head { display: flex; align-items: center; justify-content: space-between; }
.dash-ch-name { font-weight: 700; font-size: 14px; }
.dash-ch-status { font-size: 12px; color: var(--text3); margin-top: 2px; }
.dash-plat-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid rgba(42,42,46,.4); }
.dash-plat-row:last-child { border-bottom: none; }
.dash-plat-label { font-weight: 600; font-size: 12px; color: var(--text1); flex-shrink: 0; min-width: 56px; }
.dash-plat-status { font-size: 12px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bg-muted { background: var(--bg3); color: var(--text-muted); }
.mod-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.mod-chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 10px; font-size: 11px; line-height: 1.6; }
.mod-chip svg { vertical-align: middle; }
.mod-chip-on  { background: rgba(145,70,255,.12); color: var(--purple); border: 1px solid rgba(145,70,255,.25); }
.mod-chip-off { background: var(--bg3); color: var(--text-muted); opacity: .5; border: 1px solid transparent; }

/* ── System Announcements ── */
.ann-list { display: flex; flex-direction: column; gap: 8px; }
/* ── Guide / Anleitung ── */
.guide-search-wrap { position: relative; margin-bottom: 20px; }
.guide-search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.guide-search { width: 100%; box-sizing: border-box; background: var(--bg2); border: 1px solid var(--bg3); border-radius: 8px; padding: 9px 12px 9px 36px; color: var(--text1); font-size: 13px; outline: none; transition: border-color .15s; }
.guide-search:focus { border-color: var(--purple); }
.guide-search::placeholder { color: var(--text-muted); }

.guide-acc { background: var(--bg2); border: 1px solid var(--bg3); border-radius: 12px; margin-bottom: 12px; overflow: hidden; transition: box-shadow .15s; }
.guide-acc:hover { box-shadow: 0 2px 12px rgba(0,0,0,.18); }
.guide-acc-header { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; user-select: none; }
.guide-acc-header:hover { background: rgba(255,255,255,.03); }
.guide-acc-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.guide-acc-icon.icon-dashboard { background: rgba(59,130,246,.12); color: #3b82f6; }
.guide-acc-icon.icon-modules   { background: rgba(145,70,255,.12); color: var(--purple); }
.guide-acc-icon.icon-settings  { background: rgba(34,197,94,.12); color: #22c55e; }
.guide-acc-icon.icon-sniper    { background: rgba(239,68,68,.12); color: #ef4444; }
.guide-acc-title { font-size: 14px; font-weight: 700; color: var(--text1); flex: 1; }
.guide-acc-badge { font-size: 11px; font-weight: 600; background: var(--bg3); color: var(--text-muted); border-radius: 20px; padding: 2px 8px; }
.guide-acc-chevron { color: var(--text-muted); transition: transform .2s; margin-left: 4px; }
.guide-acc.open .guide-acc-chevron { transform: rotate(180deg); }

.guide-acc-body { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.guide-acc.open .guide-acc-body { max-height: none; }

.guide-section { display: flex; flex-direction: column; gap: 0; padding: 0 18px; }
.guide-item { padding: 13px 0; border-bottom: 1px solid var(--bg3); display: flex; gap: 12px; align-items: flex-start; }
.guide-item:last-child { border-bottom: none; padding-bottom: 16px; }
.guide-item-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--purple); margin-top: 5px; flex-shrink: 0; }
.guide-item-content { flex: 1; }
.guide-label { font-size: 13px; font-weight: 700; color: var(--text1); margin-bottom: 3px; }
.guide-desc { font-size: 13px; color: var(--text3); line-height: 1.6; }
.guide-desc code { background: var(--bg3); border-radius: 4px; padding: 1px 5px; font-size: 12px; color: var(--purple); }
.guide-desc em { color: var(--text2); font-style: normal; font-weight: 600; }
.guide-item.guide-hidden { display: none; }
.guide-acc.guide-acc-hidden { display: none; }

/* ── Guide polish — open-state + hover choreography ─────────────────────── */
.guide-acc { transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.guide-acc.open { border-color: var(--border-hov); }
.guide-acc.open .guide-acc-header { border-bottom: 1px solid var(--border); }
.guide-acc.open .guide-acc-header:hover { background: transparent; }
.guide-acc-body { padding: 0; }
.guide-acc.open .guide-acc-body { padding: 4px 0 8px; }
.guide-item:hover .guide-item-dot { transform: scale(1.6); box-shadow: 0 0 12px var(--purp-glow); }
.guide-item-dot { transition: transform .15s ease, box-shadow .15s ease; }
.guide-label { letter-spacing: -.005em; }
.guide-search:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purp-glow);
}
.ann-card { background: var(--bg2); border: 1px solid var(--bg3); border-left: 3px solid var(--bg3); border-radius: 12px; padding: 12px 16px; box-shadow: var(--card-shadow); transition: border-color .2s, box-shadow .2s; }
.ann-card:hover { box-shadow: var(--card-shadow-hover); }
.ann-card-changelog { border-left-color: var(--purple); }
.ann-card-info      { border-left-color: #3b82f6; }
.ann-card-warning   { border-left-color: var(--yellow); }
.ann-badge { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; margin-right: 6px; }
.ann-badge-changelog { background: rgba(145,70,255,.15); color: var(--purple); }
.ann-badge-info      { background: rgba(59,130,246,.15); color: #3b82f6; }
.ann-badge-warning   { background: rgba(255,167,38,.15); color: var(--yellow); }
.ann-title { font-weight: 600; font-size: 14px; }
.ann-body  { font-size: 13px; color: var(--text3); margin-top: 8px; white-space: pre-wrap; line-height: 1.5; }
.ann-foot  { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.ann-date  { font-size: 11px; color: var(--text-muted); }

/* ── Module cards ── */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }

.module-card {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 10px;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .18s ease, background .18s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  min-height: 138px;
}
.module-card:not(.is-active) {
  background: color-mix(in srgb, var(--bg2) 75%, #6b7280 8%);
  filter: grayscale(.55);
}
.module-card:not(.is-active) .module-icon,
.module-card:not(.is-active) .module-name,
.module-card:not(.is-active) .module-brief { opacity: .5; transition: opacity .18s ease, filter .18s ease; }
.module-card:hover { border-color: rgba(145,70,255,.45); background: var(--bg2); filter: none; }
.module-card:hover .module-icon,
.module-card:hover .module-name,
.module-card:hover .module-brief { opacity: 1; }

.module-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.module-icon {
  font-size: 17px; line-height: 1; flex-shrink: 0;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg3);
  border-radius: 7px;
}
.module-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.module-name { font-weight: 600; font-size: 13.5px; letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.module-brief {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.module-platforms { display: flex; gap: 4px; align-items: center; }
.mod-plat-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.mod-plat-badge { font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 3px; color: #fff; letter-spacing: .02em; line-height: 1.4; }
.mod-plat-twitch  { background: #9146FF; }
.mod-plat-kick    { background: #53FC18; }
.mod-plat-youtube { background: #FF0000; }

.module-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--bg3) 60%, transparent);
}
.module-foot-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.module-status-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  transition: color .18s ease;
}
.module-card.is-active .module-status-label { color: #22c55e; }
.module-card.collapsed .module-chevron { transform: rotate(-90deg); }
.mod-desc-bar { font-size: 12px; color: var(--text3); line-height: 1.5; padding: 12px 16px; background: var(--bg3); border-radius: 8px; margin-bottom: 16px; }

/* ── Modules toolbar (filter pills) ── */
#mod-filter-bar {
  padding: 10px 12px;
  background: color-mix(in srgb, var(--bg2) 60%, transparent);
  border: 1px solid var(--bg3);
  border-radius: 10px;
  margin-bottom: 18px !important;
}

/* ── Module Detail View ── */
.module-detail-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--bg3); }
.module-detail-title { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.module-detail-body { animation: fadeInUp .3s ease; }

/* Inline modal mode — renders module settings inside content flow instead of overlay */
.modal-inline.modal-backdrop { position: relative; inset: auto; left: auto; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; z-index: auto; padding: 0; animation: none; display: block !important; }
.modal-inline .modal-box { max-width: 100%; width: 100%; max-height: none; border: none; border-radius: 0; box-shadow: none; animation: none; background: transparent; }
.modal-inline .modal-hdr { display: none; }
.modal-inline .modal-body { padding: 0; overflow: visible; }
.modal-inline .modal-tabs { margin: 0 0 16px; padding: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg2); overflow: visible; }
.modal-inline .modal-actions { padding: 16px 0; border-top: 1px solid var(--bg3); }

/* ── Modals ── */
.modal-backdrop { position: fixed; inset: 0; left: 220px; background: rgba(0,0,0,.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 200;
                  display: flex; align-items: center; justify-content: center; padding: 16px; animation: modal-bg-in .2s ease; }
@keyframes modal-bg-in { from { opacity: 0; } to { opacity: 1; } }
.modal-box { background: var(--bg); border: 1px solid var(--bg3); border-radius: 18px;
             display: flex; flex-direction: column; max-width: 900px; width: 94%; max-height: 92vh; overflow: hidden;
             box-shadow: 0 1px 0 rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.45);
             animation: modal-in .3s cubic-bezier(.16,1,.3,1); }
.modal-box.modal-sm { max-width: 520px; }
.modal-box.modal-lg { max-width: 960px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: none; } }
/* Header */
.modal-hdr { display: flex; align-items: center; justify-content: space-between;
             padding: 18px 24px; border-bottom: 1px solid var(--bg3); position: relative; background: var(--bg2); border-radius: 18px 18px 0 0; }
.modal-hdr::after { content: ''; position: absolute; bottom: -1px; left: 24px; right: 24px; height: 1px;
                    background: linear-gradient(90deg, var(--purple), rgba(145,70,255,.1), transparent); }
.modal-title { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.modal-hdr .btn-ghost { border: none; color: var(--text3); font-size: 16px; width: 32px; height: 32px; padding: 0;
                        border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.modal-hdr .btn-ghost:hover { background: var(--bg3); color: var(--text); }
/* Body */
.modal-body { flex: 1; overflow-y: auto; padding: 24px; }
/* Unified modal inner layout */
.modal-section { display: flex; flex-direction: column; }
/* Tabs — segmented pill nav, identical visual language to .page-tabs */
.modal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 14px 24px 0;
  padding: 4px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 12px;
  align-self: flex-start;
}
.modal-tabs .tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: auto;
  padding: 8px 14px;
  border: none !important;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  background: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
/* Neutralise the global .tab-btn purple-bar accent + active-gradient so modal
   sub-tabs match the settings/page-tabs pill look. */
.modal-tabs .tab-btn::before,
.modal-tabs .tab-btn:hover::before { display: none !important; }
.modal-tabs .tab-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,.04);
}
.modal-tabs .tab-btn.active {
  color: #fff;
  background: rgba(145,70,255,.22);
  border-bottom-color: transparent !important;
  box-shadow: inset 0 0 0 1px rgba(145,70,255,.55);
}
.modal-tabs .tab-btn:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}
html[data-theme="light"] .modal-tabs { background: #fff; }
html[data-theme="light"] .modal-tabs .tab-btn.active { color: var(--text); background: rgba(145,70,255,.14); box-shadow: inset 0 0 0 1px rgba(145,70,255,.45); }
.modal-inline .modal-tabs { margin: 0 0 16px; }
/* Footer actions */
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; padding: 16px 24px; border-top: 1px solid var(--bg3); }
/* Cards inside modals — subtler than page-level cards */
.modal-body .card { background: var(--bg2); border: 1px solid var(--bg3); }
.modal-body .card:hover { border-color: rgba(145,70,255,.15); box-shadow: none; }
/* Setting row: label + toggle side by side */
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--bg2); border: 1px solid var(--bg3); border-radius: 10px; transition: border-color .2s; }
.setting-row:hover { border-color: rgba(145,70,255,.15); }
.setting-row .setting-text { flex: 1; min-width: 0; }
.setting-row .setting-label { font-size: 13px; font-weight: 600; color: var(--text); }
.setting-row .setting-hint { font-size: 11px; color: var(--text3); margin-top: 2px; line-height: 1.4; }
/* Section title inside modal cards */
.modal-card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-card-title .card-title { margin-bottom: 0; }
/* Hint text under inputs */
.input-hint { font-size: 11px; color: var(--text3); margin-top: 4px; line-height: 1.5; }
/* Form grid inside modals */
.form-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
/* Variables details/summary */
.vars-toggle { margin-top: 8px; }
.vars-toggle > summary { font-size: 12px; color: var(--text3); cursor: pointer; user-select: none; list-style: none; display: flex; align-items: center; gap: 5px; padding: 4px 0; transition: color .15s; }
.vars-toggle > summary:hover { color: var(--text2); }
.vars-toggle > summary > .vars-arrow { font-size: 10px; transition: transform .2s; }
.vars-toggle[open] > summary > .vars-arrow { transform: rotate(90deg); }
.vars-toggle > .vars-content { font-size: 12px; color: var(--text3); margin-top: 4px; padding-left: 15px; line-height: 1.6; }
/* Label above inputs */
.label { font-size: 12px; color: var(--text3); margin-bottom: 5px; display: block; font-weight: 500; }

/* ── Commands table ── */
.cmd-response { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Command form ── */
.cmd-form-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cmd-form-header .card-title { margin: 0; }
.cmd-form-actions { display: flex; gap: 8px; }
.cmd-form-grid { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; margin-bottom: 14px; }
.cmd-field { display: flex; flex-direction: column; gap: 5px; }
.cmd-field-trigger { min-width: 0; }
.cmd-field-cooldown { width: 90px; }
.cmd-field-level { width: 150px; }
.cmd-label { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; }
.cmd-label-row { display: flex; align-items: center; justify-content: space-between; }
.cmd-response-textarea { resize: vertical; min-height: 42px; max-height: 120px; font-family: inherit; line-height: 1.5; }
.cmd-input-suffix { position: relative; display: flex; align-items: center; }
.cmd-input-suffix input { padding-right: 22px; width: 100%; }
.cmd-suffix { position: absolute; right: 10px; color: var(--text3); font-size: 12px; pointer-events: none; }
.cmd-form-bottom { display: flex; gap: 16px; margin-top: 14px; align-items: flex-start; }
.cmd-field-platforms { flex-shrink: 0; }
.cmd-platform-pills { display: flex; gap: 6px; }
.cmd-plat-pill { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid var(--bg3); color: var(--text3); background: var(--bg); transition: all .15s; user-select: none; }
.cmd-plat-pill.active { color: #fff; border-color: transparent; }
.cmd-plat-pill.cmd-plat-twitch.active { background: #9146FF; }
.cmd-plat-pill.cmd-plat-kick.active { background: #53FC18; color: #111; }
.cmd-plat-pill.cmd-plat-youtube.active { background: #FF0000; }
.cmd-plat-pill:not(.cmd-plat-twitch):hover:not(.active) { border-color: var(--text3); color: var(--text2); }

/* ── Sniper/Cheater-Checker ── */
.sc-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 32px; }
.sc-info-item {}
.sc-info-label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.sc-info-val { font-size: 14px; }
.sc-ext-link { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; background: rgba(145,70,255,.12); color: var(--purple); border-radius: 4px; padding: 1px 6px; margin-left: 4px; text-decoration: none; white-space: nowrap; }
.sc-ext-link:hover { background: rgba(145,70,255,.25); }
.sc-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--bg3); padding-bottom: 0; }
.sc-tab { background: none; border: none; color: var(--text2); padding: 8px 14px; cursor: pointer;
          border-bottom: 2px solid transparent; font-size: 13px; font-weight: 500; border-radius: 0; }
.sc-tab:hover { color: var(--text); }
.sc-tab.active { color: var(--purple); border-bottom-color: var(--purple); }
.sc-chat-list { display: flex; flex-direction: column; gap: 2px; }
.sc-chat-row { display: grid; grid-template-columns: 100px 120px 1fr; gap: 8px; align-items: start;
               padding: 4px 0; border-bottom: 1px solid var(--bg3); font-size: 13px; }
.sc-chat-ch { color: var(--purple); font-weight: 600; font-size: 12px; }
.sc-chat-time { color: var(--text3); font-size: 11px; }
.sc-chat-msg { word-break: break-word; }
.sc-chat-row-automod .sc-chat-msg { color: var(--text2); font-style: italic; }
.sc-automod-badge { display: inline-block; background: var(--red, #e74c3c); color: #fff;
                    font-size: 10px; font-weight: 700; letter-spacing: .05em;
                    padding: 1px 6px; border-radius: 4px; margin-right: 6px;
                    text-transform: uppercase; vertical-align: middle; font-style: normal; }
.sc-comment { padding: 10px 0; border-bottom: 1px solid var(--bg3); }
.sc-comment:last-child { border-bottom: none; }
.sc-comment-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.sc-comment-body { font-size: 13px; white-space: pre-wrap; color: var(--text2); }
.sc-result-row:hover { background: var(--bg3); border-radius: 8px; }
.sc-alt-tag { display:inline-flex; align-items:center; background:var(--bg3); border-radius:6px; padding:3px 8px; font-size:12px; }
.sc-col-header { font-size:11px !important; text-transform:uppercase; letter-spacing:.05em; border-bottom:1px solid var(--bg3); padding-bottom:4px; margin-bottom:2px; }
.sc-col-header span { color:var(--text3) !important; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sc-pun-row { display:grid; grid-template-columns:110px 130px 110px 150px 1fr; gap:10px; align-items:center; padding:5px 0; border-bottom:1px solid var(--bg3); font-size:13px; min-width:0; }
.sc-pun-row > span { min-width:0; }
.sc-pun-row > .sc-col-platform { display:none; }

/* ── Chat ── */
.chat-tab-panel { padding: 0 12px !important; }
.chat-layout { display: flex; flex-direction: column; height: calc(100vh - 110px); background: var(--bg2); border: 1px solid var(--bg3); border-radius: 16px; overflow: hidden; box-shadow: 0 2px 16px rgba(0,0,0,.12); }
.chat-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--bg3); background: linear-gradient(135deg, var(--bg2), rgba(145,70,255,.03)); flex-shrink: 0; }
.chat-header-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.chat-header-sub { font-size: 12px; color: var(--text3); }
.chat-messages-wrap { flex: 1; overflow-y: auto; padding: 16px 24px 8px; }
.chat-messages { display: flex; flex-direction: column; gap: 2px; min-height: 100%; justify-content: flex-end; }
.chat-empty { color: var(--text3); font-size: 13px; text-align: center; padding: 48px 0; }
.chat-load-more { text-align: center; padding: 8px 0 16px; }

/* Message groups */
.chat-msg { display: flex; gap: 12px; padding: 4px 8px; border-radius: 10px; position: relative; transition: background .1s; }
.chat-msg.chat-msg-first { margin-top: 14px; }
.chat-msg:hover { background: rgba(145,70,255,.03); }
.chat-msg:hover .chat-msg-actions { opacity: 1; }
.chat-msg-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; margin-top: 1px; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.chat-msg-avatar-spacer { width: 38px; flex-shrink: 0; }
.chat-msg-body { flex: 1; min-width: 0; }
.chat-msg-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.chat-msg-name { font-size: 14px; font-weight: 700; }
.chat-msg-time { font-size: 11px; color: var(--text3); }
.chat-msg-badge { font-size: 10px; font-weight: 700; border-radius: 4px; padding: 1px 6px; }
.badge-admin    { background: rgba(145,70,255,.2); color: var(--purple); }
.badge-streamer { background: rgba(255,167,38,.15); color: #ffa726; }
.badge-mod      { background: rgba(34,197,94,.15);  color: #22c55e; }
.badge-donator  { background: rgba(255,214,0,.15);  color: #ffd600; }
.chat-msg-content { font-size: 14px; color: var(--text); line-height: 1.55; word-break: break-word; white-space: pre-wrap; }
.chat-msg-content a { color: var(--purple); text-decoration: underline; text-underline-offset: 2px; }
.chat-msg-content a:hover { color: #b07aff; }

/* Reply quote */
.chat-reply-quote { background: var(--bg3); border-left: 3px solid var(--purple); border-radius: 0 8px 8px 0; padding: 5px 10px; margin-bottom: 4px; font-size: 12px; color: var(--text3); cursor: pointer; max-width: 480px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; transition: background .1s; }
.chat-reply-quote:hover { background: var(--bg4); }
.chat-reply-quote strong { color: var(--text2); margin-right: 4px; }

/* Reactions */
.chat-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chat-reaction { display: inline-flex; align-items: center; gap: 4px; background: var(--bg3); border: 1px solid transparent; border-radius: 12px; padding: 2px 8px; font-size: 13px; cursor: pointer; transition: border-color .1s, background .1s; user-select: none; position: relative; }
.chat-reaction:hover { border-color: var(--purple); }
.chat-reaction.active { background: rgba(145,70,255,.15); border-color: var(--purple); }
.chat-reaction-count { font-size: 12px; color: var(--text2); font-weight: 600; }
.chat-reaction-tooltip { position: fixed; background: var(--bg); border: 1px solid var(--bg3); border-radius: 7px; padding: 5px 10px; font-size: 12px; color: var(--text2); white-space: nowrap; z-index: 9999; pointer-events: none; box-shadow: 0 3px 10px rgba(0,0,0,.2), 0 8px 20px rgba(0,0,0,.2); transform: translateX(-50%); }

/* Message actions (hover) */
.chat-msg-actions { position: absolute; right: 8px; top: -14px; opacity: 0; display: flex; gap: 2px; background: var(--bg2); border: 1px solid var(--bg3); border-radius: 8px; padding: 3px; box-shadow: 0 2px 8px rgba(0,0,0,.3); transition: opacity .1s; z-index: 10; }
.chat-action-btn { background: none; border: none; cursor: pointer; color: var(--text3); padding: 4px 6px; border-radius: 5px; font-size: 13px; display: flex; align-items: center; gap: 3px; transition: color .1s, background .1s; }
.chat-action-btn:hover { background: var(--bg3); color: var(--text1); }
.chat-action-btn.delete:hover { color: var(--red); }

/* Emoji picker */
.chat-emoji-picker { position: fixed; background: var(--bg2); border: 1px solid var(--bg3); border-radius: 10px; padding: 6px; display: flex; gap: 4px; box-shadow: 0 4px 12px rgba(0,0,0,.2), 0 10px 24px rgba(0,0,0,.2); z-index: 200; }
.chat-emoji-picker button { background: none; border: none; font-size: 20px; cursor: pointer; padding: 4px 6px; border-radius: 6px; transition: background .1s; line-height: 1; }
.chat-emoji-picker button:hover { background: var(--bg3); }

/* Input area */
.chat-input-area { border-top: 1px solid var(--bg3); background: linear-gradient(0deg, var(--bg2), rgba(145,70,255,.01)); padding: 14px 24px; flex-shrink: 0; }
.chat-reply-bar { display: flex; align-items: center; justify-content: space-between; background: var(--bg3); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; font-size: 12px; color: var(--text3); gap: 8px; }
.chat-reply-bar-inner { display: flex; align-items: center; gap: 5px; overflow: hidden; }
.chat-reply-bar-inner svg { flex-shrink: 0; }
.chat-reply-bar strong { color: var(--text2); }
.chat-reply-preview-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-reply-cancel { background: none; border: none; cursor: pointer; color: var(--text3); font-size: 14px; padding: 0 4px; flex-shrink: 0; }
.chat-reply-cancel:hover { color: var(--text1); }
.chat-input-row { display: flex; gap: 10px; align-items: flex-end; }
.chat-textarea { flex: 1; background: var(--bg3); border: 1px solid rgba(145,70,255,.1); border-radius: 12px; color: var(--text); font-size: 14px; font-family: inherit; padding: 10px 14px; resize: none; outline: none; min-height: 44px; max-height: 120px; overflow-y: auto; line-height: 1.4; transition: border-color .2s, box-shadow .2s; }
.chat-textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 2px rgba(145,70,255,.1); }
.chat-textarea::placeholder { color: var(--text3); }
.chat-send-btn { width: 44px; height: 44px; border-radius: 12px; background: var(--purple); border: none; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .15s, transform .1s; }
.chat-send-btn:hover { background: var(--purp2); transform: scale(1.04); }

/* Nav badge for unread */
.nav-chat-badge { background: var(--red); color: #fff; font-size: 10px; font-weight: 700; border-radius: 10px; padding: 1px 5px; margin-left: 4px; vertical-align: middle; }

/* Guide item highlight & commands */
.guide-item-highlight {
  background: rgba(139, 92, 246, 0.08);
  border-radius: 8px;
  transition: background 0.3s;
}
.guide-cmds {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text3);
  line-height: 1.8;
}
.guide-cmds code {
  background: var(--bg3);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text1);
}

/* Birthdays */
.bday-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg3);
  margin-bottom: 6px;
}
.bday-name {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.bday-date {
  font-size: 13px;
  color: var(--text2);
  min-width: 48px;
  text-align: right;
}
.bday-prize-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--bg3);
}
.bday-prize-row:last-child { border-bottom: none; }
.na-restriction-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg3);
  margin-bottom: 6px;
}
.na-row-released {
  opacity: 0.5;
}

/* ── Donator Lounge ── */
/* ────────────────────────────────────────────────────────────────────
   Premium / Donator page
   Style aligned with the rest of the app: standard .page-hero, cards
   with .card-title. Tier columns sit inside a .card as a comparison
   strip with per-tier color-coded top accents. Perk cards mirror
   .module-grid pattern (icon + title + desc + link).
   ──────────────────────────────────────────────────────────────────── */

/* ── Tier grid (inside .card) ──────────────────────────────────────── */
.donator-tier-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.donator-tier-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.donator-tier-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  transition: border-color .18s ease, transform .18s ease;
}
.donator-tier-card::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: var(--text3);
  opacity: .35;
  transition: opacity .18s ease, height .18s ease;
}
.donator-tier-card.tier-t1::before { background: var(--purple); opacity: .7; }
.donator-tier-card.tier-t2::before { background: #d4a017;       opacity: .8; }
.donator-tier-card.tier-m1::before { background: var(--green);  opacity: .7; }

.donator-tier-card:hover {
  border-color: var(--border-hov);
  transform: translateY(-1px);
}
.donator-tier-card:hover::before { opacity: 1; }

.donator-tier-card.donator-tier-active {
  border-color: rgba(34,197,94,.5);
  background: color-mix(in srgb, var(--bg2) 92%, var(--green) 8%);
}
.donator-tier-card.donator-tier-active::before {
  height: 3px;
  background: var(--green);
  opacity: 1;
}
.donator-tier-card.donator-tier-active .donator-tier-cta .btn[disabled] {
  opacity: 1;
  cursor: default;
  background: transparent;
  border: 1px solid var(--green);
  color: var(--green);
}

.donator-tier-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .01em;
  margin-top: 4px;
}

.donator-tier-price {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}
.donator-tier-price-amount {
  font: 800 30px/1 system-ui, -apple-system, sans-serif;
  letter-spacing: -.02em;
  color: var(--text);
}
.donator-tier-price-period {
  font-size: 12.5px;
  color: var(--text3);
  font-weight: 500;
}
.donator-tier-price-note {
  margin: -4px 0 6px;
  font-size: 11px;
  color: var(--text3);
}

.donator-tier-features {
  list-style: none;
  padding: 12px 0 0;
  margin: 0;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text2);
  flex: 1;
}
.donator-tier-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.45;
}
.donator-tier-features li::before {
  content: '✓';
  color: var(--green);
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}
.donator-tier-cta { margin-top: 4px; }
.donator-tier-cta .btn { width: 100%; justify-content: center; }

/* Subscription state banner inside tier-grid */
.donator-sub-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(34,197,94,.08);
  border: 1px solid rgba(34,197,94,.28);
  font-size: 13px;
}
.donator-sub-banner-neutral {
  background: var(--bg);
  border-color: var(--border);
}
.donator-sub-active {
  color: var(--green);
  font-weight: 700;
  margin-right: 10px;
}
.donator-sub-note { color: var(--text2); }

/* ── Perks grid (inside .card) ─────────────────────────────────────── */
.donator-perks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.donator-perk-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.donator-perk-card:hover {
  border-color: var(--border-hov);
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--bg) 92%, var(--purple) 8%);
}
.donator-perk-card:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}
.donator-perk-icon {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--purp-glow);
  color: var(--purple);
  margin-bottom: 4px;
  flex-shrink: 0;
}
.donator-perk-icon svg { display: block; }
.donator-perk-body { min-width: 0; flex: 1; }
.donator-perk-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
  line-height: 1.3;
}
.donator-perk-desc {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.55;
  margin: 0;
}
.donator-perk-link {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--purple);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  transition: gap .15s ease;
}
.donator-perk-link::after {
  content: '→';
  font-size: 12px;
  transition: transform .15s ease;
}
.donator-perk-card:hover .donator-perk-link::after {
  transform: translateX(3px);
}

/* ── MapHider card ──────────────────────────────────────────────────
   Hero strip (icon · meta · CTA) that bleeds into the card edges,
   followed by check-style 2-col features, a compatibility note, and
   a framed config disclosure. */

.donator-mh-card {
  padding: 0;
  overflow: hidden;
}
.donator-mh-hero {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 22px 22px 20px;
  background:
    radial-gradient(ellipse 60% 90% at 0% 50%, rgba(145,71,255,.10) 0%, transparent 65%),
    linear-gradient(180deg, var(--bg2) 0%, var(--bg2) 100%);
  border-bottom: 1px solid var(--border);
}
.donator-mh-icon {
  width: 56px; height: 56px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--purp-glow);
  color: var(--purple);
  border: 1px solid rgba(145,71,255,.22);
  flex-shrink: 0;
}
.donator-mh-icon svg { display: block; }
.donator-mh-meta { min-width: 0; }
.donator-mh-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.donator-mh-name {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--text);
  line-height: 1.2;
}
.donator-mh-badge {
  background: rgba(255,214,0,.15);
  color: #ffd600;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
html[data-theme="light"] .donator-mh-badge {
  background: rgba(194,145,8,.14);
  color: #8a6608;
}
.donator-mh-platform {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: .04em;
  font-variant: small-caps;
}
.donator-mh-desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text2);
  margin: 0;
  max-width: 62ch;
}
.donator-mh-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .donator-mh-hero {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 14px;
    padding: 18px;
  }
  .donator-mh-cta {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }
  .donator-mh-icon { width: 44px; height: 44px; }
  .donator-mh-icon svg { width: 22px; height: 22px; }
}

/* Features grid */
.donator-maphider-features {
  list-style: none;
  padding: 18px 22px 14px;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px 28px;
}
.donator-maphider-feat {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text2);
}
.donator-feat-check {
  display: inline-grid;
  place-items: center;
  width: 18px; height: 18px;
  border-radius: 5px;
  background: rgba(34,197,94,.12);
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Compatibility note */
.donator-mh-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 22px 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.22);
  font-size: 12.5px;
  color: var(--red);
  font-weight: 500;
}
.donator-mh-note svg { flex-shrink: 0; }

/* Config disclosure — chip-style toggle, framed pre when open */
.donator-mh-config {
  padding: 0 22px 22px;
}
.donator-config-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  letter-spacing: .02em;
  padding: 8px 12px;
  user-select: none;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.donator-config-toggle:hover {
  color: var(--text);
  border-color: var(--border-hov);
  background: color-mix(in srgb, var(--bg) 92%, var(--purple) 8%);
}
.donator-config-toggle:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}
.donator-config-toggle-arrow {
  display: inline-block;
  transition: transform .2s ease;
  color: var(--text3);
}
.donator-config-toggle.open .donator-config-toggle-arrow {
  transform: rotate(90deg);
  color: var(--purple);
}
.donator-config-toggle-meta {
  margin-left: auto;
  padding-left: 10px;
  border-left: 1px solid var(--border);
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  letter-spacing: 0;
  text-transform: none;
}
.donator-maphider-code {
  font-family: ui-monospace, "JetBrains Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.65;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 10px 0 0;
  color: var(--text2);
  overflow-x: auto;
  white-space: pre;
}
/* ── Mod Manager ── */
.mod-cards-list { display: flex; flex-direction: column; gap: 12px; }
.mod-card {
  background: var(--bg3);
  border: 1px solid var(--bg4);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .15s;
}
.mod-card:hover { border-color: var(--purple); }
.mod-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--bg4);
  background: var(--bg2);
}
.mod-card-user { display: flex; align-items: center; gap: 10px; }
.mod-card-avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
}
.mod-card-avatar-placeholder {
  background: var(--purple);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff;
}
.mod-card-name { font-weight: 600; font-size: 14px; }
.mod-card-remove { color: var(--text3); display: flex; align-items: center; gap: 5px; }
.mod-card-remove:hover { color: var(--red); }
.mod-perm-groups { padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.mod-perm-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  margin-bottom: 6px;
}
.mod-perm-group-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.mod-perm-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--bg4);
  background: var(--bg2);
  cursor: pointer;
  user-select: none;
  transition: border-color .15s, background .15s;
  font-size: 12px;
  color: var(--text3);
}
.mod-perm-item input { display: none; }
.mod-perm-icon { font-size: 12px; flex-shrink: 0; }
.mod-perm-label { white-space: nowrap; }
.mod-perm-on {
  border-color: rgba(145,70,255,.4);
  background: rgba(145,70,255,.1);
  color: var(--text);
}
.donator-paid-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(244,67,54,.08);
  border: 1px solid rgba(244,67,54,.25);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: #ef9a9a;
  font-weight: 500;
}
.donator-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.donator-service-card {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 10px;
  padding: 20px 18px;
  transition: border-color .2s;
}
.donator-service-card:hover { border-color: var(--purple); }
.donator-service-icon { font-size: 26px; margin-bottom: 10px; }
.donator-service-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.donator-service-desc { font-size: 12px; color: var(--text2); line-height: 1.6; }
/* MapHider config toggle and code styles moved to the new MapHider card
   block above (.donator-mh-config scope) to keep the disclosure visually
   coherent with the rest of the card. */

/* ── Multi-Platform Chat ─────────────────────────────────────────────────── */
.mc-tab-panel {
  position: fixed;
  top: 0;
  left: 220px;
  right: 0;
  bottom: 0;
  padding: 10px 10px 10px;
  box-sizing: border-box;
  background: var(--bg);
  z-index: 50;
}
.mc-tab-panel.active { display: block; }
.mc-layout {
  display: flex;
  gap: 8px;
  height: 100%;
  min-height: 360px;
  width: 100%;
}
.mc-sidebar {
  width: 300px;
  min-width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  outline: none;
}
.mc-sidebar.mc-hidden + .mc-resize-handle { display: none; }

/* ── Sidebar: Accounts + Channels natural-height, Activity fills the rest ── */
.mc-sidebar { overflow: hidden !important; min-height: 0; }
.mc-sidebar > .mc-auth-card { flex: 0 0 auto; }

/* Channels card sizes to content but caps at the sidebar height so the
   channel-list inside can shrink + scroll when there are too many channels.
   Add row + status feed stay pinned at the bottom — "Hinzufügen" always reachable. */
.mc-sidebar > .mc-channels-card {
  /* Override polish.css responsive-grid rules that force height:100% on
     .mc-channels-card and turn .mc-channel-list into a CSS grid — those
     are meant for other dashboard layouts, not the multichat sidebar. */
  /* Card grows to fill the gap between the Auth card and the Activity card
     below, so there is no empty sidebar area. The Activity card keeps its
     50%-height (logs space) — Channels just absorbs the rest. */
  flex: 1 1 auto !important;
  height: auto !important;
  min-height: 0;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden;
}
.mc-sidebar > .mc-channels-card > .mc-channel-list {
  /* List shrinks to content (groups pack tight, no empty filler) and caps
     at 160px — Add row sits directly below it. Remaining card space goes
     to the status-feed (YouTube/system logs) below the Add row. */
  /* !important needed to defeat polish.css's `display: grid` rule that's
     meant for other dashboard grids. */
  display: flex !important;
  flex-direction: column !important;
  flex: 0 1 auto;
  min-height: 0;
  max-height: 160px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  justify-content: flex-start;
  align-content: flex-start;
  /* Thin visible vertical scrollbar so users see the list is scrollable */
  scrollbar-width: thin;
  scrollbar-color: var(--bg4) transparent;
}
/* Keep group children at their natural size — never let flex distribute
   unused vertical space across the groups. Override polish.css `height: 100%`
   that's meant for grid children, not flex column children. */
.mc-sidebar > .mc-channels-card > .mc-channel-list > * {
  flex: 0 0 auto;
  height: auto !important;
}
.mc-sidebar > .mc-channels-card > .mc-channel-list::-webkit-scrollbar { width: 6px; height: 0; }
.mc-sidebar > .mc-channels-card > .mc-channel-list::-webkit-scrollbar:horizontal { display: none; }
.mc-sidebar > .mc-channels-card > .mc-channel-list::-webkit-scrollbar-track { background: transparent; }
.mc-sidebar > .mc-channels-card > .mc-channel-list::-webkit-scrollbar-thumb {
  background: var(--bg4); border-radius: 3px;
}
.mc-sidebar > .mc-channels-card > .mc-channel-list::-webkit-scrollbar-thumb:hover { background: var(--text3); }
/* Add row sits directly below the channel list (natural size). The
   status-feed below it absorbs all remaining card space so the YouTube /
   system logs have room to render. */
.mc-sidebar > .mc-channels-card > .mc-add-row { flex: 0 0 auto; }
.mc-sidebar > .mc-channels-card > .mc-status-feed {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

/* Activity: same height as Server Tracker (50% of the layout), pinned to the
   bottom of the sidebar so it visually aligns with the right-side Tracker. */
.mc-sidebar > .mc-activity-card {
  flex: 0 0 auto;
  height: calc(50% - 5px);
  margin-top: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.mc-sidebar > .mc-activity-card > .mc-activity-feed {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
/* Hide the right resize handle when the right stack has no visible child
   (both Events and Server Tracker are closed/hidden). */
#mc-resize-right:has(+ .mc-right-stack.mc-empty) { display: none; }

/* ── Right stack: Events (top) + Server Tracker (bottom), 50/50 split ── */
.mc-right-stack {
  width: 320px;
  min-width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.mc-right-stack.mc-empty { display: none; }
.mc-right-stack > .mc-alerts-panel,
.mc-right-stack > .mc-monitor-card {
  width: 100%;
  min-width: 0;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}
/* When one of the two is hidden, the other takes the full height. */
.mc-right-stack > .mc-monitor-card { display: flex; flex-direction: column; }
.mc-right-stack > .mc-monitor-card .mc-monitor-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.mc-right-stack > .mc-alerts-panel .mc-alerts-feed {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
/* ── Resize handles ── */
.mc-resize-handle { width: 6px; flex-shrink: 0; cursor: col-resize; position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; }
.mc-resize-handle::after { content: ''; width: 2px; height: 32px; background: var(--bg3); border-radius: 2px; transition: background .15s, height .15s; }
.mc-resize-handle:hover::after { background: var(--purple); height: 48px; }
.mc-resize-handle.dragging::after { background: var(--purple); height: 100%; }
body.mc-resizing { cursor: col-resize !important; user-select: none !important; }
body.mc-resizing * { cursor: col-resize !important; }
.mc-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  background: var(--bg2);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--bg3);
  box-shadow: var(--card-shadow);
}

/* Auth card */
.mc-auth-card, .mc-channels-card, .mc-activity-card, .mc-settings-card, .mc-monitor-card { margin: 0; }
.mc-tab-panel .card.mc-auth-card,
.mc-tab-panel .card.mc-channels-card,
.mc-tab-panel .card.mc-activity-card,
.mc-tab-panel .card.mc-monitor-card { padding: 12px 14px; border-radius: 12px; }
.mc-tab-panel .card .card-title { margin-bottom: 8px; }
.mc-monitor-card {
  flex: 1 1 0;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mc-monitor-header { display:flex; justify-content:space-between; align-items:center; gap: 8px; user-select:none; flex-shrink: 0; }
.mc-monitor-header .mc-monitor-header-left { display:flex; align-items:center; gap:8px; cursor:pointer; flex:1; min-width:0; }
.mc-monitor-header:hover .card-title { color: var(--text); }
.mc-monitor-header .card-title { margin-bottom: 0 !important; }
.mc-monitor-badge { background: rgba(239,68,68,.15); color: var(--red); font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px; min-width: 18px; text-align:center; border: 1px solid rgba(239,68,68,.3); font-variant-numeric: tabular-nums; }
.mc-monitor-close {
  background: none; border: none; color: var(--text3); cursor: pointer;
  font-size: 13px; line-height: 1; padding: 4px 7px; border-radius: 6px; flex-shrink: 0;
  transition: color .15s, background .15s;
}
.mc-monitor-close:hover { color: var(--red); background: var(--bg4); }
.mc-monitor-body {
  margin-top: 8px; display:flex; flex-direction:column; gap:6px;
  flex: 1 1 0; min-height: 0; overflow-y: auto;
}
.mc-monitor-body.collapsed { display: none; }
.mc-monitor-entry {
  background: transparent;
  border: 1px solid var(--bg3);
  border-radius: 6px;
  padding: 6px 9px;
  transition: border-color .2s;
}
.mc-monitor-entry:hover { border-color: var(--bg5, var(--bg3)); }
.mc-monitor-entry-header { display:flex; justify-content:space-between; align-items:center; gap: 8px; padding-bottom: 3px; }
.mc-monitor-entry-name { font-size: 12px; font-weight: 600; color: var(--text1); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; flex:1; letter-spacing: .1px; }
.mc-monitor-entry-name a { color: var(--text); text-decoration:none; }
.mc-monitor-entry-name a:hover { color: var(--purple); }
.mc-monitor-online-badge { background: rgba(239,68,68,.15); color: var(--red); font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px; white-space:nowrap; border: 1px solid rgba(239,68,68,.3); font-variant-numeric: tabular-nums; }
.mc-monitor-detection {
  display:grid;
  grid-template-columns: 1fr 1fr;
  align-items:center;
  gap: 8px;
  padding: 3px 0;
  border-top: 1px solid var(--bg3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.mc-monitor-det-bm { color: var(--text2); cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; gap:5px; min-width:0; }
.mc-monitor-det-bm:hover .mc-monitor-det-bm-name { color: var(--text); }
.mc-monitor-det-bm-name { color: var(--text2); transition: color .15s; }
.mc-monitor-det-tw { color: var(--text2); display:inline-flex; align-items:center; gap:5px; min-width:0; justify-content:flex-end; cursor: pointer; }
.mc-monitor-det-tw:hover .mc-monitor-det-tw-name { color: var(--text); }
.mc-monitor-det-tw-name { color: var(--text2); transition: color .15s; }
.mc-monitor-det-cols {
  display:grid;
  grid-template-columns: 1fr 1fr;
  align-items:center;
  gap: 8px;
  padding: 2px 0 3px;
}
.mc-monitor-det-cols .mc-monitor-det-label-tw { justify-self: end; }
.mc-monitor-det-label { font-size:9px; font-weight:700; letter-spacing:.6px; padding:2px 6px; border-radius:3px; line-height:1.3; flex-shrink:0; text-transform:uppercase; }
.mc-monitor-det-label-bm { background: rgba(255,111,31,.15); color: #ff8a3d; border: 1px solid rgba(255,111,31,.35); }
.mc-monitor-det-label-tw { background: rgba(145,71,255,.15); color: var(--purple); border: 1px solid rgba(145,71,255,.35); }
.mc-monitor-det-bm-name, .mc-monitor-det-tw-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mc-auth-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.mc-auth-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
}
.mc-auth-name { font-weight: 600; flex: 1; }
.mc-auth-user { color: var(--text3); font-size: 11px; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-auth-name-input {
  font-size: 11px; color: var(--text2); background: var(--bg4);
  border: 1px solid var(--bg5); border-radius: 4px;
  padding: 1px 5px; width: 80px; outline: none;
}
.mc-auth-name-input:focus { border-color: var(--accent); }
.mc-auth-logout { padding: 2px 8px !important; font-size: 10px !important; }
.mc-auth-row-token { flex-wrap: nowrap; }
.mc-token-input {
  flex: 1; min-width: 0;
  font-size: 11px; color: var(--text1); background: var(--bg4);
  border: 1px solid var(--bg5); border-radius: 4px;
  padding: 2px 6px; outline: none;
}
.mc-token-input:focus { border-color: var(--accent); }

/* Platform dot */
.mc-platform-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
/* Channel list */
.mc-channel-list { display: flex; flex-direction: column; gap: 3px; margin: 8px 0 6px; }
.mc-channel-row {
  display: flex; align-items: center; gap: 5px; font-size: 12px;
  padding: 3px 5px; margin: 0 -5px; border-radius: 5px;
  transition: background .15s;
}
.mc-channel-row:hover { background: var(--bg4); }
.mc-channel-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.mc-channel-link { color: inherit; text-decoration: none; }
a.mc-channel-link:hover { text-decoration: underline; color: var(--purple); }
.mc-ext-icon { margin-left: 3px; opacity: .4; vertical-align: middle; flex-shrink: 0; }
a.mc-channel-link:hover .mc-ext-icon { opacity: .8; }
.mc-ch-status { font-size: 11px; white-space: nowrap; flex-shrink: 0; }
.mc-ch-status-on  { color: #4caf50; }
.mc-ch-status-off { color: var(--text3); }
.mc-live-badge { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; flex-shrink: 0; background: #e53935; color: #fff; letter-spacing: .4px; }
.mc-live-badge.mc-live-off { background: transparent; color: var(--text3); font-weight: 400; }
.mc-ch-toggle, .mc-ch-remove, .mc-ch-vis {
  background: none; border: none; color: var(--text3); cursor: pointer;
  font-size: 11px; padding: 0 2px; line-height: 1; flex-shrink: 0;
}
.mc-ch-toggle:hover { color: var(--accent); }
.mc-ch-remove:hover { color: #e53935; }
.mc-ch-vis {
  width: 16px; height: 16px; position: relative;
  /* Eye (open) icon as SVG mask, tinted via currentColor */
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 5c-7 0-11 7-11 7s4 7 11 7 11-7 11-7-4-7-11-7zm0 12a5 5 0 1 1 0-10 5 5 0 0 1 0 10zm0-8a3 3 0 1 0 0 6 3 3 0 0 0 0-6z'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 5c-7 0-11 7-11 7s4 7 11 7 11-7 11-7-4-7-11-7zm0 12a5 5 0 1 1 0-10 5 5 0 0 1 0 10zm0-8a3 3 0 1 0 0 6 3 3 0 0 0 0-6z'/></svg>") center/contain no-repeat;
}
.mc-ch-vis:hover { color: var(--accent); }
.mc-ch-vis-off {
  /* Replace the open-eye SVG with a clearly-different "eye off" icon when hidden. */
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M2 4.27L3.28 3 21 20.72 19.73 22l-3.18-3.18A12 12 0 0 1 12 19c-7 0-11-7-11-7a18.7 18.7 0 0 1 4.36-5.36L2 4.27zM12 7a5 5 0 0 1 5 5 4.97 4.97 0 0 1-.61 2.39l-2.27-2.27A3 3 0 0 0 11.88 9.0L9.61 6.73A5 5 0 0 1 12 7zm0 12c-2 0-3.7-.45-5.16-1.16l1.5-1.5A8 8 0 0 0 12 17c4.5 0 7.5-3.5 8.7-5-.5-.65-1.4-1.7-2.6-2.7l1.43-1.43C21.4 9.6 23 12 23 12s-4 7-11 7z'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M2 4.27L3.28 3 21 20.72 19.73 22l-3.18-3.18A12 12 0 0 1 12 19c-7 0-11-7-11-7a18.7 18.7 0 0 1 4.36-5.36L2 4.27zM12 7a5 5 0 0 1 5 5 4.97 4.97 0 0 1-.61 2.39l-2.27-2.27A3 3 0 0 0 11.88 9.0L9.61 6.73A5 5 0 0 1 12 7zm0 12c-2 0-3.7-.45-5.16-1.16l1.5-1.5A8 8 0 0 0 12 17c4.5 0 7.5-3.5 8.7-5-.5-.65-1.4-1.7-2.6-2.7l1.43-1.43C21.4 9.6 23 12 23 12s-4 7-11 7z'/></svg>") center/contain no-repeat;
  color: #e53935;     /* red signals "muted/hidden" clearly */
  opacity: 1;
  width: 18px; height: 18px;
}
.mc-ch-vis-off:hover { color: #ff6b6b; }
.mc-channel-row-hidden .mc-channel-name,
.mc-channel-row-hidden .mc-ch-status,
.mc-channel-row-hidden .mc-live-badge,
.mc-channel-row-hidden .mc-platform-dot { opacity: .45; }
.mc-ch-group-btn {
  background: none; border: none; color: var(--text3); cursor: pointer;
  font-size: 14px; padding: 0 2px; line-height: 1; flex-shrink: 0;
}
.mc-ch-group-btn:hover { color: var(--accent); }
.mc-group { display: flex; flex-direction: column; gap: 2px; }
.mc-group-header {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text3); cursor: pointer; user-select: none;
  padding: 3px 5px; margin: 2px -5px 0; border-radius: 4px;
  transition: background .15s, color .15s;
}
.mc-group-header:hover { background: var(--bg4); color: var(--text); }
.mc-group-caret { display: inline-block; width: 10px; flex-shrink: 0; }
.mc-group-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-group-count {
  font-size: 10px; padding: 1px 6px; border-radius: 8px;
  background: var(--bg4); color: var(--text2); flex-shrink: 0;
}
.mc-group-body { display: flex; flex-direction: column; gap: 3px; padding-left: 8px; border-left: 2px solid var(--bg4); margin-left: 4px; }
.mc-group-vis { color: var(--text3); }
.mc-group-vis:hover { color: var(--accent); }
.mc-group-header:hover .mc-group-vis { color: var(--text); }
.mc-no-channels { font-size: 12px; color: var(--text3); }
.mc-add-row { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.mc-platform-select { font-size: 12px; padding: 4px 6px; }
.mc-channel-input  { font-size: 12px; }

/* Activity feed */
.mc-activity-card { flex: 1 1 0; min-height: 120px; overflow: hidden; display: flex; flex-direction: column; }
.mc-activity-feed { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; margin-top: 8px; outline: none; }
.mc-activity { font-size: 11px; color: var(--text2); padding: 2px 0; line-height: 1.45; }
.mc-activity-chan { color: var(--text); font-weight: 600; }

/* Status feed (connect / disconnect / stream errors) — sits inside .mc-channels-card,
   directly under the Add row. Empty state collapses to nothing. */
.mc-status-feed { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; }
.mc-status-feed:empty { display: none; }
.mc-status-feed > * + * { border-top: 1px solid var(--bg3); padding-top: 4px !important; }
.mc-activity-ban, .mc-activity-message_deleted { color: #e57373; }
.mc-activity-timeout { color: #ffb74d; }
.mc-activity-automod_hold { color: #ff9800; }
.mc-activity-error { color: #e57373; }
.mc-activity-connect { color: #4caf50; }
.mc-activity-disconnect { color: var(--text3); }
.mc-activity-ts { color: var(--text3); font-size: 10px; }

/* Events panel (admin-only, right of main chat) */
.mc-alerts-panel {
  width: 320px;
  min-width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg2);
  border-radius: 14px;
  border: 1px solid var(--bg3);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.mc-alerts-header {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 9px 14px;
  font-size: 11px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: .6px;
  border-bottom: 1px solid var(--bg3);
  flex-shrink: 0;
}
.mc-alerts-clear {
  background: none; border: none; color: var(--text3); cursor: pointer;
  font-size: 11px; padding: 0 2px; line-height: 1;
}
.mc-alerts-clear:hover { color: var(--text); }
.mc-alerts-feed {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column;
  gap: 0; padding: 6px 0;
}
.mc-alert {
  padding: 5px 12px; font-size: 12px; line-height: 1.4;
  border-left: 2px solid transparent; cursor: default;
  transition: background .15s;
}
.mc-alert:hover { background: var(--bg4); }
.mc-alert-user  { font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .1px; }
.mc-alert-detail { font-size: 11px; color: var(--text2); display: block; line-height: 1.5; margin-top: 1px; }
.mc-alert-ts    { font-size: 10px; color: var(--text3); display: block; margin-top: 3px; font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.mc-alerts-filter-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--text3); font-size: 13px; padding: 0 3px;
  line-height: 1; margin-left: auto; border-radius: 3px;
  transition: color .15s;
}
.mc-alerts-filter-toggle:hover, .mc-alerts-filter-toggle.active { color: var(--text); }
.mc-alerts-filters {
  display: none; flex-direction: column; gap: 6px;
  padding: 6px 8px; border-bottom: 1px solid var(--bg4);
  flex-shrink: 0;
}
.mc-alerts-filters.open { display: flex; }
.mc-alerts-filter-group { display: flex; flex-direction: column; gap: 3px; }
.mc-alerts-filter-plat {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; display: flex; align-items: center; gap: 3px;
}
.mc-alerts-filter-plat svg { width: 10px; height: 10px; }
.mc-alerts-filter-btns { display: flex; flex-wrap: wrap; gap: 3px; }
.mc-alert-filter-btn {
  background: var(--bg4); border: 1.5px solid transparent;
  border-radius: 4px; cursor: pointer;
  padding: 2px 6px; font-size: 11px; line-height: 1.5;
  color: var(--text2); opacity: .4;
  transition: opacity .15s, border-color .15s;
  white-space: nowrap;
}
.mc-alert-filter-btn.active { opacity: 1; border-color: var(--bg5); color: var(--text); }
.mc-alert-filter-btn:hover { opacity: .75; }

/* Filter bar */
.mc-sidebar.mc-hidden,
.mc-alerts-panel.mc-hidden { display: none !important; }
.mc-panel-toggle {
  background: transparent; border: 1px solid var(--bg3); border-radius: 8px;
  color: var(--text3); cursor: pointer; font-size: 14px; line-height: 1;
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s; flex-shrink: 0;
}
.mc-panel-toggle:hover { color: var(--text); border-color: var(--text3); background: var(--bg4); }
.mc-filter-bar {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 12px;
  background: var(--bg2);
  border-bottom: 1px solid var(--bg3);
  flex-shrink: 0;
  min-height: 40px;
  box-sizing: border-box;
}
.mc-filter-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 99px;
  border: 1px solid var(--bg3); cursor: pointer;
  font-size: 11px; font-weight: 600; letter-spacing: .2px;
  background: transparent; color: var(--text2);
  transition: border-color .15s, background .15s, color .15s;
}
.mc-filter-btn:hover:not(.active) { border-color: var(--fc, var(--text3)); color: var(--text); }
.mc-filter-btn.active {
  background: color-mix(in srgb, var(--fc, var(--text)) 12%, transparent);
  border-color: color-mix(in srgb, var(--fc, var(--text)) 45%, transparent);
  color: var(--fc, var(--text));
}
.mc-filter-btn[data-filter="all"].active { background: var(--bg4); border-color: var(--bg3); color: var(--text); }
.mc-filter-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--fc, var(--text3)); flex-shrink: 0;
  opacity: .55; transition: opacity .15s;
}
.mc-filter-btn.active .mc-filter-dot,
.mc-filter-btn:hover   .mc-filter-dot { opacity: 1; }
.mc-msg-count {
  font-size: 10px; font-weight: 700; color: var(--text3);
  background: transparent; border-radius: 4px;
  padding: 2px 7px; margin-left: auto;
  letter-spacing: .6px; text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.mc-msg-count::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--text3); margin-right: 6px; vertical-align: middle; transform: translateY(-1px); }
.mc-scroll-btn {
  font-size: 11px; font-weight: 600; padding: 5px 12px; border-radius: 99px;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  letter-spacing: .02em;
  box-shadow: 0 2px 8px rgba(145,70,255,.3);
}
.mc-scroll-btn:hover { background: var(--purp2); transform: translateY(-1px); }
.mc-settings-btn {
  width: 30px; height: 30px; border-radius: 8px;
  background: transparent; border: 1px solid var(--bg3);
  cursor: pointer; flex-shrink: 0; padding: 0;
  color: var(--text2);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, border-color .15s;
}
.mc-settings-btn svg { display: block; }
.mc-settings-btn:hover { color: var(--text); border-color: var(--text3); }
.mc-settings-btn.active { color: var(--purple); border-color: var(--purple); background: color-mix(in srgb, var(--purple) 15%, transparent); }

/* Settings popover (appended to <body>, anchored under the gear button) */
.mc-settings-popover {
  position: fixed; z-index: 9000;
  width: 300px; max-height: 70vh; overflow-y: auto;
  background: var(--bg2); border: 1px solid var(--bg3);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.25);
}
.mc-settings-popover-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--bg3);
  font-weight: 700; font-size: 11px; color: var(--text3);
  text-transform: uppercase; letter-spacing: .6px;
}
.mc-settings-popover-close {
  background: none; border: none; color: var(--text3);
  cursor: pointer; font-size: 14px; line-height: 1; padding: 2px 4px;
}
.mc-settings-popover-close:hover { color: var(--text); }
.mc-settings-popover-body { padding: 8px 12px 12px; }
.mc-settings-popover-body .mc-setting-row { padding: 6px 0; }

/* Messages */
.mc-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 12px 8px; display: flex; flex-direction: column; gap: 2px; outline: none; }
.mc-empty { color: var(--text3); font-size: 13px; text-align: center; margin: auto; }
.mc-msg {
  display: flex; align-items: baseline; flex-wrap: nowrap; gap: 3px;
  font-size: 13px; line-height: 1.5; padding: 1px 6px 1px 8px; border-radius: 5px;
  border-left: 2px solid transparent;
  margin-left: -8px;
}
.mc-msg:hover { background: var(--bg4); }
.mc-msg-twitch  { border-left-color: rgba(145,71,255,.55); }
.mc-msg-kick    { border-left-color: rgba(83,252,24,.55); }
.mc-msg-youtube { border-left-color: rgba(255,0,0,.55); }
.mc-msg-meta { display: flex; align-items: center; gap: 3px; flex-shrink: 0; }
/* Per-user display toggles — applied as classes on #mc-messages */
.mc-messages.mc-hide-ts     .mc-msg-ts      { display: none; }
.mc-messages.mc-hide-chan   .mc-msg-chan    { display: none; }
.mc-messages.mc-hide-mod    .mc-inline-mods { display: none; }
.mc-messages.mc-hide-badges .mc-badge,
.mc-messages.mc-hide-badges .mc-badge-text  { display: none; }
.mc-msg-chan {
  font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: 4px;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  background: color-mix(in srgb, currentColor 10%, transparent);
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex-shrink: 0; letter-spacing: .4px; text-transform: uppercase;
}
.mc-msg-user { font-weight: 700; letter-spacing: .1px; }
.mc-msg-sep  { color: var(--text3); margin: 0 1px; }
/* min-width: 0 lets the flex item shrink below its content size so long
   URLs / words wrap *inside* the text column instead of pushing the whole
   block to a new flex line below the username. overflow-wrap covers the
   no-space cases (long URLs) that word-break alone misses. */
.mc-msg-text { flex: 1 1 0; min-width: 0; word-break: break-word; overflow-wrap: anywhere; }
.mc-reply-btn {
  background: none; border: none; cursor: pointer; flex-shrink: 0;
  font-size: 13px; padding: 0 3px; line-height: 1;
  color: var(--text3); border-radius: 3px;
  opacity: 0; transition: opacity .1s, background .1s;
  margin-left: auto;
}
.mc-msg:hover .mc-reply-btn { opacity: 1; }
.mc-reply-btn:hover { background: var(--bg4); color: var(--purple); }
.mc-badge     { width: 18px; height: 18px; vertical-align: middle; margin-right: 1px; }
.mc-badge-text {
  font-size: 10px; font-weight: 700; padding: 1px 4px; border-radius: 3px;
  vertical-align: middle; letter-spacing: .02em;
}
.mc-badge-yt { background: rgba(255,0,0,.15); color: #ff5252; }
.mc-emote { height: 28px; vertical-align: middle; display: inline-block; }
.mc-link {
  color: var(--accent); text-decoration: none; word-break: break-all;
}
.mc-link:hover { text-decoration: underline; }

/* Deleted message */
.mc-msg-deleted {
  opacity: 0.35;
  text-decoration: line-through;
  cursor: default;
}
.mc-msg-deleted .mc-inline-mods { display: none; }
.mc-msg-deleted:hover {
  opacity: 1;
  text-decoration: none;
}
/* Restricted message */
.mc-msg-restricted {
  background: rgba(255, 87, 34, 0.08);
  border-left: 3px solid #ff5722;
  padding-left: 4px;
  margin-left: -4px;
}
.mc-restrict-badge {
  font-size: 10px;
  margin-right: 3px;
  vertical-align: middle;
}

/* Low Trust Users — monitored / restricted suspicious users */
.mc-msg-monitored {
  background: rgba(255, 200, 0, 0.06);
  border-left: 3px solid #ffb300;
  padding-left: 4px;
  margin-left: -4px;
}
.mc-low-trust-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 2px;
  flex-shrink: 0;
  user-select: none;
  vertical-align: middle;
}
.mc-low-trust-label-monitored {
  background: rgba(255, 179, 0, 0.18);
  color: #ffb300;
  border: 1px solid rgba(255, 179, 0, 0.35);
}
.mc-low-trust-label-restricted {
  background: rgba(255, 87, 34, 0.22);
  color: #ff7043;
  border: 1px solid rgba(255, 87, 34, 0.45);
}
/* Legacy banner (kept for backward compat if any reference remains) */
.mc-low-trust-banner {
  display: block;
  width: 100%;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 1px 4px;
  margin-bottom: 1px;
  border-radius: 3px;
}
.mc-low-trust-monitored {
  background: rgba(255, 179, 0, 0.18);
  color: #ffb300;
}
.mc-low-trust-restricted {
  background: rgba(255, 87, 34, 0.18);
  color: #ff7043;
}

/* Mention highlight */
.mc-msg-mention {
  background: rgba(255, 200, 0, 0.08);
  border-left: 3px solid #ffc800;
  padding-left: 4px;
  margin-left: -4px;
}

/* Settings card */
.mc-setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0; border-bottom: 1px solid var(--bg4);
}
.mc-setting-section { padding-top: 8px; }
.mc-setting-label { font-size: 12px; color: var(--text2); }
.mc-volume-control { display: flex; align-items: center; gap: 6px; }
.mc-volume-control input[type="range"] { width: 80px; accent-color: #9147ff; cursor: pointer; }
.mc-vol-label { font-size: 11px; color: var(--text3); min-width: 32px; text-align: right; }
.mc-blacklist-list { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.mc-blacklist-empty { font-size: 11px; color: var(--text3); }
.mc-blacklist-entry {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; background: var(--bg3); border-radius: 4px; padding: 3px 6px;
}
.mc-blacklist-platform { font-weight: 600; min-width: 40px; }
.mc-blacklist-user { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-blacklist-remove {
  background: none; border: none; color: var(--text3); cursor: pointer;
  font-size: 12px; padding: 0 2px; line-height: 1;
}
.mc-blacklist-remove:hover { color: #e53935; }

/* Inline mod icons — always visible */
.mc-inline-mods {
  display: inline-flex; align-items: center; gap: 1px; flex-shrink: 0;
}
.mc-inline-btn {
  background: none; border: none; cursor: pointer;
  font-size: 11px; padding: 0;
  width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 3px; transition: background .1s;
  color: rgba(255,255,255,0.65); line-height: 1;
}
.mc-inline-btn:hover { background: var(--bg4); color: #fff; }
.mc-btn-delete:hover  { color: #ef5350 !important; }
.mc-btn-timeout:hover { color: #ffb74d !important; }
.mc-btn-ban:hover     { color: #ef5350 !important; }

/* Timestamp in messages */
.mc-msg-ts { font-size: 10px; color: var(--text3); flex-shrink: 0; user-select: none; font-variant-numeric: tabular-nums; letter-spacing: .2px; }

/* Platform SVG logo before timestamp */
.mc-plat-logo { width: 11px; height: 11px; flex-shrink: 0; display: inline-block; vertical-align: middle; }

/* Send bar */
.mc-send-bar {
  display: flex; flex-direction: column; gap: 0;
  background: var(--bg2); border-top: 1px solid var(--bg3);
  flex-shrink: 0;
}
.mc-send-platforms {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 6px 12px 4px;
  min-height: 28px;
}
.mc-send-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px 4px 8px; border-radius: 99px;
  background: transparent; border: 1px solid var(--bg3);
  color: var(--text2); font-size: 11px; font-weight: 600; cursor: pointer;
  letter-spacing: .2px;
  transition: background .15s, border-color .15s, color .15s;
}
.mc-send-pill:hover { color: var(--text); border-color: var(--pill-color, var(--text3)); }
.mc-send-pill.active {
  background: color-mix(in srgb, var(--pill-color, var(--text)) 12%, transparent);
  border-color: color-mix(in srgb, var(--pill-color, var(--text)) 50%, transparent);
  color: var(--pill-color, var(--text));
}
.mc-send-pill-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.mc-send-row {
  display: flex; gap: 6px; padding: 4px 12px 10px;
  align-items: flex-end;
  position: relative;
}
.mc-mention-dropdown {
  position: absolute; bottom: calc(100% + 2px); left: 0; right: 0;
  background: var(--bg3); border: 1px solid var(--bg5);
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 -3px 10px rgba(0,0,0,.18), 0 -8px 24px rgba(0,0,0,.2);
  z-index: 100;
}
.mc-mention-item {
  padding: 5px 12px; font-size: 13px; cursor: pointer;
  color: var(--text); transition: background .1s;
  display: flex; align-items: center; gap: 8px;
}
.mc-mention-item:hover, .mc-mention-item.active {
  background: var(--purple); color: #fff;
}
.mc-mention-at { font-weight: 600; }
.mc-mention-item:hover .mc-mention-at,
.mc-mention-item.active .mc-mention-at { color: #fff !important; }
.mc-mention-emote { width: 24px; height: 24px; object-fit: contain; flex-shrink: 0; }
.mc-mention-plat {
  margin-left: auto; font-size: 10px; padding: 1px 5px;
  border-radius: 4px; color: #fff; opacity: .85; flex-shrink: 0;
}
.mc-mention-chip {
  font-weight: 600; border-radius: 3px;
  padding: 0 2px; cursor: default; user-select: none;
}
.mc-send-input-wrap {
  flex: 1; position: relative;
}
.mc-send-input {
  width: 100%; box-sizing: border-box;
  font-size: 13px; font-family: inherit;
  background: var(--bg); border: 1px solid var(--bg3);
  border-radius: 8px; color: var(--text); padding: 7px 12px 20px;
  outline: none; line-height: 1.6; min-height: 36px; max-height: 120px;
  overflow-y: auto; word-break: break-word;
  transition: border-color .15s, box-shadow .15s;
}
.mc-send-input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purp-glow); }
.mc-send-input:empty:before {
  content: attr(data-placeholder); color: var(--text3); pointer-events: none;
}
.mc-send-input .mc-emote { vertical-align: middle; }
.mc-char-count {
  position: absolute; bottom: 5px; right: 10px;
  font-size: 11px; color: var(--text3); pointer-events: none;
}
.mc-char-count.mc-char-warn { color: #f0a500; }
.mc-char-count.mc-char-over { color: #e53935; font-weight: 600; }

.mc-msg-user-clickable { cursor: pointer; }
.mc-msg-user-clickable:hover { text-decoration: underline; }

/* Nuclear outline removal for multichat */
#tab-multichat, #tab-multichat *, #mc-user-panel, #mc-user-panel * {
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* User panel (custom timeout) */
.mc-user-panel {
  position: fixed; z-index: 300;
  background: var(--bg3); border: none;
  border-radius: 10px; padding: 12px; width: 240px;
}
.mc-user-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; cursor: grab; user-select: none; }
.mc-user-panel-header:active { cursor: grabbing; }
.mc-user-panel-name { font-weight: 700; font-size: 14px; }
.mc-user-panel-name-clickable { cursor: pointer; }
.mc-user-panel-name-clickable:hover { text-decoration: underline; }
.mc-user-panel-close { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.mc-user-panel-close:hover { color: var(--text); }
.mc-user-panel-label { font-size: 11px; color: var(--text3); display: block; margin-bottom: 5px; }
.mc-user-panel-presets { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.mc-preset-btn {
  font-size: 11px; padding: 2px 7px; border-radius: 5px;
  background: var(--bg4); border: none; color: var(--text2); cursor: pointer;
}
.mc-preset-btn:hover { background: var(--bg5); color: var(--text); }

/* Mod panel */
.mc-mod-panel {
  position: fixed; bottom: 80px; right: 20px;
  background: var(--bg2); border: 1px solid var(--bg4);
  border-radius: 12px; padding: 14px; width: 320px;
  box-shadow: 0 4px 12px rgba(0,0,0,.2), 0 12px 28px rgba(0,0,0,.25);
  z-index: 200;
}
.mc-mod-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mc-mod-user { font-weight: 700; font-size: 14px; }
.mc-mod-close { background: none; border: none; cursor: pointer; color: var(--text3); font-size: 16px; }
.mc-mod-message { font-size: 12px; color: var(--text2); margin-bottom: 10px; border-left: 2px solid var(--bg4); padding-left: 8px; }
.mc-mod-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* AutoMod held messages */
.mc-msg-automod {
  background: rgba(255, 152, 0, 0.08);
  border-left: 3px solid #ff9800;
  padding-left: 4px;
  margin-left: -4px;
}
.mc-msg-automod.mc-automod-resolved {
  opacity: 0.4;
  border-left-color: var(--bg4);
}
.mc-automod-label {
  font-size: 10px; font-weight: 700; letter-spacing: .03em;
  color: #ff9800; flex-shrink: 0; user-select: none;
}
.mc-automod-actions {
  display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0;
}
.mc-automod-btn {
  background: none; border: 1px solid transparent; cursor: pointer;
  font-size: 11px; padding: 0 4px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 3px; transition: background .1s, border-color .1s;
  color: rgba(255,255,255,0.65); line-height: 1;
}
.mc-automod-btn-allow:hover { background: rgba(76,175,80,.2); border-color: #4caf50; color: #4caf50; }
.mc-automod-btn-deny:hover  { background: rgba(239,83,80,.2); border-color: #ef5350; color: #ef5350; }
.mc-automod-btn:disabled    { opacity: .4; cursor: not-allowed; }
.mc-automod-queued-badge {
  display: inline-block; margin-left: 4px; padding: 0 4px;
  font-size: 9px; font-weight: 700; line-height: 12px;
  border: 1px solid #ff980055; border-radius: 3px;
  color: #ffb74d; background: rgba(255,152,0,0.08);
  vertical-align: middle;
}
.mc-automod-channel {
  color: #9147ff; font-weight: 700;
  margin: 0 2px;
}

/* First-time chatter highlight — mirrors the AutoMod card layout but in
   Twitch purple: subtle background tint + left border + inline label next
   to the timestamp. */
.mc-msg-redeem {
  background: rgba(79, 195, 247, 0.10);
  border-left: 3px solid #4fc3f7;
  padding-left: 4px;
  margin-left: -4px;
}
.mc-msg-first {
  background: rgba(145, 71, 255, 0.10);
  border-left: 3px solid #9147ff;
  padding-left: 4px;
  margin-left: -4px;
}
.mc-first-msg-label {
  font-size: 10px; font-weight: 700; letter-spacing: .03em;
  color: #bb86fc; flex-shrink: 0; user-select: none;
  margin-right: 2px;
}
.mc-redeem-label {
  font-size: 10px; font-weight: 700; letter-spacing: .03em;
  color: #4fc3f7; flex-shrink: 0; user-select: none;
  margin-right: 2px;
  max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ─── Admin Support-Impersonation Banner ─────────────────────────────── */
#impersonate-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  background: linear-gradient(90deg, #b71c1c 0%, #e53935 100%);
  color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.4);
  border-bottom: 2px solid #7f0000;
}
#impersonate-banner .imp-inner {
  max-width: 1200px; margin: 0 auto; padding: 8px 16px;
  display: flex; align-items: center; gap: 14px;
}
#impersonate-banner .imp-icon { font-size: 18px; }
#impersonate-banner .imp-text { flex: 1; display: flex; align-items: baseline; gap: 10px; }
#impersonate-banner .imp-detail { font-weight: 400; opacity: .92; font-size: 13px; }
#impersonate-banner .imp-exit {
  background: rgba(255,255,255,.12); color: #fff;
  border: 1px solid rgba(255,255,255,.4); border-radius: 4px;
  padding: 5px 14px; cursor: pointer; font-weight: 600; font-size: 13px;
  transition: background .15s;
}
#impersonate-banner .imp-exit:hover { background: rgba(255,255,255,.25); }
body.impersonating { padding-top: 42px; }
body.impersonating #page-app { padding-top: 42px; }

/* ─── Audit panel ─────────────────────────────────────────────────────── */
.audit-list {
  display: flex; flex-direction: column; gap: 2px;
  margin-top: 4px;
}
.audit-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  border-left: 3px solid var(--text3);
  border-radius: 0 8px 8px 0;
  background: transparent;
  transition: background .12s ease;
}
.audit-row:hover { background: var(--bg3); }
.audit-row[data-action="create"] { border-left-color: #2ec27e; }
.audit-row[data-action="update"] { border-left-color: #e3a01a; }
.audit-row[data-action="delete"] { border-left-color: #e05656; }

.audit-row-body { min-width: 0; }
.audit-row-head {
  display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap;
  margin-bottom: 3px; min-width: 0;
}
.audit-row-head .audit-kind {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text3);
  flex-shrink: 0;
}
.audit-row-head .audit-verb {
  font-size: 12px; color: var(--text2);
  flex-shrink: 0;
}
.audit-row-head .audit-target {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0; flex: 1;
}
.audit-row-foot {
  font-size: 11px; color: var(--text3);
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.audit-row-foot > * + *::before {
  content: '·'; margin-right: 8px; color: var(--text3); opacity: .55;
}

.audit-row-action { display: flex; align-items: center; }

.audit-undo {
  background: transparent;
  color: var(--purple);
  border: 1px solid var(--border);
  padding: 5px 12px; border-radius: 6px; cursor: pointer;
  font-size: 12px; font-weight: 600;
  transition: background .12s, border-color .12s, color .12s;
}
.audit-undo:hover { background: var(--purple); color: #fff; border-color: var(--purple); }
.audit-undo[disabled] { opacity: .4; cursor: not-allowed; }
.audit-undo[disabled]:hover { background: transparent; color: var(--purple); border-color: var(--border); }

.audit-tag-ok,
.audit-tag-muted {
  font-size: 10px; font-weight: 700;
  padding: 4px 9px; border-radius: 6px;
  text-transform: uppercase; letter-spacing: .05em;
}
.audit-tag-ok    { color: #2ec27e; background: rgba(46,194,126,.10); border: 1px solid rgba(46,194,126,.25); }
.audit-tag-muted { color: var(--text3); border: 1px dashed var(--border); }

.audit-empty { padding: 28px 12px; }

/* Impersonate button in user list */
.btn-impersonate {
  background: #ffa726; color: #0e0e10; border: 0;
  padding: 4px 10px; border-radius: 4px; cursor: pointer;
  font-size: 12px; font-weight: 600;
}
.btn-impersonate:hover { background: #ffb74d; }

/* ─── Theme toggle ───────────────────────────────────────────────────────── */
.theme-toggle {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text2); padding: 5px 7px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 26px;
  transition: color .15s, border-color .15s, background .15s;
}
.theme-toggle:hover { color: var(--purple); border-color: var(--purple); background: var(--purp-glow); }
.theme-toggle svg { display: block; width: 16px; height: 16px; stroke: currentColor; }
.theme-toggle .moon { display: none !important; }
.theme-toggle .sun  { display: block !important; }
html[data-theme="light"] .theme-toggle { background: #fff; color: var(--text2); }
html[data-theme="light"] .theme-toggle .sun  { display: none !important; }
html[data-theme="light"] .theme-toggle .moon { display: block !important; }
.sidebar.collapsed .theme-toggle { width: 38px; height: 38px; border-radius: 10px; }

/* ─── Undo countdown toast — see frontend/css/ui-components.css for v2 styles ─── */

/* ─── Bulk action toolbar ────────────────────────────────────────────────── */
.bulk-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin-bottom: 12px;
  background: var(--bg2); border: 1px solid var(--border-hov); border-radius: 10px;
  box-shadow: var(--card-shadow);
  animation: bulkSlideIn .18s ease-out;
}
@keyframes bulkSlideIn { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
.bulk-toolbar .bulk-count { font-weight: 600; color: var(--purple); }
.bulk-toolbar .bulk-spacer { flex: 1; }
.bulk-check { cursor: pointer; accent-color: var(--purple); }
tr.bulk-selected { background: var(--purp-glow); }

/* ─── Audit filter panel ─────────────────────────────────────────────────── */
.audit-filters {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 14px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
}
.audit-filters .audit-filter-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.audit-filters .audit-filter-divider {
  width: 1px; height: 22px; background: var(--border);
  margin: 0 2px;
}
.audit-filters .audit-arrow {
  font-size: 12px; color: var(--text3); padding: 0 2px; user-select: none;
}
.audit-filters .audit-input {
  padding: 5px 9px; font-size: 12px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text);
  height: 30px; line-height: 1; box-sizing: border-box;
  transition: border-color .12s, background .12s;
}
.audit-filters .audit-input:hover  { border-color: var(--border-hov); }
.audit-filters .audit-input:focus  { border-color: var(--purple); outline: none; box-shadow: 0 0 0 3px var(--purp-glow); }
.audit-filters .audit-checkbox {
  font-size: 11px; color: var(--text2);
  display: inline-flex; gap: 6px; align-items: center;
  padding: 5px 10px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; height: 30px; box-sizing: border-box;
  user-select: none;
  transition: border-color .12s, background .12s, color .12s;
}
.audit-filters .audit-checkbox:hover { border-color: var(--border-hov); color: var(--text); }
.audit-filters .audit-checkbox input { accent-color: var(--purple); margin: 0; }
.audit-filters .audit-spacer { flex: 1; min-width: 8px; }

/* ─── Commands preview panel ────────────────────────────────────────────── */
.cmd-preview {
  background: var(--bg4); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; margin-top: 8px; font-size: 13px;
  display: flex; align-items: flex-start; gap: 10px;
}
.cmd-preview .cmd-preview-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  color: var(--text3); letter-spacing: .06em; flex-shrink: 0; padding-top: 2px;
}
.cmd-preview .cmd-preview-body {
  flex: 1; color: var(--text); font-family: 'Segoe UI', monospace; white-space: pre-wrap; word-break: break-word;
}
.cmd-preview mark {
  background: var(--purp-glow); color: var(--purple);
  border-radius: 3px; padding: 0 3px; font-weight: 600;
}

/* ─── Mobile: bottom nav below 768px ─────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    top: auto; bottom: 0; width: 100% !important; height: 60px;
    flex-direction: row !important; overflow-x: auto; overflow-y: hidden;
    border-right: 0; border-top: 1px solid var(--border);
    padding: 0; z-index: 200;
  }
  .sidebar-top, .sidebar-search, .sidebar-user, .sidebar-bottom { display: none !important; }
  .nav-tabs {
    flex-direction: row !important; padding: 4px 6px !important; gap: 2px !important;
    overflow-x: auto; overflow-y: hidden; flex: 1;
    scrollbar-width: none;
  }
  .nav-tabs::-webkit-scrollbar { display: none; }
  .tab-btn {
    flex-direction: column !important; align-items: center !important;
    padding: 6px 10px !important; font-size: 10px !important; gap: 2px !important;
    border-left: 0 !important; border-bottom: 2px solid transparent !important;
    border-radius: 8px !important; min-width: 56px; flex-shrink: 0;
  }
  .tab-btn.active { border-bottom-color: var(--purple) !important; border-left: 0 !important; }
  .tab-btn .sidebar-label { opacity: 1 !important; width: auto !important; font-size: 10px; }
  #page-app { padding-left: 0 !important; padding-bottom: 60px; }
  .site-footer.has-sidebar { margin-left: 0 !important; }
  body.sidebar-collapsed #page-app { padding-left: 0 !important; padding-bottom: 60px; }
  body.sidebar-collapsed .site-footer.has-sidebar { margin-left: 0 !important; }
  body.sidebar-collapsed .mc-tab-panel,
  .mc-tab-panel { left: 0 !important; }
  body.sidebar-collapsed .modal-backdrop:not(.modal-inline),
  .modal-backdrop:not(.modal-inline) { left: 0 !important; }
  body.impersonating #impersonate-banner .imp-detail { display: none; }
  .main { padding: 14px 14px !important; }
  .stats { grid-template-columns: repeat(auto-fill, minmax(140px,1fr)) !important; }
  .audit-filters { flex-direction: column; align-items: stretch; }
  .audit-filters > .audit-filter-group { width: 100%; }
  .audit-filters > .audit-filter-group > .audit-input { flex: 1 1 140px; }
  .audit-filters > .audit-filter-divider { display: none; }
  .audit-filters > .audit-spacer { display: none; }
  .audit-filters > .audit-checkbox { width: auto; }
  .audit-row { grid-template-columns: 1fr; gap: 8px; }
  .audit-row .audit-row-action { justify-self: end; }
  .bulk-toolbar { flex-wrap: wrap; }
}

/* ── Multi-Chat: hide freshly-hydrated AutoMod rows for ~800ms so that
   already-resolved ones don't flash in on F5 before the live update
   arrives and removes them. ── */
#mc-messages .mc-msg-automod.mc-automod-hydrated-pending { display: none !important; }

/* ── Multi-Chat: dynamic chat font-size (scoped to #mc-messages only) ── */
/* baseline keeps timestamp/username/badges aligned to the FIRST line of a
   wrapped message — `center` would float them to the middle of multi-line
   bodies, which makes the username drift below the timestamp visually. */
#mc-messages .mc-msg           { font-size: var(--mc-chat-fs, 13px) !important; align-items: baseline !important; }
#mc-messages .mc-msg-text,
#mc-messages .mc-msg-user,
#mc-messages .mc-msg-sep,
#mc-messages .mc-msg-ts,
#mc-messages .mc-mention,
#mc-messages .mc-reply-btn     { font-size: var(--mc-chat-fs, 13px) !important; }

/* ─── Unified Page Header System ───────────────────────────────────────────
   One hero block + one segmented pill nav for every top-level page.
   Anchors page identity (title + subtitle + grouped actions) and a
   purple accent rail that ties the design language together. Inner
   sub-section headers continue to use .sec-head / .sec-title. */
.page-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  position: relative;
  padding: 22px 24px 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 120% 80% at 100% 0%, rgba(145,71,255,.10) 0%, transparent 60%);
  pointer-events: none;
}
.page-hero::after {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--purple) 0%, transparent 100%);
}
.page-hero-meta { position: relative; min-width: 0; flex: 1 1 auto; }
.page-hero-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin: 0 0 6px;
  background: linear-gradient(135deg, var(--text), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-hero-sub {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.55;
  margin: 0;
  max-width: 580px;
}
.page-hero-actions {
  position: relative;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.page-hero-btn { display: inline-flex; align-items: center; gap: 6px; }
.page-hero-btn svg { flex-shrink: 0; }
.page-hero-help {
  width: 28px; height: 28px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  border-radius: 50% !important;
}
@media (max-width: 720px) {
  .page-hero { padding: 18px 18px 16px; }
  .page-hero-title { font-size: 22px; }
  .page-hero-actions { width: 100%; }
}

/* Segmented pill tabs — scoped via .page-tabs so that .sc-tabs used
   inside the player profile or settings sub-nav keeps its underline. */
.page-tabs.sc-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg2);
  flex-wrap: wrap;
}
.page-tabs .page-tab.sc-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: none !important;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.page-tabs .page-tab.sc-tab svg { opacity: .65; transition: opacity .15s, color .15s; }
.page-tabs .page-tab.sc-tab:hover {
  color: var(--text);
  background: rgba(255,255,255,.04);
}
.page-tabs .page-tab.sc-tab:hover svg { opacity: 1; }
.page-tabs .page-tab.sc-tab.active {
  color: var(--text);
  background: var(--bg4);
  border-bottom-color: transparent !important;
  box-shadow: inset 0 0 0 1px var(--border);
}
.page-tabs .page-tab.sc-tab.active svg { opacity: 1; color: var(--purple); }
.page-tabs .page-tab.sc-tab:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}
html[data-theme="light"] .page-tabs.sc-tabs { background: #fff; }
html[data-theme="light"] .page-tabs .page-tab.sc-tab.active { background: var(--bg4); }

/* Compact input/select inside hero actions — match button height */
.page-hero-actions .input,
.page-hero-actions select.input {
  height: 32px;
  padding: 4px 10px;
  font-size: 13px;
  min-width: 0;
}

/* Card title row with optional sub-text below + action right-aligned. */
.card-hdr-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-hdr-row > :first-child { min-width: 0; }
.card-sub {
  font-size: 12px;
  color: var(--text3);
  margin-top: 4px;
  line-height: 1.5;
  max-width: 540px;
}

/* In-card toolbar row (chip-style toggles). Soft dashed divider so it
   reads as a control strip rather than another section. */
.sniper-toolbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border);
}
.sniper-chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  font-size: 12px;
  color: var(--text2);
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: border-color .15s, color .15s, background-color .15s;
}
.sniper-chip-toggle:hover { border-color: var(--border-hov); color: var(--text); }
.sniper-chip-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.sniper-chip-toggle-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text3);
  transition: background-color .15s, box-shadow .15s;
}
.sniper-chip-toggle:has(input:checked) {
  border-color: rgba(245,158,11,.45);
  color: var(--text);
  background: rgba(245,158,11,.06);
}
.sniper-chip-toggle:has(input:checked) .sniper-chip-toggle-dot {
  background: var(--yellow);
  box-shadow: 0 0 0 3px rgba(245,158,11,.18);
}

/* Manual watchlist — nested below the monitor list with a clear divider.
   Subtle purple wash distinguishes it from outer-card surface without
   shouting. */
.sniper-watchlist {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.sniper-watchlist-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.sniper-watchlist-body {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  background: rgba(145,71,255,.04);
}
html[data-theme="light"] .sniper-watchlist-body { background: rgba(124,58,237,.04); }

/* ─── Sniper player profile — hero, karma pill, meta card ──────────────── */
.sc-profile-hero { align-items: flex-start; position: relative; }
.sc-profile-hero .page-hero-meta { padding-right: 16px; }
.sc-profile-eyebrow {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text3);
  margin-bottom: 6px;
}
.sc-profile-hero-sub { max-width: 540px; }
.sc-profile-actions {
  position: absolute;
  top: 22px;
  right: 22px;
  align-self: auto;
  justify-content: flex-end;
  max-width: calc(100% - 44px);
}
.sc-profile-actions .page-hero-btn svg { opacity: .85; }
@media (max-width: 980px) {
  .sc-profile-actions {
    position: static;
    align-self: flex-start;
    max-width: none;
    margin-top: 12px;
  }
  .sc-profile-hero .page-hero-meta { padding-right: 0; }
}

/* Karma pill — compact, accent-bordered, lives in the actions slot */
.sc-karma-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px 3px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg4);
  height: 32px;
}
.sc-karma-pill-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
  margin-right: 4px;
}
.sc-karma-pill-val {
  font-size: 14px;
  font-weight: 800;
  min-width: 22px;
  text-align: center;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.sc-karma-pill-btn {
  width: 22px; height: 22px;
  display: inline-flex;
  align-items: center; justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  transition: background-color .15s, color .15s;
}
.sc-karma-pill-up   { color: var(--green); }
.sc-karma-pill-down { color: var(--red); }
.sc-karma-pill-up:hover   { background: rgba(34,197,94,.12); }
.sc-karma-pill-down:hover { background: rgba(239,68,68,.12); }

/* Meta card under the hero — keeps identifier list & alts visually distinct */
.sc-profile-meta-card #sc-profile-info { font-size: 13px; line-height: 1.7; }
.sc-profile-alts-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.sc-profile-alts-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.sc-profile-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text3);
}

/* Profile loader — provides only the dark veil that covers the list.
   The actual spinner is delegated to #page-loader (activated from JS)
   so we don't get two out-of-phase rings stacking on each other. */
#sc-profile-loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
}
#sc-profile-loader[hidden] { display: none; }

/* ─── Management tab (admin) ─────────────────────────────────────────────── */
.mgmt-card { padding: 18px 20px 22px; }
.mgmt-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding-bottom: 14px;
}
.mgmt-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 700; letter-spacing: -.01em;
}
.mgmt-tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--bg3);
  margin: 0 -20px 20px; padding: 0 16px;
}
.mgmt-tab {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; font-size: 13px; font-weight: 600;
  color: var(--text3); text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.mgmt-tab:hover { color: var(--text); }
.mgmt-tab.active { color: var(--text); border-bottom-color: var(--purple); }
.mgmt-tab-count {
  display: none;
  font-size: 10px; font-weight: 700; line-height: 1;
  padding: 3px 7px; border-radius: 999px;
  background: var(--bg3); color: var(--text2);
}
.mgmt-tab.active .mgmt-tab-count { background: rgba(168,85,247,.15); color: var(--purple); }
.mgmt-tab-count.has-pending { background: var(--yellow); color: #000; display: inline-block; }

.mgmt-toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.mgmt-search { flex: 1 1 280px; min-width: 200px; max-width: 480px; }
.mgmt-filter-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text2); cursor: pointer;
  padding: 6px 10px; border-radius: 6px; background: var(--bg2);
}
.mgmt-filter-pill input { accent-color: var(--purple); }

.mgmt-list { display: flex; flex-direction: column; gap: 6px; }

.mgmt-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: 8px;
  background: var(--bg2);
  border: 1px solid transparent;
  transition: background .12s ease, border-color .12s ease;
}
.mgmt-row:hover { background: var(--bg3); }
.mgmt-row.is-pending { border-left: 2px solid var(--yellow); padding-left: 12px; }
.mgmt-row.is-premium { border-left: 2px solid var(--purple); padding-left: 12px; }

.mgmt-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg3); object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--text2); font-size: 14px;
}

.mgmt-body { min-width: 0; }
.mgmt-name {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 14px; font-weight: 600; line-height: 1.2;
  margin-bottom: 4px;
}
.mgmt-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--muted); line-height: 1.3;
}
.mgmt-meta strong { color: var(--text2); font-weight: 600; }
.mgmt-meta-sep { color: var(--bg3); }

.mgmt-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; font-size: 11px; line-height: 1.4;
  border-radius: 4px;
  background: var(--bg3); color: var(--text2);
  border: 1px solid transparent;
}
.mgmt-tag.is-purple { background: rgba(168,85,247,.12); color: var(--purple); border-color: rgba(168,85,247,.25); }
.mgmt-tag.is-yellow { background: rgba(255,214,0,.12); color: #ffd600; border-color: rgba(255,214,0,.25); }
.mgmt-tag.is-green  { background: rgba(57,179,107,.12); color: var(--green); border-color: rgba(57,179,107,.25); }
.mgmt-tag.is-muted  { background: var(--bg3); color: var(--muted); }
.mgmt-tag-x {
  background: none; border: none; color: var(--red);
  cursor: pointer; padding: 0 0 0 2px; font-weight: 700; line-height: 1;
  font-size: 14px;
}
.mgmt-tag-x:hover { color: #ff6b6b; }
.mgmt-tag-star {
  background: none; border: none; cursor: pointer;
  color: var(--text3); padding: 0 4px 0 0; font-size: 13px; line-height: 1;
}
.mgmt-tag-star:hover { color: var(--purple); }
.mgmt-tag-star.is-on { color: var(--purple); }

.mgmt-actions {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  justify-content: flex-end;
}

.mgmt-quick-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 6px; font-size: 11.5px; color: var(--text3);
}
.mgmt-link {
  background: none; border: none; padding: 0;
  font: inherit; color: var(--text2); cursor: pointer;
  border-bottom: 1px dashed transparent;
}
.mgmt-link:hover { color: var(--text); border-bottom-color: var(--bg3); }
.mgmt-link-sep { color: var(--bg3); user-select: none; }
.mgmt-link-group { display: inline-flex; align-items: center; gap: 6px; }

.mgmt-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; font-size: 10px; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase;
  border-radius: 4px;
}
.mgmt-pill.role-streamer { background: rgba(57,179,107,.15); color: var(--green); }
.mgmt-pill.role-mod      { background: rgba(255,214,0,.15); color: #ffd600; }
.mgmt-pill.role-admin    { background: rgba(168,85,247,.18); color: var(--purple); }
.mgmt-pill.role-demo     { background: var(--bg3); color: var(--text2); }

.mgmt-select { padding: 4px 8px; font-size: 12px; height: 30px; min-width: 96px; }

.mgmt-empty {
  text-align: center; padding: 36px 16px; color: var(--text3);
}
.mgmt-empty-icon { font-size: 28px; margin-bottom: 8px; opacity: .6; }
.mgmt-empty-title { font-size: 13px; font-weight: 600; color: var(--text2); }

.mgmt-create-card {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.mgmt-create-title {
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text3);
  margin-bottom: 10px;
}
.mgmt-create-row {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.mgmt-create-row .input { width: 160px; }
.mgmt-create-row select.input { width: 140px; }
.mgmt-create-hint {
  font-size: 11.5px; color: var(--text3); margin-top: 12px; line-height: 1.5;
}
.mgmt-viewer-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--bg3);
}
.mgmt-viewer-tabs label {
  font-size: 12px; color: var(--text2);
  display: inline-flex; align-items: center; gap: 4px;
}
.mgmt-viewer-label {
  font-size: 10px; color: var(--text3); width: 100%;
  font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 2px;
}

@media (max-width: 720px) {
  .mgmt-row { grid-template-columns: 36px 1fr; }
  .mgmt-actions { grid-column: 1 / -1; justify-content: flex-start; padding-top: 4px; }
}

/* ─────────────────────────────────────────────────────────────────────
   IAM redesign — Tier badges, Account-type marks, Inbox strip,
   Tier-products manager. Single accent (--accent), no chip fills,
   typography carries hierarchy. Borders do edge work.
   ───────────────────────────────────────────────────────────────────── */

/* Typographic tier badge — letter pair, no fill. The point is restraint:
   T0 reads as muted, T1/T3 lean on accent intensity, M1 uses --green to
   distinguish the mod-only ladder. This is the only place tier color
   appears, so the page never turns into chip soup. */
.tier-mark {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 18px; padding: 0 6px;
  font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .04em;
  color: var(--text3);
  border: 1px solid var(--border);
  border-radius: 3px;
  background: transparent;
  text-transform: uppercase;
  vertical-align: 1px;
  user-select: none;
}
.tier-mark[data-tier="T1"] { color: var(--accent); border-color: var(--border-hov); }
.tier-mark[data-tier="T2"] { color: var(--accent); border-color: var(--accent); }
.tier-mark[data-tier="T3"] { color: var(--accent); border-color: var(--accent); }
.tier-mark[data-tier="M1"] { color: var(--green); border-color: rgba(34,197,94,.4); }
.tier-mark[data-tier="T0"] { color: var(--text3); }
.tier-mark.is-button { cursor: pointer; transition: border-color .12s ease, color .12s ease; }
.tier-mark.is-button:hover { border-color: var(--accent); color: var(--accent); }
.tier-mark.is-button:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }

/* Account-type cue — single uppercase letter, no box. Sits inside the
   meta line as a subtle classification mark, not a primary control. */
.acct-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text3);
  border: 1px solid var(--border);
  border-radius: 50%;
  vertical-align: -2px;
}
.acct-mark[data-type="standalone"] { color: var(--text2); border-color: var(--border-hov); }
.acct-mark[data-type="mod"]        { color: var(--text2); }

/* Inline tier-edit popover. Appears anchored to the clicked .tier-mark. */
.tier-pop {
  position: absolute; z-index: 1000;
  display: flex; flex-direction: column;
  min-width: 168px;
  padding: 4px;
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 6px;
  box-shadow: var(--card-shadow-hover);
}
.tier-pop button {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: transparent; border: 0; border-radius: 4px;
  color: var(--text); font: inherit; text-align: left;
  cursor: pointer;
}
.tier-pop button:hover, .tier-pop button:focus-visible {
  background: var(--bg4); outline: none;
}
.tier-pop button[aria-checked="true"] {
  color: var(--accent);
}
.tier-pop .tier-pop-name { flex: 1; }
.tier-pop .tier-pop-hint { color: var(--text3); font-size: 11px; }

/* ── Inbox strip (mod-invite responses) ─────────────────────────────
   Sits above the user-mgmt tabs. Collapsed: a single quiet line.
   Expanded: each response on its own row with reason + acknowledge.
   Pattern follows Stripe Dashboard inbox: stays in the page, never
   covers content. */
.iam-inbox {
  margin: 0 -20px 14px;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg4);
}
.iam-inbox.is-empty { display: none; }
.iam-inbox-summary {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
}
.iam-inbox-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--yellow);
}
.iam-inbox-text { color: var(--text); font-weight: 500; }
.iam-inbox-text small { color: var(--text3); font-weight: 400; margin-left: 6px; }
.iam-inbox-toggle {
  margin-left: auto; color: var(--text3); font: 600 11px ui-monospace, monospace;
  text-transform: uppercase; letter-spacing: .06em;
}
.iam-inbox-list { display: none; margin-top: 10px; }
.iam-inbox.is-open .iam-inbox-list { display: block; }
.iam-inbox-row {
  display: grid; grid-template-columns: 1fr auto;
  align-items: start; gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.iam-inbox-row:first-child { border-top: 0; }
.iam-inbox-row .iam-inbox-who { color: var(--text); font-weight: 600; font-size: 13px; }
.iam-inbox-row .iam-inbox-meta { color: var(--text3); font-size: 11px; margin-top: 1px; }
.iam-inbox-row .iam-inbox-reason {
  margin-top: 6px; padding: 8px 10px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 4px;
  color: var(--text2); font-size: 12.5px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}

/* ── Tier-products manager (admin) ──────────────────────────────────
   One card. Four rows. Display name + Stripe Price + Stripe Product +
   monthly price + active toggle. T0 row is read-only. */
.tier-manager { padding: 18px 20px 22px; }
.tier-manager-grid {
  display: grid;
  grid-template-columns: 64px 1.1fr 1.4fr 1.4fr 100px 80px 80px;
  gap: 8px 12px;
  align-items: center;
}
.tier-manager-head {
  display: contents;
}
.tier-manager-head > div {
  font: 600 10px/1 ui-monospace, monospace; letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.tier-manager-row { display: contents; }
.tier-manager-row > .cell {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
}
.tier-manager-row > .cell input,
.tier-manager-row > .cell select {
  width: 100%; min-width: 0;
  padding: 6px 8px;
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}
.tier-manager-row > .cell input:focus,
.tier-manager-row > .cell select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
.tier-manager-row[data-readonly] > .cell {
  color: var(--text3);
}
.tier-manager-row[data-readonly] > .cell input { opacity: .5; pointer-events: none; }
.tier-manager-actions {
  margin-top: 14px; display: flex; gap: 8px; justify-content: flex-end;
}
.tier-manager-hint {
  color: var(--text3); font-size: 12px; line-height: 1.5;
  margin-top: 4px;
}

@media (max-width: 920px) {
  .tier-manager-grid { grid-template-columns: 56px 1fr 1fr; }
  .tier-manager-head > div:nth-child(n+4),
  .tier-manager-row > .cell:nth-child(n+4) { display: none; }
}

/* ── Premium-Mods (settings → mod-management) ─────────────────────────
   Streamer view of "who has my premium tools". Three design moves:
   1. Slot meter at the top — one mark per slot, filled = used, so usage
      reads at a glance instead of from a sentence.
   2. Star toggle per channel-row replaces Grant/Revoke buttons. Same
      glyph for on/off (★/☆), so the affordance is consistent.
   3. Tier badge (T1/T2) shown next to the title — single source of
      tier vocabulary across the app. */
.pm-card {
  margin-top: 18px;
  padding: 18px 20px 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.pm-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.pm-title-row { display: inline-flex; align-items: center; gap: 8px; }
.pm-title {
  font: 600 14px/1.2 system-ui, sans-serif; color: var(--text);
}
.pm-usage { color: var(--text3); font-size: 12.5px; }
.pm-usage strong { color: var(--text); font-weight: 600; }
.pm-meter {
  display: flex; gap: 4px; align-items: center;
  margin-bottom: 10px;
}
.pm-slot {
  width: 26px; height: 6px; border-radius: 2px;
  background: var(--bg4); border: 1px solid var(--border);
}
.pm-slot.is-filled {
  background: var(--accent);
  border-color: var(--accent);
}
.pm-slot-overflow {
  margin-left: 6px;
  font: 600 11px ui-monospace, monospace;
  color: var(--text3);
}
.pm-meter-empty {
  padding: 8px 12px; margin-bottom: 10px;
  background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.25);
  border-radius: 4px;
  color: var(--yellow); font-size: 12.5px;
}
.pm-desc {
  color: var(--text3); font-size: 12.5px; line-height: 1.5;
  margin-bottom: 14px;
}
.pm-list { list-style: none; padding: 0; margin: 0; }
.pm-mod {
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.pm-mod:first-child { border-top: 0; padding-top: 4px; }
.pm-mod-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.pm-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover;
  background: var(--bg4);
}
.pm-avatar-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 12px system-ui, sans-serif; color: var(--text2);
}
.pm-mod-name { font: 600 13px system-ui, sans-serif; color: var(--text); }
.pm-channels {
  list-style: none; padding: 0 0 0 38px; margin: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.pm-channel-row {
  display: grid; grid-template-columns: 1fr auto 32px;
  align-items: center; gap: 10px;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: 4px;
}
.pm-channel {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; color: var(--text2);
}
.pm-status {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .01em;
}
.pm-status-active { color: var(--accent); }
.pm-status-paused { color: var(--yellow); }
.pm-status-off    { color: var(--text3); }

/* Star toggle — single glyph for on (★) and off (☆) so users learn one
   control. Filled gold = active premium, outline = available slot,
   disabled outline = no slot / no permission. */
.pm-star {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 16px; line-height: 1;
  color: var(--text3);
  cursor: pointer;
  transition: color .12s ease, border-color .12s ease, background-color .12s ease;
}
.pm-star:hover:not([disabled]) {
  color: var(--accent); border-color: var(--accent);
  background: var(--accent-soft);
}
.pm-star:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
.pm-star.is-on { color: var(--yellow); border-color: rgba(245,158,11,.4); }
.pm-star.is-on.is-active { color: #f59e0b; border-color: rgba(245,158,11,.6); background: rgba(245,158,11,.08); }
.pm-star.is-on.is-paused { opacity: .5; }
.pm-star[disabled] { cursor: not-allowed; opacity: .35; }
.pm-star[disabled]:hover { color: var(--text3); border-color: var(--border); background: transparent; }

@media (max-width: 640px) {
  .pm-channels { padding-left: 0; }
  .pm-channel-row { grid-template-columns: 1fr auto 32px; }
}

/* Premium page: mod already covered by streamer (suppressed shop) */
.donator-mod-covered {
  padding: 32px 28px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 2px solid var(--green);
  text-align: left;
  max-width: 640px;
}
.donator-mod-covered-title {
  font: 700 17px/1.3 system-ui, sans-serif;
  letter-spacing: -.01em;
  color: var(--text);
  margin-bottom: 8px;
}
.donator-mod-covered-body {
  color: var(--text2);
  font-size: 13.5px;
  line-height: 1.65;
  margin: 0;
}

/* ── Invite landing page (full-screen accept/reject) ─────────────── */
.invite-stage {
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: 40px 20px;
  background: var(--bg);
}
.invite-card {
  width: min(440px, 100%);
  padding: 32px 28px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.invite-card h1 {
  margin: 0 0 4px; font-size: 22px; font-weight: 600; color: var(--text);
}
.invite-card .invite-sub {
  color: var(--text3); font-size: 13px; line-height: 1.5;
}
.invite-card .invite-channel {
  margin: 18px 0 8px;
  font: 600 11px ui-monospace, monospace; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text3);
}
.invite-card .invite-channel-name {
  font: 600 28px/1.1 system-ui, sans-serif;
  color: var(--accent); letter-spacing: -.01em;
}
.invite-card .invite-bullets {
  margin: 20px 0 24px; padding: 0; list-style: none;
  border-top: 1px solid var(--border);
}
.invite-card .invite-bullets li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex; gap: 10px; align-items: center;
  color: var(--text2); font-size: 13.5px;
}
.invite-card .invite-bullets li::before {
  content: ""; width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent); flex: 0 0 auto;
}
.invite-actions { display: flex; gap: 10px; }
.invite-actions .btn { flex: 1; padding: 10px 14px; }
.invite-reject-form {
  margin-top: 14px; display: none;
  border-top: 1px solid var(--border); padding-top: 14px;
}
.invite-reject-form.is-open { display: block; }
.invite-reject-form textarea {
  width: 100%; min-height: 84px;
  padding: 8px 10px;
  background: var(--bg4); border: 1px solid var(--border); border-radius: 4px;
  color: var(--text); font: inherit; resize: vertical;
}
.invite-reject-form textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none;
}
.invite-reject-form .invite-reject-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px;
}
.invite-status {
  margin-top: 16px; padding: 12px;
  background: var(--bg4); border: 1px solid var(--border); border-radius: 4px;
  color: var(--text2); font-size: 13px; text-align: center;
}
.invite-status.is-error { color: var(--red); border-color: rgba(239,68,68,.3); }
.invite-status.is-success { color: var(--green); border-color: rgba(34,197,94,.3); }

/* ─────────────────────────────────────────────────────────────────────
   Sniper · Identifier-Lookup
   Refined surface for the BM identifier cross-reference subtab.
   Aims to feel quieter than the existing tabs — fewer borders, more
   typographic hierarchy, single accent (purple) for primary actions.
   ───────────────────────────────────────────────────────────────────── */

/* Form layout — mobile-first: stacks until 720px, then 3-column grid */
.sc-idl-form { padding-bottom: 18px; }
.sc-idl-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
@media (min-width: 720px) {
  .sc-idl-row {
    grid-template-columns: minmax(240px, 2.4fr) minmax(170px, 1fr) auto;
    align-items: end;
  }
}
.sc-idl-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sc-idl-field .input { width: 100%; }
.sc-idl-threshold-label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.sc-idl-threshold-label > span:last-child {
  color: var(--purple); font-weight: 600; font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* Shared range-slider style — mirrors the multichat-overlay opacity slider.
   Set --sc-range-pct on the element (e.g. style="--sc-range-pct:60%") so the
   WebKit track gradient fills correctly. Firefox uses ::-moz-range-progress. */
input[type="range"].sc-range-slider {
  flex: 1;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  cursor: pointer;
  margin: 0;
  padding: 0;
}
input[type="range"].sc-range-slider::-webkit-slider-runnable-track {
  height: 4px;
  background: linear-gradient(to right,
    var(--purple) 0%, var(--purple) var(--sc-range-pct, 50%),
    var(--bg3)    var(--sc-range-pct, 50%), var(--bg3) 100%);
  border-radius: 2px;
}
input[type="range"].sc-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; margin-top: -5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  cursor: pointer; transition: transform 0.12s;
}
input[type="range"].sc-range-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"].sc-range-slider::-moz-range-track {
  height: 4px; background: var(--bg3); border-radius: 2px; border: none;
}
input[type="range"].sc-range-slider::-moz-range-progress {
  height: 4px; background: var(--purple); border-radius: 2px;
}
input[type="range"].sc-range-slider::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  cursor: pointer;
}
input[type="range"].sc-range-slider:disabled { opacity: 0.4; cursor: not-allowed; }
.sc-idl-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.sc-idl-actions .btn-purple { flex: 1; justify-content: center; }
@media (min-width: 720px) {
  .sc-idl-actions { flex-wrap: nowrap; }
  .sc-idl-actions .btn-purple { flex: 0 0 auto; }
}

/* Channels section */
.sc-idl-channels-section {
  border-top: 1px solid var(--bg3);
  padding-top: 14px; margin-top: 4px;
}
.sc-idl-channels-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 8px; margin-bottom: 8px; flex-wrap: wrap;
}
.sc-idl-channels-hint { font-size: 11px; color: var(--text3); }
.sc-idl-channels-wrap {
  display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px;
}
.sc-idl-channels-placeholder {
  color: var(--text3); font-size: 12px; padding: 4px 0;
}

/* Channel chip */
.sc-idl-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px;
  background: var(--bg2); border: 1px solid var(--bg3); border-radius: 999px;
  font-size: 12px; color: var(--text2); cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  user-select: none;
}
.sc-idl-chip:hover { border-color: var(--bg4); color: var(--text); }
.sc-idl-chip > input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 12px; height: 12px; border-radius: 3px;
  border: 1px solid var(--bg3); background: var(--bg);
  margin: 0; cursor: pointer; position: relative;
  transition: background .15s ease, border-color .15s ease;
}
.sc-idl-chip > input[type="checkbox"]:checked {
  background: var(--purple); border-color: var(--purple);
}
.sc-idl-chip > input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 3px; top: 0px;
  width: 4px; height: 8px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.sc-idl-chip.active {
  background: rgba(145,70,255,.10);
  border-color: var(--purple);
  color: var(--text);
}

/* Status line under the form */
.sc-idl-status {
  color: var(--text3); font-size: 12px; min-height: 16px;
  margin-top: 12px;
  font-variant-numeric: tabular-nums;
}

/* Empty state card */
.sc-idl-empty {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 48px 24px; color: var(--text3);
}
.sc-idl-empty-icon { opacity: .4; margin-bottom: 14px; color: var(--text2); }
.sc-idl-empty-title {
  font-size: 14px; font-weight: 500; color: var(--text2); margin-bottom: 6px;
}
.sc-idl-empty-hint { font-size: 12px; max-width: 460px; line-height: 1.55; }

/* Card header alignment */
.sc-idl-card-hdr { display: flex; align-items: center; gap: 10px; }
.sc-idl-current {
  font-size: 12px; color: var(--text3);
}
.sc-idl-current strong { color: var(--text2); font-weight: 500; }
.sc-idl-count-pill {
  font-size: 11px; color: var(--text3);
  background: var(--bg2); border: 1px solid var(--bg3);
  padding: 2px 9px; border-radius: 999px;
  font-variant-numeric: tabular-nums; min-width: 24px; text-align: center;
}

/* Summary strip — KPI tiles. Stacks on narrow, 2-col on tablets, 3-col on wide */
.sc-idl-summary-strip {
  display: grid; grid-template-columns: 1fr;
  gap: 10px; margin-bottom: 16px;
}
@media (min-width: 600px) {
  .sc-idl-summary-strip { grid-template-columns: repeat(3, 1fr); }
}
.sc-idl-tile {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 10px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  min-height: 56px;
}
.sc-idl-tile-num {
  grid-column: 1 / 2; grid-row: 1 / 3;
  font-size: 22px; font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums; line-height: 1;
  align-self: center;
}
.sc-idl-tile-num.is-zero { color: var(--text3); font-weight: 500; }
.sc-idl-tile-label {
  grid-column: 2 / 3; grid-row: 1 / 2;
  font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text3);
  align-self: end;
}
.sc-idl-tile-meta {
  grid-column: 2 / 3; grid-row: 2 / 3;
  font-size: 11px; color: var(--text2);
  align-self: start;
  display: flex; gap: 10px; flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}
.sc-idl-tile-meta span:empty { display: none; }
.sc-idl-tile-link {
  grid-column: 3 / 4; grid-row: 1 / 3;
  align-self: center;
}
.sc-idl-tile-accent {
  border-color: rgba(145,70,255,.3);
  background: linear-gradient(180deg, rgba(145,70,255,.06), var(--bg2));
}
.sc-idl-tile-accent .sc-idl-tile-num:not(.is-zero) { color: var(--purple); }

/* Result tables */
.sc-idl-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.sc-idl-table thead th {
  text-align: left;
  font-size: 10px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 8px 12px;
  border-bottom: 1px solid var(--bg3);
}
.sc-idl-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bg2);
  vertical-align: middle;
}
.sc-idl-table tbody tr:last-child td { border-bottom: none; }
.sc-idl-table tbody tr { transition: background .15s ease; }
.sc-idl-table tbody tr:hover td { background: rgba(145,70,255,.04); }
.sc-idl-table tbody tr.is-pending td { opacity: .55; }

.sc-idl-th-meta   { width: 1%; white-space: nowrap; }
.sc-idl-th-score  { width: 76px; }
.sc-idl-th-action { width: 1%; white-space: nowrap; text-align: right; }
.sc-idl-meta      { color: var(--text3); font-size: 12px; white-space: nowrap; }
.sc-idl-num       { font-variant-numeric: tabular-nums; color: var(--text2); }
.sc-idl-action    { text-align: right; }

.sc-idl-code {
  display: inline-block;
  background: var(--bg2);
  border: 1px solid var(--bg3);
  padding: 2px 8px;
  border-radius: 5px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--text2);
  max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  vertical-align: middle;
}

/* Score chip — three confidence buckets, with a small leading dot */
.sc-idl-score {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  border: 1px solid transparent;
}
.sc-idl-score::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 2px rgba(255,255,255,.05);
}
.sc-idl-score-high {
  background: rgba(34,197,94,.12); color: #22c55e;
  border-color: rgba(34,197,94,.28);
}
.sc-idl-score-mid {
  background: rgba(234,179,8,.12); color: #eab308;
  border-color: rgba(234,179,8,.28);
}
.sc-idl-score-low {
  background: var(--bg2); color: var(--text3);
  border-color: var(--bg3);
}

/* Side-by-side matches grid — stacks below 1280px */
.sc-idl-matches-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.sc-idl-matches-grid > .card { margin-bottom: 0; min-width: 0; }
@media (min-width: 1280px) {
  .sc-idl-matches-grid { grid-template-columns: 1fr 1fr; }
  /* Tighter cells in the side-by-side layout */
  .sc-idl-matches-grid .sc-idl-table thead th,
  .sc-idl-matches-grid .sc-idl-table tbody td {
    padding-left: 8px; padding-right: 8px;
  }
  .sc-idl-matches-grid .sc-idl-code { max-width: 140px; }
}

/* Result-card body wrappers — let tables overflow horizontally on
   narrow cards instead of pushing the action column off the side. */
#sc-idl-player-matches-body,
#sc-idl-chat-matches-body {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bg3) transparent;
}
#sc-idl-player-matches-body::-webkit-scrollbar,
#sc-idl-chat-matches-body::-webkit-scrollbar { height: 8px; }
#sc-idl-player-matches-body::-webkit-scrollbar-thumb,
#sc-idl-chat-matches-body::-webkit-scrollbar-thumb {
  background: var(--bg3); border-radius: 4px;
}

/* Status indicators — green pulsing dot for live, grey static for offline */
.sc-idl-live, .sc-idl-offline {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500;
  letter-spacing: .01em;
}
.sc-idl-live { color: #22c55e; }
.sc-idl-offline { color: var(--text2); }

.sc-idl-live::before, .sc-idl-offline::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  flex-shrink: 0;
}
.sc-idl-live::before {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.18);
  animation: scIdlLivePulse 2s ease-in-out infinite;
}
.sc-idl-offline::before {
  background: var(--bg4, #555);
}
@keyframes scIdlLivePulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
  50%      { box-shadow: 0 0 0 6px rgba(34,197,94,.06); }
}

.sc-idl-status-cell {
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.sc-idl-status-cell .sc-idl-meta { font-size: 11px; }

/* Identifier list rows — typographic, capped to ~5 visible rows
   then scrolls. Custom thin scrollbar matches the dashboard. */
.sc-idl-id-list {
  display: flex; flex-direction: column;
  max-height: 232px;            /* ~5 rows of 46px */
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bg3) transparent;
}
.sc-idl-id-list::-webkit-scrollbar { width: 8px; }
.sc-idl-id-list::-webkit-scrollbar-track { background: transparent; }
.sc-idl-id-list::-webkit-scrollbar-thumb {
  background: var(--bg3); border-radius: 4px;
  border: 2px solid transparent; background-clip: content-box;
}
.sc-idl-id-list::-webkit-scrollbar-thumb:hover { background: var(--bg4); background-clip: content-box; border: 2px solid transparent; }
.sc-idl-id-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid var(--bg2);
  gap: 12px;
}
.sc-idl-id-row:last-child { border-bottom: none; }
.sc-idl-id-row:hover { background: rgba(145,70,255,.03); }
.sc-idl-id-name {
  font-size: 14px; font-weight: 500; color: var(--text);
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
}
.sc-idl-id-current-badge {
  font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  background: rgba(145,70,255,.14); color: var(--purple);
  border: 1px solid rgba(145,70,255,.3);
  padding: 1px 7px; border-radius: 999px;
  font-weight: 600;
}
.sc-idl-id-times {
  font-size: 11px; color: var(--text3); white-space: nowrap;
  font-variant-numeric: tabular-nums;
  display: flex; gap: 12px;
}
.sc-idl-id-times span strong {
  color: var(--text2); font-weight: 500;
  margin-left: 2px;
}

/* Status pills inside the "Bekannt" / action cells.
   Designed to match the 28px height of icon/primary buttons in the
   action cluster so everything in the row aligns on one baseline. */
.sc-idl-pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px;
  padding: 0 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
  letter-spacing: .01em;
}
.sc-idl-pill-linked {
  background: rgba(34,197,94,.10); color: #22c55e;
  border-color: rgba(34,197,94,.25);
}
.sc-idl-pill-untracked {
  background: var(--bg2); color: var(--text3);
  border-color: var(--bg3);
}
.sc-idl-pill-conflict {
  background: rgba(239,68,68,.10); color: var(--red);
  border-color: rgba(239,68,68,.28);
}
.sc-idl-pill svg { flex-shrink: 0; }

/* Action cluster — primary link button + secondary icon button on one line */
.sc-idl-actions-cluster {
  display: inline-flex; align-items: center; gap: 4px;
  white-space: nowrap;
}

/* Primary link action ("Verknüpfen" / "BM-ID verknüpfen") */
.sc-idl-link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px;
  padding: 0 11px;
  background: var(--purple);
  border: 1px solid var(--purple);
  color: #fff;
  border-radius: 6px;
  font-size: 12px; font-weight: 500;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .15s ease, transform .12s ease, box-shadow .15s ease;
  font-family: inherit;
  box-shadow: 0 1px 0 rgba(0,0,0,.12);
  white-space: nowrap;
}
.sc-idl-link-btn:hover {
  background: #a36bff;
  border-color: #a36bff;
  box-shadow: 0 2px 8px rgba(145,70,255,.32);
}
.sc-idl-link-btn:active { transform: translateY(1px); }
.sc-idl-link-btn:disabled {
  opacity: .6; cursor: default;
  background: rgba(145,70,255,.22);
  border-color: rgba(145,70,255,.22);
  color: rgba(255,255,255,.7);
  box-shadow: none;
}

/* Icon-only square button (Open Profile → new tab) */
.sc-idl-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: var(--bg2);
  border: 1px solid var(--bg3);
  color: var(--text2);
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  text-decoration: none;
  flex-shrink: 0;
}
.sc-idl-icon-btn:hover {
  background: var(--bg3);
  border-color: var(--bg4);
  color: var(--text);
  text-decoration: none;
}
.sc-idl-icon-btn:focus-visible {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(145,70,255,.15);
}

/* Range slider (purple thumb) */
#sc-subtab-identifier input[type="range"] {
  -webkit-appearance: none; appearance: none;
  height: 4px; background: var(--bg3); border-radius: 2px;
  outline: none; margin: 6px 0 0;
}
#sc-subtab-identifier input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--purple); cursor: pointer;
  box-shadow: 0 0 0 4px rgba(145,70,255,.10);
  transition: box-shadow .15s ease;
}
#sc-subtab-identifier input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 6px rgba(145,70,255,.18);
}
#sc-subtab-identifier input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--purple); border: none; cursor: pointer;
}
