/* ═══════════════════════════════════════════════════════════════════
   HANDYMAN CALCULATORS — SHARED STYLESHEET
   Mobile-first. Single breakpoint at 768px. No framework. No build.
   ═══════════════════════════════════════════════════════════════════ */

/* ─── 1. DESIGN TOKENS ──────────────────────────────────────────────── */

:root {
  /* Colour palette */
  --color-bg:           #F7F6F3;
  --color-surface:      #FFFFFF;
  --color-border:       #E2DDD6;
  --color-text:         #1A1A18;
  --color-text-muted:   #6B6860;
  --color-accent:       #D4620A;
  --color-accent-hover: #B85208;
  --color-success:      #2D7A4F;
  --color-warning:      #C97B1A;
  --color-danger:       #B83232;
  --color-info:         #1A5C8A;

  /* Segment colours for breakdown bar */
  --seg-material:  #1A5C8A;
  --seg-labour:    #D4620A;
  --seg-sub:       #7C3AED;
  --seg-equip:     #C97B1A;
  --seg-other:     #9B9590;
  --seg-overhead:  #6B6860;
  --seg-profit:    #2D7A4F;
  --seg-loss:      #B83232;

  /* Spacing scale (base-8) */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  16px;
  --sp-4:  24px;
  --sp-5:  32px;
  --sp-6:  48px;
  --sp-7:  64px;

  /* Border radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  /* Typography */
  --font-heading: 'Barlow Condensed', -apple-system, 'Helvetica Neue', sans-serif;
  --font-body:    'IBM Plex Sans', -apple-system, 'Helvetica Neue', sans-serif;
  --font-mono:    'IBM Plex Mono', 'Courier New', monospace;

  /* Type scale */
  --fs-xs:   0.75rem;   /* 12px */
  --fs-sm:   0.875rem;  /* 14px */
  --fs-base: 1rem;      /* 16px */
  --fs-lg:   1.125rem;  /* 18px */
  --fs-xl:   1.25rem;   /* 20px */
  --fs-2xl:  1.5rem;    /* 24px */
  --fs-3xl:  1.875rem;  /* 30px */
  --fs-4xl:  2.25rem;   /* 36px */

  /* Line heights */
  --lh-tight: 1.2;
  --lh-snug:  1.4;
  --lh-base:  1.6;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(26,26,24,0.08), 0 1px 2px rgba(26,26,24,0.04);
  --shadow-md: 0 4px 12px rgba(26,26,24,0.10), 0 2px 6px rgba(26,26,24,0.06);

  /* Layout */
  --maxw-content: 1100px;
  --header-h: 60px;

  /* Transitions */
  --t-fast: 120ms ease;
  --t-base: 200ms ease;
}

/* ─── 2. RESET & BASE ───────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

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

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font: inherit;
  color: inherit;
}

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

a:hover {
  text-decoration: underline;
}

ul, ol {
  list-style: none;
}

/* ─── 3. TYPOGRAPHY ─────────────────────────────────────────────────── */

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: var(--lh-tight);
  color: var(--color-text);
}

h1 {
  font-size: var(--fs-3xl);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

h2 {
  font-size: var(--fs-2xl);
  font-weight: 600;
}

h3 {
  font-size: var(--fs-xl);
  font-weight: 600;
}

h4 {
  font-size: var(--fs-lg);
  font-weight: 600;
}

p {
  line-height: var(--lh-base);
}

.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--color-text-muted);
}

.text-sm {
  font-size: var(--fs-sm);
}

.text-xs {
  font-size: var(--fs-xs);
}

/* ─── 4. LAYOUT ──────────────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: var(--maxw-content);
  margin-inline: auto;
  padding-inline: var(--sp-3);
}

/* ─── 5A. SITE HEADER ───────────────────────────────────────────────── */

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  height: var(--header-h);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo__icon {
  flex-shrink: 0;
}

.site-logo__name {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.site-nav a {
  display: block;
  padding: var(--sp-1) var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--color-text);
  border-radius: var(--radius-sm);
  transition: background var(--t-fast), color var(--t-fast);
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: var(--color-bg);
  color: var(--color-accent);
  text-decoration: none;
}

/* Mobile nav toggle */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: var(--sp-2);
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform var(--t-base), opacity var(--t-fast);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── 5B. SITE FOOTER ───────────────────────────────────────────────── */

