/*!
 * irrigationcalculators.com: shared stylesheet for every calculator page.
 * Page-specific CSS (e.g. a result visual) goes in a small <style> block on that page.
 */
/* =================================================================
   1. DESIGN TOKENS
   Shared by every calculator page. Change here, not in components.
   ================================================================= */
:root {
  /* Color */
  --color-primary: #1D6146;        /* turf green: links, buttons, brand */
  --color-primary-hover: #154A35;
  --color-primary-soft: #E6F0EB;
  --color-secondary: #1E5A8A;      /* water blue: results, applied water */
  --color-secondary-soft: #E7EFF6;
  --color-accent: #B7791F;         /* ochre: target markers, sparing highlights */
  --color-bg: #F5F7F6;
  --color-surface: #FFFFFF;
  --color-surface-alt: #EEF2F0;
  --color-text: #17211E;
  --color-muted: #4F5D58;
  --color-border: #D5DDD9;
  --color-border-strong: #9AAAA3;
  --color-success: #2B6E3F;
  --color-warning: #8A5A00;
  --color-warning-soft: #FDF4E3;
  --color-error: #B42318;
  --color-error-soft: #FDECEA;
  --color-rain: #8FB3CC;
  --color-focus: #1E5A8A;

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-xs: 0.8125rem;   /* metadata */
  --text-sm: 0.875rem;    /* helper text, captions */
  --text-label: 0.9375rem;
  --text-base: 1.0625rem; /* body */
  --text-h3: 1.1875rem;
  --text-h2: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
  --text-h1: clamp(1.75rem, 1.45rem + 1.4vw, 2.375rem);
  --text-result: clamp(1.875rem, 1.6rem + 1.2vw, 2.375rem);
  --leading-body: 1.62;
  --leading-tight: 1.2;

  /* Space (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Shape */
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-panel: 0 1px 2px rgba(23, 33, 30, 0.06), 0 4px 16px rgba(23, 33, 30, 0.05);

  /* Layout */
  --container: 1160px;
  --measure: 70ch;
  --tap: 44px;
}

/* =================================================================
   2. BASE
   ================================================================= */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--space-4); }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--color-text);
  background: var(--color-bg);
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: var(--leading-tight); margin: 0 0 var(--space-3); letter-spacing: -0.01em; }
h1 { font-size: var(--text-h1); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: var(--text-h2); font-weight: 700; }
h3 { font-size: var(--text-h3); font-weight: 650; }
p { margin: 0 0 var(--space-4); }
a { color: var(--color-primary); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--color-primary-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; border-radius: 2px; }
button, input, select { font: inherit; color: inherit; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--space-4); }
@media (min-width: 768px) { .container { padding-inline: var(--space-6); } }
.visually-hidden {
  position: absolute !important; 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(--space-4); top: -100px; z-index: 100;
  background: var(--color-surface); padding: var(--space-2) var(--space-4);
  border: 2px solid var(--color-focus); border-radius: var(--radius);
}
.skip-link:focus { top: var(--space-2); }
.num { font-variant-numeric: tabular-nums; }

/* =================================================================
   3. HEADER + NAV
   Not sticky: on phones a sticky bar costs ~60px of calculator space.
   ================================================================= */
