/* SolarToolsPro — bespoke SaaS dark theme */
:root {
  --bg: #0B0F19;
  --bg-alt: #0E1320;
  --surface: #111827;
  --surface-hover: #141d2e;
  --surface-elevated: #161F33;
  --border: #1F2937;
  --border-strong: #2B3748;
  --text: #F3F4F6;
  --text-secondary: #9CA3AF;
  --text-tertiary: #6B7280;
  --accent: #00A8A8;
  --accent-hover: #009090;
  --accent-soft: rgba(0, 168, 168, 0.10);
  --teal: #00A8A8;
  --teal-soft: rgba(0, 168, 168, 0.12);
  --gold: #FFD700;
  --gold-soft: rgba(255, 215, 0, 0.10);
  --violet: #8B5CF6;
  --rose: #F43F5E;
  --danger: #EF4444;
  --warning: #F59E0B;
  --success: #10B981;

  /* Category colors — bespoke palette per tool category */
  --cat-solar: #F59E0B;
  --cat-battery: #14B8A6;
  --cat-ev: #0EA5E9;
  --cat-appliances: #8B5CF6;
  --cat-rates: #F43F5E;
  --cat-offgrid: #10B981;
  --cat-heating: #FB923C;
  --cat-bill: #EC4899;
  --cat-audit: #06B6D4;
  --cat-backup: #A78BFA;

  --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Merriweather', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --max-width: 1140px;
  --header-h: 64px;

  /* Mobile-first touch target minimum */
  --touch-min: 48px;

  /* Enhanced shadow system for depth */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow: 0 4px 12px rgba(0,0,0,0.35);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 8px 24px rgba(14,165,233,0.15);
  --shadow-inset: inset 0 1px 0 rgba(255,255,255,0.04);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; max-width: 100vw; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

/* Prevent any element from causing horizontal scroll */
img, table, pre, code, .table-wrap, .compare-table-wrap { max-width: 100%; }
pre, code { overflow-wrap: break-word; word-wrap: break-word; }

/* Hard overflow protection for all containers and form elements */
.container, .calc-layout, .calc-panel, .result-panel, .tool-page,
.field, .field-row, .field input, .field select, .field textarea,
form, .tool-grid, .article-list, .popular-grid, .category-grid {
  max-width: 100%;
  overflow-wrap: break-word;
}
.field input[type="number"],
.field input[type="text"],
.field input[type="range"],
.field select,
.field textarea {
  width: 100%;
  max-width: 100%;
}

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; }

code, pre, .mono { font-family: var(--font-mono); }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .container { padding: 0 16px; } }

/* ========== HEADER ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(11, 15, 25, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.logo-mark {
  width: 24px; height: 24px;
  border-radius: 6px;
  display: block;
  flex-shrink: 0;
  transition: transform .25s ease;
}
img.logo-mark { object-fit: contain; }
.logo:hover { color: var(--text); }
.logo .accent { color: var(--teal); }

/* Mobile logo adjustments */
@media (max-width: 640px) {
  .logo {
    font-size: 15px;
    gap: 8px;
  }
  .logo-mark {
    width: 22px;
    height: 22px;
    border-radius: 5px;
  }
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav-item { position: relative; }
.nav-link {
  color: var(--text-secondary);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  display: flex; align-items: center; gap: 4px;
  cursor: pointer;
  background: none; border: none;
  font-family: inherit;
  min-height: var(--touch-min);
  transition: color .15s ease, background .15s ease;
}
.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: var(--surface);
  border-radius: var(--radius-sm);
}
.nav-caret {
  display: inline-block;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.6;
  margin-left: 2px;
}

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all .18s ease;
}
.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown a {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  min-height: 48px;
  justify-content: center;
}
.dropdown a:hover { background: var(--surface-hover); color: var(--accent); }
.dropdown a .d-title { font-weight: 500; }
.dropdown a .d-desc { color: var(--text-tertiary); font-size: 12px; margin-top: 2px; }

.mobile-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); padding: 12px 16px; border-radius: var(--radius-sm); cursor: pointer; min-height: var(--touch-min); min-width: var(--touch-min); font-family: inherit; font-size: 14px; }

