/* =========================================================
   MyHouseLogic — "Working Drawings" Design System
   v2.1 — Brand refresh (blue/green identity)
   Principles: precision, documentation, restraint.
   Numerals are monospaced. Cards are rare. Lists use hairlines.
   ========================================================= */

/* ---------- 1. Design Tokens ---------- */
:root {
  /* Brand identity — clean blue + green */
  --brand-blue:      #1D4ED8;   /* primary brand colour */
  --brand-blue-700:  #1E40AF;   /* darker blue */
  --brand-blue-800:  #1E3A8A;   /* hover state */
  --brand-green:     #059669;   /* checkmark / success */
  --brand-green-600: #047857;

  /* Color — warm paper, not cool slate */
  --paper:           #FAF8F4;   /* base canvas */
  --paper-deep:      #F0EDE6;   /* section breaks */
  --paper-card:      #FFFFFF;   /* discrete modules */
  --ink:             #1C1B19;   /* primary text — warm near-black */
  --ink-soft:        #3D3B36;   /* secondary text */
  --ink-muted:       #6B6862;   /* tertiary text */
  --ink-faint:       #9A968E;   /* placeholder, disabled */
  --steel:           #5A6470;   /* chrome — borders, nav bg */
  --steel-light:     #D8D4CC;   /* hairline borders */
  --steel-lighter:   #E8E4DC;   /* subtle backgrounds */
  --accent:          var(--brand-blue);     /* clean blue accent */
  --accent-hover:    var(--brand-blue-800); /* deeper blue on hover */
  --accent-soft:     #DBEAFE;   /* blue tint for backgrounds */

  /* Category tick colors — muted, tag-only */
  --cat-masonry:      #A0522D;  /* terracotta */
  --cat-carpentry:    #8B6F47;  /* warm tan/wood */
  --cat-painting:     #2D6A6A;  /* muted teal */
  --cat-landscaping:  #5B7A29;  /* moss green */
  --cat-electrical:   #B8860B;  /* amber */
  --cat-plumbing:     #3D5A6C;  /* steel blue */

  /* Semantic */
  --success:  var(--brand-green);
  --warning:  #B45309;
  --error:    #991B1B;

  /* Typography */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;

  /* Type scale (modular, 1.2 ratio) */
  --fs-xs:    0.75rem;    /* 12px */
  --fs-sm:    0.8125rem;  /* 13px */
  --fs-base:  1rem;       /* 16px */
  --fs-md:    1.0625rem;  /* 17px */
  --fs-lg:    1.25rem;    /* 20px */
  --fs-xl:    1.375rem;   /* 22px */
  --fs-2xl:   1.75rem;    /* 28px */
  --fs-3xl:   2.25rem;    /* 36px */
  --fs-4xl:   2.5rem;     /* 40px */

  --lh-tight:   1.2;
  --lh-snug:    1.35;
  --lh-normal:  1.5;
  --lh-relaxed: 1.65;
  --lh-loose:   1.75;

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

  /* Radii — minimal, not pill */
  --r-xs:  2px;
  --r-sm:  3px;
  --r-md:  4px;
  --r-lg:  6px;

  /* Borders */
  --border-hair:  1px solid var(--steel-light);
  --border-hair-2: 1px solid var(--steel-lighter);
  --border-ink:   1px solid var(--ink);
  --border-steel: 1px solid var(--steel);

  /* Shadows — minimal, hairline preferred */
  --shadow-sm: 0 1px 2px rgba(28,27,25,0.04);

  /* Layout */
  --container-max: 1140px;
  --container-narrow: 720px;
  --measure: 68ch;   /* optimal line length for reading */

  /* Ad zone fixed heights (CLS prevention) */
  --ad-h-desktop: 120px;
  --ad-h-mobile: 100px;
}

