/* GageRef v0.1.0 - Industrial Reference Stylesheet */
/* Mobile-first, system font stack, zero dependencies */

:root {
  /* Color system - industrial palette */
  --color-bg: #f8f7f5;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-secondary: #555555;
  --color-text-muted: #888888;
  --color-border: #d4d0ca;
  --color-border-light: #e8e5e0;
  --color-accent: #c45a28;
  --color-accent-hover: #a84920;
  --color-accent-light: #fdf0ea;
  --color-link: #2a6496;
  --color-link-hover: #1a4060;
  --color-code-bg: #f0eeea;
  --color-table-header: #2c2c2c;
  --color-table-stripe: #faf9f7;
  --color-warning-bg: #fef3cd;
  --color-warning-border: #e6c458;
  --color-warning-text: #664d03;
  --color-safe-bg: #d1e7dd;
  --color-safe-border: #6fb08a;

  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Typography */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", "Fira Code", Consolas, monospace;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --line-height-tight: 1.25;
  --line-height-base: 1.6;

  /* Layout */
  --max-width: 52rem;
  --content-padding: var(--space-md);
  --border-radius: 4px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, ul, ol { margin: 0; }
img { max-width: 100%; height: auto; }

/* Base */
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

/* Layout */

.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--content-padding) var(--space-2xl);
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  padding: var(--space-sm) 0;
  margin-bottom: var(--space-lg);
}

.breadcrumbs a {
  color: var(--color-text-secondary);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--color-link);
  text-decoration: underline;
}

.breadcrumbs .separator,
.breadcrumbs .bc-sep {
  margin: 0 var(--space-xs);
  color: var(--color-border);
}

/* Typography */
h1 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

h2 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  line-height: var(--line-height-tight);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--color-border-light);
  scroll-margin-top: 4rem;
}

h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-top: var(--space-lg);
  scroll-margin-top: 4rem;
  margin-bottom: var(--space-sm);
}

p {
  margin-bottom: var(--space-md);
}

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-link-hover);
}

/* Definition block - the AEO snippet target */
.definition-block {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-base);
  margin-bottom: var(--space-lg);
  color: var(--color-text);
}

/* Spec table */
.spec-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--space-lg);
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.spec-table th {
  background: var(--color-table-header);
  color: #ffffff;
  font-weight: 600;
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  white-space: nowrap;
}

.spec-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: top;
}

.spec-table tr:nth-child(even) td {
  background: var(--color-table-stripe);
}

.spec-table td:first-child {
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
}

/* Amperage table - inherits spec-table, adds tabular nums */
.amperage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-lg);
}

.amperage-table th {
  background: var(--color-table-header);
  color: #ffffff;
  font-weight: 600;
  text-align: left;
  padding: var(--space-sm) var(--space-md);
}

.amperage-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
  font-variant-numeric: tabular-nums;
}

.amperage-table tr:nth-child(even) td {
  background: var(--color-table-stripe);
}

/* Amperage chart image */
.amperage-chart-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: var(--space-md) 0 var(--space-lg);
  border-radius: var(--border-radius);
}

/* Content sections */
.content-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
}

.content-section h2 {
  margin-top: 0;
  border-bottom: none;
  padding-bottom: 0;
}

/* Warning box - for safety disclaimers */
.warning-box {
  background: var(--color-warning-bg);
  border-left: 4px solid var(--color-warning-border);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  font-size: var(--font-size-sm);
  color: var(--color-warning-text);
}

.warning-box strong {
  display: block;
  margin-bottom: var(--space-xs);
}

/* Related links */
.related-links {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 2px solid var(--color-border-light);
}

.related-links h2 {
  border-bottom: none;
  margin-top: 0;
}

.related-links ul {
  list-style: none;
  padding: 0;
}

.related-links li {
  margin-bottom: var(--space-sm);
}

.related-links a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) 0;
}

/* Comparison page */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-lg);
}

.comparison-table th {
  background: var(--color-table-header);
  color: #ffffff;
  font-weight: 600;
  text-align: left;
  padding: var(--space-sm) var(--space-md);
}