@media (max-width: 880px) {
  .nav { display: none; position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px; gap: 4px; align-items: stretch; }
  .nav.open { display: flex; }
  .nav-item { width: 100%; }
  .nav-link { width: 100%; justify-content: space-between; }
  .dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; padding: 0 0 0 12px; min-width: 0; }
  .mobile-toggle { display: block; }
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
  min-height: var(--touch-min);
  line-height: 1;
}
.btn-primary { background: var(--accent); color: #0B0F19; box-shadow: var(--shadow-sm), var(--shadow-inset); }
.btn-primary:hover { background: var(--accent-hover); color: #0B0F19; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text); background: var(--surface); }

/* ========== HERO ========== */
.hero {
  padding: 96px 0 64px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 168, 168, 0.06), transparent 60%),
    var(--bg);
}
.hero h1 {
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin-bottom: 20px;
  max-width: 820px;
}
.hero h1 .accent { color: var(--teal); }
.hero p.lead {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 580px;
  margin-bottom: 28px;
  line-height: 1.65;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

/* Hero trust indicators */
.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.hero-trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.hero-trust-item::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  opacity: 0.7;
}

/* Hero CTA — more prominent primary button */
.hero-cta .btn-primary {
  padding: 16px 28px;
  font-size: 15px;
  font-weight: 600;
  min-height: 52px;
  box-shadow: 0 4px 14px rgba(0, 168, 168, 0.25), var(--shadow-inset);
}
.hero-cta .btn-primary:hover {
  box-shadow: 0 6px 20px rgba(0, 168, 168, 0.35), var(--shadow-inset);
  transform: translateY(-2px);
}
.hero-cta .btn-secondary {
  padding: 16px 28px;
  font-size: 15px;
  font-weight: 500;
  min-height: 52px;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 20px;
  padding: 5px 12px;
  background: var(--accent-soft);
  border-radius: 100px;
  border: 1px solid rgba(0,168,168,0.2);
  font-weight: 500;
}

/* ========== START HERE — popular calculators strip ========== */
.start-here {
  padding: 48px 0 56px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.start-here-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.start-here-head h2 {
  font-size: clamp(20px, 2.5vw, 26px);
  letter-spacing: -0.015em;
  font-weight: 700;
}
.start-here-head .sh-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--teal);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}
.start-here-head .sh-link {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}
.start-here-head .sh-link:hover { color: var(--accent); }

.popular-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 880px) { .popular-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .popular-grid { grid-template-columns: 1fr; } }

.popular-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  position: relative;
  overflow: hidden;
  min-height: 160px;
}
.popular-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--cat-accent, var(--accent));
  opacity: 0.7;
  transition: opacity .2s ease;
}
.popular-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  color: var(--text);
}
.popular-card:hover::before { opacity: 1; }
.popular-card .pc-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}
.popular-card .pc-icon {
  width: 32px; height: 32px;
  margin-bottom: 12px;
  color: var(--cat-accent, var(--accent));
}
.popular-card .pc-icon svg { width: 100%; height: 100%; }
.popular-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.popular-card p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 14px;
  flex-grow: 1;
}
.popular-card .pc-cta {
  font-size: 12px;
  color: var(--cat-accent, var(--accent));
  font-weight: 500;
}

/* ========== SECTION ========== */
.section { padding: 80px 0; border-bottom: 1px solid var(--border); }
.section-head { margin-bottom: 48px; }
.section-head h2 {
  font-size: clamp(26px, 3.5vw, 36px);
  letter-spacing: -0.025em;
  margin-bottom: 12px;
  font-weight: 700;
  line-height: 1.2;
}
.section-head p { color: var(--text-secondary); max-width: 600px; font-size: 15px; line-height: 1.6; }

