/* ============================================================
   DeviceBenchmark — Professional Technology Comparison Platform
   Design System: Technical Database & Comparison Engine
   ============================================================ */

/* ── 1. Design Tokens ──────────────────────────────────────── */

:root {
  /* Canvas & Surfaces */
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-hover: #f1f5f9;
  --surface-active: #e2e8f0;

  /* Typography Colors */
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  /* Borders & Rules */
  --border: #e2e8f0;
  --border-subtle: #edf2f7;
  --border-strong: #cbd5e1;
  --border-focus: #2563eb;

  /* Restrained Technical Accent (Clean Slate Blue) */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-subtle: #eff6ff;
  --accent-subtle-border: #bfdbfe;
  --accent-text: #1e40af;

  /* Semantic Data Highlighting */
  --win-bg: #ecfdf5;
  --win-text: #065f46;
  --win-border: #a7f3d0;
  --lose-bg: #fef2f2;
  --lose-text: #991b1b;
  --lose-border: #fecaca;
  --warn-bg: #fffbeb;
  --warn-text: #92400e;
  --warn-border: #fde68a;

  /* Grades */
  --grade-a-bg: #ecfdf5;
  --grade-a-text: #065f46;
  --grade-a-border: #a7f3d0;
  --grade-b-bg: #eff6ff;
  --grade-b-text: #1e40af;
  --grade-b-border: #bfdbfe;
  --grade-c-bg: #fffbeb;
  --grade-c-text: #92400e;
  --grade-c-border: #fde68a;
  --grade-d-bg: #fef2f2;
  --grade-d-text: #991b1b;
  --grade-d-border: #fecaca;

  /* Category Identity Tokens (Subtle Accent Indicators) */
  --cat-phones: #2563eb;
  --cat-laptops: #7c3aed;
  --cat-cpus: #059669;
  --cat-gpus: #dc2626;
  --cat-socs: #d97706;
  --cat-tablets: #0891b2;

  /* Geometry & Elevation — Sharp Developer Aesthetic (No large rounded radii) */
  --radius-xs: 0px;
  --radius-sm: 2px;
  --radius: 2px;
  --radius-md: 3px;
  --radius-lg: 4px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);

  /* Typography & Sizing */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* --topbar-h aligned to inline critical CSS in index.html (56px) for consistent layout shift prevention */
  --topbar-h: 56px;
  --max-w: 1240px;

  /* Transitions */
  --transition: 120ms ease-out;
}

[data-theme="dark"] {
  --bg: #090d16;
  --bg-alt: #0f172a;
  --surface: #111827;
  --surface-subtle: #172033;
  --surface-hover: #1e293b;
  --surface-active: #283548;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --border: #1e293b;
  --border-subtle: #192231;
  --border-strong: #334155;
  --border-focus: #3b82f6;

  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-subtle: #1e293b;
  --accent-subtle-border: #2563eb;
  --accent-text: #93c5fd;

  --win-bg: #064e3b;
  --win-text: #6ee7b7;
  --win-border: #047857;
  --lose-bg: #450a0a;
  --lose-text: #fca5a5;
  --lose-border: #7f1d1d;
  --warn-bg: #451a03;
  --warn-text: #fcd34d;
  --warn-border: #78350f;

  --grade-a-bg: #064e3b;
  --grade-a-text: #6ee7b7;
  --grade-a-border: #047857;
  --grade-b-bg: #1e3a8a;
  --grade-b-text: #93c5fd;
  --grade-b-border: #1d4ed8;
  --grade-c-bg: #451a03;
  --grade-c-text: #fcd34d;
  --grade-c-border: #78350f;
  --grade-d-bg: #450a0a;
  --grade-d-text: #fca5a5;
  --grade-d-border: #7f1d1d;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
}

/* ── 2. Reset & Document Setup (2026 Web Standard) ────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: light dark;
  font-size: 100%;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-width: 320px;
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: clamp(0.92rem, 0.88rem + 0.2vw, 1rem);
  line-height: 1.6;
  padding-top: max(var(--topbar-h, 56px), env(safe-area-inset-top, 0px));
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Reserve space when compare tray is visible so content is not obscured */
body.has-compare-tray {
  padding-bottom: max(84px, calc(72px + env(safe-area-inset-bottom, 0px)));
}

/* Base media rules */
img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

