@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  color-scheme: light;
  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface2: #f3f4f6;
  --text: #111827;
  --muted: #6b7280;
  --accent: #0d9488;
  --accent-dark: #0f766e;
  --accent-soft: #f0fdfa;
  --accent-border: #99f6e4;
  --success: #059669;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", monospace;
  --header-h: 3.5rem;
  --content-max: 1040px;
  --nav-mobile: 768px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1419;
  --surface: #1a1f26;
  --surface2: #242b35;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --border: #374151;
  --accent-soft: rgba(13, 148, 136, 0.12);
  --accent-border: rgba(13, 148, 136, 0.35);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.25);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.nav-open { overflow: hidden; }

img { max-width: 100%; display: block; }

a {
  color: var(--accent-dark);
  text-decoration: none;
}
a:hover { color: var(--accent); }

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

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 max(1.5rem, env(safe-area-inset-right)) 0 max(1.5rem, env(safe-area-inset-left));
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(248, 249, 250, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .site-header {
  background: rgba(15, 20, 25, 0.9);
}

.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 max(1.5rem, env(safe-area-inset-right)) 0 max(1.5rem, env(safe-area-inset-left));
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.logo:hover { color: var(--text); }
.logo-tag {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 0.1rem;
}

.nav-toggle { display: none; }

.nav-main {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  justify-content: center;
}
.nav-main > a {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.nav-main > a:hover { color: var(--text); background: var(--surface2); }
.nav-main > a.active { color: var(--accent-dark); font-weight: 600; }

.header-actions { flex-shrink: 0; }

.theme-toggle, .menu-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover, .menu-btn:hover { border-color: var(--accent); color: var(--accent-dark); }

.icon-menu {
  display: block;
  width: 16px; height: 2px;
  background: currentColor;
  box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
}
.icon-theme svg { display: block; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface2); color: var(--text); }
.btn-lg { padding: 0.8rem 1.65rem; }
.btn-sm { padding: 0.45rem 1rem; font-size: 0.8125rem; }

/* ── Hero ── */
.hero {
  position: relative;
  padding: 3.5rem 0 2rem;
  text-align: center;
  background: var(--bg);
}
.hero-visual {
  min-height: clamp(420px, 72vh, 620px);
  display: flex;
  align-items: center;
  padding: 5rem 0 3.5rem;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: url("../images/hero-home-efficiency.jpg") center center / cover no-repeat;
  transform: scale(1.02);
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 20, 25, 0.55) 0%,
    rgba(15, 20, 25, 0.72) 45%,
    rgba(15, 20, 25, 0.88) 100%
  );
}
.page-home .hero-visual .hero-content {
  position: relative;
  z-index: 1;
}
.page-home .hero-visual .hero-eyebrow,
.page-home .hero-visual h1,
.page-home .hero-visual .hero-lead,
.page-home .hero-visual .hero-stats li {
  color: #fff;
}
.page-home .hero-visual .hero-eyebrow {
  color: #99f6e4;
}
.page-home .hero-visual .hero-lead {
  color: rgba(255, 255, 255, 0.88);
}
.page-home .hero-visual .hero-stats span {
  color: rgba(255, 255, 255, 0.72);
}
.hero-content { max-width: 100%; }
.hero-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  max-width: 720px;
  margin: 0 auto 1rem;
}
.hero-lead {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}
.hero-btns {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.btn-hero-outline {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px);
}
.btn-hero-outline:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}
.hero-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  list-style: none;
  max-width: 720px;
  margin: 0 auto;
  padding-top: 0.5rem;
}
.hero-stats li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 7rem;
}
.hero-stats strong {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.hero-stats span {
  font-size: 0.8rem;
  color: var(--muted);
}
.values-list a {
  color: inherit;
  text-decoration: none;
}
.values-list a:hover {
  color: var(--accent-dark);
}
[data-theme="dark"] .page-home .hero-overlay {
  background: linear-gradient(
    180deg,
    rgba(8, 12, 16, 0.7) 0%,
    rgba(8, 12, 16, 0.82) 50%,
    rgba(8, 12, 16, 0.92) 100%
  );
}

/* Instrument widget */
.instrument {
  max-width: 720px;
  margin: 0 auto 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm), var(--shadow-md);
  overflow: hidden;
  text-align: left;
}
.instrument-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.instrument-tab {
  flex: 1;
  padding: 0.75rem;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.instrument-tab.active {
  background: var(--surface);
  color: var(--accent-dark);
  border-bottom: 2px solid var(--accent);
  margin-bottom: -1px;
}
.instrument-panel { display: none; }
.instrument-panel.active { display: block; }
.instrument-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.instrument-col {
  padding: 1.75rem;
}
.instrument-col:first-child { border-right: 1px solid var(--border); }
.instrument-col h3 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 1rem;
}
.big-num {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.big-num.teal { color: var(--accent-dark); }
.instrument-sub { font-size: 0.8125rem; color: var(--muted); margin-top: 0.25rem; }
.metric-list { list-style: none; margin-top: 1.25rem; }
.metric-list li {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}
.metric-list .v { font-family: var(--mono); font-weight: 500; }
.instrument-foot {
  padding: 1rem 1.75rem;
  background: var(--accent-soft);
  border-top: 1px solid var(--accent-border);
  font-size: 0.875rem;
  color: var(--accent-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.instrument-foot a { font-weight: 600; color: var(--accent-dark); }

/* Single-col instrument (vehicle / home) */
.instrument-single { padding: 1.75rem; }
.instrument-single .big-num { margin-bottom: 0.5rem; }

/* ── Values strip ── */
.values-strip {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}
.values-list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  list-style: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Sections ── */
.section { padding: 3.5rem 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-header { margin-bottom: 2rem; }
.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}
.section-header p { color: var(--muted); font-size: 0.95rem; }
.section-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-dark);
  margin-bottom: 0.35rem;
}

/* ── Cards / tiles ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.calc-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.win-card, .tool-card, .tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.35rem;
  transition: box-shadow 0.15s;
}
.tool-card {
  display: flex;
  flex-direction: column;
}
.tool-card .btn { margin-top: auto; align-self: flex-start; }
.tools-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.tool-category {
  margin-bottom: 3rem;
}
.tool-category-header {
  margin-bottom: 1.25rem;
  max-width: 720px;
}
.tool-category-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.tool-category-header p {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.65;
}
.tool-category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.tool-category-nav a {
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
}
.tool-category-nav a:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.mortgage-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.mortgage-nav h4 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.mortgage-nav ul { list-style: none; }
.mortgage-nav li { font-size: 0.8125rem; padding: 0.35rem 0; border-bottom: 1px solid var(--border); }
.mortgage-nav li:last-child { border-bottom: none; }
.mortgage-nav a { color: var(--text); text-decoration: none; }
.mortgage-nav a:hover, .mortgage-nav a.active { color: var(--accent-dark); font-weight: 600; }
.mortgage-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .mortgage-layout { grid-template-columns: 1fr; }
}
.win-card:hover, .tool-card:hover, a.tile:hover { box-shadow: var(--shadow-sm); }
a.tile {
  display: block;
  color: inherit;
  text-decoration: none;
}
a.tile:hover h4 { color: var(--accent-dark); }
.win-card-body { display: flex; flex-direction: column; flex: 1; }
.win-card-tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-dark);
  margin-bottom: 0.5rem;
}
.win-card h3, .tool-card h3, .tile h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  line-height: 1.35;
}
.win-card h3 a, .tool-card h3 a { color: var(--text); text-decoration: none; }
.win-card h3 a:hover { color: var(--accent-dark); }
.win-card p, .tool-card p, .tile p {
  font-size: 0.8125rem;
  color: var(--muted);
  flex: 1;
  margin-bottom: 1rem;
  line-height: 1.55;
}
.win-metric {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--success);
  margin-bottom: 0.75rem;
}

.tool-card-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  border-color: var(--accent-border);
  background: var(--accent-soft);
}
.tool-card-featured h3 { font-size: 1.125rem; }
.tool-card-featured p { margin: 0; }

/* ── Page hero (inner) ── */
.page-hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 2rem 0;
  text-align: left;
}
.page-hero-visual {
  position: relative;
  padding: 3.25rem 0 2.5rem;
  border-bottom: none;
  overflow: hidden;
  min-height: clamp(220px, 32vh, 320px);
  display: flex;
  align-items: flex-end;
}
.page-hero-bg {
  position: absolute;
  inset: 0;
  background: center center / cover no-repeat;
  transform: scale(1.02);
}
.page-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(15, 20, 25, 0.82) 0%,
    rgba(15, 20, 25, 0.55) 45%,
    rgba(15, 20, 25, 0.35) 100%
  );
}
.page-hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
}
.page-hero-visual h1 {
  color: #fff;
  text-shadow: 0 1px 24px rgba(0, 0, 0, 0.35);
}
.page-hero-visual p {
  color: rgba(255, 255, 255, 0.88);
  max-width: 640px;
}
.page-hero-visual .breadcrumb,
.page-hero-visual .breadcrumb a {
  color: rgba(255, 255, 255, 0.72);
}
.page-hero-visual .breadcrumb a:hover {
  color: #99f6e4;
}
.page-hero-visual .tool-badge {
  color: #99f6e4;
}
.page-hero--car-wins .page-hero-bg { background-image: url("../images/hero-car-wins.jpg"); }
.page-hero--home-wins .page-hero-bg { background-image: url("../images/hero-home-wins.jpg"); }
.page-hero--personal-wins .page-hero-bg { background-image: url("../images/hero-personal-wins.jpg"); }
.page-hero--tools .page-hero-bg { background-image: url("../images/hero-tools.jpg"); }
.page-hero--blog .page-hero-bg { background-image: url("../images/hero-blog.jpg"); }
.page-hero--podcast .page-hero-bg { background-image: url("../images/hero-podcast.jpg"); }
.page-hero--about .page-hero-bg { background-image: url("../images/hero-about.jpg"); }
.page-hero--mortgage .page-hero-bg { background-image: url("../images/hero-mortgage.jpg"); }
.page-hero--water-heater-article .page-hero-bg { background-image: url("../images/hero-water-heater-article.jpg"); }
.page-hero--pixel-slate-article .page-hero-bg { background-image: url("../images/hero-pixel-slate-article.jpg"); }
[data-theme="dark"] .page-hero-overlay {
  background: linear-gradient(
    105deg,
    rgba(8, 12, 16, 0.9) 0%,
    rgba(8, 12, 16, 0.65) 50%,
    rgba(8, 12, 16, 0.45) 100%
  );
}
.page-hero h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.page-hero p { color: var(--muted); max-width: 560px; }
.page-hero-visual p { color: rgba(255, 255, 255, 0.88); }
.breadcrumb {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent-dark); }
.tool-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-dark);
  margin-bottom: 0.5rem;
  display: inline-block;
}

