/* The Budget Clinic — shared styles */
:root {
  --paper: #F5F8F6;
  --surface: #FFFFFF;
  --ink: #13233F;
  --muted: #5B6A7D;
  --line: #DCE5E1;
  --grid: rgba(29, 107, 102, 0.07);
  --teal: #1D6B66;
  --teal-deep: #0F3F3C;
  --mint: #8ED8C6;
  --mint-soft: #E4F4EF;
  --field: #F3F7F5;
  --yellow: #F6C945;
  --yellow-soft: #FDF3D1;
  --coral: #EF7F6E;
  --coral-soft: #FCE8E4;
  --on-teal: #FFFFFF;
  --brand: var(--teal);
  /* chart series */
  --keep: #1D6B66;
  --tax: #13233F;
  --ni: #7393C4;
  --loan: #EF7F6E;
  --pension: #4DB89C;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(19, 35, 63, .06), 0 10px 30px -12px rgba(19, 35, 63, .18);
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0C1622; --surface: #142131; --ink: #E8EEF5; --muted: #9AA9BB; --line: #24364A;
    --grid: rgba(142, 216, 198, 0.06); --teal: #4DB8A8; --teal-deep: #0A2A2E; --mint: #8ED8C6; --mint-soft: #15312F;
    --field: #0F1B29; --yellow: #F6C945; --yellow-soft: #2F2913; --coral: #F29A8B; --coral-soft: #33201E; --on-teal: #0C1622;
    --keep: #4DB8A8; --tax: #C6D3E6; --ni: #7E9FD6; --loan: #F29A8B; --pension: #8ED8C6;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 30px -12px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.55; font-variant-numeric: tabular-nums; }
a { color: var(--teal); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; }
.graph { background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 28px 28px; }

/* ---------- Header ---------- */
.site-head { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.logo img { width: 50px; height: 50px; display: block; }
.logo-word { font-family: var(--display); font-weight: 800; font-size: 21px; letter-spacing: -0.03em; line-height: 1; }
.logo-word span { display: block; font-family: var(--font); font-weight: 600; font-size: 12.5px; letter-spacing: 0; color: var(--muted); margin-top: 4px; }
.site-nav { display: flex; gap: 6px; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; padding: 9px 14px; border-radius: 999px; }
.site-nav a:hover { color: var(--ink); background: var(--field); }
.site-nav a[aria-current="page"] { color: var(--teal); background: var(--mint-soft); }
@media (max-width: 600px) {
  .logo-word span { display: none; }
  .logo img { width: 42px; height: 42px; }
  .logo-word { font-size: 18px; }
  .site-nav a { padding: 8px 10px; font-size: 14px; }
}

/* ---------- Calculator page heading ---------- */
.page-head { border-bottom: 1px solid var(--line); background-color: var(--mint-soft); }
.page-head .wrap { padding-top: 46px; padding-bottom: 92px; position: relative; }
.page-head h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.02; margin: 0 0 14px; font-weight: 800; max-width: 18ch; }
.page-head p { margin: 0; color: var(--muted); max-width: 60ch; font-size: 18.5px; }
.year-tag { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 14px; font-weight: 700; color: var(--teal-deep); background: var(--yellow); padding: 5px 12px 5px 10px; border-radius: 999px; }
.year-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--teal-deep); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .year-tag { color: #0C1622; } :root:not([data-theme="light"]) .year-tag::before { background: #0C1622; } }

/* ---------- Calculator layout ---------- */
.calc { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 28px; align-items: start; margin-top: -64px; padding-bottom: 72px; position: relative; }
@media (max-width: 880px) { .calc { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); }
.panel.wide { margin: 0 0 64px; }
@media (max-width: 520px) { .panel { padding: 22px 18px; border-radius: 18px; } }
.form-title { font-family: var(--display); font-size: 20px; font-weight: 700; margin: 0 0 20px; }

/* ---------- Form ---------- */
.field { margin-bottom: 22px; }
.field:last-child { margin-bottom: 0; }
#new-fields > .field:last-child, #current-fields > .field:last-child { margin-bottom: 22px; }
.field > label, .field > .label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.hint { display: block; color: var(--muted); font-size: 14px; margin-top: 7px; line-height: 1.45; }
.money { position: relative; }
.money::before { content: "£"; position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--teal); font-weight: 700; pointer-events: none; }
.money.pct::before, .money.yrs::before { content: none; }
.money.pct::after, .money.yrs::after { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; font-size: 15px; pointer-events: none; }
.money.pct::after { content: "%"; }
.money.yrs::after { content: "years"; }
.money.mos::after { content: "months"; }
input[type="number"], input[type="text"], input[type="month"], select {
  width: 100%; font: inherit; font-size: 18px; font-weight: 600; color: var(--ink); background: var(--field);
  border: 1.5px solid transparent; border-radius: var(--radius-sm); padding: 12px 14px 12px 32px; appearance: none; -moz-appearance: textfield;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="month"], .money.pct input, .money.yrs input, select { padding-left: 14px; }