/* Focus-visible standard (Section 3 & Section 5) */
:where(a, button, input, select, textarea, [tabindex="0"], [role="button"]):focus-visible {
  outline: 3px solid var(--accent, #2563eb);
  outline-offset: 3px;
}

.rankings-table tbody tr:focus-visible {
  outline: 3px solid var(--accent, #2563eb);
  outline-offset: -2px;
  background-color: var(--surface-hover);
}

/* Reduced-motion preference (Section 3 & Section 5) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast / forced colors mode (Section 5) */
@media (forced-colors: active) {
  :where(a, button, input, select, textarea, [tabindex="0"]):focus-visible {
    outline: 3px solid Highlight;
    outline-offset: 3px;
  }
  .cat-card, .product-card, .data-table, .compare-tray-inner, .rankings-table {
    border: 2px solid CanvasText;
  }
}

/* Tabular numbers for all data display */
body, table, input, select, textarea, button, .score-value, .rating-badge, .card-price, .quick-spec-pill {
  font-variant-numeric: tabular-nums;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

ul, ol {
  list-style: none;
}

/* ── 3. Layout Grid & Containers ───────────────────────────── */

.container {
  width: 100%;
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

.section {
  padding: 24px 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.section-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.section-link:hover {
  text-decoration: underline;
}

/* ── 4. Compact Professional Topbar ────────────────────────── */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.logo:hover {
  text-decoration: none;
}

.logo svg {
  color: var(--accent);
}

.logo strong {
  color: var(--accent);
  font-weight: 800;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  margin-left: 12px;
}

.main-nav a {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background-color var(--transition), color var(--transition);
}

.main-nav a:hover {
  background-color: var(--surface-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.main-nav a.active,
.main-nav a[aria-current="page"] {
  background-color: var(--surface-hover);
  color: var(--text-primary);
  font-weight: 600;
}

/* Icon-only navbar links */
.main-nav a.nav-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--text-secondary);
}

.main-nav a.nav-icon-link svg {
  width: 18px;
  height: 18px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), color var(--transition);
}

.main-nav a.nav-icon-link:hover {
  background-color: var(--surface-hover);
  color: var(--accent);
}

.main-nav a.nav-icon-link:hover svg {
  transform: scale(1.18) translateY(-1px);
}

.main-nav a.nav-icon-link[aria-current="page"] {
  color: var(--accent);
  background-color: var(--accent-subtle, rgba(37,99,235,0.10));
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* Mobile: keep icon-only links readable in the dropdown menu */
@media (max-width: 768px) {
  .main-nav.open a.nav-icon-link {
    width: 40px;
    height: 40px;
  }
  .main-nav.open a.nav-icon-link svg {
    width: 20px;
    height: 20px;
  }
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
}

.topbar-search-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-secondary);
}

.topbar-search-btn kbd {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 1px 4px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--surface);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background-color var(--transition), border-color var(--transition);
}

.icon-btn:hover {
  background-color: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.mobile-only {
  display: none;
}

/* ── 5. Compact Comparison Hub (Homepage Header) ────────────── */

.hub-header {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 20px 0 24px;
}

.hub-title-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 14px;
}

.hub-title {
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.25;
  margin: 0;
}

.hub-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: 680px;
}

/* Quick Compare Box */
.quick-compare-bar {
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.quick-compare-select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-primary);
}

.quick-compare-select:focus {
  outline: none;
  border-color: var(--border-focus);
}

.quick-compare-vs {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 0 4px;
}

.quick-compare-btn {
  height: 36px;
  padding: 0 16px;
  background-color: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
}

.quick-compare-btn:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Compact Search Bar */
.hub-search-container {
  position: relative;
  margin-top: 14px;
}

.hub-search-input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: var(--text-primary);
}

.hub-search-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 1px var(--border-focus);
}

.hub-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ── 6. Category Selector Grid (Dense Reference Matrix) ────── */

.category-matrix {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.category-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 10px;
  text-align: left;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), background-color var(--transition);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.category-card:hover {
  border-color: var(--border-strong);
  background-color: var(--surface-subtle);
  text-decoration: none;
}

.category-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.category-card-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.category-card-count {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  background-color: var(--surface-subtle);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}

.category-card-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
}

/* ── 7. Product Cards (Data Containers) ─────────────────────── */

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.product-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color var(--transition);
}

.product-card:hover {
  border-color: var(--border-strong);
}

.card-media {
  position: relative;
  height: 140px;
  background-color: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.card-media img {
  max-height: 120px;
  max-width: 100%;
  object-fit: contain;
}

.card-category-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
}

.card-compare-check {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 2px 6px;
  cursor: pointer;
}

.card-compare-check input[type="checkbox"] {
  accent-color: var(--accent);
  width: 12px;
  height: 12px;
  cursor: pointer;
}

.card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-brand {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.card-title {
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 3px 0 8px;
  min-height: 2.5em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.card-title a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Structured Metrics in Card */
.card-score-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 4px;
  margin-bottom: 10px;
}

.card-score-item {
  text-align: center;
  padding: 0 2px;
}

.card-score-item .score-value {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
}

.card-score-item .score-label {
  font-size: 0.64rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.card-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.rating-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
}

.rating-badge.grade-a { background-color: var(--grade-a-bg); color: var(--grade-a-text); border-color: var(--grade-a-border); }
.rating-badge.grade-b { background-color: var(--grade-b-bg); color: var(--grade-b-text); border-color: var(--grade-b-border); }
.rating-badge.grade-c { background-color: var(--grade-c-bg); color: var(--grade-c-text); border-color: var(--grade-c-border); }
.rating-badge.grade-d { background-color: var(--grade-d-bg); color: var(--grade-d-text); border-color: var(--grade-d-border); }

.rating-number {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

/* ── 8. Comparison Matrix Table (Core Functional Feature) ─────── */

.compare-page {
  padding: 16px 0 32px;
}

.compare-header {
  margin-bottom: 16px;
}

.compare-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.compare-title span {
  color: var(--accent);
}

.compare-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
}

.compare-diff-toggle {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--surface-subtle);
  color: var(--text-secondary);
  cursor: pointer;
}

.compare-diff-toggle:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.compare-diff-toggle.active {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.compare-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
  box-shadow: var(--shadow-xs);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
}

/* Dynamic Multi-Column Widths */
.compare-table--2-cols {
  min-width: 680px;
}
.compare-table--2-cols th.compare-label-col,
.compare-table--2-cols td.compare-label-col {
  width: 24%;
  min-width: 140px;
}
.compare-table--2-cols .compare-value-col,
.compare-table--2-cols thead th:not(.compare-label-col) {
  width: 38%;
  min-width: 200px;
}

.compare-table--3-cols {
  min-width: 860px;
}
.compare-table--3-cols th.compare-label-col,
.compare-table--3-cols td.compare-label-col {
  width: 22%;
  min-width: 140px;
}
.compare-table--3-cols .compare-value-col,
.compare-table--3-cols thead th:not(.compare-label-col) {
  width: 26%;
  min-width: 180px;
}

.compare-table--4-cols {
  min-width: 1060px;
}
.compare-table--4-cols th.compare-label-col,
.compare-table--4-cols td.compare-label-col {
  width: 20%;
  min-width: 140px;
}
.compare-table--4-cols .compare-value-col,
.compare-table--4-cols thead th:not(.compare-label-col) {
  width: 20%;
  min-width: 170px;
}

