/* Distilled Science Dashboard Styles - Style Guide v1.1 Compliant */

/* ============================================
   1. CSS Variables - Distilled Science Tokens
   ============================================ */

:root {
  /* Core Surfaces */
  --bg-main: #0E0F12;
  --surface-1: #13151B;
  --surface-2: #181B22;
  --border-soft: #202636;

  /* Text */
  --text-hi: #E9ECF1;
  --text-lo: #B9C1CC;

  /* Brand Accents */
  --accent-purple: #4B1BEE;
  --accent-teal: #2EEED3;
  --accent-magenta: #FF3FD1;

  /* Risk Colors */
  --risk-green: rgba(74, 222, 128, 0.2);
  --risk-yellow: rgba(250, 204, 21, 0.2);
  --risk-red: rgba(248, 113, 113, 0.2);

  --risk-green-line: rgba(74, 222, 128, 0.55);
  --risk-yellow-line: rgba(250, 204, 21, 0.55);
  --risk-red-line: rgba(248, 113, 113, 0.55);

  /* Gradients */
  --heat-start: #4B1BEE;
  --heat-end: #2EEED3;

  /* Typography */
  --fs-h1: clamp(2.2rem, 4vw, 3.0rem);
  --fs-h2: clamp(1.6rem, 2.7vw, 2.0rem);
  --fs-h3: 1.25rem;
  --fs-body: 1.0625rem;
  --fs-small: 0.8125rem;

  /* Spacing */
  --space-section-mobile: 40px;
  --space-section-desktop: 56px;
  --space-card-padding: 24px;
}

/* ============================================
   2. Base Styles
   ============================================ */

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-main);
  color: var(--text-lo);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   3. Layout
   ============================================ */

.container {
  max-width: 1248px; /* 20% wider: 1040 * 1.2 = 1248 */
  margin: 0 auto;
  padding: 0 24px;
}

.content-wrapper {
  display: flex;
  gap: 2rem;
  position: relative;
}

.main-content {
  flex: 1;
  min-width: 0; /* Prevents flex item from overflowing */
}

.sidebar-toc {
  width: 220px;
  flex-shrink: 0;
}

.toc-sticky {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.toc-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-hi);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-item {
  margin-bottom: 0.5rem;
}

.toc-link {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text-lo);
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s ease;
  border-left: 2px solid transparent;
}

.toc-link:hover {
  color: var(--text-hi);
  background: rgba(255, 255, 255, 0.05);
}

.toc-link.active {
  color: var(--primary);
  background: rgba(16, 185, 129, 0.1);
  border-left-color: var(--primary);
  font-weight: 600;
}

/* Sidebar view controls */
.toc-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 1.5rem 0;
}

.sidebar-view-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sidebar-view-btn {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-lo);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.sidebar-view-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-hi);
  border-color: rgba(255, 255, 255, 0.25);
}

.sidebar-view-btn.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary);
  border-color: var(--primary);
}

.sidebar-selector {
  margin-top: 1rem;
}

.sidebar-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-lo);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-select {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.8125rem;
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  color: var(--text-hi);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.sidebar-select:hover {
  border-color: var(--accent-teal);
}

.sidebar-select:focus {
  outline: none;
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 2px rgba(46, 238, 211, 0.1);
}

.sidebar-select option {
  background: var(--bg-dark);
  color: var(--text-hi);
  padding: 0.5rem;
}

/* Brightness input styling */
.brightness-input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--text-hi);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.brightness-input:hover {
  border-color: var(--accent-teal);
}

.brightness-input:focus {
  outline: none;
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(46, 238, 211, 0.1);
}

.brightness-input::placeholder {
  color: var(--text-lo);
  opacity: 0.6;
}

/* Product Information Card */
.product-card {
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem 0;
}

.product-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.product-card-left {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.product-image-placeholder {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border-soft);
  border-radius: 8px;
  padding: 4rem 2rem;
  text-align: center;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-name {
  color: var(--text-hi);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.product-meta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.product-meta-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.product-meta-label {
  color: var(--text-lo);
  font-size: 0.875rem;
  font-weight: 600;
  min-width: 100px;
}

.product-meta-value {
  color: var(--text-hi);
  font-size: 0.875rem;
}

.product-link {
  color: var(--accent-teal);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.product-link:hover {
  color: var(--primary);
}

.product-card-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.metrics-summary-title {
  color: var(--text-hi);
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.metrics-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-summary-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.metric-summary-label {
  color: var(--text-lo);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.metric-summary-value {
  color: var(--text-hi);
  font-size: 1.25rem;
  font-weight: 700;
}

.flicker-risk-table {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  overflow: hidden;
}

.flicker-risk-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem 1rem;
  font-weight: 700;
  color: var(--text-hi);
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-soft);
}

.flicker-risk-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-mid);
  font-size: 0.875rem;
}

.flicker-risk-row:last-child {
  border-bottom: none;
}

.flicker-risk-value {
  font-weight: 600;
  text-align: right;
}

/* Hide sidebar on mobile */
@media (max-width: 1024px) {
  .sidebar-toc {
    display: none;
  }

  .content-wrapper {
    display: block;
  }

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

  .metrics-summary-grid {
    grid-template-columns: 1fr;
  }
}

.section {
  margin-bottom: var(--space-section-mobile);
}

@media (min-width: 768px) {
  .section {
    margin-bottom: var(--space-section-desktop);
  }
}

/* ============================================
   4. Typography
   ============================================ */

h1 {
  font-size: var(--fs-h1);
  font-weight: 800;
  color: var(--text-hi);
  line-height: 1.2;
}

h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  color: var(--accent-purple);
  margin-bottom: 1rem;
}

