/* ==========================================================================
   AskSolarEnergy: shared.css
   Design system + global styles. Every page loads this file only.
   Token-driven, dark-mode aware, zero framework dependencies.
   ========================================================================== */

/* ---------------------------------------------------------------------- */
/* 1. RESET                                                                */
/* ---------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote, dl, dd {
  margin: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
body {
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--clr-ink);
  background: var(--clr-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, picture, svg, video { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; font-weight: 700; }

/* In-content links must be clearly visible: amber, bold and underlined, so a reader and Google can tell them from plain text. Buttons are excluded. */
main p a:not(.btn), main li a:not(.btn), main td a:not(.btn) {
  color: var(--clr-amber-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
[data-theme='dark'] main p a:not(.btn), [data-theme='dark'] main li a:not(.btn), [data-theme='dark'] main td a:not(.btn) {
  color: var(--clr-amber);
}
ul[role='list'], ol[role='list'] { list-style: none; padding: 0; }
table { border-collapse: collapse; width: 100%; }

/* ---------------------------------------------------------------------- */
/* 2. DESIGN TOKENS                                                        */
/* ---------------------------------------------------------------------- */
:root {
  /* ---- Color: light (paper) mode ---- */
  --clr-bg:            #F7F5EF;
  --clr-bg-raised:     #FFFFFF;
  --clr-bg-sunk:       #EFEBE0;
  --clr-ink:            #10181C;
  --clr-ink-soft:       #45535A;
  --clr-ink-faint:      #7C8890;
  --clr-line:           #E1DCCC;
  --clr-line-strong:    #C9C2AC;

  --clr-amber:          #FF8A34;
  --clr-amber-ink:      #7A3E0E;
  --clr-amber-soft:     #FFE3C4;
  --clr-teal:           #1C7C6B;
  --clr-teal-ink:       #0E3B34;
  --clr-teal-soft:      #D7ECE6;
  --clr-pine:           #0E3B43;

  --clr-success:        #1C7C6B;
  --clr-warning:        #B8790E;
  --clr-danger:         #B5432E;
  --clr-info:           #2A6C9E;

  --grad-sunrise: linear-gradient(135deg, #FF8A34 0%, #FFC46B 45%, #F7F5EF 100%);
  --grad-horizon: linear-gradient(180deg, rgba(255,138,52,0.14) 0%, rgba(28,124,107,0.10) 100%);
  --grad-ink: linear-gradient(135deg, #10181C 0%, #0E3B43 100%);

  /* ---- Typography ---- */
  --font-display: 'Rajdhani', 'Rajdhani-fallback', 'Arial', sans-serif;
  --font-body: 'DM Sans', 'DM Sans-fallback', 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Plex Mono-fallback', ui-monospace, 'SF Mono', Menlo, monospace;

  --fs-2xs:  clamp(0.72rem, 0.70rem + 0.1vw, 0.78rem);
  --fs-xs:   clamp(0.82rem, 0.79rem + 0.15vw, 0.88rem);
  --fs-sm:   clamp(0.92rem, 0.89rem + 0.15vw, 0.98rem);
  --fs-base: clamp(1rem, 0.97rem + 0.15vw, 1.06rem);
  --fs-md:   clamp(1.15rem, 1.1rem + 0.25vw, 1.3rem);
  --fs-lg:   clamp(1.4rem, 1.3rem + 0.5vw, 1.7rem);
  --fs-xl:   clamp(1.8rem, 1.6rem + 1vw, 2.3rem);
  --fs-2xl:  clamp(2.3rem, 1.9rem + 2vw, 3.4rem);
  --fs-3xl:  clamp(2.3rem, 1.9rem + 2vw, 3.6rem);

  --lh-tight: 1.08;
  --lh-snug: 1.25;
  --lh-normal: 1.55;

  /* ---- Spacing scale ---- */
  --sp-3xs: 0.25rem;
  --sp-2xs: 0.5rem;
  --sp-xs:  0.75rem;
  --sp-sm:  1rem;
  --sp-md:  1.5rem;
  --sp-lg:  2.25rem;
  --sp-xl:  3.5rem;
  --sp-2xl: 5.5rem;
  --sp-3xl: 8rem;

  /* ---- Radius / shadow / motion ---- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(16,24,28,0.06), 0 1px 1px rgba(16,24,28,0.04);
  --shadow-md: 0 8px 24px rgba(16,24,28,0.08), 0 2px 6px rgba(16,24,28,0.05);
  --shadow-lg: 0 24px 60px rgba(16,24,28,0.14), 0 8px 20px rgba(16,24,28,0.08);
  --shadow-glow-amber: 0 0 0 1px rgba(255,138,52,0.25), 0 12px 30px rgba(255,138,52,0.20);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 150ms;
  --dur-base: 260ms;
  --dur-slow: 480ms;

  --container-w: 1240px;
  --header-h: 76px;
}

/* Fallback faces sized to match the web fonts, so text does not move when a
   web font loads and the layout shift stays under 0.1. Values are computed
   from the real font files: Rajdhani is condensed, so its fallback is scaled
   to 88.1 percent of Arial; DM Sans is close to Arial at 97.1 percent. */
@font-face {
  font-family: 'Rajdhani-fallback';
  src: local('Arial');
  font-weight: 100 900;
  size-adjust: 88.1%;
  ascent-override: 93%;
  descent-override: 34.6%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'DM Sans-fallback';
  src: local('Segoe UI'), local('Arial');
  font-weight: 100 900;
  size-adjust: 97.1%;
  ascent-override: 99.2%;
  descent-override: 31%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Plex Mono-fallback';
  src: local('Courier New'), local('DejaVu Sans Mono');
  font-weight: 100 900;
  size-adjust: 100%;
  ascent-override: 102.5%;
  descent-override: 27.5%;
  line-gap-override: 0%;
}

/* ---- Dark mode ---- */
[data-theme='dark'] {
  --clr-bg:            #0A1116;
  --clr-bg-raised:     #101A20;
  --clr-bg-sunk:       #060B0E;
  --clr-ink:            #EDF1F2;
  --clr-ink-soft:       #A9B7BC;
  --clr-ink-faint:      #6D7B80;
  --clr-line:           #1E2A30;
  --clr-line-strong:    #2C3A41;

  --clr-amber-soft:     rgba(255,138,52,0.14);
  --clr-teal-soft:      rgba(28,124,107,0.18);

  --grad-horizon: linear-gradient(180deg, rgba(255,138,52,0.10) 0%, rgba(28,124,107,0.14) 100%);
  --grad-ink: linear-gradient(135deg, #0A1116 0%, #0E3B43 100%);

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.45);
  --shadow-lg: 0 24px 60px rgba(0,0,0,0.55);
}

/* ---------------------------------------------------------------------- */
/* 3. LAYOUT PRIMITIVES                                                    */
/* ---------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: var(--sp-md);
}
.container--narrow { max-width: 820px; }
.container--wide { max-width: 1440px; }

.section { padding-block: var(--sp-2xl); }
.section--tight { padding-block: var(--sp-xl); }
.section--sunk { background: var(--clr-bg-sunk); }

/* AD-ONLY SECTIONS: a .section--tight that wraps nothing but a single
   standalone ad slot (sitewide-header, below-hero-leaderboard,
   post-tool-leaderboard) doesn't need the full hero/body section padding
   on both sides. Halves the vertical space so ad slots don't create large
   empty gaps when stacked against a neighboring section. Uses a plain
   class, not :has(), so it works in every browser without exception. */
.section--tight.section--ad-only {
  padding-block: var(--sp-md);
}

/* SECTION ABOVE THE CALCULATOR: on the pages that carry a disclaimer or
   notice card above the calculator, that card section and the tool section
   each add 56px of padding, leaving 112px of empty space above the
   calculator. The section right above the tool is the card when it is not
   the hero band, so drop its bottom padding and the gap becomes 56px, the
   same as the hero-to-card gap. The hero band is excluded because its
   bottom padding sits inside the orange band and the tool section's own
   top padding already gives the right gap there. */
section:has(+ #ase-tool-section):not(:has(.lede)) {
  padding-bottom: 0;
}

/* STACKED SECTIONS: when two sections sit next to each other, the gap
   between them is one section's padding, not two. The upper section gives
   up its bottom padding and the lower section's top padding sets the gap
   (56px for a tight section, 88px for a full section). This removes the
   wide empty bands that used to sit between every pair of sections on a
   tool page. The old .tool-infographic padding-top rule is gone on
   purpose: the slider and the infographic image now get their top gap
   from the section above, the same as every other section. */
:is(.section, .section--tight):has(+ :is(.section, .section--tight)) {
  padding-bottom: 0;
}

/* Round 3 homepage grid seams (2026-11-20).
   Two homepage sections end with a card grid and sit directly above a
   section with a different background. The sitewide stacked-sections rule
   in shared.css sets padding-bottom: 0 on such sections, so the background
   change ran 1px below the last card row and the cards looked cut off at
   the bottom. The cards were never clipped; their borders render fully.
   Fix: give each grid section 24px of its own bottom padding and take the
   same 24px off the top padding of the section that follows it, so the
   total gap stays 88px and the colour change lands 24px below the cards.
   Scoped to body[data-category="home"] so only the homepage changes.
   The blog grid is left alone: no background change sits below it.
   Grid gaps and row heights are not touched. */

body[data-category="home"] #featured-calculators {
  padding-bottom: var(--sp-md);
}

body[data-category="home"] #categories {
  padding-top: calc(var(--sp-2xl) - var(--sp-md));
  padding-bottom: var(--sp-md);
}

body[data-category="home"] #categories + .section {
  padding-top: calc(var(--sp-2xl) - var(--sp-md));
}

/* Round 3 homepage grid seams, extra (2026-11-20).
   The remaining three homepage sections that end with a card grid and sit
   directly above a section with a different background. The sitewide
   stacked-sections rule in shared.css sets padding-bottom: 0 on such
   sections, so the background change ran 1px below the last card row and
   the cards looked cut off at the bottom. The cards were never clipped;
   their borders render fully.
   Fix, same as homepage-grids.css: give each grid section 24px of its own
   bottom padding and take the same 24px off the top padding of the
   section that follows it, so the total gap stays 88px and the colour
   change lands 24px below the cards.
   Scoped to body[data-category="home"] so only the homepage changes.
   Hooks added to index.html for this patch: id="home-stats" (stat strip),
   id="quote-check" (Built to check quotes against), id="home-glossary"
   (The glossary). The following sections for seams 5 and 7 carry no id,
   so they are reached with a sibling selector. Seam 1 follows into
   #featured-calculators, which already has its bottom padding set by
   homepage-grids.css; this patch only touches its top padding, so the
   two patches do not conflict.
   Grid gaps and row heights are not touched. */

body[data-category="home"] #home-stats {
  padding-bottom: var(--sp-md);
}

body[data-category="home"] #featured-calculators {
  padding-top: calc(var(--sp-2xl) - var(--sp-md));
}

body[data-category="home"] #quote-check {
  padding-bottom: var(--sp-md);
}

body[data-category="home"] #quote-check + .section {
  padding-top: calc(var(--sp-2xl) - var(--sp-md));
}

body[data-category="home"] #home-glossary {
  padding-bottom: var(--sp-md);
}

body[data-category="home"] #home-glossary + .section {
  padding-top: calc(var(--sp-2xl) - var(--sp-md));
}

