﻿/* ============================================
   RaidFollower v2 - Dark Twitch Theme
   ============================================ */

:root {
  --bg: #0e0e10;
  --surface: #18181b;
  --card: #1f1f23;
  --elevated: #26262c;
  --border: #2f2f35;
  --border-light: #3a3a40;

  --purple: #9147ff;
  --purple-hover: #772ce8;
  --purple-dim: rgba(145, 71, 255, 0.15);
  --purple-glow: rgba(145, 71, 255, 0.3);

  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.14);
  --blue: #3b82f6;
  --blue-dim: rgba(59, 130, 246, 0.14);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --orange: #f59e0b;
  --orange-dim: rgba(245, 158, 11, 0.12);

  --text: #efeff1;
  --text-secondary: #adadb8;
  --text-dim: #a1a1aa;
  --text-muted: #a1a1aa;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --topbar-h: 56px;
  --hero-h: 180px;
  --sidenav-w: 200px;
  --transition: 0.2s ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
button.link-btn {
  background: none;
  border: none;
  color: var(--text);
  padding: 0;
  font: inherit;
  text-align: left;
}
button.link-btn:hover { color: var(--purple); }
img { display: block; max-width: 100%; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ============================================
   TOP BAR
   ============================================ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  padding: 0 20px;
  gap: 16px;
}
.topbar-inner {
  width: min(1600px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.topbar-center { flex: 1; min-width: 0; display: flex; justify-content: center; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.menu-btn {
  display: flex; background: none; border: none; color: var(--text-secondary);
  padding: 6px; border-radius: 4px;
}
.menu-btn:hover { color: var(--text); background: var(--elevated); }

.brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 500; color: var(--text);
  white-space: nowrap;
}
.brand strong { color: var(--text); }
.brand-swarm { color: var(--purple); font-weight: 700; }

.brand-folder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  transform: translateY(-1px);
}

.brand-icon {
  width: 10px; height: 10px; background: var(--purple);
  border-radius: 50%; display: inline-block;
  box-shadow: 0 0 8px var(--purple-glow);
}

/* Live chips in topbar */
.live-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  max-width: 100%;
  padding: 4px 0;
  scrollbar-width: none;
}
.live-chips::-webkit-scrollbar { display: none; }
.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
}
.live-chip:hover { color: var(--text); border-color: var(--border-light); background: var(--elevated); }
.live-chip.active { color: var(--text); background: var(--purple-dim); border-color: var(--purple); }
.live-chip-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--elevated);
  object-fit: cover;
}
.live-chip-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse-dot 2s infinite;
}
.live-chip-viewers { font-weight: 700; font-size: 12px; color: var(--text); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Online badge */
.online-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 16px;
  background: var(--red-dim); color: var(--red);
  font-size: 12px; font-weight: 600;
}
.pulse-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red); animation: pulse-dot 2s infinite;
}

.btn-signout {
  padding: 6px 14px; border-radius: 6px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 12px; font-weight: 500;
  transition: all var(--transition);
}
.btn-signout:hover { color: var(--text); border-color: var(--border-light); background: var(--elevated); }
.btn-feedback {
  padding: 6px 14px;
  border-radius: 6px;
  background: rgba(145, 71, 255, 0.14);
  border: 1px solid rgba(145, 71, 255, 0.42);
  color: #d9c5ff;
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition);
}
.btn-feedback:hover {
  color: #fff;
  border-color: rgba(145, 71, 255, 0.68);
  background: rgba(145, 71, 255, 0.28);
}

/* Settings dropdown */
.settings-wrap { position: relative; }
.settings-btn {
  width: 34px; height: 34px; border-radius: 8px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-dim); display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; transition: all var(--transition);
}
.settings-btn:hover { color: var(--text); border-color: var(--border-light); background: var(--elevated); }
.settings-btn svg { transition: transform 0.3s ease; }
.settings-btn:hover svg { transform: rotate(45deg); }
.settings-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 400;
  min-width: 240px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  padding: 10px 0;
}
.settings-dropdown.hidden { display: none; }
.settings-section-title {
  padding: 6px 14px 2px; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim);
}
.settings-section-sub {
  padding: 0 14px 8px; font-size: 11px; color: var(--text-dim);
}
.settings-option {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; font-size: 13px; color: var(--text);
  cursor: pointer; transition: background 0.15s;
}
.settings-option-text { flex: 1; }
.settings-live-count {
  font-size: 11px; font-weight: 700; color: var(--red);
  background: var(--red-dim);
  padding: 1px 7px; border-radius: 10px;
  display: none; align-items: center; gap: 4px;
}
.settings-live-count.visible { display: inline-flex; }
.settings-live-count::before {
  content: ""; width: 6px; height: 6px;
  background: var(--red); border-radius: 50%;
  display: inline-block;
}
.settings-option:hover { background: var(--elevated); }
.settings-option input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; border-radius: 4px;
  border: 2px solid var(--border-light); background: transparent;
  cursor: pointer; position: relative; flex-shrink: 0;
  transition: all 0.15s;
}
.settings-option input[type="checkbox"]:checked {
  background: var(--purple); border-color: var(--purple);
}
.settings-option input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 3px; top: 1px;
  width: 6px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ============================================
   SIDE PANEL
   ============================================ */