/* ── Content tabs ── */
.content-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.content-tab {
  padding: 0.65rem 1.1rem;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.content-tab.active {
  color: var(--accent-dark);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

/* ── Testimonials ── */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.testimonial {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
}
.testimonial::before { display: none; }
.testimonial p { font-size: 0.9375rem; margin-bottom: 1rem; line-height: 1.55; }
.testimonial cite { font-size: 0.8125rem; color: var(--muted); font-style: normal; }
.result-badge {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--success);
}

/* ── Newsletter ── */
.newsletter-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.newsletter-box::before { display: none; }
.newsletter-box h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.newsletter-box p { color: var(--muted); margin-bottom: 1.5rem; }
.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  max-width: 420px;
  margin: 0 auto;
}
.newsletter-form input[type="email"] {
  flex: 1;
  min-width: 200px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
}
.newsletter-note { font-size: 0.75rem; color: var(--muted); margin-top: 1rem; }

/* ── Article layout ── */
.content-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 2.5rem;
  padding: 2.5rem 0;
  align-items: start;
}
.article-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.article-body h2 { font-size: 1.35rem; font-weight: 700; margin: 2rem 0 0.75rem; }
.article-body h2:first-child { margin-top: 0; }
.article-body h3 { font-size: 1.05rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
.article-body p { margin-bottom: 1rem; }
.article-body ul, .article-body ol { margin: 0 0 1rem 1.25rem; }
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.results-box {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin: 1.5rem 0;
}
.affiliate-note { font-size: 0.8125rem; color: var(--muted); margin: 1.5rem 0; padding-top: 1rem; border-top: 1px solid var(--border); }

.sidebar { display: flex; flex-direction: column; gap: 1rem; }
.sidebar-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
}
.sidebar-widget h3 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.sidebar-widget ul { list-style: none; }
.sidebar-widget li { padding: 0.4rem 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.sidebar-widget li:last-child { border-bottom: none; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1.5rem; }
.filter-btn {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.filter-btn.active, .filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--accent-soft);
}