/* HUB GRID SEAMS (2026-11-20, round 3)
   Defect: on hub pages, a card grid sits at the bottom of a section and the
   next section has a different background (plain vs sunk). The stacked
   section rule sets the upper section's bottom padding to 0, so the colour
   change runs 1px below the last card row and the cards look cut off.
   Fix, rhythm preserving: the section ending with the grid gets 24px of
   bottom padding (var(--sp-md)), and the following section's top padding
   drops from 88px to 64px, so the total gap stays 88px and the colour
   change happens 24px below the cards, inside the first section's own
   background.
   Scope: body[data-category] for the 15 category hubs plus the glossary
   only. Two patterns cover the two background directions (sunk to plain,
   plain to sunk), so a grid section followed by a section with the SAME
   background is left alone. The :has(+ section) guard means a grid in a
   page's last section (the related-tools grid on tool pages) never
   matches. The homepage (data-category="home") and the blog index are
   not covered here; they belong to other workers. No grid gap, no row
   height, and no other page is changed by these rules. */

/* 15 category hubs: the grid is the last child of the section's container.
   Pattern A: sunk section ending with a grid, followed by a plain section. */
:is(body[data-category="battery-chemistry-storage"],
    body[data-category="battery-storage"],
    body[data-category="commercial-small-business"],
    body[data-category="community-shared-solar"],
    body[data-category="financing"],
    body[data-category="grid-offgrid"],
    body[data-category="inverters-equipment"],
    body[data-category="maintenance-lifespan"],
    body[data-category="off-grid-rv-cabin"],
    body[data-category="performance-output"],
    body[data-category="rebates-incentives"],
    body[data-category="savings-payback"],
    body[data-category="solar-ev-integration"],
    body[data-category="solar-roofing-integration"],
    body[data-category="system-sizing"])
    main > section.section--sunk:has(+ section:not(.section--sunk)):has(> .container > .grid:last-child) {
  padding-bottom: var(--sp-md);
}

:is(body[data-category="battery-chemistry-storage"],
    body[data-category="battery-storage"],
    body[data-category="commercial-small-business"],
    body[data-category="community-shared-solar"],
    body[data-category="financing"],
    body[data-category="grid-offgrid"],
    body[data-category="inverters-equipment"],
    body[data-category="maintenance-lifespan"],
    body[data-category="off-grid-rv-cabin"],
    body[data-category="performance-output"],
    body[data-category="rebates-incentives"],
    body[data-category="savings-payback"],
    body[data-category="solar-ev-integration"],
    body[data-category="solar-roofing-integration"],
    body[data-category="system-sizing"])
    main > section.section--sunk:has(+ section:not(.section--sunk)):has(> .container > .grid:last-child) + section:not(.section--sunk) {
  padding-top: 64px;
}

/* Pattern B: plain section ending with a grid, followed by a sunk section. */
:is(body[data-category="battery-chemistry-storage"],
    body[data-category="battery-storage"],
    body[data-category="commercial-small-business"],
    body[data-category="community-shared-solar"],
    body[data-category="financing"],
    body[data-category="grid-offgrid"],
    body[data-category="inverters-equipment"],
    body[data-category="maintenance-lifespan"],
    body[data-category="off-grid-rv-cabin"],
    body[data-category="performance-output"],
    body[data-category="rebates-incentives"],
    body[data-category="savings-payback"],
    body[data-category="solar-ev-integration"],
    body[data-category="solar-roofing-integration"],
    body[data-category="system-sizing"])
    main > section:not(.section--sunk):has(+ section.section--sunk):has(> .container > .grid:last-child) {
  padding-bottom: var(--sp-md);
}

:is(body[data-category="battery-chemistry-storage"],
    body[data-category="battery-storage"],
    body[data-category="commercial-small-business"],
    body[data-category="community-shared-solar"],
    body[data-category="financing"],
    body[data-category="grid-offgrid"],
    body[data-category="inverters-equipment"],
    body[data-category="maintenance-lifespan"],
    body[data-category="off-grid-rv-cabin"],
    body[data-category="performance-output"],
    body[data-category="rebates-incentives"],
    body[data-category="savings-payback"],
    body[data-category="solar-ev-integration"],
    body[data-category="solar-roofing-integration"],
    body[data-category="system-sizing"])
    main > section:not(.section--sunk):has(+ section.section--sunk):has(> .container > .grid:last-child) + section.section--sunk {
  padding-top: 64px;
}

/* Glossary: grids sit inside .az-group divs, so only the last letter
   group's grid ends the section. Plain section to sunk FAQ section.
   Same 24px / 88px to 64px fix. */
body[data-category="glossary"]
    main > section:not(.section--sunk):has(+ section.section--sunk):has(> .container > .az-group:last-child > .grid:last-child) {
  padding-bottom: var(--sp-md);
}

body[data-category="glossary"]
    main > section:not(.section--sunk):has(+ section.section--sunk):has(> .container > .az-group:last-child > .grid:last-child) + section.section--sunk {
  padding-top: 64px;
}

/* TOOL-PAGE GRID SEAMS (2026-11-20, round 3 residual)
   Defect: three diagram-skip tool pages have no infographic section
   between the tool section and the "How it works" section, so the tool
   section's .page-layout grid sits at the very bottom of its section and
   the next section is sunk. The sitewide stacked-sections rule sets the
   upper section's bottom padding to 0, so the background change runs 0px
   below the last grid row and the tool card and sidebar look cut off.
   Fix, rhythm preserving: the tool section gets 24px of bottom padding
   (var(--sp-md)), and the following sunk section's top padding drops
   from 88px to 64px, so the total gap stays 88px and the colour change
   happens 24px below the grid, inside the tool section's own background.
   Scope: a main > section.section--tight (not sunk) whose .container
   ends with .page-layout and which is directly followed by a sunk
   section. The :has(> .container > .page-layout:last-child) guard means
   a tool section followed by its infographic section never matches,
   and a grid that is not the last thing in its section never matches.
   Only three pages on the site match: the rebate deadline tracker,
   the maintenance log cost tracker, and the battery chemistry safety
   certification comparison tool. No grid gap, no row height, and no
   other page is changed by these rules. */

main > section.section--tight:not(.section--sunk):has(+ section.section--sunk):has(> .container > .page-layout:last-child) {
  padding-bottom: var(--sp-md);
}

main > section.section--tight:not(.section--sunk):has(+ section.section--sunk):has(> .container > .page-layout:last-child) + section.section--sunk {
  padding-top: 64px;
}

/* COMMUNITY-SHARED-SOLAR GAPS (2026-11-20): on every community tool page
   the breadcrumb-bar section and #ase-tool-section each carry an inline
   style="padding-bottom:var(--sp-md);" (24px), which beats the stacked
   rule above. This scoped rule restores it for those two sections only.
   !important is required: a plain rule loses to the inline style.
   Scope: body[data-category="community-shared-solar"] only. */
body[data-category="community-shared-solar"] main > section.section--tight[style*="padding-bottom"] {
  padding-bottom: 0 !important;
}

.grid { display: grid; gap: var(--sp-md); }
.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-auto { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-xs { gap: var(--sp-xs); }
.gap-sm { gap: var(--sp-sm); }
.gap-md { gap: var(--sp-md); }
.gap-lg { gap: var(--sp-lg); }

.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;
}

.skip-link {
  position: absolute; left: var(--sp-sm); top: -60px;
  background: var(--clr-ink); color: var(--clr-bg);
  padding: var(--sp-xs) var(--sp-sm); border-radius: var(--radius-sm);
  z-index: 1000; transition: top var(--dur-base) var(--ease-out);
  font-weight: 600; font-size: var(--fs-sm);
}
.skip-link:focus { top: var(--sp-sm); }

:focus-visible {
  outline: 3px solid var(--clr-amber);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------------- */
/* 4. TYPOGRAPHY                                                           */
/* ---------------------------------------------------------------------- */
h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: 0.005em;
  color: var(--clr-ink);
}
h1 { font-size: var(--fs-3xl); font-weight: 700; }
h2 { font-size: var(--fs-2xl); font-weight: 700; }
h3 { font-size: var(--fs-xl); font-weight: 600; }
h4 { font-size: var(--fs-md); font-weight: 600; }

p { font-size: var(--fs-base); color: var(--clr-ink-soft); }
.lede { font-size: var(--fs-lg); color: var(--clr-ink-soft); line-height: var(--lh-snug); }

/* ---------------------------------------------------------------------- */
/* HERO BAND: any .section--tight containing a .lede is treated as the    */
/* page hero and gets a bold solid brand band, matching a real product    */
/* header instead of blending into the page body. Pure CSS hook, no HTML  */
/* changes required: p.lede only ever appears once per page, in the hero. */
/* ---------------------------------------------------------------------- */
.section--tight:has(.lede) {
  background: linear-gradient(115deg, #E8721C 0%, var(--clr-amber) 55%, #FFA95C 100%);
  padding-block: var(--sp-xl);
  margin-bottom: 0;
}
.section--tight:has(.lede) .eyebrow {
  background: #1A0D02; color: #FFE3C4;
}
.section--tight:has(.lede) h1 {
  color: #1A0D02;
}
.section--tight:has(.lede) .lede {
  color: rgba(26,13,2,0.82);
}
[data-theme='dark'] .section--tight:has(.lede) {
  background: linear-gradient(115deg, #7A3E0E 0%, #B85E1E 55%, #D97A2E 100%);
}

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--sp-2xs);
  font-family: var(--font-mono); font-size: var(--fs-2xs);
  text-transform: uppercase; letter-spacing: 0.1em;
  color: #FFFFFF;
  background: var(--clr-teal);
  padding: 3px 9px; border-radius: var(--radius-sm);
  font-weight: 700;
}
[data-theme='dark'] .eyebrow { background: var(--clr-amber); color: #1A0D02; }
.eyebrow::before { content: none; }

.text-mono { font-family: var(--font-mono); }
.text-faint { color: var(--clr-ink-faint); }
.text-soft { color: var(--clr-ink-soft); }
.text-amber { color: var(--clr-amber-ink); }
[data-theme='dark'] .text-amber { color: var(--clr-amber); }
.text-teal { color: var(--clr-teal); }
.text-center { text-align: center; }
.text-balance { text-wrap: balance; }

/* ---------------------------------------------------------------------- */
/* 5. BUTTONS                                                              */
/* ---------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2xs);
  padding: 0.85rem 1.5rem; border-radius: var(--radius-sm);
  font-weight: 700; font-size: var(--fs-sm);
  border: 1px solid transparent; white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn--sm { padding: 0.55rem 1.05rem; font-size: var(--fs-xs); }
.btn--lg { padding: 1.05rem 1.9rem; font-size: var(--fs-md); }
.btn--block { width: 100%; }

.btn--primary {
  background: var(--clr-ink); color: var(--clr-bg-raised);
}
[data-theme='dark'] .btn--primary { background: var(--clr-amber); color: #1A0D02; }
.btn--primary:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.btn--accent {
  background: var(--clr-amber); color: #1A0D02; box-shadow: var(--shadow-sm);
}
.btn--accent:hover { background: #E8721C; box-shadow: var(--shadow-md); transform: translateY(-1px); }

.btn--outline {
  background: transparent; border-color: var(--clr-line-strong); color: var(--clr-ink);
}
.btn--outline:hover { border-color: var(--clr-ink); background: var(--clr-bg-sunk); }

.btn--ghost {
  background: transparent; color: var(--clr-ink-soft);
}
.btn--ghost:hover { color: var(--clr-ink); background: var(--clr-bg-sunk); }

.btn--icon {
  padding: 0.6rem; border-radius: var(--radius-full); background: transparent;
  border: 1px solid var(--clr-line);
}
.btn--icon:hover { background: var(--clr-bg-sunk); border-color: var(--clr-line-strong); }
.btn svg { width: 1.1em; height: 1.1em; flex-shrink: 0; }

/* ---------------------------------------------------------------------- */
/* 6. CARDS                                                                */
/* ---------------------------------------------------------------------- */
.card {
  background: var(--clr-bg-raised);
  border: 1px solid var(--clr-line);
  border-radius: var(--radius-md);
  padding: var(--sp-lg);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.card__title { font-size: var(--fs-md); }

/* ---------------------------------------------------------------------- */
/* AD SLOTS                                                                 */
/* ---------------------------------------------------------------------- */
/* Reserves layout space up front so ads never cause content to jump once
   they load. Each size has a fixed min-height matching its slot type;
   the label is muted and small so it reads as normal page chrome, not
   a placeholder. AdManager (shared.js) fills .ad-slot__unit at runtime. */
.ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2xs);
  background: var(--clr-bg-sunk);
  border: 1px dashed var(--clr-line-strong);
  border-radius: var(--radius-sm);
  padding: var(--sp-sm);
  overflow: hidden;
}
/* Ad slots placed mid-content (inside an article body, or directly
   following other stacked content within the same section) need their
   own explicit spacing, since neither .section's padding-block nor any
   paragraph/heading margin reaches an element sitting between them.
   Slots that sit alone as the sole child of a section (sitewide-header,
   below-hero-leaderboard, sidebar-rectangle inside the sticky sidebar
   column) are intentionally excluded here since .section/.section--tight
   padding, or the sidebar-specific rule below, already spaces those
   correctly on their own. */
