/* ============================================================================
   The Green Calculator — Design System (tgc.css)
   The UK's independent home energy expert. Smarter energy decisions.

   One stylesheet, served statically (express.static), linked by every page so
   markup stays small and the brand stays consistent.

   Brand palette
     Deep Forest Green  — primary identity, headlines, primary buttons
     Warm Emerald       — actions, links, data-positive
     Electric Lime      — sharp accent, used sparingly (focus, highlights, chips)
     Off-white / slate  — neutrals
   Type
     Fraunces      — editorial display headings (FT / Which feel)
     Inter         — UI + body
     JetBrains Mono— numbers, data labels, eyebrows (scientific feel)
   ============================================================================ */

/* ── Design tokens ───────────────────────────────────────────────────────── */
:root {
  /* surfaces (light, default) */
  --bg:        #f5f8f4;
  --bg-2:      #ffffff;
  --bg-3:      #eaf0e9;
  --bg-inset:  #f0f4ef;
  --bg-forest: #0e3b2e;   /* deep forest surface (footers, hero panels) */

  /* ink */
  --ink:   #0c1a14;
  --ink-2: #38463f;
  --ink-3: #677a6f;
  --ink-on-forest:   #eaf3ec;
  --ink-on-forest-2: #a9c6b6;

  /* lines */
  --line:   #e0e7df;
  --line-2: #cdd7cb;

  /* brand */
  --forest:    #0e3b2e;
  --forest-2:  #154e3b;
  --emerald:   #1b8e57;   /* fills */
  --emerald-2: #14784a;
  --emerald-ink: #0c6b40; /* emerald as text on white (AA) */
  --lime:      #c6f24e;   /* accent on dark/forest */
  --lime-ink:  #5a7800;   /* lime as text on white (AA) */
  --amber:     #b7791f;
  --amber-bg:  #fdf6e7;
  --danger:    #b4322b;
  --danger-bg: #fbeceb;
  --info:      #1d6fb8;
  --info-bg:   #eaf3fb;
  --star:      #e2a400;

  /* effects */
  --shadow-sm: 0 1px 2px rgba(12,26,20,.05), 0 1px 3px rgba(12,26,20,.05);
  --shadow:    0 2px 6px rgba(12,26,20,.06), 0 8px 24px rgba(12,26,20,.06);
  --shadow-lg: 0 8px 18px rgba(12,26,20,.08), 0 24px 60px rgba(12,26,20,.10);
  --ring: 0 0 0 3px rgba(90,120,0,.45);

  /* radii */
  --r-sm: 8px;  --r: 12px;  --r-lg: 18px;  --r-xl: 26px;  --r-pill: 999px;

  /* type */
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:  'JetBrains Mono', 'Fira Code', ui-monospace, Consolas, monospace;

  /* layout */
  --maxw: 1180px;
  --maxw-read: 720px;
  --nav-h: 68px;
}

[data-theme="dark"] {
  --bg:        #08130e;
  --bg-2:      #0e1f17;
  --bg-3:      #14291e;
  --bg-inset:  #0c1c14;
  --bg-forest: #0a2c21;

  --ink:   #eaf1ec;
  --ink-2: #b3c4ba;
  --ink-3: #7e9387;
  --ink-on-forest:   #eaf3ec;
  --ink-on-forest-2: #a9c6b6;

  --line:   #213629;
  --line-2: #2c4636;

  --forest:    #0a2c21;
  --forest-2:  #12422f;
  --emerald:   #2ea96c;
  --emerald-2: #36c07e;
  --emerald-ink: #58d394;
  --lime:      #c6f24e;
  --lime-ink:  #bfe96a;
  --amber:     #e0a942;  --amber-bg:  #2a230f;
  --danger:    #e0796f;  --danger-bg: #2a1413;
  --info:      #74b3e6;  --info-bg:   #0f2435;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow:    0 2px 8px rgba(0,0,0,.5);
  --shadow-lg: 0 20px 50px rgba(0,0,0,.6);
  --ring: 0 0 0 3px rgba(198,242,78,.4);
}

