/* BudgetHelp.ca
   Palette borrows the five Canadian banknote colours, one per kind of money flow:
   $5 blue = needs, $10 purple = wants, $20 green = future you, $50 red = shortfall, $100 gold = unassigned. */

:root {
  --paper: #F2F5F0;
  --paper-2: #E6ECE5;
  --card: #FFFFFF;
  --ink: #102A26;
  --ink-2: #415C56;
  --ink-3: #6A827C;
  --line: #D3DED7;
  --line-2: #B4C6BD;
  --spruce: #0D2F28;
  --spruce-2: #17463B;
  --spruce-ink: #E4EFE9;
  --mint: #DDF2E5;

  --needs: #2F6FDF;
  --wants: #7C4DDB;
  --future: #1F9D63;
  --short: #D9432F;
  --spare: #D99A1E;
  --spare-soft: #FBEFD2;
  --short-soft: #FBE3DF;
  --future-soft: #DDF2E5;

  --display: 'Archivo', 'Arial Black', system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible Next', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 9px;
  --shadow: 0 1px 0 rgba(16, 42, 38, .04), 0 18px 40px -24px rgba(13, 47, 40, .35);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  font-feature-settings: 'tnum' 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: var(--ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--needs); outline-offset: 2px; border-radius: 6px; }
::selection { background: #CFE3FF; }
.num, .money input, .tnum { font-variant-numeric: tabular-nums; }

h1, h2, h3, h4 { font-family: var(--display); color: var(--ink); margin: 0; font-weight: 800; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.5rem, 6.4vw, 5.25rem); line-height: .98; font-stretch: 118%; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); line-height: 1.04; font-stretch: 112%; letter-spacing: -0.025em; }
h3 { font-size: 1.3rem; line-height: 1.2; font-stretch: 106%; }
h4 { font-size: 1.05rem; line-height: 1.3; font-stretch: 100%; }
p { margin: 0 0 1em; }
small { font-size: .85em; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 760px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--spruce); color: #fff; padding: 10px 16px; border-radius: 10px; }
.skip:focus { top: 12px; }
.lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.5; color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--ink-2); }
.fine { font-size: .875rem; line-height: 1.5; color: var(--ink-3); }