.ad-slot--in-article,
.doc-section .ad-slot,
.ad-slot--leaderboard[data-slot-id="post-faq-leaderboard"],
.ad-slot--leaderboard[data-slot-id="post-tool-leaderboard"] {
  margin-block: 32px;
}
.ad-slot__label {
  font-size: var(--fs-xs);
  color: var(--clr-ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  align-self: flex-start;
}
.ad-slot__unit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Fixed min-heights match common IAB sizes so the slot never collapses
   or jumps once a real ad fills it. Width stays fluid (max-width: 100%).
   aspect-ratio gives responsive ad units (data-ad-format="auto") a clear
   orientation signal from their container: wide containers render
   horizontal units, tall/narrow containers render vertical units. This
   is a container-shape concern, not an AdManager JS concern - the JS
   in shared.js stays identical regardless of orientation. */
.ad-slot--leaderboard .ad-slot__unit {
  min-height: 90px;
  aspect-ratio: 728 / 90;      /* wide horizontal signal on desktop */
  max-width: 970px;
}
.ad-slot--rectangle .ad-slot__unit {
  min-height: 250px;
  aspect-ratio: 300 / 250;     /* near-square, reads as vertical in a narrow sidebar column */
  max-width: 336px;
}
.ad-slot--in-article .ad-slot__unit {
  min-height: 250px;
  aspect-ratio: 300 / 250;     /* same vertical-friendly ratio as sidebar, fits narrow article column */
  max-width: 336px;
}
.ad-slot--mobile-banner .ad-slot__unit {
  min-height: 100px;
  aspect-ratio: 320 / 100;     /* wide horizontal signal, sized for small screens */
  max-width: 320px;
}

/* Sidebar ad sits below the related-tools card, same sticky column. */
.page-sidebar .ad-slot { margin-top: var(--sp-md); }

@media (max-width: 720px) {
  /* Below this breakpoint, leaderboard containers narrow toward a
     more vertical-friendly ratio instead of staying wide-and-short,
     since a 728x90-shaped container on a narrow phone screen forces
     an awkward, cramped horizontal render. A taller ratio here lets
     responsive units pick a vertical layout instead when the screen
     itself is narrow. */
  .ad-slot--leaderboard .ad-slot__unit {
    min-height: 100px;
    aspect-ratio: 320 / 100;
  }
}

@media (max-width: 960px) {
  /* .page-layout is set inline on every tool page as a fixed 2-column
     grid (main content + a minmax(0,360px) sidebar column). A narrowed
     desktop browser window commonly still reports a viewport width
     well above 720px (that breakpoint is tuned for real phone screens),
     so this separate, wider breakpoint collapses the layout to a single
     column earlier, for narrow desktop windows and tablets too, not
     just phones. !important is required to override the inline style. */
  .page-layout {
    grid-template-columns: 1fr !important;
  }
}

/* REAL FIX, separate from the media queries above and needed at EVERY
   width, not just narrow ones: grid items default to min-width:auto,
   which lets a grid item refuse to shrink below its CONTENT's intrinsic
   width. .page-content and .page-sidebar are grid items inside
   .page-layout, and .card/.tool-card-body had no width rule at all, so
   a form with several fields side by side could force its intrinsic
   width wider than the actual grid track, overflowing the whole page
   horizontally regardless of what grid-template-columns says (this is
   what the 960px/720px fixes alone did not resolve, since the grid
   track was correctly a single column but the content still refused to
   shrink into it). min-width:0 forces the grid item to respect its
   track's width instead of its content's intrinsic size. */
.page-content, .page-sidebar {
  min-width: 0;
}

/* Sidebar chrome: the "Related tools" card (and any sidebar card) gets a
   solid colored header bar instead of floating plain text in white
   space, matching a real product sidebar rather than a minimal list. */
.page-sidebar .card > h3:first-child {
  margin: calc(-1 * var(--sp-lg)) calc(-1 * var(--sp-lg)) var(--sp-sm) calc(-1 * var(--sp-lg)) !important;
  padding: var(--sp-sm) var(--sp-lg) !important;
  background: var(--clr-ink); color: #F7F5EF !important;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-size: var(--fs-xs) !important;
}
[data-theme='dark'] .page-sidebar .card > h3:first-child { background: rgba(255,138,52,0.14); color: var(--clr-amber) !important; }
.page-sidebar .sidebar-link {
  display: block; padding: var(--sp-2xs) var(--sp-xs); margin-inline: calc(-1 * var(--sp-xs));
  border-radius: var(--radius-sm); font-size: var(--fs-sm); font-weight: 500;
  border-left: 2px solid transparent;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.page-sidebar .sidebar-link:hover { background: var(--clr-bg-sunk); border-left-color: var(--clr-amber); }
.sidebar-links { display: flex; flex-direction: column; gap: var(--sp-2xs); }
.sidebar-card { position: sticky; top: 72px; }
.doc-section h3 { margin-top: var(--sp-lg); }
.doc-section p { margin-bottom: var(--sp-md); }
.card--hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--clr-line-strong);
}

.card--glass {
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.4);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}
[data-theme='dark'] .card--glass {
  background: rgba(16,26,32,0.55);
  border: 1px solid rgba(255,255,255,0.08);
}

.cat-card {
  display: flex; flex-direction: column; gap: var(--sp-sm);
  padding: var(--sp-lg);
  background: var(--clr-bg-raised);
  border: 1px solid var(--clr-line);
  border-radius: var(--radius-lg);
  position: relative; overflow: hidden;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.cat-card::before {
  content: ''; position: absolute; inset: 0;
  background: var(--grad-horizon); opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}
.cat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.cat-card:hover::before { opacity: 1; }
.cat-card > * { position: relative; z-index: 1; }
.cat-card__icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--clr-amber-soft); color: var(--clr-amber-ink);
  flex-shrink: 0;
}
[data-theme='dark'] .cat-card__icon { color: var(--clr-amber); }
.cat-card__icon svg { width: 24px; height: 24px; }
.cat-card__title { font-family: var(--font-display); font-size: var(--fs-md); font-weight: 600; }
.cat-card__desc { font-size: var(--fs-sm); color: var(--clr-ink-soft); }
.cat-card__meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: var(--sp-sm);
  border-top: 1px solid var(--clr-line);
  font-size: var(--fs-xs); color: var(--clr-ink-faint);
}
.cat-card__count { font-family: var(--font-mono); color: var(--clr-teal); font-weight: 600; }
[data-theme='dark'] .cat-card__count { color: var(--clr-amber); }

.tool-card {
  display: flex; align-items: center; gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  background: var(--clr-bg-raised);
  border: 1px solid var(--clr-line);
  border-left: 3px solid var(--clr-line-strong);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.tool-card:hover { border-color: var(--clr-line); border-left-color: var(--clr-amber); background: var(--clr-amber-soft); }
[data-theme='dark'] .tool-card:hover { background: rgba(255,138,52,0.08); }
.tool-card__dot {
  width: 8px; height: 8px; border-radius: 2px; background: var(--clr-teal); flex-shrink: 0;
}
.tool-card__label { font-size: var(--fs-sm); font-weight: 600; flex: 1; }
.tool-card__arrow { color: var(--clr-ink-faint); transition: transform var(--dur-fast) var(--ease-out); }
.tool-card:hover .tool-card__arrow { transform: translateX(3px); color: var(--clr-amber-ink); }

.az-group { margin-bottom: var(--sp-2xl, 48px); scroll-margin-top: 90px; }
/* GLOSSARY GAP (2026-11-20): the last .az-group's 88px bottom margin
   collapses out of its section (no bottom padding or border to contain
   it) and shows as an 88px empty strip before the sunk section. Only
   the last group is affected; the margin between groups is intended
   spacing and is untouched. .az-group exists only on glossary/index. */
.az-group:last-child { margin-bottom: 0; }
.az-group__letter {
  font-family: var(--font-display);
  font-size: var(--fs-3xl, 2.5rem);
  color: var(--clr-amber-ink, var(--clr-amber));
  padding-bottom: var(--sp-xs, 8px);
  margin-bottom: var(--sp-md, 20px);
  border-bottom: 2px solid var(--clr-line);
}
.az-group .grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.az-group .tool-card { max-width: 340px; }
.az-jump__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border-radius: var(--radius-sm, 6px);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--clr-ink-soft);
  text-decoration: none;
  transition: background var(--dur-fast, 0.15s), color var(--dur-fast, 0.15s);
}
.az-jump__link:hover, .az-jump__link:focus-visible {
  background: var(--clr-amber-soft);
  color: var(--clr-amber-ink);
}

.stat-card {
  text-align: center; padding: var(--sp-md);
  border-right: 1px solid var(--clr-line);
}
.stat-card:last-child { border-right: none; }
.stat-card__num {
  font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 600;
  color: var(--clr-ink); line-height: 1; display: block;
}
.stat-card__label {
  font-size: var(--fs-xs); color: var(--clr-ink-soft);
  text-transform: uppercase; letter-spacing: 0.08em; margin-top: var(--sp-2xs); display: block;
}