/* ========== TOOL GRID ========== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.tool-card {
  display: flex;
  flex-direction: column;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  position: relative;
  overflow: hidden;
  min-height: 200px;
}
.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--cat-accent, var(--accent));
  opacity: 0;
  transition: opacity .25s ease;
}
.tool-card::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 80px; height: 80px;
  background: radial-gradient(circle at bottom right, var(--cat-accent, var(--accent)) 0%, transparent 70%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--border-strong);
  border-color: transparent;
  color: var(--text);
}
.tool-card:hover::before { opacity: 1; }
.tool-card:hover::after { opacity: 0.06; }
.tool-card .tc-icon {
  width: 32px; height: 32px;
  margin-bottom: 16px;
  color: var(--cat-accent, var(--accent));
  display: block;
  opacity: 0.85;
  transition: opacity .2s ease, transform .2s ease;
}
.tool-card:hover .tc-icon { opacity: 1; transform: scale(1.05); }
.tool-card .tc-icon svg { width: 100%; height: 100%; }
.tool-card .tc-category {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}
.tool-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.tool-card p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 18px;
  flex-grow: 1;
}
.tool-card .tc-cta {
  font-size: 12px;
  color: var(--cat-accent, var(--accent));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: gap .2s ease;
}
.tool-card:hover .tc-cta { gap: 10px; }

/* ========== CALCULATOR UI ========== */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 880px) {
  .calc-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
@media (max-width: 480px) {
  .calc-layout { gap: 16px; }
}

.calc-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md), var(--shadow-inset);
  position: relative;
}
.calc-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.3;
}
.calc-panel h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-bottom: 24px;
  font-weight: 600;
}

.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 7px;
  letter-spacing: -0.01em;
}
.field .hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 6px;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}
.field input[type="number"],
.field input[type="text"],
.field input[type="range"],
.field select,
.field textarea {
  width: 100%;
  padding: 13px 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  min-height: var(--touch-min);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.field input:hover, .field select:hover, .field textarea:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--bg-alt);
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%239CA3AF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] { flex: 1; padding: 0; }
.range-value {
  min-width: 64px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
}

.result-panel {
  background: linear-gradient(180deg, var(--surface-elevated) 0%, var(--surface) 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: sticky;
  top: calc(var(--header-h) + 16px);
  box-shadow: var(--shadow-md), var(--shadow-inset);
  overflow: hidden;
}
.result-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  opacity: 0.5;
}
/* Disable sticky on mobile — result panel should flow naturally and be fully visible */
@media (max-width: 880px) {
  .result-panel {
    position: static;
    top: auto;
  }
}
.result-headline {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.025em;
}
.result-headline .unit { color: var(--text-secondary); font-size: 16px; font-weight: 400; margin-left: 6px; }
.result-label { color: var(--text-tertiary); font-size: 12px; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; }

.result-breakdown {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 8px;
}
.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  font-size: 14px;
  gap: 12px;
}
.breakdown-row .label { color: var(--text-secondary); flex-shrink: 0; max-width: 55%; }
.breakdown-row .value {
  font-family: var(--font-mono);
  color: var(--text);
  font-weight: 500;
  text-align: right;
  word-wrap: break-word;
  overflow-wrap: break-word;
  flex-shrink: 1;
}
.breakdown-row.highlight .value { color: var(--teal); font-size: 16px; }

.result-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tag-good { background: rgba(16,185,129,0.12); color: var(--success); border: 1px solid rgba(16,185,129,0.25); }
.tag-warn { background: rgba(245,158,11,0.12); color: var(--warning); border: 1px solid rgba(245,158,11,0.25); }
.tag-bad { background: rgba(239,68,68,0.12); color: var(--danger); border: 1px solid rgba(239,68,68,0.25); }

/* ========== CONTENT PROSE — Merriweather for long-form ========== */
.prose { max-width: 720px; font-family: var(--font-serif); }
.prose h2, .prose h3, .prose h4 { font-family: var(--font-ui); }
.prose h2 { font-size: 26px; margin: 40px 0 12px; letter-spacing: -0.015em; font-weight: 700; }
.prose h3 { font-size: 19px; margin: 28px 0 10px; font-weight: 600; }
.prose p { color: var(--text); margin-bottom: 16px; line-height: 1.75; font-size: 16px; text-align: justify; }
.prose ul, .prose ol { margin: 0 0 16px 20px; }
.prose li { margin-bottom: 8px; color: var(--text); line-height: 1.7; }
.prose strong { color: var(--text); font-weight: 700; }
.prose code {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.86em;
  color: var(--teal);
  font-family: var(--font-mono);
}
.prose blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 18px;
  margin: 20px 0;
  color: var(--text-secondary);
  font-style: italic;
}
.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(14,165,233,0.3); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent); }