/* ---------- 2. Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* Offset for sticky header when jumping to anchors */
  scroll-padding-top: 80px;
}
body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Subtle paper texture via gradient — extremely faint */
  background-image: linear-gradient(180deg, var(--paper) 0%, var(--paper) 100%);
}
img, canvas, svg { display: block; max-width: 100%; }
a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.12s ease, color 0.12s ease;
}
a:hover { color: var(--accent-hover); border-bottom-color: var(--accent-hover); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, [tabindex]:focus-visible, a:focus, button:focus, input:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul, ol { padding-left: 1.25rem; }
h1, h2, h3, h4 {
  line-height: var(--lh-tight);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.015em;
}
h1 { font-size: var(--fs-3xl); margin-bottom: var(--sp-4); }
h2 { font-size: var(--fs-2xl); margin: var(--sp-10) 0 var(--sp-4); }
h3 { font-size: var(--fs-xl); margin: var(--sp-6) 0 var(--sp-3); }
h4 { font-size: var(--fs-md); margin: var(--sp-4) 0 var(--sp-2); font-weight: 600; }
p { margin-bottom: var(--sp-4); }
p:last-child { margin-bottom: 0; }
strong, b { font-weight: 600; color: var(--ink); }
small { font-size: var(--fs-sm); color: var(--ink-muted); }

/* Numerals everywhere — the signature detail */
code, pre, .num, .mono,
input[type="number"], input[type="text"],
.result-value, .takeoff__value, .spec-plate__value,
.formula-box, .formula-box code {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
input[type="number"], input[type="text"] {
  letter-spacing: 0;
}
code { font-size: 0.9em; background: var(--paper-deep); padding: 0.1em 0.35em; border-radius: var(--r-xs); }
pre {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  background: var(--ink);
  color: #E8E4DC;
  padding: var(--sp-4);
  border-radius: var(--r-md);
  overflow-x: auto;
  line-height: var(--lh-snug);
}
hr { border: none; border-top: var(--border-hair); margin: var(--sp-6) 0; }

/* Skip link */
.skip-link {
  position: absolute; top: -100px; left: 0;
  background: var(--ink); color: var(--paper);
  padding: var(--sp-2) var(--sp-4);
  z-index: 2000; border-radius: 0 0 var(--r-sm) 0;
  font-weight: 600; font-size: var(--fs-sm);
}
.skip-link:focus { top: 0; color: var(--paper); }

/* ---------- 3. Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}
.container--narrow { max-width: var(--container-narrow); }
.container--prose { max-width: var(--measure); }
main { flex: 1 0 auto; }
.section { padding-block: var(--sp-12); }
.section--tight { padding-block: var(--sp-8); }
.section--deep { padding-block: var(--sp-16); }
.section__header { max-width: var(--measure); margin: 0 0 var(--sp-8); }
.section__header--center { margin-inline: auto; text-align: center; }
.section__header h2 { margin-top: 0; }
.section__header p { color: var(--ink-muted); font-size: var(--fs-md); }
.section__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: var(--sp-2);
}

/* ---------- 4. Icons ---------- */
.icon {
  width: 20px; height: 20px;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
  vertical-align: middle;
}
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 24px; height: 24px; }
.icon--xl { width: 32px; height: 32px; }

/* ---------- 5. Header / Nav ---------- */
.site-header {
  background: var(--paper-card);
  border-bottom: var(--border-hair);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: saturate(180%) blur(8px);
  background: rgba(250, 248, 244, 0.92);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-block: var(--sp-3);
  flex-wrap: wrap;
}

/* Wordmark — refreshed with brand mark + wordmark */
.wordmark {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.5rem;          /* ~20% larger than original 1.25rem */
  letter-spacing: -0.02em;
  line-height: 1;
  border-bottom: none;
  text-decoration: none;
}
.wordmark:hover { color: var(--ink); border-bottom: none; }
.wordmark__mark {
  width: 36px; height: 36px;    /* ~20% larger than original 28px */
  display: block;
  flex-shrink: 0;
}
.wordmark__mark svg { width: 100%; height: 100%; display: block; }
.wordmark__text { font-size: 1.5rem; line-height: 1; white-space: nowrap; }
.wordmark__text span { color: var(--accent); }
@media (max-width: 480px) {
  .wordmark { font-size: 1.35rem; gap: 7px; }
  .wordmark__mark { width: 32px; height: 32px; }
  .wordmark__text { font-size: 1.35rem; }
}
/* Navigation */
.nav { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.nav__link {
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 2px solid transparent;
  transition: color 0.12s ease, border-color 0.12s ease;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
}
.nav__link:hover {
  color: var(--ink);
  border-bottom-color: var(--accent);
  background: none;
}
.nav__link--active {
  color: var(--ink);
  border-bottom-color: var(--accent);
  background: none;
  font-weight: 600;
}
.header-actions { display: flex; align-items: center; gap: var(--sp-3); }

/* Unit toggle — segmented control */
.unit-toggle {
  display: inline-flex;
  border: 1px solid var(--steel-light);
  border-radius: var(--r-sm);
  padding: 2px;
  background: var(--paper-deep);
}
.unit-toggle__btn {
  padding: 5px 12px;
  font-size: var(--fs-xs);
  font-weight: 600;
  border-radius: var(--r-xs);
  color: var(--ink-muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: background 0.12s ease, color 0.12s ease;
}
.unit-toggle__btn:hover { color: var(--ink); }
.unit-toggle__btn.is-active {
  background: var(--ink);
  color: var(--paper);
}

/* Basket button — real icon */
.basket-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--steel-light);
  background: var(--paper-card);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.basket-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
}
.basket-btn__count {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  background: var(--accent);
  color: var(--paper);
  padding: 1px 7px;
  border-radius: var(--r-full, 9999px);
  font-size: var(--fs-xs);
  min-width: 20px;
  text-align: center;
  font-weight: 700;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;            /* larger touch target */
  border: 1px solid var(--steel-light);
  border-radius: var(--r-sm);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  min-height: 44px;
  background: var(--paper-card);
  transition: border-color 0.12s ease, color 0.12s ease;
}
.nav-toggle:hover { border-color: var(--accent); color: var(--accent); }
.nav-toggle svg { width: 18px; height: 18px; }
.nav-toggle span { white-space: nowrap; }
.nav-toggle[aria-expanded="true"] + .nav { display: flex; }

/* On very narrow screens, hide the "Menu" text and keep just the icon */
@media (max-width: 480px) {
  .nav-toggle { padding: 9px 11px; gap: 0; }
  .nav-toggle span { display: none; }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    display: none;
    gap: 0;
    background: var(--paper-card);
    border: 1px solid var(--steel-light);
    border-radius: var(--r-md);
    padding: var(--sp-2);
    margin-top: var(--sp-2);
    box-shadow: 0 4px 14px rgba(28,27,25,0.06);
  }
  .nav__link {
    padding: 14px var(--sp-3);    /* large touch target on mobile */
    border-bottom: 1px solid var(--steel-lighter);
    border-radius: 0;
    min-height: 48px;             /* WCAG 2.2 AA touch target */
    font-size: var(--fs-base);
  }
  .nav__link:last-child { border-bottom: none; }
  .site-header__inner { gap: var(--sp-2); }
}

