/* MopRate: one system for every page. */
@font-face { font-family: "Lexend"; src: url("/fonts/lexend.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("/fonts/source-sans-3.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --alt: #eef2f6;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #4b5a70;
  --line: #dde4ec;
  --control: #7d8ba0;
  --accent: #0369a1;
  --accent-hover: #075985;
  --tint: #e4f0f8;
  --error: #b42318;
  --on-dark-2: #c4cfdd;
  --font-display: "Lexend", "Avenir Next", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --nav: 72px;
  --gut: clamp(20px, 5.5vw, 80px);
  --wrap: 1200px;
  --pad: clamp(64px, 8vw, 112px);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav) + 16px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--font-body); overflow-wrap: break-word; }
img { display: block; max-width: 100%; height: auto; }
svg { flex: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.18; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(34px, 3.2vw + 20px, 60px); letter-spacing: -0.025em; line-height: 1.08; }
h2 { font-size: clamp(27px, 1.6vw + 20px, 42px); letter-spacing: -0.02em; }
h3 { font-size: clamp(19px, 0.4vw + 17px, 22px); letter-spacing: -0.01em; }
h4 { font-size: 15px; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
::selection { background: #bfdff2; }
.wrap { width: min(var(--wrap), 100% - 2 * max(var(--gut), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px))); margin-inline: auto; }
.muted { color: var(--muted); }
.lead { font-size: clamp(18px, 0.4vw + 17px, 21px); line-height: 1.55; color: var(--ink-2); max-width: 56ch; }
.small { font-size: 15px; line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 10px 22px; border: 1px solid transparent; border-radius: var(--r-sm);
  font: 600 17px/1.25 var(--font-body); text-align: center; text-decoration: none; cursor: pointer;
  -webkit-user-select: none; user-select: none;
  transition: transform 140ms var(--ease-out), background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--control); }
.btn--quiet { background: transparent; color: var(--accent); padding-inline: 12px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn .icon { transition: transform 180ms var(--ease-out); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.text-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; text-decoration: none; }
.text-link span { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 200ms var(--ease-out); }
.text-link .icon { width: 18px; height: 18px; transition: transform 180ms var(--ease-out); }

@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: var(--accent-hover); }
  .btn--secondary:hover { border-color: var(--ink); }
  .btn--quiet:hover { background: var(--tint); }
  .btn[disabled]:hover { background: var(--accent); }
  .btn:hover .icon--arrow, .text-link:hover .icon--arrow { transform: translateX(3px); }
  .text-link:hover span { background-size: 100% 1px; }
}

/* ---------- Header ---------- */
.skip { position: absolute; left: 16px; top: -80px; z-index: 40; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r-sm); }
.skip:focus { top: 12px; }
.site-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); view-transition-name: site-header; }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: var(--nav); }
.logo { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); text-decoration: none; font: 600 21px/1 var(--font-display); letter-spacing: -0.02em; }
.logo svg { width: 30px; height: 30px; }
.main-nav { display: flex; gap: 4px; margin-left: auto; }
.main-nav a { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px; white-space: nowrap; }
.main-nav a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 180ms var(--ease-out); }
.main-nav a[aria-current]::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) { .main-nav a:hover::after { transform: scaleX(1); } }
.icon-button.menu-button { display: none; }
.menu { width: 100%; max-width: none; height: 100%; height: 100dvh; max-height: none; margin: 0; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); border: 0; background: var(--surface); color: var(--ink); overflow-y: auto; overscroll-behavior: contain; }
.menu[open] { opacity: 1; transform: none; transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
@starting-style { .menu[open] { opacity: 0; transform: translateY(-8px); } }
.menu__bar { display: flex; align-items: center; justify-content: space-between; height: var(--nav); border-bottom: 1px solid var(--line); }
.menu nav a { display: flex; align-items: center; min-height: 56px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font: 500 19px/1.3 var(--font-display); }
.menu nav a[aria-current] { color: var(--accent); }
.icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--control); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); cursor: pointer; transition: transform 140ms var(--ease-out), background-color 160ms ease; }
.icon-button:active { transform: scale(0.95); }
@media (hover: hover) and (pointer: fine) { .icon-button:hover { background: var(--alt); } }
@media (max-width: 899px) {
  :root { --nav: 60px; }
  .main-nav, .site-header .header-cta { display: none; }
  .icon-button.menu-button { display: inline-grid; margin-left: auto; }
}
@media (min-width: 900px) and (max-width: 1099px) { .site-header .header-cta { display: none; } }
.header-cta { min-height: 44px; font-size: 16px; padding-inline: 18px; }
html:has(.menu[open]) { overflow: hidden; }

