/* ===========================================
   CSS Variables - Dark Mode + Pastel Purple
   =========================================== */
:root {
  /* Brand colors - pastel purples */
  --purple-50: #faf5ff;
  --purple-100: #f3e8ff;
  --purple-200: #e9d5ff;
  --purple-300: #d8b4fe;
  --purple-400: #c084fc;
  --purple-500: #a855f7;
  --purple-600: #9333ea;
  --purple-700: #7c22ce;
  
  /* Status colors - for dark mode */
  --status-healthy-bg: rgba(74, 222, 128, 0.15);
  --status-healthy-text: #4ade80;
  --status-growing-pains-bg: rgba(250, 204, 21, 0.15);
  --status-growing-pains-text: #facc15;
  --status-drift-bg: rgba(96, 165, 250, 0.15);
  --status-drift-text: #60a5fa;
  --status-declining-bg: rgba(248, 113, 113, 0.15);
  --status-declining-text: #f87171;
  
  /* Arrows */
  --arrow-up: #4ade80;
  --arrow-down: #f87171;
  
  /* Dark mode colors */
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-card: #242424;
  --bg-card-hover: #2a2a2a;
  --bg-card-selected: #2d2438;
  --border-subtle: #333333;
  --border-selected: #9333ea;
  --text-primary: #f5f5f5;
  --text-secondary: #a3a3a3;
  --text-muted: #737373;
  
  /* Layout */
  --header-height: 60px;
  --tab-height: 48px;
  --box-a-width: 320px;
  --sidebox-width: 320px;
  --box-b-width: 280px;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  
  /* Shadows - for dark mode */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-selected: 0 0 0 2px var(--purple-500), 0 4px 12px rgba(147, 51, 234, 0.3);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
}

/* ===========================================
   Reset & Base
   =========================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

/* ===========================================
   Header
   =========================================== */
.header {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 var(--spacing-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.logo {
  font-size: 1.5rem;
}

.header-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--purple-400);
}

.niche-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding-left: var(--spacing-md);
  border-left: 1px solid var(--border-subtle);
}

.header-stats {
  display: flex;
  gap: var(--spacing-lg);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.header-stats .stat-value {
  font-weight: 600;
  color: var(--text-primary);
}

/* ===========================================
   Tab Navigation
   =========================================== */
.tab-nav {
  height: var(--tab-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 var(--spacing-lg);
  display: flex;
  gap: var(--spacing-lg);
}

.tab-btn {
  background: none;
  border: none;
  padding: var(--spacing-md) 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--purple-400);
  border-bottom-color: var(--purple-500);
}

.tab-btn {
  position: relative;
}

.lab-badge-count {
  display: none;
  position: absolute;
  top: 4px;
  right: -12px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--purple-500);
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: 9px;
  line-height: 18px;
  text-align: center;
}

.lab-badge-count.visible {
  display: inline-block;
}

/* ===========================================
   Main Content
   =========================================== */
.main-content {
  padding: var(--spacing-lg);
}

.tab-content {
  display: block;
}

.tab-content.hidden {
  display: none;
}

/* ===========================================
   Summary Box
   =========================================== */
.summary-box {
  background: var(--bg-card);
  border-radius: 12px;
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
}

/* ===========================================
   Three Column Layout
   =========================================== */
.three-column-layout {
  display: flex;
  gap: var(--spacing-lg);
  position: relative;
}

/* Box A Container - holds cards + sidebox */
.box-a-container {
  display: flex;
  gap: 0;
  flex-shrink: 0;
  position: relative;
  height: 620px;
}