.comparison-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: top;
}

.comparison-table tr:nth-child(even) td {
  background: var(--color-table-stripe);
}

.comparison-verdict {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.verdict-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius);
  padding: var(--space-md);
}

.verdict-card h3 {
  margin-top: 0;
  font-size: var(--font-size-base);
  color: var(--color-accent);
}

/* Category page - grid of entity cards */
.entity-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.entity-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius);
  padding: var(--space-md);
  text-decoration: none;
  color: inherit;
  display: block;
}

.entity-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  color: inherit;
}

/* Comparison cards: left accent border to differentiate from spec cards */
.entity-card.comp-card {
  border-left: 3px solid var(--color-accent);
}

/* Verdict cards on comparison pages */
.comparison-verdict {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.verdict-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius);
  padding: var(--space-md);
  position: relative;
}

.verdict-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Make the link inside stretch to cover the whole card */
.verdict-card a {
  text-decoration: none;
  color: var(--color-accent);
  font-weight: 600;
}

.verdict-card a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.verdict-card:hover {
  cursor: pointer;
}

.entity-card h3 {
  margin: 0 0 var(--space-xs) 0;
  font-size: var(--font-size-base);
  color: var(--color-link);
}

.entity-card p {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* FAQ section - AEO/GEO answer pack blocks */
.faq-section {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.faq-item {
  border-bottom: 1px solid var(--color-border-light);
}

.faq-item:last-of-type { border-bottom: none; }

.faq-q {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: var(--space-md) 0;
  list-style: none;
}

.faq-q::-webkit-details-marker { display: none; }

.faq-q::after {
  content: '+';
  margin-left: auto;
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--color-text-muted);
  flex-shrink: 0;
  width: 24px;
  text-align: center;
  transition: transform 0.15s ease;
}

.faq-item[open] > .faq-q::after {
  content: '\2212';
}

.faq-q h3 {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  line-height: 1.4;
}

.faq-a {
  padding: 0 0 var(--space-md) 0;
}

.faq-a p {
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0;
}

.faq-item a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.faq-item a:hover {
  color: var(--color-accent-hover);
}

/* Supplier / affiliate section */
.supplier-section {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: var(--color-table-stripe);
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius);
}

.supplier-section h2 {
  margin-top: 0;
  border-bottom: none;
  padding-bottom: 0;
  font-size: var(--font-size-lg);
}

.supplier-section a {
  color: var(--color-link);
  font-weight: 500;
}

.affiliate-disclosure {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

/* Quick reference box - the at-a-glance cheat sheet */
.quick-ref {
  background: var(--color-surface);
  border: 2px solid var(--color-accent);
  border-radius: var(--border-radius);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
}

.quick-ref-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

.quick-ref-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xs) var(--space-md);
}

.quick-ref-item {
  display: flex;
  flex-direction: column;
}

.quick-ref-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quick-ref-value {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-text);
}

/* Source citation */
.source-citation {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-lg);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border-light);
}

/* In-page jump navigation */
.jump-nav {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  margin: var(--space-md) 0;
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.jump-nav::-webkit-scrollbar {
  display: none;
}

.jump-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: 500;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: var(--border-radius);
}

.jump-nav a:hover {
  color: var(--color-accent);
  background: var(--color-accent-light);
}

/* Home page sections */
.home-section {
  margin-bottom: var(--space-2xl);
}

.home-section h2 {
  margin-top: 0;
}

.section-more {
  margin-top: var(--space-md);
  font-weight: 500;
}

.browse-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
}

.browse-list li {
  font-size: var(--font-size-base);
}

.browse-list a {
  font-weight: 500;
}

.coming-soon {
  margin-top: var(--space-md);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

/* Footer */

/* PLACEHOLDER - new CSS will be appended */

/* =================================================================
   HEADER - SINGLE BAR
   ================================================================= */

.site-header {
  background: #111;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #222;
}

.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 var(--content-padding);
  gap: var(--space-sm);
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: var(--space-sm);
}

.logo-mark { flex-shrink: 0; }

.logo-text {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.12em;
  line-height: 1;
}