/* Sticky Comparison Header Row */
.compare-table thead th {
  position: sticky;
  top: var(--topbar-h);
  background-color: var(--surface);
  border-bottom: 2px solid var(--border);
  padding: 12px 14px;
  z-index: 10;
  vertical-align: top;
}

.compare-product-row th.compare-label-col {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--surface-subtle);
  border-right: 1px solid var(--border);
  position: sticky;
  left: 0;
  z-index: 12;
}

.compare-product-header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.compare-col-remove {
  position: absolute;
  top: -6px;
  right: -4px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 2px);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.compare-col-remove:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #ef4444;
}

.pros-cons-3-cols {
  grid-template-columns: repeat(3, 1fr) !important;
}
.pros-cons-4-cols {
  grid-template-columns: repeat(4, 1fr) !important;
}
@media (max-width: 900px) {
  .pros-cons-3-cols, .pros-cons-4-cols {
    grid-template-columns: 1fr !important;
  }
}

.compare-product-header img {
  max-height: 100px;
  width: auto;
  object-fit: contain;
  margin-bottom: 6px;
}

.compare-product-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.compare-product-brand {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.compare-product-price {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 2px;
}

/* Spec Category Header Rows in Table */
.compare-section-row th,
.compare-section-row td {
  background-color: var(--surface-subtle);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 14px;
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border);
  text-align: left;
}

/* Spec Table Data Rows */
.compare-table tbody tr {
  border-bottom: 1px solid var(--border);
}

.compare-table tbody tr:hover {
  background-color: var(--surface-hover);
}

.compare-table td,
.compare-table th {
  padding: 10px 14px;
  vertical-align: middle;
}

.compare-label-col {
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--surface-subtle);
  border-right: 1px solid var(--border);
  position: sticky;
  left: 0;
  z-index: 5;
}

.compare-value-col {
  color: var(--text-primary);
  font-weight: 500;
}

/* Diff Highlighting */
.compare-win-cell {
  background-color: rgba(34, 197, 94, 0.08);
  font-weight: 700;
}

.compare-table--diff-only tr.is-identical {
  display: none;
}

/* Score Bar in Compare Table */
.compare-score-row td,
.compare-score-row th {
  padding: 10px 14px;
}

.compare-score-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compare-score-num {
  font-size: 1.05rem;
  font-weight: 800;
  min-width: 28px;
  color: var(--text-primary);
}

.compare-score-track {
  flex: 1;
  height: 7px;
  background-color: var(--border);
  border-radius: var(--radius-sm, 2px);
  overflow: hidden;
}

.compare-score-fill {
  height: 100%;
  background-color: var(--accent);
  border-radius: var(--radius-sm, 2px);
  transition: width 0.3s ease;
}

.compare-score-fill.winner {
  background-color: #22c55e;
}

.compare-na {
  color: var(--text-muted);
}

/* ── 9. Product Detail View ────────────────────────────────── */

.product-page {
  padding: 16px 0 32px;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--text-secondary);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.breadcrumbs-sep {
  color: var(--text-muted);
}

.breadcrumbs-current {
  color: var(--text-primary);
  font-weight: 600;
}

/* Technical Product Header */
.product-header-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  grid-template-columns: 180px 1fr 260px;
  gap: 20px;
  align-items: start;
  margin-bottom: 16px;
}

