/* Layout: one narrow reading column; calculators split into form | results at wide widths, stacked on phones. */
:root {
  /* Single bright theme on purpose: white, calm "bank blue", fresh green for good news. */
  --bg: #ffffff;
  --tint: #f3f7fc;
  --surface: #ffffff;
  --ink: #102a43;
  --muted: #52667a;
  --line: #dde5ee;
  --accent: #0b5cad;
  --accent-soft: #eaf2fc;
  --accent-ink: #ffffff;
  --good: #12805c;
  --good-soft: #e7f6ef;
  --ochre: #a85a12;
  --tax: #d0583f;
  --medicare: #e0a526;
  --help: #7b61c4;
  --super: #12805c;
  --font-display: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 42, 67, 0.05), 0 8px 24px rgba(16, 42, 67, 0.06);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; line-height: 1.6;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.wrap { max-width: 1040px; margin: 0 auto; }

/* Header */
.site-header { padding-block: 16px; border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.brand-mark svg { width: 18px; height: 18px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.95rem; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

main { padding-block: 32px 56px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 1.15; text-wrap: balance; letter-spacing: -0.02em; color: var(--ink); }
h1 { font-size: clamp(2rem, 5vw, 2.9rem); margin: 0 0 12px; }
h2 { font-size: 1.55rem; margin: 40px 0 10px; }
h3 { font-size: 1.15rem; margin: 26px 0 6px; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 62ch; margin: 0 0 28px; }
.prose { max-width: 68ch; }
.prose p, .prose li { color: var(--ink); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.76rem; font-weight: 700; color: var(--accent); margin: 0 0 10px; }

/* Home */
.hero { padding-block: 16px 8px; }
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; margin: 8px 0 12px; }
.tool { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.tool:hover { border-color: var(--accent); transform: translateY(-2px); }
.tool strong { color: var(--ink); }
.tool strong { font-family: var(--font-display); font-size: 1.12rem; }
.tool span { color: var(--muted); font-size: 0.95rem; }
.guide-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.guide-list a { font-weight: 600; }

/* Calculator */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; align-items: start; margin-bottom: 12px; }
@media (max-width: 820px) { .calc { grid-template-columns: minmax(0, 1fr); } }
.calc-form { display: grid; gap: 16px; padding: 24px; background: var(--tint); border: 1px solid var(--line); border-radius: var(--radius); }
.field { display: grid; gap: 6px; }
.field label, .field .label { font-weight: 600; font-size: 0.95rem; }
.hint { font-size: 0.85rem; color: var(--muted); }
input[type="text"], select {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid #c9d5e2; border-radius: 10px; padding: 10px 12px; min-height: 46px;
}
.money { position: relative; }
.money > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.money input { padding-left: 26px; }
.suffix { position: relative; }
.suffix > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.suffix input { padding-right: 40px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 0.95rem; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { flex: 1 1 auto; text-align: center; padding: 10px 12px; border: 1px solid #c9d5e2; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 0.92rem; background: var(--surface); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span { color: var(--accent); }
.seg label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn { font: inherit; font-weight: 600; font-size: 0.92rem; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--accent); background: transparent; color: var(--accent); cursor: pointer; }
.btn:hover { background: var(--accent-soft); }
.icon-btn { font: inherit; border: 1px solid #c9d5e2; background: var(--surface); color: var(--muted); border-radius: 8px; width: 46px; min-height: 46px; cursor: pointer; }
.icon-btn:hover { color: var(--tax); border-color: var(--tax); }

.results { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--good); border-radius: var(--radius); box-shadow: var(--shadow); font-variant-numeric: tabular-nums; min-width: 0; }
.headline { display: grid; gap: 2px; margin-bottom: 16px; }
.headline .label { color: var(--muted); font-weight: 600; font-size: 0.92rem; }
.headline .big { font-family: var(--font-display); font-size: clamp(2.2rem, 6vw, 3rem); font-weight: 800; line-height: 1.05; color: var(--good); letter-spacing: -0.02em; }
.headline .sub { color: var(--muted); font-size: 0.95rem; }
.bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--line); margin: 6px 0 10px; }
.bar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.86rem; color: var(--muted); margin-bottom: 14px; }
.legend b { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { color: var(--muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; }
tr.total td { font-weight: 700; border-bottom: 0; color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 8px; }
.stat { padding: 12px 14px; border-radius: 10px; background: var(--tint); }
.stat .label { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.stat .val { font-weight: 700; font-size: 1.15rem; }
.note { font-size: 0.86rem; color: var(--muted); margin: 14px 0 0; }
.warn { font-size: 0.9rem; color: var(--ochre); font-weight: 600; margin: 12px 0 0; }
.person-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 46px; gap: 8px; }
#rent-rows { display: grid; gap: 8px; }

.faq dt { font-weight: 700; margin-top: 16px; }
.faq dd { margin: 4px 0 0; }
.disclaimer { margin-top: 36px; padding: 14px 16px; border-left: 3px solid var(--line); color: var(--muted); font-size: 0.9rem; max-width: 68ch; }
.ad-slot:empty { display: none; }
.ad-slot { margin: 24px 0; }

.site-footer { border-top: 1px solid var(--line); padding-block: 28px 40px; color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: grid; gap: 20px; }
.footer-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 24px; }
.footer-base { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; padding-top: 16px; border-top: 1px solid var(--line); }
.site-footer a { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Home search and groups */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.search { max-width: 560px; margin: 0 0 8px; }
.search input { width: 100%; font: inherit; font-size: 1.05rem; color: var(--ink); background: var(--surface); border: 2px solid var(--line); border-radius: 12px; padding: 14px 16px 14px 46px; min-height: 54px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2378887f' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 15px 50%; }
.search input:focus { border-color: var(--accent); outline: none; }
.tool-group h2 { font-size: 1.15rem; margin: 30px 0 10px; color: var(--muted); font-family: var(--font-body); font-weight: 700; letter-spacing: 0; }
.tool strong::after { content: "\00a0→"; color: var(--accent); }
.related { margin-top: 40px; }
.related h2 { font-size: 1.25rem; }
.live-hint { margin: -4px 0 0; }
.partner { margin: 28px 0 0; padding: 18px 20px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent-soft); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.partner p { margin: 0; flex: 1 1 260px; font-weight: 600; }
.partner .hint { flex-basis: 100%; }

/* Trust cues */
.trustbar { background: var(--tint); border-bottom: 1px solid var(--line); font-size: 0.84rem; color: var(--muted); margin-left: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); margin-right: calc(-1 * max(16px, env(safe-area-inset-right, 0px))); padding: 8px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px)); }
.trustbar .wrap { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.trust-item { display: inline-flex; align-items: center; gap: 6px; }
.trust-item svg { width: 15px; height: 15px; color: var(--good); flex: none; }
.hero { background: linear-gradient(160deg, var(--accent-soft) 0%, #f5fbf8 100%); padding: 36px clamp(18px, 4vw, 44px) 32px; border-radius: 20px; margin-bottom: 8px; }
.hero .lede { margin-bottom: 22px; color: #3d5266; }
.hero .search { margin-bottom: 0; }
.hero .search input { border-color: #c9d5e2; box-shadow: var(--shadow); }
.trust-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 40px 0 8px; }
.trust-card { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--radius); background: var(--tint); }
.trust-card svg { width: 26px; height: 26px; color: var(--accent); flex: none; margin-top: 2px; }
.trust-card strong { display: block; font-size: 0.98rem; }
.trust-card span { color: var(--muted); font-size: 0.9rem; }
.disclaimer { border-left-color: var(--accent); background: var(--tint); border-radius: 0 10px 10px 0; }
.site-footer { background: var(--tint); margin-left: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); margin-right: calc(-1 * max(16px, env(safe-area-inset-right, 0px))); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.footer-note { max-width: 80ch; }
@media (max-width: 480px) { th, td { padding: 8px 4px; font-size: 0.84rem; } thead th { font-size: 0.7rem; letter-spacing: 0.03em; } .results, .calc-form { padding: 18px; } }