/* ── Reset & base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--emerald-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
strong, b { font-weight: 650; color: var(--ink); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }
::selection { background: var(--lime); color: var(--forest); }
hr { border: none; border-top: 1px solid var(--line); margin: 32px 0; }

/* ── Typography ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.12; letter-spacing: -.015em; color: var(--ink); }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); font-weight: 600; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
h4 { font-size: 1.08rem; letter-spacing: -.01em; }
p { color: var(--ink-2); }

.eyebrow {
  font-family: var(--mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--emerald-ink);
  display: inline-flex; align-items: center; gap: 8px;
}
.lead { font-size: 1.18rem; color: var(--ink-2); line-height: 1.6; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container-read { max-width: var(--maxw-read); }
.section { padding: clamp(48px, 7vw, 96px) 0; }
.section-sm { padding: clamp(32px, 4vw, 56px) 0; }
.section-tint { background: var(--bg-2); border-block: 1px solid var(--line); }
.section-forest { background: var(--bg-forest); color: var(--ink-on-forest); }
.section-forest h1, .section-forest h2, .section-forest h3 { color: #fff; }
.section-forest p { color: var(--ink-on-forest-2); }
.section-forest .eyebrow { color: var(--lime); }

.section-head { max-width: 680px; margin-bottom: 40px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { margin: 12px 0 10px; }
.section-head p { font-size: 1.06rem; }
.section-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }
.section-head-row .section-head { margin-bottom: 0; }

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1000px) { .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px)  { .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 1em; }
.center { text-align: center; }

/* ── Skip link ───────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 300;
  background: var(--forest); color: #fff; padding: 10px 16px; border-radius: var(--r-sm);
  transition: top .15s;
}
.skip-link:focus { top: 12px; text-decoration: none; }

/* ── Header / nav ────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { height: var(--nav-h); display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex-shrink: 0; }
.brand-name {
  font-family: var(--serif); font-weight: 600; font-size: 1.12rem; letter-spacing: -.02em;
  color: var(--ink); white-space: nowrap;
}
.brand-name .the { color: var(--ink-3); font-weight: 500; }
.beta-badge {
  font-family: var(--mono); font-size: .58rem; font-weight: 700; letter-spacing: .1em;
  background: var(--lime); color: var(--forest); border-radius: 4px; padding: 2px 5px; text-transform: uppercase;
}

.mainnav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.mainnav a, .mainnav .navbtn {
  font-size: .92rem; font-weight: 500; color: var(--ink-2);
  padding: 8px 12px; border-radius: var(--r-sm); background: none; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--sans); white-space: nowrap;
}
.mainnav a:hover, .mainnav .navbtn:hover { color: var(--ink); background: var(--bg-3); text-decoration: none; }
.mainnav a.active { color: var(--emerald-ink); }
.mainnav .navbtn svg { width: 14px; height: 14px; opacity: .7; transition: transform .18s; }
.has-menu[aria-expanded="true"] svg { transform: rotate(180deg); }

.nav-spacer { flex: 1; }
.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* dropdown */
.menu-wrap { position: relative; }
.menu {
  position: absolute; top: calc(100% + 10px); left: 0; min-width: 280px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); padding: 10px; display: none; z-index: 210;
}
.menu.open { display: block; animation: pop .14s ease; }
.menu-wide { min-width: 520px; display: none; grid-template-columns: 1fr 1fr; gap: 6px; }
.menu-wide.open { display: grid; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.menu a {
  display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r);
  color: var(--ink); font-weight: 500;
}
.menu a:hover { background: var(--bg-3); text-decoration: none; }
.menu a .mi { width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px; background: var(--bg-3); display: grid; place-items: center; font-size: 1rem; }
.menu a span small { display: block; font-weight: 400; font-size: .8rem; color: var(--ink-3); line-height: 1.4; }
.menu-foot { margin-top: 6px; padding: 10px 12px; border-top: 1px solid var(--line); }
.menu-foot a { padding: 0; color: var(--emerald-ink); font-size: .88rem; }

/* Suppliers mega-menu (two lead links + two grouped columns) */
.menu-sup { min-width: 560px; }
.menu-sup .msup-col { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.menu-sup .msup-col > a { padding: 7px 12px; font-size: .9rem; color: var(--ink-2); }
.menu-sup .msup-col > a:hover { color: var(--ink); }
.menu-sup .msup-head { font-weight: 650; color: var(--emerald-ink); font-size: .95rem; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.menu-sup .msup-head:hover { color: var(--emerald-ink); }
.menu-sup .msup-head span { opacity: .55; font-family: var(--mono); }

/* hamburger */
.nav-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--line); background: var(--bg-2); border-radius: var(--r-sm); cursor: pointer; }
.nav-toggle svg { width: 20px; height: 20px; margin: auto; color: var(--ink); }