.site-header { background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: var(--space-4); }
.site-logo { font-weight: 750; font-size: 1.125rem; color: var(--color-text); text-decoration: none; letter-spacing: -0.01em; }
.site-logo:hover { color: var(--color-primary); }
.site-footer .site-logo--footer { color: #fff; }
.nav-toggle { display: none; }
.js .nav-toggle {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: var(--tap); padding: 0 var(--space-3);
  background: none; border: 1px solid var(--color-border); border-radius: var(--radius); cursor: pointer;
  font-size: var(--text-label); font-weight: 600;
}
.nav-toggle__bars { width: 16px; height: 12px; position: relative; }
.nav-toggle__bars::before, .nav-toggle__bars::after, .nav-toggle__bars span {
  content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor; border-radius: 1px;
}
.nav-toggle__bars::before { top: 0; }
.nav-toggle__bars span { top: 5px; }
.nav-toggle__bars::after { bottom: 0; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: flex; align-items: center; min-height: var(--tap); padding: 0 var(--space-3);
  color: var(--color-text); text-decoration: none; font-weight: 550; font-size: var(--text-label);
  border-radius: var(--radius);
}
.site-nav a:hover { background: var(--color-surface-alt); color: var(--color-text); }
.site-nav a[aria-current="page"], .site-nav a.is-section { color: var(--color-primary); box-shadow: inset 0 -2px 0 var(--color-primary); border-radius: 0; }

/* Mobile nav: disclosure panel */
.js .site-nav { display: none; }
.js .site-nav.is-open {
  display: block; position: absolute; left: 0; right: 0; top: 60px; z-index: 50;
  background: var(--color-surface); border-bottom: 1px solid var(--color-border);
  padding: var(--space-2) var(--space-4) var(--space-4);
}
.site-header { position: relative; }
.site-nav.is-open a.is-section { box-shadow: inset 3px 0 0 var(--color-primary); }
@media (min-width: 720px) {
  .js .nav-toggle { display: none; }
  .js .site-nav, .site-nav { display: block; position: static; padding: 0; border: 0; }
  .site-nav ul { display: flex; gap: var(--space-1); }
}

/* =================================================================
   4. BREADCRUMBS + PAGE INTRO
   ================================================================= */
.breadcrumbs { padding-top: var(--space-4); font-size: var(--text-sm); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-1) 0; }
.breadcrumbs li { display: flex; align-items: center; color: var(--color-muted); }
.breadcrumbs li + li::before { content: "/"; margin: 0 var(--space-2); color: var(--color-border-strong); }
.breadcrumbs a { color: var(--color-muted); }
.breadcrumbs a:hover { color: var(--color-primary); }

.page-intro { padding-block: var(--space-4) var(--space-6); max-width: 760px; }
.page-intro h1 { margin-bottom: var(--space-3); }
.lede { font-size: 1.125rem; color: var(--color-text); max-width: 62ch; margin-bottom: var(--space-3); }
.byline { display: flex; align-items: center; gap: var(--space-3); }
.byline__photo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--color-surface-alt); flex: none; }
.byline__text { font-size: var(--text-xs); color: var(--color-muted); margin: 0; line-height: 1.5; }
.byline__text a { color: var(--color-muted); }
.byline__text a[rel="author"] { color: var(--color-text); font-weight: 600; }

/* =================================================================
   5. CALCULATOR SHELL
   ================================================================= */
.calc {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: var(--space-12);
}
.calc-form { padding: var(--space-5) var(--space-4); }
.calc-results { padding: var(--space-5) var(--space-4); border-top: 1px solid var(--color-border); background: #FBFCFB; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
@media (min-width: 600px) {
  .calc-form, .calc-results { padding: var(--space-6); }
}
@media (min-width: 900px) {
  .calc { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); }
  .calc-form { padding: var(--space-8); }
  .calc-results { border-top: 0; border-left: 1px solid var(--color-border); padding: var(--space-8); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
  .calc-results__sticky { position: sticky; top: var(--space-6); }
}
.calc-heading { font-size: var(--text-h3); margin-bottom: var(--space-1); }
.calc-subheading { font-size: var(--text-sm); color: var(--color-muted); margin-bottom: var(--space-5); }

/* =================================================================
   6. FORM COMPONENTS
   ================================================================= */
.field { margin: 0 0 var(--space-5); border: 0; padding: 0; min-width: 0; }
.field-label, .field > legend {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2);
  font-size: var(--text-label); font-weight: 650; margin-bottom: var(--space-2); padding: 0;
}
.field-tag { font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); }
.field-help { font-size: var(--text-sm); color: var(--color-muted); margin: var(--space-2) 0 0; line-height: 1.5; }
.field-help a { color: var(--color-muted); }
.field-help a:hover { color: var(--color-primary); }

