@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

:root {
  --bg: #000000;
  --bg-secondary: #040a04;
  --surface: rgba(0, 20, 0, 0.75);
  --surface-hover: rgba(0, 35, 0, 0.85);
  --border: rgba(0, 255, 65, 0.15);
  --border-light: rgba(0, 255, 65, 0.07);
  --text: #d0ffd0;
  --text-secondary: rgba(0, 255, 65, 0.6);
  --text-muted: rgba(0, 255, 65, 0.3);
  --primary: #00ff41;
  --primary-glow: rgba(0, 255, 65, 0.2);
  --primary-light: rgba(0, 255, 65, 0.08);
  --accent: #00ff41;
  --success: #00ff41;
  --success-bg: rgba(0, 255, 65, 0.1);
  --warning: #ffe066;
  --warning-bg: rgba(255, 224, 102, 0.1);
  --danger: #ff4444;
  --danger-bg: rgba(255, 68, 68, 0.1);
  --info: #00ccff;
  --info-bg: rgba(0, 204, 255, 0.1);
  --glow-strong:    rgba(0, 255, 65, 0.6);
  --glow-mid:       rgba(0, 255, 65, 0.35);
  --glow-subtle:    rgba(0, 255, 65, 0.05);
  --gradient-1: linear-gradient(135deg, #00ff41, #00cc33);
  --gradient-2: linear-gradient(135deg, #00ff41, #00cc33);
  --gradient-text: linear-gradient(135deg, #00ff41, #00cc33);
  --radius: 6px;
  --radius-lg: 8px;
  --radius-pill: 4px;
}

/* ── Red Terminal Theme ──────────────────────────────────────── */
[data-theme="red"] {
  --bg-secondary:   #0a0000;
  --surface:        rgba(25, 0, 0, 0.75);
  --surface-hover:  rgba(40, 0, 0, 0.85);
  --border:         rgba(255, 30, 30, 0.18);
  --border-light:   rgba(255, 30, 30, 0.08);
  --text:           #ffd5d5;
  --text-secondary: rgba(255, 90, 90, 0.68);
  --text-muted:     rgba(255, 90, 90, 0.34);
  --primary:        #ff2222;
  --primary-glow:   rgba(255, 34, 34, 0.24);
  --primary-light:  rgba(255, 34, 34, 0.09);
  --accent:         #ff2222;
  --success:        #ff4444;
  --success-bg:     rgba(255, 34, 34, 0.1);
  --glow-strong:    rgba(255, 34, 34, 0.6);
  --glow-mid:       rgba(255, 34, 34, 0.35);
  --glow-subtle:    rgba(255, 34, 34, 0.05);
  --gradient-1:     linear-gradient(135deg, #ff2222, #cc0000);
  --gradient-2:     linear-gradient(135deg, #ff2222, #cc0000);
  --gradient-text:  linear-gradient(135deg, #ff2222, #cc0000);
}

/* ── Blue Terminal Theme ─────────────────────────────────────── */
[data-theme="blue"] {
  --bg-secondary:   #00060f;
  --surface:        rgba(0, 14, 34, 0.75);
  --surface-hover:  rgba(0, 22, 50, 0.85);
  --border:         rgba(0, 180, 255, 0.18);
  --border-light:   rgba(0, 180, 255, 0.08);
  --text:           #d0eeff;
  --text-secondary: rgba(0, 180, 255, 0.68);
  --text-muted:     rgba(0, 180, 255, 0.34);
  --primary:        #00b4ff;
  --primary-glow:   rgba(0, 180, 255, 0.24);
  --primary-light:  rgba(0, 180, 255, 0.09);
  --accent:         #00b4ff;
  --success:        #00b4ff;
  --success-bg:     rgba(0, 180, 255, 0.1);
  --glow-strong:    rgba(0, 180, 255, 0.6);
  --glow-mid:       rgba(0, 180, 255, 0.35);
  --glow-subtle:    rgba(0, 180, 255, 0.05);
  --gradient-1:     linear-gradient(135deg, #00b4ff, #0077cc);
  --gradient-2:     linear-gradient(135deg, #00b4ff, #0077cc);
  --gradient-text:  linear-gradient(135deg, #00b4ff, #0077cc);
}

/* ── Mono B&W Theme ──────────────────────────────────────────── */
[data-theme="mono"] {
  --bg-secondary:   #090909;
  --surface:        rgba(255, 255, 255, 0.05);
  --surface-hover:  rgba(255, 255, 255, 0.09);
  --border:         rgba(255, 255, 255, 0.16);
  --border-light:   rgba(255, 255, 255, 0.07);
  --text:           #e0e0e0;
  --text-secondary: rgba(255, 255, 255, 0.58);
  --text-muted:     rgba(255, 255, 255, 0.30);
  --primary:        #d8d8d8;
  --primary-glow:   rgba(220, 220, 220, 0.20);
  --primary-light:  rgba(220, 220, 220, 0.07);
  --accent:         #d8d8d8;
  --success:        #a0a0a0;
  --success-bg:     rgba(200, 200, 200, 0.08);
  --glow-strong:    rgba(232, 232, 232, 0.5);
  --glow-mid:       rgba(232, 232, 232, 0.28);
  --glow-subtle:    rgba(232, 232, 232, 0.04);
  --gradient-1:     linear-gradient(135deg, #d8d8d8, #888);
  --gradient-2:     linear-gradient(135deg, #d8d8d8, #888);
  --gradient-text:  linear-gradient(135deg, #d8d8d8, #888);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Share Tech Mono', 'Courier New', Courier, monospace;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Matrix rain canvas ──────────────────────────────────────── */
#matrix-rain-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── Vignette over rain ──────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.72) 100%);
  z-index: 1;
  pointer-events: none;
}

/* ── Scanlines ───────────────────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    var(--glow-subtle) 2px,
    var(--glow-subtle) 4px
  );
  z-index: 1;
  pointer-events: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 10;
}

nav {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

nav .logo {
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  color: var(--primary);
  letter-spacing: 0.08em;
  text-shadow: 0 0 12px var(--glow-strong);
  font-family: 'Share Tech Mono', monospace;
}

nav .logo span {
  opacity: 0.5;
  font-weight: 400;
}

nav .nav-links { display: flex; gap: 4px; align-items: center; }

nav .nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: all 0.2s;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

nav .nav-links a:hover {
  color: var(--primary);
  background: var(--primary-light);
  text-shadow: 0 0 8px var(--glow-mid);
}

.page-header { padding: 40px 0 20px; }

.page-header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--primary);
}

.page-header .gradient-text {
  color: var(--primary);
  text-shadow: 0 0 16px var(--glow-mid);
}

.page-header p { color: var(--text-secondary); margin-top: 6px; font-size: 13px; }

/* ── Hero / Question Cycle ───────────────────────────────────── */
.hero-section {
  padding: 48px 0 32px;
  text-align: center;
  position: relative;
  z-index: 10;
}

.question-cycle {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 140px;
  justify-content: center;
}

.question-label {
  font-size: 10px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 18px;
  font-family: 'Share Tech Mono', monospace;
}

.question-text {
  font-size: 42px;
  font-weight: 700;
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  color: #ffffff;
  text-shadow: 0 0 20px var(--glow-strong), 0 0 60px var(--primary-glow);
  letter-spacing: 0.01em;
  line-height: 1.2;
  transition: opacity 0.45s ease, transform 0.45s ease, filter 0.1s;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.question-text.glitch {
  filter: hue-rotate(90deg) brightness(2);
}

.question-sub {
  margin-top: 14px;
  font-size: 13px;
  color: var(--primary);
  font-family: 'Share Tech Mono', monospace;
  opacity: 0.75;
  letter-spacing: 0.04em;
  min-height: 20px;
  transition: opacity 0.3s ease;
}

/* ── Stats ───────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin: 20px 0;
  position: relative;
  z-index: 10;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  backdrop-filter: blur(8px);
}

.stat-card:hover {
  border-color: var(--glow-mid);
  transform: translateY(-2px);
  box-shadow: 0 0 20px var(--primary-light);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--gradient-1);
  opacity: 0;
  transition: opacity 0.2s;
}

.stat-card:hover::before { opacity: 1; }

.stat-card .stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 400;
}

.stat-card .stat-value {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--primary);
  text-shadow: 0 0 16px var(--glow-mid);
}

/* ── Card ────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 14px;
  transition: border-color 0.2s;
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 10;
}

.card:hover { border-color: var(--glow-mid); }

.card h2 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  text-shadow: 0 0 8px var(--glow-mid);
}

.card h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--primary);
}

/* ── Table ───────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 12px; }

th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

td { padding: 11px 12px; border-bottom: 1px solid var(--border-light); }

tr { transition: background 0.15s; }
tr:hover td { background: var(--glow-subtle); }

a { color: var(--primary); text-decoration: none; transition: color 0.15s, text-shadow 0.15s; }
a:hover { color: #ffffff; text-shadow: 0 0 8px var(--glow-strong); }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-high   { background: var(--success-bg);  color: var(--primary);  border: 1px solid var(--primary-glow); }
.badge-medium { background: rgba(255,224,102,0.1); color: #ffe066; border: 1px solid rgba(255,224,102,0.25); }
.badge-low    { background: rgba(255,68,68,0.1);  color: #ff6666; border: 1px solid rgba(255,68,68,0.25); }
.badge-info   { background: rgba(0,204,255,0.1);  color: #00ccff; border: 1px solid rgba(0,204,255,0.25); }

.badge-rule {
  background: var(--border-light);
  color: var(--glow-strong);
  font-size: 10px;
  padding: 2px 7px;
  border: 1px solid var(--border);
}

.badge-no-llm {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 4px;
  border: 1px solid var(--primary-glow);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.04em;
  text-shadow: 0 0 6px var(--glow-mid);
}

.nav-auth-btn {
  margin-left: 4px;
}

.nav-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--success-bg);
  border: 1px solid var(--glow-mid);
  color: var(--primary);
  text-shadow: 0 0 6px var(--glow-mid);
}

.nav-login-btn:hover {
  background: var(--primary-glow);
  border-color: var(--glow-strong);
  color: #ffffff;
}

.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
}

.nav-avatar {
  width: 26px;
  height: 26px;
  border-radius: 3px;
  border: 1px solid var(--glow-mid);
  object-fit: cover;
  filter: grayscale(30%) sepia(20%) hue-rotate(80deg);
}

.nav-username {
  font-size: 11px;
  color: var(--glow-strong);
  letter-spacing: 0.04em;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Score bar ───────────────────────────────────────────────── */
.score-bar { display: flex; align-items: center; gap: 8px; }

.score-bar-track {
  flex: 1;
  height: 4px;
  background: var(--primary-light);
  border-radius: 2px;
  overflow: hidden;
  max-width: 100px;
}

.score-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--primary);
  box-shadow: 0 0 6px var(--glow-mid);
  transition: width 0.4s ease;
}

.score-value { font-size: 12px; font-weight: 600; min-width: 35px; color: var(--primary); }

/* ── Evidence / info boxes ───────────────────────────────────── */
.evidence-box {
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 10px 0;
  font-size: 13px;
}

.evidence-box .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.limitations-box {
  background: rgba(255,224,102,0.04);
  border: 1px solid rgba(255,224,102,0.15);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 14px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.limitations-box .label { font-weight: 600; margin-bottom: 6px; color: var(--warning); }

.info-box {
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--primary-glow);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 14px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.info-box .label { font-weight: 600; margin-bottom: 6px; color: var(--primary); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--glow-subtle);
  color: var(--primary);
  transition: all 0.2s;
  text-decoration: none;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.btn:hover {
  border-color: var(--glow-strong);
  background: var(--primary-glow);
  color: #ffffff;
  text-shadow: 0 0 8px var(--glow-strong);
  box-shadow: 0 0 14px var(--success-bg);
  text-decoration: none;
}

.btn-primary {
  background: var(--border);
  border: 1px solid var(--glow-strong);
  color: var(--primary);
  text-shadow: 0 0 8px var(--glow-mid);
}

.btn-primary:hover {
  background: var(--primary-glow);
  box-shadow: 0 0 20px var(--primary-glow);
  color: #ffffff;
  opacity: 1;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--primary-glow);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  border-color: var(--glow-mid);
  color: var(--primary);
}

.btn-sm { padding: 4px 10px; font-size: 11px; }

.btn-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Ingest form ─────────────────────────────────────────────── */
.ingest-form { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.ingest-form select, .ingest-form input {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  background: rgba(0,0,0,0.6);
  color: var(--primary);
  font-family: 'Share Tech Mono', monospace;
  min-width: 300px;
  transition: border-color 0.2s, box-shadow 0.2s;
  letter-spacing: 0.04em;
}

.ingest-form select:focus, .ingest-form input:focus {
  outline: none;
  border-color: var(--glow-strong);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.ingest-form select option { background: #0a1a0a; color: var(--primary); }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-secondary);
}

.empty-state h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--primary);
  letter-spacing: 0.04em;
}

/* ── Tag ─────────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 2px 7px;
  background: var(--glow-subtle);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
  color: var(--glow-strong);
  letter-spacing: 0.04em;
}

/* ── Lang chart ──────────────────────────────────────────────── */
.lang-chart {
  display: flex; gap: 3px; height: 24px;
  border-radius: 4px; overflow: hidden; margin: 8px 0;
}

.lang-chart-segment {
  height: 100%; min-width: 4px;
  border-radius: 2px; position: relative; transition: opacity 0.2s;
}

.lang-chart-segment:hover { opacity: 0.75; }

.lang-legend {
  display: flex; flex-wrap: wrap; gap: 10px;
  font-size: 11px; margin-top: 10px; color: var(--text-secondary);
}

.lang-legend-item { display: flex; align-items: center; gap: 5px; }

.lang-legend-dot { width: 9px; height: 9px; border-radius: 2px; }

.section { margin: 20px 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .ingest-form select { min-width: 200px; }
  .question-text { font-size: 26px; }
}

/* ── Status indicators ───────────────────────────────────────── */
.status-indicator {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-completed { background: var(--primary); box-shadow: 0 0 8px var(--glow-strong); }
.status-running   { background: #ffe066; box-shadow: 0 0 8px rgba(255,224,102,0.5); animation: pulse 2s infinite; }
.status-failed    { background: #ff4444; box-shadow: 0 0 8px rgba(255,68,68,0.5); }
.status-pending   { background: var(--text-muted); }

@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }

/* ── Ingestion status ────────────────────────────────────────── */
#ingestion-status { margin-top: 12px; font-size: 12px; color: var(--text-secondary); }

/* ── Toast ───────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-size: 12px;
  background: rgba(0,20,0,0.95);
  color: var(--primary);
  border: 1px solid var(--glow-mid);
  box-shadow: 0 0 20px var(--success-bg);
  z-index: 1000;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  backdrop-filter: blur(10px);
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.04em;
}

.toast.show { opacity: 1; transform: translateY(0); }

/* ── Method badge ────────────────────────────────────────────── */
.method-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: var(--primary-light);
  border: 1px solid var(--primary-glow);
  color: var(--primary);
  margin-bottom: 20px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Progress bars ───────────────────────────────────────────── */
.progress-bar-container { margin-top: 10px; }

.progress-bar-bg {
  width: 100%; height: 3px;
  background: var(--primary-light);
  border-radius: 2px; overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  box-shadow: 0 0 6px var(--glow-mid);
  border-radius: 2px;
  transition: width 0.3s;
}

.progress-text { font-size: 11px; color: var(--text-muted); margin-top: 5px; }

/* ── Footer ──────────────────────────────────────────────────── */
footer {
  padding: 36px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  border-top: 1px solid var(--border);
  margin-top: 48px;
  position: relative;
  z-index: 10;
  letter-spacing: 0.04em;
}

ul { color: var(--text-secondary); }
li { margin-bottom: 4px; }
strong { color: #d0ffd0; }

/* ── Settings form ───────────────────────────────────────────── */
.settings-form { display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }

.form-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.form-input {
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  background: rgba(0,0,0,0.6);
  color: var(--primary);
  font-family: 'Share Tech Mono', monospace;
  transition: border-color 0.2s;
  width: 100%;
  letter-spacing: 0.04em;
}

.form-input:focus {
  outline: none;
  border-color: var(--glow-strong);
  box-shadow: 0 0 0 3px var(--border-light);
}

.form-input option { background: #0a1a0a; color: var(--primary); }

/* ── Review modal ────────────────────────────────────────────── */
.review-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}

.review-modal-overlay.active { opacity: 1; pointer-events: all; }

.review-modal {
  background: rgba(0,15,0,0.97);
  border: 1px solid var(--primary-glow);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  max-width: 720px; width: 90%;
  max-height: 80vh; overflow-y: auto;
  position: relative;
  box-shadow: 0 0 40px var(--success-bg);
}

.review-modal h2 {
  font-size: 18px; font-weight: 700;
  margin-bottom: 8px; letter-spacing: 0.02em;
  color: var(--primary);
}

.review-modal .review-meta {
  font-size: 11px; color: var(--text-muted);
  margin-bottom: 14px;
  display: flex; gap: 12px; align-items: center;
}

.review-modal .review-content {
  font-size: 13px; line-height: 1.8;
  color: var(--text-secondary);
}
.review-modal .review-content h1,
.review-modal .review-content h2,
.review-modal .review-content h3 {
  color: var(--primary); font-family: inherit; letter-spacing: .05em;
  margin: 18px 0 8px; font-size: 13px; text-transform: uppercase;
  border-bottom: 1px solid var(--border); padding-bottom: 4px;
}
.review-modal .review-content p { margin: 0 0 10px; }
.review-modal .review-content ul,
.review-modal .review-content ol {
  padding-left: 18px; margin: 0 0 10px;
}
.review-modal .review-content li { margin-bottom: 4px; }
.review-modal .review-content strong { color: var(--text-primary); font-weight: 700; }
.review-modal .review-content em { color: var(--text-muted); font-style: italic; }
.review-modal .review-content code {
  background: var(--primary-light); border: 1px solid var(--primary-glow);
  padding: 1px 5px; border-radius: 3px; font-family: inherit; font-size: 12px;
  color: var(--primary);
}

.review-modal .close-btn {
  position: absolute; top: 14px; right: 14px;
  background: var(--glow-subtle);
  border: 1px solid var(--border); color: var(--text-muted);
  width: 28px; height: 28px; border-radius: 3px;
  cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; font-family: monospace;
}

.review-modal .close-btn:hover { color: var(--primary); border-color: var(--glow-mid); }

.btn-llm {
  background: var(--success-bg);
  border: 1px solid var(--glow-mid);
  color: var(--primary); font-weight: 600;
}

.btn-llm:hover:not(:disabled) {
  background: var(--primary-glow);
  box-shadow: 0 0 16px var(--border);
  color: #ffffff; opacity: 1; transform: translateY(-1px);
}
.btn-llm:disabled {
  opacity: 0.3; cursor: not-allowed; pointer-events: none;
}

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 12px;
  border: 1px solid transparent;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.alert-info    { background: var(--glow-subtle);  border-color: var(--primary-glow);    color: var(--glow-strong); }
.alert-success { background: var(--primary-light);  border-color: var(--glow-mid);    color: var(--primary); }
.alert-warning { background: rgba(255,224,102,0.08); border-color: rgba(255,224,102,0.25); color: #ffe066; }
.alert-error   { background: rgba(255,68,68,0.08); border-color: rgba(255,68,68,0.25);  color: #ff7070; }

/* ── Spinner ─────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 10px; height: 10px;
  border: 2px solid var(--primary-glow);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

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

/* ── Error snippet ───────────────────────────────────────────── */
.error-snippet {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px; color: #ff7070;
  cursor: help; max-width: 240px;
  display: inline-block; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
  vertical-align: middle;
}

/* ── Confidence badges ───────────────────────────────────────── */
.confidence-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
}

.confidence-high   { background: var(--success-bg);   color: var(--primary); border: 1px solid var(--primary-glow); }
.confidence-medium { background: rgba(255,224,102,0.1); color: #ffe066; border: 1px solid rgba(255,224,102,0.25); }
.confidence-low    { background: rgba(255,68,68,0.08);  color: #ff7070; border: 1px solid rgba(255,68,68,0.2); }

/* ── Score bar wrap ──────────────────────────────────────────── */
.score-bar-wrap {
  width: 80px; height: 5px;
  background: var(--primary-light);
  border-radius: 2px; overflow: hidden;
  display: inline-block; vertical-align: middle; margin-right: 6px;
}

.score-bar-wrap .score-bar {
  height: 100%;
  background: var(--primary);
  box-shadow: 0 0 4px var(--glow-mid);
  border-radius: 2px; min-width: 2px; transition: width 0.3s;
}

/* ── Skill Map KPI Row ──────────────────────────────────── */
.kpi-row {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px;
}
.kpi-card {
  flex: 1; min-width: 100px;
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 4px; padding: 14px 16px; text-align: center;
}
.kpi-card--high { border-color: var(--glow-mid); }
.kpi-card--med  { border-color: rgba(255,170,0,0.35); }
.kpi-card--low  { border-color: rgba(255,80,80,0.35); }
.kpi-value {
  font-size: 26px; font-weight: 700; color: var(--primary);
  letter-spacing: 0.04em; line-height: 1;
}
.kpi-card--med .kpi-value { color: #ffaa00; }
.kpi-card--low .kpi-value { color: #ff5050; }
.kpi-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-muted); margin-top: 6px;
}

/* ── Skill Map Toolbar ──────────────────────────────────── */
.skillmap-toolbar {
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap; margin-bottom: 14px;
}
.skillmap-filter { display: flex; align-items: center; gap: 8px; }
.filter-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); white-space: nowrap;
}
.filter-select {
  background: var(--glow-subtle);
  border: 1px solid var(--primary-glow);
  color: var(--text-primary); font-family: inherit; font-size: 12px;
  padding: 6px 10px; border-radius: 3px; cursor: pointer;
  min-width: 160px; outline: none;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2300ff41' fill-opacity='.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 28px;
}
.filter-select:focus { border-color: var(--glow-strong); }
.filter-select option { background: #0a0a0a; color: var(--text-primary); }
.filter-count {
  font-size: 11px; color: var(--text-muted); margin-left: auto;
}

/* ── Clickable Stat Cards ──────────────────────────────── */
.stat-card--clickable {
  cursor: pointer; position: relative;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  user-select: none;
}
.stat-card--clickable:hover {
  border-color: var(--glow-mid);
  background: var(--border-light);
  transform: translateY(-2px);
}
.stat-card--clickable.active {
  border-color: var(--glow-strong);
  background: var(--success-bg);
  box-shadow: 0 0 18px var(--primary-glow);
}
.stat-card-caret {
  position: absolute; bottom: 8px; right: 10px;
  font-size: 10px; color: var(--glow-mid);
  transition: transform 0.25s, color 0.2s;
}
.stat-card--clickable:hover .stat-card-caret,
.stat-card--clickable.active .stat-card-caret { color: var(--glow-strong); }

/* ── Expandable Stat Panel ─────────────────────────────── */
.stat-panel {
  max-height: 0; overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s;
  background: var(--glow-subtle);
  border: 1px solid transparent;
  border-radius: 4px; margin-bottom: 0;
}
.stat-panel.open {
  max-height: 600px;
  border-color: var(--border);
  padding: 16px 20px;
  margin-bottom: 20px;
  overflow: auto;
}

/* ── Contributors Grid ─────────────────────────────────── */
.contributors-grid {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.contributor-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--glow-subtle);
  border: 1px solid var(--primary-glow);
  border-radius: 3px; padding: 7px 12px;
  text-decoration: none; color: var(--text-primary);
  font-size: 12px; transition: all 0.2s;
}
.contributor-chip:hover {
  border-color: var(--glow-mid);
  background: var(--success-bg);
  color: var(--primary);
}
.contributor-chip-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--primary-glow);
}
.contributor-chip-login { font-weight: 600; }
.contributor-chip-badge {
  font-size: 10px; color: var(--text-muted);
  background: var(--primary-light);
  border: 1px solid var(--border);
  border-radius: 2px; padding: 1px 5px;
}

/* ── Theme Switcher ──────────────────────────────────────────── */
.theme-switcher {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  background: rgba(0,0,0,0.3);
}
.theme-dot {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer; padding: 0; outline: none;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}
.theme-dot:hover { transform: scale(1.25); }
.theme-dot.active {
  border-color: rgba(255,255,255,0.7);
  box-shadow: 0 0 6px rgba(255,255,255,0.4);
  transform: scale(1.15);
}
.theme-dot--green { background: var(--primary); box-shadow: 0 0 4px var(--glow-strong); }
.theme-dot--red   { background: #ff2222; box-shadow: 0 0 4px rgba(255,34,34,0.5); }
.theme-dot--blue  { background: #00b4ff; box-shadow: 0 0 4px rgba(0,180,255,0.5); }
.theme-dot--mono  { background: linear-gradient(135deg,#fff 50%,#555 50%); box-shadow: 0 0 4px rgba(200,200,200,0.4); }