/* ---------------------------------------------------------------------- */
/* 7. BADGES / PILLS / ALERTS                                              */
/* ---------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: var(--sp-3xs);
  padding: 0.2rem 0.6rem; border-radius: var(--radius-sm);
  font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--clr-teal-soft); color: var(--clr-teal-ink);
}
[data-theme='dark'] .badge { color: var(--clr-teal); }
.badge--amber { background: var(--clr-amber-soft); color: var(--clr-amber-ink); }
[data-theme='dark'] .badge--amber { color: var(--clr-amber); }

.pill {
  display: inline-flex; align-items: center; gap: var(--sp-2xs);
  padding: 0.45rem 0.9rem; border-radius: var(--radius-full);
  font-size: var(--fs-xs); font-weight: 500;
  background: var(--clr-bg-sunk); border: 1px solid var(--clr-line);
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.pill:hover, .pill.is-active {
  border-color: var(--clr-amber); background: var(--clr-amber-soft); color: var(--clr-amber-ink);
}
[data-theme='dark'] .pill:hover, [data-theme='dark'] .pill.is-active { color: var(--clr-amber); }

.alert {
  display: flex; gap: var(--sp-sm); align-items: flex-start;
  padding: var(--sp-sm) var(--sp-md); border-radius: var(--radius-md);
  border: 1px solid var(--clr-line); font-size: var(--fs-sm);
}
.alert--info { background: rgba(42,108,158,0.08); border-color: rgba(42,108,158,0.3); }
.alert--success { background: var(--clr-teal-soft); border-color: rgba(28,124,107,0.3); }
.alert--warning { background: rgba(184,121,14,0.1); border-color: rgba(184,121,14,0.3); }
.alert--danger { background: rgba(181,67,46,0.08); border-color: rgba(181,67,46,0.3); }

.breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2xs);
  font-size: var(--fs-xs); color: var(--clr-ink-faint); padding-block: var(--sp-sm);
}
.breadcrumb a { color: var(--clr-ink-soft); transition: color var(--dur-fast); }
.breadcrumb a:hover { color: var(--clr-amber-ink); }
[data-theme='dark'] .breadcrumb a:hover { color: var(--clr-amber); }
.breadcrumb__sep { opacity: 0.5; }

/* ---------------------------------------------------------------------- */
/* 8. FORMS                                                                */
/* ---------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: var(--sp-2xs); margin-bottom: var(--sp-sm); }
.field label {
  font-size: var(--fs-xs); font-weight: 600; color: var(--clr-ink-soft);
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.7rem 0.9rem; border-radius: var(--radius-sm);
  border: 1px solid var(--clr-line-strong); background: var(--clr-bg-raised); color: var(--clr-ink);
  font-size: var(--fs-base); transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--clr-amber);
  box-shadow: 0 0 0 3px var(--clr-amber-soft);
}
.field small { color: var(--clr-ink-faint); font-size: var(--fs-2xs); }

/* Checkbox field: a labeled checkbox row, used for multi-select feature
   lists (e.g. "which of these appliances do you have"). Distinct from
   .field, which is a single label+input/select/textarea stack; a group
   of .checkbox-field rows typically sits inside one .field wrapper that
   provides the shared group label and helper text above them. */
.checkbox-field {
  display: flex; align-items: center; gap: var(--sp-2xs);
  font-size: var(--fs-sm); color: var(--clr-ink); font-weight: 400;
  cursor: pointer; padding: var(--sp-2xs) 0;
}
.checkbox-field input[type="checkbox"] {
  width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--clr-amber);
  cursor: pointer;
}

.form-grid { display: grid; gap: var(--sp-sm) var(--sp-md); }
.form-grid--2 { grid-template-columns: repeat(2, 1fr); }
.form-grid--3 { grid-template-columns: repeat(3, 1fr); }
.form-grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 700px) { .form-grid--2, .form-grid--3, .form-grid--4 { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .form-grid--4 { grid-template-columns: repeat(2, 1fr); } }

/* Form section: groups related fields under a labeled subsection inside
   a tool form, matching a real spec-sheet form (AskHVAC-style Design
   Conditions / Envelope Heat Gain grouping) instead of one flat field
   grid. Each section gets a small numbered/lettered label, a title, and
   optional one-line context, then its own field grid underneath. */
.form-section {
  padding-top: var(--sp-md); margin-top: var(--sp-md);
  border-top: 1px solid var(--clr-line);
}
.form-section:first-child { padding-top: 0; margin-top: 0; border-top: none; }
.form-section__head {
  display: flex; align-items: baseline; gap: var(--sp-2xs);
  margin-bottom: var(--sp-sm);
}
.form-section__num {
  font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: 700;
  color: #FFFFFF; background: var(--clr-teal);
  width: 20px; height: 20px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
[data-theme='dark'] .form-section__num { background: var(--clr-amber); color: #1A0D02; }
.form-section__title {
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-sm);
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--clr-ink);
}
.form-section__note {
  font-size: var(--fs-2xs); color: var(--clr-ink-faint); margin-left: auto; text-align: right;
}

/* Inline unit suffix inside a numeric field, e.g. "1,500" + "sq ft"
   shown as part of the input row rather than only in helper text. */
.field-unit {
  display: flex; align-items: stretch; gap: 0;
}
.field-unit input {
  border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: none;
}
.field-unit__suffix {
  display: flex; align-items: center; padding: 0 var(--sp-sm);
  background: var(--clr-bg-sunk); border: 1px solid var(--clr-line-strong);
  border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm);
  font-size: var(--fs-xs); color: var(--clr-ink-faint); font-weight: 600;
  white-space: nowrap;
}

.search-box {
  display: flex; align-items: center; gap: var(--sp-2xs);
  background: var(--clr-bg-raised); border: 1px solid var(--clr-line-strong);
  border-radius: var(--radius-full); padding: 0.5rem 0.6rem 0.5rem 1.1rem;
  box-shadow: var(--shadow-sm);
}
.search-box input {
  flex: 1; min-width: 0; border: none; background: transparent; font-size: var(--fs-base);
  color: var(--clr-ink); outline: none;
}
.search-box svg { color: var(--clr-ink-faint); width: 20px; height: 20px; flex-shrink: 0; }
.search-box__kbd {
  font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--clr-ink-faint);
  border: 1px solid var(--clr-line); border-radius: 5px; padding: 2px 6px;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------- */
/* 9. TABLES                                                               */
/* ---------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--clr-line); border-radius: var(--radius-md); }
.data-table { font-size: var(--fs-sm); }
.data-table th, .data-table td { padding: var(--sp-xs) var(--sp-sm); text-align: left; }
.data-table th {
  background: var(--clr-bg-sunk); font-weight: 600; font-size: var(--fs-xs);
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--clr-ink-soft);
}
.data-table tr:not(:last-child) td { border-bottom: 1px solid var(--clr-line); }

/* ---------------------------------------------------------------------- */
/* 10. ACCORDION / TABS / FAQ                                              */
/* ---------------------------------------------------------------------- */
.accordion-item {
  border-bottom: 1px solid var(--clr-line);
}
.accordion-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-sm);
  padding: var(--sp-md) 0; background: none; border: none; text-align: left;
  font-family: var(--font-display); font-size: var(--fs-md); font-weight: 600; color: var(--clr-ink);
}
.accordion-trigger__icon {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--clr-line-strong); display: flex; align-items: center; justify-content: center;
  transition: transform var(--dur-base) var(--ease-out), background var(--dur-base);
}
.accordion-item[data-open='true'] .accordion-trigger__icon { transform: rotate(45deg); background: var(--clr-amber); border-color: var(--clr-amber); color: #1A0D02; }
.accordion-panel {
  display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-slow) var(--ease-in-out);
}
.accordion-item[data-open='true'] .accordion-panel { grid-template-rows: 1fr; }
.accordion-panel__inner { overflow: hidden; }
.accordion-panel p { padding-bottom: var(--sp-md); max-width: 65ch; }

.tabs__list { display: flex; gap: var(--sp-2xs); border-bottom: 1px solid var(--clr-line); flex-wrap: wrap; }
.tabs__tab {
  padding: var(--sp-xs) var(--sp-sm); background: none; border: none; border-bottom: 2px solid transparent;
  font-weight: 600; font-size: var(--fs-sm); color: var(--clr-ink-faint); margin-bottom: -1px;
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.tabs__tab.is-active, .tabs__tab:hover { color: var(--clr-ink); border-color: var(--clr-amber); }
.tabs__panel { display: none; padding-top: var(--sp-md); }
.tabs__panel.is-active { display: block; }

/* ---------------------------------------------------------------------- */
/* 11. TIMELINE                                                            */
/* ---------------------------------------------------------------------- */
.timeline { position: relative; padding-left: var(--sp-lg); }
.timeline::before {
  content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(var(--clr-amber), var(--clr-teal));
}
.timeline-item { position: relative; padding-bottom: var(--sp-lg); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ''; position: absolute; left: calc(-1 * var(--sp-lg) + 1px); top: 5px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--clr-amber);
  border: 3px solid var(--clr-bg);
  box-shadow: 0 0 0 1px var(--clr-line-strong);
}
.timeline-item__label { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--clr-ink-faint); text-transform: uppercase; letter-spacing: 0.08em; }
.timeline-item__title { font-family: var(--font-display); font-size: var(--fs-md); font-weight: 600; margin-top: var(--sp-3xs); }