/* Very narrow viewport: tighten wordmark + actions to fit 320px */
@media (max-width: 360px) {
  .wordmark { font-size: 1.15rem; gap: 6px; }
  .wordmark__mark { width: 28px; height: 28px; }
  .wordmark__text { font-size: 1.15rem; }
  .header-actions { gap: var(--sp-2); }
  .unit-toggle__btn { padding: 6px 10px; }
  .basket-btn { padding: 6px 10px; font-size: var(--fs-xs); }
  .basket-btn__count { padding: 1px 5px; }
}

/* ---------- 6. Hero — compact, functional ---------- */
.hero {
  background: var(--paper);
  border-bottom: var(--border-hair);
  padding-block: var(--sp-10) var(--sp-8);
}
.hero__inner {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp-10);
  align-items: start;
}
@media (max-width: 768px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); }
}
.hero__headline {
  font-size: var(--fs-3xl);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-3);
}
.hero__tagline {
  display: inline-block;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: var(--sp-4);
}
.hero__sub {
  color: var(--ink-soft);
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--sp-5);
  max-width: 56ch;
}
.hero__standards {
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  display: flex; align-items: center; gap: var(--sp-2);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;              /* allow wrapping on narrow viewports */
}
.hero__standards svg { color: var(--accent); }

/* Search */
.search-box {
  display: flex; gap: 0;
  border: 1px solid var(--steel);
  border-radius: var(--r-md);
  background: var(--paper-card);
  overflow: hidden;
  max-width: 480px;
  box-shadow: 0 1px 2px rgba(28,27,25,0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29,78,216,0.15);
}
.search-box input {
  flex: 1 1 0; border: none; padding: 14px 16px;
  font-size: var(--fs-base); color: var(--ink);
  background: transparent;
  font-family: var(--font-sans);
  min-height: 48px;
  min-width: 0;                  /* allow shrinking below intrinsic min-content */
}
.search-box input:focus { outline: none; }
.search-box input::placeholder { color: var(--ink-faint); }
.search-box button {
  background: var(--ink); color: var(--paper);
  padding: 10px 18px;
  font-weight: 600; font-size: var(--fs-sm);
  display: flex; align-items: center; gap: 6px;
  min-height: 48px;
  transition: background 0.12s ease;
}
.search-box button:hover { background: var(--accent); }
.search-results {
  margin-top: var(--sp-2);
  max-width: 480px;
  background: var(--paper-card);
  border: 1px solid var(--steel-light);
  border-radius: var(--r-md);
  display: none;
  box-shadow: 0 4px 12px rgba(28,27,25,0.08);
}
.search-results.is-visible { display: block; }
.search-results a {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--ink);
  padding: 10px 14px;
  border-bottom: 1px solid var(--steel-lighter);
  font-size: var(--fs-sm);
  border-bottom-width: 1px;
  border-bottom-style: solid;
  border-bottom-color: var(--steel-lighter);
}
.search-results a:last-child { border-bottom: none; }
.search-results a:hover {
  background: var(--paper-deep);
  color: var(--ink);
  border-bottom-color: var(--steel-lighter);
}
.search-results__empty {
  padding: var(--sp-5) var(--sp-4);
  color: var(--ink-muted);
  font-size: var(--fs-sm);
  text-align: center;
  line-height: var(--lh-normal);
}
.search-results__empty strong { color: var(--ink); display: block; margin-bottom: 4px; font-size: var(--fs-sm); }
.search-results__empty a { color: var(--accent); font-weight: 600; border-bottom: 1px solid var(--accent); }

/* Quick category entry — visible without scrolling */
.hero__cats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--steel-light);
  border-radius: var(--r-md);
  overflow: hidden;
  min-width: 0;                /* prevent overflow from children's min-content */
}
.hero__cat {
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--sp-4);
  border-right: 1px solid var(--steel-light);
  border-bottom: 1px solid var(--steel-light);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  border-bottom-width: 1px;
  transition: background 0.12s ease;
  min-width: 0;               /* allow shrinking below intrinsic min-content */
  overflow: hidden;
}
.hero__cat:hover { background: var(--paper-deep); color: var(--ink); border-bottom-color: var(--steel-light); }
.hero__cat:nth-child(3n) { border-right: none; }
.hero__cat:nth-last-child(-n+3) { border-bottom: none; }
.hero__cat-name { display: flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.hero__cat-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.hero__cat-count {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  font-weight: 400;
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .hero__cats { grid-template-columns: repeat(2, 1fr); }
  .hero__cat:nth-child(3n) { border-right: 1px solid var(--steel-light); }
  .hero__cat:nth-child(2n) { border-right: none; }
}

/* ---------- 7. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: 0;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  text-align: center;
  border-bottom: none;
  min-height: 40px;
}
.btn:active { transform: translateY(0.5px); }
.btn--primary {
  background: var(--accent);
  color: var(--paper);
  border: 1px solid var(--accent);
}
.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--paper);
  border-bottom: none;
}
.btn--secondary {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
}
.btn--secondary:hover {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
  color: var(--paper);
  border-bottom: none;
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--steel);
}
.btn--ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
}
.btn--block { width: 100%; }
.btn--sm { padding: 6px 12px; font-size: var(--fs-xs); min-height: 32px; }

/* ---------- 8. List Component (replaces card grids) ---------- */
.tool-list { list-style: none; padding: 0; margin: 0; }
.tool-list__item {
  display: flex; align-items: flex-start; gap: var(--sp-4);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--steel-lighter);
  color: var(--ink);
  border-bottom-width: 1px;
  transition: background 0.1s ease;
}
.tool-list__item:last-child { border-bottom: none; }
.tool-list__item:hover { background: var(--paper-deep); color: var(--ink); border-bottom-color: var(--steel-lighter); }
.tool-list__icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  flex-shrink: 0;
  color: var(--accent);
  border: 1px solid var(--steel-light);
  border-radius: var(--r-sm);
  background: var(--paper-card);
}
.tool-list__body { flex: 1; min-width: 0; }
.tool-list__title {
  font-weight: 600; font-size: var(--fs-md);
  color: var(--ink);
  margin-bottom: 2px;
  display: flex; align-items: center; gap: var(--sp-2);
  flex-wrap: wrap;
}
.tool-list__desc {
  color: var(--ink-muted);
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
}
.tool-list__arrow {
  color: var(--ink-faint);
  flex-shrink: 0;
  margin-top: 4px;
  transition: color 0.12s ease, transform 0.12s ease;
}
.tool-list__item:hover .tool-list__arrow {
  color: var(--accent);
  transform: translateX(2px);
}