.product-header-image {
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.product-header-image img {
  max-height: 150px;
  object-fit: contain;
}

.product-header-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-header-brand {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.product-header-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

.product-quick-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.quick-spec-pill {
  font-size: 0.78rem;
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 3px 8px;
  color: var(--text-secondary);
}

.quick-spec-pill strong {
  color: var(--text-primary);
}

/* Score Overview Box in Detail Header */
.product-header-scorecard {
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scorecard-headline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.scorecard-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.scorecard-score {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text-primary);
}

.scorecard-tier {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.scorecard-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

/* Detailed Score Breakdown Matrix */
.score-matrix-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.score-bars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 10px;
}

.score-bar-item {
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.score-bar-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
}

.score-bar-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.score-bar-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.score-bar-track {
  height: 5px;
  background-color: var(--border);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  background-color: var(--accent);
  border-radius: var(--radius-xs);
}

/* Grouped Specs Tables in Detail Page */
.spec-group-box {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}

.spec-group-header {
  background-color: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.specs-table tr {
  border-bottom: 1px solid var(--border-subtle);
}

.specs-table tr:last-child {
  border-bottom: none;
}

.specs-table tr:hover {
  background-color: var(--surface-hover);
}

.specs-table td {
  padding: 7px 14px;
  vertical-align: middle;
}

.specs-table td.spec-name {
  width: 32%;
  font-weight: 600;
  color: var(--text-secondary);
  border-right: 1px solid var(--border-subtle);
  background-color: var(--surface-subtle);
}

.specs-table td.spec-value {
  color: var(--text-primary);
  font-weight: 500;
}

/* Pros & Cons */
.pros-cons-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.pros-box, .cons-box {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.pros-box-title {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--win-text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cons-box-title {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--lose-text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pro-item, .con-item {
  font-size: 0.84rem;
  color: var(--text-secondary);
  padding: 4px 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.4;
}

.pro-item::before {
  content: "+";
  font-weight: 800;
  color: var(--win-text);
}

.con-item::before {
  content: "-";
  font-weight: 800;
  color: var(--lose-text);
}

/* ── 10. Category Browse Page Layout ────────────────────────── */

.category-page {
  padding: 16px 0 32px;
}

.browse-header-box {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.browse-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.browse-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

.browse-count-tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.category-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 14px;
  align-items: start;
}

/* Filter Sidebar */
.filter-sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + 12px);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.filter-section-title {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.filter-options-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.filter-checkbox input[type="checkbox"] {
  accent-color: var(--accent);
}

.filter-select {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-primary);
}

.filter-clear-btn {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--surface-subtle);
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
}

.filter-clear-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* Category Toolbar (Sort & Count) */
.category-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 12px;
}

.toolbar-count {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── 11. Rankings & Leaderboards (Data Table) ───────────────── */

.rankings-page {
  padding: 16px 0 32px;
}

.rankings-table-wrapper {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow-xs);
}

.rankings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.rankings-table thead th {
  background-color: var(--surface-subtle);
  border-bottom: 2px solid var(--border);
  padding: 8px 12px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.rankings-table tbody tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background-color var(--transition);
}

.rankings-table tbody tr:hover {
  background-color: var(--surface-hover);
}

.rankings-table td {
  padding: 8px 12px;
  vertical-align: middle;
}

.rankings-rank-col {
  width: 48px;
  text-align: center;
  font-weight: 800;
  color: var(--text-muted);
}

.rankings-product {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text-primary);
}

.rankings-thumb {
  width: 32px;
  height: 32px;
  object-fit: contain;
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 2px;
  flex-shrink: 0;
}

.rankings-brand {
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.rankings-score-val {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-primary);
}

/* Category Filter Tabs in Rankings */
.rankings-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.rankings-tab-btn {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
}

.rankings-tab-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.rankings-tab-btn.active {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

/* ── 12. Technical Glossary & Definitions ────────────────────── */

.glossary-page, .glossary-term-page {
  padding: 16px 0 32px;
}

.glossary-term {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--border-strong);
  cursor: help;
  font-weight: 600;
}

.glossary-term:hover {
  border-bottom-style: solid;
  color: var(--accent-hover);
  text-decoration: none;
}

/* Technical Tooltip */
.glossary-tooltip {
  position: absolute;
  z-index: 120;
  max-width: 320px;
  background-color: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  font-size: 0.82rem;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 100ms ease;
}

.glossary-tooltip.visible {
  opacity: 1;
  pointer-events: auto;
}

.glossary-tooltip-term {
  display: block;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.glossary-tooltip-cta {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 6px;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.glossary-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: inherit;
}

.glossary-card:hover {
  border-color: var(--border-strong);
  text-decoration: none;
}

.glossary-card-term {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.glossary-card-short {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.glossary-card-alias {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.glossary-card-cta {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 4px;
}

/* Glossary Term Detail View */
.glossary-term-hero {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.glossary-term-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--accent-subtle);
  border: 1px solid var(--accent-subtle-border);
  color: var(--accent-text);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
}

.glossary-aliases {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.glossary-short-hero {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 4px;
}

.glossary-term-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
  align-items: start;
}

.glossary-article {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.glossary-fulldef {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.glossary-fulldef p + p {
  margin-top: 10px;
}

.glossary-fulldef strong {
  color: var(--text-primary);
  font-weight: 700;
}

.glossary-fulldef em {
  font-style: normal;
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 1px 4px;
  font-weight: 600;
  color: var(--text-primary);
}

.glossary-related {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.glossary-related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.glossary-related-card {
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: inherit;
}

.glossary-related-card:hover {
  border-color: var(--border-strong);
  text-decoration: none;
}

.glossary-related-card strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.glossary-related-card span {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.glossary-usedin {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.glossary-usedin-more {
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 600;
}

.glossary-aside {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: calc(var(--topbar-h) + 12px);
}

.glossary-aside-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.glossary-aside-card h3 {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.glossary-aside-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.glossary-aside-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.glossary-aside-links a {
  font-size: 0.82rem;
  font-weight: 600;
}

/* ── 13. Persistent Compare Tray ────────────────────────────── */

.compare-tray {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--surface);
  border-top: 2px solid var(--border-strong);
  box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.1);
  padding: 8px 16px;
  /* Ensure tray sits above content but below topbar (topbar is z-index 100) */
  z-index: 90;
  transform: translateY(100%);
  transition: transform 160ms ease-out;
}

.compare-tray.visible {
  transform: translateY(0);
}

.compare-tray-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compare-tray-items {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.compare-tray-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 3px 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.compare-tray-item img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.compare-tray-remove {
  background: none;
  border: none;
  font-size: 1rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 2px;
}

.compare-tray-remove:hover {
  color: var(--lose-text);
}

/* ── 14. Pagination & Utilities ─────────────────────────────── */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 20px;
}

.pagination-btn {
  height: 30px;
  min-width: 30px;
  padding: 0 6px;
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pagination-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.pagination-btn.active {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Form Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color var(--transition), border-color var(--transition);
}

.btn-primary {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
  text-decoration: none;
}

.btn-outline {
  background-color: var(--surface);
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  text-decoration: none;
}

.btn-sm {
  height: 28px;
  padding: 0 8px;
  font-size: 0.78rem;
}

/* ── 15. Comments & Community ───────────────────────────────── */

.comments-section {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
}

.comments-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.comment-form {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.comment-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 6px 10px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--border-focus);
}

.comment {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.comment-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.comment-author {
  font-size: 0.85rem;
  font-weight: 700;
}

.comment-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.comment-body {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.comment-delete {
  position: absolute;
  top: 8px;
  right: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

/* ── 16. Technical Footer ───────────────────────────────────── */

.site-footer {
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px 0 16px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.footer-col h4 {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.footer-col a {
  display: block;
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 2px 0;
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* ── 17. Responsive Layouts ─────────────────────────────────── */

@media (max-width: 1024px) {
  .category-matrix {
    grid-template-columns: repeat(3, 1fr);
  }
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .product-header-card {
    grid-template-columns: 160px 1fr;
  }
  .product-header-scorecard {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .mobile-only {
    display: block;
  }
  .main-nav {
    display: none;
  }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--topbar-h);
    left: 0;
    right: 0;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    margin: 0;
    box-shadow: var(--shadow);
  }
  .quick-compare-bar {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .quick-compare-vs {
    text-align: center;
  }
  .category-matrix {
    grid-template-columns: repeat(2, 1fr);
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .category-layout {
    grid-template-columns: 1fr;
  }
  .product-header-card {
    grid-template-columns: 1fr;
  }
  .product-header-image {
    height: 140px;
  }
  .score-bars-grid {
    grid-template-columns: 1fr;
  }
  .pros-cons-container {
    grid-template-columns: 1fr;
  }
  .glossary-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
  .category-matrix {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   STATIC INFO PAGES — About / Contact / Privacy
   ============================================================ */
.info-page .info-content {
  max-width: 820px;
  padding-bottom: 32px;
}

.info-page .info-content .section + .section {
  padding-top: 8px;
}

.info-page .info-content p {
  color: var(--text-secondary);
  line-height: 1.75;
  font-size: 0.95rem;
  max-width: 72ch;
  margin-bottom: 12px;
}

.info-page .info-content ul {
  margin: 0 0 12px 18px;
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.95rem;
}

.info-page .info-content a {
  color: var(--accent);
  font-weight: 600;
}

.info-page .info-muted {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ============================================================
   ACCESSIBILITY & SEMANTICS UPGRADES (Audit Remediation)
   ============================================================ */
.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  background: var(--accent);
  color: #fff !important;
  padding: 8px 16px;
  z-index: 1000;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 12px;
}

.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;
}

/* Topbar Search Form */
.topbar-search-form {
  position: relative;
  flex: 0 1 280px;
  margin: 0 12px;
}
.topbar-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.topbar-search-wrap .search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
}
.topbar-search-wrap input {
  width: 100%;
  height: 34px;
  padding: 6px 12px 6px 32px;
  font-size: 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 2px);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.topbar-search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

@media (max-width: 900px) {
  .topbar-search-form {
    display: none;
  }
}

/* Semantic Specs Table */
.specs-table th.spec-name,
.specs-table th[scope="row"] {
  width: 40%;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}
.specs-table td.spec-value {
  width: 60%;
  padding: 10px 14px;
  color: var(--text-primary);
  font-weight: 500;
  border-bottom: 1px solid var(--border-subtle);
}

.table-responsive-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
}
.table-responsive-wrapper:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Accessible Checkboxes */
.compare-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.compare-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.compare-checkbox-label input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Compare Decision Verdict & Provenance */
.compare-verdict-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.compare-verdict-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.compare-verdict-body {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
}
.compare-verdict-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
.compare-verdict-pill {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.compare-verdict-pill-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}
.compare-verdict-pill-winner {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 2px;
}

.provenance-badge {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

/* Category FAQs */
.category-faq-section {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.category-faq-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  cursor: pointer;
}
.faq-item summary {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--accent);
  font-weight: 700;
}
.faq-item[open] summary::after {
  content: "\u2212";
}
.faq-answer {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Search Page Refinement */
.search-refine-wrap {
  margin: 16px 0 24px;
  max-width: 540px;
}

/* Glossary Search & Toolbar */
.glossary-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.glossary-search-wrap {
  position: relative;
  flex: 1 1 380px;
  max-width: 580px;
  display: flex;
  align-items: center;
}

.glossary-search-wrap .search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.glossary-search-wrap input {
  width: 100%;
  height: 44px;
  padding: 8px 16px 8px 42px;
  font-size: 0.92rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 2px);
  color: var(--text-primary);
  outline: none;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.glossary-search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.glossary-count-badge {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-sm, 2px);
  border: 1px solid var(--border);
}

/* ============================================================
   COMPARISON HUB & SELECTOR STYLES (/compare)
   ============================================================ */
.compare-selector-section {
  margin: 20px 0 36px;
}

.compare-selector-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 3px);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
}

.compare-selector-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 18px;
}

.compare-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  align-items: flex-end;
}

.compare-select-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.compare-select-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.compare-select-group select.select {
  width: 100%;
  height: 42px;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 3px);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.compare-select-group select.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Popular Comparison Cards Grid */
.popular-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.popular-compare-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 3px);
  padding: 18px 20px;
  text-decoration: none;
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition);
}

.popular-compare-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.08));
  border-color: var(--accent);
  text-decoration: none;
}

.popular-compare-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--surface-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-sm, 2px);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

.popular-compare-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  flex-wrap: wrap;
}

.popular-compare-title .vs-badge,
.vs-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--accent);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.popular-compare-sub {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin: 8px 0 14px;
  line-height: 1.4;
}

.popular-compare-cta {
  margin-top: auto;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}

@media (max-width: 640px) {
  .compare-select-grid {
    grid-template-columns: 1fr;
  }
  .popular-compare-grid {
    grid-template-columns: 1fr;
  }
  .compare-selector-card {
    padding: 16px;
  }
}

/* ============================================================
   ADVERTISING & MONETIZATION SLOTS
   ============================================================ */
.ad-placement-wrap {
  margin: 20px auto;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.ad-banner-container {
  width: 100%;
  max-width: 970px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 3px);
  padding: 12px 18px;
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ad-banner-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.ad-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--surface-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.ad-native-card-body {
  background: var(--surface);
  border: 1px dashed var(--border-strong, #cbd5e1);
  border-radius: var(--radius-md, 3px);
  padding: 18px 20px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

/* ═══════════════════════════════════════════════════════════
   Django SSR app additions (2026 Mobile & Web Best Practices)
   ═══════════════════════════════════════════════════════════ */

/* Footer pinned to bottom on short pages */
.main-layout { flex: 1 0 auto; display: flex; flex-direction: column; }

/* Article & info page reading line length (Section 3: max-width 65-72ch) */
article p, .info-content p, .category-intro {
  max-width: 68ch;
}

/* Hero section */
.hero-section { padding: clamp(32px, 5vw, 48px) 0 32px; border-bottom: 1px solid var(--border); background: var(--surface); }
.hero-badge { display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); background: var(--accent-subtle, rgba(37,99,235,0.08)); padding: 6px 14px; border-radius: var(--radius-sm, 2px); margin-bottom: 16px; border: 1px solid var(--accent-subtle-border, transparent); }
.hero-title { font-size: clamp(1.75rem, 4vw, 2.75rem); line-height: 1.15; margin: 0 0 12px; font-weight: 800; letter-spacing: -0.02em; }
.hero-subtitle { color: var(--text-secondary); max-width: 640px; margin: 0 0 24px; font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.1rem); line-height: 1.6; }
/* ── Unified Search Architecture & Animation ────────────────── */
.topbar-search-form {
  flex: 1;
  max-width: 380px;
  min-width: 180px;
}

.topbar-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.topbar-search-wrap .search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
  width: 16px;
  height: 16px;
  transition: color var(--transition), transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.topbar-search-wrap:hover .search-icon,
.topbar-search-wrap input:focus + .search-icon,
.topbar-search-wrap:focus-within .search-icon {
  color: var(--accent);
  transform: scale(1.15) rotate(-8deg);
}

.topbar-search-wrap input {
  width: 100%;
  height: 36px;
  padding: 6px 12px 6px 34px;
  font-size: 0.86rem;
  font-family: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 2px);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.topbar-search-wrap input:focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

@media (max-width: 640px) {
  .topbar-search-form {
    display: none;
  }
}

/* Hero, Search Page & 404 Unified Search Bars */
.hero-search-form { max-width: 640px; }
.hero-search-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm, 2px);
  padding: 4px 6px 4px 14px;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.05));
  transition: border-color var(--transition), box-shadow var(--transition);
}

