@font-face{font-family:"Figtree";font-style:normal;font-display:swap;font-weight:300 900;src:url(fonts/figtree-latin-wght-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
/* Calm by design: one accent colour (breeze green) for actions, progress and "paid";
   one attention colour for text that needs a look; everything else is ink on quiet greys. */
:root {
  --field: #e7eae6;
  --bg: #edf0ec;
  --surface: #ffffff;
  --soft: #e6e9e5;
  --ink: #101714;
  --ink-2: #2a3430;
  --muted: #4b5651;
  --line: #d2d8d2;
  --brand: #0b6b5c;
  --brand-ink: #ffffff;
  --brand-soft: #d3eae3;
  --brand-2: #5fa496;
  --brand-3: #b5d6ce;
  /* Kind tints are neutral on purpose: one accent colour, everything else greys. */
  --mint: var(--soft);
  --mint-ink: var(--ink-2);
  --lilac: var(--soft);
  --lilac-ink: var(--ink-2);
  --sky: var(--soft);
  --sky-ink: var(--ink-2);
  --sun: var(--soft);
  --sun-ink: var(--ink-2);
  /* One attention colour, used for text and icons only. */
  --good: #0b6b5c;
  --warn: #9a3d12;
  --adjust: #9a3d12;
  --shadow: 0 1px 2px rgba(20, 30, 26, 0.08);
  --scrim: rgba(14, 20, 18, 0.4);

  --font-display: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --field: #0a0d0c;
    --bg: #0b0e0d;
    --surface: #1c2321;
    --soft: #262e2b;
    --ink: #f3f6f4;
    --ink-2: #d6ddd9;
    --muted: #aeb8b3;
    --line: #3a4441;
    --brand: #5fd0b8;
    --brand-ink: #062720;
    --brand-soft: #1e3d35;
    --brand-2: #3a8577;
    --brand-3: #2a5a51;
    --mint: var(--soft);
    --mint-ink: var(--ink-2);
    --lilac: var(--soft);
    --lilac-ink: var(--ink-2);
    --sky: var(--soft);
    --sky-ink: var(--ink-2);
    --sun: var(--soft);
    --sun-ink: var(--ink-2);
    --good: #5fd0b8;
    --warn: #ffa77c;
    --adjust: #ffa77c;
    --shadow: none;
    --scrim: rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --field: #0a0d0c;
  --bg: #0b0e0d;
  --surface: #1c2321;
  --soft: #262e2b;
  --ink: #f3f6f4;
  --ink-2: #d6ddd9;
  --muted: #aeb8b3;
  --line: #3a4441;
  --brand: #5fd0b8;
  --brand-ink: #062720;
  --brand-soft: #1e3d35;
  --brand-2: #3a8577;
  --brand-3: #2a5a51;
  --mint: var(--soft);
  --mint-ink: var(--ink-2);
  --lilac: var(--soft);
  --lilac-ink: var(--ink-2);
  --sky: var(--soft);
  --sky-ink: var(--ink-2);
  --sun: var(--soft);
  --sun-ink: var(--ink-2);
  --good: #5fd0b8;
  --warn: #ffa77c;
  --adjust: #ffa77c;
  --shadow: none;
  --scrim: rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--field);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { min-height: 100%; display: flex; flex-direction: column; }
.shell {
  flex: 1;
  width: 100%;
  max-width: 440px;
  align-self: center;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}
@media (min-width: 520px) {
  .shell { box-shadow: 0 0 0 1px var(--line); }
}
.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-block: 16px 24px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- Type ---------- */
.wordmark { font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: -0.01em; color: var(--brand); display: flex; align-items: center; gap: 8px; }
.wordmark svg { width: 26px; height: 26px; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 28px; line-height: 1.15; }
h2 { font-size: 21px; line-height: 1.2; }
h3 { font-size: 17px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.eyebrow { font-size: 13px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  min-height: 52px;
  border-radius: 999px;
  border: 0;
  padding: 0 22px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, background 0.2s ease, opacity 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-soft { background: var(--brand-soft); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--brand); min-height: 44px; padding: 0 12px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 12px; }
.btn-row > .btn { flex: 1; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 999px; border: 0; background: transparent;
  display: inline-grid; place-items: center; color: var(--ink);
}
.icon-btn:hover { background: var(--brand-soft); }
.icon-btn svg, .btn svg { width: 22px; height: 22px; }
svg.i { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Setup ---------- */
.setup-top { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.progress { flex: 1; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: inherit; transition: width 0.35s ease; }
.question { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.setup-body { display: flex; flex-direction: column; gap: 12px; }
.setup-foot { margin-top: auto; padding-top: 8px; display: flex; flex-direction: column; gap: 8px; }

.choices { display: grid; gap: 10px; }
.choice {
  min-height: 64px; border-radius: var(--r-md); border: 2px solid var(--line); background: var(--surface);
  text-align: left; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.choice strong { font-weight: 650; }
.choice[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.choice .tick { width: 26px; height: 26px; border-radius: 999px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.choice[aria-pressed="true"] .tick { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.choice .tick svg { width: 16px; height: 16px; }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile {
  border-radius: var(--r-md); border: 2px solid var(--line); background: var(--surface);
  min-height: 96px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-weight: 600; font-size: 15px; line-height: 1.2; text-align: center; position: relative;
}
.tile .ico { width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; background: var(--mint); color: var(--mint-ink); }
.tile .ico svg { width: 24px; height: 24px; }
.tile.debt .ico { background: var(--lilac); color: var(--lilac-ink); }
.tile.save .ico { background: var(--sky); color: var(--sky-ink); }
.tile[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.tile[aria-pressed="true"]::after {
  content: ""; position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 999px; background: var(--brand);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1a11 11 0 1 0 0 22 11 11 0 0 0 0-22zm-1.6 15.6L6 12.2l1.6-1.6 2.8 2.8 6-6 1.6 1.6z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1a11 11 0 1 0 0 22 11 11 0 0 0 0-22zm-1.6 15.6L6 12.2l1.6-1.6 2.8 2.8 6-6 1.6 1.6z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-weight: 650; font-size: 15px; }
.field .hint { font-size: 14px; color: var(--muted); }
.input {
  min-height: 52px; border-radius: var(--r-sm); border: 2px solid var(--line); background: var(--surface);
  padding: 0 14px; width: 100%; font-size: 18px;
}
.input:focus { border-color: var(--brand); outline: none; }
.money-wrap { position: relative; }
.money-wrap > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-weight: 650; color: var(--muted); pointer-events: none; }
.money-wrap > .input { padding-left: 30px; }
.suffix-wrap { position: relative; }
.suffix-wrap > span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-weight: 650; color: var(--muted); pointer-events: none; }
.big-money { font-size: 34px; font-weight: 650; min-height: 72px; padding-left: 40px; font-variant-numeric: tabular-nums; }
.money-wrap.big > span { font-size: 30px; }
.row-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; }
.row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.detail-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.detail-head { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.badge-ico { width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; flex: none; }
.badge-ico svg { width: 20px; height: 20px; }
.k-bill { background: var(--mint); color: var(--mint-ink); }
.k-debt { background: var(--lilac); color: var(--lilac-ink); }
.k-save { background: var(--sky); color: var(--sky-ink); }
.k-sun { background: var(--sun); color: var(--sun-ink); }

.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.preset { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); font-weight: 650; }
.preset[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }

.note {
  border-radius: var(--r-md); background: var(--sky); color: var(--ink); padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 15px;
}
.note svg { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--sky-ink); }

/* Welcome */
.welcome { justify-content: space-between; text-align: left; }
.hero-art { border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); padding: 18px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.mess { display: flex; flex-wrap: wrap; gap: 6px; }
.mess span { padding: 6px 10px; border-radius: 999px; font-weight: 650; font-size: 14px; background: var(--lilac); color: var(--lilac-ink); }
.mess span:nth-child(2n) { background: var(--mint); color: var(--mint-ink); transform: rotate(-3deg); }
.mess span:nth-child(3n) { background: var(--sky); color: var(--sky-ink); transform: rotate(4deg); }
.arrow-down { color: var(--muted); align-self: center; }
.arrow-down svg { width: 22px; height: 22px; }
.mini-line { display: flex; flex-direction: column; gap: 6px; }
.mini-line div { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 12px; font-weight: 650; font-size: 15px; }
.mini-line div:nth-child(1) { background: var(--mint); }
.mini-line div:nth-child(2) { background: var(--lilac); }
.mini-line div:nth-child(3) { background: var(--sky); }
.mini-line b { font-family: var(--font-display); font-weight: 600; color: var(--muted); margin-right: 8px; }

/* ---------- App header ---------- */
.app-top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.example-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--sun); color: var(--ink);
  border-radius: var(--r-md); padding: 8px 8px 8px 14px; font-size: 15px; font-weight: 600;
}
.example-banner .btn-ghost { color: var(--ink); text-decoration: underline; font-weight: 650; white-space: nowrap; flex: none; }

.payday {
  background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--line); padding: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px;
}
.payday .when { display: flex; align-items: center; gap: 2px; margin-left: -12px; }
.payday .when > div { display: flex; flex-direction: column; min-width: 0; }
.payday .when .eyebrow { font-size: 12px; }
.payday .when h2 { font-size: 19px; white-space: nowrap; }
.payday .when .icon-btn:disabled { opacity: 0.3; cursor: default; background: none; }
.payday .amount { font-family: var(--font-display); font-weight: 600; font-size: 36px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.payday .sub { font-size: 15px; color: var(--muted); }
.payday .edit-pay { border: 0; background: none; padding: 0; text-decoration: underline; text-underline-offset: 3px; color: var(--muted); font-size: 15px; font-weight: 600; min-height: 44px; text-align: left; }
.ring { width: 92px; height: 92px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: var(--line); }
.ring .val { stroke: var(--brand); stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-weight: 650; font-size: 13px; line-height: 1.1; color: var(--muted); }
.ring .lbl b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--ink); }
.ring .lbl b svg { width: 26px; height: 26px; fill: none; stroke: var(--good); stroke-width: 3; }

.next {
  border-radius: var(--r-lg); background: var(--brand); color: var(--brand-ink); padding: 16px; display: flex; align-items: center; gap: 12px;
}
.next .badge-ico { background: rgba(255, 255, 255, 0.2); color: inherit; }
.next p { font-size: 15px; }
.next strong { font-family: var(--font-display); font-weight: 600; font-size: 19px; display: block; }
.next .btn { margin-left: auto; background: var(--brand-ink); color: var(--brand); min-height: 44px; padding: 0 16px; flex: none; }

.alert {
  border-radius: var(--r-lg); border: 2px solid var(--adjust); background: var(--surface); padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.alert .head { display: flex; gap: 10px; align-items: flex-start; }
.alert .head svg { width: 24px; height: 24px; color: var(--adjust); flex: none; }
.alert .fixes { display: flex; flex-direction: column; gap: 8px; }
.alert .fix { text-align: left; min-height: 48px; border-radius: var(--r-sm); border: 2px solid var(--line); background: var(--bg); padding: 10px 12px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.alert .fix:hover { border-color: var(--brand); }
.alert .fix svg { width: 18px; height: 18px; color: var(--brand); flex: none; }

.spend-card {
  border-radius: var(--r-lg); background: var(--sun); padding: 14px; display: flex; flex-direction: column; gap: 12px;
}
.spend-card .head { display: flex; gap: 10px; align-items: flex-start; }
.spend-card .badge-ico { background: var(--surface); }
.spend-card .preset { background: var(--surface); border-color: transparent; }
.spend-card .btn-ghost { align-self: flex-start; color: var(--ink); text-decoration: underline; padding: 0; min-height: 44px; }
.tile.sun .ico { background: var(--sun); color: var(--sun-ink); }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }

/* ---------- Pockets (the lineup) ---------- */
.lineup { display: flex; flex-direction: column; gap: 10px; list-style: none; margin: 0; padding: 0; }
.pocket {
  --tint: var(--mint); --tint-ink: var(--mint-ink);
  position: relative; overflow: hidden; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line);
  display: grid; grid-template-columns: 44px 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 12px 18px 10px;
}
.pocket.debt { --tint: var(--lilac); --tint-ink: var(--lilac-ink); }
.pocket.save { --tint: var(--sky); --tint-ink: var(--sky-ink); }
.pocket.sun { --tint: var(--sun); --tint-ink: var(--sun-ink); }
.pocket .pos { font-family: var(--font-display); font-weight: 600; color: var(--ink); font-size: 18px; line-height: 1; }
.pocket .badge-ico { background: var(--tint); color: var(--tint-ink); position: relative; width: 40px; height: 40px; }
.pocket .body { min-width: 0; position: relative; }
.pocket .name { font-weight: 650; overflow-wrap: anywhere; }
.pocket .meta { font-size: 14px; color: var(--muted); }
.pocket .right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; position: relative; }
.pocket .amt { font-weight: 650; font-size: 19px; font-variant-numeric: tabular-nums; }
.pocket .fill { position: absolute; left: 0; bottom: 0; height: 6px; width: 100%; background: var(--line); display: flex; }
.pocket .fill > span { flex: none; height: 100%; background: var(--tint-ink); opacity: 0.6; transition: width 0.5s ease; }
.pocket .fill > .planned { opacity: 0.25; }
.pocket .meta strong { color: var(--ink); font-weight: 650; }

/* Where the paycheck goes */
.split { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px; }
.split-bar { display: flex; gap: 3px; height: 14px; border-radius: 999px; overflow: hidden; background: var(--line); }
.split-bar span { flex: none; height: 100%; }
.seg-bills { background: var(--mint-ink); }
.seg-debts { background: var(--lilac-ink); }
.seg-savings { background: var(--sky-ink); }
.seg-hold { background: repeating-linear-gradient(45deg, var(--sky-ink) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--sky-ink); }
.seg-yours { background: var(--sun-ink); }
.legend { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.legend > div { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 15px; min-width: 0; }
.legend dt { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; min-width: 0; }
.legend dd { margin: 0; font-weight: 650; }
.legend > div:not(.yours) { padding: 0 10px; }
.legend .yours { background: var(--sun); border-radius: var(--r-sm); padding: 8px 10px; font-size: 17px; margin-top: 4px; }
.legend .yours dt { color: var(--ink); font-weight: 650; }
.dot { width: 10px; height: 10px; border-radius: 999px; flex: none; display: inline-block; }
.link { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; display: inline-flex; align-items: center; }
.goal-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 6px 0 2px; }
.goal-bar > span { display: block; height: 100%; background: var(--sky-ink); border-radius: inherit; }
.pocket .water { position: absolute; inset: 0; background: var(--tint); transform-origin: left; transform: scaleX(0); transition: transform 0.6s cubic-bezier(.2, .8, .2, 1); }
.pocket.done .water { transform: scaleX(1); }
.pocket.done { border-color: transparent; }
.pocket .done-btn {
  width: 44px; height: 44px; border-radius: 999px; border: 2px solid var(--tint-ink); background: var(--surface); display: grid; place-items: center; color: var(--muted);
  position: relative;
}
.pocket .done-btn:hover { background: var(--tint); }
.pocket .done-btn svg { width: 22px; height: 22px; }
.pocket.done .done-btn { background: var(--good); border-color: var(--good); color: var(--surface); }
.pocket .tap { position: absolute; inset: 0; border: 0; background: transparent; z-index: 0; }
.pocket > *:not(.water):not(.fill):not(.tap) { z-index: 1; }
.pocket .done-btn { z-index: 2; }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 650; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.chip svg { width: 14px; height: 14px; }
.chip.good { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.chip.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.chip.adjust { color: var(--adjust); background: color-mix(in srgb, var(--adjust) 14%, transparent); }
.chip.info { color: var(--muted); background: var(--bg); }

.period-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.period-nav .btn-ghost { font-weight: 650; }
.period-nav .btn-ghost:disabled { opacity: 0.35; cursor: default; }

/* ---------- Plan ---------- */
.plan-list { display: flex; flex-direction: column; gap: 10px; list-style: none; margin: 0; padding: 0; }
.plan-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px;
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center;
}
.plan-card .pos { font-family: var(--font-display); font-weight: 600; font-size: 20px; text-align: center; color: var(--brand); }
.plan-card .why { font-size: 14px; color: var(--muted); }
.plan-card .title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-card .title button { border: 0; background: none; padding: 0; font-weight: 650; text-align: left; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.plan-card .moves { display: flex; flex-direction: column; gap: 2px; }
.plan-card .moves .icon-btn { width: 44px; height: 44px; border-radius: 12px; background: var(--bg); }
.plan-card .moves .icon-btn:disabled { opacity: 0.3; cursor: default; }
.sugg { font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
.protected {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
}
.protected summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; align-items: center; gap: 10px; min-height: 52px; font-weight: 650; }
.protected summary::-webkit-details-marker { display: none; }
.protected summary .lock { color: var(--mint-ink); background: var(--mint); }
.protected summary .chev { margin-left: auto; color: var(--muted); transition: transform 0.2s; width: 20px; height: 20px; }
.protected[open] summary .chev { transform: rotate(180deg); }
.prot-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); }
.prot-row button { border: 0; background: none; padding: 0; font-weight: 600; text-align: left; flex: 1; min-height: 44px; }
.prot-row .num { font-weight: 650; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { min-height: 44px; border-radius: 999px; border: 0; background: transparent; font-weight: 650; font-size: 15px; padding: 0 8px; }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: var(--shadow); color: var(--brand); }

/* ---------- Timeline ---------- */
.tl-hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.tl-hero .big { font-family: var(--font-display); font-weight: 600; font-size: 26px; line-height: 1.15; }
.tl { list-style: none; margin: 0 0 0 8px; padding: 0 0 0 16px; border-left: 3px solid var(--line); display: flex; flex-direction: column; gap: 18px; }
.tl-month { position: relative; display: flex; flex-direction: column; gap: 8px; }
.tl-month::before { content: ""; position: absolute; left: -25px; top: 3px; width: 15px; height: 15px; border-radius: 999px; background: var(--bg); border: 3px solid var(--brand); }
.tl-month h2 { font-size: 16px; color: var(--muted); }
.tl-ev { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; }
.tl-ev .badge-ico { width: 34px; height: 34px; }
.tl-ev .badge-ico svg { width: 18px; height: 18px; }
.tl-ev p { font-weight: 650; }
.tl-ev .muted { font-weight: 600; font-size: 14px; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: sticky; bottom: 0; z-index: 5; background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 68px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.tabbar button { border: 0; background: none; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 13px; font-weight: 650; color: var(--muted); }
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button[aria-current="page"] { color: var(--brand); }
.tabbar .add { margin: 8px; min-height: 48px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); }
.tabbar .add svg { width: 26px; height: 26px; }

/* ---------- Sheets ---------- */
.backdrop { position: fixed; inset: 0; background: var(--scrim); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.backdrop.enter { animation: fade 0.2s ease; }
.backdrop.enter .sheet { animation: rise 0.28s cubic-bezier(.2, .8, .2, 1); }
.sheet {
  width: 100%; max-width: 440px; max-height: 92%; overflow-y: auto; background: var(--bg); border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding-block: 8px calc(20px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 14px;
}
.sheet .grab { width: 44px; height: 5px; border-radius: 999px; background: var(--line); align-self: center; }
.sheet-head { display: flex; align-items: center; gap: 10px; }
.sheet-head h2 { flex: 1; min-width: 0; }
.impact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.impact ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.impact li { font-weight: 600; }
.field-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 10px 12px;
}
.field-row .lbl { font-size: 14px; color: var(--muted); font-weight: 600; }
.field-row .val { font-weight: 650; font-size: 18px; }
.history { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.history .h { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); font-weight: 600; }
.history .h svg { width: 14px; height: 14px; }
.history .h button { margin-left: auto; border: 0; background: none; color: var(--adjust); font-weight: 650; font-size: 13px; min-height: 44px; padding: 0 4px; }
.danger { color: var(--adjust); }
.confirm-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; }
.err { color: var(--adjust); font-weight: 650; font-size: 15px; }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 650; font-size: 15px;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.enter { animation: toast-in 0.25s ease; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -12px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 360px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .payday .amount { font-size: 30px; }
}

/* Before payday */
.before-card {
  border-radius: var(--r-lg); border: 2px solid var(--line); background: var(--surface); padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.before-card .head { display: flex; gap: 10px; align-items: flex-start; }
.before-card h3 { margin: 0; }
.bp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bp-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-weight: 600; }
.bp-list li:first-child { border-top: 0; }
.bp-list .num { text-align: right; }
.warn-text { color: var(--adjust); font-weight: 650; }
.bp-result { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: var(--r-sm); }
.bp-result svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.bp-result.ok { background: color-mix(in srgb, var(--brand) 12%, transparent); }
.bp-result.ok svg { color: var(--brand); }
.bp-result.short { background: color-mix(in srgb, var(--adjust) 12%, transparent); }
.bp-result.short svg { color: var(--adjust); }
.pocket.past { box-shadow: inset 0 0 0 2px var(--adjust); }

/* Payday check-in */
.checkin-card {
  border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); padding: 20px;
  display: flex; flex-direction: column; gap: 12px; align-items: flex-start;
}
.checkin-card h2 { margin: 0; font-size: 24px; }
.checkin-card p { margin: 0; }
.checkin-card .btn-block { align-self: stretch; }
.ci-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ci-row { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.seg.seg-3 { border-radius: var(--r-md); }
.seg.seg-3 button { border-radius: var(--r-sm); font-size: 14px; line-height: 1.15; padding: 4px 6px; }
.paid-box { border: 2px solid var(--line); border-radius: var(--r-md); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.paid-box p { margin: 0; }
.pocket .done-btn.static { border-style: dashed; background: transparent; }
.app-top { gap: 8px; }
.app-top .chip { margin-left: auto; }
label.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.btn svg { width: 20px; height: 20px; }
/* The whole card is one tap target: only the done button sits above it. */
.pocket .body, .pocket .right, .pocket .badge-ico, .pocket .done-btn.static { pointer-events: none; }

/* Which debt first */
.debt-first { border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.debt-first .head { display: flex; gap: 10px; align-items: flex-start; }
.debt-first h2 { margin: 0; font-size: 20px; }
.strats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.strat { border: 2px solid var(--line); border-radius: var(--r-md); padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.strat.in-use { border-color: var(--brand); }
.strat-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.strat .btn { align-self: flex-start; min-height: 44px; }
.strat-order { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; counter-reset: s; }
.strat-order li { counter-increment: s; background: var(--bg); border-radius: 999px; padding: 4px 10px; font-weight: 650; font-size: 14px; }
.strat-order li::before { content: counter(s) ". "; color: var(--brand); }

/* Payoff details */
.payoff-hero { display: flex; flex-direction: column; gap: 2px; }
.payoff-hero .big { font-family: var(--font-display); font-weight: 600; font-size: 30px; line-height: 1.1; }
.total-split, .pay-split, .compare-min { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.total-split p, .pay-split p, .compare-min p { margin: 0; }
.seg-principal { background: var(--lilac-ink); }
.seg-interest { background: repeating-linear-gradient(45deg, var(--adjust) 0 3px, color-mix(in srgb, var(--adjust) 35%, transparent) 3px 6px); }
.good-text { color: var(--brand); font-weight: 650; }
.sched summary { font-weight: 650; min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--brand); }
.sched table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sched th, .sched td { padding: 6px 4px; border-top: 1px solid var(--line); text-align: right; }
.sched th:first-child { text-align: left; }
.sched thead th { font-size: 13px; color: var(--muted); border-top: 0; }

/* Today hero: safe to spend first, still to pay second, the breakdown on request */
.safe { display: flex; flex-direction: column; gap: 2px; background: var(--sun); border-radius: var(--r-md); padding: 12px 14px; }
.safe .eyebrow { color: var(--ink); }
.safe-num { font-family: var(--font-display); font-weight: 600; font-size: 40px; line-height: 1.05; }
.safe p { margin: 0; color: var(--ink); }
.topay { display: flex; flex-direction: column; gap: 6px; }
.topay-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.meter { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width 0.5s ease; }
.carried { margin: 0; font-weight: 650; color: var(--sky-ink); }
.where summary { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 6px 8px; cursor: pointer; min-height: 44px; align-items: center; }
.where summary::-webkit-details-marker { display: none; }
.where summary .split-bar { grid-column: 1 / -1; height: 10px; }
.where .where-lbl { font-weight: 650; font-size: 15px; color: var(--muted); }
.where .chev { width: 20px; height: 20px; color: var(--muted); transition: transform 0.2s; }
.where[open] .chev { transform: rotate(180deg); }
.where .legend { margin-top: 8px; }
.where > p { margin: 8px 0 0; }
.info-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.info-rows li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r-md); border: 1px dashed var(--line); background: var(--surface); }
.info-rows .badge-ico { width: 40px; height: 40px; }
.plan-card .title button { min-height: 44px; }
.strat-head .chip, .safe .link, .topay .link { white-space: nowrap; }
.safe .link, .spend-card .link { color: var(--ink); }

/* ---------- Sprint 4a: compact cards that never collapse ---------- */
.pocket {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  grid-template-areas: "btn name amt" "btn meta chip";
  column-gap: 12px; row-gap: 2px; align-items: center;
}
.pocket .done-btn { grid-area: btn; }
.p-name { grid-area: name; font-weight: 650; line-height: 1.25; min-width: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word; word-break: normal; hyphens: auto; }
.p-amt { grid-area: amt; font-weight: 650; font-size: 19px; text-align: right; white-space: nowrap; }
.p-meta { grid-area: meta; font-size: 14px; color: var(--muted); min-width: 0; }
.p-chip { grid-area: chip; justify-self: end; }
.pocket .p-name, .pocket .p-amt, .pocket .p-meta, .pocket .p-chip { position: relative; z-index: 1; pointer-events: none; }
@media (max-width: 400px) {
  .pocket { grid-template-areas: "btn name amt" "btn meta meta" "btn chip chip"; }
  .p-chip { justify-self: start; margin-top: 4px; }
}
/* Paid is green, whatever the kind */
.pocket.done { --tint: var(--mint); --tint-ink: var(--good); }
.chip.info { color: var(--ink); background: var(--bg); }

/* Hero */
.payday .next { border-radius: var(--r-md); padding: 10px 12px 10px 16px; box-shadow: none; }
.spend-row { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed color-mix(in srgb, var(--ink) 25%, transparent); }
.spend-row .preset { background: var(--surface); border-color: transparent; min-height: 44px; padding: 0 14px; }
.spend-row .preset.ghost { background: transparent; text-decoration: underline; padding: 0 6px; }
.safe .link { min-height: 32px; margin-left: 4px; }
h2.h3 { font-size: 17px; }

/* Before payday rows are buttons */
.bp-list li { padding: 0; }
.bp-row { width: 100%; display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; min-height: 44px; border: 0; background: none; text-align: left; font: inherit; font-weight: 600; color: inherit; cursor: pointer; }
.bp-row .num { text-align: right; }

/* Setup: "Not sure", counts, estimates, unticked choices look empty */
.choice:not([aria-pressed="true"]) .tick svg { visibility: hidden; }
.check { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; border: 0; background: none; padding: 0; font: inherit; font-weight: 650; color: var(--ink); cursor: pointer; }
.check svg { width: 18px; height: 18px; border: 2px solid var(--line); border-radius: 6px; padding: 1px; color: transparent; }
.check[aria-pressed="true"] svg { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.estimate { margin: 0; min-height: 48px; display: flex; align-items: center; gap: 6px; font-weight: 650; }
.counts { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.counts li { display: flex; align-items: center; gap: 8px; }
.counts li span { flex: 1; }

.toast-undo { border: 0; background: none; color: var(--bg); font: inherit; font-weight: 650; text-decoration: underline; min-height: 44px; padding: 0 4px; cursor: pointer; }
.toast { pointer-events: none; }
.toast-undo { pointer-events: auto; }
/* With a sheet open, messages sit at the top so they never cover the sheet's buttons. */
.toast.over-sheet { bottom: auto; top: calc(16px + env(safe-area-inset-top, 0px)); }
.estimate { flex-wrap: wrap; column-gap: 6px; row-gap: 0; }
.before-card.compact { gap: 4px; padding: 12px 14px; }
.before-card.compact h2 { margin: 0; }
.before-card.compact .link { align-self: flex-start; }
.payday > .spend-row { border-top: 0; margin-top: 0; padding: 12px; border-radius: var(--r-md); background: var(--sun); }

/* Pay with no set schedule */
.income-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line); }
.income-row .btn { min-height: 44px; padding: 0 14px; flex: none; display: inline-flex; align-items: center; gap: 6px; }
.income-row .btn svg { width: 18px; height: 18px; }
.payday > p.small.muted { margin: 0; }

/* Categories */
.seg-extras { background: var(--sun-ink); }
.seg-yours { background: var(--brand); }
.cat-overview { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border-radius: var(--r-lg); padding: 14px; box-shadow: var(--shadow); }
.cat-overview p { margin: 0; }
.cat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.cat-head { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.cat-head p { margin: 2px 0 0; }
.cat-total { display: flex; flex-direction: column; align-items: flex-end; }
.cat-total strong { font-family: var(--font-display); font-weight: 600; font-size: 22px; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-row { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 8px 0; border: 0; border-top: 1px solid var(--line); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.cat-list li:first-child .cat-row { border-top: 0; }
.cat-row .cat-name { font-weight: 650; min-width: 0; overflow-wrap: anywhere; flex: 1; }
.cat-row .num { font-weight: 650; }
.cat-row .goal-bar { margin: 4px 0 2px; }
.cat-facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cat-facts div { background: var(--bg); border-radius: var(--r-sm); padding: 8px 10px; }
.cat-facts dt { font-size: 13px; color: var(--muted); font-weight: 600; }
.cat-facts dd { margin: 0; font-weight: 650; font-size: 17px; }
.tabbar button { font-size: 12px; }
.sheet > * { flex-shrink: 0; }
.choice, .field, .note, .paid-box, .ci-row, .alert { flex-shrink: 0; }

/* ======================================================================
   Calm layer (Sprint 5). Flat surfaces, hairlines, one accent, quiet type.
   Rules here intentionally come last and win over earlier component styles.
   ====================================================================== */
body { background: var(--field); font-size: 16px; line-height: 1.5; font-weight: 450; letter-spacing: -0.003em; }
h1, h2, h3 { font-weight: 650; letter-spacing: -0.015em; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
.wordmark { font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.eyebrow { font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.page { gap: 20px; }
.btn { font-weight: 600; min-height: 50px; }
.btn-soft { background: var(--soft); }
.link { font-weight: 600; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.icon-btn:hover { background: var(--soft); }

/* Status: words in colour, no pills */
.chip, .chip.good, .chip.warn, .chip.adjust, .chip.info { background: none; padding: 0; border-radius: 0; font-size: 14px; font-weight: 600; }
.chip.warn { color: var(--muted); }
.chip.info { color: var(--muted); font-weight: 500; }

/* Badges: quiet grey circles */
.badge-ico, .tile .ico, .k-bill, .k-debt, .k-save, .k-sun { background: var(--soft); color: var(--ink-2); }

/* Notes and banners */
.note { background: var(--soft); }
.note svg { color: var(--muted); }
.example-banner { background: var(--soft); font-weight: 500; font-size: 14px; padding: 4px 4px 4px 14px; border-radius: var(--r-sm); }
.example-banner .btn-ghost { font-weight: 600; min-height: 40px; }

/* Cards: hairline, no shadow, no coloured fills */
.payday, .before-card, .checkin-card, .debt-first, .cat-overview, .cat-card, .tl-hero, .hero-art, .alert, .plan-card, .info-rows li {
  box-shadow: none; border: 1px solid var(--line); background: var(--surface);
}
.before-card { border-width: 1px; }
.alert { border-color: var(--line); }
.strat { border-width: 1px; }
.strat.in-use { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.bp-result.ok, .bp-result.short { background: var(--soft); }
.carried { color: var(--ink-2); font-weight: 600; }
.mess span, .mess span:nth-child(2n), .mess span:nth-child(3n) { background: var(--soft); color: var(--ink-2); }

/* ---------- Today hero: one number, one next step ---------- */
.payday { background: transparent; border: 0; padding: 0; gap: 16px; }
.period-nav { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin: -4px -10px 0; }
.period-nav .when-txt { text-align: center; font-size: 15px; color: var(--muted); font-weight: 500; }
.period-nav .when-txt strong { color: var(--ink); font-weight: 600; }
.period-nav .icon-btn:disabled { opacity: 0.25; cursor: default; background: none; }
.safe { background: none; padding: 4px 0 0; border-radius: 0; gap: 4px; }
.safe .eyebrow { color: var(--muted); }
.safe-num { font-family: var(--font-display); font-size: 52px; font-weight: 650; letter-spacing: -0.035em; line-height: 1; }
.safe p { color: var(--muted); font-size: 15px; }
.safe .link { color: var(--brand); }
.payday .next, .next {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 12px 12px 16px;
}
.next p { font-size: 14px; color: var(--muted); }
.next strong { font-family: var(--font-body); font-size: 17px; font-weight: 650; }
.next .btn { background: var(--brand); color: var(--brand-ink); min-height: 44px; padding: 0 20px; }
.topay { gap: 8px; }
.topay-row { font-size: 15px; }
.topay-row strong { font-weight: 650; }
.meter { height: 6px; background: var(--line); }
.payday > .spend-row, .spend-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; margin: 0; gap: 8px; }
.spend-row .preset { border: 1px solid var(--line); background: var(--surface); font-weight: 600; min-height: 44px; }
.spend-row .preset.ghost { border-color: transparent; color: var(--muted); }
.where { border-top: 1px solid var(--line); padding-top: 4px; }
.where summary { grid-template-rows: auto; grid-template-columns: minmax(0, 1fr) auto; }
.where summary .split-bar { display: none; }
.where[open] summary .split-bar { display: flex; grid-row: 2; }
.where .where-lbl { font-weight: 600; color: var(--ink-2); }
.split-bar { height: 8px; gap: 2px; }
.seg-bills { background: var(--brand); }
.seg-debts { background: var(--brand-2); }
.seg-savings { background: var(--brand-3); }
.seg-hold { background: repeating-linear-gradient(45deg, var(--brand-3) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--brand-3); }
.seg-yours, .seg-extras { background: var(--ink-2); }
.seg-principal { background: var(--brand-2); }
.seg-interest { background: repeating-linear-gradient(45deg, var(--adjust) 0 3px, color-mix(in srgb, var(--adjust) 30%, transparent) 3px 6px); }
.legend .yours { background: var(--soft); }
.goal-bar { height: 6px; }
.goal-bar > span { background: var(--brand); }
.income-row { background: var(--surface); }

/* ---------- The list: one grouped surface, hairline rows ---------- */
.section-title h2 { font-size: 17px; }
.lineup { gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.pocket, .pocket.debt, .pocket.save, .pocket.sun, .pocket.done {
  --tint: var(--soft); --tint-ink: var(--line);
  border: 0; border-radius: 0; border-top: 1px solid var(--line); background: transparent; padding: 14px 16px 14px 12px; box-shadow: none;
}
.lineup > .pocket:first-child { border-top: 0; }
.pocket .water, .pocket .fill { display: none; }
.pocket .done-btn { width: 36px; height: 36px; border: 1.5px solid color-mix(in srgb, var(--ink) 22%, transparent); background: var(--surface); }
.pocket .done-btn:hover { background: var(--soft); border-color: var(--brand); }
.pocket .pos { font-family: var(--font-body); font-size: 15px; font-weight: 600; color: var(--muted); }
.pocket.done .done-btn { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.pocket.done .p-name, .pocket.done .p-amt { color: var(--muted); }
.pocket.past { box-shadow: none; }
.pocket.past .done-btn { border-color: var(--adjust); }
.p-name { font-weight: 600; }
.p-amt { font-weight: 650; font-size: 17px; }
.p-meta { font-size: 14px; }
.p-chip:empty { display: none; }
.pocket .tap:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.pocket .tap:focus-visible { outline-offset: -3px; }

/* ---------- Other screens ---------- */
.plan-card .pos { color: var(--muted); font-family: var(--font-body); font-size: 16px; }
.plan-card .moves .icon-btn { background: var(--soft); }
.tile[aria-pressed="true"], .choice[aria-pressed="true"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--brand); }
.cat-facts div { background: var(--soft); }
.cat-total strong { font-family: var(--font-body); font-weight: 650; font-size: 20px; }
.tabbar { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
.tabbar button { font-weight: 600; }
.tabbar .add { box-shadow: none; }
.toast { font-weight: 600; }
@media (prefers-reduced-transparency: reduce) { .tabbar { background: var(--surface); backdrop-filter: none; } }
.debt-first { gap: 8px; }
.debt-first > .btn { align-self: flex-start; min-height: 44px; }
.compare summary { list-style: none; display: flex; align-items: center; gap: 4px; min-height: 44px; cursor: pointer; font-weight: 600; color: var(--brand); }
.compare summary::-webkit-details-marker { display: none; }
.compare summary .chev { width: 18px; height: 18px; transition: transform 0.2s; }
.compare[open] summary .chev { transform: rotate(180deg); }
.compare > p { margin-bottom: 10px; }
html { scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); scroll-padding-top: 16px; }

/* Where to cut */
.cut-summary { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.cut-summary .legend { margin: 0; }
.cut-h { font-size: 15px; font-weight: 650; margin: 8px 0 -4px; color: var(--ink-2); }
.cut-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.cut-row { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-top: 1px solid var(--line); }
.cut-list > .cut-row:first-child { border-top: 0; }
.cut-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.cut-txt strong { font-weight: 600; }
.cut-btn { min-height: 44px; padding: 0 16px; flex-shrink: 0; }

/* User-test fixes */
.hold-line { display: flex; gap: 8px; align-items: flex-start; color: var(--ink-2); margin: 0; }
.hold-line svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: var(--muted); }
.period-nav .link { font: inherit; color: inherit; font-weight: 500; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; min-height: 24px; }
.notfit { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: 4px 16px 12px; }
.notfit summary { list-style: none; display: flex; gap: 12px; align-items: center; justify-content: space-between; min-height: 56px; padding-top: 8px; cursor: pointer; }
.notfit summary::-webkit-details-marker { display: none; }
.notfit summary .chev { width: 20px; height: 20px; flex-shrink: 0; transition: transform 0.2s; }
.notfit[open] summary .chev { transform: rotate(180deg); }
.notfit .cat-list { margin: 8px 0; }
.field-row { flex-wrap: wrap; row-gap: 4px; }
.field-row > .muted.small { text-align: right; }
.tabbar button { min-width: 0; text-align: center; line-height: 1.15; overflow-wrap: anywhere; padding: 4px 2px; }
@media (max-width: 340px) { .tabbar button { font-size: 11px; } }
.tabbar button { overflow-wrap: normal; }
@media (max-width: 300px) {
  .tabbar { grid-template-columns: repeat(4, minmax(0, 1fr)) 52px; }
  .tabbar button { font-size: 10px; letter-spacing: -0.01em; }
  .tabbar .add { width: 46px; height: 46px; }
}

/* Catch-up plan */
.catchup { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.catchup .meter { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.catchup .meter > span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.catchup .link { justify-self: start; }
.cu-tip summary { cursor: pointer; font-weight: 600; font-size: 15px; color: var(--ink-2); min-height: 32px; display: flex; align-items: center; }
.cu-tip p { margin-top: 4px; }
.list-sub { font-size: 15px; font-weight: 600; color: var(--muted); margin: 4px 0 -8px; }

/* Info hints: details live behind a small (i) */
.row-h { display: flex; align-items: center; gap: 6px; }
.row-h > h2, .row-h > h3 { margin: 0; }
.hint-i { position: relative; display: inline-flex; flex-shrink: 0; }
.hint-i > summary { list-style: none; display: grid; place-items: center; width: 32px; height: 32px; margin: -4px -6px -4px -2px; border-radius: 50%; color: var(--muted); cursor: pointer; }
.hint-i > summary::-webkit-details-marker { display: none; }
.hint-i > summary svg { width: 18px; height: 18px; }
.hint-i > summary:hover, .hint-i[open] > summary { color: var(--ink); background: var(--soft); }
.hint-pop {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  width: min(300px, calc(100vw - 48px)); padding: 12px 14px; border-radius: var(--r-md);
  background: var(--ink); color: var(--bg); font-weight: 450; line-height: 1.45; text-align: left;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.hint-pop p { margin: 0; }
.hint-pop p + p { margin-top: 6px; }
.catchup .row-h .hint-pop, .alert .row-h .hint-pop, .hold-line .hint-pop, .carried .hint-pop, .income-row .hint-pop { left: auto; right: -8px; transform: none; }
.catchup { gap: 6px; }
.cu-nums { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0; }
.cu-nums strong { font-size: 22px; font-weight: 650; }
.hold-line { color: var(--ink-2); }
.hold-line > span { flex: 1; }
.income-row { align-items: center; gap: 8px; }
.income-row > div:first-child { flex: 1; }
.fixwrap > summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; min-height: 40px; cursor: pointer; font-weight: 600; color: var(--brand); }
.fixwrap > summary::-webkit-details-marker { display: none; }
.fixwrap > summary .chev { width: 18px; height: 18px; transition: transform 0.2s; }
.fixwrap[open] > summary .chev { transform: rotate(180deg); }
.alert .head .row-h { justify-content: flex-start; }
.hint-pop, .catchup .row-h .hint-pop, .alert .row-h .hint-pop, .hold-line .hint-pop, .carried .hint-pop, .income-row .hint-pop { position: fixed; right: auto; transform: none; }

/* ---------- Make it easier ---------- */
/* Text size scales the whole app, so tap targets grow with the words. */
html[data-text="large"] body { zoom: 1.15; }
html[data-text="larger"] body { zoom: 1.3; }
.p-pic { display: none; }
html[data-pictures] .p-pic { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 8px; vertical-align: -8px; border-radius: 50%; background: var(--soft); color: var(--ink-2); }
html[data-pictures] .p-pic svg { width: 16px; height: 16px; }
.icon-btn.speak { color: var(--brand); }
.icon-btn.speak svg { width: 22px; height: 22px; }
.safe .row-h { gap: 2px; }
.safe .row-h .speak { margin: -10px 0; }
.top-acts { display: inline-flex; gap: 4px; margin-left: auto; }
.app-top .top-acts .icon-btn svg { width: 22px; height: 22px; }
.hint-pop .speak { float: right; width: 36px; height: 36px; margin: -6px -8px 0 6px; color: var(--bg); }
.hint-pop .speak:hover { background: color-mix(in srgb, var(--bg) 15%, transparent); }
.ease-box { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 0 14px; }
.ease-box > summary { list-style: none; display: flex; align-items: center; gap: 12px; min-height: 64px; cursor: pointer; }
.ease-box > summary::-webkit-details-marker { display: none; }
.ease-box > summary > span { flex: 1; }
.ease-box > summary .chev { width: 20px; height: 20px; transition: transform 0.2s; }
.ease-box[open] > summary .chev { transform: rotate(180deg); }
.ease-box[open] { padding-bottom: 14px; display: grid; gap: 12px; }
.field > .label svg { width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px; }
.choice[role="switch"] { position: relative; padding-right: 64px; }
.choice[role="switch"]::after {
  content: ''; position: absolute; right: 14px; top: 50%; width: 40px; height: 24px; margin-top: -12px; border-radius: 99px;
  background: var(--line); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ink) 25%, transparent);
  transition: background 0.15s;
}
.choice[role="switch"]::before {
  content: ''; position: absolute; right: 32px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); z-index: 1; transition: right 0.15s;
}
.choice[role="switch"][aria-checked="true"]::after { background: var(--brand); box-shadow: none; }
.choice[role="switch"][aria-checked="true"]::before { right: 17px; }
.choice[role="switch"] .tick { display: none; }
@media (prefers-reduced-motion: reduce) { .choice[role="switch"]::before, .choice[role="switch"]::after { transition: none; } }
.seg button[aria-checked="true"] { background: var(--surface); box-shadow: var(--shadow); color: var(--brand); }
.seg button[aria-checked="true"]:not([aria-pressed]) { box-shadow: 0 1px 2px rgba(20, 30, 26, 0.08), inset 0 0 0 1px var(--line); }
.ease-box > summary > svg:first-child { width: 24px; height: 24px; flex-shrink: 0; color: var(--ink-2); }

/* ---------- Settings: grouped list rows ---------- */
.set-h { font-size: 14px; font-weight: 600; color: var(--muted); margin: 10px 4px -6px; letter-spacing: 0; }
.set-group { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.set-group > li + li { border-top: 1px solid var(--line); }
.set-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 16px;
  background: none; border: 0; border-radius: 0; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
button.set-row:hover, label.set-row:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.set-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.set-stack { flex-direction: column; align-items: stretch; gap: 10px; cursor: default; padding: 12px 16px 14px; }
.set-txt { flex: 1; min-width: 0; display: grid; gap: 1px; }
.set-title { font-weight: 600; font-size: 16px; }
.set-sub { font-size: 14px; color: var(--muted); }
.set-ico { width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center; border-radius: 8px; background: var(--soft); color: var(--ink-2); }
.set-ico svg { width: 18px; height: 18px; }
.set-chev { color: var(--muted); display: grid; }
.set-chev svg { width: 18px; height: 18px; }
.set-danger { justify-content: center; }
.set-danger .set-title { color: var(--adjust); }
.set-btns { display: flex; gap: 8px; }
.set-btns .btn { flex: 1; min-height: 44px; }
.btn-danger { background: var(--adjust); color: #fff; }
:root[data-theme="dark"] .btn-danger { color: #1b0d06; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-danger { color: #1b0d06; } }

/* Switch */
.switch { position: relative; flex-shrink: 0; width: 46px; height: 28px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 18%, transparent); transition: background 0.15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.15s; }
[aria-checked="true"] > .switch { background: var(--brand); }
[aria-checked="true"] > .switch::after { transform: translateX(18px); }
@media (prefers-reduced-motion: reduce) { .switch, .switch::after { transition: none; } }

/* Segmented control: quiet track, raised choice */
.seg { background: var(--soft); border: 0; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { min-height: 40px; border-radius: 8px; font-weight: 600; font-size: 15px; color: var(--ink-2); }
.seg button[aria-checked="true"], .seg button[aria-checked="true"]:not([aria-pressed]), .seg button[aria-pressed="true"] {
  background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
}
:root[data-theme="dark"] .seg button[aria-checked="true"], :root[data-theme="dark"] .seg button[aria-pressed="true"] { background: #3a423f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button[aria-checked="true"], :root:not([data-theme="light"]) .seg button[aria-pressed="true"] { background: #3a423f; } }

/* ---------- Structure: three tabs, page headers, plain Plan rows ---------- */
.tabbar, .tabbar[class] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 300px) { .tabbar { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.page-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.page-h h1 { margin: 0; font-size: 28px; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 15px; border-radius: 99px; gap: 6px; }
.btn-sm svg { width: 18px; height: 18px; }
.btn-ghost.btn-sm[aria-pressed="true"] { color: var(--brand); }
.seg-sm button { min-height: 36px; font-size: 14px; }

.plan-rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.plan-row { display: flex; align-items: center; gap: 4px; padding: 0 12px 0 0; border-top: 1px solid var(--line); }
.plan-rows > .plan-row:first-child { border-top: 0; }
.plan-row .pos { width: 40px; flex-shrink: 0; text-align: center; font-weight: 600; color: var(--muted); font-size: 15px; }
.plan-main { flex: 1; min-width: 0; display: grid; gap: 3px; text-align: left; background: none; border: 0; padding: 14px 4px; color: inherit; font: inherit; cursor: pointer; }
.plan-main:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 8px; }
.plan-main .p-meta { color: var(--muted); font-size: 14px; }
.plan-main .flags { color: var(--muted); }
.plan-main .goal-bar { height: 4px; margin-top: 4px; }
.plan-row .p-amt { font-weight: 650; font-size: 16px; text-align: right; white-space: nowrap; }
.plan-row .p-amt .muted { font-weight: 500; font-size: 14px; }
.plan-row.done .p-name { color: var(--muted); }
.plan-row .moves { display: flex; gap: 4px; }
.plan-row .moves .icon-btn { width: 40px; height: 40px; background: var(--soft); }
.cat-head .row-h { flex: 1; min-width: 0; }
.cat-overview + .set-group { margin-top: 0; }
.plan-main > * { grid-area: auto; grid-column: 1; min-width: 0; }
.plan-main .p-name { display: block; font-weight: 600; font-size: 16px; }
.seg-sm { width: fit-content; min-width: 60%; }
/* Item sheet: lighter "Change" actions */
.field-row > .btn-soft[data-act="field"], .field-row > .btn-soft[data-act="rename-open"] { background: none; color: var(--brand); padding: 0 8px; min-height: 44px; }
.field-row > .btn-soft[data-act="field"] svg, .field-row > .btn-soft[data-act="rename-open"] svg { display: none; }
/* Keep-your-plan-safe nudge */
.nudge { gap: 10px; padding: 12px 8px 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.nudge > svg:first-child { width: 22px; height: 22px; flex-shrink: 0; color: var(--brand); }
.nudge > span { flex: 1; min-width: 0; }
.nudge .icon-btn { width: 36px; height: 36px; color: var(--muted); }
.note.row-h > span { flex: 1; }

/* Privacy and terms */
.legal-short { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.legal-short li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; }
.legal-short li svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px; color: var(--brand); }
.legal-more details { border-top: 1px solid var(--line); }
.legal-more details:first-child { border-top: 0; }
.legal-more summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 16px; cursor: pointer; font-weight: 600; }
.legal-more summary::-webkit-details-marker { display: none; }
.legal-more summary .chev { width: 18px; height: 18px; color: var(--muted); transition: transform 0.2s; }
.legal-more details[open] summary .chev { transform: rotate(180deg); }
.legal-more details p { margin: 0; padding: 0 16px 14px; color: var(--ink-2); line-height: 1.5; }
.legal-line .link { font-size: inherit; min-height: 24px; padding: 0; }

/* Storage isn't working: shown above every screen until a save succeeds. */
.save-warn { margin: 12px 16px 0; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--warn); color: var(--ink); font-size: .95rem; line-height: 1.4; }
.save-warn .link { margin-left: 4px; }

/* Help & about */
.help-about { margin: 0 0 6px; line-height: 1.5; }
.report-text { width: 100%; min-height: 160px; font: inherit; font-size: .9rem; line-height: 1.4; padding: 10px 12px; resize: vertical; }
.who-pays { display: flex; gap: 8px; align-items: flex-start; }
.who-pays .i { width: 1.1em; height: 1.1em; margin-top: .15em; }

/* ---------- Narrow layouts: small phones and larger text ----------
   Text size zooms the page, so a 320px phone at "Larger" has about 230px of room. Media queries can't
   see that; container queries can. Under 300px of room, rows stack instead of squeezing words apart. */
main.page, .sheet { container-type: inline-size; container-name: room; }
@container room (max-width: 300px) {
  /* Header: the demo-date chip drops below the wordmark instead of pushing Settings off-screen. */
  .app-top { flex-wrap: wrap; }
  .app-top .chip { order: 3; margin-left: 0; }
  .app-top .icon-btn { margin-left: auto; }

  /* Pictures sit inline and small, so names keep whole words. */
  html[data-pictures] .p-pic { width: 22px; height: 22px; margin-right: 6px; vertical-align: -5px; }
  html[data-pictures] .p-pic svg { width: 13px; height: 13px; }
  .p-name { overflow-wrap: normal; word-break: normal; hyphens: manual; }

  /* Today: name on its own line, amount under it with the date. */
  .pocket { grid-template-columns: 44px minmax(0, 1fr); grid-template-areas: "btn name" "btn amt" "btn meta" "btn chip"; row-gap: 2px; }
  .p-amt { text-align: left; font-size: 18px; }
  .p-name { -webkit-line-clamp: 3; }

  /* Plan: amount moves under the name instead of taking a column. */
  .plan-row { flex-wrap: wrap; align-items: flex-start; }
  .plan-row .pos { width: 32px; padding-top: 15px; }
  .plan-main { flex: 1 1 calc(100% - 44px); padding-bottom: 2px; }
  .plan-row > .p-amt { flex: 1 0 100%; text-align: left; padding: 0 0 12px 36px; }
  .plan-row .moves { padding-left: 36px; padding-bottom: 10px; }

  /* "Always first" summary: count goes under the title. */
  .protected summary { flex-wrap: wrap; row-gap: 0; }
  .protected summary > .muted { flex-basis: 100%; order: 3; padding-left: 50px; }

  /* Overview categories: no icon column; the total sits on its own line. */
  .cat-head { grid-template-columns: minmax(0, 1fr); }
  .cat-head > .badge-ico { display: none; }
  .cat-total { flex-direction: row; align-items: baseline; gap: 6px; }
  .cat-facts { grid-template-columns: minmax(0, 1fr); }
  .legend > div { flex-wrap: wrap; }

  /* Two-up controls go one per line. */
  .row-2, .row-3 { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .example-banner { flex-wrap: wrap; }
  .income-row { flex-wrap: wrap; }
  .hero > .next, .todo > .sa-row, .todo > .next { flex-wrap: wrap; }
  .hero > .next .btn, .todo .sa-btns, .todo .sa-btns .btn { flex: 1 1 100%; width: 100%; justify-content: center; }
  .todo .sa-btns { align-items: stretch; }
  .todo .sa-btns .link { align-self: flex-start; }
  .income-row .btn-primary { flex: 1 1 100%; }

  /* Item sheet: value and Change on one line, scheduled changes each on their own full line. */
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .field-row > .btn-soft[data-act="field"], .field-row > .btn-soft[data-act="rename-open"] { justify-self: start; padding: 0; }
  .history .h { flex-wrap: wrap; }
  .confirm-row { flex-wrap: wrap; }
  .confirm-row > span { flex-basis: 100% !important; }
}

/* ---------- Tap targets: at least 44 x 44 everywhere (WCAG 2.5.5, older hands) ---------- */
.seg [role="radio"], .seg button, .preset, .btn-sm, .example-banner .btn-ghost { min-height: 44px; }
.pocket .done-btn { position: relative; }
.pocket .done-btn::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; }
/* Small icons and in-text amounts keep their look but get a 44px hit area. */
.hint-i > summary { position: relative; }
.hint-i > summary::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; }
button.link.num { position: relative; }
button.link.num::after { content: ''; position: absolute; inset: -10px -4px; }
.cut-gap { margin: 8px 0 0; font-size: 1.05rem; line-height: 1.4; }
.work-tag { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; font-size: 12px; font-weight: 650; color: var(--ink-2); background: var(--soft); vertical-align: 1px; }
.help-list { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; line-height: 1.45; }

/* Month parts (no set schedule): this part's target and the month at a glance */
.part-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; display: grid; gap: 8px; }
.part-card .h3 { margin: 0; }
.part-card p { margin: 0; }
.parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-top: 1px solid var(--line); padding-top: 8px; }
.parts li { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; color: var(--muted); padding: 4px 0; }
.parts li.now { color: var(--ink); font-weight: 650; }
.parts li.past { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.part-card .link { justify-self: start; min-height: 44px; }
.part-rows { list-style: none; margin: 12px 0 16px; padding: 0; display: grid; gap: 10px; }
.part-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.part-row .part-n { font-weight: 650; min-width: 4.5em; }
.part-row select { width: auto; min-width: 6em; }

/* Save and pay rhythm */
.sa-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--r-md); background: var(--soft); }
.sa-row.done { background: color-mix(in srgb, var(--good) 12%, transparent); justify-content: flex-start; }
.sa-row.done .link { margin-left: auto; min-height: 44px; }
.sa-check { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--good); color: var(--surface); flex: none; }
.sa-check svg { width: 18px; height: 18px; }
.sa-btns { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sa-btns .btn { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; }
.sa-btns .btn svg { width: 18px; height: 18px; }
.sa-btns .link { min-height: 44px; }
.part-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.rhythm-list { display: grid; gap: 8px; margin: 12px 0; }
.rhythm-list [role="radio"] { text-align: left; min-height: 48px; padding: 0 14px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface); font: inherit; font-weight: 600; color: var(--ink); }
.rhythm-list [role="radio"][aria-checked="true"] { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.day-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.day-picks .preset { min-width: 52px; }
.day-picks .preset[aria-pressed="true"] { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--surface)); }

/* ---------- Zones: Today reads as a few named sections, not a stack of equal cards ----------
   1. Right now (the payday card)   2. Money coming in (no set schedule)   3. Pay in this order   4. Small print
   Each zone after the first starts with a full-width divider and a heading, so the eye can find its place. */
.zone { display: flex; flex-direction: column; gap: 12px; }
.payday + .zone, .zone + .zone, .alert + .zone, .checkin-card + .zone { margin-top: 8px; padding-top: 22px; border-top: 1px solid var(--line); }
.zone-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.zone-h h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.zone-meta { font-size: 14px; color: var(--muted); font-weight: 600; white-space: nowrap; }
/* One panel per zone; what used to be separate cards become rows split by dividers. */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.panel > * { border: 0; border-radius: 0; box-shadow: none; margin: 0; }
.panel > * + * { border-top: 1px solid var(--line); }
.panel > .income-row { padding: 14px 16px; }
.panel > .part-card { background: none; padding: 16px; }
/* Bills zone: progress sits right under the heading, the list follows. */
.zone .topay { padding: 0 2px; }
.zone .section-title { display: none; }
/* Small print: quieter and clearly after the main content. */
.zone-foot { gap: 10px; }
.zone-foot > p { margin: 0; }
/* Paid bills fold away under one row */
.paid-fold { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.paid-fold > summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 56px; cursor: pointer; list-style: none; }
.paid-fold > summary::-webkit-details-marker { display: none; }
.paid-fold > summary .chev { margin-left: auto; transition: transform .15s; }
.paid-fold[open] > summary .chev { transform: rotate(180deg); }
.paid-fold .paid-ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); flex: none; }
.paid-fold .paid-ico svg { width: 18px; height: 18px; }
.paid-fold > .lineup { border: 0; border-top: 1px solid var(--line); border-radius: 0; margin: 0; }
@media (prefers-reduced-motion: reduce) { .paid-fold > summary .chev { transition: none; } }
.paid-fold > summary .chev { width: 20px; height: 20px; color: var(--muted); }
/* Plan uses the same zones: the first zone after the "Always first" block gets a divider too. */
.protected + .zone, .debt-first + .zone { margin-top: 8px; padding-top: 22px; border-top: 1px solid var(--line); }

/* ---------- Calm Today: the answer up top, everything else one tap away ----------
   Top: what you can spend, then a short to-do list (pay next, set aside, log pay).
   Below: one warning line if needed, then folded rows for the full bill list, this month's plan
   and where the money goes. */
.todo { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.todo > * { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; margin: 0 !important; background: none; }
.todo > * + * { border-top: 1px solid var(--line) !important; }
.todo > .next { padding: 12px 14px 12px 16px; }
.todo > .income-row { padding: 12px 14px 12px 16px; }
.todo > .sa-row { padding: 12px 14px 12px 16px; border-radius: 0; background: none; }
.todo > .sa-row.done { background: color-mix(in srgb, var(--good) 8%, transparent); }
.todo > p.small { padding: 12px 16px; }

.alert-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; }
.alert-line > svg { width: 20px; height: 20px; color: var(--warn); flex: none; }
.alert-line .h3 { margin: 0; font-size: 16px; }
.alert-line .link { margin-left: auto; min-height: 44px; }

.folds { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.folds > .fold + .fold { border-top: 1px solid var(--line); }
.fold { border: 0 !important; border-radius: 0 !important; background: none !important; box-shadow: none !important; margin: 0 !important; padding: 0 !important; }
.fold > summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 60px; cursor: pointer; list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary .chev { width: 20px; height: 20px; margin-left: auto; color: var(--muted); flex: none; transition: transform .15s; }
.fold[open] > summary .chev { transform: rotate(180deg); }
.fold-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.fold-txt .meter { margin-top: 6px; }
.fold-body { padding: 0 12px 14px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.fold-note { margin: 0 4px; }
.fold-body > .part-card { border: 0; padding: 4px; background: none; }
.part-h { margin: 0; }
/* The where-it-goes fold keeps its colour bar in the summary. */
.where.fold > summary { padding: 14px 16px; }
.where.fold > :not(summary) { margin-inline: 16px; }
.where.fold[open] { padding-bottom: 14px !important; }
@media (prefers-reduced-motion: reduce) { .fold > summary .chev { transition: none; } }
.alert.alert-line { flex-direction: row; align-items: center; text-align: left; gap: 8px; padding: 6px 8px 6px 14px; border-width: 1px; }
.alert-line .hint-i { flex: none; }
.folds > * + * { border-top: 1px solid var(--line) !important; }
/* Set aside: amount on the left, Done on the right, "Other amount" tucked under the button. */
.todo > .sa-row { flex-wrap: nowrap; align-items: center; }
.todo .sa-btns { flex-direction: column; align-items: flex-end; gap: 0; margin-left: auto; }
.todo .sa-btns .link { min-height: 36px; font-size: 14px; }
.todo .btn { white-space: nowrap; }
.todo > .sa-row > span:first-child, .todo > .next > div:first-child { min-width: 0; flex: 1 1 auto; }

/* ---------- Hierarchy: one focus, then actions, then information ----------
   Focus: the hero (what you can spend and the one thing to do next) on a tinted panel, with the only
   filled button on the screen. Actions: other to-dos on a plain card with outlined buttons.
   Information: folds and small print sit flat on the page, in quieter text. */
.payday { background: none; border: 0; padding: 0; gap: 14px; }
.hero { background: var(--brand-soft); border-radius: var(--r-lg); padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.hero .safe { background: none; padding: 0; }
.hero .safe-num { font-size: 52px; line-height: 1; letter-spacing: -0.02em; color: var(--ink); }
.hero .eyebrow { color: var(--ink-2); font-weight: 600; }
.hero > .next { background: var(--surface); border: 0; border-radius: var(--r-md); box-shadow: 0 1px 2px rgba(14, 30, 24, .06); padding: 12px 12px 12px 16px; }
.hero > .next .btn { background: var(--brand); color: var(--brand-ink); border: 0; min-height: 48px; padding: 0 18px; font-weight: 700; }
/* Secondary actions: outlined, so the hero's button stays the one that pulls the eye. */
.todo .btn, .todo .btn-primary { background: var(--surface); color: var(--brand); border: 1.5px solid color-mix(in srgb, var(--brand) 55%, transparent); box-shadow: none; }
.todo .btn:hover { background: var(--brand-soft); }
/* Information: flat, no card, quieter labels. */
.folds { background: none; border: 0; border-radius: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fold > summary { padding: 14px 4px; }
.fold-txt strong { font-weight: 600; color: var(--ink-2); }
.fold-body { padding-inline: 0; }
.where.fold > summary { padding: 14px 4px; }
.where.fold > :not(summary) { margin-inline: 4px; }
.alert.alert-line { background: none; border: 0; border-left: 3px solid var(--warn); border-radius: 0; padding: 4px 4px 4px 12px; }
.zone-foot, .zone-foot .who-pays { color: var(--muted); }

/* Dark: cards get a visible edge, and the focus panel a brighter edge, so the three levels still read. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 35%, transparent); }
  :root:not([data-theme="light"]) .hero > .next { box-shadow: inset 0 0 0 1px var(--line); }
}
:root[data-theme="dark"] .hero { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 35%, transparent); }
:root[data-theme="dark"] .hero > .next { box-shadow: inset 0 0 0 1px var(--line); }
/* Dark: the chosen option in a group gets a brand outline, not just a slightly lighter fill. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .seg button[aria-checked="true"], :root:not([data-theme="light"]) .seg button[aria-pressed="true"] { background: var(--brand-soft); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--brand); }
}
:root[data-theme="dark"] .seg button[aria-checked="true"], :root[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--brand-soft); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--brand); }

/* Where to cut: quick button plus "Other amount", which opens an editor in the row */
.cut-acts { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.cut-acts .cut-other { font-size: 14px; min-height: 36px; }
.cut-row.editing { flex-wrap: wrap; }
.cut-edit { flex: 1 1 100%; display: grid; gap: 8px; padding-top: 10px; margin-top: 4px; border-top: 1px dashed var(--line); }
.cut-edit label { font-weight: 600; }
.cut-edit p { margin: 0; }
.cut-edit-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.cut-edit-btns .btn { min-height: 44px; }

/* Light: cards get a visible edge against the page, and the chosen option a brand outline, as in dark. */
:root:not([data-theme="dark"]) .seg button[aria-checked="true"], :root:not([data-theme="dark"]) .seg button[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px var(--brand); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .todo, :root:not([data-theme="dark"]) .set-group, :root:not([data-theme="dark"]) .cut-list { border-color: #c9d0ca; }
  :root:not([data-theme="dark"]) .hero { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 22%, transparent); }
}
:root[data-theme="light"] .todo, :root[data-theme="light"] .set-group { border-color: #c9d0ca; }
:root[data-theme="light"] .hero { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 22%, transparent); }
/* Cut buttons name their result ("Lower to $210"), so let them size to the words. */
.cut-acts .cut-btn { white-space: nowrap; }
@container room (max-width: 300px) { .cut-row { flex-wrap: wrap; } .cut-acts { flex: 1 1 100%; flex-direction: row; justify-content: space-between; align-items: center; } }

/* Categories */
.cat-choices { display: grid; gap: 8px; }
.cat-choice { display: flex; align-items: center; gap: 12px; text-align: left; min-height: 56px; padding: 8px 12px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface); font: inherit; color: var(--ink); }
.cat-choice[aria-checked="true"] { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); box-shadow: inset 0 0 0 1px var(--brand); }
.cat-choice .badge-ico { width: 36px; height: 36px; flex: none; }
.cat-choice-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.icon-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.icon-picks [role="radio"] { display: grid; place-items: center; min-height: 48px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); }
.icon-picks [role="radio"] svg { width: 22px; height: 22px; }
.icon-picks [role="radio"][aria-checked="true"] { border-color: var(--brand); color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); box-shadow: inset 0 0 0 1px var(--brand); }
.choice-list { display: grid; gap: 8px; }
.choice-list [role="radio"] { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; min-height: 56px; padding: 10px 14px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface); font: inherit; color: var(--ink); }
.choice-list [role="radio"][aria-checked="true"] { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); box-shadow: inset 0 0 0 1px var(--brand); }
.set-row[disabled] { opacity: 1; cursor: default; }
.btn-danger-soft { background: none; color: var(--warn); border: 1.5px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.cat-new { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; justify-self: start; }
.cat-new svg { width: 18px; height: 18px; flex: none; }

/* ---------- Categories: manager, limits, past months ---------- */
.group-h { font-size: 14px; font-weight: 700; color: var(--muted); margin: 14px 0 6px; }
.cat-mgr-row { display: flex; align-items: center; gap: 4px; }
.cat-mgr-row .set-row { flex: 1; min-width: 0; }
.cat-move { display: flex; flex: none; }
.cat-move .icon-btn { width: 44px; height: 44px; }
.cat-move .icon-btn:disabled { opacity: 0.3; cursor: default; }
.limit-line { margin: 6px 0 0; }
.limit-line.over { display: flex; gap: 8px; align-items: flex-start; color: var(--warn); font-weight: 600; font-size: 15px; }
.limit-line.over svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.seg-3 button { padding: 0 6px; }
.hist { display: grid; gap: 10px; margin-top: 14px; }
.hist-list, .hist-months { list-style: none; margin: 0; padding: 0; }
.hist-row { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 0; border: 0; border-top: 1px solid var(--line); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.hist-list li:first-child .hist-row { border-top: 0; }
.hist-txt { flex: 1; min-width: 0; display: grid; gap: 4px; }
.hist-name { font-weight: 650; }
.hist-row .num { font-weight: 700; }
.hist-row .chev { width: 18px; height: 18px; flex: none; color: var(--muted); }
.hist-bar { display: block; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.hist-bar > span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.hist-bar.over > span { background: var(--warn); }
.hist-months li { display: grid; grid-template-columns: 7.5em 1fr auto; align-items: center; gap: 10px; min-height: 40px; border-top: 1px solid var(--line); }
.hist-months li:first-child { border-top: 0; }
.hist-months li.here { font-weight: 700; }
.cat-row.static { cursor: default; }
.empty-past { display: grid; justify-items: start; gap: 8px; margin-top: 16px; padding: 18px; border: 1px dashed var(--line); border-radius: 16px; }
@container room (max-width: 300px) {
  .hist-months li { grid-template-columns: 1fr auto; }
  .hist-months li .hist-bar { grid-column: 1 / -1; grid-row: 2; }
}
.hist .period-nav { margin: 0; }
@container room (max-width: 300px) {
  .cat-mgr-row { flex-wrap: wrap; }
  .cat-mgr-row .set-row { flex: 1 1 100%; }
  .cat-move { width: 100%; justify-content: flex-end; }
}
.confirm-box { display: grid; gap: 10px; background: var(--surface); border: 1.5px solid color-mix(in srgb, var(--warn) 40%, transparent); border-radius: var(--r-md); padding: 14px; }
.confirm-box p { margin: 0; }
.confirm-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.confirm-acts .btn { flex: 1 1 120px; min-height: 48px; }
.btn-danger-soft svg { width: 20px; height: 20px; }

/* ---------- Data colours ----------
   Charts and category pictures use one colour per kind of money, the same everywhere:
   must pay (teal), debt (amber), savings (blue), can wait (violet), yours (light teal).
   Actions keep the single brand colour. Every data colour is 3:1 or more against its card. */
:root {
  --d-must: #0b6b5c;
  --d-debt: #a8640c;
  --d-save: #2f6fb3;
  --d-wait: #7a55b0;
  --d-free: #3d9682;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --d-must: #5fd0b8; --d-debt: #e8a64a; --d-save: #7eaaf0; --d-wait: #b89be6; --d-free: #2f8a76; }
}
:root[data-theme="dark"] { --d-must: #5fd0b8; --d-debt: #e8a64a; --d-save: #7eaaf0; --d-wait: #b89be6; --d-free: #2f8a76; }

.k-bill, .t-must, .tone-bill, .pocket.bill { --tone: var(--d-must); }
.k-debt, .t-debt, .tone-debt, .pocket.debt { --tone: var(--d-debt); }
.k-save, .t-save, .tone-save, .pocket.save { --tone: var(--d-save); }
.k-wait, .t-wait, .tone-wait { --tone: var(--d-wait); }
.k-free, .t-free, .tone-free { --tone: var(--d-free); }
.badge-ico.k-bill, .badge-ico.k-debt, .badge-ico.k-save, .badge-ico.k-wait, .badge-ico.k-free {
  background: var(--soft);
  background: color-mix(in srgb, var(--tone) 16%, var(--surface));
  color: var(--tone);
}
html[data-pictures] .pocket .p-pic { background: color-mix(in srgb, var(--tone, var(--ink-2)) 16%, var(--surface)); color: var(--tone, var(--ink-2)); }

.seg-bills, .seg-essentials, .dot.seg-bills { background: var(--d-must); }
.seg-debts { background: var(--d-debt); }
.seg-savings { background: var(--d-save); }
.seg-extras { background: var(--d-wait); }
.seg-yours, .seg-free { background: var(--d-free); }
.seg-hold { background: repeating-linear-gradient(45deg, var(--d-must) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--d-must); }
.goal-bar > span, .hist-bar > span { background: var(--tone, var(--brand)); }
.hist-bar.over > span { background: var(--warn); }

/* Where this paycheck goes: the split shows without opening; amounts are inside. */
.where.fold > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto; row-gap: 8px; align-items: center; }
.where.fold > summary > .chev { grid-column: 2; grid-row: 1; }
.where summary .split-bar, .where[open] summary .split-bar { display: flex; grid-column: 1 / -1; grid-row: auto; height: 12px; }
.split-key { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.split-key > span { display: inline-flex; align-items: center; gap: 6px; }
.split-key .num { color: var(--muted); font-weight: 600; }

/* Until payday: one cell per day, a dot for each bill due. */
.strip-wrap { display: grid; gap: 10px; margin-top: 16px; min-width: 0; }
.strip-wrap .row-h { justify-content: space-between; }
.strip { list-style: none; margin: 0; padding: 2px 2px 6px; display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; min-width: 0; }
.strip li { flex: none; scroll-snap-align: start; }
.day { width: 46px; min-height: 70px; display: grid; grid-template-rows: auto auto 14px; justify-items: center; align-content: center; gap: 2px; padding: 6px 0; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.day .wd { font-size: 12px; font-weight: 650; color: var(--muted); }
.day .dn { font-size: 18px; font-weight: 700; line-height: 1.1; }
.day .dots { display: flex; gap: 3px; align-items: center; height: 14px; }
.day .dots .dot { width: 8px; height: 8px; background: var(--tone); }
.day .dots .dot.paid { background: transparent; box-shadow: inset 0 0 0 1.5px var(--tone); }
.dot.tone-warn, .strip-due .tone-warn .dot { --tone: var(--warn); }
.day .dots svg { width: 14px; height: 14px; color: var(--brand); }
.day.now { border-color: var(--ink-2); }
.day.now .wd { color: var(--ink); }
.day.pay { background: var(--brand-soft); border-color: transparent; }
.day[aria-pressed="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
.strip-detail { min-height: 44px; }
.strip-due { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.strip-due li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 36px; padding: 0 2px; }
.strip-due .dot { width: 10px; height: 10px; background: var(--tone); }
.strip-due li.paid .dot { background: transparent; box-shadow: inset 0 0 0 2px var(--tone); }
.strip-due .num { font-weight: 700; }
.strip-note { display: flex; align-items: center; gap: 8px; margin: 0; min-height: 36px; }
.strip-note svg { width: 18px; height: 18px; color: var(--brand); flex: none; }

/* Past months: one stacked bar per month. */
.mchart { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 12px 12px; }
.mbars { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; align-items: end; }
.mbar { width: 100%; display: grid; grid-template-rows: 120px auto; gap: 6px; padding: 6px 2px; border: 1.5px solid transparent; border-radius: var(--r-md); background: none; font: inherit; color: var(--muted); cursor: pointer; min-height: 44px; }
.mbar-col { display: flex; align-items: flex-end; justify-content: center; }
.mbar-stack { width: min(36px, 100%); display: flex; flex-direction: column-reverse; gap: 2px; border-radius: 6px; overflow: hidden; }
.mbar-stack > span { flex-basis: 0; min-height: 2px; }
.mbar-lbl { font-size: 13px; font-weight: 650; }
.mbar[aria-pressed="true"] { border-color: var(--brand); color: var(--ink); background: var(--brand-soft); }
.mchart .split-key { margin: 0; }

/* What's ahead: owed going down, saved going up. */
.achart { margin: 12px 0 0; display: grid; gap: 6px; }
.achart svg { width: 100%; height: 110px; display: block; overflow: visible; }
.ach-base { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ach-debt { fill: none; stroke: var(--d-debt); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ach-debt-fill { fill: var(--d-debt); opacity: 0.14; }
.ach-save { fill: none; stroke: var(--d-save); stroke-width: 3; stroke-dasharray: 6 4; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ach-axis { display: flex; justify-content: space-between; }
.achart .split-key { margin: 0; }

/* Money coming in */
.add-in { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; min-height: 48px; margin-top: 10px; padding: 8px 14px; border: 1.5px dashed var(--line); border-radius: var(--r-md); background: none; font: inherit; font-weight: 650; color: var(--brand); text-align: left; cursor: pointer; }
.add-in svg { width: 20px; height: 20px; flex: none; }
.add-in .small { font-weight: 500; }
.extra-link { color: var(--d-free); font-weight: 700; }
.chip-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; }
.pick svg { width: 18px; height: 18px; color: var(--muted); }
.pick[aria-checked="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.pick[aria-checked="true"] svg { color: var(--brand); }

/* Shared bills */
.stepper { display: inline-flex; align-items: center; gap: 14px; }
.stepper .num { font-size: 22px; font-weight: 700; min-width: 2ch; text-align: center; }
.stepper .icon-btn { border: 1.5px solid var(--line); border-radius: 999px; width: 44px; height: 44px; }
.split-show { display: flex; flex-wrap: wrap; gap: 6px; }
.split-show span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.split-show span.me { background: var(--brand); color: var(--brand-ink); }
.split-show svg { width: 20px; height: 20px; }
.split-sum { margin: 0; font-size: 17px; }

/* Help with money */
.mh-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mh-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.mh-card h3 { margin: 0; }
.mh-card p { margin: 4px 0 0; }
.mh-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mh-links .btn-sm { min-height: 44px; }
.alert-line .link + .link { margin-left: 12px; }

/* ---------- Today, picture first ----------
   One ring shows the whole paycheck; the big number in the middle is the slice that's yours.
   Bills to pay are tiles with their picture; words are kept to labels. */
.example-banner { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; }
.example-banner .ex-tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; color: var(--ink); }
.example-banner .ex-tag svg { width: 16px; height: 16px; color: var(--brand); }
.example-banner .btn-sm { margin-left: auto; min-height: 44px; }

.period-nav .when-txt { display: grid; justify-items: center; gap: 0; line-height: 1.3; }
.period-nav .pn-lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.period-nav .pn-main { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 4px 8px; color: var(--ink); }
.period-nav .pn-main .link { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
.period-nav .pn-main .link svg { width: 16px; height: 16px; color: var(--muted); }

.hero .safe { align-items: center; text-align: center; gap: 10px; }
.ring-wrap { position: relative; width: min(220px, 70vw); aspect-ratio: 1; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.ring circle { fill: none; stroke-width: 12; }
.ring-track { stroke: color-mix(in srgb, var(--surface) 70%, transparent); }
.ring-seg.seg-bills { stroke: var(--d-must); }
.ring-seg.seg-debts { stroke: var(--d-debt); }
.ring-seg.seg-savings { stroke: var(--d-save); }
.ring-seg.seg-hold { stroke: var(--d-must); opacity: 0.45; }
.ring-seg.seg-yours { stroke: var(--d-free); stroke-width: 16; }
.ring-seg { background: none !important; }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; }
.hero .safe-num { font-size: 46px; line-height: 1; }
.hero .safe-num.long { font-size: 34px; }
.ring-sub { font-size: 15px; font-weight: 650; color: var(--ink-2); margin-top: 4px; }
.ring-meta { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.until { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; background: var(--surface); font-size: 15px; font-weight: 600; color: var(--ink); }
.until svg { width: 16px; height: 16px; color: var(--brand); }
.hero .safe > p.small { margin: 0; color: var(--ink-2); }
.ring-key { list-style: none; margin: 4px 0 0; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(62px, 1fr)); gap: 8px 4px; }
.rk { display: grid; justify-items: center; gap: 2px; }
.rk-bills, .rk-hold { --tone: var(--d-must); }
.rk-debts { --tone: var(--d-debt); }
.rk-savings { --tone: var(--d-save); }
.rk-yours { --tone: var(--d-free); }
.rk-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; background: var(--tone); color: var(--surface); }
.rk-ico svg { width: 18px; height: 18px; }
.rk-amt { font-weight: 700; font-size: 15px; color: var(--ink); }
.rk-lbl { font-size: 13px; font-weight: 600; color: var(--muted); }

.hero > .next { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; }
.hero > .next .badge-ico { width: 40px; height: 40px; }
.hero > .next p { margin: 0; }
.hero > .next .btn { display: inline-flex; align-items: center; gap: 6px; }
.hero > .next .btn svg { width: 20px; height: 20px; }

.payday > .add-in { align-self: center; width: auto; margin-top: 0; min-height: 44px; padding: 0 18px; border-radius: 999px; border-style: solid; background: var(--surface); }

/* To pay: tiles with pictures */
.topay { display: grid; gap: 12px; margin-top: 18px; }
.tp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tp-head h2 { margin: 0; }
.tp-count { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.tp-count strong { color: var(--ink); }
.tp-left { margin-left: auto; font-weight: 700; }
.mini-ring { width: 22px; height: 22px; transform: rotate(-90deg); }
.mini-ring circle { fill: none; stroke-width: 5; }
.mr-bg { stroke: var(--line); }
.mr-fg { stroke: var(--brand); stroke-linecap: round; }
.tp-tip { margin: 0; }
.topay .lineup { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; background: none; border: 0; border-radius: 0; overflow: visible; }
.topay .pocket { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name btn" "amt amt" "meta meta" "chip chip"; align-content: start; gap: 4px; padding: 12px; min-height: 150px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.topay .pocket .p-name { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; font-size: 15px; }
.topay .pocket .p-pic { display: inline-grid; place-items: center; width: 40px; height: 40px; margin: 0; border-radius: 12px; vertical-align: 0;
  background: color-mix(in srgb, var(--tone, var(--ink-2)) 16%, var(--surface)); color: var(--tone, var(--ink-2)); }
.topay .pocket .p-pic svg { width: 22px; height: 22px; }
.topay .pocket .p-amt { text-align: left; font-size: 20px; font-weight: 700; }
.topay .pocket .p-meta { font-size: 13px; }
.topay .pocket .p-chip { justify-self: start; }
.topay .pocket .done-btn { align-self: start; }
.topay .pocket.done { background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.topay .pocket.past { border-color: var(--adjust); }
.topay .list-sub { margin: 4px 0 0; }
.topay .paid-fold { margin-top: 2px; }

.spend-row .spend-q { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.spend-row .spend-q svg { width: 20px; height: 20px; color: var(--d-wait); }
.pocket.tone-wait { --tone: var(--d-wait); }
.ring-key { grid-template-columns: repeat(auto-fit, minmax(54px, 1fr)); gap: 8px 2px; }
.topay .lineup { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
@container room (max-width: 300px) { .topay .lineup { grid-template-columns: minmax(0, 1fr); } }
.ring-wrap { width: min(220px, 100%); }
@container room (max-width: 340px) {
  .hero > .next { grid-template-columns: auto minmax(0, 1fr); }
  .hero > .next .btn { grid-column: 1 / -1; justify-content: center; width: 100%; }
  .hero .safe-num { font-size: 40px; }
  .hero .safe-num.long { font-size: 30px; }
}
@container room (max-width: 340px) {
  .todo > .sa-row { flex-wrap: wrap; }
  .todo .sa-btns { flex: 1 1 100%; width: 100%; margin-left: 0; align-items: stretch; }
  .todo .sa-btns .btn { width: 100%; justify-content: center; }
}

/* Plan, picture first: progress rings, finish-line dates, picture stack */
.protected summary .pf-title { white-space: nowrap; }
.pic-stack { display: inline-flex; margin-left: auto; padding-left: 8px; }
.pic-stack + .chev { margin-left: 6px; }
.ps { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; margin-left: -8px; background: color-mix(in srgb, var(--tone) 16%, var(--surface)); color: var(--tone); border: 2px solid var(--surface); }
.ps:first-child { margin-left: 0; }
.ps svg { width: 15px; height: 15px; }
.ps-more { --tone: var(--muted); font-size: 12px; font-weight: 700; color: var(--ink-2); }
.plan-row .plan-main { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 4px; }
.plan-row .plan-main > * { grid-column: auto; }
.pr-pic { position: relative; width: 48px; height: 48px; display: grid; place-items: center; }
.pr-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.pr-ring circle { fill: none; stroke-width: 4; }
.pr-bg { stroke: color-mix(in srgb, var(--tone) 18%, var(--surface)); }
.pr-fg { stroke: var(--tone); stroke-linecap: round; }
.pr-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--tone) 14%, var(--surface)); color: var(--tone); }
.pr-ico svg { width: 18px; height: 18px; }
.pr-txt { display: grid; gap: 3px; min-width: 0; }
.pr-name { font-weight: 650; font-size: 17px; overflow-wrap: anywhere; }
.pr-when { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: 14px; color: var(--muted); }
.pr-when > .i { width: 15px; height: 15px; color: var(--tone); }
.pr-flag { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--soft); }
.pr-flag .i { width: 13px; height: 13px; }
.pr-sugg { font-size: 13px; }
.pr-amt { font-weight: 700; font-size: 17px; text-align: right; white-space: nowrap; }
.pr-amt .muted { font-weight: 500; font-size: 13px; }
.plan-row.done .pr-name, .plan-row.done .pr-amt { color: var(--muted); }
.df-pitch { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.df-what { display: grid; gap: 2px; min-width: 0; }
.df-save { display: grid; justify-items: end; color: var(--mint-ink); }
.df-save strong { font-size: 24px; line-height: 1.1; }
.debt-first > .btn .i { width: 18px; height: 18px; }
.seg [data-act="extra"] { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg [data-act="extra"] .i { width: 18px; height: 18px; }
@container room (max-width: 340px) {
  .plan-row .plan-main { grid-template-columns: 44px minmax(0, 1fr); }
  .pr-pic { width: 44px; height: 44px; }
  .plan-row .plan-main > .pr-amt { grid-column: 2; text-align: left; }
  .plan-row .pos { width: 28px; }
  .df-pitch { grid-template-columns: auto minmax(0, 1fr); }
  .df-save { grid-column: 2; justify-items: start; grid-auto-flow: column; align-items: baseline; gap: 6px; }
}

/* Setup, picture first */
.w-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.w-steps > span[aria-hidden] { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: 15px; }
.w-steps .i { width: 18px; height: 18px; color: var(--brand); }
.w-steps .w-time { background: none; border-style: dashed; color: var(--muted); }
.legal-line .i { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.choice .fq-dots { display: grid; grid-template-columns: repeat(4, 8px); gap: 4px; flex: none; width: 44px; place-items: center; }
.fq-dots i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--line); }
.fq-dots i.on { background: var(--brand); border-color: var(--brand); }
.fq-dots b { grid-column: 1 / -1; font-size: 18px; color: var(--muted); }
.daypick { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.dp { display: grid; justify-items: center; align-content: center; gap: 1px; min-height: 60px; padding: 6px 0; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.dp-wd { font-size: 12px; color: var(--muted); font-weight: 600; }
.dp-n { font-size: 18px; font-weight: 700; line-height: 1.1; }
.dp-m { font-size: 11px; color: var(--muted); font-weight: 600; }
.dp[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.dp[aria-pressed="true"] .dp-wd, .dp[aria-pressed="true"] .dp-m { color: inherit; }
.dp:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.more-chip { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; min-height: 44px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--soft); color: var(--ink-2); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.more-chip .i { width: 16px; height: 16px; }
.more-chip .i:last-child { color: var(--muted); }
.ready-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rt { display: grid; gap: 4px; align-content: start; padding: 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.rt-wide { grid-column: 1 / -1; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; }
.rt-wide .badge-ico { grid-row: span 2; }
.rt-wide .rt-next { grid-column: 1 / -1; }
.rt-big { font-size: 24px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.rt-lbl { font-size: 14px; color: var(--muted); font-weight: 600; }
.rt-next { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); }
.rt-next .i { width: 16px; height: 16px; }
@container room (max-width: 300px) {
  .daypick { gap: 3px; }
  .dp-n { font-size: 16px; }
  .ready-tiles { grid-template-columns: minmax(0, 1fr); }
}
.choice .fq-dots + span { flex: 1; text-align: left; }

/* Ask before throwing away typing */
.discard { display: grid; gap: 8px; margin: 0 0 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--soft); border: 1px solid var(--line); font-weight: 600; }
.discard .btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sheet:has(#ex-pass:not(:placeholder-shown)) .nopass-note { display: none; }

/* Payday soon, and the reminder choice at the end of setup */
.soon { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; margin-top: 10px; padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.soon > .i:first-child { width: 22px; height: 22px; color: var(--brand); flex: none; }
.soon > span { flex: 1; display: grid; }
.soon > .i:last-child { width: 18px; height: 18px; color: var(--muted); flex: none; }
.soon:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.remind-choice { margin-top: 12px; justify-content: flex-start; }
.remind-choice > span:nth-child(2) { flex: 1; }