.input-wrap {
  display: flex; align-items: stretch;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input-wrap:focus-within { border-color: var(--color-focus); box-shadow: 0 0 0 3px rgba(30, 90, 138, 0.18); }
.input-wrap input, .input-wrap select {
  flex: 1; min-width: 0; min-height: 48px; padding: 0 var(--space-3);
  border: 0; background: transparent; border-radius: var(--radius);
  font-size: 1.0625rem; /* >=16px prevents iOS zoom */
  font-variant-numeric: tabular-nums;
}
.input-wrap input:focus, .input-wrap select:focus { outline: none; }
.input-wrap select { cursor: pointer; appearance: none; padding-right: var(--space-8);
  background-image: linear-gradient(45deg, transparent 50%, var(--color-muted) 50%), linear-gradient(135deg, var(--color-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat; }
.input-unit {
  display: flex; align-items: center; padding: 0 var(--space-3);
  color: var(--color-muted); font-size: var(--text-sm); white-space: nowrap;
  border-left: 1px solid var(--color-border); background: var(--color-surface-alt);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.field-row .field { margin-bottom: 0; }
.field-row__times { display: none; }
.computed-note { font-size: var(--text-sm); color: var(--color-text); margin: var(--space-2) 0 0; min-height: 1.5em; }

/* States: never color alone. Errors get an icon glyph + text + thicker border. */
.field.has-error .input-wrap { border-color: var(--color-error); border-width: 2px; }
.field.has-warning .input-wrap { border-color: var(--color-warning); }
.field-message { font-size: var(--text-sm); margin: var(--space-2) 0 0; display: none; line-height: 1.45; }
.field-message.is-visible { display: flex; gap: var(--space-2); }
.field-message::before { flex: none; font-weight: 700; }
.field-message--error { color: var(--color-error); }
.field-message--error::before { content: "!"; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--color-error); color: #fff; font-size: 12px; margin-top: 1px; }
.field-message--warning { color: var(--color-warning); }
.field-message--warning::before { content: "i"; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid currentColor; font-size: 11px; font-style: italic; margin-top: 1px; }

/* Segmented control (radio group). Used for unit system and input modes. */
.segmented { display: inline-flex; border: 1px solid var(--color-border-strong); border-radius: var(--radius); overflow: hidden; background: var(--color-surface); max-width: 100%; }
.segmented label { position: relative; display: flex; flex: 1 1 auto; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span {
  display: flex; align-items: center; min-height: 40px; padding: 0 var(--space-4);
  font-size: var(--text-sm); font-weight: 600; color: var(--color-muted); cursor: pointer;
  width: 100%; justify-content: center; text-align: center; line-height: 1.25; padding-block: var(--space-2);
}
@media (max-width: 380px) { .segmented span { padding-inline: var(--space-3); } }
.segmented label + label span { border-left: 1px solid var(--color-border); }
.segmented input:checked + span { background: var(--color-primary); color: #fff; }
.segmented input:focus-visible + span { outline: 3px solid var(--color-focus); outline-offset: -3px; }
.segmented input:not(:checked):hover + span { background: var(--color-surface-alt); color: var(--color-text); }
.segmented--spaced { margin-bottom: var(--space-3); }
.field--flush { margin-bottom: 0; }
.calc-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-5); padding-bottom: var(--space-5); border-bottom: 1px solid var(--color-border); }
.calc-toolbar .field { margin: 0; }
.calc-toolbar legend { margin-bottom: var(--space-2); }

.optional-group { margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px dashed var(--color-border); }
.optional-group .field { margin-bottom: 0; }
.optional-group__title { font-size: var(--text-label); font-weight: 650; margin: 0 0 var(--space-4); color: var(--color-muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap); padding: 0 var(--space-4);
  border-radius: var(--radius); border: 1px solid transparent;
  font-size: var(--text-label); font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-hover); color: #fff; }
.btn--secondary { background: var(--color-surface); border-color: var(--color-border-strong); color: var(--color-text); }
.btn--secondary:hover { background: var(--color-surface-alt); color: var(--color-text); }
.btn--quiet { background: none; color: var(--color-muted); padding-inline: var(--space-2); text-decoration: underline; text-underline-offset: 0.2em; }
.btn--quiet:hover { color: var(--color-text); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-6); }
.form-actions__note { font-size: var(--text-xs); color: var(--color-muted); margin: 0; }

/* =================================================================
   7. RESULTS
   ================================================================= */
.result-label { font-size: var(--text-label); font-weight: 650; color: var(--color-muted); margin: 0 0 var(--space-1); }
.result-empty { color: var(--color-muted); font-size: var(--text-sm); padding: var(--space-4); border: 1px dashed var(--color-border-strong); border-radius: var(--radius); background: var(--color-surface); }
.result-empty p:last-child { margin-bottom: 0; }
.result-empty ul { margin: var(--space-2) 0 0; padding-left: var(--space-5); }

.result-main { display: grid; grid-template-columns: auto 1fr; gap: var(--space-5); align-items: start; }
.result-primary__value { font-size: var(--text-result); font-weight: 750; color: var(--color-secondary); line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
.result-primary__approx { font-size: 0.55em; font-weight: 600; color: var(--color-muted); margin-right: 0.15em; letter-spacing: 0; }
.result-primary__sub { font-size: var(--text-sm); color: var(--color-muted); margin: var(--space-2) 0 0; }
.result-badge { display: inline-block; font-size: var(--text-xs); font-weight: 600; color: var(--color-muted); border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 0 var(--space-2); margin-top: var(--space-2); background: var(--color-surface); }
.result-done { font-size: 1.25rem; font-weight: 700; color: var(--color-success); margin: 0; line-height: 1.3; }

.result-list { margin: var(--space-5) 0 0; padding: 0; border-top: 1px solid var(--color-border); }
.result-list div { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
.result-list dt { font-size: var(--text-sm); color: var(--color-muted); }
.result-list dd { margin: 0; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.result-list dd small { display: block; font-weight: 400; color: var(--color-muted); font-size: var(--text-xs); }
.result-list .is-muted dd { font-weight: 400; color: var(--color-muted); font-size: var(--text-sm); }

.result-explain { margin: var(--space-5) 0 0; font-size: 0.9875rem; }
.result-assumptions { margin-top: var(--space-4); font-size: var(--text-sm); color: var(--color-muted); }
.result-assumptions summary { cursor: pointer; font-weight: 600; color: var(--color-text); min-height: var(--tap); display: flex; align-items: center; }
.result-assumptions ul { margin: 0 0 var(--space-2); padding-left: var(--space-5); }
.result-assumptions li + li { margin-top: var(--space-1); }


/* Result visual legend (any calculator with a small result visual) */
.gauge-legend { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); font-size: var(--text-xs); color: var(--color-muted); }
.gauge-legend li { display: flex; align-items: center; gap: var(--space-2); }
.swatch { width: 14px; height: 10px; border-radius: 2px; flex: none; }
.swatch--water { background: var(--color-secondary); }
.swatch--target { height: 0; border-top: 3px solid var(--color-accent); border-radius: 0; }

/* Result actions */
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin-top: var(--space-5); }
@media (min-width: 480px) { .result-actions { grid-template-columns: repeat(4, auto); justify-content: start; } }
.result-actions .btn { padding-inline: var(--space-3); }
.action-status { font-size: var(--text-sm); color: var(--color-success); margin: var(--space-2) 0 0; min-height: 1.4em; }

/* Mobile result bar: appears only while the result is scrolled out of view */
.result-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--color-surface); border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 16px rgba(23, 33, 30, 0.08);
  padding: var(--space-2) var(--space-4) calc(var(--space-2) + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  transform: translateY(110%); transition: transform 200ms ease;
}
.result-bar.is-visible { transform: translateY(0); }
.result-bar__text { font-size: var(--text-sm); line-height: 1.35; }
.result-bar .btn { flex: none; white-space: nowrap; }
.result-bar__text strong { color: var(--color-secondary); font-size: 1rem; }
@media (min-width: 900px) { .result-bar { display: none; } }

/* =================================================================
   8. CONTENT LAYOUT (TOC + article)
   ================================================================= */
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-8); }
@media (min-width: 1024px) {
  .content-layout { grid-template-columns: 220px minmax(0, 1fr); gap: var(--space-12); }
}
.toc { font-size: var(--text-sm); }
.toc__inner { border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); }
.toc summary { cursor: pointer; font-weight: 650; padding: var(--space-3) var(--space-4); min-height: var(--tap); display: flex; align-items: center; }
.toc ol { list-style: none; margin: 0; padding: 0 var(--space-4) var(--space-3); }
.toc a { display: block; padding: var(--space-2) 0; color: var(--color-muted); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--color-primary); text-decoration: underline; }
.toc a.is-active { color: var(--color-text); font-weight: 600; }
@media (min-width: 1024px) {
  .toc__inner { position: sticky; top: var(--space-6); border: 0; background: none; }
  .toc summary { padding: 0 0 var(--space-2); min-height: 0; pointer-events: none; list-style: none; }
  .toc summary::-webkit-details-marker { display: none; }
  .toc ol { padding: 0; border-left: 2px solid var(--color-border); }
  .toc a { padding: var(--space-2) var(--space-3); margin-left: -2px; border-left: 2px solid transparent; }
  .toc a.is-active { border-left-color: var(--color-primary); }
}