/* ---------- Sections ---------- */
.section { padding-block: var(--pad); }
.section--alt { background: var(--alt); }
.section--white { background: var(--surface); }
.section-head { display: grid; gap: 14px; max-width: 680px; margin-bottom: clamp(32px, 4vw, 48px); }

/* ---------- Home hero ---------- */
.hero { background: var(--surface); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 4vw, 56px); align-items: center; min-height: calc(100svh - var(--nav)); padding-block: 48px; }
.hero-copy { display: grid; gap: 24px; align-content: center; }
.hero h1 { font-size: clamp(34px, 2.4vw + 20px, 54px); }
.hero-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 16px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
.hero-facts dt { font-size: 14px; color: var(--muted); }
.hero-facts dd { margin: 2px 0 0; font: 500 18px/1.3 var(--font-display); }
.hero-visual { position: relative; display: grid; align-content: end; justify-items: start; min-height: min(640px, calc(100svh - var(--nav) - 96px)); border-radius: var(--r-lg); overflow: hidden; isolation: isolate; padding: 24px; }
.hero-visual > picture, .hero-visual > img { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
.hero-visual img { width: 100%; height: 100%; object-fit: cover; object-position: 46% 50%; }
.quick { width: min(340px, 100%); justify-self: end; display: grid; gap: 14px; padding: 22px; background: var(--surface); border-radius: var(--r-md); box-shadow: 0 1px 2px rgb(15 23 42 / 0.12), 0 18px 44px -18px rgb(15 23 42 / 0.35); animation: rise 420ms var(--ease-out) 120ms both; }
.quick h2 { font-size: 18px; letter-spacing: -0.01em; }
.quick__total { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.quick__total output { font: 500 36px/1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; white-space: nowrap; margin-left: auto; }
.quick__total span { flex: 1 1 150px; }
.quick .btn { width: 100%; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@media (max-width: 899px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-block: 32px 40px; }
  .hero-visual { min-height: 0; padding: 200px 12px 12px; }
  .hero-visual img { object-position: 28% 20%; height: 280px; }
  .hero-visual { background: var(--alt); }
  .quick { width: 100%; }
}
@media (max-width: 520px) { .hero-facts { grid-template-columns: 1fr 1fr; } .hero-facts div:last-child { grid-column: 1 / -1; } }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px; }
.card { grid-column: span 2; display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; color: var(--ink); text-decoration: none; transition: transform 200ms var(--ease-out), border-color 200ms ease, box-shadow 200ms ease; }
.card--wide { grid-column: span 3; }
.card__media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--alt); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--ease-out); }
.card__body { display: grid; gap: 8px; align-content: start; flex: 1; padding: 24px; }
.card__body p { color: var(--ink-2); }
.card__go { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; color: var(--accent); font-weight: 600; }
.card__go .icon { width: 18px; height: 18px; transition: transform 180ms var(--ease-out); }
.card__icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 8px; border-radius: var(--r-sm); background: var(--tint); color: var(--accent); }
.card:active { transform: scale(0.99); }
@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: translateY(-2px); border-color: var(--control); box-shadow: 0 14px 32px -20px rgb(15 23 42 / 0.35); }
  .card:hover .card__media img { transform: scale(1.03); }
  .card:hover .icon--arrow { transform: translateX(3px); }
}
@media (max-width: 899px) { .card, .card--wide { grid-column: span 3; } .card:last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (max-width: 619px) { .card, .card--wide { grid-column: 1 / -1; } .cards { gap: 16px; } .card__body { padding: 20px; } }

/* ---------- Split ---------- */
.split { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.split__media { border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 4 / 5; max-height: 640px; width: 100%; }
.split__media img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 899px) { .split { grid-template-columns: minmax(0, 1fr); } .split__media { aspect-ratio: 4 / 3; } }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 20px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.steps li:first-child { border-top: 1px solid var(--line); }
.steps p { grid-column: 1; color: var(--ink-2); }
.steps strong { grid-column: 2; grid-row: 1 / span 2; align-self: center; font: 500 24px/1.2 var(--font-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; text-align: right; }

.guide-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; list-style: none; margin: 32px 0 0; padding: 0; }
.guide-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 16px; min-height: 88px; padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.guide-list h3 { font-size: 18px; }
.guide-list p { grid-column: 1; color: var(--muted); font-size: 15px; }
.guide-list .icon { grid-column: 2; grid-row: 1 / span 2; color: var(--accent); transition: transform 180ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .guide-list a:hover h3 { color: var(--accent); } .guide-list a:hover .icon { transform: translateX(3px); } }
@media (max-width: 719px) { .guide-list { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Page head and breadcrumbs ---------- */
.page-head { background: var(--surface); border-bottom: 1px solid var(--line); padding-block: 28px clamp(32px, 4vw, 48px); }
.page-head .wrap { display: grid; gap: 16px; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; list-style: none; margin: 0; padding: 0; font-size: 15px; }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--control); }
.crumbs a { display: inline-flex; align-items: center; min-height: 32px; }
.crumbs [aria-current] { color: var(--muted); }
.page-head--tool { padding-block: 16px 24px; }
.page-head--tool .wrap { gap: 8px; }
.page-head--tool h1 { font-size: clamp(28px, 1.2vw + 22px, 40px); }
.page-head--tool .lead { font-size: 18px; max-width: 72ch; }

/* ---------- Calculator ---------- */
.tool { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; align-items: start; padding-block: 24px var(--pad); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(18px, 2.6vw, 32px); min-width: 0; }
form.panel { display: grid; gap: 32px; }
fieldset { display: grid; gap: 18px; margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 16px; font: 500 19px/1.3 var(--font-display); }
legend + * { clear: both; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; align-items: start; }
.fields--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field > label, .field > .label { font-weight: 600; font-size: 16px; line-height: 1.35; }
.field .hint { font-size: 14px; line-height: 1.4; color: var(--muted); }
.field .error { font-size: 14px; line-height: 1.4; color: var(--error); font-weight: 600; }
.field .error:empty { display: none; }
.input { display: flex; align-items: stretch; min-height: 48px; border: 1px solid var(--control); border-radius: var(--r-sm); background: var(--surface); transition: border-color 150ms ease, box-shadow 150ms ease; }
.input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(3 105 161 / 0.22); }
.input:has([aria-invalid="true"]) { border-color: var(--error); }
.input span { display: grid; place-items: center; padding: 0 12px; color: var(--muted); font-size: 15px; white-space: nowrap; }
.input input { flex: 1; width: 100%; min-width: 0; border: 0; background: transparent; padding: 8px 12px; font: 400 17px/1.3 var(--font-body); color: var(--ink); font-variant-numeric: tabular-nums; }
.input span + input { padding-left: 0; }
.input input:focus { outline: 0; }
@media (forced-colors: active) { .input:focus-within { outline: 2px solid Highlight; } }
.control, textarea.control, select.control { width: 100%; min-height: 48px; border: 1px solid var(--control); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); padding: 10px 12px; font: 400 17px/1.4 var(--font-body); }
textarea.control { resize: vertical; min-height: 88px; }