/* Category list */
.cat-list { list-style: none; padding: 0; margin: 0; }
.cat-list__item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--steel-lighter);
  color: var(--ink);
  border-bottom-width: 1px;
  font-weight: 600;
  transition: background 0.1s ease;
}
.cat-list__item:last-child { border-bottom: none; }
.cat-list__item:hover { background: var(--paper-deep); color: var(--ink); border-bottom-color: var(--steel-lighter); }
.cat-list__dot {
  width: 10px; height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.cat-list__name { flex: 1; font-size: var(--fs-md); }
.cat-list__count {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  font-weight: 400;
}

/* "More coming" row — differentiated */
.tool-list__item--coming {
  opacity: 1;
  background: var(--paper-deep);
  border: 1px dashed var(--steel-light);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  margin-top: var(--sp-3);
}
.tool-list__item--coming .tool-list__icon {
  border-style: dashed;
  color: var(--ink-muted);
}
.tool-list__item--coming .tool-list__title { color: var(--ink-soft); }
.tool-list__item--coming .tool-list__desc { color: var(--ink-muted); }
.tool-list__badge {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  border: 1px solid var(--steel-light);
  padding: 2px 8px;
  border-radius: var(--r-xs);
  background: var(--paper-card);
}

/* ---------- 9. Spec Plate (replaces metric strip) ---------- */
.spec-plate {
  display: flex;
  gap: 0;
  border-top: var(--border-hair);
  border-bottom: var(--border-hair);
  padding-block: var(--sp-4);
  flex-wrap: wrap;
}
.spec-plate__item {
  flex: 1;
  min-width: 120px;
  padding-inline: var(--sp-4);
  border-right: 1px solid var(--steel-lighter);
  text-align: left;
}
.spec-plate__item:last-child { border-right: none; }
.spec-plate__item:first-child { padding-left: 0; }
.spec-plate__value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-xl);
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 4px;
}
.spec-plate__label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  font-weight: 500;
}
@media (max-width: 600px) {
  .spec-plate { flex-wrap: wrap; }
  .spec-plate__item { flex: 1 1 50%; padding: var(--sp-2) var(--sp-3); border-right: 1px solid var(--steel-lighter); border-bottom: 1px solid var(--steel-lighter); }
  .spec-plate__item:nth-child(2) { border-right: none; }
  .spec-plate__item:nth-last-child(-n+2) { border-bottom: none; }
}

/* ---------- 10. Process (numbered, replaces icon circles) ---------- */
.process {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
  counter-reset: step;
}
@media (max-width: 768px) { .process { grid-template-columns: 1fr; } }
.process__step {
  position: relative;
  padding-left: var(--sp-12);
}
.process__num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--accent);
  position: absolute;
  left: 0; top: 0;
  line-height: 1;
}
.process__num::after {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  background: var(--accent);
  margin-top: var(--sp-2);
}
.process__title {
  font-weight: 600;
  font-size: var(--fs-md);
  margin-bottom: var(--sp-2);
}
.process__desc {
  color: var(--ink-muted);
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
}

/* ---------- 11. Badges / Tags ---------- */
.badge {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-xs);
  background: var(--paper-deep);
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}
.badge--cat {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent;
  border: 1px solid currentColor;
  padding: 2px 8px;
  font-size: var(--fs-xs);
  font-weight: 600;
  border-radius: var(--r-xs);
}
.badge--cat::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge--masonry     { color: var(--cat-masonry); }
.badge--carpentry   { color: var(--cat-carpentry); }
.badge--painting    { color: var(--cat-painting); }
.badge--landscaping { color: var(--cat-landscaping); }
.badge--electrical  { color: var(--cat-electrical); }
.badge--plumbing    { color: var(--cat-plumbing); }
.badge--accent { color: var(--accent); border-color: var(--accent); }
.badge--muted { color: var(--ink-muted); }

/* Category dot colors */
.dot--masonry     { background: var(--cat-masonry); }
.dot--carpentry   { background: var(--cat-carpentry); }
.dot--painting    { background: var(--cat-painting); }
.dot--landscaping { background: var(--cat-landscaping); }
.dot--electrical  { background: var(--cat-electrical); }
.dot--plumbing    { background: var(--cat-plumbing); }

/* ---------- 12. Calculator Form ---------- */
.calc-form {
  background: var(--paper-card);
  border: var(--border-hair);
  border-radius: var(--r-md);
  padding: var(--sp-6);
}
.calc-form h2, .calc-form h3 { margin-top: 0; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
}
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field--full { grid-column: 1 / -1; }
.form-field label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0;
}
.form-field .hint { font-size: var(--fs-xs); color: var(--ink-muted); line-height: var(--lh-normal); }
.input-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}
.input-wrap input,
.input-wrap select {
  width: 100%;
  padding: 10px 14px;
  padding-right: 48px;
  font-size: var(--fs-base);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--steel);
  border-radius: var(--r-sm);
  background: var(--paper-card);
  color: var(--ink);
  min-height: 44px;
  transition: border-color 0.12s ease;
}
.input-wrap input:focus, .input-wrap select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.input-wrap input::placeholder { color: var(--ink-faint); }
.input-unit {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  font-weight: 500;
  pointer-events: none;
  background: var(--paper-deep);
  padding: 2px 6px;
  border-radius: var(--r-xs);
}
/* Select without unit chip */
.form-field select {
  padding-right: 14px;
}
/* Checkbox field */
.form-field--check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: var(--sp-3);
  border: 1px solid var(--steel-light);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.form-field--check input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-field--check label { cursor: pointer; font-weight: 500; }