.box-a {
  width: var(--box-a-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  transition: width var(--transition-normal);
}

.box-a.collapsed {
  width: 180px;
}

.box-a.collapsed .creator-card {
  padding: var(--spacing-xs) var(--spacing-sm);
}

.box-a.collapsed .card-header {
  margin-bottom: var(--spacing-xs);
  padding-bottom: var(--spacing-xs);
}

.box-a.collapsed .sort-container {
  display: none;
}

.box-a.collapsed .yt-stats-section {
  display: none;
}

.box-a.collapsed .card-body {
  display: block;
}

.box-a.collapsed .munchkin-section {
  border-left: none;
  padding-left: 0;
}

.box-a.collapsed .section-label {
  display: none;
}

.box-a.collapsed .creator-name {
  max-width: 50px;
}

/* Status badge - show abbreviation when collapsed */
.status-abbrev {
  display: none;
}

.box-a.collapsed .status-full {
  display: none;
}

.box-a.collapsed .status-abbrev {
  display: inline;
}

.box-a.collapsed .status-badge {
  font-size: 0.6rem;
  padding: 2px 6px;
}

/* Metrics inline when collapsed */
.box-a.collapsed .metrics-row {
  flex-direction: row;
  justify-content: flex-end;
  gap: var(--spacing-sm);
}

.box-a.collapsed .metric-item {
  flex-direction: row;
  align-items: center;
  gap: 2px;
}

.box-a.collapsed .metric-label {
  font-size: 0.6rem;
  order: -1;
}

.box-a.collapsed .metric-label .label-full {
  display: none;
}

.box-a.collapsed .metric-label .label-abbrev {
  display: inline;
}

.metric-label .label-abbrev {
  display: none;
}

.box-a.collapsed .metric-value {
  font-size: 0.65rem;
}

/* Sidebox - positioned to the right of Box A */
.sidebox {
  position: absolute;
  width: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg-card);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
  border-left: 2px solid var(--purple-500);
  transition: width var(--transition-normal), padding var(--transition-normal), opacity var(--transition-normal);
  opacity: 0;
  z-index: 20;
  overflow-y: auto;
  top: 0;
}

.sidebox.open {
  width: var(--sidebox-width);
  padding: var(--spacing-lg);
  opacity: 1;
}

/* Custom scrollbar for sidebox */
.sidebox::-webkit-scrollbar {
  width: 6px;
}

.sidebox::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 3px;
}

.sidebox::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 3px;
}

.sidebox::-webkit-scrollbar-thumb:hover {
  background: var(--purple-500);
}

.main-box {
  flex: 1;
  background: var(--bg-card);
  border-radius: 12px;
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  height: 620px;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.main-box.shifted {
  opacity: 0.3;
}

/* Main Box Loading State */
.main-box-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 8px;
}

.lottie-container {
  width: 150px;
  height: 150px;
}

.loading-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ===========================================
   Main Box Internal Styles
   =========================================== */
.main-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  flex-shrink: 0;
}

.main-box-tabs {
  display: flex;
  gap: var(--spacing-md);
}