.prose { max-width: var(--measure); min-width: 0; }
.prose section { margin-bottom: var(--space-12); }
.prose h3 { margin-top: var(--space-8); }
.prose ul, .prose ol { padding-left: var(--space-6); margin: 0 0 var(--space-4); }
.prose li + li { margin-top: var(--space-2); }
.prose strong { font-weight: 650; }

/* Formula box */
.formula {
  margin: var(--space-5) 0; padding: var(--space-4) var(--space-5);
  background: var(--color-surface); border: 1px solid var(--color-border); border-left: 4px solid var(--color-secondary);
  border-radius: var(--radius);
}
.formula__title { font-size: var(--text-sm); font-weight: 650; color: var(--color-muted); margin: 0 0 var(--space-2); }
.formula__expr { font-size: 1.0625rem; font-weight: 600; margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.formula__expr + .formula__expr { margin-top: var(--space-2); }
.formula__note { font-size: var(--text-sm); color: var(--color-muted); margin: var(--space-2) 0 0; }

/* Worked example steps (a real sequence, so numbered) */
.steps { list-style: none; counter-reset: step; padding: 0 !important; }
.steps li { counter-increment: step; position: relative; padding-left: var(--space-10); }
.steps li + li { margin-top: var(--space-4) !important; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0.1em;
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 1.5px solid var(--color-border-strong); border-radius: 50%;
  font-size: var(--text-sm); font-weight: 650; color: var(--color-muted);
}

/* Callouts */
.note { padding: var(--space-4) var(--space-5); border-radius: var(--radius); background: var(--color-primary-soft); margin: var(--space-5) 0; font-size: 0.9875rem; }
.note p:last-child { margin-bottom: 0; }
.note--caution { background: var(--color-warning-soft); }

/* Tables: scroll inside wrapper, never the page */
.table-wrap { overflow-x: auto; margin: var(--space-5) 0; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); -webkit-overflow-scrolling: touch; }
.table-wrap:focus-visible { outline-offset: 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
caption { text-align: left; font-size: var(--text-sm); color: var(--color-muted); padding: var(--space-3) var(--space-4); caption-side: bottom; border-top: 1px solid var(--color-border); }
th, td { text-align: left; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border); vertical-align: top; }
thead th { font-size: var(--text-sm); font-weight: 650; background: var(--color-surface-alt); white-space: nowrap; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody th { font-weight: 600; }
td.num, th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 599px) { .table--min { min-width: 560px; } }