.side-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  height: 100vh;
  background: var(--surface);
  background-color: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 200;
  transform: translateX(-100%);
  transition: transform var(--transition);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 16px 0 40px rgba(0,0,0,0.45);
}
.side-panel.open { transform: translateX(0); }
.side-panel > * {
  position: relative;
  z-index: 1;
}
.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.side-panel-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.side-panel-close:hover { color: var(--text); border-color: var(--border-light); background: var(--elevated); }
.side-panel-search {
  padding: 12px 18px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
}
.side-panel-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
}
.side-panel-input::placeholder { color: var(--text-dim); }
.side-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
}
.sp-section {
  display: grid;
  gap: 8px;
}
.sp-section-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.sp-section-list {
  display: grid;
  gap: 8px;
}
.sp-channel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: rgba(31, 31, 35, 0.62);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.sp-channel-item.has-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--sp-channel-bg);
  background-size: 132% auto;
  background-position: right center;
  opacity: 0.56;
  transform: scale(1.02);
  filter: saturate(1.14) contrast(1.1) brightness(0.95);
  pointer-events: none;
}
.sp-channel-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(14, 14, 16, 0.94) 0%, rgba(14, 14, 16, 0.88) 34%, rgba(14, 14, 16, 0.62) 66%, rgba(14, 14, 16, 0.24) 100%);
  pointer-events: none;
}
.sp-channel-item:hover {
  background: rgba(38, 38, 44, 0.74);
  border-color: var(--border-light);
}
.sp-channel-item.active {
  background: var(--purple-dim);
  border-color: var(--purple);
  box-shadow: inset 3px 0 0 var(--purple);
}
.sp-channel-item > * {
  position: relative;
  z-index: 1;
}
.sp-channel-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--elevated);
  object-fit: cover;
  flex-shrink: 0;
}
.sp-channel-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.sp-channel-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-channel-game {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-channel-viewers {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.sp-channel-meta {
  margin-left: auto;
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 76px;
}
.sp-channel-last {
  font-size: 11px;
  color: rgba(239, 239, 241, 0.88);
  white-space: nowrap;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-channel-last.empty {
  color: rgba(173, 173, 184, 0.9);
}
.sp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}
.sp-dot.live { background: var(--red); animation: pulse-dot 2s infinite; }
.sp-live-card {
  background: rgba(31, 31, 35, 0.72);
  border: 1px solid var(--border);
  box-shadow: 0 16px 24px rgba(0,0,0,0.28);
}
.sp-folders-empty {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  color: var(--text-dim);
  font-size: 12px;
}
.sp-folder {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(24, 24, 27, 0.7);
  padding: 10px;
  display: grid;
  gap: 8px;
}
.sp-folder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.sp-folder-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.sp-folder-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  line-height: 1.2;
}
.sp-folder-list .sp-channel-item {
  background: rgba(31, 31, 35, 0.56);
}
.sp-folder-primary {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

/* ---- Persons of Interest folder ---- */
.sp-folder-neuro {
  border-color: rgba(145, 71, 255, 0.25);
  background: linear-gradient(135deg, rgba(145, 71, 255, 0.06) 0%, rgba(145, 71, 255, 0.02) 100%);
}
.sp-folder-neuro .sp-folder-header {
  color: #efe6ff;
}
.sp-folder-neuro .sp-folder-name {
  color: var(--purple);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.sp-folder-neuro .sp-folder-count {
  background: var(--purple-dim);
  border-color: rgba(145, 71, 255, 0.3);
  color: #bf9aff;
}
.sp-folder-live-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--red);
  background: var(--red-dim);
  padding: 1px 6px;
  border-radius: 8px;
  letter-spacing: 0.3px;
  animation: pulse-live 2s ease-in-out infinite;
}
@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.sp-folder-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sp-folder-chevron {
  color: var(--text-dim);
  transition: transform var(--transition);
  flex-shrink: 0;
}
.sp-folder.collapsed .sp-folder-chevron {
  transform: rotate(0deg);
}
.sp-folder:not(.collapsed) .sp-folder-chevron {
  transform: rotate(90deg);
}
.sp-folder.collapsed .sp-folder-list,
.sp-folder.collapsed .sp-folders-empty {
  display: none;
}
.sp-neuro-item {
  background: rgba(145, 71, 255, 0.06);
  border: 1px solid rgba(145, 71, 255, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
}
.sp-neuro-item:hover {
  background: rgba(145, 71, 255, 0.12);
  border-color: rgba(145, 71, 255, 0.25);
}
.sp-neuro-item.active {
  background: rgba(145, 71, 255, 0.15);
  border-color: var(--purple);
}
.sp-neuro-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.sp-neuro-status {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}
.sp-neuro-status.live {
  color: var(--red);
}
.sp-neuro-time {
  font-size: 10px;
  color: var(--text-dim);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  margin-top: var(--topbar-h);
  height: var(--hero-h);
  position: relative; overflow: hidden;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(145,71,255,0.22), rgba(0,0,0,0.75) 40%, rgba(0,0,0,0.85)),
    radial-gradient(520px 240px at 15% 25%, rgba(145,71,255,0.35), transparent 70%);
  background-size: cover;
  background-position: center;
  opacity: 0.95;
}

.hero-content {
  position: relative; z-index: 1;
  height: 100%; display: flex; align-items: center;
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 0 24px; gap: 24px;
}

.hero-avatar-wrap {
  position: relative; flex-shrink: 0;
}
.hero-avatar {
  width: 100px; height: 100px; border-radius: 50%;
  border: 3px solid var(--purple);
  background: var(--elevated);
  object-fit: cover;
}
.hero-live-badge {
  position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  padding: 1px 8px; border-radius: 4px;
  background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
}

.hero-info { flex: 1; min-width: 0; }
.hero-name { font-size: 28px; font-weight: 700; line-height: 1.2; text-shadow: 0 1px 6px rgba(0,0,0,0.6); }
.hero-twitch-link {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  color: seashell;
  opacity: 0.6;
  transition: color var(--transition), opacity var(--transition);
  vertical-align: middle;
}
.hero-twitch-link:hover { color: #9147ff; opacity: 1; }
.hero-tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0 6px;
  flex-wrap: wrap;
}
.hero-tab {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.8);
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition);
  backdrop-filter: blur(4px);
}
.hero-tab.active { color: #fff; border-color: var(--purple); background: rgba(145,71,255,0.35); }
.hero-tab:hover { color: #fff; border-color: rgba(255,255,255,0.3); }
.hero-meta {
  display: flex; align-items: center; gap: 10px;
  margin-top: 6px; color: rgba(255,255,255,0.75); font-size: 13px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.hero-game {
  padding: 2px 10px; border-radius: 4px;
  background: rgba(145,71,255,0.3); color: #c4a0ff;
  font-weight: 500; font-size: 12px;
  backdrop-filter: blur(4px);
}
.hero-separator { width: 3px; height: 3px; border-radius: 50%; background: var(--text-dim); }
.hero-viewers { font-weight: 600; }
.hero-title {
  margin-top: 8px; color: rgba(255,255,255,0.6); font-size: 13px;
  max-width: 600px; word-break: break-word;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
.main-layout {
  display: block;
  min-height: calc(100vh - var(--topbar-h) - var(--hero-h));
}

/* ---- Side Nav ---- */
.side-nav { display: none; }

.side-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius);
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
  transition: all var(--transition); cursor: pointer;
  margin-bottom: 2px;
}
.side-nav-item:hover { color: var(--text); background: var(--elevated); }
.side-nav-item.active {
  color: var(--text); background: var(--purple-dim);
  border-left: 3px solid var(--purple);
}
.side-nav-item svg { flex-shrink: 0; opacity: 0.7; }
.side-nav-item.active svg { opacity: 1; color: var(--purple); }

/* ---- Content ---- */
.content {
  flex: 1; padding: 24px 28px; min-width: 0;
  width: min(1600px, 100%);
  margin: 0 auto;
}

.section { display: block; }
.section.hidden { display: none; }

/* ============================================
   HOME
   ============================================ */
#section-home {
  padding: 24px;
  margin-top: calc(var(--topbar-h) - 24px);
}

.home-live-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.home-live-header h2 { font-size: 20px; font-weight: 600; }
.home-live-count,
.home-feed-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.home-live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.home-live-card {
  display: block;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: rgba(31, 31, 35, 0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.home-live-card.has-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--home-live-bg);
  background-size: 128% auto;
  background-position: right center;
  opacity: 0.56;
  transform: scale(1.02);
  filter: saturate(1.14) contrast(1.08) brightness(0.92);
  pointer-events: none;
}
.home-live-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(14, 14, 16, 0.95) 0%, rgba(14, 14, 16, 0.88) 34%, rgba(14, 14, 16, 0.62) 68%, rgba(14, 14, 16, 0.22) 100%);
  pointer-events: none;
}
.home-live-card > * {
  position: relative;
  z-index: 1;
}
.home-live-card:hover {
  border-color: var(--purple);
  transform: translateY(-2px);
  box-shadow: 0 16px 24px rgba(0, 0, 0, 0.28);
}
.home-live-card .home-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.home-live-card .home-channel-info { flex: 1; min-width: 0; }
.home-live-card .home-channel-name { font-size: 16px; font-weight: 600; color: var(--text); }
.home-live-card .home-channel-game {
  font-size: 13px;
  color: var(--purple);
  margin-top: 2px;
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--purple-dim);
}
.home-live-card .home-channel-title {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-live-card .home-viewers {
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.home-live-card .home-viewer-count { color: var(--red); }
.home-live-card .home-live-sep {
  color: rgba(239, 239, 241, 0.56);
  font-weight: 600;
}
.home-live-card .home-live-duration {
  color: rgba(239, 239, 241, 0.88);
  font-weight: 600;
}
.home-live-empty {
  text-align: center;
  padding: 48px 0;
  color: var(--text-dim);
  font-size: 15px;
  grid-column: 1 / -1;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
}
.home-live-empty-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  margin: 0 auto 12px;
  display: block;
}
/* Section headers */
.home-section-header {
  display: flex; align-items: center; gap: 12px;
  margin-top: 32px; margin-bottom: 16px;
}
.home-section-header h2 { font-size: 20px; font-weight: 600; }
.stream-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.stream-section-header h2 { font-size: 20px; font-weight: 600; }
.raid-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.raid-section-header h2 { font-size: 20px; font-weight: 600; }
.subs-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.subs-section-header h2 { font-size: 20px; font-weight: 600; }
.hl-range-selector,
.stream-range-selector,
.raid-range-selector,
.subs-range-selector {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.hl-range-btn,
.stream-range-btn,
.raid-range-btn,
.subs-range-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.hl-range-btn:hover,
.stream-range-btn:hover,
.raid-range-btn:hover,
.subs-range-btn:hover {
  color: var(--text);
  border-color: var(--border-light);
  background: var(--elevated);
}
.hl-range-btn.active,
.stream-range-btn.active,
.raid-range-btn.active,
.subs-range-btn.active {
  background: var(--purple-dim);
  border-color: var(--purple);
  color: var(--purple);
  font-weight: 600;
}

/* Highlight cards grid */
.home-highlights {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 960px) {
  .home-highlights { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .home-highlights { grid-template-columns: 1fr; }
}
.hl-card {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  position: relative;
  overflow: hidden;
}
.hl-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.hl-biggest::before { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.hl-targeted::before { background: linear-gradient(90deg, #22c55e, #10b981); }
.hl-active::before { background: linear-gradient(90deg, #3b82f6, #8b5cf6); }
.hl-stats::before { background: linear-gradient(90deg, #8b5cf6, #a855f7); }
.hl-header {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}
.hl-icon { font-size: 16px; opacity: 0.6; line-height: 1; }
.hl-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-dim);
}
.hl-value {
  font-size: 22px; font-weight: 700; color: var(--text);
  margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hl-detail { font-size: 13px; color: var(--text-secondary); }
.hl-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.hl-stat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; font-size: 13px; color: var(--text-secondary);
}
.hl-stat-row strong { font-weight: 700; color: var(--text); }
.hl-stat-row strong.green { color: var(--green, #22c55e); }
.hl-stat-row strong.blue { color: var(--blue, #3b82f6); }

/* Compact raid list */
.home-raid-list {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.rl-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.rl-row:last-child { border-bottom: none; }
.rl-row:hover { background: rgba(255,255,255,0.02); }
.rl-row.rl-row-compact {
  padding: 7px 12px;
  gap: 10px;
  font-size: 12px;
}
.rl-row.rl-row-compact .rl-dir {
  font-size: 9px;
  padding: 1px 6px;
}
.rl-row.rl-row-compact .rl-viewers {
  min-width: 120px;
  font-size: 12px;
}
.rl-row.rl-row-compact .rl-time {
  min-width: 70px;
  font-size: 12px;
}
.rl-dir {
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  padding: 2px 7px; border-radius: 4px; flex-shrink: 0;
}
.rl-dir.green { background: rgba(34,197,94,0.12); color: var(--green, #22c55e); }
.rl-dir.blue { background: rgba(59,130,246,0.12); color: var(--blue, #3b82f6); }
.rl-dir.purple { background: rgba(145,71,255,0.16); color: var(--purple, #9147ff); }
.rl-names { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.rl-arrow { color: var(--text-dim); margin: 0 2px; }
.rl-link { cursor: pointer; font-weight: 500; text-decoration: none; color: inherit; }
.rl-link:hover { color: var(--purple); }
.rl-viewers { font-weight: 600; color: var(--text); flex-shrink: 0; min-width: 45px; text-align: right; }
.rl-time { color: var(--text-dim); flex-shrink: 0; min-width: 80px; text-align: right; }

/* ============================================
   STATS ROW
   ============================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 20px;
}

.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  display: flex; flex-direction: column;
}
.stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); margin-bottom: 6px; }
.stat-value { font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat-sub { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.stat-link { color: var(--purple); text-decoration: none; cursor: pointer; }
.stat-link:hover { color: var(--text); text-decoration: underline; }

.stat-value.purple { color: var(--purple); }
.stat-value.green { color: var(--green); }
.stat-value.blue { color: var(--blue); }
.stat-value.orange { color: var(--orange); }
.stat-value.red { color: var(--red); }
.stat-value.yellow { color: #fcd34d; }

/* ============================================
   GRID LAYOUTS
   ============================================ */
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.grid-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 20px; }

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  margin-bottom: 20px;
}
.card:hover {
  border-color: rgba(145, 71, 255, 0.35);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.38);
}
.grid-2col .card, .grid-3col .card { margin-bottom: 0; }

.raid-bars-focused .apexcharts-bar-series .apexcharts-series path.apexcharts-bar-area {
  transition: opacity 120ms ease;
}

.card-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 14px; font-weight: 600; transition: color var(--transition); flex-shrink: 0; white-space: nowrap; }
.card-header { position: relative; }
.card-header.clickable { cursor: pointer; }
.card-header.clickable:hover h3 { color: var(--purple); }
.card-header-link {
  font-size: 12px;
  color: var(--text-dim);
  transition: color var(--transition);
}
.card-header.clickable:hover .card-header-link { color: var(--purple); }
.mini-item[data-ch], .stream-item[data-stream-id] { cursor: pointer; transition: background var(--transition); }
.mini-item[data-ch]:hover, .stream-item[data-stream-id]:hover { background: var(--elevated); }
.card-expand-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.card-expand-btn:hover { color: var(--text); border-color: var(--border-light); background: var(--elevated); }
.card-sub { font-size: 11px; color: var(--text-dim); margin-right: 22px;}
.category-help-inline {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.25;
}

.card-body { padding: 16px 18px; }

.card-highlight { border-color: var(--purple); background: linear-gradient(180deg, var(--purple-dim) 0%, var(--card) 100%); }

.chart-container { min-height: 240px; }
.chart-tall { min-height: 320px; }

/* ============================================
   RAID TABS
   ============================================ */
.raid-tabs {
  display: flex; gap: 4px; margin-bottom: 16px;
  background: var(--surface); padding: 4px;
  border-radius: var(--radius); width: fit-content;
  border: 1px solid var(--border);
}
.raid-tab {
  padding: 6px 16px; border-radius: 6px;
  background: transparent; border: none;
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
  transition: all var(--transition);
}
.raid-tab:hover { color: var(--text); }
.raid-tab.active { background: var(--purple); color: #fff; }

/* Hide raid summary panels when filtering incoming/outgoing */
.raid-filtered .raid-all-only { display: none; }
/* Show raid list only when filtering */
.raid-filter-only { display: none; }
.raid-filtered .raid-filter-only { display: block; }

/* Inline raid table controls */
/* Raid card: inline controls in header */
.raid-card-header-inline {
  gap: 10px;
}
.raid-card-inline-controls {
  display: flex;
  flex: 1;
  gap: 8px;
  min-width: 0;
}
.raid-card-inline-controls .rank-input,
.raid-card-inline-controls .rank-select {
  padding: 5px 8px;
  font-size: 12px;
}
.raid-card-inline-controls .rank-input:first-child {
  flex: 1.2;
  min-width: 0;
}
.raid-card-inline-controls .rank-input:nth-child(2) {
  flex: 0.6;
  min-width: 70px;
}
.raid-card-inline-controls .rank-select {
  flex: 0.8;
  min-width: 100px;
}
.raid-table-search {
  min-width: 0;
}

/* Rank modal */
.feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feedback-modal.hidden { display: none; }
.feedback-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 10, 0.72);
  backdrop-filter: blur(4px);
}
.feedback-modal-panel {
  position: relative;
  z-index: 1;
  width: min(560px, 94vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.feedback-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.feedback-modal-header h2 {
  font-size: 18px;
  line-height: 1.2;
}
.feedback-modal-sub {
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 12px;
}
.feedback-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.feedback-modal-close:hover {
  color: var(--text);
  border-color: var(--border-light);
  background: var(--elevated);
}
.feedback-modal-body {
  padding: 14px 20px;
}
.feedback-modal-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.feedback-modal-textarea {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}
.feedback-modal-textarea:focus {
  outline: none;
  border-color: rgba(145, 71, 255, 0.8);
  box-shadow: 0 0 0 1px rgba(145, 71, 255, 0.35);
}
.feedback-modal-textarea::placeholder {
  color: var(--text-dim);
}
.feedback-modal-meta {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.feedback-char-count {
  font-size: 12px;
  color: var(--text-dim);
}
.feedback-status {
  min-height: 18px;
  font-size: 12px;
  color: var(--text-secondary);
}
.feedback-status.error { color: var(--red); }
.feedback-status.success { color: var(--green); }
.feedback-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
}
.btn-feedback-cancel,
.btn-feedback-send {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition);
}
.btn-feedback-cancel {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
}
.btn-feedback-cancel:hover {
  color: var(--text);
  border-color: var(--border-light);
  background: var(--elevated);
}
.btn-feedback-send {
  border: 1px solid rgba(145, 71, 255, 0.62);
  background: rgba(145, 71, 255, 0.22);
  color: #e8dcff;
}
.btn-feedback-send:hover {
  border-color: rgba(145, 71, 255, 0.8);
  background: rgba(145, 71, 255, 0.34);
  color: #fff;
}
.btn-feedback-cancel:disabled,
.btn-feedback-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* FAQ button */
.faq-btn {
  width: 34px; height: 34px; border-radius: 8px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-dim); display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; transition: all var(--transition);
}
.faq-btn:hover { color: var(--text); border-color: var(--border-light); background: var(--elevated); }

/* FAQ modal */
.faq-modal {
  position: fixed; inset: 0; z-index: 330;
  display: flex; align-items: center; justify-content: center;
}
.faq-modal.hidden { display: none; }
.faq-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(6, 6, 10, 0.72);
  backdrop-filter: blur(4px);
}
.faq-modal-panel {
  position: relative; z-index: 1;
  width: min(620px, 94vw);
  max-height: 85vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.faq-modal-header {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 14px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.faq-modal-header h2 { font-size: 18px; line-height: 1.2; }
.faq-modal-sub { margin-top: 4px; color: var(--text-dim); font-size: 12px; }
.faq-modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--text-dim); display: inline-flex;
  align-items: center; justify-content: center;
  transition: all var(--transition);
}
.faq-modal-close:hover {
  color: var(--text); border-color: var(--border-light); background: var(--elevated);
}
.faq-modal-body {
  padding: 8px 20px 20px;
  overflow-y: auto;
}
.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-item:last-child { border-bottom: none; }
.faq-question {
  width: 100%; display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
  padding: 14px 0; background: none; border: none;
  color: var(--text); font-size: 14px; font-weight: 600;
  text-align: left; cursor: pointer;
  transition: color var(--transition);
}
.faq-question:hover { color: var(--purple); }
.faq-chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
  color: var(--text-dim);
}
.faq-item.open > .faq-question .faq-chevron {
  transform: rotate(180deg);
}
.faq-answer {
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 0;
}
.faq-item.open > .faq-answer {
  max-height: 500px;
  padding: 0 0 14px;
}
.faq-answer p {
  font-size: 13px; line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.faq-answer p:last-child { margin-bottom: 0; }
.faq-answer ul {
  margin: 6px 0 0 18px;
  font-size: 13px; line-height: 1.65;
  color: var(--text-secondary);
}
.faq-answer ul li { margin-bottom: 4px; }

/* Technical details collapse inside FAQ */
.faq-tech-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 8px; padding: 5px 10px;
  border-radius: 6px; border: 1px solid var(--border);
  background: var(--card); color: var(--text-dim);
  font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
}
.faq-tech-toggle:hover {
  color: var(--text); border-color: var(--border-light); background: var(--elevated);
}
.faq-tech-toggle .faq-chevron {
  width: 14px; height: 14px;
}
.faq-tech-details {
  margin-top: 10px; padding: 12px 14px;
  background: var(--card); border-radius: 8px;
  border: 1px solid var(--border);
  transition: max-height 0.3s ease, padding 0.3s ease, margin 0.3s ease;
}
.faq-tech-details.hidden {
  max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: 0;
  border-color: transparent; overflow: hidden;
}
.faq-tech-details:not(.hidden) {
  max-height: 300px; padding: 12px 14px; margin-top: 10px;
  border-color: var(--border);
}
.faq-tech-details p {
  font-size: 12px; line-height: 1.6;
  color: var(--text-dim);
}

/* Rank modal */
.rank-modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; }
.rank-modal.hidden { display: none; }
.rank-modal-backdrop { position: absolute; inset: 0; background: rgba(6, 6, 10, 0.72); backdrop-filter: blur(4px); }
.rank-modal-panel {
  position: relative;
  z-index: 1;
  width: min(1600px, 94vw);
  max-height: 85vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.rank-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 10px;
  border-bottom: 1px solid var(--border);
}
.rank-modal-header h2 { font-size: 18px; }
.rank-modal-sub { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.rank-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.rank-modal-close:hover { color: var(--text); border-color: var(--border-light); background: var(--elevated); }
.rank-modal-controls {
  display: grid;
  grid-template-columns: var(--rank-controls-columns, 1.2fr 0.6fr 0.6fr 0.8fr);
  gap: 10px;
  padding: 12px 20px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
}
/* Raid History: inline controls in header */
.raid-modal-header-inline {
  flex-wrap: nowrap;
  gap: 12px;
}
.raid-modal-header-inline h2 {
  flex-shrink: 0;
  white-space: nowrap;
}
.raid-modal-inline-controls {
  display: flex;
  flex: 1;
  gap: 8px;
  min-width: 0;
}
.raid-modal-inline-controls .rank-input,
.raid-modal-inline-controls .rank-select {
  padding: 6px 10px;
  font-size: 12px;
}
.raid-modal-inline-controls .rank-input:first-child {
  flex: 1.5;
  min-width: 0;
}
.raid-modal-inline-controls .rank-input:nth-child(2) {
  flex: 0.7;
  min-width: 80px;
}
.raid-modal-inline-controls .rank-select {
  flex: 0.8;
  min-width: 90px;
}
.rank-input, .rank-select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
}
.rank-input::placeholder { color: var(--text-dim); }
#stream-modal .rank-modal-header,
#stream-modal .rank-modal-controls { display: none; }
.stream-modal-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.stream-modal-toolbar .rank-input { flex: 1; min-width: 120px; }
.stream-modal-toolbar .rank-select { width: auto; min-width: 130px; }
.stream-modal-channel-name { font-size: 16px; font-weight: 600; white-space: nowrap; margin: 0; }
.rank-modal-body { padding: 10px 20px 18px; overflow: auto; }
.rank-modal-list { display: grid; gap: 8px; }
.stream-modal-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  min-height: 400px;
  transition: grid-template-columns 0.25s ease;
}
.stream-modal-grid.list-collapsed {
  grid-template-columns: 0px 1fr;
}
.stream-modal-grid.list-collapsed .stream-modal-list {
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  padding: 0;
  width: 0;
  min-width: 0;
}
.stream-modal-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  max-height: 60vh;
  padding-right: 4px;
  transition: opacity 0.2s ease;
}
.stream-modal-list::-webkit-scrollbar { width: 4px; }
.stream-modal-list::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
.stream-modal-item {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  display: grid;
  gap: 2px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.stream-modal-item:hover { border-color: var(--border); background: var(--elevated); }
.stream-modal-item.active { border-color: var(--purple); background: var(--purple-dim); }
.stream-modal-title {
  font-weight: 600;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stream-modal-item.active .stream-modal-title { color: var(--purple); }
.stream-modal-subline { font-size: 11px; color: var(--text-dim); line-height: 1.2; }
.stream-modal-chart { border: 1px solid var(--border); border-radius: 12px; background: var(--card); display: flex; flex-direction: column; min-height: 360px; }
.stream-modal-chart-header { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.stream-modal-label { font-weight: 600; }
.stream-modal-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.stream-modal-meta { font-size: 12px; color: var(--text-secondary); }
.stream-modal-chart-body { padding: 10px 12px 14px; }
.stream-modal-legend { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text); }
.stream-modal-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.stream-modal-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--purple); display: inline-block; flex-shrink: 0; }
.stream-legend-section { width: 100%; }
.stream-legend-title { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.stream-legend-items { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.stream-legend-clickable { cursor: pointer; border-radius: 4px; padding: 1px 4px; transition: background 0.15s ease; }
.stream-legend-clickable:hover { background: var(--elevated); }
.stream-legend-title--expandable { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; padding: 2px 4px; border-radius: 4px; transition: background 0.15s ease; }
.stream-legend-title--expandable:hover { background: var(--elevated); }
.stream-follower-summary, .stream-legend-summary { font-weight: 400; color: var(--text-dim); font-size: 11px; }

/* Meta tags in stream modal header */
.stream-modal-meta-tags { display: contents; }
.meta-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text-dim);
  background: var(--elevated); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 8px;
  cursor: pointer; user-select: none; transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.meta-tag:hover { background: var(--hover); border-color: var(--text-dim); }
.meta-tag--static { cursor: default; }
.meta-tag--static:hover { background: var(--elevated); border-color: var(--border); }
.meta-tag--expanded { background: var(--hover); border-color: var(--text-secondary); }
.meta-tag--expanded .stream-legend-chevron { transform: rotate(180deg); }
.meta-tag-label { font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.3px; }
.meta-tag .stream-legend-chevron { font-size: 9px; margin-left: 2px; }
.stream-legend-chevron { font-size: 10px; color: var(--text-dim); transition: transform 0.2s ease; }
.stream-legend-title--expanded .stream-legend-chevron { transform: rotate(180deg); }
.stream-follower-details { margin-top: 4px; }
.stream-modal-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.stream-modal-header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.stream-modal-header-left > div { min-width: 0; }
.stream-modal-toggle-list {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--text-dim); display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; transition: all var(--transition); flex-shrink: 0;
}
.stream-modal-toggle-list:hover { color: var(--text); border-color: var(--border-light); background: var(--elevated); }
.rank-modal-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
}
.rank-modal-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--elevated);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-secondary);
}
.rank-modal-name { font-weight: 600; cursor: pointer; text-decoration: none; color: inherit; }
.rank-modal-meta { font-size: 12px; color: var(--text-secondary); text-align: right; }
.rank-modal-empty { padding: 20px; text-align: center; color: var(--text-dim); }
.activity-batch-block { display: grid; gap: 6px; }
.activity-batch-item { cursor: pointer; }
.activity-batch-item:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 1px;
}
.activity-batch-toggle-label { color: var(--purple); font-weight: 600; }
.activity-batch-details {
  margin: -2px 8px 2px 44px;
  padding: 8px 10px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: rgba(145, 71, 255, 0.07);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.activity-batch-recipient {
  font-size: 11px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--card);
}
.activity-batch-recipient:hover { color: var(--purple); border-color: var(--purple); }
.activity-batch-empty {
  font-size: 11px;
  color: var(--text-dim);
}

@media (max-width: 720px) {
  .rank-modal-controls { grid-template-columns: 1fr 1fr; }
  .rank-modal-panel { max-height: 90vh; }
  .stream-modal-grid { grid-template-columns: 1fr; }
  .activity-batch-details { margin-left: 0; }
}

/* ============================================
   RANK LIST
   ============================================ */
.rank-list { display: flex; flex-direction: column; gap: 6px; }

.rank-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px;
  transition: background var(--transition);
}
.rank-item:hover { background: var(--elevated); }

.rank-badge {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
  background: var(--elevated); color: var(--text-dim);
}
.rank-badge.gold { background: #fbbf2440; color: #fbbf24; }
.rank-badge.silver { background: #94a3b840; color: #94a3b8; }
.rank-badge.bronze { background: #d9764040; color: #d97640; }

.rank-name { flex: 1; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; color: inherit; }
.rank-name:hover { color: var(--purple); }
.rank-count { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.rank-viewers { font-size: 11px; color: var(--text-dim); margin-left: 4px; }

/* ============================================
   SUB RANK LIST
   ============================================ */
.sub-rank-list { display: flex; flex-direction: column; gap: 8px; }

.sub-rank-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(145,71,255,0.08), rgba(145,71,255,0.02));
  transition: border-color var(--transition), background var(--transition);
}
.sub-rank-item:hover {
  border-color: var(--border-light);
  background: linear-gradient(180deg, rgba(145,71,255,0.14), rgba(145,71,255,0.05));
}
.sub-rank-item.is-compact {
  padding: 8px 10px;
  grid-template-columns: 24px 1fr auto;
}
.sub-rank-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--elevated);
  color: var(--text-dim);
}
.sub-rank-badge.gold { background: #fbbf2440; color: #fbbf24; }
.sub-rank-badge.silver { background: #94a3b840; color: #94a3b8; }
.sub-rank-badge.bronze { background: #d9764040; color: #d97640; }
.sub-rank-name {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sub-rank-name:hover { color: var(--purple); }
.sub-rank-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}
.sub-rank-total {
  color: #fcd34d;
  font-weight: 700;
}
.sub-rank-events {
  color: var(--text-secondary);
}
.sub-rank-list--compact .sub-rank-item {
  padding: 8px 10px;
}

/* ============================================
   RECENT ACTIVITY FEED
   ============================================ */
.sub-activity-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sub-activity-item {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(145, 71, 255, 0.06), rgba(145, 71, 255, 0.02));
  transition: border-color var(--transition), background var(--transition);
}
.sub-activity-item:hover {
  border-color: var(--border-light);
  background: linear-gradient(180deg, rgba(145, 71, 255, 0.12), rgba(145, 71, 255, 0.04));
}
.sub-activity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  min-height: 20px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  min-width: 48px;
}
.badge-sub     { background: var(--green-dim); color: var(--green); }
.badge-resub   { background: var(--blue-dim); color: var(--blue); }
.badge-gift    { background: var(--purple-dim); color: var(--purple); }
.badge-mystery { background: var(--orange-dim); color: var(--orange); }
.badge-upgrade { background: rgba(236, 72, 153, 0.14); color: #ec4899; }
.badge-extend  { background: rgba(99, 102, 241, 0.14); color: #6366f1; }
.sub-activity-body {
  min-width: 0;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sub-activity-name {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.sub-activity-name:hover { color: var(--purple); }
.sub-activity-detail {
  color: var(--text-dim);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sub-activity-time {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}
/* Modal activity items: pill badge instead of numbered circle */
.sub-activity-modal-item .rank-modal-badge {
  min-width: 52px;
  width: auto;
  height: auto;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
@media (max-width: 900px) {
  .sub-activity-item {
    grid-template-columns: max-content minmax(0, 1fr);
  }
  .sub-activity-time {
    grid-column: 2;
    justify-self: start;
    margin-left: 0;
  }
}

/* ============================================
   BIGGEST SUB EVENT
   ============================================ */
.biggest-sub-event {
  text-align: center;
  padding: 14px 0;
}
.biggest-sub-event .big-sub-count {
  font-size: 44px;
  line-height: 1;
  font-weight: 700;
  color: #fcd34d;
}
.biggest-sub-event .big-sub-label {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.biggest-sub-event .big-sub-user {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text);
}
.biggest-sub-event .big-sub-type {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 12px;
}
.biggest-sub-event .big-sub-time {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 11px;
}
.big-sub-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 6px;
  font-size: 10px;
  line-height: 1.4;
  border: 1px solid rgba(250, 204, 21, 0.45);
  color: #fcd34d;
  background: rgba(250, 204, 21, 0.12);
}

/* ============================================
   BIGGEST RAID
   ============================================ */
.biggest-raid { text-align: center; padding: 12px 0; }
.biggest-raid .big-viewers { font-size: 42px; font-weight: 700; color: var(--purple); line-height: 1; }
.biggest-raid .big-label { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.biggest-raid .big-channels { margin-top: 12px; font-size: 13px; color: var(--text-secondary); }
.biggest-raid .big-channels strong { color: var(--text); }
.biggest-raid .big-time { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* ============================================
   TABLE
   ============================================ */
.table-wrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 10px 14px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.table th.stream-sort-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.table th.stream-sort-th:hover {
  color: var(--text);
}
.table th.stream-sort-th.is-active {
  color: var(--purple);
}
.stream-sort-indicator {
  display: inline-block;
  margin-left: 6px;
  min-width: 10px;
  color: inherit;
}
.table td {
  padding: 10px 14px; font-size: 13px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.table tbody tr:hover { background: var(--elevated); }
.table tbody tr.stream-row-clickable:hover { background: rgba(168,85,247,0.12); }
.table tbody tr.is-live { background: rgba(239, 68, 68, 0.08); }
.table tbody tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 4px; font-size: 11px; font-weight: 600;
}
.badge-incoming { background: var(--green-dim); color: var(--green); }
.badge-outgoing { background: var(--blue-dim); color: var(--blue); }
.badge-live { background: var(--red); color: #fff; animation: pulse-live 2s infinite; }
@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.channel-link { color: var(--text); font-weight: 500; cursor: pointer; text-decoration: none; }
.channel-link:hover { color: var(--purple); }

/* ============================================
   MINI LIST (Overview)
   ============================================ */
.mini-list { display: flex; flex-direction: column; gap: 2px; }

.mini-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: 6px;
  font-size: 13px; color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--transition);
}
.mini-item:hover { background: var(--elevated); }
.mini-item-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mini-item-left .badge { margin-right: 4px; }
.mini-item-right { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.mini-item .mini-name { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-item .mini-game { color: var(--text-dim); font-size: 12px; }
.mini-item .mini-viewers { font-weight: 600; color: var(--purple); }

/* Stream item in mini-list */
.stream-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; gap: 12px;
}
.stream-item-main { flex: 1; min-width: 0; }
.stream-item-header {
  display: flex; align-items: center; gap: 8px;
}
.stream-item-header .badge { flex-shrink: 0; }
.stream-item-game {
  font-weight: 500; color: var(--text); font-size: 13px;
  white-space: nowrap;
}
.stream-item-duration {
  color: var(--text-dim); font-size: 12px;
  white-space: nowrap;
}
.stream-item-duration::before { content: "|"; margin: 0 6px; }
.stream-item-stats {
  display: flex; flex-direction: column; align-items: flex-end;
  font-size: 12px; color: var(--text-dim); white-space: nowrap;
}
.stream-item-viewers { font-weight: 600; }
.stream-item-date { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.stream-item-title {
  font-size: 12px; color: var(--text-dim); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 300px;
}
.stream-item-followers { font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.stream-item-followers::before { content: "|"; margin: 0 6px; }
.stream-item.is-live { background: rgba(239, 68, 68, 0.08); }

/* ============================================
   LIVE SECTION
   ============================================ */
.live-hero {
  text-align: center; padding: 40px 20px; margin-bottom: 20px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.live-big-count { font-size: 72px; font-weight: 700; color: var(--text); line-height: 1; }
.live-label { font-size: 14px; color: var(--text-dim); margin-top: 8px; text-transform: uppercase; letter-spacing: 1px; }

.stream-info { display: flex; flex-direction: column; gap: 4px; }
.info-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-label { font-size: 12px; color: var(--text-dim); font-weight: 500; }
.info-value { font-size: 13px; color: var(--text); text-align: right; max-width: 60%; }

/* ============================================
   NETWORK SECTION
   ============================================ */
.network-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.network-toggle input {
  accent-color: var(--purple);
}
.network-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition);
}
.network-reset-btn:hover {
  border-color: var(--border-light);
  color: var(--text);
  background: var(--elevated);
}
.network-explore-btn {
  gap: 4px;
  border-color: var(--purple);
  background: var(--purple-dim);
  color: #d9c7ff;
}
.network-explore-btn:hover {
  background: rgba(145, 71, 255, 0.25);
  color: #f0e6ff;
  border-color: var(--purple);
}
.nf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nf-close-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: all var(--transition);
}
.nf-close-btn:hover {
  color: var(--text);
  background: var(--elevated);
}
.network-focus-card.is-collapsed .card-body {
  display: none;
}
.network-focus-card.is-collapsed .nf-close-btn svg {
  transform: rotate(45deg);
}
.network-grid.panel-collapsed {
  grid-template-columns: 1fr;
}
.network-grid.panel-collapsed .network-focus-card {
  display: none;
}
.nf-controls {
  margin-top: 8px;
  display: grid;
  gap: 10px;
}
.nf-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.nf-range-section {
  display: grid;
  gap: 6px;
}
.nf-range-label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.nf-range-selector {
  display: flex;
  gap: 4px;
}
.nf-range-btn {
  flex: 1;
  padding: 5px 0;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.nf-range-btn:hover {
  border-color: var(--border-light);
  color: var(--text);
}
.nf-range-btn.active {
  border-color: var(--purple);
  background: var(--purple-dim);
  color: #d9c7ff;
}
.network-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}
.network-card,
.network-focus-card,
.network-mobile-card {
  margin-bottom: 0;
}
.network-card {
  display: flex;
  flex-direction: column;
}
.network-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.network-card .network-graph {
  flex: 1;
}
.network-graph {
  width: 100%;
  min-height: 520px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  overflow: hidden;
}
.network-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.network-header-actions .card-sub {
  margin-right: 0;
}
.network-search {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: all var(--transition);
  width: 160px;
}
.network-search:focus-within {
  border-color: var(--purple);
  background: var(--surface);
  width: 200px;
}
.network-search-icon {
  flex-shrink: 0;
  color: var(--text-dim);
  opacity: 0.6;
}
.network-search:focus-within .network-search-icon {
  color: var(--purple);
  opacity: 1;
}
.network-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-family: var(--font);
  outline: none;
}
.network-search-input::placeholder {
  color: var(--text-dim);
  opacity: 0.6;
}
/* Autocomplete dropdown */
.network-search {
  position: relative;
}
.network-search-ac {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 220;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: var(--card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  max-height: 300px;
  overflow-y: auto;
}
.network-search-ac.is-open {
  display: block;
}
.network-search-ac-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition);
}
.network-search-ac-item:hover,
.network-search-ac-item.is-active {
  background: var(--elevated);
  color: var(--text);
}
.network-search-ac-item mark {
  background: transparent;
  color: var(--purple);
  font-weight: 700;
}
.network-search-ac-live {
  margin-left: auto;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--green);
  color: #000;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.network-open-details-btn {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
.network-open-details-btn:hover {
  border-color: var(--border-light);
  background: var(--elevated);
}
#network-grid.is-maximized .network-open-details-btn {
  border-color: rgba(145, 71, 255, 0.4);
  background: rgba(145, 71, 255, 0.12);
  color: #d9c7ff;
}
#network-grid.is-maximized .network-open-details-btn:hover {
  border-color: var(--purple);
  background: rgba(145, 71, 255, 0.2);
  color: #f0e6ff;
}
.network-fullscreen-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}
.network-fullscreen-btn:hover {
  border-color: var(--border-light);
  color: var(--text);
  background: var(--elevated);
}
.network-fullscreen-btn svg {
  width: 16px;
  height: 16px;
}
.network-fullscreen-btn .icon-compress {
  display: none;
}
.network-fullscreen-btn.is-active .icon-expand {
  display: none;
}
.network-fullscreen-btn.is-active .icon-compress {
  display: block;
}
body.network-maximized {
  overflow: hidden;
}
#network-grid.is-maximized {
  position: fixed;
  inset: 10px;
  z-index: 180;
  margin: 0;
  grid-template-columns: 1fr;
  align-items: stretch;
}
#network-grid.is-maximized .network-card {
  height: 100%;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}
#network-grid.is-maximized .network-mobile-card {
  display: none;
}
#network-grid.is-maximized .network-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#network-grid.is-maximized .network-graph {
  flex: 1;
  min-height: 0;
  height: 100%;
}

/* Compact header in fullscreen */
#network-grid.is-maximized .network-card > .card-header {
  padding: 8px 14px;
}
#network-grid.is-maximized .network-card > .card-header h3 {
  font-size: 13px;
}
/* --- Fullscreen: floating overlay Node Details panel --- */
#network-grid.is-maximized .network-focus-card {
  position: absolute;
  top: 42px;
  right: 16px;
  bottom: 16px;
  width: 340px;
  margin: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid rgba(145, 71, 255, 0.2);
  background: rgba(24, 24, 27, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translateX(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
}
#network-grid.is-maximized .network-focus-card .card-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
#network-grid.is-maximized .network-focus-card .card-header h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  font-weight: 600;
}
#network-grid.is-maximized .network-focus-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 16px 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(145, 71, 255, 0.3) transparent;
}
#network-grid.is-maximized .network-focus-card .card-body::-webkit-scrollbar {
  width: 4px;
}
#network-grid.is-maximized .network-focus-card .card-body::-webkit-scrollbar-track {
  background: transparent;
}
#network-grid.is-maximized .network-focus-card .card-body::-webkit-scrollbar-thumb {
  background: rgba(145, 71, 255, 0.3);
  border-radius: 4px;
}
/* Larger avatar in fullscreen */
#network-grid.is-maximized .nf-avatar {
  width: 52px;
  height: 52px;
  border-width: 2.5px;
  border-color: var(--purple);
  box-shadow: 0 0 12px rgba(145, 71, 255, 0.25);
}
#network-grid.is-maximized .network-focus-name {
  font-size: 20px;
  gap: 14px;
}
/* Stats with subtle background cards */
#network-grid.is-maximized .network-focus-stats {
  gap: 6px;
  font-size: 14px;
}
#network-grid.is-maximized .network-focus-stats > div {
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
/* Connections list */
#network-grid.is-maximized .network-focus-connections {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(145, 71, 255, 0.2) transparent;
}
#network-grid.is-maximized .network-link-row {
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
}
#network-grid.is-maximized .network-link-row:hover {
  border-color: rgba(145, 71, 255, 0.3);
  background: rgba(145, 71, 255, 0.08);
}
/* Open/Twitch buttons */
#network-grid.is-maximized .nf-open-links {
  margin-top: 8px;
}
#network-grid.is-maximized .network-open-btn {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}
#network-grid.is-maximized .network-twitch-btn {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
}
/* Controls pinned at bottom */
#network-grid.is-maximized .nf-controls {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
#network-grid.is-maximized .nf-divider {
  display: none;
}
#network-grid.is-maximized .nf-range-btn {
  padding: 6px 0;
  border-radius: 8px;
  font-size: 12px;
  border-color: rgba(255, 255, 255, 0.08);
}
#network-grid.is-maximized .nf-range-btn:hover {
  border-color: rgba(145, 71, 255, 0.3);
}
#network-grid.is-maximized .network-header-actions .network-reset-btn {
  border-color: rgba(145, 71, 255, 0.3);
  background: rgba(145, 71, 255, 0.08);
  color: #d9c7ff;
}
#network-grid.is-maximized .network-header-actions .network-reset-btn:hover {
  border-color: var(--purple);
  background: rgba(145, 71, 255, 0.16);
  color: #f0e6ff;
}
#network-grid.is-maximized .nf-controls .network-reset-btn {
  width: 100%;
  border-radius: 10px;
  padding: 8px 0;
  font-size: 12px;
}
/* Live badge in fullscreen */
#network-grid.is-maximized .nf-live-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
}
/* Slide-out when panel collapsed in fullscreen - override display:none from normal mode */
#network-grid.is-maximized.panel-collapsed .network-focus-card {
  display: flex;
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  pointer-events: none;
}
#network-grid.is-maximized .network-focus-card.is-collapsed .card-body {
  display: flex;
}
.network-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.network-node {
  cursor: pointer;
  transition: opacity var(--transition);
}
.network-node.is-dimmed {
  opacity: 0.15;
}
.network-node.is-selected {
  opacity: 1;
}
.network-node.is-search-dim {
  opacity: 0.1;
}
.network-node.is-search-match {
  opacity: 1;
}
.network-edge.is-search-dim {
  opacity: 0.05;
}
.network-node-circle {
  fill: var(--elevated);
  stroke-width: 2.5;
}
.network-node-circle.is-center {
  stroke: var(--purple);
  stroke-width: 3;
  fill: rgba(145, 71, 255, 0.15);
}
.network-node-circle.is-tracked {
  stroke: #5bbcff;
}
.network-node-circle.is-external {
  stroke: var(--border-light);
  stroke-dasharray: 3 2;
}
.network-node-live-ring {
  fill: none;
  stroke: var(--green);
  stroke-width: 2.5;
  opacity: 0.9;
}
@keyframes network-pulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.4; }
}
.network-node-live-ring {
  animation: network-pulse 2s ease-in-out infinite;
}
.network-node-initial {
  fill: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}
