/* === Custom Properties === */
:root {
  --primary: #f59e0b;
  --primary-light: #fbbf24;
  --primary-dark: #d97706;
  --accent: #fde68a;
  --accent-light: #fef3c7;
  --bg: #000000;
  --bg-light: #0a0a0a;
  --surface: #111111;
  --surface-2: #1a1a1a;
  --surface-hover: #222222;
  --text: #ffffff;
  --text-muted: #a0a0a0;
  --text-dim: #666666;
  --border: #2a2a2a;
  --border-bright: #3a3a3a;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --orange: #ff6d00;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.8);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.9);
  --transition: 0.2s ease;
  --max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-light);
}

img {
  max-width: 100%;
}

/* === Layout & Nav === */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo span {
  font-size: 1.4rem;
  -webkit-text-fill-color: initial;
}

.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: rgba(245,158,11,0.1);
}
.nav-links a.active {
  color: var(--primary-light);
  font-weight: 600;
}

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
}

/* === Page containers === (transitions added below) */

/* === Hero === */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    #f59e0b, #d97706, #fbbf24, #fde68a,
    #f59e0b, #d97706, #fbbf24, #fde68a
  );
  background-size: 400% 400%;
  animation: heroGradient 15s ease infinite;
  opacity: 0.06;
  z-index: 0;
}

@keyframes heroGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #fbbf24 50%, #fde68a 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShine 4s linear infinite;
}

@keyframes textShine {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 40px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* === Hero Action Cards === */
.hero-action-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 640px;
  margin: 0 auto;
}

.hero-action-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.hero-action-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.15);
  border-color: var(--primary-light);
}

.hero-action-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.hero-action-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.hero-action-text strong {
  font-size: 1.15rem;
  font-weight: 700;
}

.hero-action-text span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
  color: white;
}

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

.btn-secondary:hover {
  background: var(--surface-hover);
  transform: translateY(-2px);
  color: var(--text);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

/* === Section Headers === */
.section {
  padding: 60px 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-header .subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* === Search / Config Panel === */
.search-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 800px;
  margin: 0 auto 48px;
  box-shadow: var(--shadow);
}

.search-panel h2 {
  font-size: 1.3rem;
  margin-bottom: 24px;
  text-align: center;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group select,
.form-group input[type="text"],
.form-group input[type="number"] {
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color var(--transition);
  width: 100%;
  min-height: 46px;
}

.form-group select option {
  background: #111111;
  color: var(--text);
}

.form-group select:focus,
.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}



/* Range slider */
.range-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-wrapper input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  outline: none;
}

.range-wrapper input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

.range-wrapper input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

.range-value {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  min-width: 55px;
  text-align: right;
}

/* Toggle switch */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 6px;
}

.toggle {
  position: relative;
  width: 48px;
  height: 26px;
  cursor: pointer;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle {
  cursor: pointer;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg);
  border-radius: 13px;
  transition: background var(--transition);
  border: 1px solid var(--border);
  cursor: pointer;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  bottom: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all var(--transition);
}

.toggle input:checked + .toggle-slider {
  background: var(--primary);
  border-color: var(--primary);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(22px);
  background: white;
}

.gpu-fields {
  display: none;
  grid-column: 1 / -1;
}

.gpu-fields.visible {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.search-submit {
  grid-column: 1 / -1;
  margin-top: 8px;
}

/* === Cards === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* === Best Fit Hero Card === */
.best-fit-hero {
  max-width: 700px;
  margin: 0 auto 28px;
}

.best-fit-hero .model-card {
  padding: 28px 32px;
  border: 2px solid var(--primary);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.15);
  position: relative;
}

.best-fit-hero .model-card:hover {
  box-shadow: 0 0 32px rgba(245, 158, 11, 0.25);
}

.best-fit-hero .model-card h3 {
  font-size: 1.35rem;
}

.best-fit-hero .model-card .model-stats {
  gap: 12px;
  margin-bottom: 18px;
}

.best-fit-hero .stat-value {
  font-size: 1.5rem;
}

.best-fit-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #000;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.best-fit-reasoning {
  margin-top: 14px;
  padding: 14px 16px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
}

.best-fit-reasoning strong {
  color: var(--primary-light);
  font-weight: 700;
}

.runner-up-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.model-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.model-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

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

.model-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}

.model-card .model-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* ==========================================
   Card Meta Row (icon style from mockup)
   ========================================== */