.logo-ref { color: var(--color-accent); }

.logo-tagline {
  display: none;
  font-size: 0.62rem;
  font-weight: 400;
  color: #555;
  letter-spacing: 0.03em;
  white-space: nowrap;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid #333;
}

@media (min-width: 900px) {
  .logo-tagline { display: block; }
}

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.nav-item { position: relative; }

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: #999;
  font-size: 0.84rem;
  font-weight: 500;
  font-family: inherit;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
  white-space: nowrap;
}

.nav-btn:hover { color: #fff; background: #1e1e1e; }
.nav-btn[aria-expanded="true"] { color: #fff; background: #222; }

.nav-chevron { opacity: 0.4; transition: transform 0.2s, opacity 0.2s; }
.nav-btn:hover .nav-chevron { opacity: 0.7; }
.nav-btn[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); opacity: 0.8; }

.nav-link {
  color: #666;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  transition: color 0.12s;
  white-space: nowrap;
}

.nav-link:hover { color: #ccc; }

/* Inline search in nav */
.nav-search {
  position: relative;
  margin-left: 4px;
}

.nav-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #444;
  pointer-events: none;
  transition: color 0.15s;
}

.nav-search-input {
  width: 160px;
  padding: 7px 32px 7px 30px;
  font-size: 0.82rem;
  font-family: var(--font-body);
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  color: #ccc;
  outline: none;
  transition: width 0.25s ease, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.nav-search-input::placeholder { color: #444; }

.nav-search-input:focus {
  width: 260px;
  border-color: var(--color-accent);
  background: #1e1e1e;
  box-shadow: 0 0 0 3px rgba(196,90,40,0.12);
}

.nav-search-input:focus ~ .nav-search-icon,
.nav-search:hover .nav-search-icon { color: #666; }

.search-kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.58rem;
  font-family: var(--font-mono);
  color: #444;
  background: #1e1e1e;
  border: 1px solid #2a2a2a;
  border-radius: 3px;
  padding: 1px 5px;
  pointer-events: none;
  line-height: 1.4;
}

.nav-search-input:focus ~ .search-kbd { opacity: 0; }

/* Search results */
.site-search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  z-index: 300;
  max-height: 60vh;
  overflow-y: auto;
}

.site-search-results[hidden] { display: none; }

.sr-item {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  border-bottom: 1px solid var(--color-border-light);
  transition: background 0.06s;
}

.sr-item:last-child { border-bottom: none; }
.sr-item:hover, .sr-active { background: var(--color-accent-light); }

.sr-tag {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-accent);
  margin-bottom: 1px;
}

.sr-title {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--color-text);
  line-height: 1.3;
}

.sr-amp {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-light);
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: 1px;
}

.sr-desc {
  display: block;
  font-size: 0.76rem;
  color: var(--color-text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-empty {
  padding: 16px;
  color: var(--color-text-muted);
  font-size: 0.84rem;
  text-align: center;
}

/* Dropdown panels */
.dd-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  z-index: 300;
  padding: 6px;
}

.dd-panel-right { left: auto; right: 0; }

.dd-panel-wide {
  min-width: 440px;
}

.nav-btn[aria-expanded="true"] + .dd-panel { display: block; animation: ddReveal 0.15s ease-out; }
.nav-btn[aria-expanded="true"] + .dd-panel-wide { display: grid; grid-template-columns: 1fr 1fr; animation: ddReveal 0.15s ease-out; }

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

.dd-col { padding: 4px 0; }

.dd-panel-wide .dd-col:first-child {
  border-right: 1px solid var(--color-border-light);
  padding-right: 6px;
}

.dd-panel-wide .dd-col:last-child { padding-left: 6px; }

.dd-heading {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  padding: 6px 10px 4px;
  margin: 0;
}

.dd-heading-spaced { margin-top: 6px; }

.dd-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  font-size: 0.84rem;
  color: var(--color-text);
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.08s;
}

.dd-link:hover { background: var(--color-accent-light); }
.dd-link-text { flex-grow: 1; }
.dd-featured .dd-link-text { font-weight: 600; color: var(--color-accent); }