/* Tool page wrapper */
.tool-page { padding: 40px 0; }

/* Semantic breadcrumb navigation */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.breadcrumb a { color: var(--text-secondary); padding: 6px 8px; border-radius: var(--radius-sm); min-height: 32px; display: inline-flex; align-items: center; }
.breadcrumb a:hover { color: var(--accent); background: var(--surface); }
.breadcrumb span.sep { color: var(--text-tertiary); opacity: 0.5; }
.breadcrumb span.current { color: var(--text); padding: 6px 8px; }

/* Legacy class kept for compatibility */
.tool-breadcrumb { font-family: var(--font-mono); font-size: 12px; color: var(--text-tertiary); margin-bottom: 16px; }
.tool-breadcrumb a { color: var(--text-secondary); }
.tool-breadcrumb a:hover { color: var(--accent); }

.tool-title { font-size: clamp(28px, 4vw, 38px); letter-spacing: -0.02em; margin-bottom: 10px; font-weight: 700; }
.tool-subtitle { color: var(--text-secondary); font-size: 17px; margin-bottom: 32px; max-width: 700px; }

/* Content sections below calc — Merriweather for body */
.content-stack > section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}
.content-stack > section:first-child { border-top: none; padding-top: 8px; }
.content-stack h2 { font-size: 24px; letter-spacing: -0.015em; margin-bottom: 16px; font-weight: 700; font-family: var(--font-ui); }
.content-stack h3 { font-size: 17px; margin: 24px 0 8px; font-weight: 600; color: var(--text); font-family: var(--font-ui); }
.content-stack p { color: var(--text); line-height: 1.75; margin-bottom: 14px; font-family: var(--font-serif); font-size: 16px; text-align: justify; }
.content-stack ul, .content-stack ol { margin: 0 0 14px 22px; }
.content-stack li { margin-bottom: 8px; color: var(--text); line-height: 1.7; font-family: var(--font-serif); }
.content-stack strong { color: var(--text); font-weight: 700; }
.content-stack a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(14,165,233,0.3); text-underline-offset: 3px; }
.content-stack code { background: var(--surface); border: 1px solid var(--border); padding: 2px 6px; border-radius: 4px; font-size: 0.86em; color: var(--teal); font-family: var(--font-mono); }

/* FAQ */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--surface);
}
.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 18px 20px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: var(--touch-min);
}
.faq-question:hover { background: var(--surface-hover); }
.faq-icon {
  flex-shrink: 0;
  width: 16px; height: 16px;
  position: relative;
  color: var(--accent);
}
.faq-icon::before, .faq-icon::after {
  content: ''; position: absolute; background: currentColor; border-radius: 2px;
}
.faq-icon::before { top: 7px; left: 0; right: 0; height: 2px; }
.faq-icon::after { left: 7px; top: 0; bottom: 0; width: 2px; transition: transform .2s ease; }
.faq-item.open .faq-icon::after { transform: rotate(90deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
  padding: 0 20px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}
.faq-item.open .faq-answer { max-height: 500px; padding: 0 20px 18px; }

/* Table — mobile responsive with horizontal scroll fallback */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.table-wrap::-webkit-scrollbar { height: 6px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 480px; }
thead { background: var(--bg-alt); }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; color: var(--text-secondary); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-hover); }
td .mono { color: var(--teal); }
@media (max-width: 480px) {
  table { font-size: 13px; }
  th, td { padding: 10px 12px; }
}

