/* =============================================================
   SmallBiz Calculator Hub — stylesheet
   Sections: 1 tokens · 2 base · 3 header · 4 homepage
             5 directory · 6 calculator · 7 charts & tables
             8 saved · 9 forms · 10 responsive · 11 print
   Colours live in section 1. Change --accent to re-skin.
   ============================================================= */

/* ---- 1. Tokens --------------------------------------------- */
:root {
  --bg: #F3F6F4;
  --surface: #FFFFFF;
  --surface-2: #FAFBFA;
  --ink: #131D19;
  --ink-2: #4C5C56;
  --ink-3: #6E7E78;
  --line: #DEE5E1;
  --line-2: #C6D1CB;
  --accent: #14584A;
  --accent-hover: #0E4239;
  --accent-soft: #E4EFEA;
  --on-accent: #FFFFFF;
  --positive: #1A6B4E;
  --negative: #A6362A;
  --warn-ink: #7C5310;
  --warn-bg: #FBF2E0;
  --warn-line: #E8D5A8;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(19, 29, 25, .06), 0 8px 24px -16px rgba(19, 29, 25, .25);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --maxw: 1120px;
}

[data-theme="dark"] {
  --bg: #0D1412;
  --surface: #151E1A;
  --surface-2: #121A17;
  --ink: #E7EEEA;
  --ink-2: #A3B3AC;
  --ink-3: #87978F;
  --line: #24312B;
  --line-2: #34453D;
  --accent: #5FC4A4;
  --accent-hover: #7DD5B8;
  --accent-soft: #16302A;
  --on-accent: #062018;
  --positive: #5FC4A4;
  --negative: #E58C7D;
  --warn-ink: #E7C88A;
  --warn-bg: #241E10;
  --warn-line: #43371C;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -18px rgba(0, 0, 0, .8);
}

/* ---- 2. Base ----------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.18; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.2vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.8rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; max-width: 68ch; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.skip {
  position: absolute; left: -9999px; top: 0; background: var(--surface); color: var(--ink);
  padding: 10px 16px; z-index: 200; border-radius: var(--radius-sm);
}
.skip:focus { left: 12px; top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
main { display: block; padding-bottom: 5rem; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
  font: inherit; font-size: .95rem; font-weight: 550;
  padding: .66rem 1.1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; transition: background .12s ease, border-color .12s ease;
}
.btn:hover { border-color: var(--ink-3); color: var(--ink); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn-sm { padding: .42rem .7rem; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---- 3. Header ---------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 1.25rem; height: 68px; }
.wordmark { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.wordmark-badge {
  width: 34px; height: 34px; flex: none; border-radius: 8px;
  background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; font-family: var(--serif); font-size: 1.05rem; font-weight: 600;
}
.wordmark-text { display: flex; flex-direction: column; line-height: 1.08; }
.wordmark-text b { font-family: var(--serif); font-size: 1.02rem; font-weight: 600; }
.wordmark-text span { font-size: .72rem; color: var(--ink-3); letter-spacing: .02em; }
.site-nav { margin-left: auto; display: flex; gap: .25rem; }
.site-nav a {
  padding: .45rem .7rem; border-radius: var(--radius-sm); color: var(--ink-2);
  text-decoration: none; font-size: .93rem;
}
.site-nav a:hover { background: var(--surface-2); color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.header-tools { display: flex; align-items: center; gap: .4rem; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.icon-btn svg { width: 19px; height: 19px; }
.nav-toggle { display: none; }
.mobile-nav { display: none; border-top: 1px solid var(--line); background: var(--surface); }
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block; padding: .8rem 20px; color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.mobile-nav .currency-field { padding: .8rem 20px; }

/* currency select in header */
.currency-select {
  font: inherit; font-size: .88rem; padding: .4rem 1.6rem .4rem .55rem; color: var(--ink-2);
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius-sm);
  appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 12px center, right 7px center; background-size: 5px 5px; background-repeat: no-repeat;
}
.currency-select:hover { border-color: var(--line-2); color: var(--ink); }