.model-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-bottom: 14px;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.meta-item {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.meta-item strong {
  color: var(--text);
  font-weight: 600;
}
.meta-label-sm {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.6;
}

/* ==========================================
   Score + RAM row (gauge + value)
   ========================================== */
.score-ram-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.score-cell, .ram-cell {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.score-gauge { display: block; margin: 0 auto 2px; }
.score-label, .ram-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-top: 4px;
}
.ram-bars {
  font-size: 1.4rem;
  margin-bottom: 2px;
}
.ram-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

/* ==========================================
   Compact Vote Pill (mockup style)
   ========================================== */
.vote-pill {
  display: inline-flex;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.vote-pill-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.vote-pill-btn + .vote-pill-btn {
  border-left: 1px solid var(--border);
}
.vote-pill-btn:hover {
  background: var(--surface-hover);
}
.vote-pill-btn.voted.vote-up {
  background: rgba(var(--primary-rgb, 232, 160, 42), 0.15);
  color: var(--primary);
}
.vote-pill-btn.voted.vote-down {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}
.vote-pill-btn .vote-count {
  font-size: 0.75rem;
  font-weight: 600;
}

/* Light mode overrides */
html.light .model-meta-row { color: #78716c; }
html.light .meta-item strong { color: #1c1917; }
html.light .score-cell, html.light .ram-cell {
  background: #fafaf9;
  border-color: #e7e5e4;
}
html.light .vote-pill {
  background: #f5f5f4;
  border-color: #e7e5e4;
}
html.light .vote-pill-btn { color: #78716c; }
html.light .vote-pill-btn:hover { background: #e7e5e4; }

/* ==========================================
   Report Button & Dropdown
   ========================================== */
.report-wrap {
  position: relative;
  display: inline-flex;
}
.report-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  padding: 5px 8px;
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: all 0.15s;
  line-height: 1;
}
.report-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.report-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 100;
  min-width: 200px;
  overflow: hidden;
}
.report-dropdown.open {
  display: block;
}
.report-option {
  /* Rendered as <button> for keyboard a11y — reset native button chrome
     so the dropdown row still looks like a list item. */
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  font: inherit;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  transition: background 0.1s;
  white-space: nowrap;
}
.report-option:hover,
.report-option:focus-visible {
  background: var(--surface-hover);
  outline: none;
}
.report-option + .report-option {
  border-top: 1px solid var(--border);
}
html.light .report-dropdown {
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.meta-tag {
  font-size: 0.75rem;
  padding: 3px 8px;
  background: var(--bg);
  border-radius: 20px;
  color: var(--text);
  font-weight: 600;
}

.meta-label {
  font-weight: 400;
  opacity: 0.55;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.meta-tag-warning {
  background: var(--warning, #f59e0b);
  color: #000;
  font-weight: 700;
}

.model-card .model-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.stat {
  text-align: center;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-light);
}

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

/* -- Stat visual differentiation -- */
.stat-avg {
  background: rgba(251, 191, 36, 0.08);
  border-left: 3px solid rgba(251, 191, 36, 0.5);
}
.stat-avg .stat-value { color: var(--primary-light); }

.stat-ram {
  border-left: 3px solid rgba(255, 255, 255, 0.1);
}
.stat-ram .stat-value { color: var(--text-dim); font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace; font-size: 1rem; }

.stat-fit {
  border-left: 3px solid rgba(255, 255, 255, 0.1);
}
.stat-fit-perfect {
  background: rgba(16, 185, 129, 0.12);
  border-left-color: var(--success);
}
.stat-fit-perfect .stat-value { color: var(--success); }

.stat-fit-good {
  background: rgba(22, 163, 74, 0.10);
  border-left-color: var(--success);
}
.stat-fit-good .stat-value { color: var(--success); }

.stat-fit-tight {
  background: rgba(245, 158, 11, 0.10);
  border-left-color: var(--warning);
}
.stat-fit-tight .stat-value { color: var(--warning); }

.stat-fit-squeezed {
  background: rgba(245, 158, 11, 0.08);
  border-left-color: var(--warning);
}
.stat-fit-squeezed .stat-value { color: var(--warning); }

.stat-fit-no {
  background: rgba(239, 68, 68, 0.10);
  border-left-color: var(--danger);
}
.stat-fit-no .stat-value { color: var(--danger); }

.model-card .install-cmd {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.8rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.install-cmd .copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
  transition: all var(--transition);
}

.install-cmd .copy-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* === Badges === */
.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.badge-perfect {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-good {
  background: rgba(22, 163, 74, 0.15);
  color: var(--success);
  border: 1px solid rgba(22, 163, 74, 0.3);
}

.badge-tight {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-no {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* === Cloud CTA (affiliate) === */
.cloud-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border);
  font-size: 0.72rem;
}
.cloud-cta-label {
  color: var(--text-muted);
  white-space: nowrap;
}
.cloud-cta-link {
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.7rem;
  text-decoration: none;
  transition: opacity var(--transition);
}
.cloud-cta-link:hover { opacity: 0.8; }
.cloud-cta-runpod {
  background: rgba(103, 58, 183, 0.15);
  color: #b39ddb;
  border: 1px solid rgba(103, 58, 183, 0.3);
}
.cloud-cta-vastai {
  background: rgba(0, 180, 216, 0.15);
  color: #4dd0e1;
  border: 1px solid rgba(0, 180, 216, 0.3);
}

/* === Trending Row === */
.trending-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.trending-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
}

.trending-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.trending-rank {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fbbf24, #fde68a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.trending-card h4 {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.trending-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* === Leaderboard Tabs === */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 32px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  padding: 10px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

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

.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* === Leaderboard Table === */
.leaderboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

.leaderboard-table thead {
  z-index: 10;
}

.leaderboard-table th {
  background: var(--surface);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--primary);
  cursor: pointer;
  user-select: none;
  transition: color var(--transition);
  white-space: nowrap;
}

.leaderboard-table th:hover {
  color: var(--text);
}

.leaderboard-table th.sorted {
  color: var(--primary-light);
}

.leaderboard-table th .sort-arrow {
  margin-left: 4px;
  font-size: 0.7rem;
}

.leaderboard-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.leaderboard-table tbody tr {
  transition: background var(--transition);
  cursor: pointer;
}

.leaderboard-table tbody tr:hover {
  background: var(--surface-hover);
}

.rank-cell {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-dim);
  width: 50px;
}

.rank-cell.top-3 {
  color: var(--warning);
}

.model-name-cell {
  font-weight: 600;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .model-name-cell {
    max-width: 120px;
    font-size: 0.85rem;
  }
  .leaderboard-table {
    min-width: 600px;
  }
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  padding: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.score-bar-cell {
  min-width: 120px;
}

.score-bar {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.5s ease;
}

.score-value {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* === Hardware Setup Cards === */
.hardware-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
}

.hardware-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.hardware-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.hardware-card .hw-specs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.hw-spec {
  font-size: 0.8rem;
  padding: 4px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.hardware-card .hw-models {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.hardware-card .hw-models strong {
  color: var(--text-muted);
}

.hw-votes {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* === Model Modal === */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 40px 20px;
}

.modal-overlay.active {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Prevent background scroll when modal is open */
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  top: 0;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 800px;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modalIn 0.3s ease;
  overscroll-behavior: contain;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 10;
}

.modal-close:hover {
  background: var(--danger);
  border-color: var(--danger);
}

/* ==========================================
   Modal Header (mockup-style)
   ========================================== */
.modal-header {
  padding: 32px 32px 24px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 6px;
  padding-right: 40px;
  letter-spacing: -0.01em;
}
.modal-meta-line {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.modal-header-cmd {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0a0a0a;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}
.modal-header-cmd code {
  flex: 1;
  color: var(--accent);
  font-size: 0.85rem;
}
.modal-copy-cmd {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  color: #fff;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s;
}
.modal-copy-cmd:hover { opacity: 0.85; transform: translateY(-1px); }

.modal-body {
  padding: 24px 32px 32px;
}
.modal-blurb {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.modal-section {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.modal-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.modal-section h3 {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ==========================================
   Benchmark Cards (mockup-style)
   ========================================== */
.bench-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.bench-grid-primary { grid-column: 1; }
.bench-grid-others {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bench-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.bench-card-primary {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}
.bench-card-top { margin-bottom: 4px; }
.bench-card-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.bench-card-score {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--primary-light);
  line-height: 1.1;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.bench-card-bar {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.bench-card-bar-sm { height: 5px; margin-bottom: 0; flex: 1; }
.bench-card-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary), var(--accent));
  transition: width 0.8s ease;
}
.bench-card-baseline {
  font-size: 0.72rem;
  color: var(--text-dim);
}
.bench-delta {
  font-weight: 700;
  font-size: 0.75rem;
}
.bench-delta-pos { color: #22c55e; }
.bench-delta-neg { color: #ef4444; }

.bench-card-compact {
  display: grid;
  grid-template-columns: 80px 50px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}
.bench-card-score-sm {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-light);
  text-align: right;
}

/* ==========================================
   Scout Score + Benchmarks Grid (modal)
   ========================================== */
.scout-bench-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: start;
}
.scout-bench-hero {
  display: flex;
  justify-content: center;
}
.scout-hero {
  text-align: center;
  padding: 16px 24px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 150px;
}
.scout-hero-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 4px;
}
.scout-hero-gauge { display: block; margin: 0 auto; }
.scout-hero-est {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 4px;
  font-style: italic;
}
.scout-hero-real {
  font-size: 0.68rem;
  color: #22c55e;
  margin-top: 4px;
  font-weight: 600;
}

.scout-bench-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bench-mini-card {
  display: grid;
  grid-template-columns: 110px 1fr 50px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.bench-mini-info { display: flex; flex-direction: column; }
.bench-mini-label {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text);
}
.bench-mini-desc {
  font-size: 0.65rem;
  color: var(--text-dim);
}
.bench-mini-bar {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}
.bench-mini-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary), var(--accent));
  transition: width 0.6s ease;
}
.bench-mini-score {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text);
  text-align: right;
}
.bench-na {
  color: var(--text-dim) !important;
  font-weight: 500 !important;
  opacity: 0.5;
}

@media (max-width: 600px) {
  .scout-bench-grid { grid-template-columns: 1fr; }
  .scout-hero { min-width: unset; }
  .bench-mini-card { grid-template-columns: 80px 1fr 40px; padding: 8px 10px; }
}

/* Light mode */
html.light .scout-hero { background: #fafaf9; border-color: #e7e5e4; }
html.light .bench-mini-card { background: #fafaf9; border-color: #e7e5e4; }
html.light .bench-mini-bar { background: #e7e5e4; }

@media (max-width: 600px) {
  .bench-grid { grid-template-columns: 1fr; }
  .bench-grid-primary { grid-column: 1; }
  .bench-grid-others { grid-column: 1; }
}

/* ==========================================
   Install Block (mockup-style terminal)
   ========================================== */
.modal-install-block {
  background: #0a0a0a;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #222;
}
.modal-install-primary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #222;
}
.modal-install-primary code {
  flex: 1;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.9rem;
  color: var(--accent);
}
.modal-install-primary .copy-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  color: #fff;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.modal-install-setup {
  padding: 14px 16px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.82rem;
}
.modal-install-comment {
  color: #666;
  margin-bottom: 8px;
}
.modal-install-line {
  color: #d6d3d1;
  margin-bottom: 4px;
}
.modal-install-hint {
  padding: 10px 16px;
  border-top: 1px solid #222;
  font-size: 0.78rem;
  color: #666;
}
.modal-install-hint code {
  color: var(--accent);
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* ==========================================
   Use Case Chips (mockup-style)
   ========================================== */
.use-case-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.use-case-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
}
.use-case-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ==========================================
   Related Models (link-style)
   ========================================== */
.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.related-link {
  color: var(--primary);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 4px 0;
  transition: color 0.15s;
  text-decoration: none;
}
.related-link:hover {
  color: var(--primary-light);
  text-decoration: underline;
}
.related-link + .related-link::before {
  content: '·';
  color: var(--text-dim);
  margin-right: 8px;
}

/* ==========================================
   Vote Row (inline)
   ========================================== */
.modal-vote-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.modal-vote-info {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-left: auto;
}

/* Requirements table in modal */
.req-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.req-item .req-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.req-item .req-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-light);
}

.install-block {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.9rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.install-block .copy-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  white-space: nowrap;
  transition: all var(--transition);
}

.install-block .copy-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.related-models {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.related-tag {
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.related-tag:hover {
  border-color: var(--primary);
  color: var(--text);
}

/* === Sort Controls === */
.sort-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.sort-btn {
  padding: 6px 14px;
  font-size: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 500;
}

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

.sort-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* === Results Count === */
.results-info {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.results-info strong {
  color: var(--text);
}

/* === Loading === */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* === Footer === */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

footer a {
  color: var(--text-muted);
}

footer .footer-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 16px;
}

/* === Scrollbar === */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* === Table wrapper for horizontal scroll === */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* === Responsive: Tablet === */
@media (max-width: 768px) {
  .hero {
    padding: 60px 0 48px;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero p {
    font-size: 1rem;
    padding: 0 8px;
  }

  .hero-cta {
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero-action-cards {
    grid-template-columns: 1fr;
    max-width: 400px;
  }

  .container {
    padding: 0 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .gpu-fields.visible {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #000;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px 16px;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
  }

  .nav-hamburger {
    display: block;
    padding: 8px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .section-header h2 {
    font-size: 1.4rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .best-fit-hero .model-card {
    padding: 20px;
  }

  .best-fit-hero .model-card h3 {
    font-size: 1.15rem;
  }

  .trending-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }

  .trending-card {
    padding: 14px 12px;
  }

  .req-grid {
    grid-template-columns: 1fr;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    margin: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 90vh;
  }

  .modal-header {
    padding: 20px 20px 16px;
  }
  .modal-header h2 { font-size: 1.25rem; }
  .modal-header-cmd { flex-wrap: wrap; }
  .modal-header-cmd code { font-size: 0.78rem; }

  .modal-body {
    padding: 16px 20px 32px;
  }

  .bench-card-score { font-size: 2rem; }
  .bench-card-compact { grid-template-columns: 60px 40px 1fr auto; gap: 6px; padding: 10px 12px; }
  .modal-install-setup { font-size: 0.75rem; }
  .modal-install-primary code { font-size: 0.78rem; }

  .tabs {
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  .tab-btn {
    padding: 10px 14px;
    font-size: 0.82rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .search-panel {
    padding: 24px 20px;
    border-radius: var(--radius);
    margin: 0 0 24px;
  }

  .search-panel h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
  }

  .model-card {
    padding: 16px;
  }

  .leaderboard-table {
    font-size: 0.82rem;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 12px 10px;
  }

  /* Hide less important columns on tablet */
  .leaderboard-table .hide-mobile {
    display: none;
  }
}

/* === Responsive: Mobile (small) === */
@media (max-width: 480px) {
  .hero {
    padding: 48px 0 36px;
  }

  .hero h1 {
    font-size: 1.75rem;
    letter-spacing: -0.02em;
  }

  .container {
    padding: 0 14px;
  }

  .search-panel {
    padding: 20px 16px;
    margin: 0 0 20px;
  }

  .search-mode-tabs {
    gap: 4px;
  }

  .mode-tab {
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  .preset-card {
    padding: 12px;
  }

  .preset-info strong {
    font-size: 0.82rem;
  }

  .preset-info span {
    font-size: 0.7rem;
  }

  .model-card {
    padding: 14px;
  }

  .model-card h3 {
    font-size: 1rem;
  }

  .model-card .model-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat-item {
    padding: 10px 8px;
  }

  .badge {
    font-size: 0.68rem;
    padding: 3px 8px;
  }

  .leaderboard-table {
    font-size: 0.78rem;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 10px 8px;
  }

  .copy-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .btn {
    padding: 10px 18px;
    font-size: 0.9rem;
  }

  .btn-primary {
    min-height: 48px; /* easier tap target */
  }

  footer {
    padding: 32px 0 48px; /* extra bottom padding for home indicator */
  }

  footer .footer-links {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }

  /* Toast at bottom center on mobile */
  .toast {
    left: 14px;
    right: 14px;
    bottom: 20px;
    text-align: center;
  }
}

/* === Notification toast === */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  color: var(--text);
  font-size: 0.9rem;
  z-index: 3000;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Leaderboard preview on homepage */
.leaderboard-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.leaderboard-preview-row {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}

.leaderboard-preview-row:last-child {
  border-bottom: none;
}

.leaderboard-preview-row:hover {
  background: var(--surface-hover);
}

.preview-rank {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-dim);
  width: 32px;
  text-align: center;
}

.preview-rank.gold { color: #fbbf24; }
.preview-rank.silver { color: #94a3b8; }
.preview-rank.bronze { color: #d97706; }

.preview-info {
  flex: 1;
}

.preview-info h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.preview-info p {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.preview-score {
  font-weight: 700;
  color: var(--primary-light);
  font-size: 0.95rem;
}

/* Use case tags */
.use-case-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.use-case-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  color: var(--primary-light);
}

/* Error state */
.error-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--danger);
}

.error-state p {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ==========================================
   Freshness Badge
   ========================================== */
.freshness-badge {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.freshness-loading { background: rgba(245,158,11,0.12); color: var(--primary-light); animation: pulse 2s infinite; }
.freshness-live    { background: rgba(16,185,129,0.12); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.freshness-cached  { background: rgba(156,163,175,0.1); color: var(--text-muted); }
.freshness-error   { background: rgba(156,163,175,0.1); color: var(--text-muted); }

/* ==========================================
   New This Week Grid
   ========================================== */
.new-models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 1rem;
}

.new-model-card {
  background: linear-gradient(135deg, rgba(16,185,129,0.06) 0%, rgba(17,24,39,0.8) 100%);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.new-model-card:hover {
  border-color: rgba(16,185,129,0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16,185,129,0.12);
}
.new-model-card h4 { margin: 8px 0 4px; font-size: 1rem; }
.new-model-card .new-meta { font-size: 0.75rem; color: var(--text-muted); margin: 0 0 6px; }
.new-model-card .new-desc { font-size: 0.82rem; color: var(--text-dim); line-height: 1.5; margin: 0 0 10px; }

.new-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #34d399;
  text-transform: uppercase;
}

.new-dot {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.85rem;
}

/* ==========================================
   Model Tags
   ========================================== */
.new-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.tag {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.2);
  color: var(--primary-light);
}
.tag-reasoning { background: rgba(245,158,11,0.1);  border-color: rgba(245,158,11,0.3);  color: #fbbf24; }
.tag-vision    { background: rgba(217,119,6,0.1);   border-color: rgba(217,119,6,0.3);   color: #fbbf24; }
.tag-moe       { background: rgba(253,230,138,0.1); border-color: rgba(253,230,138,0.3); color: #fde68a; }

/* Trending card description */
.trending-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* ==========================================
   Search Mode Tabs
   ========================================== */
.search-mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 0;
}
.mode-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: -1px;
}
.mode-tab:hover { color: var(--text-dim); }
.mode-tab.active { color: var(--primary-light); border-bottom-color: var(--primary-light); }

.mode-panel { display: none; }
.mode-panel.active { display: block; }
.mode-hint { color: var(--text-muted); font-size: 0.88rem; margin: 0 0 20px; }

/* ==========================================
   Preset Cards
   ========================================== */
/* Platform Tabs */
.preset-platform-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.platform-tab {
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.platform-tab:hover {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.25);
  color: var(--text-primary);
}
.platform-tab.active {
  background: rgba(245,158,11,0.15);
  border-color: var(--primary-light);
  color: var(--primary);
}

/* Preset Search */
.preset-search-wrap {
  position: relative;
  margin-bottom: 14px;
}
.preset-search-input {
  width: 100%;
  padding: 10px 36px 10px 14px;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}
.preset-search-input::placeholder { color: var(--text-muted); opacity: 0.7; }
.preset-search-input:focus { border-color: var(--primary-light); }
.preset-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.preset-search-clear:hover { color: var(--text-primary); }

.preset-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }

.preset-tier { }
.tier-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tier-label:hover { opacity: 0.8; }
.tier-chevron {
  font-size: 0.6rem;
  display: inline-block;
  width: 1em;
  text-align: center;
}
.tier-count {
  font-weight: 500;
  opacity: 0.5;
  font-size: 0.65rem;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  transition: max-height 0.2s ease, opacity 0.15s ease;
}
.preset-row.collapsed {
  display: none;
}

.preset-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 200px;
  flex: 0 0 auto;
}
.preset-card:hover {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.3);
}
.preset-card.selected {
  background: rgba(245,158,11,0.15);
  border-color: var(--primary-light);
  box-shadow: 0 0 0 1px var(--primary-light);
}
.preset-emoji { font-size: 1.4rem; line-height: 1; }
.preset-info { display: flex; flex-direction: column; }
.preset-info strong { font-size: 0.85rem; color: var(--text-primary); line-height: 1.3; }
.preset-info span { font-size: 0.75rem; color: var(--text-muted); }

.preset-footer {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-wrap: wrap;
}
.preset-footer .form-group { margin: 0; }
.preset-footer .btn { white-space: nowrap; height: 42px; align-self: flex-end; }

/* ==========================================
   RAM hint + count badge
   ========================================== */
.ram-count-badge {
  display: inline-block;
  margin-left: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.25);
  color: #34d399;
  border-radius: 10px;
  vertical-align: middle;
}
.ram-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
  min-height: 1.2em;
}

/* ==========================================
   Responsive tweaks
   ========================================== */
@media (max-width: 600px) {
  .preset-platform-tabs { flex-wrap: wrap; }
  .platform-tab { flex: 1; text-align: center; padding: 6px 10px; font-size: 0.75rem; }
  .preset-row { flex-direction: column; }
  .preset-card { min-width: unset; width: 100%; }
  .preset-footer { flex-direction: column; align-items: stretch; }
  .search-mode-tabs { flex-direction: row; }
  .mode-tab { padding: 8px 12px; font-size: 0.85rem; }
}

/* ==========================================
   FAQ Accordion
   ========================================== */
.accordion { display: flex; flex-direction: column; gap: 2px; }
.accordion-item { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.accordion-trigger {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 16px 20px; background: var(--surface); border: none; color: var(--text);
  font-size: 0.95rem; font-weight: 600; cursor: pointer; text-align: left; gap: 12px;
  transition: background var(--transition);
}
.accordion-trigger:hover { background: var(--surface-hover); }
.accordion-chevron {
  font-size: 0.7rem; transition: transform 0.3s ease; flex-shrink: 0; color: var(--text-dim);
}
.accordion-trigger[aria-expanded="true"] .accordion-chevron { transform: rotate(180deg); }
.accordion-panel {
  max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
}
.accordion-panel.open { max-height: 500px; }
.accordion-body {
  padding: 16px 20px; color: var(--text-muted); font-size: 0.9rem; line-height: 1.7;
  border-top: 1px solid var(--border); background: var(--bg-light);
}
.accordion-body a { color: var(--accent); }
.accordion-body code { background: var(--surface); padding: 2px 6px; border-radius: 4px; font-size: 0.85rem; color: var(--accent); }

/* ==========================================
   About Page
   ========================================== */
.about-hero { text-align: center; margin-bottom: 48px; }
.about-hero h1 {
  font-size: 2.2rem; font-weight: 800; margin-bottom: 12px;
  background: linear-gradient(135deg, #fff, #fbbf24, #fde68a);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.about-hero p { color: var(--text-muted); font-size: 1.1rem; }

.about-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 48px; }
.about-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; text-align: center; transition: all var(--transition);
}
.about-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.about-card-icon { font-size: 2rem; margin-bottom: 12px; }
.about-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.about-card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

.about-section { margin-bottom: 40px; }
.about-section h2 { font-size: 1.4rem; margin-bottom: 16px; }
.about-section p { color: var(--text-muted); line-height: 1.7; font-size: 0.95rem; }

.about-steps { display: flex; flex-direction: column; gap: 20px; }
.about-step { display: flex; gap: 16px; align-items: flex-start; }
.step-num {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary);
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem; flex-shrink: 0;
}
.about-step p { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }

.about-sources { display: flex; flex-direction: column; gap: 16px; }
.source-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; }
.source-item strong { color: var(--text); }
.source-item p { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }

@media (max-width: 768px) {
  .about-cards { grid-template-columns: 1fr; }
  .about-hero h1 { font-size: 1.6rem; }
}

/* ==========================================
   Families Page
   ========================================== */
/* Old family styles removed — using the polished version below */

@media (max-width: 768px) {
  .families-grid { grid-template-columns: 1fr; }
}

/* ==========================================
   Compare Page
   ========================================== */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.compare-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 20px; }
.compare-col h3 { font-size: 1.1rem; margin-bottom: 8px; }
.compare-section { margin-bottom: 32px; }
.compare-section h3 { font-size: 1rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.85rem; margin-bottom: 12px; }

.compare-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.compare-table th { text-align: left; padding: 10px 12px; color: var(--text-dim); font-size: 0.8rem; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.compare-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.compare-winner { color: var(--success); font-weight: 700; }

.compare-bench-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.compare-bench-label { width: 80px; font-size: 0.85rem; color: var(--text-muted); flex-shrink: 0; }
.compare-bench-bars { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.compare-bench-bar-wrap { display: flex; align-items: center; gap: 8px; }
.compare-bench-bar { height: 10px; border-radius: 5px; transition: width 0.8s ease; }
.compare-bench-bar-wrap span { font-size: 0.82rem; font-weight: 600; min-width: 36px; }

.compare-summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.compare-summary ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.compare-summary li { color: var(--text-muted); font-size: 0.9rem; padding-left: 16px; position: relative; }
.compare-summary li::before { content: '→'; position: absolute; left: 0; color: var(--accent); }

@media (max-width: 768px) {
  .compare-grid { grid-template-columns: 1fr; }
}

/* ==========================================
   Compare Tray (floating bottom bar)
   ========================================== */
.compare-tray {
  position: fixed; bottom: -100px; left: 0; right: 0; z-index: 1500;
  background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.6);
  transition: bottom 0.3s ease; padding: 12px 20px;
}
.compare-tray.active { bottom: 0; }
.tray-inner {
  max-width: var(--max-width); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.tray-models { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.tray-model {
  background: var(--bg); padding: 6px 12px; border-radius: 20px; font-size: 0.88rem;
  font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.tray-remove {
  background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 1rem;
  padding: 0 2px; transition: color var(--transition);
}
.tray-remove:hover { color: var(--danger); }
.tray-hint { color: var(--text-dim); font-size: 0.85rem; }
.tray-actions { display: flex; gap: 8px; align-items: center; }

/* ==========================================
   Compare Button on Cards
   ========================================== */
.compare-card-btn {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: 0.78rem; padding: 4px 10px; cursor: pointer;
  transition: all var(--transition); white-space: nowrap;
}
.compare-card-btn:hover { border-color: var(--primary); color: var(--primary-light); background: rgba(245,158,11,0.1); }

/* ==========================================
   Recently Added Section
   ========================================== */
.recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.recent-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: all var(--transition);
}
.recent-card:hover { transform: translateY(-2px); border-color: var(--success); box-shadow: 0 6px 20px rgba(16,185,129,0.1); }
.recent-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.recent-badge { font-size: 0.72rem; font-weight: 700; color: var(--success); text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.recent-time { font-size: 0.75rem; color: var(--text-dim); }
.recent-card h4 { font-size: 1rem; margin-bottom: 4px; }
.recent-creator { font-size: 0.82rem; color: var(--text-dim); margin-bottom: 8px; }
.recent-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.recent-ollama-tag {
  display: inline-block; margin-top: 8px; font-size: 0.75rem; font-family: 'SF Mono', 'Fira Code', monospace;
  background: var(--bg); padding: 3px 8px; border-radius: 6px; color: var(--accent);
}

.pulse-dot {
  display: inline-block; width: 8px; height: 8px; background: var(--success);
  border-radius: 50%; animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ==========================================
   Tabbed Installer
   ========================================== */
.install-guide-toggle { margin-top: 12px; }
.install-guide-toggle summary {
  cursor: pointer; color: var(--text-dim); font-size: 0.85rem; padding: 4px 0;
  transition: color var(--transition);
}
.install-guide-toggle summary:hover { color: var(--text-muted); }
.install-guide-toggle[open] summary { margin-bottom: 12px; }

.installer-tabs-container { margin-top: 8px; }
.installer-tab-bar { display: flex; gap: 4px; margin-bottom: 12px; }
.installer-tab {
  padding: 6px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-dim); font-size: 0.82rem;
  font-weight: 600; cursor: pointer; transition: all var(--transition);
}
.installer-tab:hover { color: var(--text); }
.installer-tab.active { background: var(--primary); border-color: var(--primary); color: white; }
.installer-panel { display: none; }
.installer-panel.active { display: block; }
.installer-panel code { font-size: 0.82rem; word-break: break-all; }

/* ==========================================
   About Page
   ========================================== */
.about-section {
  margin-bottom: 28px;
}

.about-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.about-section p {
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 0.95rem;
}

/* ==========================================
   FAQ Accordion
   ========================================== */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border: none;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  gap: 12px;
  transition: background var(--transition);
}

.accordion-trigger:hover {
  background: var(--surface-hover);
}

.accordion-icon {
  font-size: 1.2rem;
  color: var(--text-muted);
  flex-shrink: 0;
  line-height: 1;
}

.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.accordion-panel.open {
  max-height: 400px;
}

.accordion-body {
  padding: 16px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  border-top: 1px solid var(--border);
}

.accordion-body code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--accent);
}

/* ==========================================
   Family Cards
   ========================================== */
.family-grid,
.families-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 420px));
  gap: 16px;
  justify-content: center;
}

.family-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  border-left: 4px solid var(--primary);
  transition: all var(--transition);
}

.family-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-bright);
}

.family-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.family-emoji {
  font-size: 2rem;
  line-height: 1;
}

.family-card-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  flex: 1;
}

.family-count-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.25);
  color: var(--primary-light);
  border-radius: 12px;
  white-space: nowrap;
}