.main-box-tab {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.main-box-tab:hover {
  color: var(--text-secondary);
}

.main-box-tab.active {
  color: var(--text-primary);
}

.main-box-footer {
  display: flex;
  justify-content: center;
  gap: var(--spacing-lg);
  align-items: center;
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--spacing-md);
  flex-shrink: 0;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Filter Toggle Switch (All | Creator) */
.filter-toggle {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border-radius: 6px;
  padding: 3px;
  border: 1px solid var(--border-subtle);
  width: 200px;
}

.filter-toggle-option {
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex: 1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-toggle-option:hover:not(.disabled) {
  color: var(--text-secondary);
}

.filter-toggle-option.active {
  background: var(--purple-600);
  color: white;
  font-weight: 500;
}

.filter-toggle-option.disabled {
  cursor: default;
  opacity: 0.4;
}

/* ===========================================
   Creator Spectrum
   =========================================== */
.summary-header {
  margin-bottom: var(--spacing-md);
}

.niche-status-block {
  margin-top: 4px;
  margin-bottom: var(--spacing-md);
}

.niche-status-line {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.niche-status-line .status-badge {
  margin-left: 4px;
}

.niche-status-line .niche-metric {
  margin-left: 8px;
}

.niche-metrics-line {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-top: 4px;
}

.creator-type-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: var(--spacing-sm);
}

.niche-metric {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
}

.niche-metric.up {
  color: var(--arrow-up);
}

.niche-metric.down {
  color: var(--arrow-down);
}

.niche-metric .arrow {
  font-size: 0.7rem;
}

.spectrum-wrapper {
  width: 100%;
}

.spectrum-container {
  position: relative;
  padding: 24px 0 16px;
  width: 100%;
}

.spectrum-bar {
  height: 6px;
  background: linear-gradient(to right, var(--purple-700), var(--purple-500), var(--purple-300));
  border-radius: 3px;
}

.spectrum-bubbles {
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  height: 30px;
}

.spectrum-bubble {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.6rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transform: translateX(-50%);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  border: 3px solid var(--purple-500);
}

.spectrum-bubble:hover {
  transform: translateX(-50%) scale(1.15);
  z-index: 10;
}

.spectrum-bubble.active {
  transform: translateX(-50%) scale(1.2);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.6);
  z-index: 10;
}

.spectrum-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.spectrum-selection {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: var(--spacing-md);
  font-size: 0.8rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.spectrum-selection.visible {
  opacity: 1;
  visibility: visible;
}

.selection-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.selection-name {
  color: var(--text-primary);
  font-weight: 600;
}

.selection-divider {
  color: var(--purple-500);
  font-weight: 700;
}

.selection-subs {
  color: var(--text-secondary);
}

.selection-label {
  color: var(--text-secondary);
}

.selection-status {
  color: var(--text-secondary);
}

.selection-status .status-badge {
  margin-left: 4px;
}

.activation-value {
  color: var(--purple-400);
  font-weight: 600;
}

.main-box-content {
  flex: 1;
  min-height: 0;
}

/* Quadrant Plot */
.quadrant-plot {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.plot-container {
  flex: 1;
  position: relative;
  background: var(--bg-secondary);
  border-radius: 8px;
  overflow: hidden;
}

.plot-axis-label {
  position: absolute;
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.plot-x-label {
  right: 12px;
  top: 50%;
  transform: translateY(calc(-50% - 12px));
  color: white;
  font-weight: 600;
}

.plot-y-label {
  left: 50%;
  top: 12px;
  transform: translateX(calc(-100% - 8px)) rotate(180deg);
  color: white;
  font-weight: 600;
  writing-mode: vertical-rl;
}

.plot-quadrant-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.quadrant-label {
  position: absolute;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.6;
}

.q-tl { top: 12px; left: 12px; }
.q-tr { top: 12px; right: 12px; }
.q-bl { bottom: 12px; left: 12px; }
.q-br { bottom: 12px; right: 12px; }

.plot-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.plot-axis-x {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-subtle);
}

.plot-axis-y {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-subtle);
}

.plot-points {
  position: absolute;
  inset: 20px;
}

.plot-point-wrapper {
  position: absolute;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plot-point {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  opacity: 0.8;
}

.plot-point-wrapper:hover .plot-point {
  transform: scale(1.5);
  box-shadow: 0 0 8px currentColor;
  opacity: 1;
}

.plot-point-wrapper:hover {
  z-index: 10;
}

.plot-legend {
  display: flex;
  justify-content: center;
  gap: var(--spacing-lg);
  padding-top: var(--spacing-md);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
}

.empty-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.empty-subtext {
  font-size: 0.875rem;
  margin-top: var(--spacing-xs);
}

.box-b {
  width: var(--box-b-width);
  flex-shrink: 0;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  height: 620px;
  overflow-y: auto;
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.box-b.covered {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-20px);
}

/* ===========================================
   Creator Cards (Box A)
   =========================================== */
.creator-cards-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-xs);
}

.creator-cards-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sort-container {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sort-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sort-select {
  font-size: 0.75rem;
  padding: 4px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
}

.sort-select:focus {
  outline: none;
  border-color: var(--purple-500);
}

.creator-cards-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  max-height: 580px;
  overflow-y: auto;
}

/* Custom scrollbar for cards list */
.creator-cards-list::-webkit-scrollbar {
  width: 6px;
}

.creator-cards-list::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 3px;
}

.creator-cards-list::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 3px;
}

.creator-cards-list::-webkit-scrollbar-thumb:hover {
  background: var(--purple-500);
}

/* Individual Creator Card - Compact Horizontal Layout */
.creator-card {
  background: var(--bg-card);
  border-radius: 10px;
  padding: var(--spacing-sm) var(--spacing-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid var(--border-subtle);
}

.creator-card:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md);
}

.creator-card.selected {
  background: var(--bg-card-selected);
  box-shadow: var(--shadow-selected);
  border-color: var(--purple-500);
}

.creator-card.dimmed {
  opacity: 0.4;
}

/* Card Header */
.card-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--border-subtle);
}

.creator-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--purple-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  color: white;
  flex-shrink: 0;
}

.creator-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.creator-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.card-header .status-badge {
  margin-left: auto;
}

/* Card Body - Horizontal Split */
.card-body {
  display: flex;
  gap: var(--spacing-md);
}