h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--text-hi);
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
}

strong {
  color: var(--text-hi);
  font-weight: 600;
}

.gradient-text {
  background: linear-gradient(120deg, var(--accent-purple), var(--accent-teal));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

/* ============================================
   5. Sticky CTA Bar
   ============================================ */

.sticky-cta {
  position: sticky;
  top: 80px;
  z-index: 40;
  backdrop-filter: saturate(140%) blur(8px);
  background: rgba(14, 15, 18, 0.85);
  border-bottom: 1px solid var(--border-soft);
  padding: 0.75rem 0;
}

.sticky-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.sticky-label {
  font-weight: 600;
  color: var(--text-hi);
  font-size: 0.95rem;
}

.sticky-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ============================================
   6. Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-hi);
  text-decoration: none;
  transition: all 0.18s ease-out;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-teal));
  color: #050608;
  font-weight: 700;
  border: none;
}

.btn-ghost {
  background: transparent;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
}

.btn:focus-visible {
  outline: 2px solid var(--accent-teal);
  outline-offset: 2px;
}

/* ============================================
   7. Cards & Panels
   ============================================ */

.card {
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: var(--space-card-padding);
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .card {
    padding: 40px;
  }
}

.panel {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 1.5rem;
}

/* ============================================
   8. Hero Section
   ============================================ */

.hero-section {
  text-align: center;
  padding: 3rem 0 2rem;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-lo);
  max-width: 700px;
  margin: 1rem auto 2.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(120deg, var(--accent-purple), var(--accent-teal));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: var(--fs-small);
  color: var(--text-lo);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   9. Setting Selector
   ============================================ */

.section-intro {
  color: var(--text-lo);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.selector-panel {
  margin-bottom: 0;
}

.input-label {
  display: block;
  font-weight: 600;
  color: var(--text-hi);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.setting-select {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--text-hi);
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.setting-select:hover {
  border-color: var(--accent-teal);
}

.setting-select:focus {
  outline: none;
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(46, 238, 211, 0.1);
}

.setting-info {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(46, 238, 211, 0.05);
  border-left: 3px solid var(--accent-teal);
  border-radius: 6px;
  display: none;
}

.setting-info.active {
  display: block;
}

.setting-info p {
  margin-bottom: 0.5rem;
  color: var(--text-hi);
}

.setting-info p:last-child {
  margin-bottom: 0;
}

/* ============================================
   10. Charts
   ============================================ */

.chart-description {
  color: var(--text-lo);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .chart-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.chart-container {
  position: relative;
  height: 280px;
}

@media (min-width: 768px) {
  .chart-container {
    height: 360px;
  }
}

/* Chart container with filter dropdown needs extra height */
.chart-container-with-filter {
  height: 360px;
}

@media (min-width: 768px) {
  .chart-container-with-filter {
    height: 440px;
  }
}

.chart-container-full {
  position: relative;
  height: 640px;
}

@media (min-width: 768px) {
  .chart-container-full {
    height: 840px;
  }
}

canvas {
  max-width: 100%;
}

/* ============================================
   11. Table
   ============================================ */

.table-container {
  overflow-x: auto;
  margin-top: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: var(--surface-2);
  border-bottom: 2px solid var(--border-soft);
}

th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-hi);
  white-space: nowrap;
}

td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-lo);
}

tbody tr:hover {
  background: rgba(46, 238, 211, 0.03);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Metric value highlighting */
.metric-good {
  color: var(--risk-green-line);
  font-weight: 600;
}

.metric-caution {
  color: var(--risk-yellow-line);
  font-weight: 600;
}

.metric-risk {
  color: var(--risk-red-line);
  font-weight: 600;
}

/* Flicker analysis table specific styles */
#flicker-analysis-table th {
  font-size: 0.9rem;
}

#flicker-analysis-table td {
  font-size: 0.95rem;
}

#flicker-analysis-table tbody tr:hover {
  background: rgba(46, 238, 211, 0.05);
}