/* Input error state */
.input-wrap input:invalid:not(:placeholder-shown),
.form-field.has-error input {
  border-color: var(--error);
  border-left: 3px solid var(--error);
}
.form-field__error {
  font-size: var(--fs-xs);
  color: var(--error);
  display: none;
}
.form-field.has-error .form-field__error { display: block; }

/* ---------- 13. Takeoff Slip (results panel) ---------- */
.takeoff {
  background: var(--paper-card);
  border: 1px solid var(--ink);
  border-radius: var(--r-md);
  margin-top: var(--sp-6);
  overflow: hidden;
}
.takeoff__header {
  background: var(--ink);
  color: var(--paper);
  padding: var(--sp-4) var(--sp-5);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--sp-2);
}
.takeoff__title {
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--paper);
  display: flex; align-items: center; gap: 6px;
}
.takeoff__title svg { color: var(--accent-soft); }
.takeoff__standards {
  font-size: var(--fs-xs);
  color: var(--steel-light);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.takeoff__body {
  padding: 0;
}
.takeoff__row {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--steel-lighter);
  gap: var(--sp-4);
}
.takeoff__row:last-of-type { border-bottom: none; }
.takeoff__label {
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  font-weight: 500;
}
.takeoff__label-sub {
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  margin-top: 1px;
}
.takeoff__value-group {
  text-align: right;
  flex-shrink: 0;
}
.takeoff__value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
}
.takeoff__unit {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  margin-top: 2px;
}
.takeoff__total {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: var(--sp-5);
  background: var(--paper-deep);
  border-top: 2px solid var(--ink);
}
.takeoff__total-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.takeoff__total-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.takeoff__actions {
  display: flex; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--steel-lighter);
  background: var(--paper);
  flex-wrap: wrap;
}

/* Multi-column takeoff grid (for many result rows) */
.takeoff__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.takeoff__grid .takeoff__row {
  border-right: 1px solid var(--steel-lighter);
}
.takeoff__grid .takeoff__row:nth-child(2n) { border-right: none; }
@media (max-width: 560px) {
  .takeoff__grid { grid-template-columns: 1fr; }
  .takeoff__grid .takeoff__row { border-right: none; }
}

/* Standards indicator */
.standards {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  font-weight: 600;
}
.standards svg { color: var(--accent); }