/* YouTube Stats Section (Left) */
.yt-stats-section {
  flex: 1;
  padding-right: var(--spacing-md);
  border-right: 1px solid var(--border-subtle);
}

.section-label {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.yt-stats-row {
  display: flex;
  gap: var(--spacing-md);
}

.yt-stat {
  display: flex;
  flex-direction: column;
}

.yt-stat .value {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.yt-stat .label {
  font-size: 0.625rem;
  color: var(--text-muted);
}

/* Munchkin Metrics Section (Right) */
.munchkin-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.status-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
}

.status-badge.healthy {
  background: var(--status-healthy-bg);
  color: var(--status-healthy-text);
}

.status-badge.growing-pains {
  background: var(--status-growing-pains-bg);
  color: var(--status-growing-pains-text);
}

.status-badge.drift {
  background: var(--status-drift-bg);
  color: var(--status-drift-text);
}

.status-badge.declining {
  background: var(--status-declining-bg);
  color: var(--status-declining-text);
}

.metrics-row {
  display: flex;
  gap: var(--spacing-md);
}

.metric-item {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
}

.metric-value {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.75rem;
  font-weight: 600;
}

.metric-value.up {
  color: var(--arrow-up);
}

.metric-value.down {
  color: var(--arrow-down);
}

.metric-value .arrow {
  font-size: 0.625rem;
}

.metric-label {
  font-size: 0.5rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ===========================================
   Sidebox Content (Munchkin's Insight)
   =========================================== */
.sidebox-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--border-subtle);
}

.sidebox-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--purple-400);
}

.sidebox-content {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.sidebox-content p {
  margin-bottom: var(--spacing-sm);
}

.sidebox-content strong {
  color: var(--text-primary);
}

.sidebox-section {
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-subtle);
}

.sidebox-section-title {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--spacing-sm);
}

.sidebox-insight {
  margin-bottom: var(--spacing-sm);
}

.sidebox-insight .status-badge {
  margin-bottom: 8px;
}

.sidebox-insight p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.sidebox-muted {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Sidebox Theme Rows */
.sidebox-theme-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebox-theme-row:last-child {
  border-bottom: none;
}

.sidebox-theme-row .theme-name {
  position: static;
  transform: none;
  font-size: 0.75rem;
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 8px;
  max-width: none;
}

.sidebox-theme-row .theme-delta {
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.sidebox-theme-row .theme-delta.up {
  color: #4ade80;
}

.sidebox-theme-row .theme-delta.down {
  color: #f87171;
}

/* ===========================================
   Utility Classes
   =========================================== */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ===========================================
   Themes Tab
   =========================================== */

.themes-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 12px;
}

.quadrant-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.themes-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.add-best-themes-btn {
  padding: 6px 12px;
  border: 1px solid var(--purple-500);
  border-radius: 6px;
  background: transparent;
  color: var(--purple-400);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.add-best-themes-btn:hover {
  background: var(--purple-600);
  border-color: var(--purple-600);
  color: white;
}

.add-best-themes-btn .btn-hover-text {
  display: none;
}

.add-best-themes-btn.added {
  background: var(--purple-500);
  border-color: var(--purple-500);
  color: white;
}

.add-best-themes-btn.added:hover {
  background: rgba(248, 113, 113, 0.9);
  border-color: rgba(248, 113, 113, 0.9);
}

.add-best-themes-btn.added:hover .btn-text {
  display: none;
}

.add-best-themes-btn.added:hover .btn-hover-text {
  display: inline;
}

.add-best-themes-btn.success {
  background: #4ade80;
  border-color: #4ade80;
  color: black;
}

.quadrant-filter-btn {
  padding: 6px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quadrant-filter-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-secondary);
}

.quadrant-filter-btn.active {
  border-color: transparent;
  font-weight: 500;
}

.themes-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.theme-row {
  background: var(--bg-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-row:hover {
  background: var(--bg-tertiary);
}

.theme-row.expanded {
  background: var(--bg-tertiary);
}

.theme-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.theme-rank {
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 20px;
  text-align: right;
  flex-shrink: 0;
}

.theme-bar-container {
  flex: 1;
  position: relative;
  height: 24px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
}

.theme-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  opacity: 0.3;
  border-radius: 4px;
}

.theme-name {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 16px);
}

.theme-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 50px;
  text-align: right;
  flex-shrink: 0;
}