/* mobile panel */
.mobile-nav { display: none; }
@media (max-width: 940px) {
  .mainnav, .nav-actions .btn-cta-desktop { display: none; }
  .nav-toggle { display: flex; }
  .mobile-nav { display: block; position: fixed; inset: var(--nav-h) 0 0; background: var(--bg); z-index: 190; overflow-y: auto; padding: 16px 24px 80px; transform: translateX(100%); transition: transform .22s ease; }
  .mobile-nav.open { transform: none; }
  .mobile-nav details { border-bottom: 1px solid var(--line); }
  .mobile-nav summary { list-style: none; cursor: pointer; padding: 16px 2px; font-size: 1.05rem; font-weight: 600; color: var(--ink); display: flex; justify-content: space-between; align-items: center; }
  .mobile-nav summary::-webkit-details-marker { display: none; }
  .mobile-nav summary::after { content: "+"; font-family: var(--mono); color: var(--ink-3); }
  .mobile-nav details[open] summary::after { content: "–"; }
  .mobile-nav .sub a { display: block; padding: 10px 2px 10px 14px; color: var(--ink-2); font-size: .98rem; }
  .mobile-nav > a:not(.btn) { display: block; padding: 16px 2px; font-size: 1.05rem; font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--line); }
  .mobile-nav .btn { width: 100%; margin-top: 20px; justify-content: center; }
}

/* ── Theme toggle ────────────────────────────────────────────────────────── */
.theme-btn {
  width: 42px; height: 42px; border: 1px solid var(--line); background: var(--bg-2);
  border-radius: var(--r-sm); cursor: pointer; color: var(--ink-2); display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.theme-btn:hover { background: var(--bg-3); color: var(--ink); }
.theme-btn svg { width: 18px; height: 18px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--sans); font-size: .95rem; font-weight: 600; line-height: 1;
  padding: 14px 22px; border-radius: var(--r); border: 1.5px solid transparent;
  cursor: pointer; transition: transform .12s, filter .15s, background .15s, border-color .15s, color .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--forest); color: #fff; border-color: var(--forest); }
.btn-primary:hover { background: var(--forest-2); color: #fff; }
.btn-accent { background: var(--lime); color: var(--forest); border-color: var(--lime); }
.btn-accent:hover { filter: brightness(1.04); color: var(--forest); }
.btn-secondary { background: var(--bg-2); color: var(--emerald-ink); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--emerald); color: var(--emerald-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--emerald); color: var(--emerald-ink); }
.btn-lg { font-size: 1.04rem; padding: 16px 28px; }
.btn-sm { font-size: .85rem; padding: 9px 15px; }
.btn-block { display: flex; width: 100%; }
.section-forest .btn-secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.section-forest .btn-secondary:hover { border-color: var(--lime); color: var(--lime); }

.btnrow { display: flex; gap: 14px; flex-wrap: wrap; }
.btnrow.center { justify-content: center; }

/* ── Pills / badges / chips ──────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; font-weight: 600;
  padding: 6px 13px; border-radius: var(--r-pill); background: var(--bg-3); color: var(--ink-2);
  border: 1px solid var(--line);
}
.pill-lime { background: color-mix(in srgb, var(--lime) 25%, var(--bg-2)); color: var(--lime-ink); border-color: color-mix(in srgb, var(--lime) 45%, var(--line)); }
.pill-emerald { background: color-mix(in srgb, var(--emerald) 14%, var(--bg-2)); color: var(--emerald-ink); border-color: color-mix(in srgb, var(--emerald) 35%, var(--line)); }
.tag { font-family: var(--mono); font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px; transition: transform .16s, box-shadow .16s, border-color .16s;
}
.card-hover:hover, a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); text-decoration: none; }
.card h3 { color: var(--ink); }

/* calculator card */
.calc-card { display: flex; flex-direction: column; gap: 14px; position: relative; }
.calc-card .ico {
  width: 50px; height: 50px; border-radius: var(--r); display: grid; place-items: center;
  background: color-mix(in srgb, var(--emerald) 12%, var(--bg-2)); color: var(--emerald-ink);
}
.calc-card .ico svg { width: 26px; height: 26px; }
.calc-card h3 { font-size: 1.22rem; margin: 0; }
.calc-card p { font-size: .92rem; margin: 0; color: var(--ink-3); flex: 1; }
.calc-card .go { font-weight: 600; font-size: .9rem; color: var(--emerald-ink); display: inline-flex; align-items: center; gap: 6px; }
.calc-card:hover .go svg { transform: translateX(3px); }
.calc-card .go svg { width: 15px; height: 15px; transition: transform .16s; }