/* ── Forms ── */
.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}
.form-hint { font-size: 0.75rem; color: var(--muted); margin-top: 0.3rem; }
.form-check { display: flex; gap: 0.5rem; font-size: 0.9rem; cursor: pointer; align-items: flex-start; }
.form-check input { margin-top: 0.2rem; accent-color: var(--accent); }
.form-section { margin-bottom: 1.5rem; }
.form-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.room-list { display: flex; flex-direction: column; gap: 1rem; }
.room-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.room-row:last-child { border-bottom: none; padding-bottom: 0; }
.room-area-readout {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  font-family: var(--mono);
  font-size: 0.9375rem;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.calc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ── Tool pages ── */
.tool-page { padding-bottom: 3rem; }
.tool-intro {
  max-width: 640px;
  margin: 0 auto 2rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}
.calc-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}
.calc-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.calc-panel h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.calc-panel-gas h2 { border-bottom-color: #fbbf24; }
.calc-panel-ev h2 { border-bottom-color: var(--accent); }

.results-panel { position: sticky; top: calc(var(--header-h) + 1rem); }
.results-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.results-card h3 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.tco-verdict {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  color: var(--accent-dark);
}
.tco-verdict.verdict-ev { border-left: 3px solid var(--success); }
.tco-verdict.verdict-gas { border-left: 3px solid #f59e0b; }
.tco-verdict.verdict-tie { border-left: 3px solid var(--muted); }

.result-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.result-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  text-align: center;
}
.result-box .label { font-size: 0.65rem; text-transform: uppercase; color: var(--muted); }
.result-box .value {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 600;
}
.result-box.highlight .value { color: var(--accent-dark); }
.result-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}
.result-stat-row strong { font-family: var(--mono); font-weight: 500; }