/* Search */
.search-box {
  position: relative;
  margin-bottom: 20px;
}
.search-box input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  min-height: var(--touch-min);
}
.search-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box::before {
  content: '';
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  border: 2px solid var(--text-tertiary);
  border-radius: 50%;
}
.search-box::after {
  content: '';
  position: absolute;
  left: 28px; top: 60%;
  width: 8px; height: 2px;
  background: var(--text-tertiary);
  transform: rotate(45deg);
}

/* Filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
  padding: 12px 16px;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
  transition: all .15s ease;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* Article list */
.article-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 20px; }
.article-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  transition: transform .2s, box-shadow .2s, border-color .2s;
  position: relative;
  overflow: hidden;
}
.article-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity .2s ease;
}
.article-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--text); border-color: var(--border-strong); }
.article-card:hover::before { opacity: 0.6; }
.article-card .ac-meta { font-family: var(--font-mono); font-size: 11px; color: var(--accent); margin-bottom: 12px; letter-spacing: 0.05em; }
.article-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.01em; line-height: 1.3; }
.article-card p { color: var(--text-secondary); font-size: 13px; line-height: 1.55; }

/* Article hero */
.article-hero { padding: 56px 0 40px; border-bottom: 1px solid var(--border); }
.article-hero h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.02em; margin-bottom: 16px; font-weight: 700; }
.article-meta { display: flex; gap: 16px; color: var(--text-tertiary); font-size: 13px; font-family: var(--font-mono); }

/* Legal page */
.legal-hero { padding: 56px 0 32px; border-bottom: 1px solid var(--border); }
.legal-hero h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.02em; margin-bottom: 8px; font-weight: 700; }
.legal-updated { color: var(--text-tertiary); font-family: var(--font-mono); font-size: 13px; }

/* CTA strip */
.cta-strip {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--teal-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  margin: 40px 0;
}
.cta-strip h2 { font-size: 24px; margin-bottom: 12px; }
.cta-strip p { color: var(--text-secondary); margin-bottom: 20px; }

/* ========== FOOTER ========== */
.site-footer {
  background: linear-gradient(180deg, var(--bg-alt) 0%, #090C14 100%);
  border-top: 1px solid var(--border);
  padding: 64px 0 0;
  margin-top: 80px;
  position: relative;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 120px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 48px;
}
@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; margin-bottom: 8px; }
}
@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 420px) {
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

.footer-brand {
  padding-right: 24px;
}
.footer-brand .logo {
  font-size: 18px;
  margin-bottom: 16px;
}
.footer-brand p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.7;
  margin-top: 14px;
  max-width: 300px;
  text-align: justify;
}
.footer-col h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 16px;
  font-weight: 600;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a {
  color: var(--text-secondary);
  font-size: 13px;
  transition: color .15s ease, padding-left .15s ease;
}
.footer-col a:hover {
  color: var(--accent);
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-tertiary);
  font-size: 12px;
}
.footer-bottom a { color: var(--text-tertiary); transition: color .15s ease; }
.footer-bottom a:hover { color: var(--accent); }

/* 404 */
.notfound {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 20px;
}
.notfound .nf-code {
  font-family: var(--font-mono);
  font-size: clamp(80px, 18vw, 180px);
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
  letter-spacing: -0.04em;
}
.notfound h1 { font-size: 28px; margin-bottom: 12px; letter-spacing: -0.02em; }
.notfound p { color: var(--text-secondary); margin-bottom: 24px; max-width: 480px; }

/* Utility */
.muted { color: var(--text-secondary); }
.mono { font-family: var(--font-mono); }
.mb-0 { margin-bottom: 0 !important; }
.mt-8 { margin-top: 32px; }
.text-center { text-align: center; }
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* Result chart bars */
.bar-chart { margin-top: 20px; }
.bar-row { display: grid; grid-template-columns: 100px 1fr 70px; gap: 12px; align-items: center; margin-bottom: 10px; }
.bar-row .bar-label { font-size: 12px; color: var(--text-secondary); }
.bar-track { height: 22px; background: var(--bg-alt); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--teal)); transition: width .5s ease; }
.bar-value { font-family: var(--font-mono); font-size: 12px; color: var(--text); text-align: right; }

/* Print friendly fallback */
@media print {
  .site-header, .site-footer, .nav, .cta-strip { display: none; }
  body { background: white; color: black; }
}