/* ---------- Header ---------- */
.site-head { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-head.scrolled { border-bottom-color: var(--line); }
.head-row { display: flex; align-items: center; gap: 24px; height: 72px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.logo svg { width: 34px; height: 34px; flex-shrink: 0; }
.logo-word { font: 800 1.28rem/1 var(--display); font-stretch: 116%; letter-spacing: -0.03em; }
.logo-word span { color: var(--ink-3); font-weight: 600; font-stretch: 100%; letter-spacing: -0.01em; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .98rem; padding: 9px 12px; border-radius: 10px; }
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--paper-2); }
.nav .nav-cta { margin-left: 8px; color: var(--spruce); border: 1.5px solid var(--spruce); padding: 8px 16px; border-radius: 999px; }
.nav .nav-cta:hover, .nav .nav-cta[aria-current="page"] { background: var(--spruce); color: #fff; }
.menu-btn { display: none; margin-left: auto; background: none; border: 1.5px solid var(--line-2); border-radius: 12px; width: 46px; height: 46px; align-items: center; justify-content: center; color: var(--ink); cursor: pointer; }
.menu-btn svg { width: 22px; height: 22px; }
@media (max-width: 900px) {
  .menu-btn { display: inline-flex; }
  .nav { display: none; position: fixed; inset: 72px 0 auto 0; background: var(--paper); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 12px var(--gutter) 22px; gap: 2px; box-shadow: 0 30px 40px -30px rgba(13,47,40,.4); }
  .nav.open { display: flex; }
  .nav a { padding: 14px 12px; font-size: 1.1rem; }
  .nav .nav-cta { margin: 10px 0 0; text-align: center; }
}

/* ---------- Buttons & chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: 999px; border: 2px solid var(--spruce); background: var(--spruce); color: #fff; font: 700 1.02rem/1 var(--body); text-decoration: none; cursor: pointer; transition: transform .15s ease, background .15s; }
.btn:hover { background: var(--spruce-2); border-color: var(--spruce-2); }
.btn:active { transform: translateY(1px); }
.btn-line { background: transparent; color: var(--spruce); }
.btn-line:hover { background: var(--spruce); color: #fff; }
.btn-light { background: #fff; color: var(--spruce); border-color: #fff; }
.btn-light:hover { background: var(--mint); border-color: var(--mint); }
.btn-sm { min-height: 42px; padding: 0 18px; font-size: .95rem; }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink); font: 600 .9rem/1 var(--body); cursor: pointer; text-decoration: none; white-space: nowrap; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip svg { width: 16px; height: 16px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.field > label, .label { font-weight: 700; font-size: .95rem; }
.field .hint { font-size: .85rem; color: var(--ink-3); font-weight: 400; }
.input, .field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: var(--r-sm); background: var(--card); color: var(--ink); font: 400 1rem/1.3 var(--body);
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23102A26' stroke-width='2'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink-3); }
.field input:focus, .field select:focus, .field textarea:focus, .money input:focus { outline: none; border-color: var(--needs); box-shadow: 0 0 0 3px rgba(47,111,223,.22); }
.field [aria-invalid="true"] { border-color: var(--short); }
.err { color: var(--short); font-size: .88rem; font-weight: 600; min-height: 0; }
.err:empty { display: none; }
.money { position: relative; display: flex; align-items: center; }
.money > span { position: absolute; left: 12px; color: var(--ink-3); font-weight: 600; pointer-events: none; }
.money input { width: 100%; min-height: 44px; padding: 8px 10px 8px 26px; border: 1.5px solid var(--line-2); border-radius: var(--r-sm); background: var(--card); color: var(--ink); font: 600 1rem/1 var(--body); text-align: right; }
.money input::placeholder { color: #A9BAB3; font-weight: 400; }
.money.pct > span { left: auto; right: 12px; }
.money.pct input { padding: 8px 30px 8px 12px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: .95rem; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--spruce); flex-shrink: 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
input[type="range"] { width: 100%; accent-color: var(--spruce); height: 28px; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(64px, 9vw, 112px); }
.section-tight { padding-block: clamp(44px, 6vw, 72px); }
.section-head { max-width: 760px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 { margin-bottom: 14px; }
.band { background: var(--spruce); color: var(--spruce-ink); }
.band h2, .band h3 { color: #fff; }
.band a:not(.btn) { color: #fff; }
.band .muted, .band .fine { color: #A8C4B9; }
.band .ticket h2, .band .ticket h3 { color: var(--ink); }
.band .ticket .fine { color: var(--ink-3); }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* ---------- Hero / planner ---------- */
/* overflow: clip (not hidden) so the sticky chart and phone summary bar still stick. */
.hero { position: relative; padding-top: clamp(28px, 5vw, 64px); padding-bottom: clamp(48px, 6vw, 80px); overflow: hidden; overflow: clip; }
.hero::before { content: ""; position: absolute; right: -180px; top: -220px; width: 760px; height: 760px; background: url('/assets/guilloche.svg') center/contain no-repeat; opacity: .55; pointer-events: none; }
@media (max-width: 700px) {
  .hero::before { width: 520px; height: 520px; right: -300px; top: -240px; opacity: .4; }
  .pl-actions [data-act="print"] { display: none; }
}
.hero-head { position: relative; max-width: 900px; margin-bottom: clamp(26px, 4vw, 40px); }
.hero-title { margin-bottom: 18px; }
.hero-title { animation: widen 1.1s cubic-bezier(.2,.7,.2,1) both; }
@keyframes widen { from { font-stretch: 82%; opacity: 0; } 30% { opacity: 1; } to { font-stretch: 118%; } }
.hero-sub { font-size: clamp(1.1rem, 1.7vw, 1.32rem); line-height: 1.5; color: var(--ink-2); max-width: 60ch; margin: 0; }
.welcome { position: relative; display: none; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--card); border: 1.5px solid var(--line); border-left: 5px solid var(--spare); border-radius: var(--r-md); padding: 12px 16px; margin-bottom: 18px; font-size: .98rem; }
.welcome.show { display: flex; }
.welcome strong { font-weight: 700; }