/* feature / icon row */
.feature { display: flex; gap: 16px; align-items: flex-start; }
.feature .fico { flex-shrink: 0; width: 44px; height: 44px; border-radius: var(--r); display: grid; place-items: center; background: var(--bg-3); color: var(--emerald-ink); }
.feature .fico svg { width: 22px; height: 22px; }
.feature h3 { font-family: var(--sans); font-size: 1.05rem; font-weight: 650; margin-bottom: 4px; }
.feature p { font-size: .94rem; margin: 0; }

/* ── Stats ───────────────────────────────────────────────────────────────── */
.stat { }
.stat .num { font-family: var(--serif); font-weight: 600; font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1; color: var(--ink); letter-spacing: -.02em; }
.section-forest .stat .num { color: var(--lime); }
.stat .lbl { font-size: .9rem; color: var(--ink-3); margin-top: 8px; }
.section-forest .stat .lbl { color: var(--ink-on-forest-2); }
/* Stat cards that set the forest background inline (not via .section-forest) need the
   same light label colour for AA contrast on dark green. */
.card[style*="bg-forest"] .stat .lbl { color: var(--ink-on-forest-2); }

/* trust strip */
.trust-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; }
.trust-strip .src { font-family: var(--mono); font-size: .8rem; color: var(--ink-3); display: inline-flex; align-items: center; gap: 8px; }
.trust-strip .src::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--emerald); }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero { padding: clamp(40px, 6vw, 76px) 0 clamp(36px, 5vw, 60px); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
@media (max-width: 940px) { .hero-grid { grid-template-columns: 1fr; gap: 36px; } }
.hero h1 { margin: 18px 0 20px; }
.hero h1 .hl { color: var(--emerald-ink); }
.hero .lead { max-width: 540px; }
.hero .btnrow { margin-top: 30px; }
.hero .reassure { margin-top: 18px; font-size: .86rem; color: var(--ink-3); display: flex; gap: 18px; flex-wrap: wrap; }
.hero .reassure span { display: inline-flex; align-items: center; gap: 6px; }
.hero .reassure svg { width: 15px; height: 15px; color: var(--emerald); }

/* ── Forms / calculator UI ───────────────────────────────────────────────── */
.field { margin-bottom: 18px; }
.field > label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 7px; color: var(--ink); }
.field .hint { font-size: .8rem; color: var(--ink-3); margin-top: 6px; }
.input, .select, select.input {
  width: 100%; font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: var(--bg-2); border: 1.5px solid var(--line-2); border-radius: var(--r-sm);
  padding: 13px 14px; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus { border-color: var(--emerald); box-shadow: 0 0 0 3px color-mix(in srgb, var(--emerald) 22%, transparent); outline: none; }
.input-group { display: flex; align-items: stretch; }
.input-group .addon { display: grid; place-items: center; padding: 0 14px; background: var(--bg-3); border: 1.5px solid var(--line-2); color: var(--ink-3); font-family: var(--mono); font-size: .9rem; }
.input-group .addon.pre { border-right: none; border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-group .addon.suf { border-left: none; border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.input-group .input { border-radius: 0; }
.input-group .addon.pre + .input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.input-group .input:has(+ .addon.suf), .input-group .input:not(:last-child) { border-radius: var(--r-sm) 0 0 var(--r-sm); }

/* segmented options */
.segments { display: flex; flex-wrap: wrap; gap: 8px; }
.segments label {
  flex: 1 1 auto; min-width: 80px; text-align: center; cursor: pointer; font-size: .9rem; font-weight: 500;
  padding: 11px 12px; border: 1.5px solid var(--line-2); border-radius: var(--r-sm); background: var(--bg-2); color: var(--ink-2);
  transition: border-color .12s, background .12s, color .12s;
}
.segments input { position: absolute; opacity: 0; pointer-events: none; }
.segments label:hover { border-color: var(--line-2); background: var(--bg-3); }
.segments input:checked + span, .segments label:has(input:checked) { }
.segments label.sel { border-color: var(--forest); background: color-mix(in srgb, var(--emerald) 10%, var(--bg-2)); color: var(--forest); font-weight: 600; }

input[type="range"] { width: 100%; accent-color: var(--emerald); height: 26px; }
.range-val { font-family: var(--mono); font-weight: 600; color: var(--emerald-ink); }

/* calculator shell */
.calc-shell { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 900px) { .calc-shell { grid-template-columns: 1fr; } }
.calc-panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow-sm); }
.calc-result { position: sticky; top: calc(var(--nav-h) + 16px); }
.result-headline { background: var(--bg-forest); color: #fff; border-radius: var(--r-lg); padding: 26px; }
.result-headline .eyebrow { color: var(--lime); }
.result-headline .big { font-family: var(--serif); font-size: clamp(2.2rem,6vw,3rem); font-weight: 600; color: var(--lime); line-height: 1; margin: 10px 0 4px; }
.result-headline .sub { color: var(--ink-on-forest-2); font-size: .92rem; }
.result-rows { margin-top: 18px; }
.result-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.result-row:first-child { border-top: none; }
.result-row .k { color: var(--ink-2); font-size: .94rem; }
.result-row .v { font-family: var(--mono); font-weight: 600; font-size: 1.05rem; color: var(--ink); text-align: right; }
.result-row .v.pos { color: var(--emerald-ink); }

/* ── Tables / rankings ───────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-2); }
table.tgc { width: 100%; border-collapse: collapse; font-size: .94rem; min-width: 640px; }
table.tgc th, table.tgc td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); }
table.tgc thead th { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; background: var(--bg-3); }
table.tgc tbody tr:hover { background: var(--bg-inset); }
table.tgc tbody tr:last-child td { border-bottom: none; }
table.tgc .num { font-family: var(--mono); }
.rank-no { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; color: var(--ink-3); width: 34px; }
.rank-1 { color: var(--emerald-ink); }
.score-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; padding: 4px 9px; border-radius: var(--r-sm); font-family: var(--mono); font-weight: 700; font-size: .92rem; }
.score-a { background: color-mix(in srgb, var(--emerald) 18%, var(--bg-2)); color: var(--emerald-ink); }
.score-b { background: var(--bg-3); color: var(--ink-2); }
.score-c { background: var(--amber-bg); color: var(--amber); }
.score-d { background: var(--danger-bg); color: var(--danger); }
.stars { color: var(--star); letter-spacing: 1px; font-size: .9rem; }
.stars .off { color: var(--line-2); }

/* ── Callouts ────────────────────────────────────────────────────────────── */
.callout { border: 1px solid var(--line); border-left: 4px solid var(--emerald); background: var(--bg-2); border-radius: var(--r); padding: 18px 20px; font-size: .94rem; color: var(--ink-2); }
.callout strong { color: var(--ink); }
.callout-info { border-left-color: var(--info); background: var(--info-bg); }
.callout-warn { border-left-color: var(--amber); background: var(--amber-bg); }
.callout-title { font-weight: 700; color: var(--ink); margin-bottom: 5px; display: flex; align-items: center; gap: 8px; }

/* ── Article / post cards ────────────────────────────────────────────────── */
.post-card { display: flex; flex-direction: column; gap: 10px; height: 100%; }
.post-card .kicker { font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--emerald-ink); font-weight: 600; }
.post-card h3 { font-size: 1.16rem; line-height: 1.25; margin: 0; }
.post-card a:hover h3 { color: var(--emerald-ink); }
.post-card p { font-size: .92rem; color: var(--ink-3); margin: 0; flex: 1; }
.post-card .meta { font-size: .8rem; color: var(--ink-3); display: flex; gap: 12px; }

/* big editorial lead card */
.lead-card { display: grid; grid-template-columns: 1.3fr 1fr; gap: 0; overflow: hidden; padding: 0; }
@media (max-width: 760px) { .lead-card { grid-template-columns: 1fr; } }
.lead-card .lc-body { padding: 30px; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.lead-card .lc-side { background: var(--bg-forest); color: #fff; padding: 30px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.lead-card .lc-side .eyebrow { color: var(--lime); }
/* The global `p { color: var(--ink-2) }` overrides the inherited white here, leaving dark
   text on the forest panel. Restore a light, AA-compliant colour. */
.lead-card .lc-side p { color: var(--ink-on-forest-2); }

/* grant card */
.grant-card { display: flex; flex-direction: column; gap: 12px; }
.grant-card .gc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.grant-card .amount { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; color: var(--emerald-ink); line-height: 1; }
.grant-card .glist { list-style: none; display: grid; gap: 7px; }
.grant-card .glist li { font-size: .9rem; color: var(--ink-2); padding-left: 24px; position: relative; }
.grant-card .glist li::before { content: ""; position: absolute; left: 0; top: 7px; width: 13px; height: 13px; border-radius: 50%; background: color-mix(in srgb, var(--emerald) 22%, var(--bg-2)); }
.grant-card .glist li::after { content: ""; position: absolute; left: 4px; top: 10px; width: 5px; height: 3px; border-left: 1.5px solid var(--emerald-ink); border-bottom: 1.5px solid var(--emerald-ink); transform: rotate(-45deg); }

/* comparison vs card */
.vs-card { text-align: center; }
.vs-card .vs-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 6px 0 10px; }
.vs-card .vs-row .opt { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; color: var(--ink); }
.vs-card .vs { font-family: var(--mono); font-size: .8rem; color: var(--ink-3); background: var(--bg-3); border-radius: var(--r-pill); padding: 3px 9px; }

/* testimonial */
.quote-card { display: flex; flex-direction: column; gap: 16px; }
.quote-card blockquote { font-family: var(--serif); font-size: 1.12rem; line-height: 1.5; color: var(--ink); }
.quote-card .who { display: flex; align-items: center; gap: 12px; }
.quote-card .who .av { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-forest); color: var(--lime); display: grid; place-items: center; font-family: var(--serif); font-weight: 600; }
.quote-card .who .nm { font-weight: 650; font-size: .92rem; color: var(--ink); }
.quote-card .who .loc { font-size: .82rem; color: var(--ink-3); }

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.crumbs { font-size: .85rem; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 18px 0; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--emerald-ink); }
.crumbs .sep { opacity: .5; }