.theme-share {
  font-size: 0.7rem;
  color: var(--text-muted);
  width: 70px;
  text-align: right;
  flex-shrink: 0;
}

.theme-detail {
  padding: 0 12px 12px 42px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 0;
}

.theme-full-name {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.theme-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.theme-channel {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-primary);
  padding: 3px 8px;
  border-radius: 4px;
}

.theme-creators-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.theme-channel-link {
  font-size: 0.75rem;
  color: var(--purple-400);
  background: var(--bg-primary);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-channel-link:hover {
  background: var(--purple-600);
  color: white;
}

.theme-video-link {
  font-size: 0.7rem;
  color: var(--text-secondary);
  background: var(--bg-primary);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-video-link:hover {
  background: var(--purple-600);
  color: white;
}

/* ===========================================
   Box B - Deep Dive Panel
   =========================================== */

.deep-dive-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
}

.deep-dive-empty .empty-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.deep-dive-empty .empty-text {
  font-size: 0.875rem;
  font-weight: 500;
}

.deep-dive-empty .empty-subtext {
  font-size: 0.75rem;
  margin-top: 4px;
}

.deep-dive-container {
  padding: 16px;
}

.deep-dive-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.deep-dive-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.deep-dive-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color var(--transition-fast);
}

.deep-dive-close:hover {
  color: var(--text-primary);
}

.deep-dive-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.deep-dive-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.deep-dive-title a:hover {
  color: var(--purple-400);
}

.deep-dive-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 12px;
}

.deep-dive-trend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  margin-bottom: 16px;
}

.deep-dive-trend.up {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}

.deep-dive-trend.down {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.deep-dive-trend .trend-arrow {
  font-size: 0.75rem;
}

.deep-dive-trend .trend-delta {
  font-weight: 600;
}

.deep-dive-trend .trend-label {
  opacity: 0.8;
  font-size: 0.7rem;
}

.deep-dive-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 16px 0;
}

.deep-dive-section {
  margin-bottom: 12px;
}

.deep-dive-section .section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.deep-dive-section .section-label .section-channel {
  display: block;
  color: var(--purple-400);
  margin-bottom: 2px;
}

.deep-dive-section .section-label .section-hint {
  font-size: 0.6rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--purple-400);
  font-weight: 600;
}

/* Theme Pattern Display */
.theme-pattern {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px;
  background: var(--bg-card);
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.theme-pattern .pattern-badge {
  font-family: 'SF Mono', 'Monaco', monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--purple-400);
  background: var(--purple-900);
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.theme-pattern .pattern-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* Vertical Metrics Layout for Theme Deep Dive */
.metrics-vertical {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.metrics-vertical .metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: 6px;
  border-left: 3px solid var(--border-subtle);
}

.metrics-vertical .metric-row.up {
  border-left-color: var(--green-500);
}

.metrics-vertical .metric-row.down {
  border-left-color: var(--red-500);
}

.metrics-vertical .metric-value {
  font-size: 1rem;
  font-weight: 600;
  font-family: 'SF Mono', 'Monaco', monospace;
}

.metrics-vertical .metric-row.up .metric-value {
  color: var(--green-500);
}

.metrics-vertical .metric-row.down .metric-value {
  color: var(--red-500);
}

.metrics-vertical .metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Pattern Summary - flows from vertical metrics */
.theme-pattern-summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.theme-pattern-summary .pattern-badge {
  font-family: 'SF Mono', 'Monaco', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--purple-300);
  background: var(--purple-900);
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.theme-pattern-summary .pattern-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.lab-add-btn {
  width: 100%;
  padding: 12px 16px;
  background: var(--purple-600);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lab-add-btn:hover {
  background: var(--purple-500);
  transform: translateY(-1px);
}

.lab-add-btn:active {
  transform: translateY(0);
}

.lab-add-btn .btn-hover-text {
  display: none;
}

.lab-add-btn.in-lab {
  background: var(--purple-400);
}

.lab-add-btn.in-lab:hover {
  background: rgba(248, 113, 113, 0.9);
}

.lab-add-btn.in-lab:hover .btn-text {
  display: none;
}

.lab-add-btn.in-lab:hover .btn-hover-text {
  display: inline;
}

.deep-dive-theme-row.lab-theme:hover {
  background: var(--purple-600);
}

.deep-dive-theme-row.lab-theme:hover .theme-name-short,
.deep-dive-theme-row.lab-theme:hover .theme-pct {
  color: white;
}

/* Theme added to Lab state */
.deep-dive-theme-row.lab-theme.in-lab {
  background: var(--purple-600);
  position: relative;
}

.deep-dive-theme-row.lab-theme.in-lab .theme-name-short,
.deep-dive-theme-row.lab-theme.in-lab .theme-pct {
  opacity: 0.5;
}

.deep-dive-theme-row.lab-theme.in-lab .lab-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--purple-400);
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
}