/* Risk column in flicker table */
#flicker-analysis-table td:last-child {
  text-align: center;
  padding: 0.75rem 1rem;
  border-radius: 6px;
}

/* ============================================
   12. Guide & Legend
   ============================================ */

.guide-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .guide-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.metric-list {
  list-style: none;
  padding-left: 0;
}

.metric-list li {
  padding: 0.5rem 0;
  color: var(--text-lo);
  line-height: 1.6;
}

.metric-list li:not(:last-child) {
  border-bottom: 1px solid rgba(32, 38, 54, 0.5);
}

/* ============================================
   13. Text Utilities
   ============================================ */

.text-good {
  color: var(--risk-green-line);
  font-weight: 600;
}

.text-caution {
  color: var(--risk-yellow-line);
  font-weight: 600;
}

.text-risk {
  color: var(--risk-red-line);
  font-weight: 600;
}

/* ============================================
   14. Footer
   ============================================ */

.footer {
  text-align: center;
  padding: 2rem 0 3rem;
  color: var(--text-lo);
  font-size: var(--fs-small);
  border-top: 1px solid var(--border-soft);
  margin-top: 3rem;
}

.footer p {
  margin-bottom: 0.5rem;
}

.footer-note {
  opacity: 0.7;
}

/* ============================================
   15. Accessibility
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--accent-teal);
  outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   16. Loading State
   ============================================ */

.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-lo);
}

.loading::after {
  content: '...';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

/* ============================================
   17. Chart.js Tooltip Override
   ============================================ */

/* Allow tooltips to expand and wrap text */
.chartjs-tooltip {
  max-width: 400px !important;
  white-space: normal !important;
  word-wrap: break-word !important;
}

/* Ensure long text wraps in tooltip title */
canvas {
  max-width: 100%;
}

/* ============================================
   18. Spectral Selector Checkboxes
   ============================================ */

.spectral-checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--surface-2);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.spectral-checkbox-item:hover {
  background: rgba(46, 238, 211, 0.08);
}

.spectral-checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent-teal);
}

.spectral-checkbox-item label {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-lo);
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.spectral-checkbox-item .color-indicator {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.spectral-checkbox-item input[type="checkbox"]:checked + label {
  color: var(--text-hi);
  font-weight: 500;
}

/* ========================================
   Product Comparison Table Styles
   ======================================== */

.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface-2);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.comparison-table thead {
  background: var(--surface-1);
  position: sticky;
  top: 0;
  z-index: 10;
}

.comparison-table th {
  padding: 1rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-hi);
  border-bottom: 2px solid var(--border-soft);
  white-space: nowrap;
  user-select: none;
}

.comparison-table th.sortable {
  cursor: pointer;
  transition: background 0.2s ease;
}

.comparison-table th.sortable:hover {
  background: rgba(255, 255, 255, 0.05);
}

.comparison-table th.sorted-asc .sort-icon::after {
  content: ' ▲';
  color: var(--accent-purple);
}

.comparison-table th.sorted-desc .sort-icon::after {
  content: ' ▼';
  color: var(--accent-purple);
}

.comparison-table th .sort-icon {
  opacity: 0.3;
  font-size: 0.8em;
  margin-left: 0.25rem;
}

.comparison-table th.sortable:hover .sort-icon {
  opacity: 0.6;
}

.comparison-table tbody tr {
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.15s ease;
}

.comparison-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.comparison-table td {
  padding: 0.875rem 0.75rem;
  color: var(--text-lo);
}

.comparison-table td:first-child {
  font-weight: 600;
  color: var(--text-hi);
}

/* Sticky first column */
.comparison-table th.sticky-col,
.comparison-table td.sticky-col {
  position: sticky;
  left: 0;
  background: var(--surface-2);
  z-index: 5;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.comparison-table thead th.sticky-col {
  background: var(--surface-1);
  z-index: 15;
}

.comparison-table tbody tr:hover td.sticky-col {
  background: rgba(255, 255, 255, 0.05);
}

/* Editable cells */
.editable-cell {
  position: relative;
  min-height: 40px;
  cursor: text;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.editable-cell:hover {
  background: rgba(255, 255, 255, 0.05);
}

.editable-cell.editing {
  background: rgba(75, 27, 238, 0.1);
  border: 1px solid var(--accent-purple);
}

.editable-cell textarea {
  width: 100%;
  min-height: 60px;
  padding: 0.5rem;
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  color: var(--text-hi);
  font-family: inherit;
  font-size: 0.875rem;
  resize: vertical;
}

.editable-cell textarea:focus {
  outline: none;
  border-color: var(--accent-purple);
}

.editable-cell .placeholder {
  color: var(--text-lo);
  opacity: 0.4;
  font-style: italic;
}

/* Metric value styling */
.metric-value {
  font-variant-numeric: tabular-nums;
}

.metric-good {
  color: #4ade80;
  font-weight: 500;
}

.metric-caution {
  color: #facc15;
  font-weight: 500;
}

.metric-bad {
  color: #f87171;
  font-weight: 500;
}

/* Price column */
.price-cell::before {
  content: '$';
  opacity: 0.6;
  margin-right: 2px;
}

/* Product link styling */
.product-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--accent-purple);
  text-decoration: none;
  transition: all 0.2s ease;
  background: rgba(75, 27, 238, 0.1);
}