/* FAQ */
.faq { border-top: 1px solid var(--color-border); }
.faq details { border-bottom: 1px solid var(--color-border); }
.faq summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--space-4);
  padding: var(--space-4) 0; min-height: var(--tap);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { font-size: 1.0625rem; margin: 0; font-weight: 650; }
.faq summary::after { content: "+"; flex: none; font-size: 1.375rem; line-height: 1; color: var(--color-muted); width: 20px; text-align: center; }
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover h3 { color: var(--color-primary); }
.faq__answer { padding: 0 0 var(--space-4); }
.faq__answer p:last-child { margin-bottom: 0; }

/* Author box (single author) */
.author-box { border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); padding: var(--space-5); }
@media (min-width: 600px) { .author-box { padding: var(--space-6); } }
.author-card { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-4); }
.author-card__photo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--color-surface-alt); flex: none; }
@media (min-width: 600px) { .author-card__photo { width: 96px; height: 96px; } }
.author-card__name { font-size: 1.125rem; font-weight: 700; margin: 0; }
.author-card__name a { color: var(--color-text); }
.author-card__title { font-size: var(--text-sm); color: var(--color-muted); margin: var(--space-1) 0 0; }
.author-box > p { font-size: 0.9875rem; }
.author-box__heading { font-size: 1rem; margin: var(--space-5) 0 var(--space-3) !important; }
.check-list { list-style: none; padding: 0 !important; font-size: 0.9375rem; }
.check-list li { position: relative; padding-left: var(--space-6); }
.check-list li::before { content: ""; position: absolute; left: 2px; top: 0.45em; width: 10px; height: 6px; border-left: 2px solid var(--color-success); border-bottom: 2px solid var(--color-success); transform: rotate(-45deg); }
.author-box__meta { font-size: var(--text-sm); color: var(--color-muted); border-top: 1px solid var(--color-border); padding-top: var(--space-4); margin-top: var(--space-5); }
.author-box__meta strong { color: var(--color-text); }
.author-box__meta p:last-child { margin-bottom: 0; }
.sources { font-size: 0.9375rem; }
.sources li { overflow-wrap: anywhere; }