/* ---------------------------------------------------------------------- */
/* 12. HEADER + MEGA MENU                                                  */
/* ---------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 200;
  height: var(--header-h);
  display: flex; align-items: center;
  background: var(--clr-ink);
  border-bottom: 3px solid var(--clr-amber);
  transition: box-shadow var(--dur-base) var(--ease-out);
}
[data-theme='dark'] .site-header { background: #060B0E; }
.site-header.is-scrolled { box-shadow: var(--shadow-md); }
.site-header__inner {
  width: 100%; max-width: var(--container-w); margin-inline: auto; padding-inline: var(--sp-md);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-md);
}
.brand { display: flex; align-items: center; gap: var(--sp-2xs); flex-shrink: 0; }
.brand__mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand__name {
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: #F7F5EF;
  white-space: nowrap; letter-spacing: 0.01em;
}
.brand__name em { font-style: normal; color: var(--clr-amber); }

.main-nav { display: flex; align-items: center; gap: var(--sp-2xs); flex: 1; justify-content: center; }
.main-nav__item { position: relative; }
.main-nav__link {
  display: flex; align-items: center; gap: 4px;
  padding: 0.55rem 0.9rem; border-radius: var(--radius-sm); font-size: var(--fs-sm); font-weight: 600;
  color: rgba(247,245,239,0.82); transition: background var(--dur-fast), color var(--dur-fast);
  background: none; border: none; font-family: inherit; cursor: pointer;
}
.main-nav__link:hover, .main-nav__link[aria-expanded='true'] { background: var(--clr-amber); color: #1A0D02; }
.main-nav__link.is-current { color: var(--clr-amber); background: rgba(255,138,52,0.12); }
.main-nav__chevron { width: 14px; height: 14px; transition: transform var(--dur-fast); }
.main-nav__link[aria-expanded='true'] .main-nav__chevron { transform: rotate(180deg); }

.mega-menu {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(-6px);
  width: min(880px, 90vw);
  background: var(--clr-bg-raised); border: 1px solid var(--clr-line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: var(--sp-md); opacity: 0; visibility: hidden;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), visibility var(--dur-base);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-xs);
  max-height: 70vh; overflow-y: auto;
}
.mega-menu.is-open { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.mega-menu__link {
  display: flex; align-items: flex-start; gap: var(--sp-xs); padding: var(--sp-xs);
  border-radius: var(--radius-sm); transition: background var(--dur-fast);
}
.mega-menu__link:hover { background: var(--clr-bg-sunk); }
.mega-menu__icon {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: var(--clr-teal-soft); color: var(--clr-teal-ink);
  display: flex; align-items: center; justify-content: center;
}
[data-theme='dark'] .mega-menu__icon { color: var(--clr-teal); }
.mega-menu__icon svg { width: 18px; height: 18px; }
.mega-menu__title { font-size: var(--fs-sm); font-weight: 600; color: var(--clr-ink); }
.mega-menu__desc { font-size: var(--fs-2xs); color: var(--clr-ink-faint); margin-top: 2px; }

.header-actions { display: flex; align-items: center; gap: var(--sp-2xs); flex-shrink: 0; }
.header-search-trigger {
  display: flex; align-items: center; gap: var(--sp-2xs);
  padding: 0.5rem 0.9rem; border-radius: var(--radius-sm);
  border: 1px solid rgba(247,245,239,0.18); background: rgba(247,245,239,0.06);
  color: rgba(247,245,239,0.7); font-size: var(--fs-xs); font-weight: 600;
}
.header-search-trigger svg { width: 16px; height: 16px; flex-shrink: 0; }
.header-search-trigger:hover { border-color: var(--clr-amber); color: #F7F5EF; }
.header-search-trigger .search-box__kbd { border-color: rgba(247,245,239,0.25); color: rgba(247,245,239,0.6); }

.theme-toggle {
  width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid rgba(247,245,239,0.18);
  background: rgba(247,245,239,0.06); display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; flex-shrink: 0;
}
.theme-toggle svg {
  position: absolute; width: 19px; height: 19px;
  transition: transform var(--dur-slow) var(--ease-in-out), opacity var(--dur-slow) var(--ease-in-out);
}
.theme-toggle .icon-sun { color: var(--clr-amber); opacity: 1; transform: rotate(0) scale(1); }
.theme-toggle .icon-moon { color: var(--clr-teal); opacity: 0; transform: rotate(-90deg) scale(0.4); }
[data-theme='dark'] .theme-toggle .icon-sun { opacity: 0; transform: rotate(90deg) scale(0.4); }
[data-theme='dark'] .theme-toggle .icon-moon { opacity: 1; transform: rotate(0) scale(1); }

.hamburger {
  display: none; width: 40px; height: 40px; border-radius: var(--radius-sm);
  border: 1px solid rgba(247,245,239,0.18); background: rgba(247,245,239,0.06);
  align-items: center; justify-content: center; flex-shrink: 0;
}
.hamburger span, .hamburger::before, .hamburger::after {
  content: ''; display: block; width: 17px; height: 2px; background: #F7F5EF;
  border-radius: 2px; transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base);
}
.hamburger::before { transform: translateY(-5px); }
.hamburger::after { transform: translateY(5px); }
.hamburger[aria-expanded='true']::before { transform: translateY(0) rotate(45deg); }
.hamburger[aria-expanded='true']::after { transform: translateY(0) rotate(-45deg); }
.hamburger[aria-expanded='true'] span { opacity: 0; }

.mobile-nav {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 190;
  background: var(--clr-bg); padding: var(--sp-md);
  overflow-y: auto; transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease-in-out);
}
.mobile-nav.is-open { transform: translateX(0); }
.mobile-nav__cat { border-bottom: 1px solid var(--clr-line); }
.mobile-nav__cat-link {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-sm) var(--sp-2xs); background: none; border: none;
  font-weight: 600; font-size: var(--fs-base); color: var(--clr-ink);
  transition: color var(--dur-fast) var(--ease-out);
}
.mobile-nav__cat-link:hover, .mobile-nav__cat-link:active { color: var(--clr-amber-ink); }
[data-theme='dark'] .mobile-nav__cat-link:hover, [data-theme='dark'] .mobile-nav__cat-link:active { color: var(--clr-amber); }
.mobile-nav__chevron {
  width: 18px; height: 18px; flex-shrink: 0; color: var(--clr-ink-faint);
}

@media (max-width: 980px) {
  .main-nav { display: none; }
  .hamburger { display: flex; }
}

@media (max-width: 560px) {
  .header-search-trigger span:not(.search-box__kbd) { display: none; }
  .header-search-trigger .search-box__kbd { display: none; }
  .header-search-trigger { padding: 0.6rem; width: 40px; height: 40px; justify-content: center; border-radius: 50%; }
  .header-actions { gap: 6px; }
}

/* ---------------------------------------------------------------------- */
/* 13. HERO + SUN ARC SIGNATURE                                            */
/* ---------------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  padding-block: var(--sp-xl) var(--sp-lg);
  background: var(--grad-horizon);
}
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(255,138,52,0.12), transparent 70%);
}
.hero__inner {
  position: relative; z-index: 2;
  max-width: var(--container-w); margin-inline: auto; padding-inline: var(--sp-md);
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--sp-2xl); align-items: center;
}
@media (max-width: 980px) { .hero__inner { grid-template-columns: 1fr; gap: var(--sp-xl); } }

.hero__eyebrow { margin-bottom: var(--sp-sm); }
.hero h1 { max-width: 15ch; }
.hero__sub { margin-top: var(--sp-sm); max-width: 46ch; }
.hero__ctas { display: flex; gap: var(--sp-sm); margin-top: var(--sp-md); flex-wrap: wrap; }
.hero__search { margin-top: var(--sp-md); max-width: 480px; }
.hero__trust {
  display: flex; gap: var(--sp-lg); margin-top: var(--sp-lg); flex-wrap: wrap;
}
.hero__trust-item { display: flex; flex-direction: column; }
.hero__trust-num { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 600; }
.hero__trust-label { font-size: var(--fs-2xs); color: var(--clr-ink-faint); text-transform: uppercase; letter-spacing: 0.06em; }

/* the signature: an animated sun-arc / analemma path with a moving dot */
.sun-arc {
  position: relative; width: 100%; max-width: 380px; margin-inline: auto; aspect-ratio: 1 / 0.72;
}
.sun-arc svg { width: 100%; height: 100%; overflow: visible; }
.sun-arc__path {
  fill: none; stroke: var(--clr-line-strong); stroke-width: 1.5; stroke-dasharray: 4 6;
}
.sun-arc__ground { stroke: var(--clr-line); stroke-width: 1; }
.sun-arc__dot {
  filter: drop-shadow(0 0 10px rgba(255,138,52,0.9)) drop-shadow(0 0 24px rgba(255,138,52,0.5));
}
.sun-arc__label {
  font-family: var(--font-mono); font-size: 11px; fill: var(--clr-ink-faint);
}
.sun-arc__ray { stroke: var(--clr-amber); opacity: 0.35; }

.sun-arc__chip {
  position: absolute; display: flex; flex-direction: column; gap: 2px;
  background: var(--clr-bg-raised); border: 1px solid var(--clr-line);
  border-radius: var(--radius-md); padding: 0.6rem 0.85rem; box-shadow: var(--shadow-sm);
  max-width: 148px; font-size: var(--fs-2xs);
}
.sun-arc__chip-num { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-md); color: var(--clr-ink); line-height: 1; }
.sun-arc__chip-label { color: var(--clr-ink-faint); line-height: 1.3; }
.sun-arc__chip--left { left: -6%; bottom: 6%; }
.sun-arc__chip--right { right: -6%; top: 8%; }
@media (max-width: 980px) {
  .sun-arc__chip--left { left: 0; }
  .sun-arc__chip--right { right: 0; }
}
@media (max-width: 560px) {
  .sun-arc__chip { display: none; }
}

/* ---------------------------------------------------------------------- */
/* 14. FEATURE / BENEFIT / CTA / EMPTY / ERROR / SUCCESS BLOCKS            */
/* ---------------------------------------------------------------------- */
.section-head { max-width: 640px; margin-bottom: var(--sp-xl); }
.section-head__eyebrow { margin-bottom: var(--sp-xs); }
.section-head--center { margin-inline: auto; text-align: center; }

.benefit {
  display: flex; gap: var(--sp-sm);
}
.benefit__icon {
  width: 44px; height: 44px; border-radius: var(--radius-md); flex-shrink: 0;
  background: var(--clr-teal-soft); color: var(--clr-teal-ink);
  display: flex; align-items: center; justify-content: center;
}
[data-theme='dark'] .benefit__icon { color: var(--clr-teal); }
.benefit__title { font-weight: 600; font-size: var(--fs-md); font-family: var(--font-display); }

.cta-band {
  border-radius: var(--radius-lg); padding: var(--sp-2xl);
  background: var(--grad-ink); color: #F7F5EF;
  text-align: center; position: relative; overflow: hidden;
}
.cta-band::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,138,52,0.25), transparent 55%);
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { color: #FDFBF6; }
.cta-band p { color: rgba(253,251,246,0.75); }
.cta-band .btn--primary { background: var(--clr-amber); color: #1A0D02; }

.state-block {
  text-align: center; padding: var(--sp-2xl) var(--sp-md); max-width: 440px; margin-inline: auto;
}
.state-block__icon { width: 64px; height: 64px; margin-inline: auto var(--sp-sm); color: var(--clr-ink-faint); }
.state-block--success .state-block__icon { color: var(--clr-teal); }
.state-block--error .state-block__icon { color: var(--clr-danger); }

/* ---------------------------------------------------------------------- */
/* 15. LOADING SKELETONS + PROGRESS + TOASTS + MODAL                        */
/* ---------------------------------------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, var(--clr-bg-sunk) 25%, var(--clr-line) 37%, var(--clr-bg-sunk) 63%);
  background-size: 400% 100%; animation: skeleton-wave 1.8s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-wave { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.progress { height: 8px; border-radius: var(--radius-full); background: var(--clr-bg-sunk); overflow: hidden; }
.progress__bar {
  height: 100%; background: linear-gradient(90deg, var(--clr-amber), var(--clr-teal));
  border-radius: var(--radius-full); transition: width var(--dur-slow) var(--ease-out);
}

.toast-region {
  position: fixed; bottom: var(--sp-md); right: var(--sp-md); z-index: 500;
  display: flex; flex-direction: column; gap: var(--sp-2xs); max-width: 340px;
}
.toast {
  background: var(--clr-ink); color: var(--clr-bg);
  padding: var(--sp-sm) var(--sp-md); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); font-size: var(--fs-sm);
  display: flex; align-items: center; gap: var(--sp-xs);
  animation: toast-in var(--dur-base) var(--ease-out);
}
[data-theme='dark'] .toast { background: var(--clr-bg-raised); border: 1px solid var(--clr-line-strong); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.toast--success::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--clr-teal); flex-shrink: 0; }
.toast--error::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--clr-danger); flex-shrink: 0; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(10,17,22,0.55);
  backdrop-filter: blur(4px); z-index: 400;
  display: flex; align-items: center; justify-content: center; padding: var(--sp-md);
  opacity: 0; visibility: hidden; transition: opacity var(--dur-base), visibility var(--dur-base);
}
.modal-overlay.is-open { opacity: 1; visibility: visible; }
.modal {
  background: var(--clr-bg-raised); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  max-width: 560px; width: 100%; padding: var(--sp-lg);
  transform: scale(0.96) translateY(10px); transition: transform var(--dur-base) var(--ease-out);
}
.modal-overlay.is-open .modal { transform: scale(1) translateY(0); }

.dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 200px;
  background: var(--clr-bg-raised); border: 1px solid var(--clr-line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); padding: var(--sp-2xs);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: all var(--dur-fast) var(--ease-out); z-index: 150;
}
.dropdown-menu.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu a, .dropdown-menu button {
  display: block; width: 100%; text-align: left; padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm); font-size: var(--fs-sm); background: none; border: none;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--clr-bg-sunk); }

/* ---------------------------------------------------------------------- */
/* 16. NEWSLETTER                                                          */
/* ---------------------------------------------------------------------- */
.newsletter {
  display: flex; align-items: center; gap: var(--sp-lg); flex-wrap: wrap;
  background: var(--clr-bg-raised); border: 1px solid var(--clr-line); border-radius: var(--radius-lg);
  padding: var(--sp-xl);
}
.newsletter__copy { flex: 1; min-width: min(240px, 100%); }
.newsletter__form { display: flex; gap: var(--sp-2xs); flex: 1; min-width: min(280px, 100%); }
.newsletter__form input {
  flex: 1; min-width: 0; padding: 0.85rem 1.1rem; border-radius: var(--radius-full);
  border: 1px solid var(--clr-line-strong); background: var(--clr-bg); color: var(--clr-ink);
}
.newsletter__form input:focus { outline: none; border-color: var(--clr-amber); box-shadow: 0 0 0 3px var(--clr-amber-soft); }

/* ---------------------------------------------------------------------- */
/* 17. FOOTER                                                              */
/* ---------------------------------------------------------------------- */
.site-footer {
  background: var(--clr-ink); color: rgba(247,245,239,0.7);
  padding-block: var(--sp-2xl) var(--sp-lg);
}
[data-theme='dark'] .site-footer { background: var(--clr-bg-sunk); }
.site-footer a { color: rgba(247,245,239,0.7); transition: color var(--dur-fast); }
.site-footer a:hover { color: var(--clr-amber); }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: var(--sp-lg);
  padding-bottom: var(--sp-xl); border-bottom: 1px solid rgba(247,245,239,0.12);
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h3 { color: #F7F5EF; font-size: var(--fs-sm); margin-bottom: var(--sp-sm); text-transform: uppercase; letter-spacing: 0.06em; }
.footer-grid ul li { margin-bottom: var(--sp-2xs); font-size: var(--fs-sm); }
.footer-brand__desc { font-size: var(--fs-sm); max-width: 32ch; margin-top: var(--sp-sm); color: rgba(247,245,239,0.85); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--sp-md);
  padding-top: var(--sp-lg); font-size: var(--fs-xs);
}
.footer-legal { display: flex; gap: var(--sp-md); flex-wrap: wrap; order: 3; flex-basis: 100%; padding-top: var(--sp-sm); border-top: 1px solid rgba(247,245,239,0.08); }
.footer-social { display: flex; gap: var(--sp-xs); }
.footer-social a {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(247,245,239,0.18);
  display: flex; align-items: center; justify-content: center;
}
.footer-social a svg { width: 17px; height: 17px; flex-shrink: 0; }
.footer-social a:hover { border-color: var(--clr-amber); }

/* ---------------------------------------------------------------------- */
/* 18. UTILITIES / MISC                                                    */
/* ---------------------------------------------------------------------- */
.hr { border: none; border-top: 1px solid var(--clr-line); margin-block: var(--sp-lg); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.reveal { opacity: 0; transition: opacity var(--dur-slow) var(--ease-out); }
.reveal.is-visible { opacity: 1; }

/* ---------------------------------------------------------------------- */
/* 19. RESULTS PANEL (header bar, hero metric, export bar)                 */
/* ---------------------------------------------------------------------- */
/* A results panel that feels like a finished output, not more form
   content: a colored header announcing the result has arrived, one
   metric visually promoted above its siblings, and a visible row of
   export actions once a calculation completes. */

.results-panel {
  border: 1px solid var(--clr-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--clr-bg-raised);
}

.results-header {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-lg);
  background: var(--clr-ink); color: var(--clr-bg-raised);
  flex-wrap: wrap;
}
[data-theme='dark'] .results-header { background: var(--clr-amber); color: #1A0D02; }
.results-header__title {
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-md);
  letter-spacing: 0.01em;
}
.results-header__meta {
  font-family: var(--font-mono); font-size: var(--fs-2xs); opacity: 0.75;
  text-transform: uppercase; letter-spacing: 0.06em;
}

.results-body { padding: var(--sp-lg); }

.results-metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--sp-md);
}
.result-metric {
  padding: var(--sp-md); border-radius: var(--radius-md);
  background: var(--clr-bg-sunk); border: 1px solid var(--clr-line);
  text-align: left;
}
.result-metric__label {
  font-size: var(--fs-2xs); color: var(--clr-ink-faint);
  text-transform: uppercase; letter-spacing: 0.06em; display: block; margin-bottom: var(--sp-2xs);
}
.result-metric__value {
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-xl);
  color: var(--clr-ink); line-height: 1; display: block;
}
.result-metric__unit {
  font-size: var(--fs-xs); color: var(--clr-ink-faint); margin-left: 4px;
}
/* the one number that matters most: promoted with the accent color and a
   filled background instead of the neutral sunk-panel treatment */