/* search overlay */
.search-overlay {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(10, 20, 16, .42);
  background: color-mix(in srgb, var(--ink) 38%, transparent);
  padding: 8vh 20px;
}
.search-overlay.open { display: block; }
.search-panel {
  max-width: 620px; margin: 0 auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.search-panel input {
  width: 100%; font: inherit; font-size: 1.05rem; padding: 1rem 1.1rem; border: 0;
  border-bottom: 1px solid var(--line); background: transparent; color: var(--ink);
}
.search-panel input:focus { outline: none; }
.search-results { list-style: none; margin: 0; padding: .4rem; max-height: 56vh; overflow-y: auto; }
.search-results a {
  display: block; padding: .6rem .7rem; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink);
}
.search-results a:hover, .search-results a:focus, .search-results li.active a { background: var(--accent-soft); }
.search-results strong { display: block; font-weight: 550; font-size: .97rem; }
.search-results span { font-size: .85rem; color: var(--ink-2); }
.search-empty { padding: 1.2rem; color: var(--ink-2); font-size: .92rem; }

/* ---- 4. Homepage -------------------------------------------- */
.hero { padding: clamp(2.5rem, 5vw, 4.5rem) 0 2.5rem; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.hero h1 { margin-bottom: .6rem; }
.hero .lede { font-family: var(--serif); font-size: 1.22rem; color: var(--ink-2); margin-bottom: 1rem; }
.hero p.support { color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.6rem; }
.hero-trust { margin-top: 1.6rem; font-size: .88rem; color: var(--ink-3); }

/* live demo card in the hero */
.demo-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.demo-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.demo-head b { font-family: var(--serif); font-weight: 600; }
.demo-head span { font-size: .78rem; color: var(--ink-3); }
.demo-body { padding: 1.1rem; display: grid; gap: .85rem; }
.demo-out { border-top: 1px solid var(--line); padding: 1rem 1.1rem 1.15rem; display: grid; gap: .55rem; }
.demo-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.demo-row span { color: var(--ink-2); font-size: .92rem; }
.demo-row b { font-size: 1.05rem; font-weight: 600; }
.demo-row.lead b { font-size: 1.6rem; color: var(--accent); font-family: var(--serif); }
.demo-foot { padding: .7rem 1.1rem; border-top: 1px solid var(--line); background: var(--surface-2); font-size: .82rem; }

.section { padding: 3rem 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.section-head p { margin: .25rem 0 0; color: var(--ink-2); }
.section-head a { font-size: .92rem; white-space: nowrap; }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.calc-card {
  display: flex; flex-direction: column; gap: .5rem; padding: 1.15rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink);
}
.calc-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.calc-card .ico { width: 34px; height: 34px; color: var(--accent); }
.calc-card .ico svg { width: 26px; height: 26px; }
.calc-card b { font-family: var(--serif); font-size: 1.06rem; font-weight: 600; }
.calc-card p { margin: 0; font-size: .9rem; color: var(--ink-2); }
.calc-card .open {
  margin-top: auto; padding-top: .7rem; font-size: .88rem; font-weight: 550; color: var(--accent);
  display: inline-flex; align-items: center; gap: .35rem;
}
.calc-card .open svg { width: 15px; height: 15px; }
.cat-chip {
  align-self: flex-start; font-size: .74rem; color: var(--ink-3);
  border: 1px solid var(--line); border-radius: 999px; padding: .12rem .5rem;
}

.what-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.6rem; }
.what-grid h3 { margin-bottom: .3rem; }
.what-grid p { font-size: .93rem; color: var(--ink-2); margin-bottom: .5rem; }
.what-grid ul { margin: 0; padding-left: 1.1rem; font-size: .9rem; color: var(--ink-2); }
.what-grid li { margin-bottom: .2rem; }