.network-node-label {
  fill: var(--text);
  font-size: 11px;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.network-node-label.is-visible {
  opacity: 1;
}
.network-edge {
  stroke: rgba(173, 173, 184, 0.35);
  transition: opacity var(--transition), stroke var(--transition);
}
.network-edge.is-dimmed {
  opacity: 0.08;
}
.network-edge.is-selected {
  opacity: 1;
  stroke: rgba(145, 71, 255, 0.85);
}
.network-empty {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 13px;
}
.network-focus-empty {
  color: var(--text-dim);
  font-size: 13px;
}
.network-focus-content {
  display: grid;
  gap: 10px;
}
.network-focus-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
}
.nf-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  object-fit: cover;
  flex-shrink: 0;
}
.nf-name-text {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nf-name-label {
  display: inline-block;
}
.nf-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  animation: network-pulse 2s ease-in-out infinite;
}
.nf-live-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--green);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.nf-live-inline {
  margin-left: 2px;
}
.network-focus-meta {
  font-size: 12px;
  color: var(--text-dim);
}
.network-focus-stats {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}
.nf-io-sep {
  color: var(--text-dim);
}
.nf-stats-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.nf-stats-row .network-focus-stats {
  flex: 1;
  min-width: 0;
}
.nf-viewers-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 1px;
}
.nf-viewers-toggle:hover {
  border-color: var(--border-light);
  background: var(--elevated);
}
.nf-viewers-toggle:has(input:checked) {
  border-color: var(--orange);
  background: var(--orange-dim);
}
.nf-viewers-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.nf-viewers-icon {
  width: 14px;
  height: 14px;
  color: var(--text-dim);
  transition: color var(--transition);
}
.nf-viewers-toggle:has(input:checked) .nf-viewers-icon {
  color: var(--orange);
}
.nf-link-counts {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nf-link-viewers {
  font-size: 11px;
  color: var(--orange);
  opacity: 0.8;
}
.nf-link-viewers-icon {
  font-size: 10px;
}
.nf-subtle {
  font-size: 11px;
  color: var(--text-dim);
}
.network-focus-connections {
  display: grid;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}
.network-focus-connections::-webkit-scrollbar {
  width: 4px;
}
.network-focus-connections::-webkit-scrollbar-track {
  background: transparent;
}
.network-focus-connections::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}
.network-link-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text-secondary);
  font-size: 12px;
  transition: all var(--transition);
}
.network-link-row:hover {
  color: var(--text);
  border-color: var(--border-light);
  background: var(--elevated);
}
.nf-open-links {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.network-open-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--purple);
  background: var(--purple-dim);
  color: #d9c7ff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
}
.network-open-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.network-open-btn:not(:disabled):hover {
  background: rgba(145, 71, 255, 0.25);
  color: #f0e6ff;
}
.network-twitch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--elevated);
  color: #bf94ff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
}
.network-twitch-btn:hover {
  background: rgba(145, 71, 255, 0.15);
  color: #d9c7ff;
}
.network-twitch-btn svg {
  flex-shrink: 0;
}
.network-mobile-card {
  display: none;
  margin-top: 16px;
}
.network-mobile-list {
  display: grid;
  gap: 8px;
}
.network-mobile-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-secondary);
  font-size: 12px;
  transition: all var(--transition);
}
.network-mobile-row:hover {
  border-color: var(--border-light);
  color: var(--text);
  background: var(--elevated);
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
  background: var(--bg);
}