/* ========== COMPARISON TABLE ========== */
.compare-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); margin: 24px 0; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 600px; }
.compare-table thead { background: var(--bg-alt); }
.compare-table th, .compare-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.compare-table th { font-weight: 600; color: var(--text-secondary); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.compare-table tbody tr:last-child td { border-bottom: none; }
.compare-table .product-name { font-weight: 600; color: var(--text); font-size: 15px; }
.compare-table .product-sub { color: var(--text-tertiary); font-size: 12px; margin-top: 2px; }
.compare-table .winner { background: var(--teal-soft); color: var(--teal); font-weight: 600; }
.compare-table .check { color: var(--success); font-weight: 600; }
.compare-table .cross { color: var(--danger); font-weight: 600; }
.compare-table .neutral { color: var(--text-secondary); }

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 24px 0;
}
@media (max-width: 760px) { .compare-grid { grid-template-columns: 1fr; } }

.compare-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.compare-card.winner { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.compare-card .cc-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.compare-card.winner .cc-tag { color: var(--teal); }
.compare-card h3 { font-size: 22px; margin-bottom: 4px; letter-spacing: -0.01em; }
.compare-card .cc-sub { color: var(--text-secondary); font-size: 13px; margin-bottom: 20px; }
.compare-card .cc-price { font-family: var(--font-mono); font-size: 28px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.compare-card .cc-price-note { color: var(--text-tertiary); font-size: 12px; margin-bottom: 20px; }
.compare-card dl { margin: 0; }
.compare-card dt { font-size: 12px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 12px; }
.compare-card dd { margin: 2px 0 0; color: var(--text); font-size: 14px; font-family: var(--font-mono); }
.compare-card dd:first-of-type { margin-top: 0; }

.verdict-box {
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--teal-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 24px 0;
}
.verdict-box .vb-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 6px;
}
.verdict-box p { margin: 0; color: var(--text); }

/* ========== LOCATION PAGES ========== */
.location-hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(20,184,166,0.06), transparent 60%), var(--bg);
}
.location-hero h1 {
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  font-weight: 700;
}
.location-hero p { color: var(--text-secondary); font-size: 17px; max-width: 700px; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 32px 0;
}
.stat-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat-card .sc-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.stat-card .sc-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.stat-card .sc-note { color: var(--text-secondary); font-size: 12px; margin-top: 4px; }

.fact-list { list-style: none; padding: 0; margin: 16px 0; }
.fact-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
}
.fact-list li:last-child { border-bottom: none; }
.fact-list .fl-label { color: var(--text-secondary); }
.fact-list .fl-value { color: var(--text); font-family: var(--font-mono); text-align: right; }
.fact-list .fl-value.good { color: var(--success); }
.fact-list .fl-value.bad { color: var(--danger); }
.fact-list .fl-value.warn { color: var(--warning); }

.nm-quality-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--bg-alt);
  overflow: hidden;
  margin: 8px 0;
  position: relative;
}
.nm-quality-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--danger), var(--warning), var(--success));
  transition: width .4s ease;
}

/* Glossary */
.glossary-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
  position: sticky;
  top: calc(var(--header-h) + 8px);
  background: rgba(11,15,25,0.85);
  backdrop-filter: blur(8px);
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  z-index: 10;
}
.glossary-nav a {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.glossary-nav a:hover { color: var(--accent); border-color: var(--accent); }
.glossary-section { margin-bottom: 40px; }
.glossary-section h2 {
  font-size: 20px;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
}
.glossary-entry { margin-bottom: 18px; }
.glossary-entry h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.glossary-entry .ge-term { font-family: var(--font-mono); color: var(--teal); margin-right: 6px; }
.glossary-entry p { color: var(--text-secondary); font-size: 14px; line-height: 1.6; }

/* Share button */
.share-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.share-btn {
  font-size: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-mono);
  transition: all .15s ease;
  min-height: var(--touch-min);
  white-space: nowrap;
}
.share-btn:hover { color: var(--accent); border-color: var(--accent); }
.share-url {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-alt);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========== CATEGORY HUB PAGES ========== */
.category-hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
}
.category-hero .ch-icon {
  width: 56px; height: 56px;
  margin-bottom: 20px;
  color: var(--cat-accent, var(--accent));
}
.category-hero .ch-icon svg { width: 100%; height: 100%; }
.category-hero h1 {
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  font-weight: 700;
}
.category-hero p { color: var(--text-secondary); font-size: 17px; max-width: 700px; }