.built {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.5rem, 3vw, 2.4rem);
}
.built-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem 2rem; margin: 1.4rem 0 0; padding: 0; list-style: none; }
.built-list li { border-top: 1px solid var(--line); padding-top: .7rem; }
.built-list b { display: block; font-weight: 600; margin-bottom: .1rem; }
.built-list span { font-size: .9rem; color: var(--ink-2); }

.cta-band {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
  background: var(--accent); color: var(--on-accent); border-radius: var(--radius); padding: 2rem clamp(1.4rem, 3vw, 2.4rem);
}
.cta-band h2 { color: var(--on-accent); margin: 0; }
.cta-band p { margin: .3rem 0 0; opacity: .85; }
.cta-band .btn { background: var(--on-accent); color: var(--accent); border-color: var(--on-accent); }

/* ---- 5. Directory ------------------------------------------- */
.page-head { padding: 2.75rem 0 1.5rem; }
.page-head p { color: var(--ink-2); font-size: 1.05rem; }
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.filter-bar button {
  font: inherit; font-size: .9rem; padding: .4rem .85rem; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2);
}
.filter-bar button:hover { border-color: var(--line-2); color: var(--ink); }
.filter-bar button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.cat-block { margin-bottom: 2.5rem; }
.cat-block h2 { margin-bottom: .2rem; }
.cat-block > p { color: var(--ink-2); margin-bottom: 1.1rem; }

/* ---- 6. Calculator page -------------------------------------- */
.calc-head { padding: 2.5rem 0 1.5rem; }
.calc-head .crumb { font-size: .88rem; color: var(--ink-3); margin-bottom: .7rem; }
.calc-head .crumb a { color: var(--ink-2); text-decoration: none; }
.calc-head .crumb a:hover { color: var(--accent); }
.calc-head p.intro { font-size: 1.05rem; color: var(--ink-2); }

.calc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head {
  padding: .9rem 1.2rem; border-bottom: 1px solid var(--line); background: var(--surface-2);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border-radius: var(--radius) var(--radius) 0 0;
}
.panel-head h2 { margin: 0; font-size: 1.1rem; }
.panel-body { padding: 1.2rem; }
.results-panel { position: sticky; top: 88px; }

/* result ledger */
.result-lead { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.result-lead > div { background: var(--surface); padding: 1.1rem 1.2rem; }
.result-lead .label { font-size: .85rem; color: var(--ink-2); margin-bottom: .2rem; }
.result-lead .value { font-family: var(--serif); font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem); font-weight: 600; color: var(--accent); }
.result-lead .hint { font-size: .78rem; color: var(--ink-3); margin-top: .2rem; }
.result-rows { list-style: none; margin: 0; padding: .4rem 1.2rem 1.1rem; }
.result-rows li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: .62rem 0; border-bottom: 1px solid var(--line);
}
.result-rows li:last-child { border-bottom: 0; }
.result-rows .label { color: var(--ink-2); font-size: .93rem; }
.result-rows .label small { display: block; color: var(--ink-3); font-size: .78rem; }
.result-rows .value { font-size: 1.05rem; font-weight: 600; }
.value.negative { color: var(--negative); }
.value.positive { color: var(--positive); }
.value.negative::before { content: "▼ "; font-size: .7em; vertical-align: .1em; }
.value.positive::before { content: "▲ "; font-size: .7em; vertical-align: .1em; }
.result-actions { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0 1.2rem 1.2rem; }

.note {
  display: flex; gap: .55rem; font-size: .89rem; padding: .7rem .8rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); margin: 0 1.2rem 1rem;
}
.note.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.note b { font-weight: 600; }

/* break-even flow diagram */
.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: .5rem; margin: 0 1.2rem 1.2rem; }
.flow .step {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .7rem; text-align: center; background: var(--surface-2);
}
.flow .step span { display: block; font-size: .76rem; color: var(--ink-3); }
.flow .step b { font-size: .98rem; }
.flow .step.goal { border-color: var(--accent); background: var(--accent-soft); }
.flow .arrow { color: var(--ink-3); }