.money.yrs input { padding-right: 70px; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--teal) 50%), linear-gradient(135deg, var(--teal) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; cursor: pointer; }
input:hover, select:hover { border-color: var(--line); }
input:focus, select:focus { border-color: var(--teal); background-color: var(--surface); outline: none; box-shadow: 0 0 0 4px var(--mint-soft); }
input[type="range"] { width: 100%; accent-color: var(--teal); margin-top: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.seg { display: flex; background: var(--field); border-radius: 12px; padding: 4px; gap: 4px; }
.seg label { flex: 1; text-align: center; padding: 9px 8px; border-radius: 9px; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--muted); line-height: 1.3; transition: background-color .15s, color .15s; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:hover { color: var(--ink); }
.seg label:has(input:checked) { background: var(--surface); color: var(--teal); box-shadow: 0 1px 2px rgba(19,35,63,.08), 0 2px 8px -2px rgba(19,35,63,.12); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--yellow); }
.mode { margin-bottom: 26px; }
.mode .seg { background: var(--teal-deep); }
.mode .seg label { color: rgba(255,255,255,.75); padding: 11px 8px; }
.mode .seg label:hover { color: #fff; }
.mode .seg label:has(input:checked) { background: var(--yellow); color: #0F3F3C; }

.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.checks label { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; padding: 10px 12px; border: 1.5px solid transparent; border-radius: var(--radius-sm); cursor: pointer; background: var(--field); transition: border-color .15s, background-color .15s; }
.checks label:hover { border-color: var(--line); }
.checks label:has(input:checked) { border-color: var(--teal); background: var(--mint-soft); color: var(--teal-deep); }
.checks input { accent-color: var(--teal); width: 18px; height: 18px; margin: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .checks label:has(input:checked) { color: var(--ink); } }
@media (max-width: 420px) { .checks { grid-template-columns: 1fr; } }

details.more { border-top: 1px dashed var(--line); padding-top: 18px; margin-top: 6px; }
details.more summary { cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 18px; list-style: none; display: flex; align-items: center; justify-content: space-between; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "+"; width: 28px; height: 28px; border-radius: 50%; background: var(--mint-soft); color: var(--teal); display: grid; place-items: center; font-family: var(--font); font-weight: 700; }
details.more[open] summary::after { content: "−"; }
details.more[open] summary { margin-bottom: 18px; }
.err { color: #B3261E; background: var(--coral-soft); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 15px; font-weight: 600; margin: 16px 0 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .err { color: #F7C1B8; } }

/* ---------- Result: the prescription slip ---------- */
.result { position: sticky; top: 20px; padding: 0; overflow: visible; border: none; background: transparent; box-shadow: none; }
@media (max-width: 880px) { .result { position: static; } }
.slip { background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow); position: relative; }
.slip::after { /* torn-off bottom edge */
  content: ""; position: absolute; left: 0; right: 0; bottom: -13px; height: 14px; background: var(--surface);
  -webkit-mask: radial-gradient(circle at 10px 14px, transparent 7px, #000 7.5px) 0 0 / 20px 14px repeat-x;
          mask: radial-gradient(circle at 10px 14px, transparent 7px, #000 7.5px) 0 0 / 20px 14px repeat-x;
}
.slip-head { display: flex; align-items: center; gap: 12px; padding: 16px 28px; background: var(--teal); color: var(--on-teal); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.rx { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1; letter-spacing: -0.04em; display: flex; align-items: baseline; }
.rx i { font-style: normal; font-size: 18px; margin-left: -2px; transform: translateY(5px) rotate(-12deg); display: inline-block; }
.slip-title { font-weight: 700; font-size: 16px; }
.slip-meta { margin-left: auto; font-size: 13px; font-weight: 600; opacity: .85; background: rgba(255,255,255,.14); padding: 4px 10px; border-radius: 999px; }
.slip-body { padding: 26px 28px 34px; }
@media (max-width: 520px) { .slip-head { padding: 14px 18px; } .slip-body { padding: 22px 18px 30px; } }

.headline-label { font-size: 15px; color: var(--muted); font-weight: 600; margin: 0 0 6px; }
.headline-figure { font-family: var(--display); font-size: clamp(48px, 7.4vw, 76px); line-height: .95; font-weight: 800; letter-spacing: -0.045em; margin: 0; color: var(--ink); }
.headline-figure small { font-family: var(--font); font-size: 0.26em; font-weight: 700; letter-spacing: 0; color: var(--muted); margin-left: 8px; }
.subfigures { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.subfigures span { background: var(--field); border-radius: 999px; padding: 6px 13px; font-size: 14.5px; color: var(--muted); }
.subfigures b { color: var(--ink); font-weight: 800; }
.period-switch { margin: 24px 0 4px; max-width: 340px; }

/* Where your pay goes */
.strip { display: flex; height: 22px; border-radius: 999px; overflow: hidden; margin: 24px 0 16px; background: var(--line); gap: 3px; }
.strip span { display: block; height: 100%; transition: flex-grow .4s cubic-bezier(.2,.8,.2,1); min-width: 4px; }
.strip span:first-child { border-radius: 999px 0 0 999px; }
.strip span:last-child { border-radius: 0 999px 999px 0; }
@media (prefers-reduced-motion: reduce) { .strip span { transition: none; } }
.legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 22px; margin: 0; padding: 0; list-style: none; font-size: 15px; }
.legend li { display: flex; align-items: center; gap: 10px; }
.legend i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.legend .v { margin-left: auto; font-weight: 800; }

/* Callouts */
.callout { margin-top: 18px; border-radius: var(--radius-md); padding: 15px 18px 15px 56px; background: var(--yellow-soft); font-size: 15px; position: relative; line-height: 1.5; }
.callout::before { content: "!"; position: absolute; left: 16px; top: 15px; width: 26px; height: 26px; border-radius: 50%; background: var(--yellow); color: #13233F; font-weight: 800; display: grid; place-items: center; font-size: 15px; }
.callout strong { display: block; margin-bottom: 2px; font-size: 15.5px; }
.callout.calm { background: var(--mint-soft); }
.callout.calm::before { content: "✓"; background: var(--teal); color: var(--on-teal); }

/* Working / summary tables */
.working { margin-top: 30px; }
.working h2, .statement-head h2 { font-size: 21px; margin: 0 0 4px; font-weight: 700; }
.working p.note, .note { margin: 0 0 14px; color: var(--muted); font-size: 14.5px; }
table.sheet { width: 100%; border-collapse: collapse; font-size: 15px; }
table.sheet th, table.sheet td { padding: 11px 0; border-bottom: 1px solid var(--line); text-align: right; }
table.sheet th:first-child, table.sheet td:first-child { text-align: left; }
table.sheet thead th { font-size: 13px; color: var(--muted); font-weight: 700; padding-top: 0; }
table.sheet tr.sub td { color: var(--muted); font-size: 14px; padding: 6px 0; border-bottom: none; }
table.sheet tr.sub td:first-child { padding-left: 16px; position: relative; }
table.sheet tr.sub td:first-child::before { content: ""; position: absolute; left: 4px; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: var(--mint); }
table.sheet tr.total td { font-weight: 800; border-bottom: none; border-top: 2px solid var(--ink); font-size: 17px; padding-top: 14px; }
table.sheet td.diff { color: var(--teal); font-weight: 800; }
table.sheet .wrap-cell { white-space: nowrap; }
.panel.wide table.sheet td, .panel.wide table.sheet th { padding-left: 18px; }
.panel.wide .working { margin-top: 0; }

/* Mortgage chart */
.chart { margin-top: 26px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 14px; font-family: var(--font); }

/* Payment statement */
.statement { margin-top: 38px; }
.statement-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.statement-head .seg { min-width: 280px; }
.statement .scroll { max-height: 640px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
table.stmt { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.stmt th, table.stmt td { padding: 10px 14px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.stmt th:first-child, table.stmt td:first-child { text-align: left; }
table.stmt thead th { position: sticky; top: 0; background: var(--teal-deep); color: #fff; font-size: 13px; font-weight: 700; z-index: 1; }
table.stmt tr.yr td { font-weight: 800; background: var(--surface); cursor: pointer; }
table.stmt tr.yr:hover td { background: var(--mint-soft); }
table.stmt tr.yr td:first-child::before { content: "›"; display: inline-block; width: 18px; color: var(--teal); font-size: 18px; line-height: 1; transition: transform .15s; }
table.stmt tr.yr.open td { background: var(--mint-soft); }
table.stmt tr.yr.open td:first-child::before { transform: rotate(90deg); }
table.stmt tr.mo td { color: var(--muted); background: var(--field); font-size: 14px; }
table.stmt tr.mo td:first-child { padding-left: 32px; }
table.stmt td.ov { color: var(--teal); }
@media (max-width: 560px) { table.stmt .hide-sm { display: none; } table.stmt th, table.stmt td { padding: 9px 10px; } }

/* ---------- Home ---------- */
.hero { background-color: var(--teal-deep); color: #fff; position: relative; overflow: hidden; }
.hero.graph { background-image: linear-gradient(rgba(142,216,198,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(142,216,198,.08) 1px, transparent 1px); background-size: 32px 32px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding-top: 72px; padding-bottom: 120px; position: relative; z-index: 1; }
@media (max-width: 880px) { .hero .wrap { grid-template-columns: 1fr; padding-top: 48px; padding-bottom: 110px; } }
.hero h1 { font-size: clamp(42px, 6.4vw, 78px); line-height: .98; letter-spacing: -0.04em; margin: 0 0 22px; font-weight: 800; }
.hero p.lede { font-size: 20px; color: rgba(255,255,255,.8); margin: 0 0 32px; max-width: 44ch; }
.btn { display: inline-flex; align-items: center; gap: 10px; background: var(--yellow); color: #13233F; text-decoration: none; font-weight: 800; padding: 15px 24px; border-radius: 999px; font-size: 16.5px; transition: transform .15s, box-shadow .15s; box-shadow: 0 6px 20px -6px rgba(246,201,69,.6); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -6px rgba(246,201,69,.7); }
.btn.ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.35); box-shadow: none; margin-left: 8px; }
.btn.ghost:hover { border-color: #fff; }
@media (max-width: 420px) { .btn.ghost { margin: 10px 0 0; } }
.hero-art { position: relative; justify-self: center; width: min(420px, 100%); }
.hero-art img { width: 100%; height: auto; display: block; filter: drop-shadow(0 30px 40px rgba(0,0,0,.25)); }
.hero-slip { position: absolute; left: -36px; bottom: -28px; width: 230px; background: #FFFDF5; color: #13233F; border-radius: 14px 14px 0 0; padding: 14px 16px 16px; font-size: 13.5px; transform: rotate(-4deg); box-shadow: 0 18px 40px -12px rgba(0,0,0,.4); }
.hero-slip::after { content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 10px; background: #FFFDF5; -webkit-mask: radial-gradient(circle at 7px 10px, transparent 5px, #000 5.5px) 0 0 / 14px 10px repeat-x; mask: radial-gradient(circle at 7px 10px, transparent 5px, #000 5.5px) 0 0 / 14px 10px repeat-x; }
.hero-slip .hs-top { display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: #1D6B66; margin-bottom: 8px; font-size: 12.5px; }
.hero-slip .hs-top b { font-family: var(--display); font-size: 20px; color: #13233F; letter-spacing: -0.04em; }
.hero-slip .r { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed #D5DED9; }
.hero-slip .r span:last-child { font-weight: 600; }
.hero-slip .r.fin { border: none; border-top: 2px solid #13233F; margin-top: 6px; padding-top: 8px; font-weight: 800; font-size: 16px; }
@media (max-width: 880px) { .hero-art { width: min(320px, 80%); margin-top: 10px; } .hero-slip { left: -24px; width: 200px; } }

/* heartbeat line across the bottom of the hero */
.pulse { position: absolute; left: 0; right: 0; bottom: 28px; height: 70px; z-index: 0; pointer-events: none; }
.pulse svg { width: 100%; height: 100%; display: block; }
.pulse path { fill: none; stroke: var(--coral); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2600; stroke-dashoffset: 2600; animation: beat 2.4s cubic-bezier(.6,.1,.3,1) .3s forwards; opacity: .9; }
@keyframes beat { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .pulse path { animation: none; stroke-dashoffset: 0; } }

.tools { padding: 0 0 40px; margin-top: -64px; position: relative; z-index: 2; }
.tool-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; }
@media (max-width: 880px) { .tool-grid { grid-template-columns: 1fr; } }
.tool { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-lg); padding: 30px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); border: 1px solid var(--line); transition: transform .2s, box-shadow .2s; position: relative; overflow: hidden; }
.tool:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(19,35,63,.06), 0 22px 40px -16px rgba(19,35,63,.28); }
.tool h3 { font-size: 28px; margin: 0 0 8px; font-weight: 800; line-height: 1.1; }
.tool p { margin: 0 0 24px; color: var(--muted); max-width: 42ch; }
.tool .sample { margin-top: auto; background: var(--field); border-radius: var(--radius-md); padding: 16px 18px; display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.tool .sample .big { font-family: var(--display); font-weight: 800; font-size: 34px; letter-spacing: -0.04em; line-height: 1; }
.tool .sample .cap { color: var(--muted); font-size: 14px; }
.tool .open { margin-top: 18px; font-weight: 800; color: var(--teal); display: flex; align-items: center; gap: 8px; }
.tool .open svg { transition: transform .2s; }
.tool:hover .open svg { transform: translateX(4px); }
.tool.primary { background: var(--yellow); border-color: transparent; }
.tool.primary p, .tool.primary .sample .cap { color: rgba(19,35,63,.72); }
.tool.primary .sample { background: rgba(255,255,255,.55); }
.tool.primary, .tool.primary h3, .tool.primary .sample .big { color: #13233F; }
.tool.primary .open { color: #0F3F3C; }

.soon-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; color: var(--muted); font-size: 15px; }
.soon-row b { color: var(--ink); margin-right: 4px; }
.soon-row span { background: var(--surface); border: 1px dashed var(--line); border-radius: 999px; padding: 6px 14px; }

.promise { padding: 40px 0 72px; }
.promise h2 { font-size: clamp(28px, 3.6vw, 40px); margin: 0 0 28px; font-weight: 800; max-width: 22ch; line-height: 1.08; }
.promise-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; list-style: none; margin: 0; padding: 0; }
@media (max-width: 760px) { .promise-list { grid-template-columns: 1fr; gap: 20px; } }
.promise-list li { border-top: 3px solid var(--teal); padding-top: 16px; }
.promise-list h3 { font-size: 19px; margin: 0 0 6px; font-weight: 700; }
.promise-list p { margin: 0; color: var(--muted); font-size: 15.5px; }

/* ---------- Footer ---------- */
.site-foot { background: #13233F; color: rgba(255,255,255,.72); padding: 40px 0 48px; font-size: 14px; }
.site-foot .wrap { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: start; }
.site-foot img { width: 56px; height: 56px; }
.site-foot strong { display: block; color: #fff; font-family: var(--display); font-size: 18px; margin-bottom: 8px; }
.site-foot p { margin: 0 0 8px; max-width: 80ch; }
@media (max-width: 560px) { .site-foot .wrap { grid-template-columns: 1fr; gap: 14px; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.panel.wide { margin-top: -24px; }
.site-nav a { white-space: nowrap; }
.logo-word { white-space: nowrap; }
@media (max-width: 600px) {
  .hide-xs { display: none; }
  .hero-slip { display: none; }
  .hero-art { width: min(280px, 78%); }
  .hero .wrap { padding-bottom: 96px; }
}
@media (max-width: 600px) { .cap-xs { text-transform: capitalize; } }

/* Report downloads */
.export { margin-top: 24px; padding-top: 20px; border-top: 1px dashed var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.export-label { font-weight: 700; font-size: 15px; margin-right: auto; }
.dl { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 800; font-size: 15px; padding: 11px 18px; border-radius: 999px; border: none; cursor: pointer; background: var(--teal); color: var(--on-teal); transition: transform .15s, filter .15s; }
.dl:hover { transform: translateY(-1px); filter: brightness(1.07); }
.dl.alt { background: var(--yellow); color: #13233F; }
.dl:disabled { opacity: .7; cursor: progress; transform: none; }
@media (max-width: 520px) { .export-label { width: 100%; } .dl { flex: 1; justify-content: center; } }

/* ---------- Budget planner ---------- */
.budget-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px dashed var(--line); }
.example-note { margin: 0 auto 0 0; font-size: 14px; font-weight: 700; color: #13233F; background: var(--yellow-soft); padding: 6px 12px; border-radius: 999px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .example-note { color: var(--ink); } }
.link-btn { background: none; border: none; padding: 4px 2px; font: inherit; font-size: 14px; font-weight: 700; color: var(--teal); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link-btn:hover { text-decoration-thickness: 2px; }

.bgroup { border-bottom: 1px solid var(--line); padding: 16px 0; }
.bgroup:last-child { border-bottom: none; padding-bottom: 0; }
.bgroup.income { padding-top: 0; }
.bgroup-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; list-style: none; }
summary.bgroup-head { cursor: pointer; margin-bottom: 0; }
summary.bgroup-head::-webkit-details-marker { display: none; }
summary.bgroup-head::after { content: "›"; color: var(--teal); font-size: 22px; line-height: 1; transform: rotate(90deg); transition: transform .15s; margin-left: 4px; }
details.bgroup:not([open]) summary.bgroup-head::after { transform: rotate(0); }
details.bgroup[open] summary.bgroup-head { margin-bottom: 12px; }
.bgroup-head h2 { font-size: 18px; margin: 0; font-weight: 700; }
.bgroup.income .bgroup-head h2 { font-size: 20px; }
.bgroup-head .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.bgroup-total { margin-left: auto; font-weight: 800; font-size: 15px; color: var(--muted); }
.bgroup.income .bgroup-total { color: var(--teal); }

.rows { display: grid; gap: 8px; }
.brow { display: grid; grid-template-columns: minmax(0, 1fr) 128px 128px 34px; gap: 8px; align-items: center; }
.brow input, .brow select { font-size: 16px; padding-top: 10px; padding-bottom: 10px; }
.brow input.b-label { padding-left: 12px; font-weight: 600; }
.brow select { padding-left: 12px; font-weight: 600; font-size: 15px; }
.b-remove { width: 34px; height: 34px; border-radius: 50%; border: none; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.b-remove:hover { background: var(--coral-soft); color: #B3261E; }
@media (max-width: 560px) {
  .brow { grid-template-columns: 1fr 1fr 34px; row-gap: 6px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
  .brow .b-label { grid-column: 1 / -1; }
}
.add-row { margin-top: 10px; background: none; border: 1.5px dashed var(--line); border-radius: var(--radius-sm); padding: 9px 14px; width: 100%; font: inherit; font-size: 15px; font-weight: 700; color: var(--teal); cursor: pointer; text-align: left; }
.add-row:hover { border-color: var(--teal); background: var(--mint-soft); }

.headline-figure.neg { color: #C2412D; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .headline-figure.neg { color: var(--coral); } }

.diagnosis { margin-top: 22px; border-radius: var(--radius-md); padding: 16px 18px; background: var(--mint-soft); border-left: 5px solid var(--teal); }
.diagnosis .dx-label { font-size: 12.5px; font-weight: 700; color: var(--muted); display: block; margin-bottom: 2px; }
.diagnosis strong { font-family: var(--display); font-size: 22px; letter-spacing: -0.02em; display: block; }
.diagnosis p { margin: 4px 0 0; font-size: 15px; }
.diagnosis.stable { background: var(--mint-soft); border-color: var(--pension); }
.diagnosis.tight { background: var(--yellow-soft); border-color: var(--yellow); }
.diagnosis.over { background: var(--coral-soft); border-color: var(--coral); }
.diagnosis.empty { background: var(--field); border-color: var(--line); }

.mini-h { font-size: 17px; margin: 28px 0 0; font-weight: 700; }
.cat-legend { grid-template-columns: 1fr; gap: 8px; }
.cat-legend .pc { margin-left: auto; color: var(--muted); font-size: 14px; }
.cat-legend .v { margin-left: 14px; min-width: 76px; text-align: right; }

.rule { display: grid; gap: 14px; margin-top: 4px; }
.rule-top { display: flex; justify-content: space-between; font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.rule-top em { font-style: normal; color: var(--muted); font-weight: 500; font-size: 13.5px; margin-left: 4px; }
.rule-bar { height: 10px; border-radius: 999px; background: var(--field); position: relative; overflow: visible; }
.rule-bar span { display: block; height: 100%; border-radius: 999px; transition: width .4s cubic-bezier(.2,.8,.2,1); }
.rule-bar span.ok { background: var(--teal); }
.rule-bar span.warn { background: var(--coral); }
.rule-bar i { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 2px; }
@media (prefers-reduced-motion: reduce) { .rule-bar span { transition: none; } }
.tool-grid { grid-template-columns: 1.3fr 1fr 1fr; }
@media (max-width: 1000px) { .tool-grid { grid-template-columns: 1fr 1fr; } .tool-grid .tool.primary { grid-column: 1 / -1; } }
@media (max-width: 640px) { .tool-grid { grid-template-columns: 1fr; } }
.btn-inline { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; padding: 14px 18px; border-radius: var(--radius-md); background: var(--teal-deep); color: #fff; font-weight: 800; text-decoration: none; transition: filter .15s; }
.btn-inline:hover { filter: brightness(1.15); }
.btn-inline svg { flex: none; transition: transform .2s; }
.btn-inline:hover svg { transform: translateX(4px); }
@media (max-width: 420px) { .site-nav { gap: 0; } .site-nav a { padding: 8px 7px; } }
.budget-calc { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
@media (max-width: 980px) { .budget-calc { grid-template-columns: 1fr; } }
.budget-calc .brow { grid-template-columns: minmax(0, 1fr) 120px 128px 34px; }
@media (max-width: 560px) { .budget-calc .brow { grid-template-columns: 1fr 1fr 34px; } }
.export .export-label { width: 100%; margin-right: 0; }
.export .dl { flex: 1; justify-content: center; }
.toolbar-links { display: flex; gap: 14px; margin-left: auto; }

/* ---------- Weekly food shop ---------- */
.fs-block { padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px dashed var(--line); }
.fs-block:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.fs-block .form-title { margin-bottom: 14px; }
.steppers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 460px) { .steppers { grid-template-columns: 1fr; } }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--field); border-radius: var(--radius-md); padding: 10px 10px 10px 14px; }
.stepper b { display: block; font-size: 15px; }
.stepper span { font-size: 13px; color: var(--muted); }
.step-ctl { display: flex; align-items: center; gap: 4px; }
.step-ctl button { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--surface); color: var(--teal); font-size: 20px; font-weight: 700; cursor: pointer; box-shadow: 0 1px 2px rgba(19,35,63,.1); line-height: 1; }
.step-ctl button:hover { background: var(--teal); color: var(--on-teal); }
.step-ctl output { min-width: 26px; text-align: center; font-family: var(--display); font-weight: 800; font-size: 22px; }

.slider-field { display: grid; grid-template-columns: 1fr auto; align-items: baseline; margin-bottom: 18px; }
.slider-field:last-child { margin-bottom: 0; }
.slider-field label { font-weight: 700; font-size: 15px; }
.slider-field output { font-weight: 800; color: var(--teal); font-size: 15px; }
.slider-field input[type="range"] { grid-column: 1 / -1; margin-top: 8px; }
.slider-field .hint { grid-column: 1 / -1; margin-top: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: var(--field); border: 1.5px solid transparent; cursor: pointer; font-weight: 600; font-size: 15px; transition: background-color .15s, border-color .15s; user-select: none; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:hover { border-color: var(--line); }
.chip:has(input:checked) { background: var(--teal); color: var(--on-teal); }
.chip:has(input:focus-visible) { outline: 3px solid var(--yellow); outline-offset: 2px; }
.chip em { font-style: normal; font-size: 12.5px; font-weight: 700; background: rgba(255,255,255,.2); padding: 2px 8px; border-radius: 999px; }
.chip em:empty { display: none; }

.glance { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.tile { background: var(--field); border-radius: var(--radius-md); padding: 14px 14px 12px; position: relative; }
.tile i { position: absolute; top: 16px; right: 14px; width: 10px; height: 10px; border-radius: 50%; }
.tile .t-name { display: block; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.tile b { display: block; font-family: var(--display); font-size: 28px; font-weight: 800; letter-spacing: -0.03em; margin: 2px 0; }
.tile .t-sub { display: block; font-size: 13px; color: var(--muted); line-height: 1.35; }
#explain { margin-top: 18px; }

.list-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 10px; }
.list-head h2 { font-size: 24px; margin: 0 0 4px; font-weight: 800; }
.list-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
table.shop { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
table.shop th, table.shop td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.shop th:last-child, table.shop td:last-child { text-align: right; }
table.shop thead th { background: var(--teal-deep); color: #fff; font-size: 13px; font-weight: 700; }
table.shop tr.grp td { background: var(--mint-soft); font-weight: 800; font-family: var(--display); font-size: 16px; }
table.shop tr.grp i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 10px; vertical-align: 1px; }
table.shop td.muted { color: var(--muted); font-size: 14px; }
table.shop .price { width: 108px; display: inline-block; }
table.shop .price input { font-size: 15px; padding: 7px 10px 7px 26px; }
table.shop .price::before { left: 11px; }
table.shop .per { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
table.shop tfoot td { font-weight: 800; font-size: 18px; border-bottom: none; border-top: 2px solid var(--ink); background: var(--yellow-soft); }
@media (max-width: 560px) { table.shop .hide-sm { display: none; } }

.tips-h { font-size: 22px; margin: 36px 0 18px; font-weight: 800; }
.tips li { border-top-color: var(--yellow); }

/* Header dropdown */
.nav-drop { position: relative; }
.nav-drop-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; font-size: 15px; color: var(--muted); background: none; border: none; padding: 9px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.nav-drop-btn:hover, .nav-drop.open .nav-drop-btn { color: var(--ink); background: var(--field); }
.nav-drop-btn.is-current { color: var(--teal); background: var(--mint-soft); }
.nav-drop-btn svg { transition: transform .2s; }
.nav-drop.open .nav-drop-btn svg { transform: rotate(180deg); }
.nav-menu { position: absolute; top: calc(100% + 8px); left: 50%; transform: translate(-50%, -4px); min-width: 250px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 8px; opacity: 0; visibility: hidden; transition: opacity .15s, transform .15s, visibility .15s; z-index: 20; }
.nav-drop.open .nav-menu { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.site-nav .nav-menu a { display: block; padding: 10px 12px; border-radius: 10px; white-space: normal; color: var(--ink); background: none; }
.site-nav .nav-menu a b { display: block; font-weight: 700; font-size: 15px; }
.site-nav .nav-menu a span { display: block; font-weight: 500; font-size: 13px; color: var(--muted); margin-top: 1px; }
.site-nav .nav-menu a:hover, .site-nav .nav-menu a:focus-visible { background: var(--mint-soft); }
.site-nav .nav-menu a[aria-current="page"] { background: var(--mint-soft); }
.site-nav .nav-menu a[aria-current="page"] b { color: var(--teal); }
@media (prefers-reduced-motion: reduce) { .nav-menu, .nav-drop-btn svg { transition: none; } }
@media (max-width: 600px) {
  .nav-drop-btn { padding: 8px 10px; font-size: 14px; }
  .nav-menu { left: auto; right: -60px; transform: translateY(-4px); }
  .nav-drop.open .nav-menu { transform: translateY(0); }
}
@media (max-width: 420px) { .nav-drop-btn { padding: 8px 7px; } }

/* Homepage: four tools in two rows */
.tool-grid { grid-template-columns: 1fr 1fr; }
@media (max-width: 1000px) { .tool-grid .tool.primary { grid-column: auto; } }
@media (max-width: 640px) { .tool-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .site-head .wrap { gap: 8px; }
  .logo { gap: 8px; flex: none; }
  .logo-word { white-space: normal; font-size: 16px; line-height: 1.05; width: 76px; }
  .site-nav { gap: 0; }
  .nav-menu { left: auto; right: -8px; min-width: 230px; }
}
@media (max-width: 360px) { .logo img { width: 36px; height: 36px; } .site-nav a, .nav-drop-btn { font-size: 13.5px; padding: 8px 6px; } }

/* Per-meal choices */
.meals { display: grid; gap: 12px; }
.meal { background: var(--field); border-radius: var(--radius-md); padding: 16px 16px 18px; }
.meal-head { display: flex; align-items: baseline; justify-content: space-between; }
.meal-head h3 { margin: 0; font-size: 18px; font-weight: 700; }
.meal-head output { font-weight: 800; color: var(--teal); font-size: 15px; }
.meal input[type="range"] { margin-top: 8px; }
.meal .hint { margin-top: 2px; }
.meal-picks { transition: opacity .2s; }
.meal-picks.off { opacity: .4; pointer-events: none; }
.meal-sub { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 14px 0 8px; }
.meal .chip { background: var(--surface); }
.meal .chip:has(input:checked) { background: var(--teal); }

/* Meal counts and splits */
.meal-head { align-items: center; gap: 12px; }
.meal-sub-h { display: block; font-size: 13.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.split { margin-top: 10px; }
.split:empty { display: none; }
.split-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.split-head .link-btn { font-size: 13px; }
.split-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0 5px 12px; border-left: 3px solid var(--mint); font-weight: 600; font-size: 15px; }
.step-ctl.sm button { width: 30px; height: 30px; font-size: 18px; }
.step-ctl.sm output { font-size: 18px; min-width: 22px; }
.step-ctl button:disabled { opacity: .35; cursor: not-allowed; background: var(--surface); color: var(--teal); }

/* ---------- Food pyramid ---------- */
.fs-calc { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
@media (max-width: 980px) { .fs-calc { grid-template-columns: 1fr; } }
.build-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; }
.pyramid { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 6px 0 10px; }
.band { position: relative; height: 62px; border: none; padding: 0; cursor: pointer; font: inherit; color: #13233F; overflow: hidden;
  background: color-mix(in srgb, var(--c) 22%, var(--surface)); transition: filter .15s, transform .15s; }
.band:hover { filter: brightness(1.04) saturate(1.1); }
.band-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--c); transition: width .45s cubic-bezier(.2,.8,.2,1); }
.band-text { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; line-height: 1.15; }
.band-text b { font-family: var(--display); font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.band-text em { font-style: normal; font-size: 12.5px; font-weight: 700; opacity: .8; }
.band.sel { box-shadow: none; filter: none; }
.band.sel .band-text b::before { content: "▸ "; }
.band.sel .band-text b::after { content: " ◂"; }
.band:not(.sel) { opacity: .92; }
.band:focus-visible { outline: none; filter: brightness(.92); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .band { color: #13233F; background: color-mix(in srgb, var(--c) 35%, #E8EEF5); } }
@media (prefers-reduced-motion: reduce) { .band-fill { transition: none; } }
@media (max-width: 520px) { .band { height: 56px; } .band-text b { font-size: 14px; } .band-text em { font-size: 11.5px; } }
#band-treats .band-text b { font-size: 13px; }

.extras-btn { display: block; margin: 4px auto 0; background: var(--field); border: 1.5px dashed var(--line); border-radius: 999px; padding: 8px 16px; font: inherit; font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; }
.extras-btn:hover, .extras-btn.sel { border-color: #13233F; color: var(--ink); border-style: solid; }

.level-panel { margin-top: 18px; background: var(--field); border-radius: var(--radius-md); padding: 18px; }
.lp-head { display: flex; align-items: center; gap: 10px; }
.lp-head h3 { margin: 0; font-size: 20px; font-weight: 800; }
.lp-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); }
.lp-guide { margin: 10px 0 8px; font-size: 15px; }
.lp-bar { background: var(--surface); }
.lp-tip { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.foods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
@media (max-width: 640px) { .foods { grid-template-columns: 1fr; } }
.food { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface); border-radius: 12px; padding: 10px 10px 10px 14px; border: 1.5px solid transparent; transition: border-color .15s; }
.food.on { border-color: var(--teal); }
.food-name b { display: block; font-size: 15px; line-height: 1.25; }
.food-name span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.food .step-ctl button { background: var(--field); box-shadow: none; }
.food .step-ctl button:hover:not(:disabled) { background: var(--teal); color: var(--on-teal); }
.food .step-ctl output { font-size: 19px; min-width: 24px; }
.diagnosis.healthy { border-color: var(--teal); }
.band-text { padding: 0 8px; }
.band-text b, .band-text em { background: rgba(255,255,255,.82); color: #13233F; padding: 0 8px; }
.band-text b { border-radius: 8px 8px 0 0; padding-top: 2px; }
.band-text em { border-radius: 0 0 8px 8px; padding-bottom: 2px; opacity: 1; color: #3E4C5E; }
.band.sel .band-text b, .band.sel .band-text em { background: #fff; }
.build-head { margin-bottom: 12px; }
.build-head .form-title { margin-bottom: 0; }
.diet-field { margin: 16px 0 0; }
.diet-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; background: var(--yellow-soft); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-size: 14.5px; }
.diet-note p { margin: 0; font-weight: 600; }
.extras { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.extras .extras-btn { margin: 0; display: inline-flex; align-items: center; gap: 8px; border-style: solid; border-color: transparent; background: var(--field); color: var(--ink); }
.extras .extras-btn i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.extras .extras-btn:hover { border-color: var(--line); }
.extras .extras-btn.sel { border-color: var(--c); background: var(--surface); }
.extras .xc { background: var(--teal); color: var(--on-teal); font-size: 12px; font-weight: 800; border-radius: 999px; padding: 1px 7px; }

/* ---------- Recipe ideas ---------- */
.recipes-panel { margin-top: -40px; }
.recipe-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 6px 0 18px; }
.rc-steppers { grid-template-columns: repeat(3, minmax(170px, 1fr)); flex: 1; }
@media (max-width: 700px) { .rc-steppers { grid-template-columns: 1fr; } }
.rc-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.rc-actions .dl { padding: 13px 22px; }
.rs { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; background: var(--mint-soft); border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; }
.rs-line { margin: 0; font-size: 15px; }
.recipes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.recipe { background: var(--field); border-radius: var(--radius-md); padding: 18px; display: flex; flex-direction: column; }
.r-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.r-meal { font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--teal); color: var(--on-teal); }
.r-meal.r-lunch { background: var(--yellow); color: #13233F; }
.r-meal.r-breakfast { background: var(--coral); color: #13233F; }
.r-time { color: var(--muted); font-weight: 600; }
.recipe h3 { font-size: 20px; margin: 10px 0 10px; font-weight: 800; line-height: 1.15; }
.r-ing { list-style: none; margin: 0; padding: 0; font-size: 14.5px; }
.r-ing li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); align-items: center; }
.r-ing li span { font-weight: 600; }
.r-ing li.have span::before { content: "✓"; color: var(--teal); font-weight: 800; margin-right: 8px; }
.r-ing li.miss span::before { content: "!"; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--yellow); color: #13233F; font-size: 11px; font-weight: 800; margin-right: 8px; }
.r-ing em { font-style: normal; color: var(--muted); font-size: 13px; text-align: right; }
.r-add { background: var(--yellow-soft); border: 1.5px solid var(--yellow); border-radius: 999px; font: inherit; font-size: 12.5px; font-weight: 800; padding: 4px 10px; cursor: pointer; color: #13233F; white-space: nowrap; }
.r-add:hover { background: var(--yellow); }
.r-note { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); }
.r-method { margin-top: auto; padding-top: 12px; }
.r-method summary { cursor: pointer; font-weight: 800; color: var(--teal); font-size: 14.5px; }
.r-method ol { margin: 10px 0 0; padding-left: 20px; font-size: 14.5px; }
.r-method li { margin-bottom: 6px; }
.r-top { position: relative; }
.r-time { margin-left: auto; }
.r-remove { flex: none; width: 30px; height: 30px; margin: -4px -6px -4px 4px; border: none; border-radius: 50%; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.r-remove:hover { background: var(--coral-soft); color: #B3261E; }
.rs-actions { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.r-mine { font-size: 12px; font-weight: 800; color: var(--teal); background: var(--surface); border: 1.5px solid var(--teal); border-radius: 999px; padding: 2px 8px; }
.browse { margin: 0 0 16px; border: 1.5px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.browse > summary { cursor: pointer; padding: 14px 18px; font-family: var(--display); font-weight: 700; font-size: 17px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.browse > summary::-webkit-details-marker { display: none; }
.browse > summary::after { content: "+"; width: 28px; height: 28px; border-radius: 50%; background: var(--mint-soft); color: var(--teal); display: grid; place-items: center; font-family: var(--font); font-weight: 700; }
.browse[open] > summary::after { content: "−"; }
.browse-body { padding: 0 18px 18px; }
.browse-tabs { max-width: 420px; }
.browse-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; max-height: 460px; overflow: auto; padding-right: 4px; }
.b-row { display: flex; align-items: center; gap: 10px; background: var(--field); border-radius: 12px; padding: 10px 10px 10px 14px; }
.b-name { flex: 1; min-width: 0; }
.b-name b { display: block; font-size: 15px; line-height: 1.25; }
.b-name span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.b-name em { font-style: normal; font-weight: 700; }
.b-ok { color: var(--teal); }
.b-miss { color: #9A5B00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .b-miss { color: var(--yellow); } }
.b-in { font-size: 12px; font-weight: 800; color: var(--teal); white-space: nowrap; }
.b-add { flex: none; background: var(--teal); color: var(--on-teal); border: none; border-radius: 999px; font: inherit; font-size: 13.5px; font-weight: 800; padding: 7px 14px; cursor: pointer; }
.b-add:hover { filter: brightness(1.1); }

/* Make sure the hidden attribute always wins over display rules */
[hidden] { display: none !important; }
.r-times { display: inline-block; font-size: 15px; font-weight: 800; color: var(--on-teal); background: var(--teal); border-radius: 999px; padding: 1px 9px; vertical-align: 3px; margin-left: 4px; }
.r-count { display: flex; justify-content: space-between; align-items: center; background: var(--surface); border-radius: 10px; padding: 6px 8px 6px 12px; margin: 0 0 10px; font-size: 14px; font-weight: 700; }
.r-count .step-ctl button { background: var(--field); box-shadow: none; }
.r-total { margin: -2px 0 8px; }
.b-add:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.r-amt { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.r-ing li.part span:first-child::before { content: "!"; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--yellow); color: #13233F; font-size: 11px; font-weight: 800; margin-right: 8px; }
.r-ing li .r-amt span::before, .r-ing li .r-amt::before { content: none; }
.r-ing li.have .r-amt::before, .r-ing li.part .r-amt::before, .r-ing li.miss .r-amt::before { content: none; display: none; }
.rc-actions .dl:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; }
.rb { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; border-radius: 12px; padding: 12px 14px 12px 16px; margin: -6px 0 16px; background: var(--yellow-soft); font-size: 14.5px; }
.rb > div { flex: 1; min-width: 240px; }
.rb strong { margin-right: 4px; }
.rb .dl { padding: 10px 18px; font-size: 14.5px; }
.rb.ok { background: var(--field); }
.rb.done { background: var(--mint-soft); }

/* ---------- Tips and links pages ---------- */
.tips-main { padding: 0 20px 64px; margin-top: -56px; position: relative; }
.tip-jump { display: flex; flex-wrap: wrap; gap: 8px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: var(--radius-lg); padding: 14px; margin-bottom: 28px; }
.tip-jump a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 15px; padding: 8px 14px; border-radius: 999px; background: var(--field); }
.tip-jump a::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.tip-jump a:hover { background: var(--mint-soft); }
.tip-section { margin: 0 0 40px; scroll-margin-top: 20px; }
.tip-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.tip-head h2 { font-size: clamp(24px, 3vw, 32px); margin: 0; font-weight: 800; }
.tip-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--c); flex: none; }
.tip-grid, .link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tip { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: var(--radius-md); padding: 18px 20px; display: flex; flex-direction: column; }
.tip h3 { font-size: 18px; margin: 0 0 6px; font-weight: 700; line-height: 1.25; }
.tip p { margin: 0; color: var(--muted); font-size: 15.5px; }
.tip-try { margin-top: auto; padding-top: 12px; font-weight: 800; font-size: 14.5px; color: var(--teal); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.tip-try::after { content: "→"; transition: transform .2s; }
.tip-try:hover::after { transform: translateX(3px); }
.tip-try[target="_blank"]::after { content: "↗"; }
.tips-note { color: var(--muted); font-size: 14px; max-width: 80ch; border-top: 1px dashed var(--line); padding-top: 16px; }
.link-intro { margin: -6px 0 14px; color: var(--muted); max-width: 75ch; }
.link-card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--radius-md); padding: 16px 18px; transition: transform .15s, box-shadow .15s; }
.link-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.link-card b { font-size: 17px; display: flex; justify-content: space-between; gap: 8px; }
.link-card b::after { content: "↗"; color: var(--teal); font-weight: 800; }
.link-card.internal b::after { content: "→"; }
.link-card span { color: var(--muted); font-size: 15px; }
.link-card em { font-style: normal; font-size: 13px; font-weight: 700; color: var(--teal); margin-top: 4px; }
.link-card.internal { background: var(--mint-soft); }
.more-help a { background: var(--surface); border: 1.5px solid var(--teal); border-radius: 999px; padding: 6px 14px; color: var(--teal); font-weight: 700; text-decoration: none; }
.more-help a:hover { background: var(--mint-soft); }
@media (max-width: 520px) { .tips-main { padding: 0 16px 48px; } .tip-grid, .link-grid { grid-template-columns: 1fr; } }

/* ---------- Use up my fridge ---------- */
.fridge-calc { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
@media (max-width: 980px) { .fridge-calc { grid-template-columns: 1fr; } }
.search input { padding-left: 42px; background-image: radial-gradient(circle at 18px 21px, transparent 6px, var(--muted) 6.5px, var(--muted) 8px, transparent 8.5px), linear-gradient(45deg, transparent 47%, var(--muted) 47%, var(--muted) 57%, transparent 57%); background-size: 100% 100%, 8px 8px; background-position: 0 0, 23px 27px; background-repeat: no-repeat; }
.pick-group { margin-top: 16px; }
.pick-group .meal-sub { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.pg-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; }
.count-pill { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--teal); color: var(--on-teal); font-family: var(--font); font-size: 14px; font-weight: 800; vertical-align: 3px; margin-left: 6px; }
.have-list { display: grid; gap: 8px; }
.have-row { display: flex; align-items: center; gap: 10px; background: var(--field); border-radius: 12px; padding: 8px 8px 8px 14px; font-weight: 600; border: 1.5px solid transparent; }
.have-row span { flex: 1; }
.have-row.soon { border-color: var(--coral); background: var(--coral-soft); }
.soon-btn { border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; font: inherit; font-size: 13px; font-weight: 700; padding: 5px 12px; cursor: pointer; }
.soon-btn[aria-pressed="true"] { background: var(--coral); border-color: var(--coral); color: #13233F; }
.meal-filter { margin-bottom: 16px; }
.fr-sum { margin: 0 0 14px; font-size: 15.5px; }
.fr-empty { display: flex; gap: 14px; align-items: center; background: var(--field); border-radius: var(--radius-md); padding: 16px; }
.fr-empty img { width: 64px; height: 64px; flex: none; }
.fr-empty p { margin: 0; font-size: 15px; }
.fr-list { display: grid; gap: 12px; }
.fr-recipe .r-top { gap: 6px; flex-wrap: wrap; }
.fr-recipe.has-soon { box-shadow: inset 4px 0 0 var(--coral); }
.fr-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 10px; }
.fr-badge { font-size: 12.5px; font-weight: 800; border-radius: 999px; padding: 3px 10px; background: var(--yellow-soft); color: #7A4F00; }
.fr-badge.uses { background: var(--mint-soft); color: var(--teal-deep); }
.fr-badge.ok { background: var(--teal); color: var(--on-teal); }
.fr-badge.soon { background: var(--coral-soft); color: #9A2F1E; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fr-badge { color: var(--ink); } :root:not([data-theme="light"]) .fr-badge.ok { color: var(--on-teal); } }
.soon-tag { font-style: normal; font-size: 11.5px; font-weight: 800; color: #9A2F1E; background: var(--coral-soft); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.r-ing .alt { font-style: normal; font-weight: 500; color: var(--muted); font-size: 13px; }
.r-add:disabled { background: var(--mint-soft); border-color: var(--teal); color: var(--teal-deep); cursor: default; }
#more { margin-top: 14px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #13233F; color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); font-size: 15px; z-index: 50; max-width: calc(100% - 32px); }
.toast a { color: var(--yellow); font-weight: 800; margin-left: 6px; }
.search input { padding-left: 14px; background-image: none; }

/* ---------- Budget menu: sections ---------- */
.nav-menu .nav-sec + .nav-sec { margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--line); }
.nav-sec-label { display: block; padding: 8px 12px 4px; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); }
.site-nav .nav-menu a { padding: 8px 12px; }
@media (min-width: 760px) {
  .nav-menu { display: grid; grid-template-columns: 1fr 1fr; column-gap: 6px; min-width: 520px; left: auto; right: -120px; transform: translateY(-4px); }
  .nav-drop.open .nav-menu { transform: translateY(0); }
  .nav-menu .nav-sec:first-child { grid-row: span 2; }
  .nav-menu .nav-sec + .nav-sec { margin-top: 0; padding-top: 0; border-top: none; }
  .nav-menu .nav-sec:nth-child(3) { margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--line); }
}
@media (max-width: 759px) { .nav-menu { max-height: calc(100vh - 90px); overflow-y: auto; } }

/* ---------- Debt payoff planner ---------- */
.calc.wide-left { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
@media (max-width: 880px) { .calc.wide-left { grid-template-columns: 1fr; } }
.drows { display: grid; gap: 8px; margin-bottom: 12px; }
.drow { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.15fr) minmax(0, .85fr) minmax(0, 1fr) 34px; gap: 6px; align-items: center; }
.drow input[type="number"], .drow input[type="text"] { font-size: 16px; padding-top: 10px; padding-bottom: 10px; }
.drow .money.pct input { padding-right: 26px; }
.drow .money.pct::after { right: 10px; }
.drow .money::before { left: 11px; }
.drow .money:not(.pct) input { padding-left: 24px; }
.drow-head { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.drow-head span { padding-left: 2px; }
.b-remove { width: 34px; height: 34px; border-radius: 50%; border: none; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.b-remove:hover { background: var(--coral-soft); color: #B4483A; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 22px; }
.dlab { display: none; }
@media (max-width: 560px) {
  .drow-head { display: none; }
  .drows { gap: 10px; }
  .drow { grid-template-columns: 1fr 1fr 1fr 34px; grid-template-areas: "n n n x" "b a m m"; background: var(--field); border-radius: 14px; padding: 10px; row-gap: 8px; }
  .drow > :nth-child(1) { grid-area: n; } .drow > :nth-child(2) { grid-area: b; } .drow > :nth-child(3) { grid-area: a; } .drow > :nth-child(4) { grid-area: m; } .drow > :nth-child(5) { grid-area: x; }
  .drow input[type="number"], .drow input[type="text"] { background: var(--surface); }
  .dlab { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 3px 2px; }
  .drow > .dcell:first-child .dlab { display: none; }
}
ol.payoff { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
ol.payoff li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--field); border-radius: 12px; }
ol.payoff li b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ol.payoff li em { font-style: normal; color: var(--muted); font-size: 14px; white-space: nowrap; }
.po-dot { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; }
.milestones .po-dot { width: 42px; border-radius: 999px; font-size: 12px; color: #0F3F3C; }
ol.payoff li.po-stuck { background: var(--coral-soft); color: var(--ink); }
.paid { color: var(--teal); font-weight: 700; }
.table-scroll { overflow-x: auto; }

/* ---------- Savings goal ---------- */
.goal-chips { margin-top: 10px; }
.goal-chip { font-size: 13.5px; padding: 6px 12px; }
.goal-chip:hover { border-color: var(--mint); }
.goal-bar { height: 12px; border-radius: 999px; background: var(--field); overflow: hidden; margin-top: 20px; }
.goal-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), #4DB89C); border-radius: inherit; transition: width .3s; }
.goal-bar-label { margin: 8px 0 0; font-size: 14px; color: var(--muted); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .goal-bar span { transition: none; } }
input[type="date"] { width: 100%; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); background: var(--field); border: 1.5px solid transparent; border-radius: var(--radius-sm); padding: 10px 14px; }
input[type="date"]:focus { border-color: var(--teal); background-color: var(--surface); outline: none; box-shadow: 0 0 0 4px var(--mint-soft); }
.ch-controls { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: end; margin-top: 8px; }
@media (max-width: 680px) { .ch-controls { grid-template-columns: 1fr; } }
.ch-desc { color: var(--muted); margin: 14px 0 0; }
.ch-progress .goal-bar { margin-top: 12px; }
.ch-progress p { margin: 8px 0 0; font-size: 15px; }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-top: 18px; }
.ch-cell { position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 10px 10px 10px 12px; border-radius: 12px; background: var(--field); border: 1.5px solid transparent; cursor: pointer; transition: background-color .15s, border-color .15s; }
.ch-cell:hover { border-color: var(--mint); }
.ch-cell input { grid-row: span 3; width: 18px; height: 18px; accent-color: var(--teal); margin: 0; }
.ch-cell .ch-w { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ch-cell b { font-family: var(--display); font-size: 19px; line-height: 1.15; }
.ch-cell em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.ch-cell.on { background: var(--mint-soft); border-color: var(--teal); }
.ch-cell.on b { color: var(--teal); }
.ch-cell:has(input:focus-visible) { outline: 3px solid var(--yellow); }
.ch-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 20px; }
@media (max-width: 420px) { .ch-grid { grid-template-columns: 1fr 1fr; } }
input[type="text"] { padding-left: 14px; }
.milestones .po-dot { width: 54px; }
table.compare th, table.compare td { white-space: nowrap; }
table.compare td:first-child { white-space: normal; min-width: 140px; }

/* ---------- Savings: easier date picking and more options ---------- */
.when-chips { margin-bottom: 10px; gap: 6px; }
.when-chip { font-size: 13.5px; padding: 6px 12px; }
.when-chip:hover { border-color: var(--mint); }
.when-chip[aria-pressed="true"] { background: var(--teal); color: #fff; border-color: var(--teal); }
.when-chip:focus-visible, .goal-chip:focus-visible { outline: 3px solid var(--yellow); outline-offset: 1px; }
.when { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 8px; }
.when.three { grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr) minmax(0, 1fr); }
.when select { font-size: 16px; padding-top: 11px; padding-bottom: 11px; }
.seg-four label { font-size: 14px; padding: 9px 4px; }
@media (max-width: 420px) { .seg-four { flex-wrap: wrap; } .seg-four label { flex: 1 1 40%; } }
.mode .seg label { font-size: 14.5px; }
.more-opts { border: 1.5px solid var(--line); border-radius: var(--radius-md); padding: 0 16px; }
.more-opts[open] { padding-bottom: 18px; }
.more-opts summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 14px 26px 14px 0; position: relative; }
.more-opts summary::-webkit-details-marker { display: none; }
.more-opts summary::after { content: ""; position: absolute; right: 4px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--teal); border-bottom: 2px solid var(--teal); transform: translateY(-70%) rotate(45deg); transition: transform .2s; }
.more-opts[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.more-opts summary b { font-size: 15.5px; }
.more-opts summary span { font-size: 13.5px; color: var(--muted); }
.more-opts summary:focus-visible { outline: 3px solid var(--yellow); border-radius: 8px; }
.more-opts .field:last-child { margin-bottom: 0; }
.xrows { display: grid; gap: 8px; }
.xrow { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, .9fr) minmax(0, .95fr) 34px; gap: 6px; align-items: center; }
.xrow input[type="text"], .xrow input[type="number"], .xrow select { font-size: 15px; padding-top: 10px; padding-bottom: 10px; }
.xrow .money input { padding-left: 24px; }
.xrow .money::before { left: 11px; }
.xrow select { padding-left: 10px; padding-right: 26px; background-position: calc(100% - 15px) 50%, calc(100% - 9px) 50%; }
@media (max-width: 560px) {
  .xrow { grid-template-columns: 1fr 1fr 34px; grid-template-areas: "l l x" "a a a" "m y y"; background: var(--field); border-radius: 14px; padding: 10px; }
  .xrow > :nth-child(1) { grid-area: l; } .xrow > :nth-child(2) { grid-area: a; } .xrow > :nth-child(3) { grid-area: m; } .xrow > :nth-child(4) { grid-area: y; } .xrow > :nth-child(5) { grid-area: x; }
  .xrow input[type="text"], .xrow input[type="number"], .xrow select { background-color: var(--surface); }
}
.ch-controls { align-items: start; }

/* ---------- Footer links and next steps ---------- */
.foot-nav { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 8px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.12); }
.foot-nav b { display: block; color: #fff; font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.foot-nav a { display: block; color: rgba(255,255,255,.78); text-decoration: none; padding: 4px 0; font-size: 14.5px; }
.foot-nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.foot-nav a[aria-current="page"] { color: var(--mint); }
.foot-nav a:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; border-radius: 4px; }
@media (max-width: 760px) { .foot-nav { grid-template-columns: 1fr 1fr; } }
.next-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.next-links a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--mint-soft); color: var(--teal); font-weight: 700; font-size: 14.5px; text-decoration: none; }
.next-links a::after { content: "→"; }
.next-links a:hover { background: var(--teal); color: #fff; }

/* Shown only when this stylesheet fails to load (e.g. a page opened from inside the zip) */
#unzip-note { display: none !important; }

/* ---------- Short menu labels on phones (e.g. "Take-home pay" -> "Pay") ---------- */
.show-xs { display: none; }
@media (max-width: 600px) { .show-xs { display: inline; } }

/* ---------- Written pages and blog posts ---------- */
.prose-wrap { margin-top: -64px; position: relative; padding-bottom: 72px; }
.prose { max-width: 760px; padding: 36px 40px; font-size: 17.5px; line-height: 1.7; }
@media (max-width: 600px) { .prose { padding: 24px 20px; font-size: 17px; } }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 26px; line-height: 1.2; margin: 36px 0 12px; font-weight: 800; }
.prose h3 { font-size: 20px; margin: 28px 0 8px; font-weight: 700; }
.prose p, .prose ul, .prose ol, .prose table, .prose blockquote { margin: 0 0 18px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--teal); font-weight: 600; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose strong { color: var(--ink); }
.prose img { max-width: 100%; height: auto; border-radius: 14px; }
.prose blockquote { border-left: 4px solid var(--yellow); background: var(--yellow-soft); padding: 14px 18px; border-radius: 0 12px 12px 0; color: var(--ink); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15.5px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.prose th { background: var(--teal-deep); color: #fff; font-weight: 700; }
.prose th:first-child { border-radius: 8px 0 0 0; } .prose th:last-child { border-radius: 0 8px 0 0; }
.prose hr { border: none; border-top: 1px dashed var(--line); margin: 28px 0; }
.prose em:only-child { color: var(--muted); font-size: 15px; }
.prose code { background: var(--field); padding: 2px 6px; border-radius: 6px; font-size: .9em; }

/* Blog post */
.post-head .year-tag { background: var(--c, var(--yellow)); }
.post-head h1 { max-width: 22ch; }
.back-link { display: table; margin-bottom: 16px; font-weight: 700; font-size: 14.5px; color: var(--teal); text-decoration: none; }
.back-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.post-meta { margin-top: 14px !important; font-size: 15px !important; font-weight: 600; }
.post-layout { display: grid; grid-template-columns: minmax(0, 760px) minmax(0, 300px); gap: 28px; align-items: start; }
@media (max-width: 1000px) { .post-layout { grid-template-columns: 1fr; } }
.post-hero { display: block; width: 100%; margin: 0 0 24px; }
.post-side { display: grid; gap: 18px; position: sticky; top: 20px; }
@media (max-width: 1000px) { .post-side { position: static; } }
.side-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }
.side-box h2 { font-size: 16px; text-transform: uppercase; letter-spacing: .06em; color: var(--teal); margin: 0 0 10px; }
.side-tool, .side-post { display: block; padding: 10px 12px; margin: 0 -4px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.side-tool:hover, .side-post:hover { background: var(--mint-soft); }
.side-tool b, .side-post b { display: block; font-size: 15.5px; line-height: 1.3; }
.side-tool span, .side-post span { display: block; font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.side-all { display: inline-block; margin-top: 8px; font-weight: 700; font-size: 14.5px; color: var(--teal); text-decoration: none; }

/* Blog list and cards */
.blog-main { margin-top: -56px; position: relative; padding-bottom: 72px; }
.blog-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.blog-filter .chip { font: inherit; font-size: 14.5px; background: var(--surface); border: 1.5px solid var(--line); }
.blog-filter .chip[aria-pressed="true"] { background: var(--teal); color: #fff; border-color: var(--teal); }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.post-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.post-card:hover { transform: translateY(-3px); }
.post-card:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.post-card[hidden] { display: none !important; }
.post-card-band { display: block; height: 10px; background: var(--c, var(--teal)); }
.post-card-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 4px solid var(--c, var(--teal)); }
.post-card-body { display: flex; flex-direction: column; gap: 8px; padding: 20px 22px 22px; flex: 1; }
.post-cat { align-self: flex-start; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--c, var(--teal)); }
.post-card b { font-family: var(--display); font-size: 21px; line-height: 1.2; }
.post-card-desc { color: var(--muted); font-size: 15px; line-height: 1.5; flex: 1; }
.post-card-meta { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.blog-empty { text-align: center; }
@media (prefers-reduced-motion: reduce) { .post-card { transition: none; } .post-card:hover { transform: none; } }

/* Homepage: latest posts */
.home-blog { margin: 8px 0 56px; }
.home-blog-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.home-blog-head h2 { font-size: 30px; margin: 0; font-weight: 800; }
.home-blog-head a { font-weight: 700; color: var(--teal); text-decoration: none; }
.home-blog-head a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Newsletter sign-up band (appears when a form is added in Site settings) */
.newsletter { background: var(--teal-deep); color: #fff; }
.newsletter .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; padding-top: 40px; padding-bottom: 40px; }
@media (max-width: 760px) { .newsletter .wrap { grid-template-columns: 1fr; } }
.newsletter h2 { margin: 0 0 6px; font-size: 26px; }
.newsletter p { margin: 0; color: rgba(255,255,255,.8); }

/* Small phones: room for four items in the top bar */
@media (max-width: 420px) {
  .site-nav a, .nav-drop-btn { padding-left: 5px; padding-right: 5px; font-size: 14px; }
  .nav-drop-btn { gap: 3px; }
}
@media (max-width: 380px) {
  .site-head .logo img { width: 34px; height: 34px; }
  .site-head .logo { gap: 7px; }
  .logo-word { font-size: 15px; }
  .site-nav a, .nav-drop-btn { padding-left: 4px; padding-right: 4px; font-size: 13.5px; }
}
/* Tables in posts scroll sideways inside the post instead of widening the page */
@media (max-width: 1000px) { .post-layout { grid-template-columns: minmax(0, 1fr); } }