/* ── Newsletter band ─────────────────────────────────────────────────────── */
.news-band { background: var(--bg-forest); color: #fff; border-radius: var(--r-xl); padding: clamp(32px, 5vw, 56px); }
.news-band h2 { color: #fff; }
.news-band p { color: var(--ink-on-forest-2); }
.news-form { display: flex; gap: 10px; max-width: 460px; margin-top: 22px; flex-wrap: wrap; }
.news-form input { flex: 1 1 220px; padding: 14px 16px; border-radius: var(--r); border: 1.5px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; font-size: 1rem; font-family: var(--sans); }
.news-form input::placeholder { color: var(--ink-on-forest-2); }
.news-form input:focus { border-color: var(--lime); outline: none; }
.news-note { font-size: .78rem; color: var(--ink-on-forest-2); margin-top: 12px; }
.form-status { font-size: .88rem; margin-top: 12px; min-height: 1.2em; }
.form-status.ok { color: var(--lime); }
.form-status.err { color: #ffb4ac; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--line); padding: 56px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 30px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { font-family: var(--sans); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; }
.footer-grid ul { list-style: none; display: grid; gap: 9px; }
.footer-grid ul a { color: var(--ink-2); font-size: .92rem; }
.footer-grid ul a:hover { color: var(--emerald-ink); }
.footer-brand p { font-size: .9rem; color: var(--ink-3); margin-top: 12px; max-width: 280px; }
.footer-legal-note { margin-top: 40px; padding: 22px 0; border-top: 1px solid var(--line); font-size: .82rem; color: var(--ink-3); max-width: 760px; }

/* site-info-bar (versioned by pre-commit hook — keep markup shape) */
.site-info-bar {
  width: 100%; padding: 16px 24px; display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); background: var(--bg);
}
.site-info-bar span, .site-info-bar a { font-family: var(--mono); font-size: .7rem; color: var(--ink-3); text-decoration: none; }
.site-info-bar a:hover { color: var(--ink); }
.site-info-bar .sep { opacity: .35; }
.site-info-bar .beta-tag { font-size: .58rem; font-weight: 700; letter-spacing: .08em; background: var(--lime); color: var(--forest); padding: 1px 5px; border-radius: 3px; }

/* ── Misc utilities ──────────────────────────────────────────────────────── */
.divider-dot { color: var(--ink-3); opacity: .5; }
.tick-list { list-style: none; display: grid; gap: 10px; }
.tick-list li { position: relative; padding-left: 30px; color: var(--ink-2); }
.tick-list li::before { content: ""; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: color-mix(in srgb, var(--emerald) 16%, var(--bg-2)); }
.tick-list li::after { content: ""; position: absolute; left: 6px; top: 7px; width: 7px; height: 4px; border-left: 2px solid var(--emerald-ink); border-bottom: 2px solid var(--emerald-ink); transform: rotate(-45deg); }
.note-source { font-size: .8rem; color: var(--ink-3); font-style: italic; }
.hide { display: none !important; }
@media (max-width: 620px) { .hide-mobile { display: none !important; } }

/* ── Legal / policy documents (privacy, terms, data-retention, disclaimers) ── */
.wrap { max-width: var(--maxw-read); margin: 0 auto; padding: 40px 24px 24px; }
.doc-head { margin-bottom: 14px; }
.doc-head h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.doc-meta { font-family: var(--mono); font-size: .72rem; color: var(--ink-3); margin-top: 10px; }
.intro { background: var(--bg-2); border: 1px solid var(--line); border-left: 4px solid var(--emerald); border-radius: var(--r); padding: 16px 18px; color: var(--ink-2); font-size: .94rem; margin: 20px 0 34px; }
.intro strong { color: var(--ink); }
.toc { margin: 0 0 38px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; }
.toc h2 { font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.toc ol { list-style: none; counter-reset: toc; display: grid; gap: 7px; grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .toc ol { grid-template-columns: 1fr; } }
.toc li { counter-increment: toc; }
.toc a { color: var(--ink-2); font-size: .9rem; }
.toc a::before { content: counter(toc) ". "; color: var(--ink-3); font-family: var(--mono); }
.toc a:hover { color: var(--emerald-ink); }
.wrap section { margin-bottom: 30px; scroll-margin-top: 84px; }
.wrap section h2 { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.wrap section h2 .n { color: var(--ink-3); font-family: var(--mono); font-size: .82rem; margin-right: 10px; }
.wrap section h3 { font-family: var(--sans); font-size: 1.02rem; font-weight: 650; margin: 18px 0 6px; }
.wrap section p { color: var(--ink-2); margin-bottom: 12px; }
.wrap section p:last-child { margin-bottom: 0; }
.wrap section ul { color: var(--ink-2); margin: 0 0 12px; padding-left: 22px; }
.wrap section li { margin-bottom: 6px; }
.note { background: var(--info-bg); border: 1px solid var(--line); border-left: 3px solid var(--info); border-radius: var(--r-sm); padding: 13px 16px; font-size: .88rem; color: var(--ink-2); margin: 6px 0 12px; }
.note strong { color: var(--info); }
.note.warn { background: var(--amber-bg); border-left-color: var(--amber); }
.note.warn strong { color: var(--amber); }

/* ── Blog: article + index ──────────────────────────────────────────────── */
.back-link { font-family: var(--mono); font-size: .76rem; color: var(--ink-3); }
.back-link:hover { color: var(--emerald-ink); }
article.post { margin-top: 14px; }
article.post .post-meta { font-family: var(--mono); font-size: .72rem; color: var(--ink-3); letter-spacing: .04em; margin-bottom: 14px; }
article.post .post-meta .dot { opacity: .4; margin: 0 7px; }
article.post h1 { font-family: var(--serif); font-size: clamp(2rem, 4.4vw, 2.8rem); line-height: 1.12; margin-bottom: 18px; }
article.post h2 { font-family: var(--serif); font-size: 1.5rem; margin: 34px 0 12px; }
article.post h3 { font-family: var(--sans); font-size: 1.08rem; font-weight: 650; margin: 22px 0 6px; color: var(--ink); }
article.post p { color: var(--ink-2); margin-bottom: 15px; font-size: 1.05rem; }
article.post ul, article.post ol { color: var(--ink-2); margin: 0 0 15px; padding-left: 24px; }
article.post li { margin-bottom: 8px; }
article.post strong { color: var(--ink); font-weight: 650; }
.tbl { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: .92rem; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 10px 13px; text-align: left; color: var(--ink-2); vertical-align: top; }
.tbl th { background: var(--bg-3); color: var(--ink); font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
.tbl td strong { color: var(--ink); }
.faq-q { font-size: 1.05rem; font-weight: 650; color: var(--ink); margin: 20px 0 4px; }
.home-cta { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; background: var(--bg-forest); color: #fff; border-radius: var(--r-lg); padding: 24px 26px; margin: 36px 0 26px; }
.home-cta-title { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; color: #fff; }
.home-cta-sub { font-size: .9rem; color: var(--ink-on-forest-2); margin-top: 4px; }
.home-cta-btn { font-family: var(--sans); font-size: .9rem; font-weight: 600; background: var(--lime); color: var(--forest); border: 1.5px solid var(--lime); padding: 13px 22px; border-radius: var(--r); text-decoration: none; white-space: nowrap; transition: filter .15s, transform .1s; }
.home-cta-btn:hover { filter: brightness(1.04); transform: translateY(-1px); color: var(--forest); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 24px; }
@media (max-width: 560px) { .post-nav { grid-template-columns: 1fr; } }
.post-nav-link { display: flex; flex-direction: column; gap: 5px; text-decoration: none; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 15px 17px; transition: border-color .15s, transform .1s, box-shadow .15s; }
.post-nav-link:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.post-nav-link.next { text-align: right; align-items: flex-end; }
.pn-dir { font-family: var(--mono); font-size: .68rem; color: var(--emerald-ink); letter-spacing: .04em; }
.pn-title { font-size: .94rem; font-weight: 650; color: var(--ink); }
.related-label { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 30px 0 4px; }

/* blog index: hero, post cards, pagination (legacy class + id names) */
.wrap .hero { text-align: left; padding: 8px 0 12px; }
.wrap .hero h1 { font-size: clamp(2rem, 4.4vw, 2.8rem); margin-bottom: 12px; }
.wrap .hero p { color: var(--ink-2); font-size: 1.06rem; }
.section-label { font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 26px 0 14px; }
.post-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 720px) { .post-list { grid-template-columns: 1fr; } }
.post-list .post-card { display: flex; flex-direction: column; gap: 9px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; text-decoration: none; transition: transform .16s, box-shadow .16s, border-color .16s; height: 100%; }
.post-list .post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }
.pc-meta { font-family: var(--mono); font-size: .7rem; color: var(--ink-3); letter-spacing: .03em; }
.pc-meta .dot { opacity: .4; margin: 0 5px; }
.pc-title { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; line-height: 1.25; color: var(--ink); }
.post-list .post-card:hover .pc-title { color: var(--emerald-ink); }
.pc-hook { font-size: .92rem; color: var(--ink-3); margin: 0; flex: 1; }
.read-btn { font-weight: 600; font-size: .88rem; color: var(--emerald-ink); margin-top: 4px; }
#pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 36px 0 0; }
#pagination button { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); width: 42px; height: 42px; cursor: pointer; color: var(--ink); display: grid; place-items: center; font-size: 1.1rem; transition: border-color .15s, background .15s; }
#pagination button:hover:not(:disabled) { border-color: var(--forest); }
#pagination button:disabled { opacity: .35; cursor: default; }
#pgInfo { font-family: var(--mono); font-size: .8rem; color: var(--ink-3); }

/* ── Calculator tools: save / compare / PDF (injected by tgc.js) ──────────── */
.tgc-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.tgc-toolbar .btn { flex: 1 1 auto; }
.tgc-saved-count { font-family: var(--mono); font-weight: 700; }

/* compare modal */
.tgc-modal { position: fixed; inset: 0; z-index: 400; display: none; }
.tgc-modal.open { display: block; }
.tgc-modal-backdrop { position: absolute; inset: 0; background: rgba(8,19,14,.55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.tgc-modal-card { position: relative; max-width: 920px; margin: 6vh auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); max-height: 88vh; overflow: auto; padding: 26px; }
.tgc-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.tgc-modal-head h2 { font-size: 1.5rem; }
.tgc-modal-close { background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--r-sm); width: 38px; height: 38px; cursor: pointer; color: var(--ink); font-size: 1.1rem; flex-shrink: 0; }
.tgc-compare-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tgc-compare-table th, .tgc-compare-table td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tgc-compare-table thead th { font-family: var(--serif); font-size: 1rem; color: var(--ink); background: var(--bg-3); }
.tgc-compare-table thead th small { display: block; font-family: var(--mono); font-weight: 400; font-size: .68rem; color: var(--ink-3); margin-top: 3px; }
.tgc-compare-table .metric { font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.tgc-compare-table td .v { font-family: var(--mono); font-weight: 600; color: var(--ink); }
.tgc-compare-table .rm { background: none; border: none; color: var(--danger); cursor: pointer; font-size: .8rem; font-family: var(--mono); padding: 0; }
.tgc-empty { color: var(--ink-3); padding: 24px 0; text-align: center; }
.tgc-print-header { display: none; }

/* ── Print: turn any page into a clean PDF report ────────────────────────── */
@media print {
  .site-header, .mobile-nav, .site-footer, .site-info-bar, .skip-link, .nav-toggle,
  .theme-btn, .news-band, .tgc-toolbar, .tgc-modal, form, .crumbs,
  #sc-cookie-banner, .sc-cookie-banner, [id*="cookie"], details { display: none !important; }
  html, body { background: #fff !important; color: #111 !important; font-size: 11.5pt; }
  .section, .section-sm { padding: 10px 0 !important; }
  a { color: #111 !important; text-decoration: none !important; }
  .container { max-width: none; padding: 0; }
  .calc-shell { display: block !important; }
  .calc-panel { display: none !important; }
  .card, .result-headline { box-shadow: none !important; border: 1px solid #bbb !important; break-inside: avoid; }
  .result-headline, .section-forest, .lc-side { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tgc-print-header { display: block !important; border-bottom: 2px solid #0e3b2e; padding-bottom: 10px; margin-bottom: 16px; }
  .tgc-print-header .pb { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; color: #0e3b2e; }
  .tgc-print-header .pm { font-family: var(--mono); font-size: .75rem; color: #555; }
}