.family-creator {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.family-desc {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 14px;
}

.family-models-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.family-model-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background var(--transition);
}

.family-model-row:hover {
  background: var(--surface-hover);
}

.family-model-row .fm-name {
  flex: 1;
  font-weight: 600;
  color: var(--text);
}

.family-model-row .fm-params {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.family-best-for {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ==========================================
   Compare Tray
   ========================================== */
.compare-tray {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1500;
  background: rgba(17, 17, 17, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-bright);
  padding: 14px 20px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 16px;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.6);
  animation: traySlideUp 0.25s ease;
}

.compare-tray.visible,
.compare-tray.active {
  display: flex;
}

@keyframes traySlideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

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

/* Compare tray chip redesign (#26) — logo + name + per-chip remove */
.compare-tray-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.tray-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px 4px 10px;
  background: var(--surface);
  font-size: 0.85rem;
}
.tray-chip .creator-logo {
  height: 18px;
  width: auto;
  flex-shrink: 0;
}
.tray-chip-name {
  font-weight: 600;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tray-chip-remove {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  border-radius: 4px;
}
.tray-chip-remove:hover {
  color: var(--text);
  background: var(--border);
}
.compare-tray-vs {
  color: var(--text-dim);
  font-weight: 600;
}

.btn-compare {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-compare:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245,158,11,0.4);
}

.btn-compare-clear {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-compare-clear:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* Compare tray inner layout (app.js generated) */
.tray-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  max-width: var(--max-width);
}

.tray-models {
  display: flex;
  gap: 12px;
  align-items: center;
}

.tray-model {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
}

.tray-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 2px;
  line-height: 1;
}

.tray-remove:hover {
  color: var(--danger);
}

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

.tray-actions {
  display: flex;
  gap: 8px;
}

/* Compare button on model cards */
.btn-compare-add,
.compare-card-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-compare-add:hover,
.compare-card-btn:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: rgba(245,158,11,0.1);
}

.btn-compare-add.selected,
.compare-card-btn.selected {
  background: rgba(245,158,11,0.15);
  border-color: var(--primary);
  color: var(--primary-light);
}

/* ==========================================
   Compare Page
   ========================================== */
.compare-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

.compare-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.compare-col-header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.compare-col-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.compare-col-header .compare-creator {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.compare-section {
  margin-bottom: 20px;
}

.compare-section h4 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.compare-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.88rem;
}

.compare-stat-row .csr-label {
  color: var(--text-muted);
}

.compare-stat-row .csr-value {
  font-weight: 700;
  color: var(--text);
}

.compare-stat-row .csr-value.winner {
  color: var(--success);
}

.compare-bench-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.compare-bench-row .cb-label {
  width: 80px;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.compare-bench-row .cb-bar {
  flex: 1;
  height: 10px;
  background: var(--bg);
  border-radius: 5px;
  overflow: hidden;
}

.compare-bench-row .cb-bar-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.8s ease;
}

.compare-bench-row .cb-bar-fill.winner-bar {
  background: linear-gradient(90deg, var(--success), #34d399);
}

.compare-bench-row .cb-val {
  width: 40px;
  text-align: right;
  font-size: 0.82rem;
  font-weight: 600;
}

.compare-bench-row .cb-val.winner {
  color: var(--success);
}

.compare-install-cmd {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.82rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.compare-install-cmd .copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
  transition: all var(--transition);
}

.compare-install-cmd .copy-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.compare-verdict {
  background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(253,230,138,0.06));
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 32px;
}

.compare-verdict h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--primary-light);
}

.compare-verdict p {
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 0.92rem;
}

@media (max-width: 768px) {
  .compare-layout {
    grid-template-columns: 1fr;
  }

  .compare-tray {
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
  }

  .family-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .family-card {
    padding: 16px;
  }

  .compare-col {
    padding: 16px;
  }
}

/* ==========================================
   Like Button
   ========================================== */
.like-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 6px;
  border-radius: 8px;
  transition: all 0.2s ease;
  line-height: 1;
  opacity: 0.6;
}
.like-btn:hover { opacity: 1; transform: scale(1.15); }
.like-btn.liked { opacity: 1; animation: likePopIn 0.3s ease; }
.like-icon { pointer-events: none; }

@keyframes likePopIn {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.model-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ==========================================
   Light Mode
   ========================================== */
html.light {
  --primary: #b45309;
  --primary-light: #d97706;
  --primary-dark: #92400e;
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --bg: #ffffff;
  --bg-light: #fffbeb;
  --surface: #fefce8;
  --surface-2: #fef9c3;
  --surface-hover: #fef3c7;
  --text: #1c1917;
  --text-muted: #78716c;
  --text-dim: #78716c;
  --border: #e7e5e4;
  --border-bright: #d6d3d1;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --orange: #ea580c;
  --shadow: 0 4px 24px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.1);
}

html.light body {
  background: #ffffff;
  color: #1c1917;
}

html.light nav {
  background: rgba(255,255,255,0.92);
  border-bottom-color: #e7e5e4;
}

/* nav-logo now uses image, no gradient text needed */

html.light .nav-links a:hover,
html.light .nav-links a.active {
  background: rgba(180,83,9,0.08);
}
html.light .nav-links a.active {
  color: #b45309;
}

html.light .hero::before {
  opacity: 0.04;
}