/* prose sections under the calculator */
.prose-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; margin-top: 2.5rem; }
.prose { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; }
.prose h2 { font-size: 1.25rem; }
.prose p:last-child { margin-bottom: 0; }
.example-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.example-list li { padding: .45rem 0; border-bottom: 1px dotted var(--line-2); font-size: .95rem; }
.example-list li:last-child { border-bottom: 0; }
.example-tag {
  display: inline-block; font-size: .74rem; border: 1px solid var(--line-2); border-radius: 999px;
  padding: .1rem .55rem; color: var(--ink-2); margin-bottom: .8rem;
}
.disclaim { font-size: .84rem; color: var(--ink-3); }

/* ---- 7. Charts and tables ------------------------------------ */
.chart-wrap { padding: 1.2rem; border-top: 1px solid var(--line); }
.chart-wrap h3 { font-size: 1rem; margin-bottom: .6rem; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis { stroke: var(--line-2); stroke-width: 1; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .series { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart .area { fill: var(--accent); opacity: .1; }
.chart .bar { fill: var(--accent); opacity: .85; }
.chart text { fill: var(--ink-3); font-size: 10px; font-family: var(--sans); }
.chart-caption { font-size: .82rem; color: var(--ink-3); margin-top: .5rem; }

.table-wrap { padding: 0 1.2rem 1.2rem; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data caption { text-align: left; font-weight: 600; padding: 1rem 0 .6rem; }
table.data th, table.data td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); text-align: right; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { color: var(--ink-2); font-weight: 550; border-bottom: 1px solid var(--line-2); }
table.data tbody tr:nth-child(even) td { background: var(--surface-2); }

/* ---- 8. Saved calculations ----------------------------------- */
.saved-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.saved-item {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem;
}
.saved-item .meta { flex: 1 1 240px; min-width: 0; }
.saved-item b { display: block; font-family: var(--serif); font-size: 1.05rem; }
.saved-item span { font-size: .85rem; color: var(--ink-3); }
.empty-state {
  border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 2.2rem; text-align: center; color: var(--ink-2);
}
.empty-state p { margin-left: auto; margin-right: auto; }

/* ---- 9. Forms ------------------------------------------------- */
.field { margin-bottom: 1.05rem; }
.field > label, .field > .repeater-label { display: block; font-size: .92rem; font-weight: 550; margin-bottom: .3rem; }
.field .help { font-size: .82rem; color: var(--ink-3); margin: .3rem 0 0; }
.input-shell {
  display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); overflow: hidden;
}
.input-shell:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-shell .affix {
  display: grid; place-items: center; padding: 0 .7rem; background: var(--surface-2);
  color: var(--ink-2); font-size: .9rem; border-right: 1px solid var(--line); white-space: nowrap;
}
.input-shell .affix.suffix { border-right: 0; border-left: 1px solid var(--line); }
.input-shell input, .input-shell select {
  flex: 1; min-width: 0; font: inherit; font-variant-numeric: tabular-nums;
  padding: .6rem .7rem; border: 0; background: transparent; color: var(--ink);
}
.input-shell input:focus, .input-shell select:focus { outline: none; }
.input-shell.invalid { border-color: var(--negative); }
.field-error { font-size: .83rem; color: var(--negative); margin-top: .3rem; }
.field-error:empty { display: none; }
select.plain {
  width: 100%; font: inherit; padding: .6rem .7rem; border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
}
/* repeater rows */
.repeater { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.repeater-head, .repeater-row {
  display: grid; grid-template-columns: 1.4fr .8fr 1fr 34px; gap: .5rem; align-items: center;
  padding: .5rem .6rem;
}
.repeater-head { background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .82rem; color: var(--ink-2); }
.repeater-row { border-bottom: 1px solid var(--line); }
.repeater-row:last-of-type { border-bottom: 0; }
.repeater-row input {
  width: 100%; font: inherit; font-size: .92rem; padding: .42rem .5rem; color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface);
}
.repeater-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.repeater-row .row-remove {
  width: 30px; height: 30px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--ink-3);
}
.repeater-row .row-remove:hover { color: var(--negative); border-color: var(--line); }
.repeater-row .row-remove svg { width: 15px; height: 15px; }
.repeater-foot { padding: .6rem; border-top: 1px solid var(--line); background: var(--surface-2); }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.2rem; }