.product-link:hover {
  background: rgba(75, 27, 238, 0.2);
  color: var(--accent-teal);
  transform: translateX(2px);
}

/* Responsive table */
@media (max-width: 768px) {
  .comparison-table {
    font-size: 0.8rem;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 0.5rem 0.4rem;
  }

  .comparison-table th.sticky-col,
  .comparison-table td.sticky-col {
    position: relative;
    box-shadow: none;
  }
}

/* ========================================
   Top Picks Cards - Enhanced Design
   ======================================== */

.top-pick-card {
  background: linear-gradient(135deg, var(--surface-1) 0%, rgba(19, 21, 27, 0.8) 100%);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.top-pick-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-teal));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.top-pick-card:hover {
  border-color: var(--accent-purple);
  box-shadow: 0 8px 32px rgba(75, 27, 238, 0.25);
  transform: translateY(-4px);
}

.top-pick-card:hover::before {
  opacity: 1;
}

.top-pick-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, rgba(75, 27, 238, 0.08), rgba(46, 238, 211, 0.04));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.top-pick-icon {
  font-size: 1.75rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.top-pick-category {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-purple);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.top-pick-content {
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* Product Image Section */
.top-pick-image-section {
  position: relative;
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface-1) 100%);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.top-pick-image-container {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-pick-image-bg {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, rgba(75, 27, 238, 0.15), transparent 70%);
  filter: blur(20px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.top-pick-card:hover .top-pick-image-bg {
  opacity: 1;
}

.top-pick-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
}

.top-pick-card:hover .top-pick-image {
  transform: scale(1.05);
}

.top-pick-image[src=""],
.top-pick-image:not([src]) {
  display: none;
}

.top-pick-image-container:has(.top-pick-image[src=""]),
.top-pick-image-container:has(.top-pick-image:not([src])) {
  background: linear-gradient(135deg, rgba(75, 27, 238, 0.1), rgba(46, 238, 211, 0.1));
  border-radius: 16px;
  border: 2px dashed rgba(255, 255, 255, 0.1);
}

.top-pick-image-container:has(.top-pick-image[src=""]):before,
.top-pick-image-container:has(.top-pick-image:not([src])):before {
  content: '📷';
  font-size: 4rem;
  opacity: 0.2;
}

/* Info Section */
.top-pick-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.top-pick-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-hi);
  margin: 0;
  line-height: 1.3;
}

.top-pick-reason {
  font-size: 0.9rem;
  color: var(--text-lo);
  line-height: 1.6;
  margin: 0;
  opacity: 0.9;
}

/* Key Stats Badges */
.top-pick-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background: rgba(75, 27, 238, 0.1);
  border: 1px solid rgba(75, 27, 238, 0.2);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-hi);
  white-space: nowrap;
}

.stat-badge-icon {
  opacity: 0.6;
  font-size: 0.9em;
}

.stat-badge-label {
  color: var(--text-lo);
  font-weight: 500;
}

/* Features Grid */
.top-pick-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.feature-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.feature-label {
  color: var(--text-lo);
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

.feature-value {
  color: var(--text-hi);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
}

.feature-value-highlight {
  color: var(--accent-teal);
  font-size: 1.1rem;
}

.feature-item-full {
  grid-column: 1 / -1;
}

.feature-item-full .feature-value {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* Buy Button */
.top-pick-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
}

.top-pick-buy-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-teal));
  color: #0a0b0e;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(75, 27, 238, 0.2);
  position: relative;
  overflow: hidden;
}

.top-pick-buy-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.top-pick-buy-btn:hover::before {
  left: 100%;
}

.top-pick-buy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(75, 27, 238, 0.4);
}

/* Responsive top picks */
@media (max-width: 1024px) {
  .grid-2 {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {
  .top-pick-image-section {
    padding: 1.5rem;
    min-height: 160px;
  }

  .top-pick-image-container {
    width: 140px;
    height: 140px;
  }

  .top-pick-info {
    padding: 1.25rem;
  }

  .top-pick-features {
    grid-template-columns: 1fr;
  }

  .top-pick-stats {
    justify-content: flex-start;
  }

  .stat-badge {
    font-size: 0.7rem;
    padding: 0.35rem 0.65rem;
  }
}