.dd-count {
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg);
  padding: 1px 7px;
  border-radius: 10px;
  flex-shrink: 0;
}

.dd-badge {
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-light);
  padding: 1px 7px;
  border-radius: 10px;
  flex-shrink: 0;
}

.dd-meta {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.dd-viewall {
  margin-top: 2px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent);
  border-top: 1px solid var(--color-border-light);
  border-radius: 0 0 6px 6px;
  padding-top: 8px;
}

/* Mobile hamburger */
.nav-mobile-btn {
  display: none;
  background: none;
  border: none;
  color: #888;
  padding: 10px;
  cursor: pointer;
  margin-left: auto;
}

.nav-mobile-btn:hover { color: #fff; }

/* =================================================================
   SUITABILITY SCORES
   ================================================================= */

.suitability-card {
  margin: var(--space-xl) 0;
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.suitability-card h2 {
  margin-bottom: var(--space-xs);
}

.suit-methodology {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  font-style: italic;
}

.suit-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.suit-row {
  display: grid;
  grid-template-columns: 100px 44px 1fr;
  gap: var(--space-sm);
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border-light);
}

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

.suit-cat-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
}

.suit-grade {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  border-radius: 6px;
  flex-shrink: 0;
  line-height: 1;
}

.grade-a { background: #15803d; color: #fff; }
.grade-b { background: #65a30d; color: #fff; }
.grade-c { background: #ca8a04; color: #fff; }
.grade-d { background: #dc6e2e; color: #fff; }
.grade-f { background: #b91c1c; color: #fff; }

.suit-note {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.45;
}

@media (max-width: 639px) {
  .suitability-card { padding: var(--space-md); }

  .suit-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px 0;
  }

  .suit-row > .suit-cat {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .suit-grade {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }

  /* Mobile: category + grade inline, note below */
  .suit-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .suit-cat {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .suit-grade { order: -1; }

  .suit-note {
    width: 100%;
    padding-left: 38px;
    margin-top: -2px;
  }
}

/* =================================================================
   FOOTER
   ================================================================= */

.site-footer {
  background: #111111;
  color: #888;
  padding: var(--space-2xl) var(--content-padding) var(--space-lg);
  margin-top: var(--space-2xl);
  font-size: var(--font-size-sm);
}

.site-footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 2.5fr;
  gap: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid #2a2a2a;
}

.footer-brand a {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #fff;
  text-decoration: none;
  margin-bottom: var(--space-sm);
}

.footer-brand a span { color: var(--color-accent); }

.footer-brand p {
  color: #666;
  line-height: 1.5;
  max-width: 22rem;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.footer-heading {
  color: #bbb;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
}

.footer-col nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-col nav a {
  color: #777;
  text-decoration: none;
  font-size: 0.82rem;
  padding: 2px 0;
  transition: color 0.12s;
}

.footer-col nav a:hover { color: #ddd; }

.footer-bottom {
  padding-top: var(--space-md);
  margin-top: var(--space-md);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
  font-size: 0.75rem;
  color: #555;
}

.footer-affiliate {
  width: 100%;
  color: #777;
  font-size: 0.7rem;
}

/* =================================================================
   HOMEPAGE: HERO
   ================================================================= */

.hero {
  text-align: center;
  padding: var(--space-2xl) var(--content-padding) var(--space-lg);
  background: linear-gradient(180deg, #faf9f7 0%, var(--color-bg) 100%);
}

.hero-inner {
  max-width: 40rem;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(1.5rem, 4.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.hero-sub {
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
  line-height: 1.55;
  margin-bottom: var(--space-lg);
}



/* Hero search */
.hero-search {
  max-width: 440px;
  margin: 0 auto var(--space-lg);
  position: relative;
}

.hero-search-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
  font-family: var(--font-body);
}

.hero-search-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

.hero-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  z-index: 100;
  margin-top: 4px;
  max-height: 400px;
  overflow-y: auto;
  text-align: left;
}

.hero-search-results[hidden] { display: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* Hero action buttons */
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: var(--space-md);
}

.hero-btn {
  display: inline-block;
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  transition: transform 0.1s, box-shadow 0.1s;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  background: var(--color-surface);
}

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

.hero-btn-primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.hero-btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

/* =================================================================
   HOMEPAGE: SEARCH (now in header, kept for homepage-only elements)
   ================================================================= */

.search-wrap {
  position: relative;
  max-width: 30rem;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: var(--font-size-base);
  font-family: var(--font-body);
  border: 2px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(196,90,40,0.12);
}

.search-input::placeholder { color: var(--color-text-muted); }

.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  z-index: 200;
  max-height: 56vh;
  overflow-y: auto;
}

.search-hit {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  text-decoration: none;
  border-bottom: 1px solid var(--color-border-light);
  transition: background 0.08s;
}

.search-hit:last-child { border-bottom: none; }
.search-hit:hover,
.search-hit-active { background: var(--color-accent-light); }

.search-hit-left {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.search-hit-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  margin-bottom: 1px;
}

.search-hit-title {
  font-weight: 600;
  color: var(--color-text);
  font-size: var(--font-size-sm);
}

.search-hit-amp {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-light);
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

.search-hit-desc {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-empty {
  padding: 14px;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  text-align: center;
}

/* =================================================================
   HOMEPAGE: TICKER
   ================================================================= */

.ticker-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-md);
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.78rem;
  transition: border-color 0.15s;
}

.ticker-item:hover { border-color: var(--color-accent); }

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

.ticker-val {
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.72rem;
}

/* =================================================================
   HOMEPAGE: TRUST BAR
   ================================================================= */

.trust-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--content-padding);
  font-size: 0.72rem;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--color-border-light);
}

.trust-sep { opacity: 0.4; }

/* =================================================================
   HOMEPAGE: SECTIONS
   ================================================================= */

.home-section {
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.home-section:last-child { border-bottom: none; }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
  gap: var(--space-md);
}

.section-header h2 {
  margin-bottom: 0;
  font-size: var(--font-size-xl);
  letter-spacing: -0.02em;
}

.section-link {
  font-size: 0.8rem;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}

.section-link:hover { text-decoration: underline; }

.section-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.section-cta {
  margin-top: var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.section-cta a { color: var(--color-accent); }

.section-muted {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

/* Dark section (comparisons) */
.section-dark {
  background: #1a1a1a;
  color: #e0e0e0;
  margin-left: calc(-1 * var(--content-padding));
  margin-right: calc(-1 * var(--content-padding));
  padding-left: var(--content-padding);
  padding-right: var(--content-padding);
  border-bottom: none;
}

.section-dark h2 { color: #ffffff; }
.section-dark p { color: #aaa; }
.section-dark .section-label { color: #777; }

/* =================================================================
   HOMEPAGE: AMPERAGE TABLE
   ================================================================= */

.home-amp-table {
  width: 100%;
}

.amp-process {
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: var(--font-size-sm);
}

/* =================================================================
   HOMEPAGE: SPEC CARDS (electrodes, fittings)
   ================================================================= */

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: var(--space-md);
}

.spec-card {
  display: flex;
  flex-direction: column;
  padding: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  text-decoration: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.spec-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 2px 8px rgba(196,90,40,0.08);
}

.spec-card-featured {
  border-left: 3px solid var(--color-accent);
}

.spec-card-tag {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.spec-card-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.spec-card-desc {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-top: 4px;
  line-height: 1.4;
  flex-grow: 1;
}

.spec-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.spec-card-badge {
  display: inline-block;
  padding: 2px 7px;
  background: var(--color-accent-light);
  color: var(--color-accent);
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 3px;
}

.spec-card-polarity {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.fitting-card .spec-card-tag { color: var(--color-link); }

/* =================================================================
   HOMEPAGE: COMPARE CARDS
   ================================================================= */

.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-top: var(--space-md);
}

.compare-card {
  display: block;
  padding: 14px;
  background: #252525;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid #333;
  transition: border-color 0.12s, transform 0.1s;
}

.compare-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-1px);
}

.compare-card-vs {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.compare-card-desc {
  display: block;
  font-size: 0.78rem;
  color: #999;
  margin-top: 4px;
  line-height: 1.35;
}

/* =================================================================
   HOMEPAGE: GUIDE FEATURE
   ================================================================= */

.guide-feature {
  display: block;
  padding: var(--space-md) var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-left: 3px solid var(--color-accent);
  border-radius: 6px;
  text-decoration: none;
  transition: border-color 0.12s;
  margin-top: var(--space-md);
}

.guide-feature:hover { border-color: var(--color-accent); }

.guide-feature-label {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin-bottom: 4px;
}

.guide-feature-title {
  display: block;
  font-weight: 700;
  font-size: var(--font-size-lg);
  color: var(--color-text);
  margin-bottom: 4px;
}

.guide-feature-desc {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: 1.45;
}

.guide-feature-cta {
  display: inline-block;
  margin-top: var(--space-sm);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-accent);
}

.guide-list { margin-top: var(--space-sm); }

.guide-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border-light);
  text-decoration: none;
  transition: padding-left 0.15s;
}

.guide-row:last-child { border-bottom: none; }
.guide-row:hover { padding-left: var(--space-sm); }

.guide-row-title {
  font-weight: 600;
  color: var(--color-link);
  font-size: var(--font-size-base);
  flex-shrink: 0;
}

.guide-row-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  flex-grow: 1;
}

.guide-row-arrow {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* =================================================================
   HOMEPAGE: RESOURCES
   ================================================================= */

.home-resources { border-bottom: none; }

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-top: var(--space-sm);
}

.resource-link {
  display: block;
  padding: 10px 14px;
  border: 1px solid var(--color-border-light);
  border-radius: 5px;
  text-decoration: none;
  transition: border-color 0.12s;
}

.resource-link:hover { border-color: var(--color-accent); }

.resource-name {
  display: block;
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.resource-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* =================================================================
   RESPONSIVE: SMALL SCREENS
   ================================================================= */

@media (max-width: 639px) {
  /* Header: single bar stays, nav collapses */
  .site-header-inner {
    height: 50px;
    flex-wrap: wrap;
  }

  .logo-tagline { display: none !important; }

  .site-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 0;
    gap: 0;
    background: #191919;
    border-top: 1px solid #2a2a2a;
  }

  .site-nav.nav-open { display: flex; }
  .nav-mobile-btn { display: block; }

  /* Search at top of mobile menu */
  .nav-search {
    order: -1;
    margin: 0;
    padding: 10px var(--content-padding);
    border-bottom: 1px solid #2a2a2a;
  }

  .nav-search-input {
    width: 100% !important;
    font-size: 16px;
    padding: 11px 14px 11px 34px;
    background: #222;
    border-color: #333;
  }

  .search-kbd { display: none; }

  .site-search-results {
    width: 100%;
    left: 0;
    right: 0;
    border-radius: 0 0 10px 10px;
  }

  /* Nav buttons */
  .nav-btn {
    width: 100%;
    justify-content: space-between;
    padding: 14px var(--content-padding);
    font-size: 0.95rem;
    border-radius: 0;
    min-height: 48px;
    color: #ccc;
  }

  .nav-link {
    display: block;
    padding: 14px var(--content-padding);
    font-size: 0.95rem;
    border-radius: 0;
    min-height: 48px;
    color: #999;
  }

  /* Dropdowns inline */
  .dd-panel, .dd-panel-wide {
    position: static !important;
    min-width: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #1e1e1e !important;
    padding: 4px 0 !important;
    animation: none !important;
    transform: none !important;
  }

  .nav-btn[aria-expanded="true"] + .dd-panel-wide {
    display: block !important;
    grid-template-columns: 1fr !important;
  }

  .dd-panel-wide .dd-col:first-child {
    border-right: none;
    border-bottom: 1px solid #2a2a2a;
    padding-right: 0;
    padding-bottom: 6px;
  }

  .dd-panel-wide .dd-col:last-child { padding-left: 0; padding-top: 6px; }

  .dd-link {
    color: #bbb;
    padding: 10px calc(var(--content-padding) + 12px);
    font-size: 0.9rem;
    min-height: 44px;
    border-radius: 0;
  }

  .dd-link:hover { background: rgba(255,255,255,0.03); }
  .dd-heading { color: #555; padding-left: calc(var(--content-padding) + 12px); }
  .dd-count { background: #2a2a2a; color: #777; }
  .dd-badge { background: rgba(196,90,40,0.15); }
  .dd-viewall { border-color: #2a2a2a; margin: 0 calc(var(--content-padding) + 12px); padding-left: 0; }

  /* Hero */
  .hero { padding: var(--space-lg) var(--content-padding) var(--space-md); }
  .hero h1 { font-size: 1.35rem; }
  .hero-actions { flex-direction: column; align-items: stretch; gap: 8px; }
  .hero-btn { text-align: center; padding: 12px 16px; }

  /* Trust bar */
  .trust-bar { flex-direction: column; gap: 2px; font-size: 0.68rem; }
  .trust-sep { display: none; }

  /* Grids */
  .spec-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .spec-card { padding: 10px; }
  .spec-card-desc { font-size: 0.75rem; }
  .compare-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .section-header { flex-direction: column; gap: 2px; }
  .amp-process { display: none; }
  .resource-grid { grid-template-columns: 1fr 1fr; }

  /* Footer */
  .footer-top { grid-template-columns: 1fr; gap: var(--space-lg); }
  .footer-links { grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
  .footer-col nav a { min-height: 44px; display: flex; align-items: center; }
  .footer-bottom { flex-direction: column; }

  /* Tables */
  .quick-ref-grid { grid-template-columns: 1fr 1fr; gap: var(--space-sm) var(--space-md); }
  .spec-table-wrap { position: relative; }
  .comparison-table td:first-child, .comparison-table th:first-child {
    position: sticky; left: 0; background: var(--color-surface); z-index: 1; font-weight: 600;
  }
  .comparison-table th:first-child { background: var(--color-table-header); }
  .spec-table td, .spec-table th, .amperage-table td, .amperage-table th,
  .comparison-table td, .comparison-table th { padding: var(--space-sm); font-size: var(--font-size-sm); }
  .definition-block { font-size: var(--font-size-base); }

  /* Ticker */
  .ticker-row { gap: 4px; }
  .ticker-item { font-size: 0.72rem; padding: 3px 8px; }
}

/* Larger screens */
@media (min-width: 640px) {
  h1 { font-size: var(--font-size-3xl); }
  h2 { font-size: var(--font-size-2xl); }
  .main-content { padding: var(--space-xl) var(--content-padding) var(--space-2xl); }
}

/* Application Guide Recommendation Cards */
.recommendation-cards { display: grid; gap: var(--space-md); margin: var(--space-md) 0; }
.rec-card { border: 1px solid var(--color-border); border-radius: 6px; padding: var(--space-md); background: var(--color-surface); }
.rec-card h3 { margin: 0 0 var(--space-xs); font-size: var(--font-size-lg); }
.rec-card h3 a { color: var(--color-accent); text-decoration: none; }
.rec-card h3 a:hover { text-decoration: underline; }
.rec-context { margin: 0 0 var(--space-sm); color: var(--color-text-secondary); font-size: var(--font-size-sm); line-height: 1.5; }
.rec-quick-stats { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); margin-bottom: var(--space-sm); font-size: var(--font-size-sm); }
.rec-stat { white-space: nowrap; }
.rec-link { font-size: var(--font-size-sm); color: var(--color-accent); text-decoration: none; font-weight: 500; }
.rec-link:hover { text-decoration: underline; }
.affiliate-note { font-size: var(--font-size-xs); color: var(--color-text-secondary); margin-top: var(--space-lg); padding-top: var(--space-sm); border-top: 1px solid var(--color-border); }

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

/* Print */
@media print {
  .site-header, .site-footer, .related-links, .hero, .trust-bar { display: none; }
  .main-content { max-width: 100%; padding: 0; }
  .spec-table th { background: #000; -webkit-print-color-adjust: exact; }
}