.result-metric--hero {
  background: var(--clr-amber-soft); border-color: rgba(255,138,52,0.35);
  grid-column: span 2;
}
[data-theme='dark'] .result-metric--hero { background: rgba(255,138,52,0.14); }
.result-metric--hero .result-metric__value { color: var(--clr-amber-ink); font-size: var(--fs-2xl); }
[data-theme='dark'] .result-metric--hero .result-metric__value { color: var(--clr-amber); }
@media (max-width: 480px) {
  .result-metric--hero { grid-column: span 1; }
}

.export-bar {
  display: flex; align-items: center; gap: var(--sp-xs); flex-wrap: wrap;
  padding: var(--sp-sm) var(--sp-lg);
  background: var(--clr-bg-sunk); border-top: 1px solid var(--clr-line);
}
.export-bar__label {
  font-size: var(--fs-2xs); color: var(--clr-ink-faint);
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-right: var(--sp-2xs);
}
.export-btn {
  display: inline-flex; align-items: center; gap: var(--sp-2xs);
  padding: 0.45rem 0.85rem; border-radius: var(--radius-full);
  border: 1px solid var(--clr-line-strong); background: var(--clr-bg-raised); color: var(--clr-ink-soft);
  font-size: var(--fs-xs); font-weight: 600;
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.export-btn:hover { border-color: var(--clr-amber); color: var(--clr-amber-ink); background: var(--clr-amber-soft); }
[data-theme='dark'] .export-btn:hover { color: var(--clr-amber); }
.export-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ---------------------------------------------------------------------- */
/* 20. PRINTABLE REPORT (letterhead-style output for save/print/PDF)       */
/* ---------------------------------------------------------------------- */
.report-preview {
  background: #FFFFFF; color: #10181C;
  border: 1px solid var(--clr-line); border-radius: var(--radius-md);
  padding: var(--sp-lg); font-family: var(--font-body); font-size: var(--fs-sm); line-height: 1.6;
}
[data-theme='dark'] .report-preview { background: #12191d; color: #EDF1F2; border-color: var(--clr-line-strong); }

/* the "preview chrome" strip above the report itself, announcing what
   the panel contains, distinct from the report document's own letterhead */
.report-preview-chrome {
  display: flex; align-items: center; gap: var(--sp-xs);
  padding: var(--sp-sm) var(--sp-lg);
  background: var(--clr-info); color: #FFFFFF;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-sm);
}
[data-theme='dark'] .report-preview-chrome { background: var(--clr-info); color: #FFFFFF; }
.report-preview-chrome svg { width: 18px; height: 18px; flex-shrink: 0; }
.report-preview-wrap {
  border: 1px solid var(--clr-line); border-radius: var(--radius-lg); overflow: hidden;
}
.report-preview-wrap .report-preview { border: none; border-radius: 0; margin: var(--sp-md); width: calc(100% - 2 * var(--sp-md)); }

.report-header {
  display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: var(--sp-sm);
  margin-bottom: var(--sp-md); padding-bottom: var(--sp-sm); border-bottom: 2px solid var(--clr-info);
}
.report-header__brand { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-md); color: var(--clr-ink); }
[data-theme='dark'] .report-header__brand { color: #EDF1F2; }
.report-header__brand em { font-style: normal; color: var(--clr-amber); }
.report-header__tagline { font-size: var(--fs-2xs); color: var(--clr-ink-faint); margin-top: 2px; }
.report-header__meta { text-align: right; font-size: var(--fs-xs); color: var(--clr-ink-faint); }
.report-header__title { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-lg); color: var(--clr-info); }
[data-theme='dark'] .report-header__title { color: var(--clr-teal); }

.report-section { margin-bottom: var(--sp-md); }
.report-section h3 {
  font-family: var(--font-display); font-size: var(--fs-sm); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--clr-info);
  margin-bottom: var(--sp-xs);
}
[data-theme='dark'] .report-section h3 { color: var(--clr-teal); }
/* only the report's very first section gets a divider under its heading,
   matching a letterhead-style document where one rule separates the
   header block from the body, not every subsection */
.report-section--first h3 {
  border-bottom: 1px solid var(--clr-line); padding-bottom: var(--sp-2xs);
}

/* two-per-line field layout for compact project-info style sections */
.report-fields {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--sp-lg);
}
@media (max-width: 560px) { .report-fields { grid-template-columns: 1fr; } }
.report-field { display: flex; justify-content: space-between; gap: var(--sp-sm); padding: 0.3rem 0; }
.report-field .lbl { color: var(--clr-ink-faint); }
.report-field .val { font-weight: 600; color: var(--clr-ink); text-align: right; }
[data-theme='dark'] .report-field .val { color: #EDF1F2; }

.report-row {
  display: flex; justify-content: space-between; gap: var(--sp-sm);
  padding: 0.2rem 0; border-bottom: 1px dotted var(--clr-line); font-size: var(--fs-sm);
}
.report-row:last-child { border-bottom: none; }
.report-row .lbl { color: var(--clr-ink-faint); }
.report-row .val { font-weight: 600; color: var(--clr-ink); }
[data-theme='dark'] .report-row .val { color: #EDF1F2; }
.report-row--total { font-size: var(--fs-md); border-bottom: none; margin-top: var(--sp-2xs); padding-top: var(--sp-xs); border-top: 1px solid var(--clr-line); }
.report-row--total .lbl { font-weight: 700; color: var(--clr-ink); text-transform: uppercase; letter-spacing: 0.03em; font-size: var(--fs-xs); }
[data-theme='dark'] .report-row--total .lbl { color: #EDF1F2; }
.report-row--total .val { color: var(--clr-info); font-size: var(--fs-lg); }
[data-theme='dark'] .report-row--total .val { color: var(--clr-teal); }

/* two-column grid for paired component-summary rows (e.g. Wall Conduction
   next to Window Conduction on the same line) */
.report-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--sp-lg); }
@media (max-width: 560px) { .report-grid-2 { grid-template-columns: 1fr; } }

.report-stamp {
  display: flex; align-items: flex-start; gap: var(--sp-xs);
  background: var(--clr-teal-soft); border: 1px solid rgba(28,124,107,0.35);
  border-radius: var(--radius-md); padding: var(--sp-sm) var(--sp-md);
  color: var(--clr-teal-ink); font-weight: 500; font-size: var(--fs-xs); margin-top: var(--sp-md);
  line-height: 1.5;
}
[data-theme='dark'] .report-stamp { color: var(--clr-teal); }
.report-stamp svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: var(--clr-teal); }