html.light .hero h1 {
  background: linear-gradient(135deg, #1c1917 0%, #b45309 50%, #d97706 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

html.light .hero p {
  color: #78716c;
}

html.light .search-panel,
html.light .model-card,
html.light .modal,
html.light .trending-card,
html.light .new-model-card,
html.light .preset-card,
html.light .leaderboard-preview-row {
  background: #ffffff;
  border-color: #e7e5e4;
}

html.light .best-fit-hero .model-card {
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(180, 83, 9, 0.12);
}

html.light .best-fit-reasoning {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(180, 83, 9, 0.18);
}

html.light .best-fit-badge {
  color: #fff;
}

html.light .model-card:hover,
html.light .trending-card:hover,
html.light .preset-card:hover {
  border-color: #d6d3d1;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

html.light .preset-card.selected {
  background: rgba(180,83,9,0.06);
  border-color: #b45309;
}

html.light .form-group select,
html.light .form-group input[type="text"],
html.light .form-group input[type="number"] {
  background: #fffbeb;
  border-color: #e7e5e4;
  color: #1c1917;
}

html.light .form-group select option {
  background: #ffffff;
  color: #1c1917;
}

html.light .range-wrapper input[type="range"] {
  background: #e7e5e4;
}

html.light .install-cmd {
  background: #fefce8;
  border-color: #e7e5e4;
}

html.light .install-cmd span {
  color: #1c1917;
}

html.light .badge-no { background: rgba(220,38,38,0.08); color: #dc2626; border-color: rgba(220,38,38,0.2); }
html.light .badge-tight { background: rgba(217,119,6,0.08); color: #b45309; border-color: rgba(217,119,6,0.2); }
html.light .badge-good { background: rgba(22,163,74,0.08); color: #16a34a; border-color: rgba(22,163,74,0.2); }
html.light .badge-perfect { background: rgba(22,163,74,0.08); color: #16a34a; border-color: rgba(22,163,74,0.2); }

html.light .stat {
  border-color: #e7e5e4;
}
html.light .stat-avg { background: rgba(217, 119, 6, 0.06); border-left-color: rgba(217, 119, 6, 0.4); }
html.light .stat-avg .stat-value { color: #b45309; }
html.light .stat-ram { background: #fafaf9; border-left-color: #e7e5e4; }
html.light .stat-ram .stat-value { color: #57534e; }
html.light .stat-fit { background: #fafaf9; border-left-color: #e7e5e4; }
html.light .stat-fit-perfect { background: rgba(22, 163, 74, 0.06); border-left-color: #16a34a; }
html.light .stat-fit-perfect .stat-value { color: #16a34a; }
html.light .stat-fit-good { background: rgba(22, 163, 74, 0.06); border-left-color: #16a34a; }
html.light .stat-fit-good .stat-value { color: #16a34a; }
html.light .stat-fit-tight { background: rgba(217, 119, 6, 0.06); border-left-color: #b45309; }
html.light .stat-fit-tight .stat-value { color: #b45309; }
html.light .stat-fit-squeezed { background: rgba(217, 119, 6, 0.05); border-left-color: #b45309; }
html.light .stat-fit-squeezed .stat-value { color: #b45309; }
html.light .stat-fit-no { background: rgba(220, 38, 38, 0.06); border-left-color: #dc2626; }
html.light .stat-fit-no .stat-value { color: #dc2626; }

html.light .tab-btn {
  color: #78716c;
}

html.light .tab-btn.active {
  background: #b45309;
  color: #ffffff;
}

html.light .leaderboard-table th {
  background: #f9fafb;
  color: #78716c;
}

html.light .leaderboard-table td {
  border-bottom-color: #fefce8;
}

html.light .leaderboard-table tr:hover td {
  background: #fffbeb;
}

html.light .modal-overlay {
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

html.light .modal {
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

html.light .modal-header {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 60%, #fde68a 100%);
  border-bottom: 1px solid #e7e5e4;
}
html.light .modal-header h2 { color: #1c1917; }
html.light .modal-meta-line { color: #78716c; }
html.light .modal-header-cmd { background: #1c1917; }
html.light .modal-header-cmd code { color: #fbbf24; }

html.light .modal-blurb { color: #57534e; border-bottom-color: #f0efed; }
html.light .modal-body { background: #ffffff; }
html.light .modal-section { border-bottom-color: #f0efed; background: #ffffff; }
html.light .modal-section h3 { color: #78716c; }

html.light .bench-card {
  background: #fafaf9;
  border-color: #e7e5e4;
}
html.light .bench-card-score { color: #b45309; }
html.light .bench-card-score-sm { color: #b45309; }
html.light .bench-card-bar { background: #e7e5e4; }
html.light .bench-card-bar-fill {
  background: linear-gradient(90deg, #b45309, #d97706, #f59e0b);
}

html.light .quant-table { border-color: #e7e5e4; background: #ffffff; }
html.light .quant-table thead th { background: #fafaf9; }
html.light .quant-table td { background: #ffffff; }
html.light .quant-row-rec td { background: rgba(245,158,11,0.06); }
html.light .quant-row-rec td:first-child { border-left-color: #d97706; }
html.light .quant-rec-badge { background: linear-gradient(135deg, #d97706, #b45309); }

html.light .modal-install-block { background: #1c1917; border-color: #292524; }
html.light .modal-install-primary { border-bottom-color: #292524; }
html.light .modal-install-primary code { color: #fbbf24; }
html.light .modal-install-hint { border-top-color: #292524; }
html.light .modal-install-hint code { color: #fbbf24; }

html.light .use-case-chip {
  background: #fafaf9;
  border-color: #e7e5e4;
  color: #44403c;
}

html.light .related-link { color: #b45309; }
html.light .related-link:hover { color: #d97706; }

html.light .modal-vote-row { border-top-color: #f0efed; }

html.light footer {
  background: #fffbeb;
  border-top-color: #e7e5e4;
}

html.light .accordion-header {
  background: #fffbeb;
}

html.light .accordion-header:hover {
  background: #fefce8;
}

html.light .toast {
  background: #1c1917;
  color: #ffffff;
}

/* ==========================================
   Theme Toggle Button
   ========================================== */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: all 0.2s;
  color: var(--text);
  display: flex;
  align-items: center;
}
.theme-toggle:hover {
  border-color: var(--primary-light);
  background: var(--surface-hover);
}

/* ==========================================
   BUG FIX: Theme toggle visible on mobile
   ========================================== */
@media (max-width: 768px) {
  .theme-toggle {
    order: -1;
    margin-right: auto;
    margin-left: 12px;
  }
  .nav-inner {
    gap: 8px;
  }
}

/* ==========================================
   BUG FIX: Installer Tabs (modal)
   ========================================== */
.installer-tabs {
  margin-top: 12px;
}

.installer-tab-btns {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.installer-tab-btn {
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.installer-tab-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.installer-tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.installer-tabs .installer-panel {
  display: none;
}

.installer-tabs .installer-panel.active {
  display: block;
}

.installer-tabs .install-block {
  background: #0a0a0a;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
  padding: 14px 16px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.installer-tabs .install-block .copy-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  color: white;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition);
}

.installer-tabs .install-block .copy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

html.light .installer-tabs .install-block {
  background: #fefce8;
  border-left-color: var(--primary);
}

html.light .installer-tabs .install-block span {
  color: #1c1917;
}

/* ==========================================
   POLISH: Scroll Fade-In Animations
   ========================================== */
.fade-in-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}

.fade-in-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================
   POLISH: Card Hover Glow
   ========================================== */
.model-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.15), var(--shadow-lg);
  border-color: var(--primary);
}

.trending-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.12), var(--shadow);
  border-color: var(--primary);
}

.new-model-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15);
}

html.light .model-card:hover {
  box-shadow: 0 8px 32px rgba(180, 83, 9, 0.1), var(--shadow-lg);
}

/* ==========================================
   POLISH: Grainy Texture (dark mode only)
   ========================================== */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

html.light body::after {
  opacity: 0;
}

/* ==========================================
   POLISH: Smooth Page Transitions
   ========================================== */
.page {
  display: none;
  padding-top: 96px;
  padding-bottom: 80px;
  min-height: 100vh;
}

.page.active {
  display: block;
  animation: pageFadeIn 0.3s ease;
}

@keyframes pageFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==========================================
   POLISH: Gradient Text on Section Headers
   ========================================== */
.section-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

html.light .section-header h2 {
  background: linear-gradient(135deg, #1c1917 0%, #b45309 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================
   POLISH: Pulse Animation on LIVE + NEW badges
   ========================================== */
.freshness-live {
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
  50% { box-shadow: 0 0 8px 2px rgba(52, 211, 153, 0.3); }
}

.new-badge {
  animation: glowPulseGreen 2s ease-in-out infinite;
}

@keyframes glowPulseGreen {
  0%, 100% { text-shadow: 0 0 0 transparent; }
  50% { text-shadow: 0 0 6px rgba(52, 211, 153, 0.4); }
}

.ra-badge {
  animation: glowPulseGreen 2s ease-in-out infinite;
}

/* ==========================================
   POLISH: Better Mobile Spacing
   ========================================== */
@media (max-width: 480px) {
  .container {
    padding: 0 20px;
  }

  .model-card {
    padding: 16px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }

  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex-shrink: 0;
  }

  footer {
    padding: 48px 20px 56px;
  }

  footer .footer-links {
    gap: 16px;
  }
}

/* ==========================================
   POLISH: Code Blocks / Install Commands
   ========================================== */
.install-block,
.install-cmd {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
  border-left: 3px solid var(--primary);
}

code, pre {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
}

/* ==========================================
   POLISH: Stat Cards (modal req-items)
   ========================================== */
.req-item {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}

.req-item .req-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.req-item .req-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-light);
}

/* ==========================================
   Modal Meta Row (human-readable pills)
   ========================================== */
.modal-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.modal-meta-pill {
  font-size: 0.82rem;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  white-space: nowrap;
}

/* ==========================================
   Quantization Table (modal hardware section)
   ========================================== */
.quant-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.quant-table thead th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.quant-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.quant-table tbody tr:last-child { border-bottom: none; }
.quant-table tbody tr:hover {
  background: var(--surface-hover);
}
.quant-table td {
  padding: 14px 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.quant-table tbody tr:last-child td { border-bottom: none; }
.quant-name {
  font-weight: 700;
  color: var(--text);
  display: inline;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.85rem;
}
.quant-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: block;
  margin-top: 2px;
}
.quant-val {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  text-align: left;
  white-space: nowrap;
}
.quant-rec-badge {
  font-size: 0.6rem;
  font-weight: 700;
  font-family: var(--font);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 10px;
  padding: 3px 8px;
  margin-left: 8px;
  vertical-align: middle;
}
.quant-row-rec {
  background: rgba(var(--primary-rgb, 232, 160, 42), 0.06);
}
.quant-row-rec td:first-child {
  border-left: 3px solid var(--primary);
}

/* ==========================================
   Modal Cloud CTA Cards (affiliate)
   ========================================== */
.modal-cloud-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.modal-cloud-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.modal-cloud-card {
  display: block;
  padding: 18px 20px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid var(--border);
}
.modal-cloud-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
.modal-cloud-runpod {
  background: linear-gradient(135deg, #673ab7 0%, #9c27b0 100%);
  border-color: #673ab7;
}
.modal-cloud-vastai {
  background: linear-gradient(135deg, #00838f 0%, #00b4d8 100%);
  border-color: #00838f;
}
.modal-cloud-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}
.modal-cloud-tagline {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.8);
}
@media (max-width: 480px) {
  .modal-cloud-cards { grid-template-columns: 1fr; }
}

/* ==========================================
   Hover tooltip (ⓘ icon)
   ========================================== */
.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}
.info-tip-icon {
  font-size: 0.85rem;
  color: var(--text-dim);
  cursor: help;
  margin-left: 6px;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.info-tip:hover .info-tip-icon,
.info-tip:focus-within .info-tip-icon {
  opacity: 1;
  color: var(--primary);
}
.info-tip-content {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  max-width: 90vw;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-dim);
  text-transform: none;
  letter-spacing: normal;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  z-index: 100;
  pointer-events: none;
}
.info-tip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border);
}
.info-tip:hover .info-tip-content,
.info-tip:focus-within .info-tip-content {
  display: block;
}
.info-tip-content a {
  color: var(--primary);
  text-decoration: underline;
  pointer-events: auto;
}
.info-tip-content strong {
  color: var(--text);
}
/* For tips near the top of the modal, flip tooltip below */
.modal-header .info-tip-content {
  bottom: auto;
  top: calc(100% + 8px);
}
.modal-header .info-tip-content::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--border);
}
/* On mobile, anchor left to prevent overflow */
@media (max-width: 600px) {
  .info-tip-content {
    left: 0;
    transform: none;
    width: 280px;
  }
  .info-tip-content::after {
    left: 12px;
    transform: none;
  }
}

/* Use case pills (modal) */
.use-case-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.use-case-pill {
  font-size: 0.82rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
}

/* ==========================================
   About Feature Cards polish
   ========================================== */
.about-feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all var(--transition);
}

.about-feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.about-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 768px) {
  .about-features-grid {
    grid-template-columns: 1fr;
  }
}

.about-feature-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.about-feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.about-feature-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.about-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.about-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.about-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}

.about-step h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

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

/* ==========================================
   FAQ Page (standalone styling)
   ========================================== */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 20px;
  background: var(--surface);
  border: none;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  gap: 12px;
  transition: background var(--transition);
}

.faq-question:hover {
  background: var(--surface-hover);
}

.faq-chevron {
  font-size: 0.7rem;
  transition: transform 0.3s ease;
  color: var(--text-dim);
  flex-shrink: 0;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer {
  max-height: 500px;
}

.faq-answer-inner {
  padding: 16px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  border-top: 1px solid var(--border);
}

.faq-answer-inner a {
  color: var(--accent);
}

.faq-answer-inner code {
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--accent);
}

/* ==========================================
   Recently Added Section
   ========================================== */
.recently-added-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.recently-added-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
}

.recently-added-card:hover {
  transform: translateY(-2px);
  border-color: var(--success);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.1);
}

.ra-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ra-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--success);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ra-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.ra-dot-header {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
  margin-right: 6px;
}

.ra-time {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.recently-added-card h4 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.ra-creator {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.ra-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ollama-chip {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.75rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  background: var(--bg);
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--accent);
}

/* ==========================================
   Compare Page Header Grid
   ========================================== */
.compare-header-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 32px;
}

.compare-vs {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text-dim);
  text-align: center;
}

.compare-model-col {
  text-align: center;
}

.compare-model-col h3 {
  font-size: 1.3rem;
}

.compare-creator {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.compare-ram-header,
.compare-bench-header {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
}

.compare-ram-row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.88rem;
}

.compare-ram-label {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.compare-bench-val {
  font-weight: 600;
  font-size: 0.82rem;
}

.compare-bench-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compare-bench-bar {
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.8s ease;
}

.compare-ctx-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.compare-ctx-val {
  font-weight: 700;
  font-size: 1rem;
  display: block;
  margin-bottom: 6px;
}

.compare-ctx-bar {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

@media (max-width: 768px) {
  .compare-header-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .compare-ram-header,
  .compare-bench-header,
  .compare-ram-row {
    grid-template-columns: 60px 1fr 1fr;
    font-size: 0.78rem;
  }
}

/* ==========================================
   Install guide details (on model cards)
   ========================================== */
.install-guide-details {
  display: inline-flex;
  align-items: stretch;
}

/* Equalize Compare and Full install guide button sizes on the card */
.model-card-actions > .btn,
.model-card-actions > .install-guide-details {
  flex: 1 1 0;
}

.model-card-actions > .install-guide-details > summary {
  width: 100%;
  justify-content: center;
}

.model-card-actions > .compare-btn {
  justify-content: center;
}

.install-guide-details summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  height: 100%;
}

.install-guide-details summary::-webkit-details-marker {
  display: none;
}

.install-guide-details[open] {
  margin-top: 4px;
}

/* ==========================================
   Nav Logo Image
   ========================================== */
.nav-logo-img {
  height: 28px;
  width: auto;
  display: block;
}
.nav-logo-light { display: none; }
.nav-logo-dark { display: block; }

html.light .nav-logo-dark { display: none; }
html.light .nav-logo-light { display: block; }

@media (max-width: 480px) {
  .nav-logo-img { height: 24px; }
}

/* ==========================================
   Compare Tray — Better Styling
   ========================================== */
.tray-vs {
  color: var(--primary-light);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tray-model {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.25);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

.tray-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
}
.tray-remove:hover { color: var(--danger); }

.tray-models {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.tray-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.tray-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.tray-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .tray-inner {
    flex-direction: column;
    gap: 10px;
  }
  .tray-models {
    justify-content: center;
  }
}

/* ==========================================
   Filter Panel (Search Results)
   ========================================== */
.filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.filter-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 20px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.filter-toggle:hover {
  background: var(--surface-hover);
}

.filter-toggle-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 10px;
  min-width: 20px;
  text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: 20px;
  white-space: nowrap;
}

.filter-chevron {
  font-size: 0.7rem;
  color: var(--text-dim);
  transition: transform 0.3s ease;
}

.filter-panel.open .filter-chevron {
  transform: rotate(180deg);
}

.filter-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-panel.open .filter-body {
  max-height: 600px;
}

.filter-inner {
  padding: 0 20px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Filter pill toggles */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill {
  display: inline-flex;
  cursor: pointer;
  user-select: none;
}

.filter-pill input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.filter-pill span {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.filter-pill:hover span {
  border-color: var(--primary);
  color: var(--text);
}

.filter-pill input:checked + span {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.filter-pill:active span {
  transform: scale(0.95);
}

.filter-select {
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  transition: border-color var(--transition);
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

.filter-select option {
  background: #111;
  color: var(--text);
}

.filter-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 4px 0;
}

.filter-toggle-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.filter-toggle-row .toggle {
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.filter-toggle-row .toggle-slider::before {
  width: 16px;
  height: 16px;
}

.filter-toggle-row .toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* RAM range slider in filters */
.filter-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-range input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  outline: none;
}

.filter-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
}

.filter-range input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.filter-range-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 45px;
  text-align: right;
}

/* ==========================================
   Leaderboard Filters
   ========================================== */
.lb-filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.lb-filter-bar select {
  padding: 6px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.82rem;
}

.lb-filter-bar select option {
  background: #111;
  color: var(--text);
}

.lb-filter-bar label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ==========================================
   Squeeze Mode
   ========================================== */
.badge-squeezed {
  background: rgba(245,158,11,0.15);
  color: var(--warning);
  border: 1px solid rgba(245,158,11,0.3);
}

.squeeze-info {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.15);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.squeeze-icon {
  display: inline-block;
  margin-right: 4px;
}

.squeeze-options {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.squeeze-option {
  font-size: 0.75rem;
  padding: 3px 8px;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 12px;
  color: var(--primary-light);
  white-space: nowrap;
}

.squeeze-option.best {
  background: rgba(16,185,129,0.12);
  border-color: rgba(16,185,129,0.25);
  color: var(--success);
}

.squeeze-warning {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 6px;
  font-style: italic;
}

/* ==========================================
   Model Blurb
   ========================================== */
.model-blurb {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.4;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.model-blurb-full {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

/* ==========================================
   View Counter / Trending
   ========================================== */
.view-count {
  font-size: 0.72rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

.view-count-icon {
  font-size: 0.68rem;
  opacity: 0.7;
}

.trending-home-section {
  padding: 0 20px;
  max-width: var(--max-width);
  margin: 0 auto 40px;
}

.trending-home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.trending-home-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
}

.trending-home-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.trending-home-rank {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary-light);
  min-width: 28px;
}

.trending-home-info h4 {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.trending-home-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  gap: 8px;
  align-items: center;
}

.trending-indicator {
  color: var(--success);
  font-weight: 700;
  font-size: 0.72rem;
}

/* ==========================================
   Filter & Squeeze Responsive
   ========================================== */
@media (max-width: 768px) {
  .filter-inner {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .lb-filter-bar {
    gap: 8px;
  }

  .lb-filter-bar label {
    flex: 1;
    min-width: 120px;
  }

  .trending-home-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .filter-inner {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .lb-filter-bar {
    flex-direction: column;
  }

  .trending-home-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   Light Mode — new features
   ========================================== */
html.light .lb-filter-bar select {
  background: #fef9c3;
  border-color: var(--border);
}

html.light .lb-filter-bar select option {
  background: #fff;
  color: var(--text);
}

html.light .lb-filter-bar {
  background: #fff;
}

html.light .squeeze-info {
  background: rgba(180,83,9,0.06);
  border-color: rgba(180,83,9,0.15);
}

html.light .trending-home-card {
  background: #fff;
}

/* ==========================================
   Badge: Squeezed (amber gradient)
   ========================================== */
.badge-squeezed {
  background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(217,119,6,0.15));
  color: var(--warning);
  border: 1px solid rgba(245,158,11,0.35);
}

html.light .badge-squeezed {
  background: linear-gradient(135deg, rgba(217,119,6,0.12), rgba(180,83,9,0.08));
  color: #b45309;
  border-color: rgba(180,83,9,0.25);
}

.squeeze-subtext {
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 0 0 8px;
  line-height: 1.4;
}

/* ==========================================
   Estimated Benchmarks
   ========================================== */
.est-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: super;
}

.est-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 6px;
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.2);
  color: var(--primary-light);
  border-radius: 8px;
  margin-left: 4px;
  vertical-align: middle;
}

/* Bug #64: show raw → adjusted scout score on estimated cards/leaderboard rows */
.score-est-note {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
  text-align: center;
}
.score-est-note strong { color: var(--text); }
.est-pill {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0 5px;
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.25);
  color: var(--primary-light);
  border-radius: 6px;
  vertical-align: middle;
}
.score-raw-strike {
  color: var(--text-muted);
  text-decoration: line-through;
  margin-right: 4px;
  font-weight: 500;
}

.bench-unavailable {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-style: italic;
}

.bench-unavailable-msg {
  color: var(--text-dim);
  font-size: 0.9rem;
  font-style: italic;
  padding: 12px 0;
}

.bench-estimated-disclaimer {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(245,158,11,0.06);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

html.light .bench-estimated-disclaimer {
  background: rgba(180,83,9,0.08);
  color: #57534e;
}

.lb-row-estimated {
  opacity: 0.75;
}

.lb-row-estimated:hover {
  opacity: 1;
}

.lb-est-high {
  opacity: 0.85;
}

.lb-est-low {
  opacity: 0.6;
}

.est-band {
  font-size: 0.6rem;
  color: var(--text-dim);
  font-weight: 500;
  vertical-align: super;
  margin-left: 1px;
}

.est-badge-low {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.2);
  color: #f87171;
}

.bar-fill-estimated {
  opacity: 0.7;
  background: linear-gradient(90deg, var(--primary), var(--primary-light)) !important;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 4px,
    rgba(0,0,0,0.08) 4px,
    rgba(0,0,0,0.08) 8px
  ) !important;
}

.lb-estimated-toggle {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

/* ==========================================
   Filter Panel: Light Mode
   ========================================== */
html.light .filter-panel {
  background: #fff;
  border-color: var(--border);
}

html.light .filter-pill span {
  border-color: var(--border);
  color: var(--text-muted);
}

html.light .filter-pill input:checked + span {
  background: linear-gradient(135deg, #b45309, #92400e);
  border-color: #b45309;
  color: white;
}

html.light .filter-select {
  background: #fef9c3;
  border-color: var(--border);
}

html.light .filter-select option {
  background: #fff;
  color: var(--text);
}

html.light .filter-badge {
  background: linear-gradient(135deg, #b45309, #92400e);
}

html.light .est-badge {
  background: rgba(180,83,9,0.08);
  border-color: rgba(180,83,9,0.15);
  color: #b45309;
}

html.light .est-badge-low {
  background: rgba(220,38,38,0.08);
  border-color: rgba(220,38,38,0.15);
  color: #dc2626;
}

/* ==========================================
   Filter Panel: Mobile Collapse
   ========================================== */
@media (max-width: 768px) {
  .filter-inner {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .filter-toggle-left {
    font-size: 0.88rem;
  }

  .filter-pills {
    gap: 5px;
  }

  .filter-pill span {
    padding: 5px 11px;
    font-size: 0.78rem;
  }
}

/* ==========================================
   Welcome-Back Banner (Saved Hardware)
   ========================================== */
.welcome-banner {
  max-width: 800px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(245,158,11,0.03));
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius);
  padding: 16px 20px;
  animation: bannerSlideDown 0.3s ease;
}

@keyframes bannerSlideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.welcome-banner.banner-dismiss {
  animation: bannerSlideUp 0.3s ease forwards;
}

@keyframes bannerSlideUp {
  from { opacity: 1; transform: translateY(0); max-height: 120px; margin-bottom: 20px; }
  to { opacity: 0; transform: translateY(-12px); max-height: 0; margin-bottom: 0; padding: 0; overflow: hidden; }
}

.welcome-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.welcome-banner-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.welcome-hw-emoji {
  font-size: 1.5rem;
}

.welcome-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

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

.welcome-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.welcome-search-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
  white-space: nowrap;
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px 8px;
  transition: color var(--transition);
}
.btn-link:hover {
  color: var(--text);
}

@media (max-width: 600px) {
  .welcome-banner {
    padding: 12px 16px;
  }
  .welcome-banner-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .welcome-banner-actions {
    width: 100%;
  }
  .welcome-search-btn {
    flex: 1;
  }
}

/* ==========================================
   Community Vote Buttons (Thumbs Up/Down)
   ========================================== */
.vote-btns {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.vote-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  transition: all 0.15s ease;
  color: var(--text-muted);
  line-height: 1;
}

.vote-btn:hover {
  border-color: var(--border-bright);
  transform: scale(1.05);
}

.vote-btn .vote-icon {
  font-size: 0.9rem;
  pointer-events: none;
}

.vote-btn .vote-count {
  font-size: 0.75rem;
  pointer-events: none;
  min-width: 0;
}

.vote-btn.vote-up.voted {
  background: rgba(245,158,11,0.15);
  border-color: var(--primary);
  color: var(--primary-light);
}

.vote-btn.vote-down.voted {
  background: rgba(239,68,68,0.15);
  border-color: var(--danger);
  color: var(--danger);
}

.vote-btn.vote-pop {
  animation: votePop 0.3s ease;
}

@keyframes votePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* Larger vote buttons in modal */
.modal-vote-section {
  margin-top: 12px;
}

.modal-vote-btns {
  display: flex;
  gap: 8px;
}

.vote-btn-lg {
  padding: 8px 16px;
  font-size: 1rem;
  border-radius: var(--radius);
}

.vote-btn-lg .vote-icon {
  font-size: 1.15rem;
}

.vote-btn-lg .vote-count {
  font-size: 0.9rem;
  font-weight: 600;
}

.modal-vote-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.vote-stat-sep {
  color: var(--text-dim);
}

@media (max-width: 600px) {
  .vote-btn {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    padding: 6px 10px;
  }
  .vote-btn-lg {
    min-width: 54px;
    min-height: 44px;
    padding: 8px 14px;
  }
}

/* Light theme overrides for votes */
:root.light .vote-btn {
  border-color: #d1d5db;
}
:root.light .vote-btn:hover {
  border-color: #9ca3af;
}
:root.light .vote-btn.vote-up.voted {
  background: rgba(245,158,11,0.12);
}
:root.light .vote-btn.vote-down.voted {
  background: rgba(239,68,68,0.1);
}
:root.light .welcome-banner {
  background: linear-gradient(135deg, rgba(245,158,11,0.06), rgba(245,158,11,0.02));
  border-color: rgba(245,158,11,0.2);
}

/* ==========================================
   CLS Fix — Reserve space for async sections
   ========================================== */
#home-trending { min-height: 280px; }
#home-recently-added { min-height: 200px; }
#home-engagement-trending { min-height: 180px; }

/* Prevent layout shift from fade-in animations */
.fade-in-section {
  will-change: opacity, transform;
  contain: layout style;
}

/* Loading skeleton stays same size as final content */
.loading { min-height: 200px; }

@media (max-width: 768px) {
  #home-trending { min-height: 240px; }
  #home-recently-added { min-height: 160px; }
  #home-engagement-trending { min-height: 140px; }
}

/* ==========================================
   Quiz — "What's the Move?"
   ========================================== */
.quiz-page {
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px 60px;
  background: radial-gradient(ellipse at center, rgba(245,158,11,0.04) 0%, transparent 70%);
}

/* Progress dots with labels */
.quiz-progress {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  margin-bottom: 40px;
}
.quiz-dot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.quiz-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--text-dim);
  border: 2px solid var(--border);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.quiz-dot.active {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
  box-shadow: 0 0 16px rgba(245,158,11,0.4);
  transform: scale(1.1);
}
.quiz-dot.done {
  background: var(--primary-dark);
  color: #000;
  border-color: var(--primary-dark);
}
.quiz-dot-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  transition: color 0.3s;
}
.quiz-dot.active ~ .quiz-dot-label,
.quiz-dot-wrap:has(.quiz-dot.active) .quiz-dot-label { color: var(--primary); }
.quiz-dot-wrap:has(.quiz-dot.done) .quiz-dot-label { color: var(--primary-dark); }
.quiz-dot-line {
  width: 28px;
  height: 2px;
  background: var(--border);
  transition: background 0.3s ease;
  margin-top: 15px;
  flex-shrink: 0;
}
.quiz-dot-line.done {
  background: var(--primary-dark);
}

/* Step — slide animations */
.quiz-step {
  text-align: center;
  max-width: 600px;
  width: 100%;
  animation: quizSlideForward 0.35s ease;
}
.quiz-step.quiz-slide-back {
  animation: quizSlideBack 0.35s ease;
}
@keyframes quizSlideForward {
  from { opacity: 0; transform: translateX(60px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes quizSlideBack {
  from { opacity: 0; transform: translateX(-60px); }
  to { opacity: 1; transform: translateX(0); }
}
.quiz-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 32px;
  color: var(--text);
}

/* Option cards */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.quiz-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  width: 100%;
  position: relative;
}
.quiz-option:hover {
  border-color: var(--primary);
  background: rgba(245,158,11,0.06);
  transform: scale(1.02);
}
.quiz-option.selected {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
  transform: scale(1.03);
}
.quiz-option.selected::after {
  content: '\2713';
  margin-left: auto;
  font-size: 1.2rem;
  font-weight: 700;
  color: #000;
  animation: checkPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes checkPop {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.quiz-option.selected .quiz-option-text span {
  color: rgba(0,0,0,0.6);
}
.quiz-option-emoji {
  font-size: 1.6rem;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}
.quiz-option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.quiz-option-text strong {
  font-size: 1rem;
  font-weight: 700;
}
.quiz-option-text span {
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: color 0.15s;
}
.quiz-back {
  margin-top: 24px;
  padding: 8px 20px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  transition: all 0.15s;
}
.quiz-back:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

/* Result page */
.quiz-result-page {
  justify-content: flex-start;
  padding-top: 100px;
}
.quiz-result-container {
  max-width: 560px;
  width: 100%;
}
.quiz-result-container > * {
  opacity: 0;
  animation: quizFadeUp 0.5s ease forwards;
}
.quiz-result-container > *:nth-child(1) { animation-delay: 0s; }
.quiz-result-container > *:nth-child(2) { animation-delay: 0.12s; }
.quiz-result-container > *:nth-child(3) { animation-delay: 0.24s; }
@keyframes quizFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Result card */
.quiz-result-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--primary-dark);
  border-radius: var(--radius-lg);
  padding: 36px 28px 28px;
  text-align: center;
  box-shadow: 0 0 60px rgba(245,158,11,0.1), 0 0 20px rgba(245,158,11,0.05);
}
.quiz-result-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.quiz-result-name {
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary-light), var(--primary), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  line-height: 1.2;
}
.quiz-result-why {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
  text-align: left;
}

/* Gauge */
.quiz-gauge {
  margin: 12px auto 8px;
  text-align: center;
  width: 120px;
}
.quiz-scout-score {
  text-align: center;
  margin-bottom: 16px;
}
.quiz-score-value {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}
.quiz-score-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-top: 2px;
}
.quiz-gauge-svg { width: 120px; height: 70px; display: block; margin: 0 auto; }
.gauge-fill { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.gauge-fill.perfect { stroke: var(--success); }
.gauge-fill.good { stroke: var(--success); }
.gauge-fill.tight { stroke: var(--warning); }
.gauge-fill.squeezed { stroke: var(--danger); }
.gauge-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 2px;
}
.gauge-label.badge-perfect, .gauge-label.badge-good { color: var(--success); }
.gauge-label.badge-tight { color: var(--warning); }
.gauge-label.badge-squeezed { color: var(--danger); }

/* Spec badges */
.quiz-result-specs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
  margin-bottom: 16px;
  font-size: 0.85rem;
}
.quiz-spec {
  display: inline-block;
  padding: 5px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.quiz-spec.badge-perfect {
  background: rgba(34,197,94,0.12);
  border-color: rgba(34,197,94,0.3);
  color: var(--success);
}
.quiz-spec.badge-good {
  background: rgba(34,197,94,0.08);
  border-color: rgba(34,197,94,0.2);
  color: var(--success);
}
.quiz-spec.badge-tight {
  background: rgba(245,158,11,0.1);
  border-color: rgba(245,158,11,0.25);
  color: var(--warning);
}
.quiz-spec.badge-squeezed {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.25);
  color: var(--danger);
}

/* Strengths / Watch out */
.quiz-strengths {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0;
  text-align: left;
}
.quiz-great-at, .quiz-watch-out {
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
}
.quiz-great-at { border-left: 3px solid var(--success); }
.quiz-watch-out { border-left: 3px solid var(--warning); }
.quiz-strengths h3 {
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.quiz-great-at h3 { color: var(--success); }
.quiz-watch-out h3 { color: var(--warning); }
.quiz-strengths ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.quiz-strengths li { padding: 3px 0; }
.quiz-strengths li::before { margin-right: 6px; font-weight: 700; }
.quiz-great-at li::before { content: '+'; color: var(--success); }
.quiz-watch-out li::before { content: '!'; color: var(--warning); }

/* Benchmark bars */
.quiz-benchmarks {
  margin: 20px 0;
  text-align: left;
}
.quiz-benchmarks h3 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}
.bench-est {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.bench-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.bench-label {
  width: 72px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
  flex-shrink: 0;
}
.bench-track {
  flex: 1;
  height: 10px;
  background: var(--surface-2);
  border-radius: 5px;
  overflow: hidden;
}
.bench-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  border-radius: 5px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}
.bench-val {
  width: 38px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

/* Install tabs */
.quiz-install {
  margin: 20px 0;
}
.quiz-install-tabs {
  display: flex;
  gap: 0;
}
.install-tab {
  flex: 1;
  padding: 8px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.install-tab:first-child { border-radius: var(--radius-sm) 0 0 0; border-right: none; }
.install-tab:last-child { border-radius: 0 var(--radius-sm) 0 0; }
.install-tab.active {
  background: var(--bg);
  color: var(--primary-light);
  border-bottom-color: var(--bg);
}
.quiz-install .install-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  color: var(--primary-light);
  word-break: break-all;
}

/* Comparison table */
.quiz-comparison {
  margin-top: 24px;
  width: 100%;
}
.quiz-comparison h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
  text-align: center;
}
.quiz-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.quiz-compare-table th {
  padding: 10px 14px;
  border-bottom: 2px solid var(--border);
  text-align: center;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--surface-2);
}
.quiz-compare-table th:first-child { text-align: left; }
.quiz-compare-table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  color: var(--text);
}
.quiz-compare-table td:first-child {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.82rem;
}
.quiz-compare-table td:nth-child(2) {
  color: var(--primary-light);
  font-weight: 700;
}
.quiz-compare-table tr:last-child td { border-bottom: none; }
.quiz-compare-table a { color: var(--text); text-decoration: none; }
.quiz-compare-table a:hover { color: var(--primary-light); }

/* Next steps */
.quiz-next-steps {
  margin-top: 24px;
  text-align: left;
}
.quiz-next-steps h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
.quiz-next-steps ul { list-style: none; padding: 0; margin: 0; }
.quiz-next-steps li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.quiz-next-steps li:last-child { border-bottom: none; }
.quiz-next-steps a {
  color: var(--primary-light);
  font-size: 0.88rem;
  text-decoration: none;
}
.quiz-next-steps a:hover { text-decoration: underline; }

/* Actions */
.quiz-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* Retake */
.quiz-retake {
  margin-top: 28px;
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
}

/* Mobile */
@media (max-width: 600px) {
  .quiz-title { font-size: 1.4rem; }
  .quiz-option { padding: 14px 16px; }
  .quiz-option-emoji { font-size: 1.4rem; width: 32px; }
  .quiz-result-card { padding: 24px 16px 20px; }
  .quiz-result-name { font-size: 1.5rem; }
  .quiz-result-container { max-width: 100%; }
  .quiz-dot { width: 26px; height: 26px; font-size: 0.68rem; }
  .quiz-dot-line { width: 12px; }
  .quiz-dot-label { font-size: 0.58rem; }
  .quiz-strengths { grid-template-columns: 1fr; }
  .quiz-compare-table { font-size: 0.78rem; }
  .quiz-compare-table th, .quiz-compare-table td { padding: 6px 8px; }
  .bench-label { width: 60px; font-size: 0.72rem; }
}

/* Light mode overrides */
:root.light .quiz-option {
  background: #fff;
  border-color: #e5e7eb;
}
:root.light .quiz-option:hover {
  background: rgba(245,158,11,0.06);
  border-color: var(--primary);
}
:root.light .quiz-option.selected {
  background: var(--primary);
  color: #000;
}
:root.light .quiz-result-card {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 60px rgba(245,158,11,0.08);
}
:root.light .quiz-install .install-block {
  background: #f9fafb;
  border-color: #e5e7eb;
}
:root.light .install-tab {
  background: #f3f4f6;
  border-color: #e5e7eb;
}
:root.light .install-tab.active {
  background: #f9fafb;
  border-bottom-color: #f9fafb;
}
:root.light .quiz-spec {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #6b7280;
}
:root.light .quiz-great-at, :root.light .quiz-watch-out {
  background: #f9fafb;
}
:root.light .quiz-compare-table {
  background: #fff;
  border-color: #e5e7eb;
}
:root.light .quiz-compare-table th { background: #f3f4f6; }
:root.light .bench-track { background: #f3f4f6; }

/* ==========================================
   Ticker Bar
   ========================================== */
.ticker {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  height: 32px;
  overflow: hidden;
  z-index: 999;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.ticker-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: tickerScroll 60s linear infinite;
  will-change: transform;
}

.ticker-track:hover {
  animation-play-state: paused;
}

.ticker-item {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0 24px;
  cursor: default;
  letter-spacing: 0.01em;
}

a.ticker-item {
  cursor: pointer;
  transition: color var(--transition);
}

a.ticker-item:hover {
  color: var(--primary-light);
}

.ticker-sep {
  font-size: 0.5rem;
  color: var(--border-bright);
  padding: 0 12px;
  user-select: none;
}

@keyframes tickerScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (max-width: 768px) {
  .ticker-item {
    font-size: 0.7rem;
  }
  .ticker-sep {
    padding: 0 6px;
  }
}

html.light .ticker {
  background: var(--surface);
  border-bottom-color: var(--border);
}

/* ==========================================
   Ticker Labels — Color coded
   ========================================== */
.ticker-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
}
.ticker-trending {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.ticker-new {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

html.light .ticker-trending {
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.2);
}
html.light .ticker-new {
  background: rgba(22, 163, 74, 0.08);
  color: #16a34a;
  border-color: rgba(22, 163, 74, 0.2);
}

/* Make model names in ticker slightly brighter */
a.ticker-item {
  color: var(--text);
}

/* ==========================================
   Hot Right Now — pills + expandable details
   ========================================== */
.hot-cards-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  margin-bottom: 8px;
  scroll-snap-type: x mandatory;
}

.hot-card {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  min-width: 220px;
  max-width: 280px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

.hot-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.1);
}

.hot-card-top {
  margin-bottom: 6px;
}

.hot-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
}
.hot-label-new { background: rgba(34,197,94,0.12); color: #4ade80; }
.hot-label-community { background: rgba(245,158,11,0.12); color: #fbbf24; }

.hot-card-name {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.3;
  margin-bottom: 6px;
}

.hot-card-blurb {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hot-card-meta {
  color: var(--text-dim);
  font-size: 0.72rem;
  margin-top: auto;
}

@media (max-width: 480px) {
  .hot-cards-grid { gap: 10px; }
  .hot-card { min-width: 200px; padding: 12px 14px; }
  .hot-card-name { font-size: 0.85rem; }
}

/* Expanded detail panel */
.hot-details-wrap {
  position: relative;
}

.hot-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin 0.35s ease;
  opacity: 0;
  margin: 0;
}

.hot-detail.open {
  max-height: 400px;
  opacity: 1;
  margin: 12px 0;
}

.hot-detail-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
}

.hot-detail-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  z-index: 1;
}

.hot-detail-close:hover {
  color: var(--text);
}

.hot-detail-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.hot-detail-header strong {
  font-size: 1.1rem;
}

.hot-detail-creator {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.hot-detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}

.hot-fit {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
}

.hot-fit-yes {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.hot-fit-tight {
  background: rgba(245, 158, 11, 0.12);
  color: var(--primary);
}

.hot-fit-no {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.hot-blurb {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.5;
}

.hot-install {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 10px;
}

.hot-install code {
  flex: 1;
  font-size: 0.82rem;
  color: var(--accent);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.hot-detail-link {
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.hot-detail-link:hover {
  text-decoration: underline;
}

/* ==========================================
   Quick Stats Bar
   ========================================== */
.quick-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  flex-wrap: wrap;
}

.quick-stat {
  font-size: 0.88rem;
  color: var(--text-dim);
  text-decoration: none;
}

a.quick-stat:hover {
  color: var(--primary);
}

.quick-stat strong {
  color: var(--text-muted);
  font-weight: 700;
}

.quick-stat-sep {
  color: var(--border-bright);
  font-size: 0.8rem;
}

/* ==========================================
   Home Navigation Cards
   ========================================== */
.home-nav-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding-bottom: 40px;
}

.home-nav-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
  cursor: pointer;
}

.home-nav-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.home-nav-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.home-nav-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-nav-text strong {
  font-size: 1rem;
  font-weight: 700;
}

.home-nav-text span {
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* ==========================================
   Responsive — Hero action cards, pills, nav
   ========================================== */
@media (max-width: 768px) {
  .hero-action-cards {
    grid-template-columns: 1fr;
    max-width: 400px;
  }

  .hero-action-card {
    padding: 18px;
  }

  .home-nav-cards {
    grid-template-columns: 1fr;
  }

  .hot-card-old {
    font-size: 0.8rem;
    padding: 6px 12px;
  }

  .quick-stats {
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .hero-action-cards {
    max-width: 100%;
  }

  .quick-stats {
    flex-direction: column;
    gap: 4px;
  }

  .quick-stat-sep {
    display: none;
  }
}

/* ==========================================
   Light Mode — Homepage redesign
   ========================================== */
html.light .hero-action-card {
  background: #ffffff;
  border-color: #e7e5e4;
  border-left-color: #b45309;
}

html.light .hero-action-card:hover {
  border-color: #d6d3d1;
  border-left-color: #d97706;
  box-shadow: 0 8px 32px rgba(180, 83, 9, 0.1);
}

html.light .hot-card {
  background: #ffffff;
  border-color: #e7e5e4;
  color: #1c1917;
}

html.light .hot-card:hover,
html.light .hot-card.active {
  border-color: #b45309;
  background: #fffbeb;
}

html.light .hot-card-stat {
  color: #78716c;
}

html.light .hot-detail-inner {
  background: #ffffff;
  border-color: #e7e5e4;
  border-left-color: #b45309;
}

html.light .hot-install {
  background: #fafaf9;
  border-color: #e7e5e4;
}

html.light .home-nav-card {
  background: #ffffff;
  border-color: #e7e5e4;
}

html.light .home-nav-card:hover {
  border-color: #d6d3d1;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

html.light .quick-stat {
  color: #78716c;
}

html.light .quick-stat strong {
  color: #44403c;
}

html.light a.quick-stat:hover {
  color: #b45309;
}

/* ==========================================
   Hot Split — Two columns side by side
   ========================================== */
.hot-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.hot-col-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.hot-col-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s ease;
}
.hot-row:hover {
  background: var(--surface-hover);
}

.hot-row-name {
  font-weight: 600;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 12px;
}

.hot-row-meta {
  color: var(--text-dim);
  font-size: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .hot-split {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Creator Logos */
.creator-logo {
  height: 18px;
  width: auto;
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 6px;
  filter: drop-shadow(0 0 3px rgba(255,255,255,0.25));
}

/* ==========================================
   Scout v2 — Recommended Cards (Gold/Silver/Bronze)
   ========================================== */

.recommended-section {
  margin-bottom: 32px;
}

.recommended-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.recommended-cards {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  padding: 0 16px;
}
/* Podium row: #2 and #3 side by side */
.recommended-podium-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
  max-width: 1100px;
  align-items: stretch;
}
.recommended-podium-row > * {
  display: flex;
  flex-direction: column;
}
.recommended-podium-row .recommended-silver,
.recommended-podium-row .recommended-bronze {
  flex: 1;
  display: flex;
}
.recommended-podium-row .recommended-silver .model-card,
.recommended-podium-row .recommended-bronze .model-card {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.recommended-podium-row .model-card .model-card-actions {
  margin-top: auto !important;
}
@media (max-width: 640px) {
  .recommended-podium-row {
    grid-template-columns: 1fr;
  }
}

/* -- Gold (#1) — the champion -- */
.recommended-gold {
  max-width: 1100px;
  width: 100%;
}
.recommended-gold .model-card {
  padding: 36px 40px;
  border: 2px solid #f59e0b;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.35), 0 0 60px rgba(245, 158, 11, 0.15);
  animation: goldGlow 3s ease-in-out infinite;
  position: relative;
}
.recommended-gold .model-card:hover {
  box-shadow: 0 0 50px rgba(245, 158, 11, 0.5), 0 0 80px rgba(245, 158, 11, 0.2);
}
.recommended-gold .model-card h3 {
  font-size: 1.5rem;
}
.recommended-gold .model-card .model-stats,
.recommended-gold .score-ram-row {
  gap: 16px;
  margin-bottom: 20px;
  margin-top: 12px;
}
.recommended-gold .stat-value {
  font-size: 1.7rem;
}
.recommended-gold .ram-value {
  font-size: 1.8rem;
}
.recommended-gold .score-gauge {
  width: 110px;
  height: 66px;
}
.recommended-gold .model-meta-row {
  font-size: 0.85rem;
  gap: 6px 18px;
  margin-top: 8px;
  margin-bottom: 16px;
}
.recommended-gold .install-cmd {
  margin-top: 16px !important;
}

/* -- Silver (#2) -- */
.recommended-silver {
  width: 100%;
}
.recommended-silver .model-card {
  padding: 24px 28px;
  border: 2px solid #94a3b8;
  box-shadow: 0 0 16px rgba(148, 163, 184, 0.12);
  height: 100%;
}
.recommended-silver .model-card:hover {
  box-shadow: 0 0 28px rgba(148, 163, 184, 0.22);
  border-color: #94a3b8;
}
.recommended-silver .model-card h3 {
  font-size: 1.15rem;
}

/* -- Bronze (#3) -- */
.recommended-bronze {
  width: 100%;
}
.recommended-bronze .model-card {
  padding: 24px 28px;
  border: 2px solid #cd7f32;
  box-shadow: 0 0 14px rgba(205, 127, 50, 0.10);
  height: 100%;
}
.recommended-bronze .model-card:hover {
  box-shadow: 0 0 24px rgba(205, 127, 50, 0.20);
  border-color: #cd7f32;
}
.recommended-bronze .model-card h3 {
  font-size: 1.15rem;
}

/* -- Rank badges -- */
.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.rank-badge-gold {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #000;
}
.rank-badge-silver {
  background: linear-gradient(135deg, #64748b, #94a3b8);
  color: #000;
}
.rank-badge-bronze {
  background: linear-gradient(135deg, #a0622d, #cd7f32);
  color: #000;
}

/* -- Fit explanation (why this model was recommended) -- */
.fit-explanation {
  font-size: 0.8rem;
  color: var(--success);
  margin-top: 4px;
  margin-bottom: 4px;
  font-weight: 500;
  opacity: 0.9;
}

/* -- Install commands: fully clickable for copy -- */
.install-cmd span,
.install-block span {
  cursor: pointer;
}
.install-cmd:hover span,
.install-block:hover span {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

/* -- Gold glow animation -- */
@keyframes goldGlow {
  0%, 100% {
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.35), 0 0 60px rgba(245, 158, 11, 0.15);
  }
  50% {
    box-shadow: 0 0 50px rgba(245, 158, 11, 0.5), 0 0 90px rgba(245, 158, 11, 0.2), 0 0 120px rgba(245, 158, 11, 0.08);
  }
}

/* -- Recommended reasoning -- */
.recommended-reasoning {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
}
.recommended-gold .recommended-reasoning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.recommended-silver .recommended-reasoning {
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.recommended-bronze .recommended-reasoning {
  background: rgba(205, 127, 50, 0.08);
  border: 1px solid rgba(205, 127, 50, 0.2);
}
.recommended-reasoning strong {
  color: var(--primary-light);
  font-weight: 700;
}

/* -- Scout Score display -- */
.scout-score {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.scout-score-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-light);
}
.scout-score-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==========================================
   Variants Section
   ========================================== */
.variants-section {
  margin-top: 28px;
  margin-bottom: 28px;
}

.variants-group {
  margin-bottom: 20px;
}

.variants-group-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.variant-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.variant-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
}
.variant-pill:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
}
.variant-type-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}
.variant-type-uncensored { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.variant-type-coding { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.variant-type-reasoning-distill { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.variant-type-vision { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.variant-type-variant { background: rgba(148, 163, 184, 0.12); color: #94a3b8; }

/* ==========================================
   Inline Variant Pills on Recommended Cards
   ========================================== */
.card-variants {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.card-variant-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 4px;
  width: 100%;
  margin-bottom: 2px;
}
.card-variant-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.7rem;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
}
.card-variant-pill .variant-type-tag {
  font-size: 0.6rem;
  padding: 1px 5px;
  margin: 0;
}
.card-variant-pill:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
}
.variant-pill-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.68rem;
}
.recommended-podium-row .variant-pill-name {
  max-width: 100px;
}
.variant-pill-score {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
}
.variant-score-green {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}
.variant-score-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}
.variant-score-red {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
html.light .card-variant-pill {
  background: #ffffff;
  border-color: #e7e5e4;
}
html.light .card-variant-pill:hover {
  border-color: #b45309;
}

/* Variant guidance — community merge chip + estimation pill inside the score */
.card-variant-hint {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 6px;
  cursor: help;
}
.variant-est-pill {
  font-size: 0.6rem;
  margin-left: 4px;
  opacity: 0.85;
}
.card-variant-pill.variant-conf-low    { border-left: 2px solid #ef4444; }
.card-variant-pill.variant-conf-medium { border-left: 2px solid #f59e0b; }
.card-variant-pill.variant-conf-high   { border-left: 2px solid #22c55e; }

/* ==========================================
   More Results Section
   ========================================== */
.scroll-more-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 0 8px;
  color: var(--text-muted);
  opacity: 0.55;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: opacity 0.4s ease;
  cursor: default;
}
.scroll-more-indicator.hidden {
  opacity: 0;
  pointer-events: none;
}
.scroll-more-arrow {
  font-size: 1.1rem;
  animation: scrollBounce 2s ease-in-out infinite;
}
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

.more-results-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
  margin-top: 8px;
}

/* ==========================================
   Light mode overrides for recommended
   ========================================== */
html.light .recommended-gold .model-card {
  border-color: #d97706;
  box-shadow: 0 0 20px rgba(217, 119, 6, 0.15);
}
html.light .recommended-silver .model-card {
  border-color: #64748b;
  box-shadow: 0 0 14px rgba(100, 116, 139, 0.10);
}
html.light .recommended-bronze .model-card {
  border-color: #a0622d;
  box-shadow: 0 0 14px rgba(160, 98, 45, 0.10);
}
html.light .rank-badge-gold { color: #fff; }
html.light .rank-badge-silver { color: #fff; }
html.light .rank-badge-bronze { color: #fff; }
html.light .fit-explanation { color: #16a34a; }
html.light .recommended-gold .recommended-reasoning {
  background: rgba(217, 119, 6, 0.06);
  border-color: rgba(217, 119, 6, 0.18);
}
html.light .recommended-silver .recommended-reasoning {
  background: rgba(100, 116, 139, 0.06);
  border-color: rgba(100, 116, 139, 0.18);
}
html.light .recommended-bronze .recommended-reasoning {
  background: rgba(160, 98, 45, 0.06);
  border-color: rgba(160, 98, 45, 0.18);
}
html.light .variant-pill {
  background: #ffffff;
  border-color: #e7e5e4;
}
html.light .variant-pill:hover {
  border-color: #b45309;
}

@keyframes goldGlowLight {
  0%, 100% {
    box-shadow: 0 0 20px rgba(217, 119, 6, 0.15);
  }
  50% {
    box-shadow: 0 0 36px rgba(217, 119, 6, 0.25), 0 0 52px rgba(217, 119, 6, 0.08);
  }
}
html.light .recommended-gold .model-card {
  animation: goldGlowLight 3s ease-in-out infinite;
}

/* Responsive: recommended cards */
@media (max-width: 768px) {
  .recommended-gold,
  .recommended-silver,
  .recommended-bronze {
    max-width: 100%;
  }
  .recommended-gold .model-card {
    padding: 20px;
  }
  .recommended-gold .model-card h3 {
    font-size: 1.15rem;
  }
  .recommended-gold .stat-value {
    font-size: 1.25rem;
  }
  .recommended-silver .model-card,
  .recommended-bronze .model-card {
    padding: 18px;
  }
}

@media (max-width: 480px) {
  .recommended-cards {
    gap: 14px;
  }
  .variant-pills {
    gap: 6px;
  }
  .variant-pill {
    font-size: 0.78rem;
    padding: 5px 10px;
  }
}

/* ==========================================
   MOBILE UX OVERHAUL
   Comprehensive responsive fixes for 64% mobile traffic.
   All rules scoped to media queries — desktop unchanged.
   ========================================== */

/* ------------------------------------------
   1. NAVIGATION — better hamburger + mobile menu
   ------------------------------------------ */
@media (max-width: 768px) {
  nav {
    padding: 0 12px;
  }

  .nav-hamburger {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    -webkit-tap-highlight-color: transparent;
  }

  .nav-links {
    background: rgba(0, 0, 0, 0.97);
    padding: 8px 12px 16px;
    gap: 2px;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }

  .nav-links a {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 14px 16px;
    font-size: 1rem;
    border-radius: var(--radius-sm);
  }

  .nav-links a:active {
    background: rgba(245, 158, 11, 0.15);
  }

  .theme-toggle {
    min-width: 44px;
    min-height: 44px;
    font-size: 1.2rem;
  }
}

/* ------------------------------------------
   2. PRESET / HARDWARE SELECTION — larger cards, better grid
   ------------------------------------------ */
@media (max-width: 768px) {
  .preset-card {
    padding: 14px 16px;
    min-height: 56px;
    gap: 12px;
    -webkit-tap-highlight-color: transparent;
  }

  .preset-card:active {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.4);
    transform: scale(0.98);
  }

  .preset-emoji {
    font-size: 1.6rem;
  }

  .preset-info strong {
    font-size: 0.9rem;
  }

  .preset-info span {
    font-size: 0.78rem;
  }

  .preset-row {
    gap: 10px;
  }

  .preset-search-input {
    padding: 12px 40px 12px 14px;
    font-size: 0.9rem;
    min-height: 48px;
  }

  .preset-search-clear {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    right: 2px;
    font-size: 1.4rem;
  }

  .platform-tab {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 0.82rem;
  }

  .mode-tab {
    min-height: 44px;
    padding: 12px 16px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .preset-card {
    padding: 14px;
    gap: 10px;
  }

  .platform-tab {
    flex: 1;
    text-align: center;
    min-height: 44px;
  }
}

/* ------------------------------------------
   3. TIER SECTIONS — obvious tappable headers with feedback
   ------------------------------------------ */
@media (max-width: 768px) {
  .tier-label {
    font-size: 0.82rem;
    padding: 12px 8px;
    margin-bottom: 4px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
  }

  .tier-label:active {
    background: rgba(245, 158, 11, 0.08);
  }

  .tier-chevron {
    font-size: 0.8rem;
    width: 1.2em;
    transition: transform 0.2s ease;
  }

  .tier-count {
    font-size: 0.72rem;
    margin-left: 4px;
  }
}

/* ------------------------------------------
   4. MODEL CARDS — full width, larger touch targets
   ------------------------------------------ */
@media (max-width: 768px) {
  .model-card {
    -webkit-tap-highlight-color: transparent;
  }

  /* Disable hover transform on touch — it causes jank */
  .model-card:hover {
    transform: none;
  }

  .model-card:active {
    border-color: var(--primary);
    background: var(--surface-hover);
  }

  .model-card-header {
    gap: 8px;
  }

  .vote-pill-btn {
    min-width: 44px;
    min-height: 36px;
    padding: 6px 10px;
  }

  .score-cell,
  .ram-cell {
    padding: 12px 8px;
  }

  .score-ram-row {
    gap: 8px;
  }

  .model-card .install-cmd {
    padding: 10px 12px;
    min-height: 44px;
  }

  .install-cmd .copy-btn {
    min-width: 44px;
    min-height: 36px;
    padding: 6px 10px;
    font-size: 0.82rem;
  }

  .model-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
  }

  .model-card-actions .btn {
    min-height: 44px;
    flex: 1;
    justify-content: center;
    font-size: 0.85rem;
  }

  .install-guide-details summary {
    min-height: 44px;
    padding: 0 12px;
  }

  .model-blurb {
    font-size: 0.82rem;
    margin-top: 8px;
    margin-bottom: 4px;
  }
}

@media (max-width: 480px) {
  .score-ram-row {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .ram-value {
    font-size: 1.2rem;
  }

  .model-meta-row {
    gap: 3px 10px;
    font-size: 0.74rem;
  }

  .meta-label-sm {
    font-size: 0.62rem;
  }
}

/* ------------------------------------------
   5. MODAL — full-screen on mobile, touch-friendly
   ------------------------------------------ */
@media (max-width: 768px) {
  .modal-overlay {
    padding: 0;
    align-items: stretch;
  }

  .modal-overlay.active {
    align-items: stretch;
  }

  .modal {
    max-width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    border: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-close {
    width: 44px;
    height: 44px;
    top: 12px;
    right: 12px;
    font-size: 1.4rem;
    z-index: 20;
    background: var(--surface-2);
    border: 1px solid var(--border-bright);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  .modal-close:active {
    background: var(--danger);
    transform: scale(0.95);
  }

  .modal-header {
    padding: 16px 16px 14px;
    padding-top: max(16px, env(safe-area-inset-top, 16px));
  }

  .modal-header h2 {
    font-size: 1.15rem;
    padding-right: 48px;
    line-height: 1.3;
  }

  .modal-meta-line {
    font-size: 0.8rem;
    line-height: 1.5;
  }

  .modal-header-cmd {
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .modal-header-cmd code {
    font-size: 0.75rem;
    word-break: break-all;
  }

  .modal-copy-cmd {
    min-height: 40px;
    min-width: 44px;
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  .modal-body {
    padding: 16px 16px 40px;
    padding-bottom: max(40px, env(safe-area-inset-bottom, 40px));
  }

  /* Benchmark grid in modal */
  .scout-bench-grid {
    flex-direction: column;
    gap: 12px;
  }

  .scout-bench-cards {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .bench-mini-card {
    padding: 10px 8px;
    font-size: 0.78rem;
  }

  /* Quant table in modal */
  .quant-table {
    font-size: 0.82rem;
  }

  .quant-table th,
  .quant-table td {
    padding: 10px 8px;
  }

  .quant-name {
    font-size: 0.82rem;
  }

  .quant-sub {
    font-size: 0.7rem;
  }

  /* Modal install block */
  .modal-install-primary {
    padding: 12px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .modal-install-primary code {
    font-size: 0.75rem;
    word-break: break-all;
  }

  .modal-install-primary .copy-btn {
    min-height: 40px;
    min-width: 44px;
    padding: 8px 14px;
  }

  /* Use-case tags */
  .usecase-tags {
    gap: 6px;
  }

  .usecase-tag {
    padding: 6px 10px;
    font-size: 0.78rem;
    min-height: 36px;
  }

  /* Related models in modal */
  .related-model-link {
    min-height: 44px;
    padding: 10px 12px;
  }

  /* Installer tabs in modal and cards */
  .installer-tab-btns {
    flex-wrap: wrap;
    gap: 4px;
  }

  .installer-tab-btn {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 0.8rem;
    flex: 1;
    text-align: center;
  }

  .install-block {
    padding: 10px 12px;
    font-size: 0.78rem;
    word-break: break-all;
  }

  .install-block .copy-btn {
    min-width: 44px;
    min-height: 36px;
  }
}

/* ------------------------------------------
   6. SEARCH PANEL — mobile-friendly controls
   ------------------------------------------ */
@media (max-width: 768px) {
  .search-panel {
    padding: 20px 16px;
    margin: 0 0 20px;
    border-radius: var(--radius-sm);
  }

  .search-panel h2 {
    font-size: 1.25rem;
    margin-bottom: 16px;
  }

  /* Sort controls — horizontally scrollable */
  .sort-controls {
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 6px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .sort-controls::-webkit-scrollbar {
    display: none;
  }

  .sort-btn {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 0.82rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Filter panel */
  .filter-toggle {
    min-height: 48px;
    padding: 12px 16px;
    font-size: 0.9rem;
  }

  .filter-body {
    padding: 12px;
  }

  .filter-pills {
    gap: 6px;
  }

  .filter-pill {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  .filter-pill input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }

  .filter-select {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .filter-group-label {
    font-size: 0.82rem;
    margin-bottom: 8px;
  }

  /* Custom hardware form */
  .custom-hw-form select,
  .custom-hw-form input[type="number"] {
    min-height: 48px;
    font-size: 1rem;
    padding: 10px 14px;
  }

  .custom-hw-form label {
    font-size: 0.9rem;
  }
}

/* ------------------------------------------
   7. TOGGLE SWITCHES — larger hit areas on mobile
   ------------------------------------------ */
@media (max-width: 768px) {
  .toggle {
    width: 52px;
    height: 30px;
    min-width: 52px;
  }

  .toggle-slider {
    border-radius: 15px;
  }

  .toggle-slider::before {
    width: 24px;
    height: 24px;
    left: 2px;
    bottom: 2px;
  }

  .toggle input:checked + .toggle-slider::before {
    transform: translateX(22px);
  }

  .toggle-wrapper {
    min-height: 44px;
    gap: 14px;
  }

  .filter-toggle-row {
    min-height: 48px;
    padding: 8px 0;
    gap: 12px;
  }

  .filter-toggle-row .toggle {
    width: 48px;
    height: 28px;
    min-width: 48px;
  }

  .filter-toggle-row .toggle-slider::before {
    width: 22px;
    height: 22px;
  }

  .filter-toggle-row .toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
  }

  .filter-toggle-label {
    font-size: 0.9rem;
  }
}

/* ------------------------------------------
   8. RECOMMENDED SECTION — prominent cards with clear CTAs
   ------------------------------------------ */
@media (max-width: 768px) {
  .recommended-section {
    margin-bottom: 24px;
  }

  .recommended-section-title {
    font-size: 1rem;
    margin-bottom: 12px;
    text-align: center;
  }

  .recommended-cards {
    padding: 0 4px;
    gap: 16px;
  }

  .recommended-gold .model-card {
    padding: 20px 16px;
    border-width: 2px;
  }

  .recommended-gold .model-card h3 {
    font-size: 1.1rem;
  }

  .recommended-silver .model-card,
  .recommended-bronze .model-card {
    padding: 16px;
  }

  .rank-badge {
    font-size: 0.75rem;
    padding: 5px 12px;
  }

  .fit-explanation {
    font-size: 0.82rem;
    padding: 6px 0;
  }

  /* Make recommended install cmd more prominent */
  .recommended-gold .install-cmd,
  .recommended-silver .install-cmd,
  .recommended-bronze .install-cmd {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.2);
    padding: 12px 14px;
    min-height: 48px;
  }

  /* Prominent CTA on recommended cards */
  .recommended-gold .model-card-actions .btn,
  .recommended-silver .model-card-actions .btn,
  .recommended-bronze .model-card-actions .btn {
    min-height: 48px;
    font-size: 0.9rem;
    font-weight: 600;
  }

  /* Variant pills — touch-friendly */
  .card-variants {
    margin-top: 8px;
  }

  .card-variant-pill {
    min-height: 40px;
    padding: 8px 12px;
  }

  .variant-pills {
    gap: 8px;
  }

  .variant-pill {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  /* Scroll indicator — more visible on mobile */
  .scroll-more-indicator {
    padding: 24px 0 12px;
    font-size: 0.85rem;
    opacity: 0.7;
  }

  .scroll-more-arrow {
    font-size: 1.3rem;
  }

  .more-results-label {
    text-align: center;
    font-size: 0.9rem;
    margin-top: 12px;
    margin-bottom: 16px;
  }
}

@media (max-width: 480px) {
  .recommended-podium-row {
    gap: 12px;
  }

  .recommended-gold .model-card {
    padding: 16px 14px;
  }

  .recommended-gold .stat-value {
    font-size: 1.15rem;
  }
}

/* ------------------------------------------
   9. LEADERBOARD — scroll hints + better mobile table
   ------------------------------------------ */
@media (max-width: 768px) {
  /* Wrap table in a scrollable container */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 0 16px;
    position: relative;
  }

  /* Scroll shadow hint on right edge */
  .table-wrapper::after {
    content: '';
    position: sticky;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.3));
    flex-shrink: 0;
  }

  .leaderboard-table {
    min-width: 550px;
    font-size: 0.8rem;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 10px 8px;
    white-space: nowrap;
  }

  .leaderboard-table th:first-child,
  .leaderboard-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 5;
    background: var(--surface);
  }

  /* Make rows tappable */
  .leaderboard-table tbody tr {
    -webkit-tap-highlight-color: transparent;
  }

  .leaderboard-table tbody tr:active {
    background: var(--surface-hover);
  }

  .model-name-cell {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Leaderboard tabs — scroll horizontally */
  .tabs {
    gap: 6px;
    padding-bottom: 4px;
  }

  .tab-btn {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 0.85rem;
  }

  /* Estimated toggle */
  .lb-estimated-toggle {
    margin-bottom: 12px;
  }

  .lb-estimated-toggle .filter-pill {
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .leaderboard-table {
    min-width: 480px;
    font-size: 0.75rem;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 8px 6px;
  }

  .model-name-cell {
    max-width: 120px;
    font-size: 0.78rem;
  }
}

/* ------------------------------------------
   10. QUIZ — mobile-first refinements
   ------------------------------------------ */
@media (max-width: 768px) {
  .quiz-page {
    padding: 72px 16px 40px;
    justify-content: flex-start;
    padding-top: max(72px, calc(64px + env(safe-area-inset-top, 8px)));
  }

  .quiz-progress {
    margin-bottom: 28px;
  }

  .quiz-dot {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }

  .quiz-dot-line {
    width: 28px;
  }

  .quiz-title {
    font-size: 1.5rem;
    margin-bottom: 24px;
  }

  .quiz-options {
    gap: 10px;
  }

  .quiz-option {
    min-height: 56px;
    padding: 14px 16px;
    gap: 14px;
    font-size: 0.95rem;
    -webkit-tap-highlight-color: transparent;
  }

  .quiz-option:hover {
    transform: none; /* disable hover transform on touch */
  }

  .quiz-option:active {
    border-color: var(--primary);
    background: rgba(245, 158, 11, 0.1);
    transform: scale(0.98);
  }

  .quiz-option-emoji {
    font-size: 1.5rem;
    width: 36px;
    flex-shrink: 0;
  }

  .quiz-option-text strong {
    font-size: 0.95rem;
  }

  .quiz-option-text span {
    font-size: 0.82rem;
  }

  .quiz-back-btn {
    min-height: 44px;
    min-width: 44px;
    margin-top: 20px;
  }

  /* Quiz result page */
  .quiz-result-card {
    padding: 28px 16px 24px;
    margin: 0;
    max-width: 100%;
  }

  .quiz-result-badge {
    font-size: 2.5rem;
  }

  .quiz-result-name {
    font-size: 1.5rem;
    word-break: break-word;
  }

  .quiz-result-why {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .quiz-result-specs {
    flex-wrap: wrap;
    gap: 6px;
  }

  .quiz-spec {
    font-size: 0.82rem;
    padding: 6px 10px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }

  .quiz-install .install-block {
    padding: 12px;
    min-height: 48px;
  }

  .quiz-actions {
    flex-direction: column;
    gap: 8px;
  }

  .quiz-actions .btn {
    min-height: 48px;
    width: 100%;
    justify-content: center;
    font-size: 0.95rem;
  }

  .quiz-share-btn {
    min-height: 48px;
    padding: 12px 20px;
  }

  .quiz-runner-up {
    font-size: 0.85rem;
    padding: 12px;
  }

  .quiz-see-all {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    font-size: 0.95rem;
    padding: 10px 0;
  }

  .quiz-retake {
    font-size: 0.85rem;
    padding: 12px 0;
  }

  .quiz-retake a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
  }
}

@media (max-width: 480px) {
  .quiz-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
  }

  .quiz-dot {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
  }

  .quiz-dot-line {
    width: 20px;
  }

  .quiz-result-name {
    font-size: 1.3rem;
  }

  .quiz-result-badge {
    font-size: 2rem;
  }
}

/* ------------------------------------------
   11. COMPARE PAGE — stack on mobile
   ------------------------------------------ */
@media (max-width: 768px) {
  .compare-header-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    text-align: center;
  }

  .compare-bench-row,
  .compare-ram-row {
    font-size: 0.82rem;
  }

  .compare-page-actions .btn {
    min-height: 44px;
  }
}

/* ------------------------------------------
   12. GENERAL MOBILE TOUCH IMPROVEMENTS
   ------------------------------------------ */
@media (max-width: 768px) {
  /* All buttons get minimum 44px tap target */
  .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn-sm {
    min-height: 40px;
    padding: 8px 14px;
  }

  .btn-lg {
    min-height: 52px;
    font-size: 1rem;
  }

  .copy-btn {
    min-width: 44px;
    min-height: 36px;
    padding: 6px 12px;
  }

  /* Disable hover effects on touch (they stick on mobile) */
  .trending-card:hover {
    transform: none;
  }

  .trending-card:active {
    border-color: var(--primary);
    background: var(--surface-hover);
  }

  /* Links in content should have adequate tap targets */
  .footer-links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
  }

  /* Hero action cards */
  .hero-action-card {
    min-height: 56px;
    padding: 16px;
  }

  /* Home nav cards */
  .nav-card {
    min-height: 56px;
  }

  /* Comparison tray at bottom */
  .compare-tray {
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
  }

  .compare-tray .btn {
    min-height: 44px;
  }

  /* Badge adjustments */
  .badge {
    font-size: 0.72rem;
    padding: 4px 10px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
  }

  /* FAQ accordion on mobile */
  .accordion-trigger {
    min-height: 52px;
    padding: 14px 16px;
    font-size: 0.9rem;
  }

  .accordion-body {
    padding: 14px 16px;
    font-size: 0.85rem;
  }

  /* Welcome banner */
  .welcome-banner {
    padding: 14px 16px;
    font-size: 0.9rem;
  }

  /* Container less padding on mobile */
  .container {
    padding: 0 12px;
  }

  /* Footer extra bottom for home indicator */
  footer {
    padding: 28px 0 40px;
    padding-bottom: max(40px, env(safe-area-inset-bottom, 40px));
  }

  /* Prevent text from being too small */
  input, select, textarea {
    font-size: 16px; /* prevents iOS zoom on focus */
  }
}

/* ------------------------------------------
   13. LIGHT MODE MOBILE OVERRIDES
   ------------------------------------------ */
@media (max-width: 768px) {
  html.light .nav-links {
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid #e7e5e4;
  }

  html.light .tier-label {
    background: rgba(0, 0, 0, 0.02);
  }

  html.light .tier-label:active {
    background: rgba(245, 158, 11, 0.06);
  }

  html.light .preset-card:active {
    background: rgba(245, 158, 11, 0.08);
  }

  html.light .leaderboard-table th:first-child,
  html.light .leaderboard-table td:first-child {
    background: #ffffff;
  }

  html.light .modal-close {
    background: #f5f5f4;
    border-color: #e7e5e4;
  }
}

/* ------------------------------------------
   14. SAFE AREA INSETS (notch phones)
   ------------------------------------------ */
@supports (padding: env(safe-area-inset-top)) {
  @media (max-width: 768px) {
    nav {
      padding-left: max(12px, env(safe-area-inset-left));
      padding-right: max(12px, env(safe-area-inset-right));
    }

    .container {
      padding-left: max(12px, env(safe-area-inset-left));
      padding-right: max(12px, env(safe-area-inset-right));
    }
  }
}

/* ------------------------------------------
   15. SEARCH RESULTS PAGE — better spacing
   ------------------------------------------ */
@media (max-width: 768px) {
  #page-search {
    padding-top: 0;
  }

  #search-panel {
    padding-top: 16px !important;
  }

  .results-info {
    font-size: 0.85rem;
    margin-bottom: 12px;
  }

  .card-grid {
    gap: 12px;
  }
}

/* ------------------------------------------
   16. FAMILIES PAGE — mobile grid
   ------------------------------------------ */
@media (max-width: 768px) {
  .family-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .family-card {
    padding: 16px;
    min-height: 56px;
    -webkit-tap-highlight-color: transparent;
  }

  .family-card:active {
    background: var(--surface-hover);
  }
}

/* ------------------------------------------
   17. BEST-FOR LANDING PAGES
   ------------------------------------------ */
.bf-index-container { padding-top: 32px; padding-bottom: 48px; }
.bf-page-container { padding-top: 24px; padding-bottom: 48px; max-width: 960px; margin: 0 auto; }

.bf-breadcrumb { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 16px; }
.bf-breadcrumb a { color: var(--primary); text-decoration: none; }
.bf-breadcrumb a:hover { text-decoration: underline; }
.bf-breadcrumb span { margin: 0 6px; }

.bf-hero { margin-bottom: 24px; }
.bf-hero h1 { font-size: 2rem; margin-bottom: 8px; }
.bf-hero-sub { color: var(--text-dim); font-size: 1.05rem; line-height: 1.5; }

.bf-section-title {
  font-size: 1.3rem;
  margin: 32px 0 16px;
  color: var(--primary);
}

.bf-specs {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}
.bf-spec { display: flex; flex-direction: column; gap: 2px; }
.bf-spec-label { font-size: 0.75rem; text-transform: uppercase; color: var(--text-dim); letter-spacing: 0.5px; }
.bf-spec-value { font-size: 1.1rem; font-weight: 600; }

/* Index page grid */
.bf-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.bf-index-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}
.bf-index-card:hover { border-color: var(--primary); background: var(--surface-hover); }
.bf-index-card-sm { padding: 10px 14px; }
.bf-index-emoji { font-size: 1.5rem; flex-shrink: 0; }
.bf-index-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bf-index-info strong { font-size: 0.95rem; }
.bf-index-info span { font-size: 0.8rem; color: var(--text-dim); }
.bf-index-fits { color: var(--primary) !important; font-weight: 600; }

.bf-tier-section { margin-top: 24px; }
.bf-tier-title { font-size: 1.1rem; margin-bottom: 12px; color: var(--text-dim); }

/* Detail page table */
.bf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.bf-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}
.bf-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.bf-row { cursor: pointer; transition: background 0.15s; }
.bf-row:hover { background: var(--surface-hover); }
.bf-rank { font-weight: 700; width: 40px; text-align: center; }
.bf-rank.top-3 { color: var(--primary); font-size: 1.1rem; }
.bf-model-name strong { display: block; }
.bf-model-meta { font-size: 0.78rem; color: var(--text-dim); }
.bf-score { font-weight: 700; color: var(--primary); }
.bf-ram { white-space: nowrap; }
.bf-install-code {
  font-size: 0.78rem;
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--text);
  word-break: break-all;
}
.bf-table-compact th, .bf-table-compact td { padding: 8px 10px; }

.bf-more { margin-top: 16px; }
.bf-more summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
  padding: 8px 0;
}

/* Related hardware */
.bf-related { margin-top: 32px; }
.bf-related h3 { margin-bottom: 12px; }
.bf-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.bf-related-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s;
}
.bf-related-card:hover { border-color: var(--primary); }
.bf-related-card strong { display: block; font-size: 0.9rem; }
.bf-related-card span { font-size: 0.8rem; color: var(--text-dim); }

.bf-cta {
  margin-top: 32px;
  text-align: center;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.bf-cta p { color: var(--text-dim); margin-bottom: 0; }
.bf-cta a { color: var(--primary); }
.bf-cta .btn { margin: 0 6px; }

@media (max-width: 768px) {
  .bf-hero h1 { font-size: 1.5rem; }
  .bf-index-grid { grid-template-columns: 1fr; }
  .bf-specs { flex-direction: column; gap: 12px; }
  .bf-table { font-size: 0.8rem; }
  .bf-table .bf-install { display: none; }
  .bf-table .bf-bench { display: none; }
  .bf-related-grid { grid-template-columns: 1fr; }
}