.stepper { display: flex; align-items: stretch; height: 48px; border: 1px solid var(--control); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.stepper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(3 105 161 / 0.22); }
.stepper button { width: 48px; border: 0; background: var(--surface); color: var(--ink); font: 400 22px/1 var(--font-body); cursor: pointer; touch-action: manipulation; transition: background-color 150ms ease; }
.stepper button:active { background: var(--tint); }
.stepper button:disabled { color: var(--line); cursor: default; }
.stepper input { flex: 1; width: 100%; min-width: 0; text-align: center; border: 0; border-inline: 1px solid var(--line); font: 400 17px/1 var(--font-body); color: var(--ink); font-variant-numeric: tabular-nums; }
.stepper input:focus { outline: 0; }
@media (hover: hover) and (pointer: fine) { .stepper button:not(:disabled):hover { background: var(--alt); } }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border: 1px solid var(--control); border-radius: var(--r-sm); background: var(--surface); font-size: 16px; line-height: 1.3; -webkit-user-select: none; user-select: none; pointer-events: none; transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 140ms var(--ease-out); }
.choice input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.choice input:active + span { transform: scale(0.97); }
.choice input:disabled { cursor: not-allowed; }
.choice input:disabled + span { opacity: 0.45; }
.choice--check span::before { content: ""; width: 16px; height: 16px; border: 1.5px solid currentColor; border-radius: 4px; }
.choice--check input:checked + span::before { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%230f172a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; border-color: #fff; }
@media (hover: hover) and (pointer: fine) { .choice input:not(:checked, :disabled):hover + span { border-color: var(--ink); background: var(--alt); } }

.toggle { display: flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 600; cursor: pointer; }
.toggle input { width: 22px; height: 22px; accent-color: var(--accent); }

details.advanced { border-top: 1px solid var(--line); padding-top: 8px; }
details.advanced summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; cursor: pointer; font-weight: 600; list-style: none; }
details.advanced summary::-webkit-details-marker { display: none; }
details.advanced summary .icon { transition: transform 180ms var(--ease-out); }
details.advanced[open] summary .icon { transform: rotate(180deg); }
details.advanced > div { display: grid; gap: 16px; padding-top: 12px; }