.login-card {
  width: 100%; max-width: 380px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px 32px;
}
.login-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.brand-text { font-size: 20px; font-weight: 600; }
.brand-text strong { color: var(--text); }
.brand-text .brand-swarm { color: var(--orange); font-weight: 700; }
.login-sub { color: var(--text-dim); font-size: 13px; margin-bottom: 24px; }

.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-size: 14px; outline: none;
  transition: border-color var(--transition);
}
.form-input:focus { border-color: var(--purple); }
.form-input::placeholder { color: var(--text-dim); }

.form-btn {
  width: 100%; padding: 10px; margin-top: 16px;
  background: var(--purple); border: none; border-radius: var(--radius);
  color: #fff; font-size: 14px; font-weight: 600;
  transition: background var(--transition);
}
.form-btn:hover { background: var(--purple-hover); }

.login-error {
  margin-top: 16px; padding: 10px 14px; border-radius: var(--radius);
  background: var(--red-dim); color: var(--red);
  font-size: 13px; font-weight: 500;
}

/* ============================================
   MOBILE OVERLAY
   ============================================ */
.mobile-overlay {
  display: none; position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(2px);
}
.mobile-overlay.active { display: block; }

/* ============================================
   UTILITY
   ============================================ */
.hidden { display: none !important; }
.text-purple { color: var(--purple); }
.text-green { color: var(--green); }
.text-blue { color: var(--blue); }
.text-red { color: var(--red); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
  .grid-3col { grid-template-columns: 1fr 1fr; }
  .grid-3col > :last-child { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .topbar-center { display: none; }
  .hero { height: auto; min-height: 140px; }
  .hero-content { padding: 20px; flex-wrap: wrap; }
  .hero-avatar { width: 64px; height: 64px; }
  .hero-name { font-size: 20px; }

  .main-layout { display: block; }

  .content { padding: 16px; }
  .home-section-header,
  .stream-section-header,
  .raid-section-header,
  .subs-section-header { flex-wrap: wrap; }
  .hl-range-selector {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
  .stream-range-selector {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
  .raid-range-selector {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
  .subs-range-selector {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
  .raid-table-controls {
    grid-template-columns: 1fr 1fr;
  }
  .raid-table-controls .raid-table-search {
    grid-column: 1 / -1;
  }
  .network-grid {
    grid-template-columns: 1fr;
  }
  .network-focus-card {
    display: none;
  }
  .network-open-details-btn {
    display: none !important;
  }
  .network-graph {
    min-height: 260px;
  }
  .network-mobile-card {
    display: block;
  }
  .grid-2col { grid-template-columns: 1fr; }
  .grid-3col { grid-template-columns: 1fr; }
  .grid-3col > :last-child { grid-column: auto; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .untracked-info {
    margin-top: 16px;
    padding: 0 16px 24px;
  }
  .untracked-controls {
    justify-content: flex-start;
  }
  .untracked-panel .rl-row {
    flex-wrap: wrap;
    gap: 6px 10px;
  }
  .untracked-panel .rl-viewers,
  .untracked-panel .rl-time {
    text-align: left;
    min-width: 0;
  }
  .untracked-batch-row {
    grid-template-columns: auto 1fr;
    row-gap: 6px;
  }
  .untracked-batch-row .rl-viewers,
  .untracked-batch-row .rl-time {
    grid-column: 2 / 3;
    text-align: left;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .hero-content { gap: 12px; }
  .live-big-count { font-size: 48px; }
  .biggest-sub-event .big-sub-count { font-size: 36px; }
  .sub-rank-item {
    grid-template-columns: 24px 1fr;
    row-gap: 6px;
  }
  .sub-rank-meta {
    grid-column: 2 / 3;
    justify-self: start;
  }
  .raid-table-controls {
    grid-template-columns: 1fr;
  }
  .raid-table-controls .raid-table-search {
    grid-column: auto;
  }
  .untracked-range-selector {
    width: 100%;
    justify-content: space-between;
  }
  .untracked-range-btn {
    flex: 1;
    text-align: center;
  }
}

/* ============================================
   APEXCHARTS OVERRIDES
   ============================================ */
.apexcharts-tooltip {
  background: #1f1f27 !important;
  border: 1px solid rgba(168, 85, 247, 0.45) !important;
  border-radius: var(--radius) !important;
  color: var(--text) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}
.apexcharts-tooltip-title {
  background: #1a1a22 !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  color: var(--text-muted) !important;
}
.apexcharts-xaxistooltip, .apexcharts-yaxistooltip {
  background: #1f1f27 !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  color: var(--text) !important;
}
.apexcharts-legend-text { color: var(--text-muted) !important; }
.apexcharts-gridline { stroke: rgba(255,255,255,0.05) !important; }
.apexcharts-text { fill: var(--text-muted) !important; }
.apexcharts-xaxis-annotations .apexcharts-text { fill: #fff !important; }

/* Secondary channel depth badges */
.sp-depth-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 5px;
  font-weight: 600;
  vertical-align: middle;
  letter-spacing: 0.5px;
}
.sp-depth-badge.depth-1 {
  background: rgba(145, 71, 255, 0.25);
  color: #bf9aff;
}
.sp-depth-badge.depth-2 {
  background: rgba(0, 180, 216, 0.25);
  color: #66d9ef;
}
.sp-depth-badge.depth-3 {
  background: rgba(245, 158, 11, 0.25);
  color: #f59e0b;
}

/* Hero discovery chain breadcrumb */
.hero-discovery-chain {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
  margin-bottom: 2px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.hero-discovery-chain a {
  color: #9147ff;
  text-decoration: none;
  cursor: pointer;
}
.hero-discovery-chain a:hover {
  text-decoration: underline;
  color: #bf9aff;
}

/* ============================================
   UNTRACKED CHANNEL INFO
   ============================================ */
.hero-untracked-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.hero-untracked-tabs.hidden {
  display: none;
}
.hero-untracked-badge-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(145, 71, 255, 0.12);
  border: 1px solid rgba(145, 71, 255, 0.3);
  color: #bf9aff;
  font-size: 11px;
  font-weight: 500;
}
.hero-untracked-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(145, 71, 255, 0.12);
  border: 1px solid rgba(145, 71, 255, 0.3);
  color: #bf9aff;
  font-size: 13px;
  font-weight: 500;
  margin-top: 10px;
}
.hero-untracked-badge svg {
  opacity: 0.8;
  flex-shrink: 0;
}
.hero-untracked-badge.hidden {
  display: none;
}
.hero-untracked-sub {
  color: var(--text-dim);
  font-weight: 400;
}
.untracked-info {
  max-width: 1600px;
  margin: 24px auto 0;
  padding: 0 24px 32px;
}
.untracked-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.untracked-range-selector {
  display: inline-flex;
  gap: 4px;
  background: var(--surface);
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.untracked-range-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition);
}
.untracked-range-btn:hover {
  color: var(--text);
}
.untracked-range-btn.active {
  background: rgba(145, 71, 255, 0.25);
  color: #efe4ff;
}
.untracked-content {
  display: grid;
  gap: 16px;
}
.untracked-grid {
  margin-bottom: 0;
}
.untracked-stats-grid {
  margin-bottom: 0;
}
.untracked-panel {
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.untracked-raids-header {
  font-weight: 600;
  font-size: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.untracked-raids-meta {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.untracked-panel .rl-row {
  padding: 8px 16px;
}
.untracked-empty {
  padding: 14px 16px;
  color: var(--text-dim);
  font-size: 12px;
}
.untracked-target-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  padding: 3px 10px;
  white-space: nowrap;
}
.untracked-batch {
  border-top: 1px solid var(--border);
}
.untracked-batch:first-of-type {
  border-top: none;
}
.untracked-batch-row {
  width: 100%;
  background: transparent;
  border: none;
  color: inherit;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 8px 16px;
}
button.untracked-batch-row {
  cursor: pointer;
}
div.untracked-batch-row {
  cursor: default;
}
.untracked-batch-row:hover {
  background: rgba(255, 255, 255, 0.02);
}
.untracked-batch-details {
  padding: 8px 16px 14px;
  border-top: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.01);
}
.untracked-batch-details.hidden {
  display: none;
}
.untracked-recipient-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.untracked-recipient {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--text-secondary);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.02);
}
.untracked-recipient:hover {
  color: var(--purple);
  border-color: rgba(145, 71, 255, 0.5);
}
.hero-tabs.hidden {
  display: none;
}

/* Mini-chart range slider */
.range-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 0;
  min-width: 0;
  padding: 0 4px;
  user-select: none;
  overflow: visible;
}
.rs-track-area {
  position: relative;
  flex: 1;
  height: 26px;
  border-radius: 5px;
  background: var(--elevated);
  border: 1px solid var(--border);
}
.rs-mini-bars, .rs-overlay-left, .rs-overlay-right {
  border-radius: 5px;
}
.rs-mini-bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 3px 0;
  gap: 1px;
}
.rs-mini-bar {
  flex: 1;
  min-width: 0;
  background: var(--border);
  border-radius: 1px 1px 0 0;
  transition: background 0.1s;
}
.rs-mini-bar.in-range {
  background: var(--purple);
  opacity: 0.7;
}
.rs-overlay-left,
.rs-overlay-right {
  position: absolute;
  top: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 1;
}
.rs-overlay-left { left: 0; }
.rs-overlay-right { right: 0; }
.rs-handle {
  position: absolute;
  top: 0; bottom: 0;
  width: 10px;
  background: transparent;
  cursor: col-resize;
  z-index: 3;
}
.rs-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 12px;
  background: rgba(255,255,255,0.2);
  border-radius: 1px;
  transition: background 0.15s, height 0.15s;
}
.rs-handle:hover::after, .rs-handle.active::after {
  background: var(--purple);
  height: 100%;
}
.rs-selection {
  position: absolute;
  top: 0; bottom: 0;
  border-top: 2px solid var(--purple);
  border-bottom: 2px solid var(--purple);
  z-index: 2;
  cursor: grab;
}
.rs-label {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 32px;
}