.hero-search-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.hero-search-wrap .search-icon {
  flex-shrink: 0;
  color: var(--text-muted);
  width: 20px;
  height: 20px;
  transition: color var(--transition), transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-search-wrap:hover .search-icon,
.hero-search-wrap:focus-within .search-icon {
  color: var(--accent);
  transform: scale(1.18) rotate(-8deg);
}

.hero-search-wrap input[type="search"] {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 0.95rem;
  color: inherit;
  min-width: 0;
  padding: 8px 4px;
}

/* Button & Link SVG Movement Animations (Hover Actions) */
.btn svg,
a.btn svg {
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
  vertical-align: middle;
}

.btn:hover svg,
a.btn:hover svg {
  transform: translateX(3px);
}

.btn-outline:hover svg,
.btn-ghost:hover svg {
  transform: scale(1.15) translateY(-1px);
}

/* Quick Spec Icon Animations on Hover */
.quick-spec-item {
  transition: border-color var(--transition), transform 0.2s ease, box-shadow var(--transition);
}

.quick-spec-item:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xs);
}

.quick-spec-icon-wrap svg {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quick-spec-item:hover .quick-spec-icon-wrap svg {
  transform: scale(1.18) translateY(-1px);
}

/* Topbar Icon Button Hover Motion */
.icon-btn svg {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.icon-btn:hover svg {
  transform: rotate(15deg) scale(1.12);
}

/* Footer Section Header Icons */
.footer-col h4 svg {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.footer-col:hover h4 svg {
  transform: translateY(-2px) scale(1.12);
}

/* Category grid + cards */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 20px; }
.cat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md, 3px); padding: 22px; display: flex; flex-direction: column; gap: 10px; transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease; box-shadow: var(--shadow-xs); }
.cat-card:hover { box-shadow: var(--shadow-md, 0 6px 16px rgba(0,0,0,0.08)); transform: translateY(-3px); }
.cat-card h3 { margin: 0; font-size: 1.1rem; font-weight: 700; }
.cat-card span { font-size: 0.82rem; color: var(--text-muted); font-weight: 600; }
.cat-card p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.5; margin: 0; flex: 1; }
.cat-card--phones { border-top: 3px solid var(--cat-phones, #3b82f6); }
.cat-card--laptops { border-top: 3px solid var(--cat-laptops, #8b5cf6); }
.cat-card--cpus { border-top: 3px solid var(--cat-cpus, #10b981); }
.cat-card--gpus { border-top: 3px solid var(--cat-gpus, #ef4444); }
.cat-card--socs { border-top: 3px solid var(--cat-socs, #f59e0b); }
.cat-card--tablets { border-top: 3px solid var(--cat-tablets, #06b6d4); }

/* SVG Device Icon Animations & Winner Highlights */
.cat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md, 3px);
  background: var(--surface-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.cat-card-icon svg {
  width: 22px;
  height: 22px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), stroke 0.2s ease;
}

.cat-card:hover .cat-card-icon { transform: scale(1.12); }
.cat-card--phones:hover .cat-card-icon { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.cat-card--phones:hover .cat-card-icon svg { animation: iconPulse 0.6s ease infinite alternate; }

.cat-card--laptops:hover .cat-card-icon { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.cat-card--laptops:hover .cat-card-icon svg { animation: iconLid 0.6s ease; }

.cat-card--cpus:hover .cat-card-icon { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.cat-card--cpus:hover .cat-card-icon svg { animation: iconGlow 0.8s ease-in-out infinite alternate; }

.cat-card--gpus:hover .cat-card-icon { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.cat-card--gpus:hover .cat-card-icon svg { animation: iconSpin 1.4s linear infinite; }

.cat-card--socs:hover .cat-card-icon { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.cat-card--socs:hover .cat-card-icon svg { animation: iconPulse 0.5s ease infinite alternate; }

.cat-card--tablets:hover .cat-card-icon { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }
.cat-card--tablets:hover .cat-card-icon svg { animation: iconTilt 0.5s ease; }

@keyframes iconPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.15); }
}

@keyframes iconLid {
  0% { transform: perspective(300px) rotateX(0deg); }
  50% { transform: perspective(300px) rotateX(-22deg); }
  100% { transform: perspective(300px) rotateX(0deg); }
}

@keyframes iconGlow {
  0% { filter: drop-shadow(0 0 1px rgba(16, 185, 129, 0.3)); }
  100% { filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.9)); }
}

@keyframes iconSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes iconTilt {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(-10deg) scale(1.1); }
  100% { transform: rotate(0deg); }
}

/* Winner Trophy & Badge Animations */
.winner-ribbon {
  animation: winnerFloat 2s ease-in-out infinite alternate;
}

@keyframes winnerFloat {
  0% { transform: translateY(0) scale(1); filter: drop-shadow(0 2px 4px rgba(37,99,235,0.25)); }
  100% { transform: translateY(-3px) scale(1.03); filter: drop-shadow(0 4px 10px rgba(37,99,235,0.45)); }
}

.compare-product-card.is-winner {
  border-color: var(--accent) !important;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-subtle) 100%) !important;
}

/* Multi-Column Compare Grid (2, 3, or 4 columns) */
@media (max-width: 960px) {
  .compare-grid--3,
  .compare-grid--4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 600px) {
  .compare-grid--2,
  .compare-grid--3,
  .compare-grid--4 {
    grid-template-columns: 1fr !important;
  }
}

/* Badge + lead */
.badge { display: inline-block; font-size: 0.75rem; font-weight: 700; color: var(--accent); background: var(--accent-subtle, rgba(37,99,235,0.08)); padding: 3px 10px; border-radius: var(--radius-sm, 2px); vertical-align: middle; border: 1px solid var(--accent-subtle-border, transparent); }
.lead { font-size: 1.05rem; color: var(--text-secondary); line-height: 1.6; }

/* Responsive Data Table Container (Section 4 & Section 8) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 12px 0 24px;
  border-radius: var(--radius-md, 3px);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.table-responsive > table,
.data-table,
main table:not([class]) {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  text-align: left;
  font-size: 0.9rem;
}

.data-table caption,
main table:not([class]) caption,
.table-responsive caption {
  text-align: left;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 16px 8px;
  color: var(--text-primary);
}

.data-table th,
.data-table td,
main table:not([class]) th,
main table:not([class]) td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle, var(--border));
  vertical-align: top;
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td,
main table:not([class]) tbody tr:last-child th,
main table:not([class]) tbody tr:last-child td {
  border-bottom: 0;
}

.data-table thead th,
main table:not([class]) thead th {
  background: var(--surface-subtle, var(--bg-alt));
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

main table:not([class]) tbody th[scope="row"],
.data-table tbody th[scope="row"] {
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Category Page Layout */
.category-header { margin: 16px 0 24px; }
.category-header h1 { font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 8px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.category-intro { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 4px; }
.category-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; margin-top: 16px; align-items: start; }
.category-sidebar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md, 3px); padding: 18px; box-shadow: var(--shadow-xs); }
.category-sidebar h3 { font-size: 1rem; margin-bottom: 12px; }
.category-sidebar h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin: 12px 0 8px; }
.category-sidebar ul { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 4px; }
.category-sidebar li a { display: block; padding: 6px 10px; border-radius: var(--radius-sm, 2px); font-size: 0.88rem; color: var(--text-secondary); transition: background var(--transition); }
.category-sidebar li a:hover { background: var(--surface-hover); color: var(--text-primary); text-decoration: none; }
.category-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; font-size: 0.88rem; color: var(--text-secondary); }

/* Product Card Styling */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 3px);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.08));
  border-color: var(--border-strong);
}
.product-card img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  margin: 0 auto 8px;
  background: var(--surface-subtle);
  border-radius: var(--radius-md, 3px);
  padding: 8px;
}
.product-card h3 {
  font-size: 1rem;
  margin: 0;
  line-height: 1.35;
}
.product-card h3 a {
  color: var(--text-primary);
}
.product-card h3 a:hover {
  color: var(--accent);
}