/* ---------- 14. Callout Component ---------- */
.callout {
  border-left: 3px solid var(--accent);
  padding: var(--sp-3) var(--sp-4) var(--sp-3) var(--sp-5);
  margin: var(--sp-5) 0;
  background: var(--paper-deep);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.callout__label {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 4px;
}
.callout__label svg { width: 14px; height: 14px; }
.callout p { color: var(--ink-soft); font-size: var(--fs-sm); margin: 0; line-height: var(--lh-relaxed); }
.callout p:last-child { margin: 0; }
.callout p + p { margin-top: var(--sp-2); }
.callout strong { color: var(--ink); }
.callout--tip { border-left-color: var(--cat-landscaping); }
.callout--tip .callout__label { color: var(--cat-landscaping); }
.callout--warning { border-left-color: var(--warning); }
.callout--warning .callout__label { color: var(--warning); }
.callout--reminder { border-left-color: var(--cat-painting); }
.callout--reminder .callout__label { color: var(--cat-painting); }
.callout--safety { border-left-color: var(--error); }
.callout--safety .callout__label { color: var(--error); }

/* ---------- 15. Canvas Visualizer ---------- */
.canvas-wrap {
  background: var(--paper-card);
  border: var(--border-hair);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  margin-top: var(--sp-6);
}
.canvas-wrap canvas {
  width: 100%;
  height: auto;
  background: var(--paper-deep);
  border-radius: var(--r-sm);
}
.canvas-wrap figcaption {
  text-align: center;
  color: var(--ink-muted);
  font-size: var(--fs-xs);
  margin-top: var(--sp-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- 16. Article / Editorial ---------- */
.article {
  background: transparent;
  max-width: var(--measure);
  line-height: var(--lh-relaxed);
}
.article--boxed {
  background: var(--paper-card);
  border: var(--border-hair);
  border-radius: var(--r-md);
  padding: var(--sp-8);
  max-width: none;
}
.article h2 { margin-top: var(--sp-10); }
.article h2:first-child { margin-top: 0; }
.article p { color: var(--ink-soft); }
.article ul, .article ol { margin: var(--sp-4) 0; padding-left: 1.4rem; }
.article li { margin-bottom: var(--sp-2); color: var(--ink-soft); }
.article blockquote {
  border-left: 3px solid var(--accent);
  padding: var(--sp-3) var(--sp-5);
  background: var(--paper-deep);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin: var(--sp-6) 0;
  color: var(--ink-soft);
  font-style: normal;
  font-size: var(--fs-md);
}
.article blockquote p { color: var(--ink); font-weight: 500; }

/* Formula box */
.formula-box {
  background: var(--ink);
  color: #E8E4DC;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  margin: var(--sp-4) 0;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
  overflow-x: auto;
}
.formula-box code {
  background: none;
  color: var(--accent-soft);
  padding: 0;
  font-size: inherit;
}
.formula-box code + br + code { color: #E8E4DC; }

/* Tables — for genuinely tabular content */
.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  margin: var(--sp-4) 0;
  border: 1px solid var(--steel-light);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.ref-table th {
  background: var(--paper-deep);
  text-align: left;
  padding: var(--sp-3);
  font-weight: 600;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
  border-bottom: 1px solid var(--steel-light);
}
.ref-table td {
  padding: var(--sp-3);
  border-bottom: 1px solid var(--steel-lighter);
  color: var(--ink-soft);
}
.ref-table td:last-child {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--ink);
}
.ref-table tr:last-child td { border-bottom: none; }
.ref-table tr:nth-child(even) td { background: var(--paper); }

/* Article header */
.article-header {
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-4);
  border-bottom: var(--border-hair);
}
.article-header__meta {
  display: flex; gap: var(--sp-4); flex-wrap: wrap;
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-top: var(--sp-3);
}
.article-header__meta span { display: inline-flex; align-items: center; gap: 4px; }
.article-header__meta svg { width: 14px; height: 14px; }

/* ---------- 17. FAQ Accordion ---------- */
.faq { margin-top: var(--sp-8); }
.faq__item {
  border-bottom: 1px solid var(--steel-light);
  overflow: hidden;
  background: transparent;
}
.faq__item:first-child { border-top: 1px solid var(--steel-light); }
.faq__question {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-4) 0;
  font-weight: 600;
  color: var(--ink);
  width: 100%;
  text-align: left;
  font-size: var(--fs-md);
  background: transparent;
  gap: var(--sp-3);
}
.faq__question:hover { color: var(--accent); }
.faq__question::after {
  content: "";
  width: 12px; height: 12px;
  flex-shrink: 0;
  border-right: 2px solid var(--ink-muted);
  border-bottom: 2px solid var(--ink-muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-right: 4px;
}
.faq__item[open] .faq__question::after {
  transform: rotate(-135deg);
  border-color: var(--accent);
}
.faq__item[open] .faq__question { color: var(--accent); }
.faq__answer {
  padding: 0 0 var(--sp-4);
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  max-width: var(--measure);
}
.faq__answer p { margin-bottom: var(--sp-3); }

/* ---------- 18. Breadcrumbs ---------- */
.breadcrumb {
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
  padding-block: var(--sp-4);
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.breadcrumb a { color: var(--ink-muted); border-bottom: none; }
.breadcrumb a:hover { color: var(--accent); border-bottom: none; }
.breadcrumb__sep { color: var(--ink-faint); }
.breadcrumb__current { color: var(--ink); font-weight: 600; }

/* Quick jump */
.quick-jump {
  display: flex; flex-wrap: wrap; gap: var(--sp-1);
  margin-bottom: var(--sp-6);
  font-size: var(--fs-sm);
  padding-bottom: var(--sp-3);
  border-bottom: var(--border-hair);
}
.quick-jump__label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  font-weight: 600;
  margin-right: var(--sp-2);
  align-self: center;
}
.quick-jump a {
  color: var(--ink-soft);
  border: 1px solid var(--steel-light);
  padding: 3px 10px;
  border-radius: var(--r-xs);
  font-size: var(--fs-xs);
  font-weight: 500;
  border-bottom: 1px solid var(--steel-light);
}
.quick-jump a:hover { border-color: var(--accent); color: var(--accent); border-bottom: 1px solid var(--accent); }

/* ---------- 19. Tool Page Layout ---------- */
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--sp-8);
  align-items: start;
}
.tool-layout__main { min-width: 0; }
.tool-layout__sidebar { display: flex; flex-direction: column; gap: var(--sp-5); }
@media (max-width: 980px) {
  .tool-layout { grid-template-columns: 1fr; }
}

/* Sidebar widgets */
.widget {
  background: var(--paper-card);
  border: var(--border-hair);
  border-radius: var(--r-md);
  padding: var(--sp-4);
}
.widget h3 {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin: 0 0 var(--sp-3);
  font-weight: 600;
}
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { border-bottom: 1px solid var(--steel-lighter); }
.widget li:last-child { border-bottom: none; }
.widget li a {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) 0;
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 500;
  border-bottom: none;
  border-bottom-width: 0;
}
.widget li a:hover { color: var(--accent); border-bottom: none; }
.widget--tip {
  background: var(--paper-deep);
  border-left: 3px solid var(--accent);
}
.widget--tip h3 { color: var(--accent); }

/* ---------- 20. Ad Zones — fixed dimensions, labeled ---------- */
.ad-zone {
  min-height: var(--ad-h-mobile);
  width: 100%;
  margin-block: var(--sp-6);
  border: 1px dashed var(--steel-light);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--paper);
  position: relative;
}
.ad-zone__label {
  position: absolute;
  top: 6px; left: 10px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  font-weight: 600;
}
.ad-zone--inline { max-width: 728px; margin-inline: auto; }
.ad-zone--sidebar { min-height: 250px; }
@media (min-width: 768px) {
  .ad-zone { min-height: var(--ad-h-desktop); }
}