@media print {
  .site-header, .site-footer, .hero__ctas, .toast-region, .theme-toggle, .newsletter, .ad-slot { display: none !important; }
  body { background: #fff; color: #000; }
  .results-panel { border: none; }
  .results-header { background: none !important; color: #10181C !important; padding-inline: 0; }
  .export-bar { display: none !important; }
  .report-preview { border: none; padding: 0; }
  .report-preview-chrome { display: none !important; }
  /* Without this, browsers are free to mute, desaturate, or substitute
     colors in print/PDF output at their own discretion - this is what
     was silently turning the amber brand color back into something
     duller in printed and PDF-exported reports, with no CSS rule
     anywhere actually specifying a different color. Forcing exact
     color rendering makes the printed brand color match the screen
     color precisely. */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
}

/* Isolated report-only print view, activated briefly by the PDF Report
   export button so the printed/saved-as-PDF output is just the report
   card, not the surrounding page (header, form, sidebar, breadcrumbs).
   Scoped entirely inside @media print so the page looks unaffected on
   screen while the class is briefly present. */
@media print {
  body.ase-print-report-only main > section { display: none !important; }
  body.ase-print-report-only main > section#ase-tool-section { display: block !important; }
  body.ase-print-report-only .site-header, body.ase-print-report-only .site-footer,
  body.ase-print-report-only .breadcrumb, body.ase-print-report-only #ase-back-to-top,
  body.ase-print-report-only .tool-card-body, body.ase-print-report-only .page-sidebar,
  body.ase-print-report-only .quote-request-card { display: none !important; }
  /* hiding the sidebar alone leaves .page-content pinned to its original
     grid-column track (about 70% of the row), so the report still prints
     narrow and left-aligned; the grid itself has to collapse to one
     full-width column for the report to actually fill the page */
  body.ase-print-report-only .page-layout { display: block !important; width: 100% !important; }
  body.ase-print-report-only .page-content { width: 100% !important; max-width: none !important; }
  body.ase-print-report-only .report-preview-wrap { width: 100% !important; max-width: none !important; }
}

/* ---------------------------------------------------------------------- */
/* BLOG: AskHVAC pattern in the Solar theme. Gradient hero with a curved  */
/* bottom edge, card grid on the hub, callout and CTA boxes on posts.     */
/* All colors come from the Solar variables above, so light and dark      */
/* modes follow automatically.                                            */
/* ---------------------------------------------------------------------- */
.blog-hero { background: linear-gradient(135deg, #E8721C 0%, var(--clr-amber) 55%, #FFA95C 100%); padding-block: var(--sp-xl) var(--sp-2xl); color: #fff; position: relative; overflow: hidden; }
.blog-hero::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 44px; background: var(--clr-bg); clip-path: ellipse(55% 100% at 50% 100%); }
.blog-hero--teal { background: linear-gradient(135deg, #0E3B43 0%, #1C7C6B 100%); }
.blog-hero__inner { position: relative; z-index: 1; }
.blog-hero .breadcrumb { color: rgba(255,255,255,0.75); margin-bottom: var(--sp-sm); }
.blog-hero .breadcrumb a { color: rgba(255,255,255,0.75); }
.blog-hero .breadcrumb a:hover { color: #fff; }
.blog-hero h1 { color: #fff; margin-bottom: var(--sp-sm); }
.blog-hero__desc { color: rgba(255,255,255,0.85); font-size: var(--fs-lg); line-height: var(--lh-snug); max-width: 60ch; }
.blog-hero__meta { display: flex; align-items: center; gap: var(--sp-sm); color: rgba(255,255,255,0.75); font-size: var(--fs-sm); margin-top: var(--sp-sm); flex-wrap: wrap; }
.blog-hero__meta-sep { opacity: 0.5; }

.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-md); margin-top: var(--sp-lg); }
.blog-card { display: flex; flex-direction: column; background: var(--clr-bg-raised); border: 1px solid var(--clr-line); border-radius: var(--radius-lg); overflow: hidden; text-decoration: none; transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); box-shadow: var(--shadow-sm); }
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--clr-amber); }
.blog-card__body { padding: var(--sp-md); }
.blog-card__tag { display: inline-block; font-size: var(--fs-2xs); font-weight: 700; color: var(--clr-amber-ink); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--sp-2xs); }
[data-theme='dark'] .blog-card__tag { color: var(--clr-amber); }
.blog-card__title { font-family: var(--font-display); font-size: var(--fs-md); font-weight: 700; color: var(--clr-ink); margin-bottom: var(--sp-2xs); line-height: 1.3; }
.blog-card__excerpt { font-size: var(--fs-sm); color: var(--clr-ink-soft); line-height: 1.6; margin-bottom: var(--sp-sm); }
.blog-card__meta { display: flex; align-items: center; gap: var(--sp-2xs); font-size: var(--fs-xs); color: var(--clr-ink-soft); }
.blog-card__meta-sep { opacity: 0.5; }
.blog-card__img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }

.blog-note { background: var(--clr-amber-soft); border: 1px solid var(--clr-line); border-radius: var(--radius-lg); padding: var(--sp-md); margin-top: var(--sp-lg); text-align: center; }
.blog-note p { color: var(--clr-ink-soft); font-size: var(--fs-sm); margin: 0; }

.blog-article { max-width: 74ch; margin: 0 auto; }
.blog-article h2 { margin-top: var(--sp-lg); }
.blog-article h3 { margin-top: var(--sp-md); }
.blog-article p { line-height: 1.7; }

.blog-callout { background: var(--clr-amber-soft); border-left: 4px solid var(--clr-amber); border-radius: var(--radius-md); padding: var(--sp-md); margin: var(--sp-md) 0; }
.blog-callout p { margin: 0; font-size: var(--fs-sm); }
.blog-callout a { color: var(--clr-amber-ink); font-weight: 700; }
[data-theme='dark'] .blog-callout a { color: var(--clr-amber); }

.blog-cta { background: linear-gradient(135deg, var(--clr-amber-soft), rgba(255,138,52,0.08)); border: 1.5px solid var(--clr-amber); border-radius: var(--radius-lg); padding: var(--sp-md); margin: var(--sp-lg) 0; text-align: center; }
.blog-cta h3 { margin-top: 0; }
.blog-cta p { font-size: var(--fs-sm); color: var(--clr-ink-soft); margin-bottom: var(--sp-sm); }

.blog-figure { margin: var(--sp-md) 0; }
.blog-figure img { width: 100%; height: auto; display: block; border: 1px solid var(--clr-line); border-radius: var(--radius-lg); }
.blog-figure figcaption { font-size: var(--fs-xs); color: var(--clr-ink-faint); text-align: center; margin-top: var(--sp-2xs); }

.blog-author { color: rgba(255,255,255,0.85); font-size: var(--fs-sm); margin: var(--sp-2xs) 0 0; }
.blog-hero-img { margin-top: var(--sp-lg); }
.blog-hero-img img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--clr-line); border-radius: var(--radius-lg); }
.blog-takeaway { background: var(--clr-teal-soft); border-left: 4px solid var(--clr-teal); border-radius: var(--radius-md); padding: var(--sp-md); margin: var(--sp-md) 0; }
.blog-takeaway p { margin: 0; font-size: var(--fs-sm); }
.blog-related { background: var(--clr-bg-sunk); border: 1px solid var(--clr-line); border-radius: var(--radius-lg); padding: var(--sp-md); margin: var(--sp-lg) 0; }
/* BLOG GAP (2026-11-20): on the battery blog page .blog-related is the
   last child of the article container, so its 36px bottom margin
   collapses out of the section and shows as a 36px empty strip before
   the sunk section. On the other 6 blog pages a "Last updated" line
   follows it, so the margin is contained spacing there and is untouched. */
.blog-article > .blog-related:last-child { margin-bottom: 0; }
.blog-related h3 { margin-top: 0; }
.blog-related ul { margin: 0; padding-left: 1.25rem; }
.blog-related li { margin-bottom: var(--sp-2xs); }
.blog-related li:last-child { margin-bottom: 0; }
.blog-related a { font-weight: 600; }

@media (max-width: 640px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-hero { padding-block: var(--sp-lg) var(--sp-xl); }
}