/* FAQ Accordion (<details>) */
.category-faq-section {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.category-faq-section h2 {
  font-size: 1.25rem;
  margin-bottom: 16px;
}
.category-faq-section details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 3px);
  margin-bottom: 10px;
  padding: 14px 18px;
  transition: background var(--transition);
}
.category-faq-section details[open] {
  background: var(--surface-subtle);
}
.category-faq-section summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.95rem;
}
.category-faq-section details > div {
  margin-top: 10px;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.9rem;
}

/* Search page controls */
.search-controls input[type="search"] { min-width: min(320px, 100%); }

/* Pagination buttons (legacy system class) */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 24px 0; }
.pagination-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-md, 3px); color: var(--text-secondary); text-decoration: none; background: var(--surface); font-size: 0.88rem; font-weight: 500; }
.pagination-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pagination-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }

/* Breadcrumb separators / current */
.breadcrumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 12px 0 16px; font-size: 0.85rem; color: var(--text-muted); }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumbs-sep { color: var(--text-dim, var(--text-muted)); margin: 0 4px; }
.breadcrumbs-current { color: var(--text-primary); font-weight: 600; }

/* Compare page two-up grid (collapses on mobile) */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 20px 0; }
.compare-grid > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md, 3px); padding: 20px; box-shadow: var(--shadow-xs); }
@media (max-width: 640px) { .compare-grid { grid-template-columns: 1fr; } }