/* dialog for saving */
.dialog-backdrop {
  position: fixed; inset: 0; background: rgba(10, 20, 16, .45);
  background: color-mix(in srgb, var(--ink) 40%, transparent);
  display: none; place-items: center; padding: 20px; z-index: 120;
}
.dialog-backdrop.open { display: grid; }
.dialog {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); width: min(420px, 100%); padding: 1.4rem;
}
.dialog h2 { font-size: 1.2rem; }
.dialog input[type="text"] {
  width: 100%; font: inherit; padding: .6rem .7rem; border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
}
.dialog .form-actions { justify-content: flex-end; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: .65rem 1.1rem; border-radius: 999px;
  font-size: .9rem; z-index: 150; box-shadow: var(--shadow);
}

/* ---- Footer --------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 2.5rem 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.footer-grid h3 { font-family: var(--sans); font-size: .9rem; font-weight: 600; margin-bottom: .6rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: .35rem; }
.footer-grid a { color: var(--ink-2); text-decoration: none; font-size: .92rem; }
.footer-grid a:hover { color: var(--accent); }
.footer-note { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: .83rem; color: var(--ink-3); }
.footer-note p { max-width: 90ch; }

/* ---- 10. Responsive ------------------------------------------ */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .what-grid { grid-template-columns: repeat(2, 1fr); }
  .calc-grid, .prose-grid { grid-template-columns: 1fr; }
  .results-panel { position: static; }
  .built-list { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .site-nav { display: none; }
  .nav-toggle { display: grid; }
  .header-row { height: 60px; gap: .5rem; }
  .header-tools { margin-left: auto; }
  .currency-select.desktop-only { display: none; }
  .card-grid, .what-grid, .built-list, .footer-grid { grid-template-columns: 1fr; }
  .result-lead { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .flow .arrow { transform: rotate(90deg); justify-self: center; }
  .repeater-head { display: none; }
  .repeater-row { grid-template-columns: 1fr 1fr; grid-template-areas: "name name" "qty cost" "rm rm"; }
  .repeater-row .c-name { grid-area: name; }
  .repeater-row .c-qty { grid-area: qty; }
  .repeater-row .c-unitCost { grid-area: cost; }
  .repeater-row .row-remove { grid-area: rm; width: 100%; height: 34px; border: 1px solid var(--line); }
  .cta-band { padding: 1.5rem; }
  .section { padding: 2.2rem 0; }
  .hero { padding: 2rem 0 1.5rem; }
  body { font-size: 15.5px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---- 11. Print / PDF ------------------------------------------ */
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #fff; --ink: #000; --ink-2: #333; --ink-3: #555; --line: #ccc; --line-2: #999; --accent: #14584A; --shadow: none; }
  .site-header, .site-footer, .no-print, .form-actions, .result-actions, .search-overlay, .mobile-nav, .cta-band { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  main { padding-bottom: 0; }
  .calc-grid { display: none !important; }
  .print-summary { display: block !important; }
  .print-summary table.data { margin-bottom: 1rem; }
  .prose-grid { grid-template-columns: 1fr; gap: 1rem; }
  .panel, .prose { break-inside: avoid; border: 1px solid #ccc; box-shadow: none; }
  .print-header { display: block !important; margin-bottom: 1rem; padding-bottom: .6rem; border-bottom: 2px solid #14584A; }
  a { color: #000; text-decoration: none; }
  .chart-wrap { break-inside: avoid; }
}
.print-header { display: none; }
.print-summary { display: none; }
.print-header b { font-family: var(--serif); font-size: 1.1rem; }
.print-header span { display: block; font-size: .85rem; color: #555; }