.methodology-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.6;
}
.methodology-card h4 { font-size: 0.75rem; font-weight: 600; color: var(--text); margin-bottom: 0.5rem; }
.methodology-card ul { margin: 0.5rem 0 0 1rem; }

.breakdown-section { margin-top: 2.5rem; }
.breakdown-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.breakdown-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
}
.breakdown-card h3 { font-size: 0.9rem; font-weight: 600; margin-bottom: 1rem; }
.breakdown-row { margin-bottom: 0.65rem; }
.breakdown-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  margin-bottom: 0.25rem;
}
.breakdown-label span { color: var(--muted); }
.breakdown-bar-track { height: 6px; background: var(--surface2); border-radius: 99px; overflow: hidden; }
.breakdown-bar-fill { height: 100%; background: var(--accent); border-radius: 99px; }
.bar-fuel, .bar-maint, .bar-repair, .bar-ins, .bar-reg, .bar-dep, .bar-time, .bar-upfront { background: var(--accent); }

.data-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.data-table, .compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table th, .data-table td,
.compare-table th, .compare-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.data-table th, .data-table td { text-align: right; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table th, .compare-table th {
  background: var(--surface2);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
}
.table-scroll { overflow-x: auto; }

.tabs-nav { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.tab-btn {
  padding: 0.6rem 1rem;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-btn.active { color: var(--accent-dark); font-weight: 600; border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.preset-bar { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1.25rem; align-items: center; }
.preset-btn {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.preset-btn:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }

.disclaimer-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 2rem;
  line-height: 1.6;
}

/* ── Calculator insights (tips, mistakes, context) ── */
.calc-insights {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.calc-insights > h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}
.calc-insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.calc-insight-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
}
.calc-insight-card h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.calc-insight-card.tip h3 { color: var(--accent-dark); }
.calc-insight-card.mistake h3 { color: #b45309; }
[data-theme="dark"] .calc-insight-card.mistake h3 { color: #fbbf24; }
.calc-insight-card.context h3 { color: var(--muted); }
.calc-insight-card p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}
.calc-insight-card p strong { color: var(--text); font-weight: 600; }

.calc-widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.calc-result {
  margin-top: 1rem;
  padding: 1.25rem;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  text-align: center;
}
.calc-result .result-value {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent-dark);
}

/* ── Podcast ── */
.episode-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.episode {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.episode:last-child { border-bottom: none; }
.episode-play {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 0.75rem;
}
.episode h3 { font-size: 1rem; font-weight: 600; }
.episode p { font-size: 0.875rem; color: var(--muted); }
.episode-duration { font-family: var(--mono); font-size: 0.8125rem; color: var(--muted); }
.subscribe-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.subscribe-links a {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
}

/* ── About ── */
.about-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2.5rem;
  align-items: start;
}
.about-photo {
  aspect-ratio: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-placeholder { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.credential-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0; }
.credential-list span {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent-dark);
}

/* ── Footer ── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 1.5rem;
  margin-top: 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-brand p { font-size: 0.875rem; color: var(--muted); margin-top: 0.5rem; line-height: 1.55; }
.footer-col h4 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.4rem; }
.footer-col a { color: var(--muted); font-size: 0.875rem; }
.footer-col a:hover { color: var(--accent-dark); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ── Mobile ── */
.menu-btn { display: none; }

@media (max-width: 768px) {
  :root {
    --header-h: 3.25rem;
  }

  .container {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .header-inner {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    gap: 0.5rem;
  }

  .logo { font-size: 0.95rem; min-width: 0; }
  .logo-tag { display: none; }

  .menu-btn {
    display: flex;
    margin-left: auto;
    min-width: 44px;
    min-height: 44px;
  }

  .theme-toggle {
    min-width: 44px;
    min-height: 44px;
  }

  .nav-main {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 300;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem max(1rem, env(safe-area-inset-right)) 1rem max(1rem, env(safe-area-inset-left));
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s, opacity 0.2s;
    box-shadow: var(--shadow-md);
    justify-content: flex-start;
  }

  .nav-main > a {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .nav-toggle:checked ~ .nav-main {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .hero { padding: 2.25rem 0 1.5rem; }
  .hero-visual {
    min-height: auto;
    padding: 4.5rem 0 2.5rem;
  }
  .hero h1 { font-size: clamp(1.65rem, 7vw, 2.25rem); }
  .hero-lead { font-size: 0.95rem; margin-bottom: 1.5rem; }
  .hero-btns { flex-direction: column; align-items: stretch; }
  .hero-btns .btn { width: 100%; }
  .hero-stats {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  .hero-stats li { align-items: center; text-align: center; }

  .section { padding: 2.25rem 0; }
  .page-hero { padding: 1.5rem 0; }
  .page-hero-visual {
    min-height: auto;
    padding: 2.75rem 0 2rem;
  }
  .page-hero h1 { font-size: clamp(1.5rem, 6vw, 2rem); }
  .breadcrumb {
    font-size: 0.75rem;
    line-height: 1.5;
    word-break: break-word;
  }

  .instrument { margin-bottom: 1.5rem; }
  .instrument-body { grid-template-columns: 1fr; }
  .instrument-col:first-child {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .instrument-col { padding: 1.25rem; }
  .instrument-single { padding: 1.25rem; }
  .instrument-foot {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    gap: 0.65rem;
  }
  .instrument-tab {
    padding: 0.85rem 0.5rem;
    font-size: 0.75rem;
  }
  .big-num { font-size: 1.65rem; }

  .card-grid,
  .calc-card-grid,
  .tools-grid,
  .testimonial-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .calc-layout,
  .content-layout,
  .breakdown-grid,
  .footer-grid,
  .about-grid,
  .mortgage-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .content-layout { padding: 1.5rem 0; }
  .article-body { padding: 1.25rem; }

  .tool-card-featured { grid-template-columns: 1fr; }
  .form-grid,
  .form-grid-3,
  .calc-row,
  .room-row,
  .result-compare {
    grid-template-columns: 1fr;
  }

  .results-panel,
  [class$="-results-sticky"] {
    position: static !important;
    top: auto !important;
  }

  /* Standalone energy calculators — single column */
  [class$="-calc"] {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  [class$="-compare"],
  [class$="-stats"],
  [class$="-cost-row"],
  [class$="-power-compare"],
  [class$="-time-compare"] {
    grid-template-columns: 1fr !important;
  }

  .calc-insights-grid {
    grid-template-columns: 1fr;
  }

  .calc-insights { margin-top: 2rem; padding-top: 1.5rem; }

  .content-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .content-tabs::-webkit-scrollbar { display: none; }
  .content-tab {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .filter-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
  }
  .filter-btn { flex-shrink: 0; }

  .btn,
  .btn-sm {
    min-height: 44px;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
  }

  .form-group input,
  .form-group select,
  .form-group textarea,
  [class$="-field"] input,
  [class$="-field"] select {
    font-size: 16px;
    min-height: 44px;
  }

  .form-group input[type="range"],
  [class$="-field"] input[type="range"] {
    min-height: auto;
    padding: 0.5rem 0;
  }

  .tool-intro {
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
  }

  .disclaimer-box {
    margin-top: 1.5rem;
    padding: 0.85rem 1rem;
  }

  .site-footer {
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }

  .footer-grid { gap: 1.5rem; }
  .episode { grid-template-columns: auto 1fr; }

  .table-scroll,
  [class$="-table-wrap"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  .data-table,
  .compare-table,
  [class$="-table"] {
    min-width: 280px;
  }
}

@media (max-width: 380px) {
  .instrument-tabs { flex-wrap: wrap; }
  .instrument-tab {
    flex: 1 1 30%;
    min-width: 0;
  }
  [class$="-roi-timeline"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}