/* Compare tray (rendered by site.js) */
.compare-tray { position: fixed; left: 0; right: 0; bottom: -100%; z-index: 90; transition: bottom 0.25s ease; pointer-events: none; }
.compare-tray.visible { bottom: 0; pointer-events: auto; }
.compare-tray-inner { max-width: 1280px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-bottom: 0; border-radius: var(--radius-md, 3px) var(--radius-md, 3px) 0 0; box-shadow: 0 -4px 20px rgba(0,0,0,0.12); padding: 12px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.compare-tray-items { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.compare-tray-item { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-sm, 2px); padding: 6px 12px; font-size: 0.85rem; font-family: var(--font-mono); font-weight: 500; }
.compare-tray-remove { border: 0; background: transparent; cursor: pointer; font-size: 1.1rem; line-height: 1; color: var(--text-muted); padding: 2px 4px; border-radius: var(--radius-xs, 0px); }
.compare-tray-remove:hover { color: #ef4444; background: rgba(239,68,68,0.1); }
.compare-tray-actions { display: flex; gap: 8px; }

/* Icon buttons in topbar actions */
.topbar-actions { display: flex; gap: 6px; align-items: center; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid transparent; border-radius: var(--radius-sm, 2px); background: transparent; cursor: pointer; color: var(--text-secondary); transition: background var(--transition), color var(--transition); }
.icon-btn:hover { background: var(--bg-alt); color: var(--text-primary); }
.mobile-only { display: none; }

/* Touch Target Minimum Sizes on Coarse Pointers (Section 4) */
@media (pointer: coarse) {
  .icon-btn, .pagination-btn, .btn, .category-sidebar li a {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
  }
  .main-nav a {
    padding: 10px 14px;
  }
}

/* Mobile Breakpoint (< 768px) */
@media (max-width: 768px) {
  .mobile-only { display: inline-flex; }
  .main-nav { display: none; }
  .main-nav.open {
    display: flex;
    position: absolute;
    top: max(var(--topbar-h, 56px), env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    gap: 6px;
    box-shadow: var(--shadow-md, 0 8px 16px rgba(0,0,0,0.1));
    z-index: 101;
  }
  .main-nav.open a {
    padding: 10px 12px;
    border-radius: var(--radius-sm, 2px);
    font-size: 0.95rem;
  }
  .category-layout {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════
   Cookie Consent Banner (GDPR & CCPA Compliant)
   ═══════════════════════════════════════════════════════════ */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 760px;
  margin: 0 auto;
  z-index: 1000;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner[hidden] {
  display: none !important;
}

.cookie-banner-inner {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm, 2px);
  padding: 16px 20px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.cookie-banner-content {
  flex: 1;
  min-width: 260px;
}

.cookie-banner-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.cookie-banner-content p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.cookie-banner-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════════════════
   Advertising Slots (AdSense + Test Mode placeholders)
   ═══════════════════════════════════════════════════════════ */
.ad-slot {
  width: 100%;
  max-width: 1240px;
  margin: 12px auto;
  padding: 0 16px;
  box-sizing: border-box;
  text-align: center;
}

.ad-slot-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 2px);
  padding: 2px 8px;
  margin-bottom: 6px;
}

.ad-slot-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 90px;
  background: var(--surface-subtle);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm, 2px);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.85rem;
}

.ad-slot .adsbygoogle {
  min-height: 90px;
}

@media (max-width: 768px) {
  .ad-slot-placeholder {
    min-height: 60px;
    font-size: 0.78rem;
  }
}

/* ═══════════════════════════════════════════════════════════
   Custom Ad Formats & Sticky Footer
   ═══════════════════════════════════════════════════════════ */
.ad-banner-link { display: inline-block; }
.ad-banner-link img { display: block; border-radius: var(--radius-sm, 2px); max-width: 100%; height: auto; }

/* Generic banner format: fluid width, 970x90-ish aspect */
.ad-format--banner .ad-banner-link,
.ad-format--banner .ad-banner-link img { display: block; width: 100%; }
.ad-format--banner .ad-banner-link img { max-width: 970px; margin: 0 auto; }

.ad-format--leaderboard .ad-banner-link img { width: 728px; height: 90px; }
.ad-format--rectangle .ad-banner-link img { width: 300px; height: 250px; }
.ad-format--skyscraper .ad-banner-link img { width: 160px; height: 600px; }
@media (max-width: 780px) {
  .ad-format--leaderboard .ad-banner-link img { width: 100%; height: auto; }
}

.ad-native-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 2px);
  padding: 16px 18px;
  text-align: left;
  max-width: 520px;
  margin: 0 auto;
  box-shadow: var(--shadow-xs);
}
.ad-native-img { border-radius: var(--radius-xs, 0px); flex-shrink: 0; }
.ad-native-body { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.55; }
.ad-native-body h4 { margin: 0 0 4px; font-size: 0.95rem; color: var(--text-primary); }
.ad-native-body p { margin: 0 0 10px; }

.ad-html-custom { display: inline-block; max-width: 100%; }
.ad-affiliate-btn { display: inline-flex; align-items: center; gap: 6px; }

.ad-video-wrap { position: relative; width: 100%; max-width: 560px; margin: 0 auto; aspect-ratio: 16/9; }
.ad-video-wrap iframe { width: 100%; height: 100%; border: 0; border-radius: var(--radius-sm, 2px); }

/* Sticky Footer Ad Bar */
.sticky-footer-ad {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 95;
  background: var(--surface);
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.15);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.sticky-footer-ad-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sticky-footer-ad-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  text-decoration: none;
  color: var(--text-primary);
  min-width: 0;
}
.sticky-footer-ad-link img { border-radius: var(--radius-xs, 0px); flex-shrink: 0; }
.sticky-footer-ad-text { font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticky-footer-ad-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs, 0px);
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.sticky-footer-ad-close:hover { color: #ef4444; border-color: #ef4444; }
body:has(.sticky-footer-ad) { padding-bottom: 56px; }
@media (max-width: 640px) {
  .sticky-footer-ad-text { font-size: 0.78rem; }
}