/* ---------- 21. Project Basket Drawer ---------- */
.basket-overlay {
  position: fixed; inset: 0;
  background: rgba(28,27,25,0.4);
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 1500;
}
.basket-overlay.is-open { opacity: 1; visibility: visible; }
.basket-drawer {
  position: fixed; top: 0; right: 0;
  width: min(400px, 100vw);
  height: 100%;
  background: var(--paper-card);
  box-shadow: -4px 0 16px rgba(28,27,25,0.1);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 1600;
  display: flex; flex-direction: column;
  border-left: 1px solid var(--steel-light);
}
.basket-drawer.is-open { transform: translateX(0); }
.basket-drawer__header {
  background: var(--ink); color: var(--paper);
  padding: var(--sp-4) var(--sp-5);
  display: flex; justify-content: space-between; align-items: center;
}
.basket-drawer__header h2 { color: var(--paper); margin: 0; font-size: var(--fs-lg); font-weight: 600; }
.basket-drawer__close {
  color: var(--paper);
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
}
.basket-drawer__close:hover { background: rgba(255,255,255,0.12); }
.basket-drawer__body { flex: 1; overflow-y: auto; padding: var(--sp-4) var(--sp-5); }
.basket-empty { text-align: center; color: var(--ink-muted); padding: var(--sp-12) var(--sp-4); }
.basket-empty__icon { color: var(--ink-faint); margin-bottom: var(--sp-4); }
.basket-empty__icon svg { width: 48px; height: 48px; margin: 0 auto; }
.basket-empty h3 { font-size: var(--fs-md); margin-bottom: var(--sp-2); }
.basket-empty p { font-size: var(--fs-sm); }
.basket-item {
  border: 1px solid var(--steel-light);
  border-radius: var(--r-sm);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
  background: var(--paper);
}
.basket-item__header { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.basket-item__title { font-weight: 600; color: var(--ink); font-size: var(--fs-sm); }
.basket-item__remove {
  color: var(--error);
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  border: none; background: none;
}
.basket-item__remove:hover { background: rgba(153,27,27,0.08); }
.basket-item__details { font-size: var(--fs-xs); color: var(--ink-muted); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.basket-item__details div { padding: 1px 0; }
.basket-item__total { font-weight: 700; color: var(--accent); margin-top: 4px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.basket-drawer__footer {
  border-top: 1px solid var(--steel-light);
  padding: var(--sp-4) var(--sp-5);
  background: var(--paper-deep);
}
.basket-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-3); }
.basket-total__label { font-size: var(--fs-sm); color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.basket-total__value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-2xl); font-weight: 700; color: var(--accent); }
.basket-actions { display: flex; gap: var(--sp-2); }
.basket-actions .btn { flex: 1; }

/* Toast */
.toast {
  position: fixed; bottom: var(--sp-5); left: 50%;
  transform: translateX(-50%) translateY(150%);
  background: var(--ink); color: var(--paper);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-sm);
  z-index: 2000;
  transition: transform 0.3s ease;
  font-size: var(--fs-sm);
  font-weight: 500;
  display: flex; align-items: center; gap: var(--sp-2);
  box-shadow: 0 4px 12px rgba(28,27,25,0.15);
}
.toast.is-visible { transform: translateX(-50%) translateY(0); }
.toast__icon { color: var(--cat-landscaping); display: flex; }
.toast__icon svg { width: 16px; height: 16px; }

/* ---------- 22. Mobile Sticky Summary ---------- */
.mobile-summary {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--paper-card);
  border-top: 2px solid var(--ink);
  padding: var(--sp-3) var(--sp-4);
  z-index: 900;
  box-shadow: 0 -4px 12px rgba(28,27,25,0.08);
}
.mobile-summary__inner {
  max-width: var(--container-max);
  margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3);
}
.mobile-summary__label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  font-weight: 600;
}
.mobile-summary__value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--accent);
}
.mobile-summary__action {
  font-size: var(--fs-xs);
  color: var(--accent);
  font-weight: 600;
  display: flex; align-items: center; gap: 4px;
}
@media (max-width: 980px) {
  .has-sticky-summary .mobile-summary { display: block; }
  .has-sticky-summary main { padding-bottom: 70px; }
}

/* ---------- 23. Coming Soon (intentional state) ---------- */
.coming-soon {
  border: 1px dashed var(--steel-light);
  border-radius: var(--r-md);
  padding: var(--sp-6);
  text-align: center;
  background: var(--paper-deep);
}
.coming-soon__icon {
  width: 48px; height: 48px;
  margin: 0 auto var(--sp-3);
  color: var(--steel);
  display: grid; place-items: center;
  border: 1px solid var(--steel-light);
  border-radius: var(--r-sm);
}
.coming-soon__icon svg { width: 24px; height: 24px; }
.coming-soon__title { font-size: var(--fs-md); font-weight: 600; margin-bottom: var(--sp-2); }
.coming-soon__desc { color: var(--ink-muted); font-size: var(--fs-sm); max-width: 48ch; margin: 0 auto var(--sp-4); }
.coming-soon__timeline {
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  font-family: var(--font-mono);
}

/* ---------- 24. Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--steel-light);
  padding-block: var(--sp-12) var(--sp-5);
  margin-top: auto;
  border-top: 1px solid var(--ink);
}
.footer-grid {
  display: grid; gap: var(--sp-8);
  grid-template-columns: 2fr 1fr 1fr 1fr;
  margin-bottom: var(--sp-8);
}
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-col h4 {
  color: var(--paper);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-3);
  font-weight: 600;
}
.footer-col p { font-size: var(--fs-sm); color: var(--ink-faint); }
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 6px; }
.footer-col a { color: var(--steel-light); font-size: var(--fs-sm); border-bottom: none; }
.footer-col a:hover { color: var(--accent-soft); border-bottom: none; }
.footer-bottom {
  border-top: 1px solid var(--ink-soft);
  padding-top: var(--sp-4);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--ink-faint);
}
.footer-bottom__disclosure {
  max-width: 600px;
  line-height: var(--lh-normal);
  color: var(--steel-light);
  font-size: var(--fs-xs);
}
.footer-bottom__disclosure strong { color: var(--paper); }

/* Wordmark in footer */
.footer-col .wordmark { color: var(--paper); margin-bottom: var(--sp-3); }
.footer-col .wordmark__text span { color: var(--accent-soft); }
.footer-col .wordmark:hover { color: var(--paper); }