/* Interactive blog diagrams: sliders, toggles and live bars. Pure HTML/CSS/JS, no libraries. */
.blog-interactive { background: var(--clr-bg-raised); border: 1px solid var(--clr-line); border-radius: var(--radius-lg); padding: var(--sp-md); margin: 0; }
.doc-section > :last-child { margin-bottom: 0; }
.blog-interactive__title { font-family: var(--font-display); font-size: var(--fs-md); font-weight: 700; margin: 0 0 var(--sp-sm); }
.blog-interactive__hint { font-size: var(--fs-sm); color: var(--clr-ink-soft); margin: 0 0 var(--sp-sm); }
.ib__slider-row { display: flex; align-items: center; gap: var(--sp-sm); flex-wrap: wrap; margin-bottom: var(--sp-sm); }
.ib__slider-row label { font-weight: 700; font-size: var(--fs-sm); }
.ib__slider { flex: 1; min-width: 180px; accent-color: var(--clr-amber); height: 2rem; }
.ib__value { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 700; color: var(--clr-amber-ink); white-space: nowrap; }
[data-theme='dark'] .ib__value { color: var(--clr-amber); }
.ib__steps { display: flex; gap: var(--sp-sm); flex-wrap: wrap; }
.ib__step { flex: 1 1 120px; background: var(--clr-bg-sunk); border: 1px solid var(--clr-line); border-radius: var(--radius-md); padding: var(--sp-sm); text-align: center; }
.ib__step--result { background: var(--clr-teal); border-color: var(--clr-teal); color: #FFFFFF; }
.ib__step-label { font-size: var(--fs-xs); font-weight: 700; color: var(--clr-teal-ink); text-transform: uppercase; letter-spacing: 0.04em; }
.ib__step--result .ib__step-label { color: var(--clr-teal-soft); }
.ib__step-val { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 700; margin-top: var(--sp-2xs); }
.ib__step-sub { font-size: var(--fs-xs); color: var(--clr-ink-soft); margin-top: var(--sp-2xs); }
.ib__step--result .ib__step-sub { color: rgba(255,255,255,0.85); }
.ib__bars { display: grid; gap: var(--sp-sm); margin-top: var(--sp-sm); }
.ib__bar-row { display: grid; grid-template-columns: 9rem 1fr 6.5rem; gap: var(--sp-sm); align-items: center; font-size: var(--fs-sm); }
.ib__bar-label { font-weight: 700; }
.ib__bar-track { background: var(--clr-bg-sunk); border: 1px solid var(--clr-line); border-radius: var(--radius-full); height: 1.5rem; overflow: hidden; }
.ib__bar-fill { height: 100%; border-radius: var(--radius-full); transition: width 0.2s ease; }
.ib__bar-fill--teal { background: var(--clr-teal); }
.ib__bar-fill--amber { background: var(--clr-amber); }
.ib__bar-val { font-weight: 700; text-align: right; white-space: nowrap; }

/* EV BAR-VALUE OVERFLOW (2026-11-20): on the two EV sizing pages below,
   every .ib__bar-val reads "NN.N kWh/100mi" (14 chars, 116.7px at the
   bold font), but the value column is 6.5rem (104px), so each span
   overflows by 13px. Widen the column to 8.5rem on these two pages only,
   scoped by the unique bar-value id prefixes. No other page has a
   14-char bar value. */
.ib__bar-row:has(> .ib__bar-val[id^="ib-electric-suv-solar-sizing-calculator-val"]),
.ib__bar-row:has(> .ib__bar-val[id^="ib-electric-sedan-solar-sizing-calculator-val"]) {
  grid-template-columns: 9rem 1fr 8.5rem;
}
.ib__toggle { display: flex; gap: var(--sp-sm); flex-wrap: wrap; margin-bottom: var(--sp-sm); }
.ib__toggle-btn { font: inherit; font-size: var(--fs-sm); font-weight: 700; padding: var(--sp-xs) var(--sp-sm); border: 1.5px solid var(--clr-line); border-radius: var(--radius-full); background: var(--clr-bg-raised); color: var(--clr-ink); cursor: pointer; }
.ib__toggle-btn[aria-pressed="true"] { background: var(--clr-teal); border-color: var(--clr-teal); color: #FFFFFF; }
.ib__toggle-btn:focus-visible { outline: 3px solid var(--clr-amber); outline-offset: 2px; }
.ib__result { display: flex; gap: var(--sp-sm); flex-wrap: wrap; margin-top: var(--sp-sm); }
.ib__result-item { flex: 1 1 140px; background: var(--clr-bg-sunk); border: 1px solid var(--clr-line); border-radius: var(--radius-md); padding: var(--sp-sm); text-align: center; }
.ib__result-label { font-size: var(--fs-xs); font-weight: 700; color: var(--clr-ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.ib__result-val { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 700; margin-top: var(--sp-2xs); }
.ib__note { font-size: var(--fs-xs); color: var(--clr-ink-soft); margin: var(--sp-sm) 0 0; }

/* BLOG DIAGRAM GAPS (2026-11-20): equal 16px internal gaps inside
   figure.blog-interactive. Root cause: .doc-section p { margin-bottom:
   var(--sp-md); } (24px) beats the single-class diagram rules on the
   blog pages inside .doc-section, so title, hint and note all computed
   to 24px; on the battery page (not in .doc-section) the note stayed
   at 0 and the caption gap collapsed to 8px. These selectors score
   (0,2,1), beating .doc-section p (0,1,1), and only touch elements
   inside figure.blog-interactive, so tool pages keep their 16px values. */
.blog-interactive p.blog-interactive__title { margin-bottom: var(--sp-sm); }
.blog-interactive p.blog-interactive__hint { margin-bottom: var(--sp-sm); }
.blog-interactive p.ib__note { margin-bottom: var(--sp-sm); }
.blog-figure.blog-interactive figcaption { margin-top: var(--sp-sm); }
@media (max-width: 640px) {
  .ib__bar-row { grid-template-columns: 6.5rem 1fr 5rem; }
  /* EV BAR-VALUE OVERFLOW, mobile (2026-11-20): the 5rem value column
     cannot hold 110.3px of text at any readable size, and widening it
     would crush the track to about 36px. Move the value onto its own
     full-width row under label and track instead, on these two pages. */
  .ib__bar-row:has(> .ib__bar-val[id^="ib-electric-suv-solar-sizing-calculator-val"]),
  .ib__bar-row:has(> .ib__bar-val[id^="ib-electric-sedan-solar-sizing-calculator-val"]) {
    grid-template-columns: 6.5rem 1fr;
  }
  .ib__bar-row:has(> .ib__bar-val[id^="ib-electric-suv-solar-sizing-calculator-val"]) .ib__bar-val,
  .ib__bar-row:has(> .ib__bar-val[id^="ib-electric-sedan-solar-sizing-calculator-val"]) .ib__bar-val {
    grid-column: 1 / -1;
  }
}

/* TOOL INFOGRAPHIC IMAGE: a labelled SVG diagram that explains one tool.
   Each element is a node; hovering, focusing or tapping it shows a tooltip
   that explains that element. Pure HTML/CSS/JS, no libraries. */
.ig-wrap { position: relative; background: var(--clr-bg-raised); border: 1px solid var(--clr-line); border-radius: var(--radius-lg); padding: var(--sp-md); margin: 0; }
.ig-title { font-family: var(--font-display); font-size: var(--fs-md); font-weight: 700; margin: 0 0 var(--sp-2xs); }
.ig-hint { font-size: var(--fs-sm); color: var(--clr-ink-soft); margin: 0 0 var(--sp-sm); }
.ig-svg { width: 100%; height: auto; display: block; }
.ig-node { cursor: pointer; }
.ig-node:hover { opacity: 0.88; }
.ig-node:focus-visible { outline: 3px solid var(--clr-amber); outline-offset: 4px; }
.ig-label { font-family: var(--font-body); font-size: 14px; font-weight: 700; fill: var(--clr-ink); }
.ig-val { font-family: var(--font-display); font-size: 15px; font-weight: 700; fill: var(--clr-ink); }
.ig-big { font-family: var(--font-display); font-size: 18px; font-weight: 700; fill: var(--clr-amber-ink); }
.ig-small { font-family: var(--font-body); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; }
.ig-total { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.ig-tip { position: absolute; z-index: 5; max-width: 280px; background: #10181C; color: #FFFFFF; font-size: 14px; line-height: 1.5; padding: 10px 12px; border-radius: 10px; box-shadow: 0 6px 20px rgba(16,24,28,0.25); pointer-events: none; opacity: 0; visibility: hidden; transform: translate(-50%, -8px); transition: opacity 0.15s ease, visibility 0.15s ease; }
.ig-tip--show { opacity: 1; visibility: visible; }
@media (max-width: 640px) { .ig-tip { max-width: 220px; font-size: 13px; } }

/* Round 4 homepage seams (2026-11-20).
   The two remaining tight seams on the homepage, measured live at 1919px.
   Both have the same root cause as round 3: the sitewide stacked-sections
   rule in shared.css sets padding-bottom: 0 on the upper section, so the
   background change runs almost flush against the last content.
   Timeline seam: the timeline section (section--sunk, .timeline, not a
   grid) ends with step 5 whose last line of text sits 4px above the
   background change into the glossary section. The vertical timeline
   line itself is not clipped; it ends cleanly 6px above the change
   (.timeline::before has bottom: 6px). The tight look comes from the
   4px after the text.
   FAQ seam: the FAQ section ends with the accordion list; the last
   question text sits well clear, but the list's bottom divider (the
   1px border-bottom of the last accordion-item) sits flush against the
   background change into the scenarios section, reading as touching it.
   Fix, same rhythm-preserving rule as round 3: give the upper section
   bottom padding and take the same amount off the top padding of the
   section that follows it, so the total content gap stays 88px and the
   colour change lands 25px below the last content, matching the round 3
   fixed seams (measured 25px live). Amounts are computed from the
   measured values: timeline 4px + 21px = 25px; FAQ divider 1px + 24px
   = 25px. Scoped to body[data-category="home"] so only the homepage
   changes. Hooks added to index.html for this patch: id="home-timeline"
   (timeline), id="home-faq" (FAQ), id="home-scenarios" (scenarios);
   #home-glossary already existed. No existing rule sets padding-top on
   #home-glossary or #home-scenarios, or padding-bottom on #home-timeline
   or #home-faq, so these rules do not conflict with the round 3 rules
   (#home-glossary keeps its round 3 padding-bottom; #home-faq keeps the
   padding-top set by the #home-glossary + .section round 3 rule).
   Grid gaps, row heights and the blog-hero gaps are not touched. */

body[data-category="home"] #home-timeline {
  padding-bottom: 21px;
}

body[data-category="home"] #home-glossary {
  padding-top: calc(var(--sp-2xl) - 21px);
}

body[data-category="home"] #home-faq {
  padding-bottom: var(--sp-md);
}

body[data-category="home"] #home-scenarios {
  padding-top: calc(var(--sp-2xl) - var(--sp-md));
}

/* ROUND 4 SITE-WIDE SEAMS (2026-11-21).
   Full-site inventory (measure-round4-after-desktop-v2.jsonl, 982 pages at
   1440px, plus measure-round4-after-mobile-v2.jsonl, 26 pages at 390px):
   3,517 flagged seams in 14 template groups. 1,744 FIX-CANDIDATE, 1,771
   LEAVE-ALONE (plain-text endings at 4px, 5px, 7px and 19px, and the
   confirmed blog-hero non-defects), 2 NEEDS-REVIEW (the blog-related box,
   judged a real defect below: it paints a background and a border).
   Every fix below follows the same rhythm-preserving rule as rounds 3 and
   4 on the homepage: give the upper section bottom padding and take the
   same amount off the top padding of the section that follows it, so the
   total content gap is unchanged and the clearance lands at 25px, the
   round 4 homepage target. No grid gap is changed, no row height is
   forced, and no blog-hero gap is touched.
   Selector match counts were verified against the measured data before
   this patch was written: each rule matches exactly the pages in its
   defect group, no more. The homepage seams are NOT covered here; they
   are fixed by css-patches/homepage-seams-round4.css, and patch 3 below
   excludes body[data-category="home"] so the two never stack. */

/* 1. INTERACTIVE-DIAGRAM FIGURE (0px, 847 desktop + 14 mobile = 861).
   The first tool-infographic section ends with FIGURE.blog-figure
   .blog-interactive, and the next section is sunk. The figure's bottom
   edge sits 0px above the background change. Fix: 25px of bottom padding
   on the infographic section, 25px off the top of the following sunk
   section (88px to 63px). The second infographic section is followed by
   a plain section, so it never matches the :has(+ .section--sunk) guard
   and is left alone. */
main > section.tool-infographic:has(+ section.section--sunk) {
  padding-bottom: 25px;
}

main > section.tool-infographic:has(+ section.section--sunk) + section.section--sunk {
  padding-top: calc(var(--sp-2xl) - 25px);
}

/* 2. HOW-IT-WORKS TIMELINE (4px, 850 desktop + 17 mobile = 867).
   The sunk How-it-works section holds the timeline, and its last step's
   text (or a link inside the last step, or a short trailing paragraph in
   the same section) sits 4px above the background change into the second
   infographic section. This is the same defect Muhammad flagged on the
   homepage timeline, confirmed on the control tool page. Fix: 21px of
   bottom padding on the timeline section (4px to 25px) and 21px off the
   top of the following infographic section (56px to 35px). The
   :has(+ section.tool-infographic) guard means a timeline section
   followed by anything else is left alone, and the homepage timeline
   (followed by #home-glossary) never matches. */
main > section.section--sunk:has(.timeline):has(+ section.tool-infographic) {
  padding-bottom: 21px;
}

main > section.section--sunk:has(.timeline):has(+ section.tool-infographic) + section.tool-infographic {
  padding-top: calc(var(--sp-xl) - 21px);
}

/* 3. FAQ DIVIDER (1px, 850 desktop + 17 mobile = 867).
   The sunk FAQ section ends with the accordion list, and the last
   accordion-item's 1px bottom divider sits 1px above the background
   change into the plain section that follows. Same pattern as the
   homepage FAQ seam. Fix: 24px of bottom padding on the FAQ section
   (1px to 25px) and 24px off the top of the following plain section
   (88px to 64px). The :has(+ section:not(.section--sunk)) guard means
   the 23 pages whose FAQ section is the last section (16 hub indexes
   and 7 blog pages) never match, so nothing is added before the footer.
   body:not([data-category="home"]) keeps the homepage FAQ out of this
   rule; the homepage patch owns #home-faq and #home-scenarios with the
   same values. */
body:not([data-category="home"]) main > section.section--sunk:has(.accordion-item):has(+ section:not(.section--sunk)) {
  padding-bottom: var(--sp-md);
}

body:not([data-category="home"]) main > section.section--sunk:has(.accordion-item):has(+ section:not(.section--sunk)) + section:not(.section--sunk) {
  padding-top: calc(var(--sp-2xl) - var(--sp-md));
}

/* 4. HUB FEATURED CARD (0px, 13 desktop + 1 mobile = 14).
   On 13 hub index pages the "tool most people run first" section ends
   with a single featured card link (a.card.card--hover, the last child
   of the section's container), not a grid, so the round 3 hub grid rule
   (which needs .grid:last-child) never matched it. The card's bottom
   edge sits 0px above the background change into the following sunk
   browse section. Fix: 25px of bottom padding on the card section and
   25px off the top of the following sunk section (88px to 63px). The
   :has(> .container > a.card:last-child) guard means a section whose
   container ends with anything else (for example the system-sizing hub,
   whose featured section ends with a paragraph) never matches. */
main > section:not(.section--sunk):has(+ section.section--sunk):has(> .container > a.card:last-child) {
  padding-bottom: 25px;
}

main > section:not(.section--sunk):has(+ section.section--sunk):has(> .container > a.card:last-child) + section.section--sunk {
  padding-top: calc(var(--sp-2xl) - 25px);
}

/* 5. BLOG-RELATED BOX (0px, 1 desktop + 1 mobile = 2).
   On the overnight-backup blog page the .blog-related box ("Keep
   reading") is the last child of the article container, so its bottom
   border sits 0px above the background change into the sunk FAQ section.
   The box paints a visible edge (sunk background, 1px border, radius),
   so this is a real defect, not a plain-text ending. On the other 6 blog
   pages a "Last updated" line follows the box, so their containers do
   not end with it and never match. Fix: 25px of bottom padding on the
   article section and 25px off the top of the following sunk FAQ section
   (88px to 63px). */
main > section:has(> .container.blog-article > .blog-related:last-child) {
  padding-bottom: 25px;
}

main > section:has(> .container.blog-article > .blog-related:last-child) + section.section--sunk {
  padding-top: calc(var(--sp-2xl) - 25px);
}