.deep-dive-theme-row.lab-theme.in-lab:hover {
  background: var(--purple-700);
}

.deep-dive-theme-row.lab-theme.in-lab:hover .lab-badge {
  background: rgba(248, 113, 113, 0.9);
  color: transparent;
}

.deep-dive-theme-row.lab-theme.in-lab:hover .lab-badge::after {
  content: 'Remove';
  color: white;
  font-size: 0.65rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.metric-box {
  background: var(--bg-secondary);
  border-radius: 6px;
  padding: 10px 8px;
  text-align: center;
}

.metric-box .metric-value {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.metric-box .metric-value.up {
  color: #4ade80;
}

.metric-box .metric-value.down {
  color: #f87171;
}

.metric-box .metric-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.quadrant-distribution {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quadrant-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quadrant-label {
  font-size: 0.7rem;
  width: 70px;
  flex-shrink: 0;
}

.quadrant-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.quadrant-bar-fill {
  height: 100%;
  border-radius: 4px;
  opacity: 0.7;
}

.quadrant-pct {
  font-size: 0.7rem;
  color: var(--text-muted);
  width: 35px;
  text-align: right;
}

.deep-dive-themes {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.deep-dive-theme-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: var(--bg-secondary);
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.deep-dive-theme-row.clickable {
  cursor: pointer;
}

.deep-dive-theme-row.clickable:hover {
  background: var(--bg-tertiary);
}

.deep-dive-theme-row.selected {
  background: var(--purple-600);
}

.deep-dive-theme-row.selected .theme-name-short {
  color: white;
}

.deep-dive-theme-row.selected .theme-pct {
  color: rgba(255, 255, 255, 0.8);
}

.deep-dive-theme-row .theme-name-short {
  font-size: 0.75rem;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 8px;
}

.deep-dive-theme-row .theme-pct {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.deep-dive-videos {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.deep-dive-video-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: var(--bg-secondary);
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.deep-dive-video-row:hover {
  background: var(--bg-tertiary);
}

.deep-dive-video-row .video-title-short {
  font-size: 0.75rem;
  color: var(--text-primary);
  flex: 1;
}

.deep-dive-video-row .video-theme-count {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.deep-dive-comments {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deep-dive-comment {
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: 6px;
  border-left: 3px solid var(--purple-500);
}

.deep-dive-comment .comment-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
  font-style: italic;
}

.deep-dive-comment .comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.deep-dive-comment .comment-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.deep-dive-comment .comment-label.core {
  background: rgba(139, 92, 246, 0.2);
  color: var(--purple-400);
}

.deep-dive-comment .comment-label.community {
  background: rgba(96, 165, 250, 0.2);
  color: #60a5fa;
}

.deep-dive-comment .comment-prob,
.deep-dive-comment .comment-channel {
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* Video Deep Dive Specific */
.deep-dive-video-header {
  margin-bottom: 12px;
}

.deep-dive-title-link {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  line-height: 1.3;
  margin-bottom: 8px;
}

.deep-dive-title-link:hover {
  color: var(--purple-400);
}

.deep-dive-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.deep-dive-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.deep-dive-thumbnail {
  margin-bottom: 16px;
  border-radius: 8px;
  overflow: hidden;
}

.deep-dive-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
}

.stats-row {
  display: flex;
  gap: 12px;
}

.stat-item-large {
  flex: 1;
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.stat-item-large .stat-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.stat-item-large .stat-value.up {
  color: #4ade80;
}

.stat-item-large .stat-value.down {
  color: #f87171;
}

.stat-item-large .stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ===========================================
   Munchkin's Lab
   =========================================== */

.lab-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.lab-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.lab-header .lab-icon {
  font-size: 2rem;
}

.lab-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--purple-400);
  margin: 0;
}

.lab-section {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid var(--border-subtle);
}

.lab-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.lab-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 16px 0;
}

.lab-muted {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.lab-channel-section {
  background: var(--bg-secondary);
}

.lab-channel-section h3 {
  color: var(--purple-400);
}

/* Lab Queue */
.lab-queue {
  background: linear-gradient(135deg, var(--purple-600) 0%, var(--purple-700) 100%);
  border-color: var(--purple-500);
}

.lab-queue h3 {
  color: white;
}

.lab-queue-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lab-queue-item {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Lab Table */
.lab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.lab-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
}

.lab-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.lab-table tr:last-child td {
  border-bottom: none;
}

.lab-table tr:hover td {
  background: var(--bg-hover);
}

.lab-table .delta {
  font-weight: 600;
  font-size: 0.8rem;
}

.lab-table .delta.up {
  color: #4ade80;
}

.lab-table .delta.down {
  color: #f87171;
}

.lab-table .cp-value {
  color: var(--purple-400);
  font-weight: 600;
}

/* Lab Loading */
.lab-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-muted);
}

.lab-spinner {
  font-size: 3rem;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Lab Videos Table */
.lab-videos-table td {
  vertical-align: middle;
}

.theme-pill {
  display: inline-block;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  margin: 1px;
  font-size: 0.65rem;
  white-space: nowrap;
}

/* Custom Sidebox Insight Rows */
.sidebox-insight-row {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebox-insight-row:last-child {
  border-bottom: none;
}

.sidebox-insight-row .insight-theme {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.sidebox-insight-row .insight-proof {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.4;
}

.sidebox-recommendation {
  background: rgba(168, 85, 247, 0.1);
  margin-left: -16px;
  margin-right: -16px;
  padding-left: 16px !important;
  padding-right: 16px !important;
  border-radius: 0;
}

.sidebox-recommendation p {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ===========================================
   Munchkin's Lab - Prompt Generator
   =========================================== */

.lab-container {
  padding: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.lab-header {
  text-align: center;
  margin-bottom: 32px;
}

.lab-header h2 {
  font-size: 1.75rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.lab-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Explainer Section */
.lab-explainer {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px 24px 24px;
  margin-bottom: 24px;
  text-align: center;
}

.lab-explainer p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.lab-explainer p:last-of-type {
  margin-bottom: 0;
}

.lab-explainer strong {
  color: var(--purple-400);
}

.lab-explainer-cta {
  font-style: italic;
  color: var(--text-muted) !important;
  margin-top: 4px !important;
}

.lab-explainer .lab-buttons {
  margin-top: 20px;
  margin-bottom: 0;
}

/* Buttons Row */
.lab-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 32px;
}

.lab-btn {
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.lab-btn-psr {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: white;
}

.lab-btn-psr:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.lab-btn-engagement {
  background: linear-gradient(135deg, #3b82f6 0%, #0ea5e9 100%);
  color: white;
}

.lab-btn-engagement:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.lab-btn-auto {
  background: linear-gradient(135deg, #a78bfa 0%, #c4b5fd 100%);
  color: #1e1b4b;
  border: none;
  font-weight: 600;
}

.lab-btn-auto:hover:not(:disabled) {
  background: linear-gradient(135deg, #c4b5fd 0%, #ddd6fe 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(167, 139, 250, 0.4);
}

.lab-btn-auto:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Themes Section */
.lab-themes-section {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.lab-themes-section h3 {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lab-themes-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
}

.lab-theme-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.lab-theme-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.lab-theme-remove:hover {
  opacity: 1;
  color: #ef4444;
}

.lab-empty-message {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.85rem;
  padding: 8px 0;
}

.lab-empty-message.lab-loading {
  color: var(--purple-400);
}

/* Auto Section */
.lab-auto-section {
  margin-bottom: 32px;
}

.lab-auto-buttons {
  display: flex;
  gap: 12px;
}

.lab-auto-buttons .lab-btn {
  flex: 1;
  margin-top: 0;
}

.lab-btn-clear {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.lab-btn-clear:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

/* Button copied state */
.lab-btn .btn-copied {
  color: #10b981;
}

/* Lab Full Popup */
.lab-full-popup {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px 40px 16px 16px;
  max-width: 320px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  animation: slideIn 0.2s ease;
}

.lab-full-popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.lab-full-popup-close:hover {
  color: var(--text-primary);
}

.lab-full-popup-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.lab-full-popup-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.lab-full-popup h3 {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.lab-full-popup p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