/* ---------- 25. Legal Pages ---------- */
.legal-doc { max-width: var(--container-narrow); margin-inline: auto; }
.legal-doc h1 { font-size: var(--fs-2xl); }
.legal-doc h2 { font-size: var(--fs-lg); margin-top: var(--sp-8); }
.legal-doc p, .legal-doc li { color: var(--ink-soft); line-height: var(--lh-relaxed); }
.legal-doc .last-updated { color: var(--ink-muted); font-size: var(--fs-sm); margin-bottom: var(--sp-6); font-family: var(--font-mono); }

/* Contact form */
.contact-form { max-width: 600px; }
.contact-form .form-field { margin-bottom: var(--sp-4); }
.contact-form textarea {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--steel); border-radius: var(--r-sm);
  font: inherit; resize: vertical; min-height: 120px;
  font-family: var(--font-sans);
}

/* ---------- 26. Print Styles ---------- */
@media print {
  .site-header, .site-footer, .nav, .ad-zone,
  .basket-btn, .unit-toggle, .nav-toggle,
  .quick-jump, .tool-layout__sidebar,
  .action-bar, .search-box, .basket-overlay, .basket-drawer,
  .toast, .mobile-summary { display: none !important; }
  body { background: #fff; color: #000; }
  .tool-layout { grid-template-columns: 1fr; }
  .tool-layout__main { width: 100%; }
  .container { max-width: 100%; padding: 0; }
  .calc-form, .takeoff, .article, .canvas-wrap {
    box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid;
  }
  .takeoff { border-color: #000; }
  .takeoff__header { background: #000 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .takeoff__total-value { color: var(--accent) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* ---------- 27. Utilities ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--ink-muted); }
.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.hidden { display: none !important; }
.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;
}

/* Grid utility for side-by-side layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-6); }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }

/* Featured calculator tile (genuine card — discrete module) */
.featured-tile {
  display: block;
  background: var(--paper-card);
  border: var(--border-hair);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  transition: border-color 0.12s ease;
  color: var(--ink);
  border-bottom: 1px solid var(--steel-light);
}
.featured-tile:hover {
  border-color: var(--accent);
  border-bottom: 1px solid var(--accent);
  color: var(--ink);
}
.featured-tile__icon {
  width: 36px; height: 36px;
  color: var(--accent);
  margin-bottom: var(--sp-3);
}
.featured-tile__title { font-weight: 600; font-size: var(--fs-md); margin-bottom: var(--sp-2); }
.featured-tile__desc { color: var(--ink-muted); font-size: var(--fs-sm); line-height: var(--lh-normal); }

/* Article teaser */
.article-teaser {
  display: block;
  border: var(--border-hair);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  background: var(--paper-card);
  color: var(--ink);
  border-bottom: 1px solid var(--steel-light);
  max-width: var(--container-narrow);
  margin-inline: auto;
}
.article-teaser:hover { border-color: var(--accent); border-bottom-color: var(--accent); color: var(--ink); }
.article-teaser__meta {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  font-weight: 600;
  margin-bottom: var(--sp-2);
  display: flex; gap: var(--sp-3); flex-wrap: wrap;
}
.article-teaser__title { font-size: var(--fs-lg); font-weight: 600; margin-bottom: var(--sp-2); }
.article-teaser__desc { color: var(--ink-muted); font-size: var(--fs-sm); margin-bottom: var(--sp-3); }

/* ---------- 28. Brand Refresh Polish ---------- */

/* Reduced-motion respect */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Footer wordmark uses a brighter blue tint for contrast on dark */
.footer-col .wordmark__text span { color: #93C5FD; }

/* Related-tools widget (new, on calculator pages) */
.related-tools {
  margin-top: var(--sp-10);
  padding-top: var(--sp-6);
  border-top: var(--border-hair);
}
.related-tools__title {
  font-size: var(--fs-md);
  font-weight: 600;
  margin-bottom: var(--sp-4);
  color: var(--ink);
}
.related-tools__list {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-3);
}
.related-tools__list a {
  display: block;
  padding: var(--sp-4);
  border: 1px solid var(--steel-light);
  border-radius: var(--r-md);
  background: var(--paper-card);
  color: var(--ink);
  border-bottom-width: 1px;
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.related-tools__list a:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  border-bottom-width: 1px;
}
.related-tools__name { font-weight: 600; font-size: var(--fs-sm); margin-bottom: 2px; }
.related-tools__cat { font-size: var(--fs-xs); color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }

/* Touch-target safety for unit toggle and basket button on small screens */
@media (max-width: 480px) {
  .unit-toggle__btn { padding: 8px 14px; min-height: 40px; }
  .basket-btn { padding: 8px 14px; min-height: 40px; }
}

/* Hero tagline tablet+ size bump */
@media (min-width: 768px) {
  .hero__headline { font-size: var(--fs-4xl); }
}

/* Calculator card subtle hover lift */
.tool-list__item { transition: background 0.12s ease, transform 0.12s ease, border-color 0.12s ease; }
.tool-list__item:hover { background: var(--paper-deep); transform: translateX(2px); }

/* Print summary tagline */
.print-summary-tagline {
  color: var(--ink-muted);
  font-size: 12px;
  margin-bottom: 16px;
  font-style: italic;
}