.site-footer {
  background: var(--color-text);
  color: rgba(255,255,255,0.8);
  padding-block: var(--sp-5);
  margin-top: var(--sp-7);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.site-footer__disclaimer {
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
  color: rgba(255,255,255,0.65);
  font-style: italic;
}

.site-footer__meta {
  font-size: var(--fs-sm);
  color: rgba(255,255,255,0.7);
}

.site-footer__meta a {
  color: rgba(255,255,255,0.9);
  text-decoration: underline;
}

/* ─── 5C. BREADCRUMB ────────────────────────────────────────────────── */

.breadcrumb {
  padding-block: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  align-items: center;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.breadcrumb li:not(:last-child)::after {
  content: '›';
  color: var(--color-border);
}

.breadcrumb a {
  color: var(--color-text-muted);
}

.breadcrumb a:hover {
  color: var(--color-accent);
}

.breadcrumb [aria-current="page"] {
  color: var(--color-text);
  font-weight: 500;
}

/* ─── 5D. HERO (landing page) ────────────────────────────────────────── */

.hero {
  padding-block: var(--sp-6) var(--sp-5);
  text-align: center;
}

.hero h1 {
  font-size: var(--fs-4xl);
  margin-bottom: var(--sp-3);
}

.hero__lede {
  font-size: var(--fs-lg);
  color: var(--color-text-muted);
  max-width: 52ch;
  margin-inline: auto;
}

/* ─── 5E. CALCULATOR GRID (landing page) ────────────────────────────── */

.category-section {
  padding-block: var(--sp-5);
}

.category-section + .category-section {
  border-top: 1px solid var(--color-border);
}

.category-header {
  margin-bottom: var(--sp-4);
}

.category-header h2 {
  margin-bottom: var(--sp-1);
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
}

/* ─── 5F. CALCULATOR CARD (landing page) ────────────────────────────── */

.calc-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow var(--t-base), transform var(--t-base);
}

.calc-card:not(.calc-card--coming-soon):hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.calc-card__link {
  display: block;
  padding: var(--sp-4);
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.calc-card__link:hover {
  text-decoration: none;
}

.calc-card h3 {
  font-size: var(--fs-lg);
  margin-block: var(--sp-2);
  color: var(--color-text);
}

.calc-card p {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  line-height: var(--lh-snug);
}

.calc-card--coming-soon {
  opacity: 0.55;
  cursor: default;
}

.calc-card--coming-soon .calc-card__inner {
  display: block;
  padding: var(--sp-4);
  color: inherit;
}

.coming-soon-label {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  padding: 2px var(--sp-2);
  margin-top: var(--sp-2);
}

/* ─── 5G. CATEGORY BADGE ─────────────────────────────────────────────── */

.category-badge {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 100px;
  padding: 3px 10px;
}

.category-badge--estimator {
  background: rgba(26, 92, 138, 0.10);
  color: var(--color-info);
}

.category-badge--trade {
  background: rgba(212, 98, 10, 0.10);
  color: var(--color-accent);
}

/* ─── 5H. CALCULATOR PAGE ────────────────────────────────────────────── */

.calc-page-header {
  padding-block: var(--sp-4) var(--sp-3);
}

.calc-page-header h1 {
  margin-bottom: var(--sp-2);
}

.calc-desc {
  color: var(--color-text-muted);
  max-width: 72ch;
  font-size: var(--fs-lg);
}

.calc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

/* ─── 5I. INPUT PANEL ────────────────────────────────────────────────── */

.input-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
}

.input-panel__title {
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--color-border);
}

/* ─── 5J. FORM FIELDS ────────────────────────────────────────────────── */

.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  margin-bottom: var(--sp-3);
}

.field:last-of-type {
  margin-bottom: 0;
}

.field label,
.field__label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.field input[type="number"],
.field input[type="text"],
.field select {
  width: 100%;
  padding: var(--sp-2) var(--sp-2);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  color: var(--color-text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B6860' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(212, 98, 10, 0.15);
}

.field input[type="number"] {
  -moz-appearance: textfield;
}

.field input[type="number"]::-webkit-outer-spin-button,
.field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.field__helper {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

/* ─── 5K. TOGGLE SWITCH ──────────────────────────────────────────────── */

.field--toggle {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--color-border);
}

.field--toggle:last-of-type {
  border-bottom: none;
}

.toggle {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle__switch {
  display: block;
  width: 44px;
  height: 24px;
  background: var(--color-border);
  border-radius: 100px;
  position: relative;
  transition: background var(--t-base);
  flex-shrink: 0;
}

.toggle__switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--color-surface);
  border-radius: 50%;
  transition: transform var(--t-base);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle input:checked + .toggle__switch {
  background: var(--color-accent);
}

.toggle input:checked + .toggle__switch::after {
  transform: translateX(20px);
}

.toggle input:focus-visible + .toggle__switch {
  box-shadow: 0 0 0 3px rgba(212, 98, 10, 0.25);
}

/* ─── 5L. RANGE SLIDER ───────────────────────────────────────────────── */

.slider-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.slider-wrap input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--color-border);
  border-radius: 100px;
  outline: none;
  cursor: pointer;
}

.slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--color-accent);
  border-radius: 50%;
  border: 3px solid var(--color-surface);
  box-shadow: 0 0 0 1px var(--color-accent);
  cursor: grab;
  transition: transform var(--t-fast);
}

.slider-wrap input[type="range"]::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.15);
}

.slider-wrap input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--color-accent);
  border-radius: 50%;
  border: 3px solid var(--color-surface);
  box-shadow: 0 0 0 1px var(--color-accent);
  cursor: grab;
}

.slider-output {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-accent);
  min-width: 3.5ch;
  text-align: right;
  white-space: nowrap;
}

/* ─── 5M. TOOLTIP ────────────────────────────────────────────────────── */

.tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: var(--color-border);
  color: var(--color-text-muted);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  flex-shrink: 0;
}

/* ─── 5N. BUTTONS ────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
  cursor: pointer;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 3px solid rgba(212, 98, 10, 0.35);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--color-accent);
  color: #fff;
  border: 1px solid var(--color-accent);
}

.btn--primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  width: 100%;
  margin-top: var(--sp-4);
}

.btn--ghost:hover {
  background: var(--color-bg);
  border-color: var(--color-text-muted);
  color: var(--color-text);
}

/* ─── 5O. RESULTS PANEL ──────────────────────────────────────────────── */

.results-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
}

.results-panel__title {
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--color-border);
}

/* ─── 5P. RESULT ROWS ────────────────────────────────────────────────── */

.result-rows {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.result-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--color-bg);
}

.result-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.result-label {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  flex: 1;
}

.result-value {
  font-family: var(--font-mono);
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--color-text);
  text-align: right;
  white-space: nowrap;
}

.result-value.is-warn {
  color: var(--color-danger);
}

/* Sub-item rows within a material breakdown group */
.result-row--sub {
  padding-left: var(--sp-4);
  padding-bottom: var(--sp-1);
  border-bottom: none;
}

.result-row--sub .result-label {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.result-row--sub .result-value {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

/* Total row — emphasized */
.result-row--total {
  margin-top: var(--sp-2);
  padding-top: var(--sp-3);
  border-top: 2px solid var(--color-border);
  border-bottom: none;
}

.result-row--total .result-label {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--color-text);
}

.result-row--total .result-value {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--color-accent);
}

.result-row--total .result-value.is-warn {
  color: var(--color-danger);
}

/* ─── 5Q. BREAKDOWN BAR ──────────────────────────────────────────────── */

.breakdown-section {
  margin-top: var(--sp-4);
}

.breakdown-section__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--sp-2);
}

.breakdown-bar {
  display: flex;
  height: 28px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-bg);
  min-height: 28px;
}

.seg {
  height: 100%;
  width: var(--w, 0%);
  transition: width 0.35s ease;
  min-width: 0;
}

.seg--material  { background: var(--seg-material); }
.seg--labour    { background: var(--seg-labour); }
.seg--sub       { background: var(--seg-sub); }
.seg--equip     { background: var(--seg-equip); }
.seg--other     { background: var(--seg-other); }
.seg--overhead  { background: var(--seg-overhead); }
.seg--profit    { background: var(--seg-profit); }
.seg--loss      { background: var(--seg-loss); }

.breakdown-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-3);
  margin-top: var(--sp-3);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ─── 5R. RATING BADGE ───────────────────────────────────────────────── */

.rating-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-1) var(--sp-3);
  border-radius: 100px;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--color-border);
  color: var(--color-text-muted);
  transition: background var(--t-base), color var(--t-base);
}

.rating-badge[data-rating="excellent"] { background: rgba(45, 122, 79, 0.12); color: var(--color-success); }
.rating-badge[data-rating="good"]      { background: rgba(26, 92, 138, 0.12); color: var(--color-info); }
.rating-badge[data-rating="fair"]      { background: rgba(201, 123, 26, 0.12); color: var(--color-warning); }
.rating-badge[data-rating="poor"]      { background: rgba(184, 50, 50, 0.12); color: var(--color-danger); }

/* ─── 5S. DISCLAIMER ─────────────────────────────────────────────────── */

.disclaimer {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  font-style: italic;
  line-height: var(--lh-snug);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--color-border);
  margin-top: var(--sp-3);
}

/* ─── 5T. ASSUMPTIONS (collapsible) ─────────────────────────────────── */

.assumptions {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-4);
  overflow: hidden;
}

.assumptions summary {
  padding: var(--sp-3) var(--sp-4);
  font-weight: 600;
  font-size: var(--fs-base);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  user-select: none;
}

.assumptions summary::-webkit-details-marker { display: none; }