/* =================================================================
   9. RELATED LINKS (calculators + guides)
   ================================================================= */
.related { margin-bottom: var(--space-12); }
.related__group + .related__group { margin-top: var(--space-8); }
.link-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--color-border); }
@media (min-width: 640px) { .link-list { grid-template-columns: 1fr 1fr; column-gap: var(--space-8); } }
@media (min-width: 1024px) { .link-list--3 { grid-template-columns: repeat(3, 1fr); } }
.link-list li { border-bottom: 1px solid var(--color-border); }
.link-list a { display: block; padding: var(--space-3) 0; text-decoration: none; color: var(--color-text); }
.link-list a:hover .link-list__title { color: var(--color-primary); text-decoration: underline; }
.link-list__title { display: block; font-weight: 650; color: var(--color-primary); }
.link-list__desc { display: block; font-size: var(--text-sm); color: var(--color-muted); margin-top: 2px; }

/* =================================================================
   10. FOOTER
   ================================================================= */
.site-footer { background: #1B2825; color: #D5DDD9; padding-block: var(--space-10) var(--space-8); margin-top: var(--space-12); font-size: var(--text-sm); }
.site-footer a { color: #E8EEEB; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8) var(--space-6); }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1.4fr repeat(4, 1fr); } }
.footer-brand { grid-column: 1 / -1; }
@media (min-width: 900px) { .footer-brand { grid-column: auto; } }
.footer-col-stack nav + nav { margin-top: var(--space-6); }
.footer-brand p { color: #B6C3BE; max-width: 40ch; margin: var(--space-3) 0 0; line-height: 1.55; }
.site-footer h2 { font-size: var(--text-label); color: #fff; margin-bottom: var(--space-3); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin-top: var(--space-2); }
.footer-bottom { border-top: 1px solid #34443F; margin-top: var(--space-8); padding-top: var(--space-5); color: #B6C3BE; display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); }
.footer-bottom p { margin: 0; }

/* =================================================================
   11. MOTION + PRINT
   ================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

.print-sheet { display: none; }
@media print {
  :root { --color-bg: #fff; }
  body { background: #fff; font-size: 11pt; color: #000; }
  .site-header, .site-footer, .toc, .result-actions, .action-status, .result-bar, .form-actions,
  .skip-link, .breadcrumbs, .related, .nav-toggle { display: none !important; }
  .calc { box-shadow: none; border-color: #999; }
  .calc-results__sticky { position: static; }
  .faq details { break-inside: avoid; }
  .faq details > .faq__answer { display: block; }
  a { color: #000; }
  /* "Print result" button: only the result sheet prints */
  body.is-printing-result main > *:not(.print-sheet) { display: none !important; }
  body.is-printing-result .print-sheet { display: block; }
  .print-sheet .print-title { font-size: 18pt; font-weight: 700; margin: 0 0 4pt; }
  .print-sheet h2 { font-size: 12pt; margin: 14pt 0 6pt; }
  .print-sheet table { border: 1px solid #999; }
  .print-sheet th, .print-sheet td { border-bottom: 1px solid #ccc; padding: 4pt 6pt; }
  .print-sheet .print-meta { color: #444; font-size: 9pt; }
}