/* Further Reading section */
.further-reading {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.fr-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.fr-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); color: var(--text); }
.fr-card .fr-type {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.fr-card h4 { font-size: 15px; font-weight: 600; margin-bottom: 6px; line-height: 1.3; }
.fr-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* Article semantic wrapper */
article { display: block; }

/* Ensure calculator output values wrap on small screens */
.result-headline { word-wrap: break-word; overflow-wrap: break-word; }

/* Mobile: comfortable spacing and readable font sizes */
@media (max-width: 480px) {
  .result-headline { font-size: 26px; }
  .calc-panel, .result-panel { padding: 20px; }
  .tool-page { padding: 24px 0; }
  .content-stack > section { padding: 28px 0; }
  .breakdown-row { font-size: 13px; gap: 8px; }
  .breakdown-row .label { max-width: 50%; }
  .breakdown-row.highlight .value { font-size: 15px; }
}

/* Range input touch target */
.field input[type="range"] {
  min-height: var(--touch-min);
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}
.field input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: var(--bg-alt);
  border-radius: 3px;
  border: 1px solid var(--border);
}
.field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  margin-top: -10px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.field input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  cursor: pointer;
}

/* Checkbox touch target */
.field input[type="checkbox"],
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ========== BROWSE BY CATEGORY — compact homepage section ========== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.category-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  position: relative;
  overflow: hidden;
  min-height: 120px;
}
.category-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--cat-accent, var(--accent));
  opacity: 0.7;
  transition: opacity .2s ease;
}
.category-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  color: var(--text);
}
.category-tile:hover::before { opacity: 1; }
.category-tile .ct-icon {
  width: 28px; height: 28px;
  margin-bottom: 12px;
  color: var(--cat-accent, var(--accent));
}
.category-tile .ct-icon svg { width: 100%; height: 100%; }
.category-tile h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.category-tile .ct-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
}

/* Trust strip — compact replacement for "How WattLab works" */
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.trust-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
  min-width: 240px;
}
.trust-item .ti-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.12em;
  flex-shrink: 0;
  padding-top: 3px;
  font-weight: 600;
}
.trust-item .ti-body h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}
.trust-item .ti-body p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ========== Mobile fixes for inline-styled calculator elements ========== */
/* Ensure flex rows in custom tools wrap text properly on mobile */
@media (max-width: 600px) {
  /* Generator sizing: checkbox rows */
  #load-list > div[style*="display:flex"] {
    flex-wrap: wrap;
    gap: 8px;
  }
  #load-list > div[style*="display:flex"] > div[style*="flex:1"] {
    flex: 1 1 100%;
    min-width: 0;
  }
  #load-list > div[style*="display:flex"] > .mono {
    flex-shrink: 0;
  }

  /* Bill estimator: appliance input rows */
  #appliance-list [style*="display:flex"][style*="align-items:end"],
  #appliance-list [style*="display:flex"][style*="align-items:flex-end"] {
    flex-direction: column;
    align-items: stretch !important;
    gap: 8px !important;
  }
  #appliance-list .field-row {
    grid-template-columns: 1fr 1fr;
  }

  /* General: prevent any flex row from causing horizontal overflow */
  [style*="display:flex"] {
    max-width: 100%;
  }

  /* Ensure any inline-styled div with text wraps */
  div[style*="flex:1"] {
    min-width: 0;
  }
}

/* Ensure bar chart rows don't overflow on mobile */
.bar-row {
  max-width: 100%;
}
.bar-row .bar-label {
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0;
}
@media (max-width: 480px) {
  .bar-row {
    grid-template-columns: 80px 1fr 60px;
    gap: 8px;
  }
  .bar-row .bar-label {
    font-size: 11px;
  }
  .bar-row .bar-value {
    font-size: 11px;
  }
}