.planner { position: relative; background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--r-xl); box-shadow: 8px 8px 0 var(--ink); }
.pl-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 22px; border-bottom: 1.5px solid var(--line); }
.pl-title { font-size: 1.15rem; font-stretch: 108%; letter-spacing: -0.01em; }
.pl-title span { color: var(--ink-3); font-weight: 600; font-stretch: 100%; }
.pl-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-grid { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; }
.pl-in-wrap { border-right: 1.5px solid var(--line); min-width: 0; }
.pl-in { padding: 18px 22px 24px; }
.pl-viz { padding: 18px 22px 24px; min-width: 0; }
.pl-viz-inner { position: sticky; top: 92px; }
.pl-mini { display: none; }
@media (max-width: 920px) {
  .pl-grid { grid-template-columns: 1fr; }
  .pl-viz { order: -1; border-bottom: 1.5px solid var(--line); }
  .pl-viz-inner { position: static; }
  .pl-in-wrap { border-right: 0; }
  .planner { box-shadow: 5px 5px 0 var(--ink); }
  .pl-mini { display: flex; position: sticky; bottom: 0; z-index: 5; justify-content: space-between; gap: 10px; padding: 12px 16px; background: var(--ink); color: #DCE8E2; font-size: .88rem; box-shadow: 0 -10px 24px -12px rgba(13,47,40,.4); }
  .pl-mini b { color: #fff; font-variant-numeric: tabular-nums; }
  .pl-mini .warn b { color: #F2BE4E; } .pl-mini .bad b { color: #FF8A78; } .pl-mini .good b { color: #6FE0A6; }
}
@media (max-width: 520px) {
  .pl-bar, .pl-in, .pl-viz { padding-inline: 14px; }
  .planner { border-radius: var(--r-lg); }
}

.pay { display: grid; gap: 10px; padding-bottom: 16px; margin-bottom: 8px; border-bottom: 1.5px dashed var(--line); }
.pay-line { display: grid; grid-template-columns: 1fr 150px; gap: 10px; align-items: center; }
.pay-line label { font-weight: 700; font-size: .95rem; line-height: 1.25; }
.pay-line label small { display: block; font-weight: 400; color: var(--ink-3); font-size: .82rem; }
.pay-freq { min-height: 44px; padding: 8px 34px 8px 12px; border: 1.5px solid var(--line-2); border-radius: var(--r-sm); background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23102A26' stroke-width='2'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center/16px; appearance: none; font: 600 .95rem/1 var(--body); color: var(--ink); width: 100%; }
.pay-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: .95rem; color: var(--ink-2); }
.pay-total strong { font: 800 1.35rem/1 var(--display); font-stretch: 110%; color: var(--ink); font-variant-numeric: tabular-nums; }

.grp { border-bottom: 1.5px solid var(--line); }
.grp:last-of-type { border-bottom: 0; }
.grp > summary { list-style: none; display: grid; grid-template-columns: 14px 1fr auto 18px; gap: 12px; align-items: center; padding: 14px 0; cursor: pointer; }
.grp > summary::-webkit-details-marker { display: none; }
.grp-sw { width: 14px; height: 30px; border-radius: 4px; background: var(--c); }
.grp-name { font: 800 1.08rem/1.15 var(--display); font-stretch: 106%; }
.grp-name small { display: block; font: 400 .82rem/1.3 var(--body); color: var(--ink-3); letter-spacing: 0; margin-top: 2px; }
.grp-sum { font: 800 1.08rem/1 var(--display); font-variant-numeric: tabular-nums; }
.grp-caret { width: 18px; height: 18px; transition: transform .2s; color: var(--ink-3); }
.grp[open] .grp-caret { transform: rotate(180deg); }
.grp-rows { display: grid; gap: 8px; padding: 0 0 16px 26px; }
.row { display: grid; grid-template-columns: 1fr 132px; gap: 10px; align-items: center; }
.row label { font-size: .95rem; line-height: 1.25; }
.row label small { display: block; color: var(--ink-3); font-size: .8rem; }
.row .money input { min-height: 42px; }
.row-custom { grid-template-columns: 1fr 132px 32px; }
.row-custom input[type="text"] { min-height: 42px; border: 1.5px dashed var(--line-2); border-radius: var(--r-sm); padding: 8px 10px; font: 400 .95rem/1.2 var(--body); color: var(--ink); background: var(--card); width: 100%; }
.row-del { width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.row-del:hover { background: var(--short-soft); color: var(--short); }
.add-line { justify-self: start; background: none; border: 0; padding: 6px 0; color: var(--ink-2); font: 600 .9rem/1 var(--body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.add-line:hover { color: var(--ink); }

/* River (Sankey) */
.river-wrap { position: relative; }
.river { display: block; width: 100%; height: auto; overflow: visible; }
.river .link { fill-opacity: .34; transition: fill-opacity .2s; }
.river .link.hot { fill-opacity: .68; }
.river .reveal { transform-origin: 0 0; animation: reveal 1.2s .1s cubic-bezier(.35,.6,.2,1) both; }
@keyframes reveal { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.river .drift { fill: none; stroke: #fff; stroke-linecap: round; stroke-opacity: .85; stroke-dasharray: 0.5 18; animation: drift 1.5s linear infinite; pointer-events: none; }
@keyframes drift { to { stroke-dashoffset: -18.5; } }
.river .node { rx: 3; }
.river text { font-family: var(--body); fill: var(--ink); paint-order: stroke; stroke: var(--card); stroke-width: 4px; stroke-linejoin: round; }
.river .t-name { font-size: 13px; font-weight: 700; }
.river .t-val { font-size: 12px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.river .t-big { font-family: var(--display); font-size: 15px; font-weight: 800; font-stretch: 108%; }
@media (prefers-reduced-motion: reduce) {
  .river .drift { display: none; }
  .river .reveal { animation: none; }
  .hero-title { animation: none; }
}
.river-empty { display: grid; place-items: center; text-align: center; min-height: 320px; color: var(--ink-3); border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); padding: 24px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 18px; border: 1.5px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.stat { padding: 14px 16px; border-right: 1.5px solid var(--line); min-width: 0; }
.stat:last-child { border-right: 0; }
.stat-k { font-size: .85rem; color: var(--ink-2); font-weight: 600; }
.stat-v { font: 800 clamp(1.4rem, 2.6vw, 2rem)/1.05 var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums; margin-top: 6px; white-space: nowrap; }
.stat-s { font-size: .82rem; color: var(--ink-3); margin-top: 4px; }
.stat.good .stat-v { color: var(--future); }
.stat.warn .stat-v { color: var(--spare); }
.stat.bad .stat-v { color: var(--short); }
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(3) { grid-column: 1 / -1; border-top: 1.5px solid var(--line); border-right: 0; }
}

.split { margin-top: 18px; }
.split-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.split-head h3 { font-size: 1.02rem; }
.split-row { display: grid; grid-template-columns: 92px 1fr 64px; gap: 12px; align-items: center; padding: 6px 0; font-size: .92rem; }
.split-row b { font-weight: 700; }
.split-track { position: relative; height: 12px; background: var(--paper-2); border-radius: 99px; }
.split-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--c); max-width: 100%; transition: width .35s ease; }
.split-mark { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--ink); border-radius: 2px; }
.split-mark::after { content: attr(data-t); position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: .7rem; color: var(--ink-3); white-space: nowrap; }
.split-pct { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.moves { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1.5px solid var(--line); }
.move { padding: 18px 22px 20px; border-right: 1.5px solid var(--line); }
.move:last-child { border-right: 0; }
.move h3 { font-size: 1rem; font-stretch: 104%; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.move h3 i { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--ink)); flex-shrink: 0; }
.move p { font-size: .94rem; color: var(--ink-2); margin: 0; }
.move a { font-weight: 700; }
@media (max-width: 920px) { .moves { grid-template-columns: 1fr; } .move { border-right: 0; border-bottom: 1.5px solid var(--line); } .move:last-child { border-bottom: 0; } }
.pl-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-top: 1.5px solid var(--line); background: var(--paper); border-radius: 0 0 var(--r-xl) var(--r-xl); font-size: .9rem; color: var(--ink-2); }
@media (max-width: 520px) { .pl-foot, .move { padding-inline: 14px; } .pl-foot { border-radius: 0 0 var(--r-lg) var(--r-lg); } }

/* Month strip */
.month { background: var(--spruce); color: var(--spruce-ink); }
.month-row { display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center; padding-block: 26px; }
.month-cal { display: grid; grid-template-columns: repeat(7, 9px); gap: 3px; }
.month-cal i { width: 9px; height: 9px; border-radius: 2px; background: rgba(255,255,255,.14); }
.month-cal i.past { background: rgba(255,255,255,.45); }
.month-cal i.today { background: var(--spare); }
.month-text h2 { font-size: clamp(1.3rem, 2.4vw, 1.75rem); color: #fff; margin-bottom: 4px; font-stretch: 108%; }
.month-text p { margin: 0; color: #A8C4B9; }
@media (max-width: 820px) { .month-row { grid-template-columns: 1fr; gap: 16px; } .month-cal { display: none; } }

/* ---------- Habits (psychology) ---------- */
.habits { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.habit { grid-column: span 4; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.habit h3 { font-size: 1.22rem; }
.habit p { margin: 0; color: var(--ink-2); }
.habit .why { font-size: .86rem; color: var(--ink-3); margin-top: auto; padding-top: 8px; }
.habit-wide { grid-column: span 8; grid-row: span 2; background: var(--spruce); border-color: var(--spruce); color: var(--spruce-ink); }
.habit-wide h3 { color: #fff; font-size: clamp(1.4rem, 2.4vw, 2rem); font-stretch: 112%; }
.habit-wide p { color: #BCD3CA; }
.habit-wide .why { color: #8FB0A4; }
.habit-art { height: 72px; display: flex; align-items: flex-end; }
.habit-art svg { height: 72px; width: auto; }
@media (max-width: 980px) { .habit, .habit-wide { grid-column: span 6; } .habit-wide { grid-row: auto; grid-column: 1 / -1; } }
@media (max-width: 640px) { .habit, .habit-wide { grid-column: 1 / -1; } }

.wait { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: end; margin-top: 8px; }
.wait-controls { display: grid; gap: 14px; }
.wait-controls label { font-weight: 700; color: #fff; font-size: .95rem; display: flex; justify-content: space-between; gap: 10px; }
.wait-controls output { font-variant-numeric: tabular-nums; color: var(--spare); }
.wait input[type="range"] { accent-color: var(--spare); }
.wait .money input { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.25); color: #fff; }
.wait .money > span { color: #A8C4B9; }
.wait-out { font: 800 clamp(2rem, 4.4vw, 3.4rem)/1 var(--display); font-stretch: 118%; color: var(--spare); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.wait-cap { color: #BCD3CA; font-size: .95rem; margin-top: 8px; }
.wait-chart { grid-column: 1 / -1; }
.wait-chart svg { width: 100%; height: auto; display: block; }
@media (max-width: 640px) { .wait { grid-template-columns: 1fr; } }

/* ---------- Tool directory ---------- */
.tool-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 40px; border-top: 1.5px solid var(--ink); }
.tool-link { display: grid; grid-template-columns: 52px 1fr 24px; gap: 18px; align-items: center; padding: 20px 4px; border-bottom: 1.5px solid var(--line); text-decoration: none; color: var(--ink); }
.tool-link:hover { background: var(--card); }
.tool-link:hover .tool-arrow { transform: translateX(4px); color: var(--ink); }
.tool-ico { width: 52px; height: 52px; border-radius: 14px; background: var(--c-soft, var(--paper-2)); display: grid; place-items: center; color: var(--c, var(--ink)); }
.tool-ico svg { width: 28px; height: 28px; }
.tool-link h3 { font-size: 1.12rem; margin-bottom: 3px; }
.tool-link p { margin: 0; font-size: .93rem; color: var(--ink-2); line-height: 1.4; }
.tool-arrow { width: 22px; height: 22px; color: var(--ink-3); transition: transform .15s; }
@media (max-width: 760px) { .tool-list { grid-template-columns: 1fr; } }

/* ---------- Accounts (referrals) ---------- */
.accounts { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
@media (max-width: 900px) { .accounts { grid-template-columns: 1fr; } }
.fee-box { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 20px; margin-top: 22px; }
.fee-box .pay-line { grid-template-columns: 1fr 130px; }
.fee-out { font: 800 2.2rem/1 var(--display); font-stretch: 116%; color: var(--short); font-variant-numeric: tabular-nums; margin-top: 14px; }
.acct { display: grid; grid-template-columns: 1fr auto; gap: 8px 18px; align-items: center; padding: 18px 0; border-bottom: 1.5px solid var(--line); }
.acct:first-of-type { border-top: 1.5px solid var(--ink); }
.acct h3 { font-size: 1.1rem; }
.acct p { grid-column: 1; margin: 0; font-size: .93rem; color: var(--ink-2); }
.acct .btn { grid-row: 1 / span 2; grid-column: 2; }
.tag { display: inline-flex; align-items: center; gap: 6px; font: 700 .78rem/1 var(--body); padding: 5px 9px; border-radius: 99px; background: var(--paper-2); color: var(--ink-2); vertical-align: 2px; margin-left: 6px; }
.bonus { display: flex; gap: 12px; align-items: flex-start; background: var(--spare-soft); border-radius: var(--r-md); padding: 14px 16px; margin-top: 18px; font-size: .93rem; }
.bonus svg { width: 22px; height: 22px; flex-shrink: 0; color: #9A6A0A; margin-top: 1px; }
@media (max-width: 520px) { .acct { grid-template-columns: 1fr; } .acct .btn { grid-row: auto; grid-column: 1; justify-self: start; } }

/* ---------- Coaching ---------- */
.coach { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
@media (max-width: 900px) { .coach { grid-template-columns: 1fr; } }
.ticket { position: relative; background: var(--card); color: var(--ink); border-radius: var(--r-lg); padding: 26px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.5); }
/* Ticket notches sit on the dashed tear line, whatever height the top grows to. */
.ticket-top { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 6px 16px; padding-bottom: 22px; border-bottom: 2px dashed var(--line-2); margin-bottom: 18px; }
.ticket-top::before, .ticket-top::after { content: ""; position: absolute; bottom: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--notch, var(--paper)); }
.ticket-top::before { left: -39px; } .ticket-top::after { right: -39px; }
.band .ticket { --notch: var(--spruce); }
.ticket-price { font: 800 2.6rem/1 var(--display); font-stretch: 116%; letter-spacing: -0.02em; }
.ticket-price small { font: 600 .9rem/1 var(--body); color: var(--ink-3); letter-spacing: 0; margin-left: 4px; }
.ticket h3 { font-size: 1.15rem; margin-bottom: 4px; }
.ticket ul { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 10px; }
.ticket li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: .97rem; }
.ticket li svg { width: 20px; height: 20px; color: var(--future); margin-top: 2px; }
.ticket .btn { width: 100%; }
.ticket .fine { margin: 12px 0 0; text-align: center; }

/* ---------- Content pages ---------- */
.page-head { padding-top: clamp(36px, 6vw, 72px); padding-bottom: clamp(24px, 4vw, 40px); position: relative; overflow: hidden; }
.page-head h1 { font-size: clamp(2.3rem, 5.2vw, 4.2rem); margin-bottom: 16px; max-width: 18ch; }
.page-head .lede { margin: 0; }
.crumbs { font-size: .88rem; color: var(--ink-3); margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--ink-2); }
.crumbs span[aria-hidden] { color: var(--line-2); }

.prose { max-width: 70ch; font-size: 1.08rem; line-height: 1.7; }
.prose h2 { font-size: clamp(1.6rem, 2.8vw, 2.1rem); margin: 2em 0 .55em; }
.prose h3 { font-size: 1.25rem; margin: 1.7em 0 .5em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--ink-3); }
.prose strong { font-weight: 700; }
.prose table { width: 100%; border-collapse: collapse; font-size: .98rem; margin: 0 0 1.4em; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1.5px solid var(--line); vertical-align: top; }
.prose th { font-weight: 700; background: var(--paper-2); }
.table-scroll { overflow-x: auto; }
.callout { background: var(--card); border: 1.5px solid var(--line); border-left: 5px solid var(--c, var(--future)); border-radius: var(--r-md); padding: 16px 18px; margin: 1.4em 0; font-size: 1rem; }
.callout p:last-child { margin-bottom: 0; }
.steps { counter-reset: s; list-style: none; padding: 0 !important; }
.steps > li { counter-increment: s; position: relative; padding-left: 52px; margin-bottom: 1.3em; }
.steps > li > h2:first-child { margin: 0 0 .45em; font-size: clamp(1.35rem, 2.3vw, 1.65rem); padding-top: 2px; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; font: 800 1rem/36px var(--display); text-align: center; }

.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(32px, 5vw, 72px); align-items: start; }
.aside { position: sticky; top: 96px; display: grid; gap: 16px; }
.aside-box { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.aside-box h2 { font-size: 1.1rem; margin-bottom: 10px; }
.aside-box ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: .95rem; }
@media (max-width: 960px) { .article-grid { grid-template-columns: 1fr; } .aside { position: static; } }

/* ---------- Tool pages ---------- */
.tool { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--r-xl); box-shadow: 6px 6px 0 var(--ink); }
.tool-in { padding: 24px; border-right: 1.5px solid var(--line); display: grid; gap: 16px; align-content: start; }
.tool-out { padding: 24px; min-width: 0; }
@media (max-width: 880px) { .tool { grid-template-columns: 1fr; box-shadow: 4px 4px 0 var(--ink); } .tool-in { border-right: 0; border-bottom: 1.5px solid var(--line); } }
@media (max-width: 520px) { .tool-in, .tool-out { padding: 18px 14px; } .tool { border-radius: var(--r-lg); } }
.tool-in .pay-line { grid-template-columns: 1fr 140px; }
.from-plan { font-size: .85rem; color: var(--ink-2); background: var(--future-soft); border-radius: 10px; padding: 8px 12px; display: none; }
.from-plan.show { display: block; }
.big-result { font: 800 clamp(2.2rem, 5vw, 3.6rem)/1 var(--display); font-stretch: 116%; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.big-result.good { color: var(--future); } .big-result.bad { color: var(--short); } .big-result.warn { color: var(--spare); }
.result-cap { color: var(--ink-2); margin: 8px 0 0; font-size: 1.02rem; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border: 1.5px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-top: 20px; }
.kv div { padding: 12px 14px; border-right: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); margin: 0 -1.5px -1.5px 0; }
.kv dt { font-size: .82rem; color: var(--ink-2); font-weight: 600; }
.kv dd { margin: 4px 0 0; font: 800 1.25rem/1.1 var(--display); font-variant-numeric: tabular-nums; }
.chart { margin-top: 22px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font: 12px var(--body); fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .85rem; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--c); margin-right: 6px; vertical-align: -1px; }
.segbar { display: flex; height: 18px; border-radius: 99px; overflow: hidden; background: var(--paper-2); margin-top: 18px; }
.segbar span { background: var(--c); transition: width .35s; }
.debts { display: grid; gap: 12px; }
.debt { border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 12px; display: grid; gap: 8px; }
.debt-top { display: grid; grid-template-columns: 1fr 32px; gap: 8px; }
.debt-top input { min-height: 40px; border: 1.5px solid var(--line-2); border-radius: var(--r-sm); padding: 6px 10px; font: 600 .95rem/1 var(--body); color: var(--ink); width: 100%; }
.debt-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.debt-nums label { font-size: .78rem; color: var(--ink-2); font-weight: 600; display: grid; gap: 4px; }
.debt-nums .money input { min-height: 40px; font-size: .95rem; padding-left: 22px; }
.debt-nums .money > span { left: 9px; }
.debt-nums .money.pct input { padding: 8px 24px 8px 8px; }
.debt-nums .money.pct > span { left: auto; right: 9px; }
.order { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 0; border-top: 1.5px solid var(--line); }
.order li { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; padding: 10px 0; border-bottom: 1.5px solid var(--line); align-items: center; font-size: .95rem; }
.order li b { width: 26px; height: 26px; border-radius: 50%; background: var(--paper-2); display: grid; place-items: center; font-size: .82rem; }
.subs { display: grid; gap: 6px; }
.sub { display: grid; grid-template-columns: 24px 1fr 112px; gap: 10px; align-items: center; padding: 6px 0; }
.sub input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--spruce); }
.sub label { font-size: .95rem; line-height: 1.25; }
.sub label small { display: block; color: var(--ink-3); font-size: .8rem; }
.sub .money input { min-height: 38px; font-size: .95rem; }

.related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 32px; border-top: 1.5px solid var(--ink); }
@media (max-width: 860px) { .related { grid-template-columns: 1fr; } }

/* FAQ */
.faq { border-top: 1.5px solid var(--ink); max-width: 860px; }
.faq details { border-bottom: 1.5px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 18px; padding: 20px 0; font: 800 1.12rem/1.3 var(--display); font-stretch: 104%; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.6rem/1 var(--body); color: var(--ink-3); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-a { padding: 0 0 20px; color: var(--ink-2); max-width: 68ch; }
.faq .faq-a p:last-child { margin: 0; }

/* Ask / forms */
.form-card { background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--r-xl); padding: clamp(20px, 4vw, 36px); box-shadow: 6px 6px 0 var(--ink); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .form-card { box-shadow: 4px 4px 0 var(--ink); } }
.form-status { display: none; border-radius: var(--r-md); padding: 16px 18px; margin-top: 16px; font-weight: 600; }
.form-status.ok { display: block; background: var(--future-soft); color: #0E5A37; }
.form-status.bad { display: block; background: var(--short-soft); color: #8A2216; }
.done { text-align: left; }
.done h2 { margin-bottom: 10px; }

/* Check-in */
.ci-grid { display: grid; grid-template-columns: minmax(280px, 400px) 1fr; gap: clamp(20px, 3vw, 36px); align-items: start; }
@media (max-width: 900px) { .ci-grid { grid-template-columns: 1fr; } }
.streak { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.streak-n { font: 800 3.4rem/1 var(--display); font-stretch: 118%; color: var(--future); }
.dots { display: flex; gap: 6px; flex-wrap: wrap; }
.dots i { width: 16px; height: 16px; border-radius: 4px; background: var(--paper-2); }
.dots i.on { background: var(--future); }
.hist { width: 100%; border-collapse: collapse; font-size: .95rem; margin-top: 12px; }
.hist th, .hist td { text-align: right; padding: 10px 8px; border-bottom: 1.5px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hist th:first-child, .hist td:first-child { text-align: left; }
.hist th { font-size: .82rem; color: var(--ink-2); font-weight: 700; }
.list-check { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }

/* Footer */
.site-foot { background: var(--spruce); color: #BCD3CA; padding: clamp(48px, 7vw, 80px) 0 32px; margin-top: 0; }
.site-foot a { color: #E4EFE9; text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; }
.foot-grid h2 { font-size: .98rem; color: #fff; font-stretch: 104%; margin-bottom: 12px; letter-spacing: 0; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: .95rem; }
.foot-brand .logo { color: #fff; }
.foot-brand .logo-word span { color: #8FB0A4; }
.foot-brand p { font-size: .95rem; margin: 14px 0 0; max-width: 34ch; }
.foot-legal { border-top: 1px solid rgba(255,255,255,.14); margin-top: 40px; padding-top: 22px; font-size: .84rem; line-height: 1.6; color: #8FB0A4; display: grid; gap: 10px; }
.foot-legal p { margin: 0; max-width: 110ch; }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }

/* Ask band */
.ask-band { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-xl); padding: clamp(22px, 4vw, 36px); }
.ask-band h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 6px; }
.ask-band p { margin: 0; color: var(--ink-2); }
@media (max-width: 720px) { .ask-band { grid-template-columns: 1fr; } }

.guide-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.guide-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); padding: 22px; border-radius: var(--r-lg); background: var(--card); border: 1.5px solid var(--line); }
.guide-card:hover { border-color: var(--ink); }
.guide-card h3 { font-size: 1.15rem; }
.guide-card p { margin: 0; font-size: .94rem; color: var(--ink-2); }
.guide-card .meta { font-size: .82rem; color: var(--ink-3); margin-top: auto; padding-top: 6px; }
.guide-card .bar { height: 6px; width: 54px; border-radius: 9px; background: var(--c); }
@media (max-width: 900px) { .guide-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .guide-list { grid-template-columns: 1fr; } }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 140%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: .95rem; z-index: 90; transition: transform .25s ease; max-width: calc(100% - 32px); }
.toast.show { transform: translate(-50%, 0); }

.reminder { display: flex; flex-wrap: wrap; gap: 10px; }
.stack { display: grid; gap: 16px; }

@media print {
  .site-head, .site-foot, .pl-actions, .month, .no-print, .skip, .toast { display: none !important; }
  body { background: #fff; }
  .planner, .tool { box-shadow: none; border-color: #999; }
  .hero::before { display: none; }
  .pl-viz-inner { position: static; }
  details.grp > .grp-rows { display: grid !important; }
}