.result { position: sticky; top: calc(var(--nav) + 16px); display: grid; gap: 20px; max-height: calc(100vh - var(--nav) - 32px); overflow-y: auto; }
.result__main { display: grid; gap: 4px; }
.result__main .label { color: var(--muted); font-size: 15px; }
.result__main output { font: 500 clamp(40px, 3vw + 24px, 60px)/1.05 var(--font-display); letter-spacing: -0.035em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.result__main p { color: var(--ink-2); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.stats div { background: var(--alt); border-radius: var(--r-sm); padding: 10px 14px; min-width: 0; }
.stats div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.stats dt { font-size: 14px; color: var(--muted); line-height: 1.35; }
.stats dd { margin: 4px 0 0; font: 500 19px/1.25 var(--font-display); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.breakdown { list-style: none; margin: 0; padding: 0; }
.breakdown li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.breakdown li[hidden] { display: none; }
.breakdown b { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.breakdown i { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--alt); overflow: hidden; }
.breakdown i::after { content: ""; display: block; height: 100%; background: var(--accent); transform: scaleX(var(--share, 0)); transform-origin: left; transition: transform 220ms var(--ease-out); }
.note { font-size: 15px; line-height: 1.5; color: var(--muted); }
.warn { padding: 12px 14px; border-radius: var(--r-sm); background: #fff4e5; color: #6f3d00; font-size: 15px; line-height: 1.5; }
.warn:empty, .warn[hidden] { display: none; }
.result .btn-row .btn { flex: 1 1 160px; }

.swap { display: inline-grid; }
.swap > span { grid-area: 1 / 1; transition: opacity 180ms ease, filter 180ms ease; }
.swap > span:last-child { opacity: 0; filter: blur(2px); }
.swap[data-done] > span:first-child { opacity: 0; filter: blur(2px); }
.swap[data-done] > span:last-child { opacity: 1; filter: none; }

.mobile-total { display: none; }
@media (max-width: 899px) {
  .tool { grid-template-columns: minmax(0, 1fr); padding-block: 16px 48px; }
  .result { position: static; max-height: none; overflow: visible; }
  .mobile-total { position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px var(--gut) calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); transition: transform 220ms var(--ease-out), visibility 220ms; }
  .mobile-total[data-hidden] { transform: translateY(100%); visibility: hidden; }
  .mobile-total div { min-width: 0; }
  .mobile-total span { display: block; font-size: 13px; line-height: 1.2; color: var(--muted); }
  .mobile-total output { display: block; font: 500 24px/1.2 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mobile-total .btn { flex: none; }
}
@media (max-width: 559px) { .fields { grid-template-columns: minmax(0, 1fr); } .fields--pair, .fields--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fields--3 > :first-child { grid-column: 1 / -1; } }

/* ---------- Startup list ---------- */
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 44px; gap: 10px; align-items: center; }
.row .control { min-width: 0; }
@media (max-width: 479px) { .row { grid-template-columns: minmax(0, 1fr) 112px 44px; gap: 6px; } .row .input span { padding-inline: 8px; } }

/* ---------- Estimate maker ---------- */
.line-item { display: grid; grid-template-columns: minmax(0, 1fr) 84px 130px 44px; gap: 8px; align-items: end; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
@media (max-width: 559px) { .line-item { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 44px; } .line-item .field:first-child { grid-column: 1 / -1; } }
.sheet { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: clamp(20px, 3vw, 32px); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.sheet__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 24px; padding-bottom: 20px; border-bottom: 2px solid var(--ink); }
.sheet__top > div { min-width: 0; max-width: 100%; }
.sheet h2 { font-size: 24px; }
.sheet h3 { font-size: 13px; font-family: var(--font-body); font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.sheet .pre { white-space: pre-line; }
.sheet__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 24px; padding-block: 20px; }
.sheet__meta > div { min-width: 0; flex: 1 1 140px; }
.sheet table { width: 100%; border-collapse: collapse; overflow-wrap: break-word; }
.sheet td:first-child { min-width: 9em; }
.sheet th { text-align: left; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); padding: 6px 8px 6px 0; }
.sheet td { border-bottom: 1px solid var(--line); padding: 8px 8px 8px 0; vertical-align: top; }
.sheet .n { text-align: right; padding-right: 0; padding-left: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sheet__totals { margin: 12px 0 0 auto; max-width: 300px; }
.sheet__totals div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.sheet__totals div[hidden] { display: none; }
.sheet__totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.sheet__totals .grand { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 10px; font: 500 19px/1.3 var(--font-display); }
.sheet__notes { margin-top: 24px; }
.tool--doc { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); }
.tool--doc .result { gap: 12px; }
@media (max-width: 899px) { .tool--doc { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Articles ---------- */
.article-layout { display: grid; grid-template-columns: minmax(0, 720px) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; padding-block: clamp(32px, 5vw, 64px) var(--pad); }
.prose { font-size: 18px; line-height: 1.7; color: #1e293b; min-width: 0; }
.prose > * + * { margin-top: 20px; }
.prose h2 { font-size: clamp(24px, 1vw + 20px, 30px); margin-top: 48px; color: var(--ink); }
.prose h3 { margin-top: 32px; color: var(--ink); }
.prose h2 + *, .prose h3 + * { margin-top: 12px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li + li { margin-top: 8px; }
.prose figure { margin: 32px 0; }
.prose figure img { width: 100%; border-radius: var(--r-md); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.45; }
.prose th, .prose td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--alt); font-weight: 600; }
.prose tr:last-child td { border-bottom: 0; }
.prose td.n, .prose th.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.callout { display: grid; gap: 12px; justify-items: start; padding: 24px; border-radius: var(--r-md); background: var(--tint); }
.callout p { color: var(--ink); }
.aside { position: sticky; top: calc(var(--nav) + 24px); display: grid; gap: 24px; max-width: 340px; }
.aside ul { list-style: none; margin: 8px 0 0; padding: 0; }
.aside li a { display: flex; align-items: center; min-height: 44px; border-bottom: 1px solid var(--line); line-height: 1.35; padding-block: 8px; }
@media (max-width: 999px) { .article-layout { grid-template-columns: minmax(0, 1fr); } .aside { position: static; max-width: none; } }
.hero-figure { aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; margin-bottom: 32px; }
.hero-figure img { width: 100%; height: 100%; object-fit: cover; }

.explain { background: var(--surface); border-top: 1px solid var(--line); }
.faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 48px; margin-top: 48px; }
.faq h3 { margin-bottom: 8px; font-size: 19px; }
.faq p { color: var(--ink-2); }
@media (max-width: 719px) { .faq { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Ads: a reserved, labelled space, away from buttons ---------- */
.ad { margin: 40px auto; min-height: 280px; text-align: center; }
.ad > span { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }

/* ---------- Close and footer ---------- */
.close { background: var(--ink); color: #fff; }
.close .wrap { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 28px; padding-block: var(--pad); }
.close p { color: var(--on-dark-2); margin-top: 12px; max-width: 52ch; }
.close .btn--primary { background: #fff; color: var(--ink); }
.close .btn--secondary { background: transparent; color: #fff; border-color: #94a3b8; }
@media (hover: hover) and (pointer: fine) { .close .btn--primary:hover { background: #e2e8f0; } .close .btn--secondary:hover { border-color: #fff; } }
.close :focus-visible { outline-color: #7dd3fc; }
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding-block: 56px calc(32px + env(safe-area-inset-bottom)); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 32px 24px; }
.footer-grid p { max-width: 34ch; color: var(--ink-2); margin-top: 8px; }
.footer-grid h2 { font-size: 15px; letter-spacing: 0; margin-bottom: 4px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li a { display: inline-flex; align-items: center; min-height: 36px; color: var(--ink-2); text-decoration: none; font-size: 16px; line-height: 1.3; }
@media (hover: hover) and (pointer: fine) { .footer-grid li a:hover { color: var(--accent); text-decoration: underline; } }
@media (pointer: coarse) { .footer-grid li a, .crumbs a { min-height: 44px; } }
@media (max-width: 819px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-grid > :first-child { grid-column: 1 / -1; } }
.legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.legal a, .legal button { color: var(--muted); }
.legal button { border: 0; padding: 0; background: none; font: inherit; text-decoration: underline; cursor: pointer; }
.has-mobile-total .site-footer { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { .has-mobile-total .site-footer { padding-bottom: 32px; } }

/* ---------- Touch ---------- */
a, button, summary, label { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
@media (pointer: coarse) { .btn:active { background-image: linear-gradient(rgb(15 23 42 / 0.08), rgb(15 23 42 / 0.08)); } .guide-list a:active { background: var(--tint); } }

/* ---------- Page transitions and reduced motion ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { transition-property: color, background-color, border-color, opacity !important; }
  .quick { animation: none; }
  .btn:active, .card:active, .card:hover, .card:hover .card__media img, .icon-button:active, .choice input:active + span { transform: none; }
  @starting-style { .menu[open] { transform: none; } }
}

/* ---------- Print: the estimate maker prints only the document ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; }
  .site-header, .site-footer, .page-head, .close, .explain, .ad, .mobile-total, .no-print, .skip { display: none !important; }
  .tool, .tool--doc { display: block; width: auto; padding: 0; }
  .result { position: static; max-height: none; overflow: visible; }
  .sheet { border: 0; padding: 0; font-size: 12pt; }
  .sheet tr { break-inside: avoid; }
}

/* Hero price check: keep the steppers usable on narrow phones. */
.quick .stepper button { width: 44px; flex: none; }
@media (max-width: 439px) { .quick .fields--pair { grid-template-columns: minmax(0, 1fr); } }

/* Controls are not selectable text. */
.stepper button, .icon-button, .mobile-total { -webkit-user-select: none; user-select: none; }

/* Very long amounts scroll inside the document or wrap; the page never scrolls sideways. */
.result { grid-template-columns: minmax(0, 1fr); }
.sheet { min-width: 0; }
.sheet__totals div { flex-wrap: wrap; }
.sheet__totals dd { margin-left: auto; overflow-wrap: anywhere; }

/* Buttons take the full width on a phone. */
@media (max-width: 519px) { .hero .btn-row .btn, .close .btn-row, .close .btn-row .btn, .result .btn { width: 100%; } }
.control { min-width: 0; }
@media (max-width: 419px) { .fields--3 { grid-template-columns: minmax(0, 1fr); } }