.assumptions summary::after {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(45deg);
  transition: transform var(--t-base);
  margin-left: auto;
  flex-shrink: 0;
}

.assumptions[open] summary::after {
  transform: rotate(-135deg);
}

.assumptions__body {
  padding: 0 var(--sp-4) var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  line-height: var(--lh-base);
}

.assumptions__body p + p {
  margin-top: var(--sp-2);
}

.assumptions__body ul {
  list-style: disc;
  padding-left: var(--sp-4);
  margin-top: var(--sp-2);
}

.assumptions__body li {
  margin-bottom: var(--sp-1);
}

/* ─── 5U. FAQ ─────────────────────────────────────────────────────────── */

.faq-section {
  margin-bottom: var(--sp-5);
}

.faq-section h2 {
  margin-bottom: var(--sp-4);
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
}

.faq-item:first-of-type {
  border-top: 1px solid var(--color-border);
}

.faq-item summary {
  padding: var(--sp-3) 0;
  font-weight: 600;
  font-size: var(--fs-base);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  list-style: none;
  user-select: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-size: var(--fs-xl);
  line-height: 1;
  color: var(--color-accent);
  flex-shrink: 0;
  font-weight: 300;
  transition: transform var(--t-base);
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-answer {
  padding-bottom: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  line-height: var(--lh-base);
}

.faq-answer p + p { margin-top: var(--sp-2); }

/* ─── 5V. RELATED CALCULATORS ────────────────────────────────────────── */

.related-section {
  margin-bottom: var(--sp-5);
}

.related-section h2 {
  margin-bottom: var(--sp-4);
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
}

.related-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--t-base), transform var(--t-base);
}

.related-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  text-decoration: none;
}

.related-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(212, 98, 10, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xl);
  flex-shrink: 0;
}

.related-card__text strong {
  display: block;
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--color-text);
}

.related-card__text span {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.related-card--disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ─── 5W. SEO COPY SECTION ────────────────────────────────────────────── */

.seo-copy {
  max-width: 72ch;
  margin-bottom: var(--sp-5);
}

.seo-copy h2 {
  font-size: var(--fs-2xl);
  margin-bottom: var(--sp-3);
}

.seo-copy h3 {
  font-size: var(--fs-xl);
  margin-top: var(--sp-4);
  margin-bottom: var(--sp-2);
}

.seo-copy p {
  color: var(--color-text-muted);
  font-size: var(--fs-base);
  margin-bottom: var(--sp-3);
}

.seo-copy ul {
  list-style: disc;
  padding-left: var(--sp-4);
  margin-bottom: var(--sp-3);
}

.seo-copy li {
  font-size: var(--fs-base);
  color: var(--color-text-muted);
  margin-bottom: var(--sp-1);
}

/* ─── 6. UTILITIES ────────────────────────────────────────────────────── */

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

.is-hidden {
  display: none !important;
}

.is-warn {
  color: var(--color-danger) !important;
}

/* ─── 7. RESPONSIVE — ≥ 768px ─────────────────────────────────────────── */

@media (min-width: 768px) {
  /* Header: hide hamburger, show nav */
  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: flex;
  }

  /* Calculator grid: 2 columns */
  .calc-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Related grid: 3 columns */
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Calculator layout: 2-column, inputs left, results right */
  .calc-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  /* Sticky results panel on desktop */
  .results-panel {
    position: sticky;
    top: calc(var(--header-h) + var(--sp-3));
    max-height: calc(100vh - var(--header-h) - var(--sp-5));
    overflow-y: auto;
  }

  h1 {
    font-size: var(--fs-4xl);
  }
}

@media (min-width: 1024px) {
  /* 3-column calc grid on larger screens */
  .calc-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Wider input column on very large screens */
  .calc-layout {
    grid-template-columns: 5fr 4fr;
    gap: var(--sp-5);
  }
}

/* Mobile nav */
@media (max-width: 767px) {
  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    padding: var(--sp-2) var(--sp-3) var(--sp-3);
    z-index: 99;
  }

  .site-nav.site-nav--open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .site-nav a {
    padding: var(--sp-2) var(--sp-1);
    font-size: var(--fs-base);
    border-radius: 0;
    border-bottom: 1px solid var(--color-bg);
  }
}

/* ─── 8. PRINT ─────────────────────────────────────────────────────────── */

@media print {
  .site-header,
  .site-footer,
  .nav-toggle,
  .btn--ghost,
  .assumptions summary,
  .faq-section,
  .related-section {
    display: none;
  }

  .calc-layout {
    display: block;
  }

  .results-panel {
    position: static;
    max-height: none;
    border: 1px solid #ccc;
  }

  .input-panel {
    display: none;
  }

  body {
    background: white;
    color: black;
  }
}