/* ========== AGGRESSIVE MOBILE OVERFLOW PROTECTION ========== */
/* These rules are deliberately placed last for maximum specificity */
@media (max-width: 768px) {
  /* Force all form elements to respect container width */
  .calc-panel,
  .result-panel {
    padding: 20px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }
  
  /* Ensure calc-layout always stacks on mobile */
  .calc-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px;
    width: 100%;
    max-width: 100%;
  }
  
  /* Force field-row to stack — never side by side on mobile */
  .field-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px;
    width: 100%;
  }
  
  /* All inputs, selects, textareas must be 100% width */
  .field input,
  .field select,
  .field textarea,
  input[type="number"],
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  select,
  textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Prevent any inline-styled flex row from overflowing */
  [style*="display:flex"],
  [style*="display: flex"] {
    flex-wrap: wrap;
    max-width: 100%;
  }
  
  /* Ensure the container doesn't exceed viewport */
  .container {
    width: 100%;
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
    overflow-x: hidden;
  }
  
  /* Prevent tables and compare grids from causing scroll */
  .compare-table-wrap,
  .table-wrap {
    overflow-x: auto;
    max-width: 100%;
  }
  
  /* Tool page header icon row wraps properly */
  .tool-page > .container > div[style*="display:flex"] {
    flex-wrap: wrap;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .calc-panel,
  .result-panel {
    padding: 16px;
  }
  
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }
  
  .field input,
  .field select,
  .field textarea {
    font-size: 16px; /* Prevents iOS zoom */
    padding: 12px;
  }
}

/* ========== PHASE 2: COMPARISON TABLE MOBILE CARD LAYOUT ========== */
@media (max-width: 640px) {
  .compare-table-wrap {
    border: none;
    border-radius: 0;
    overflow: visible;
  }
  .compare-table {
    min-width: 0;
    display: block;
  }
  .compare-table thead { display: none; }
  .compare-table tbody, .compare-table tr, .compare-table td {
    display: block;
    width: 100%;
  }
  .compare-table tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    padding: 16px;
    overflow: hidden;
  }
  .compare-table td {
    border: none;
    padding: 6px 0;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
  }
  .compare-table td::before {
    content: attr(data-label);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    font-weight: 600;
    flex-shrink: 0;
  }
  .compare-table td[data-label] .mono,
  .compare-table td[data-label] {
    font-size: 13px;
  }
  .compare-table .product-name { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
}

/* ========== PHASE 2: KEYBOARD FOCUS STATES ========== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.faq-question:focus-visible,
.chip:focus-visible,
.dropdown a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.tool-card:focus-visible,
.article-card:focus-visible,
.popular-card:focus-visible,
.category-tile:focus-visible,
.fr-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ========== PHASE 2: STAT CARD REFINEMENT ========== */
.stat-card {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .2s ease, transform .2s ease;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 40px; height: 2px;
  background: var(--accent);
  opacity: 0.4;
}
.stat-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.stat-card:hover::after { opacity: 0.8; width: 60px; }
.stat-card .sc-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  font-weight: 600;
}
.stat-card .sc-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.stat-card .sc-note { color: var(--text-secondary); font-size: 11px; margin-top: 4px; }

/* ========== PHASE 2: BAR CHART REFINEMENT ========== */
.bar-chart { margin-top: 20px; }
.bar-row {
  display: grid;
  grid-template-columns: 100px 1fr 70px;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
  transition: opacity .15s ease;
}
.bar-row:hover { opacity: 0.85; }
.bar-row .bar-label {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-track {
  height: 20px;
  background: var(--bg-alt);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  transition: width .5s ease;
  border-radius: 3px;
}
.bar-value {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  text-align: right;
}

/* ========== PHASE 2: CALCULATOR LOADING STATE ========== */
.calc-panel form {
  position: relative;
}
.calc-panel.updating::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: calcPulse 1s ease-in-out;
}
@keyframes calcPulse {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
