:root {
  --bg: #f6f7f5; --surface: #ffffff; --surface-2: #f0f2ef; --text: #16201d; --muted: #5f6b67;
  --line: #e2e6e3; --brand: #0f766e; --brand-ink: #ffffff; --pos: #15803d; --neg: #b42318; --budget-bar: #c4e3de;
  --in: #0f766e; --out: #d97706; --focus: #14b8a6; --radius: 14px;
  /* chart series: validated categorical palette, fixed order (light steps) */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  --s-other: #b8b7b0; --grid: #e6e8e5; --warn: #b45309; --good: #15803d;
  --money-in: #d3d8d5; --hi: rgba(15, 118, 110, .07);
  --heat-lo: #e2ecf6; --heat-hi: #063970; --cal-in: #cfeedd; --cal-in-ink: #166534;
  --shadow: 0 1px 2px rgba(16, 24, 20, .05), 0 4px 16px rgba(16, 24, 20, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1412; --surface: #151d1a; --surface-2: #1c2622; --text: #e8eeeb; --muted: #97a39e;
    --line: #26322e; --brand: #2dd4bf; --brand-ink: #062a26; --pos: #4ade80; --neg: #f87171; --budget-bar: #2f5751;
    --in: #2dd4bf; --out: #fbbf24; --shadow: none; color-scheme: dark;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --s-other: #5c5b56; --grid: #26322e; --warn: #fbbf24; --good: #4ade80;
    --money-in: #45514d; --hi: rgba(45, 212, 191, .08);
    --heat-lo: #142236; --heat-hi: #a3c4e8; --cal-in: #173d2a; --cal-in-ink: #4ade80;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 12px; }
h2 { font-size: 16px; margin: 0 0 12px; }
a { color: var(--brand); }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }

label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 14px; }
label.check { flex-direction: row; align-items: center; font-weight: 400; }
input, select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; min-height: 42px; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
button, .button { font: inherit; font-weight: 600; border-radius: 10px; padding: 10px 16px; min-height: 42px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
button.primary, .button.primary { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
button.ghost { background: transparent; }
button:disabled { opacity: .45; cursor: not-allowed; }
.danger-btn { background: var(--neg); color: #fff; border-color: transparent; }

/* ---- tiles, filters, charts ---- */
.tiles.six { grid-template-columns: repeat(6, 1fr); }
.tiles.four { grid-template-columns: repeat(4, 1fr); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 0 0 16px; }
.filters input[type=search] { flex: 1 1 180px; }
label.inline { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.donut-card { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: center; }
.donut-wrap { position: relative; width: 220px; height: 220px; }
.donut-wrap svg { width: 100%; height: 100%; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center strong { font-size: 18px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.donut-seg { cursor: pointer; transition: opacity .15s; }
.donut-seg.dim { opacity: .25; }
.donut-legend { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 2px; }
.donut-legend button { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 10px; align-items: center; width: 100%;
  background: none; border: 0; min-height: 34px; padding: 4px 8px; font-weight: 400; font-size: 14px; text-align: left; border-radius: 8px; }
.donut-legend button:hover, .donut-legend button.on { background: var(--surface-2); }
.donut-legend .sw { width: 12px; height: 12px; border-radius: 3px; }
.donut-legend .pct { font-weight: 600; font-variant-numeric: tabular-nums; }
.donut-legend .amt { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 90px; text-align: right; }
.tooltip { position: fixed; z-index: 20; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(0,0,0,.15); border-radius: 10px; padding: 8px 10px; font-size: 13px; line-height: 1.4; max-width: 240px; }
.tooltip b { display: block; }
.tooltip .k { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }

/* ---- savings growth ---- */
.growth-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 12px 0 16px; }
.growth-controls input[type=range] { min-height: 0; padding: 0; border: 0; background: none; accent-color: var(--brand); }
.growth-controls .seg { margin: 0; }
.tiles.three { grid-template-columns: repeat(3, 1fr); }
.growth-tiles .tile { box-shadow: none; background: var(--surface-2); border-color: transparent; }
.chart-legend i.k-dep { background: var(--s1); }
.chart-legend i.k-grow { background: var(--s2); }

/* ---- loans ---- */
.grid2.tight { gap: 12px; }
.card.loan { display: flex; flex-direction: column; gap: 14px; border-left: 5px solid var(--loan, var(--line)); scroll-margin-top: 80px; }
.loan-head { display: flex; gap: 12px; align-items: center; }
.loan-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 22px;
  background: color-mix(in srgb, var(--loan) 16%, transparent); flex: none; }
.loan-tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.loan-tag.yours { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.linkish { background: none; border: 0; padding: 0; min-height: 0; color: var(--brand); font-weight: 500; font-size: 13px; text-decoration: underline; }
.loan-table a { color: inherit; text-decoration: none; font-weight: 600; }
.loan-table a:hover { text-decoration: underline; }
.loan-table .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-right: 8px; vertical-align: -1px; }
.table-scroll { overflow-x: auto; margin-bottom: 12px; }
.from-statements { background: var(--surface-2); border-radius: 12px; padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; font-size: 14px; }
.from-statements .ok { color: var(--good); font-weight: 700; margin-right: 6px; }
.from-statements label { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 400; font-size: 13px; }
.from-statements select { min-height: 34px; padding: 4px 8px; font-size: 13px; max-width: 100%; }
.from-statements table { font-size: 13px; }
.note { font-size: 13px; background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--text); border-radius: 10px; padding: 10px 12px; }
.loan-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.loan-stats div { display: flex; flex-direction: column; gap: 2px; }
.loan-stats span { font-size: 12px; color: var(--muted); }
.loan-stats strong { font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--line); stroke-width: 1; }
.chart .today { stroke: var(--muted); stroke-dasharray: 3 3; }
.chart-legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); align-items: center; flex-wrap: wrap; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.extra { background: var(--surface-2); border-radius: 12px; padding: 14px; display: grid; gap: 8px; }
.extra input[type=range] { width: 100%; min-height: 0; padding: 0; border: 0; background: none; accent-color: var(--brand); }
.extra .res { font-size: 14px; }
.loan-actions { display: flex; gap: 8px; }

/* ---- currency picker ---- */
.currency-pick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.currency-pick legend { font-weight: 500; font-size: 14px; padding: 0; margin-bottom: 6px; }
.currency-pick label { position: relative; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 4px; cursor: pointer; font-weight: 400; font-size: 12px; color: var(--muted); }
.currency-pick input { position: absolute; opacity: 0; pointer-events: none; }
.currency-pick .sym { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.2; }
.currency-pick label:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); color: var(--text); }
.currency-pick label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 1px; }

/* ---- beta, feedback, legal links ---- */
.beta-tag { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand);
  border: 1px solid currentColor; border-radius: 99px; padding: 1px 7px; }
.legal-links { text-align: center; padding: 24px 16px 8px; }
.legal-links a { color: var(--muted); }
.legal-links p { margin: 6px 0 0; }
label.terms { align-items: flex-start; font-size: 13px; line-height: 1.45; }
label.terms input { margin-top: 3px; min-height: 0; }
textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; resize: vertical; }
dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); padding: 24px;
  width: min(480px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog h2, h2.flush-h { margin: 0; }

/* ---- auth ---- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 28px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.tagline { color: var(--muted); margin: 8px 0 12px; }
.lang-switch { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 20px; }
.lang-switch button { min-height: 30px; padding: 4px 10px; font-size: 13px; font-weight: 500; border-radius: 99px; background: transparent; color: var(--muted); }
.lang-switch button.on { background: var(--hi); color: var(--brand); border-color: var(--brand); font-weight: 700; }
.qr { width: 200px; height: 200px; align-self: center; background: #fff; border-radius: 12px; padding: 6px; }
.codes { columns: 2; font: 15px ui-monospace, Menlo, monospace; background: var(--surface-2); border-radius: 12px; padding: 14px 14px 14px 36px; margin: 0; }
.error { color: var(--neg); background: color-mix(in srgb, var(--neg) 10%, transparent); padding: 10px 12px; border-radius: 10px; }
.trust { margin: 20px 0 0; text-align: center; }

/* ---- shell ---- */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 10px 24px;
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.topbar nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 500; white-space: nowrap; }
.topbar nav a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.content { max-width: 1040px; margin: 0 auto; padding: 24px 24px 64px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + .card, .tiles + .grid2 { margin-top: 16px; }
.empty { text-align: center; padding: 48px 16px; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 8px 0 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.tile .label { color: var(--muted); font-size: 13px; }
.tile .value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; align-items: center; font-size: 14px;
  background: none; border: 0; padding: 4px 6px; margin: 0 -6px; min-height: 0; font-weight: 400; text-align: left; border-radius: 8px; width: calc(100% + 12px); }
button.bar-row:hover { background: var(--surface-2); }
.bar-track { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--brand); border-radius: 99px; }
.bar-row .amt { font-variant-numeric: tabular-nums; color: var(--muted); }

.insights { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.insights li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; font-size: 14px; }
.insights .ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--surface-2); color: var(--muted); }
.insights .warn .ic { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.insights .good .ic { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.suggest { margin-top: 16px; background: var(--surface-2); border-radius: 12px; padding: 14px; }
.suggest:empty { display: none; }

.trend { display: flex; align-items: flex-end; gap: 14px; height: 180px; padding-top: 8px; overflow-x: auto; }
.trend .m { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 44px; flex: 1; height: 100%; }
.trend .pair { flex: 1; display: flex; align-items: flex-end; gap: 3px; width: 100%; justify-content: center; }
.trend .b { width: 14px; border-radius: 4px 4px 0 0; min-height: 2px; }
.trend .b.in, .dot.in { background: var(--in); } .trend .b.out, .dot.out { background: var(--out); }
.trend .m span { font-size: 12px; color: var(--muted); }
.legend { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 6px; }

table.tx { width: 100%; border-collapse: collapse; font-size: 14px; }
.tx th { text-align: left; color: var(--muted); font-weight: 500; font-size: 13px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.tx td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.card:not(.flush) .tx td { padding: 10px 4px; }
.tx tr:last-child td { border-bottom: 0; }
.tx .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx select { min-height: 34px; padding: 4px 8px; font-size: 13px; }
.tx .desc { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-method { display: inline-block; width: 18px; height: 18px; margin-right: 8px; vertical-align: -4px; color: var(--muted); }
.tx-method svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#tx-search { min-width: 180px; }

.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; align-items: center; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--brand); }
.drop input { max-width: 100%; border: 0; min-height: 0; padding: 0; background: none; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 3px; margin-bottom: 16px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; min-height: 36px; padding: 6px 12px; font-weight: 500; }
.seg button.on { background: var(--surface); box-shadow: var(--shadow); }
.preview { background: var(--surface-2); border-radius: 10px; padding: 12px; margin: 0; font-size: 14px; }
.preview:empty { display: none; }

.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.plan { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.plan .big { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.progress { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--brand); }
.weeks { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; max-height: 190px; overflow-y: auto; }
.weeks button { min-height: 38px; padding: 2px; font-size: 11px; font-weight: 500; flex-direction: column; border-radius: 8px; line-height: 1.2; }
.weeks button.done { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.weeks button.now { outline: 2px solid var(--out); }
.plan form { display: flex; gap: 8px; }
.plan form input { flex: 1; min-width: 0; }

details.danger { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
details.danger summary { color: var(--neg); cursor: pointer; font-weight: 600; }
details.danger form { margin-top: 12px; max-width: 360px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; font-weight: 500; z-index: 10; max-width: calc(100% - 32px); }

@media (max-width: 1000px) {
  .tiles.six { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .topbar { padding: 8px 16px; flex-wrap: wrap; gap: 8px; }
  .topbar nav { order: 3; flex-basis: 100%; }
  .topbar > button { margin-left: auto; }
  .tile .value { font-size: 17px; }
  .content { padding: 16px 16px 48px; }
  .grid2 { grid-template-columns: 1fr; }
  .tiles, .tiles.six, .tiles.four { grid-template-columns: 1fr 1fr; }
  .donut-card { grid-template-columns: 1fr; justify-items: center; }
  .donut-card > div:last-child { width: 100%; }
  .loan-stats { grid-template-columns: 1fr 1fr; }
  .growth-controls { grid-template-columns: 1fr; gap: 12px; }
  .tiles.three { grid-template-columns: 1fr 1fr; }
  .chart text { font-size: 20px; }   /* charts scale down ~50% on phones; keep labels readable */
  .currency-pick { grid-template-columns: repeat(2, 1fr); }
  .bar-row { grid-template-columns: 96px 1fr auto; }
  .tx-list th:nth-child(1), .tx-list td.date { display: none; }
  .tx td, .tx th { padding: 10px 10px; }
  .tx .desc { max-width: 140px; }
  #tx-search { min-width: 0; width: 100%; }
}

/* ---- legal pages ---- */
.legal-page { max-width: 760px; margin: 0 auto; padding: 24px 16px 64px; line-height: 1.65; }
.legal-page header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.legal-page h1 { font-size: 30px; margin: 8px 0 4px; }
.reminder-page form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.legal-page h2 { font-size: 19px; margin: 32px 0 8px; }
.legal-page h3 { font-size: 16px; margin: 20px 0 6px; }
.legal-page table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; }
.legal-page th, .legal-page td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal-page .draft { background: color-mix(in srgb, var(--warn) 14%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.legal-page .review { background: color-mix(in srgb, var(--s1) 10%, transparent); border-left: 4px solid var(--s1);
  padding: 8px 12px; border-radius: 6px; font-size: 13px; margin: 10px 0; }
.legal-page .review::before { content: "Review note for lawyer: "; font-weight: 700; }
.legal-page .table-scroll { overflow-x: auto; }

.legal-page header .brand { text-decoration: none; color: var(--text); }

/* ---- savings inbox ---- */
.inbox { border-left: 5px solid var(--brand); }
.inbox-rows { display: grid; gap: 10px; }
.inbox-row { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; align-items: center; padding: 12px;
  background: var(--surface-2); border-radius: 12px; }
.inbox-row .what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inbox-row .what strong { font-variant-numeric: tabular-nums; font-size: 17px; }
.inbox-row .what span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-row .how { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.inbox-row select { min-height: 38px; padding: 6px 10px; }
.inbox-row .remember { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 8px; font-weight: 400; font-size: 13px; color: var(--muted); }
.inbox-row .remember input { min-height: 0; }
.plan-deposits { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.plan-deposits li { display: flex; justify-content: space-between; gap: 8px; align-items: center; color: var(--muted); }
.plan-deposits li b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.plan-deposits .src { font-size: 11px; padding: 0 6px; border-radius: 99px; background: var(--surface-2); margin-left: 6px; }
@media (max-width: 760px) {
  .inbox-row { grid-template-columns: 1fr; }
  .inbox-row .how { justify-content: flex-start; }
}

/* ---- overview day-by-day calendar ---- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 14px 0 10px; }
.cal-head { font-size: 12px; color: var(--muted); text-align: center; font-weight: 600; }
.cal-day { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 2px;
  min-height: 62px; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  font-weight: 400; text-align: left; font-variant-numeric: tabular-nums; }
.cal-day .n { font-size: 13px; color: var(--muted); }
.cal-day .amt { font-size: 13px; font-weight: 600; white-space: nowrap; }
.cal-day.blank { border: 0; background: none; }
.cal-day.future { opacity: .4; cursor: default; }
.cal-day.in { background: var(--cal-in); border-color: transparent; color: var(--cal-in-ink); }
.cal-day.in .n { color: inherit; }
.cal-day.out { background: color-mix(in oklab, var(--heat-hi) var(--t), var(--heat-lo)); border-color: transparent; color: #063970; }
.cal-day.out .n { color: inherit; opacity: .75; }
.cal-day.out.mid { color: #fff; }
.cal-day:not(.future):not(.blank):hover { outline: 2px solid var(--focus); outline-offset: 1px; }
.chart-legend i.k-cal-in { background: var(--cal-in); }
.cal-scale { display: inline-flex; align-items: center; gap: 8px; }
.cal-scale i { width: 90px; height: 10px; border-radius: 3px; margin: 0;
  background: linear-gradient(90deg, color-mix(in oklab, var(--heat-hi) 6%, var(--heat-lo)), var(--heat-hi)); }
/* dark mode runs dim to bright, so the text flips the other way and later */
@media (prefers-color-scheme: dark) { .cal-day.out, .cal-day.out.mid { color: #deeaf7; } .cal-day.out.high { color: #05264a; } }
@media (max-width: 600px) {
  .cal { gap: 3px; }
  .cal-day { min-height: 48px; padding: 5px 4px; border-radius: 7px; }
  .cal-day .n { font-size: 11px; }
  .cal-day .amt { font-size: 10.5px; letter-spacing: -.02em; }
}

/* ---- overview cash-flow chart ---- */
.cashflow { margin: 8px 0 4px; }
.cf-help { margin: 4px 0 0; max-width: 640px; }
.chart-legend i.k-in { background: var(--money-in); }
.chart-legend i.k-exp { background: var(--s1); }
.chart-legend i.k-debt { background: var(--s2); }
.chart-legend i.k-sav { background: var(--s3); }
.chart .cf-group { cursor: pointer; }
.chart .cf-net { font-size: 12px; font-weight: 700; }
.chart .cf-net.pos { fill: var(--good); }
.chart .cf-net.neg { fill: var(--neg); }
.chart .cf-month.on { fill: var(--text); font-weight: 700; }
@media (max-width: 760px) { .chart .cf-net { font-size: 19px; } }
.plan-deposits .linkish { margin-left: 10px; }
.chart.compact text { font-size: 11px; }
.chart.compact .cf-net { font-size: 12px; }
@media (max-width: 760px) {
  .topbar > button { min-height: 34px; padding: 6px 10px; font-size: 13px; }
  .topbar > button + button { margin-left: 0; }
}
.inbox-row .how input[type=text] { min-height: 38px; padding: 6px 10px; width: 230px; max-width: 100%; }
@media (max-width: 760px) { .inbox-row .how input[type=text] { width: 100%; } }

/* ---- front page ---- */
a.brand.plain { text-decoration: none; color: var(--text); }
.button.big { min-height: 50px; padding: 12px 22px; font-size: 16px; }
.landing main { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.lp-nav { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.lp-nav nav { display: flex; align-items: center; gap: 8px; }
.lp-nav nav > span { display: flex; gap: 8px; }
.lp-link { color: var(--muted); text-decoration: none; font-weight: 500; padding: 8px 10px; }
.lp-link:hover { color: var(--text); }

.lp-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding: 72px 0 56px; }
.lp-eyebrow { color: var(--brand); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 13px; margin: 0 0 12px; }
.lp-hero h1 { font-size: clamp(40px, 6vw, 64px); line-height: 1.03; letter-spacing: -.035em; margin: 0 0 20px; }
.lp-lead { font-size: 19px; line-height: 1.55; color: var(--muted); margin: 0 0 28px; max-width: 34em; }
.lp-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

.lp-preview { display: flex; justify-content: center; }
.lp-phone { width: 100%; max-width: 340px; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 18px;
  box-shadow: 0 30px 80px rgba(15, 60, 50, .18), 0 2px 6px rgba(0,0,0,.06); display: grid; gap: 12px; transform: rotate(1.5deg); }
.lp-phone-top { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.lp-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lp-tiles div { background: var(--surface-2); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.lp-tiles span { font-size: 11px; color: var(--muted); }
.lp-tiles b { font-size: 17px; letter-spacing: -.02em; }
.lp-chart { width: 100%; height: auto; }
.lp-chart .lp-base { stroke: var(--line); }
.lp-chart .lp-in { fill: var(--money-in); } .lp-chart .lp-exp { fill: var(--s1); }
.lp-chart .lp-debt { fill: var(--s2); } .lp-chart .lp-sav { fill: var(--s3); }
.lp-chart text { font-size: 10px; fill: var(--muted); text-anchor: middle; }
.lp-insight { display: grid; grid-template-columns: 20px 1fr; gap: 8px; font-size: 12.5px; align-items: center; }
.lp-insight .ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }

.lp-section { padding: 56px 0; border-top: 1px solid var(--line); }
.lp-section > h2, .lp-final h2 { font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.025em; margin: 0 0 28px; }
.lp-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.lp-steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.lp-steps span { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 700; }
.lp-steps h3, .lp-feature h3 { font-size: 17px; margin: 14px 0 6px; }
.lp-steps p, .lp-feature p { color: var(--muted); margin: 0; }
.lp-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.lp-feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.lp-icon { font-size: 28px; }

.lp-privacy { display: grid; grid-template-columns: .8fr 1.2fr; gap: 40px; align-items: start; }
.lp-privacy h2 { margin-bottom: 12px; }
.lp-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lp-checks li { position: relative; padding-left: 30px; }
.lp-checks li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--brand-ink); background: var(--brand); }
.lp-checks.small li { font-size: 14px; }

.lp-pricing { display: grid; grid-template-columns: repeat(2, minmax(0, 360px)); gap: 20px; }
/* "Coming next" plan: a quieter card under the two real ones, across the full width */
.lp-price-card.lp-next { grid-column: 1 / -1; box-shadow: none; border-style: dashed; padding: 20px 26px; }
.lp-next .lp-price { font-size: 26px; }
.lp-price-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px; }
.lp-price-card.featured { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow); }
.lp-price-card .button { margin-top: auto; }
.lp-plan { margin: 0; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .04em; font-size: 13px; }
.lp-price { margin: 0; font-size: 40px; font-weight: 800; letter-spacing: -.03em; }
.lp-price span { font-size: 16px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.lp-price-card .muted { margin: 0 0 6px; }

.lp-faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 10px; }
.lp-faq summary { font-weight: 600; cursor: pointer; }
.lp-faq details p { color: var(--muted); margin: 10px 0 0; }
.lp-final { text-align: center; padding: 64px 0 40px; border-top: 1px solid var(--line); }
.lp-join { display: grid; grid-template-columns: 1.3fr .7fr; gap: 32px; align-items: center; background: var(--hi);
  border: 1px solid var(--line); border-radius: 20px; padding: 32px; }
.lp-join h2 { margin: 0 0 12px; font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.025em; }
.lp-join .lp-lead { margin: 0; }
.lp-join-actions { display: flex; flex-direction: column; gap: 6px; }
.lp-join-actions p { margin: 4px 0 0; }
.lp-join-promise { margin: 14px 0 0; }
.lp-join-actions form { gap: 10px; }
.lp-join-actions .button.big { width: 100%; }
.lp-ok { color: var(--pos); background: color-mix(in srgb, var(--pos) 10%, transparent); padding: 10px 12px; border-radius: 10px; }
.lp-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }   /* honeypot for form bots */

@media (max-width: 900px) {
  .lp-hero { grid-template-columns: 1fr; padding: 40px 0 32px; gap: 32px; }
  .lp-phone { transform: none; }
  .lp-features { grid-template-columns: 1fr 1fr; }
  .lp-privacy { grid-template-columns: 1fr; gap: 16px; }
  .lp-join { grid-template-columns: 1fr; gap: 20px; padding: 24px; }
}
@media (max-width: 640px) {
  .landing main { padding: 0 16px; }
  .lp-nav { padding: 10px 16px; }
  .lp-link { display: none; }
  .lp-nav .button { min-height: 36px; padding: 6px 12px; font-size: 14px; }
  .lp-steps, .lp-features, .lp-pricing { grid-template-columns: 1fr; }
  .lp-lead { font-size: 17px; }
  .lp-section { padding: 40px 0; }
}
@media (max-width: 340px) { .lp-nav .button.ghost { display: none; } }

/* ---- front page: language switch ---- */
.lp-lang { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; margin-right: 4px; }
.lp-lang button { min-height: 30px; padding: 4px 9px; border: 0; background: transparent; font-size: 12px; font-weight: 700;
  letter-spacing: .03em; color: var(--muted); border-radius: 8px; }
.lp-lang button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
@media (max-width: 520px) {
  /* phones: the hero right below has both buttons, so the header keeps just the logo and the language switch */
  .lp-nav nav > [data-signed-out], .lp-nav nav > [data-signed-in] { display: none !important; }
  .lp-lang { margin-right: 0; }
}

/* ---- line icons (replace emoji) ---- */
svg.icon { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lp-icon { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; font-size: 30px;
  color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.loan-icon { color: var(--loan); font-size: 24px; }
.loan-kind { display: flex; align-items: center; gap: 6px; }
.loan-kind svg.icon { font-size: 15px; }
#billing-actions { flex-direction: column; align-items: stretch; max-width: 560px; }
#billing-actions .button, #billing-actions button { justify-content: flex-start; text-align: left; }
.lp-year { margin: -4px 0 4px; font-weight: 600; color: var(--brand); }

/* ---- savings: bucket picker, tiles, in/out rows ---- */
.bp { position: relative; }
.bp-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 10px; font-weight: 500; max-width: 260px; }
.bp-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-chev { color: var(--muted); font-size: 12px; margin-left: auto; }
.bp-ic { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; flex: none; font-size: 17px;
  color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.bp-ic.none { color: var(--muted); background: var(--surface-2); font-size: 13px; }
.bp-menu { position: absolute; z-index: 15; right: 0; top: calc(100% + 6px); width: 300px; max-width: calc(100vw - 32px); max-height: 360px;
  overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.bp-group { margin: 8px 6px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.bp-group:empty { margin: 4px 0; border-top: 1px solid var(--line); }
.bp-opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 8px; border: 0; background: none;
  font-weight: 500; text-align: left; border-radius: 10px; }
.bp-opt:hover, .bp-opt:focus-visible, .bp-opt[aria-selected="true"] { background: var(--surface-2); }
.bp-extra { margin-left: auto; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.bp-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.bp-presets .bp-opt { font-size: 13px; }

.bucket-tiles { display: grid; gap: 8px; }
.bucket-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.bucket-tile { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 10px; font-weight: 500; font-size: 13px; justify-content: flex-start; }
.bucket-tile[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }

.plan-head { display: flex; align-items: center; gap: 10px; }
.plan-ic { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; font-size: 21px;
  color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }

.inbox-row.out { border-left: 3px solid var(--warn); }
.dir-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.dir-tag.in { color: var(--good); } .dir-tag.out { color: var(--warn); }
.inbox-row .what .linkish { align-self: flex-start; font-size: 12px; }
.inbox-row .how .amt-in { width: 110px; min-height: 38px; padding: 6px 10px; }
.week-pick { grid-column: 1 / -1; display: grid; gap: 6px; }
.weeks.small-weeks { max-height: 120px; }
.weeks button.stmt { box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--brand-ink) 45%, transparent); }
@media (max-width: 760px) {
  .bp-toggle { max-width: 100%; }
  .bp-menu { left: 0; right: auto; }
  .inbox-row .how .amt-in { width: 100%; }
}
.bp-opt, .bp-toggle { justify-content: flex-start; }

/* getting-started checklist */
.small-btn { min-height: 34px; padding: 6px 12px; font-size: 14px; }
.onboarding { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.ob-progress { height: 6px; border-radius: 3px; background: var(--surface-2); margin: 14px 0 6px; overflow: hidden; }
.ob-fill { height: 100%; width: 0; background: var(--brand); border-radius: 3px; transition: width .3s ease; }
.ob-steps { list-style: none; margin: 8px 0 0; padding: 0; }
.ob-step { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.ob-check { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.ob-step.next .ob-check { border-color: var(--brand); }
.ob-step.done .ob-check { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.ob-step.done strong { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.ob-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ob-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) {
  .ob-step { flex-wrap: wrap; }
  .ob-actions { width: 100%; padding-left: 38px; justify-content: flex-start; }
}

/* monthly budgets */
.budgets-empty p { margin: 12px 0; max-width: 560px; }
.bchart { margin: 10px 0 4px; }
.bc-row { display: grid; grid-template-columns: 140px 1fr 92px; align-items: center; gap: 12px; width: 100%;
  background: transparent; border: 0; border-radius: 0; padding: 0; min-height: 0; font-weight: 400; color: inherit;
  text-align: left; cursor: pointer; justify-content: stretch; }
.bc-row:hover .bc-label { color: var(--brand); text-decoration: underline; }
.bc-label { font-size: 14px; font-weight: 600; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-plot { position: relative; height: 46px; border-left: 1.5px solid var(--muted); }
.bc-grid span { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--grid); }
.bc-budget { position: absolute; left: 0; top: 6px; bottom: 6px; background: var(--budget-bar); border-radius: 0 4px 4px 0; }
.bc-spent { position: absolute; left: 0; top: 15px; bottom: 15px; background: var(--brand); border-radius: 0 3px 3px 0;
  min-width: 2px; transition: width .3s ease; }
.bc-row.close .bc-spent { background: var(--warn); }
.bc-row.over .bc-spent { background: var(--neg); }
.bc-val { position: absolute; top: 50%; transform: translateY(-50%); font-size: 13px; font-weight: 700;
  white-space: nowrap; color: var(--text); }
.bc-val.inside { right: 6px; color: #fff; }
.bc-target { position: absolute; top: 1px; bottom: 1px; width: 3px; margin-left: -1.5px; background: var(--text); border-radius: 2px; }
.bc-limit { display: flex; flex-direction: column; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.bc-limit small { font-weight: 400; font-size: 12px; color: var(--muted); }
.bc-row.over .bc-limit small { color: var(--neg); font-weight: 600; }
.bc-row.close .bc-limit small { color: var(--warn); }
.bc-axis { display: grid; grid-template-columns: 140px 1fr 92px; gap: 12px; height: 22px; border-top: 0; }
.bc-ticks { position: relative; border-top: 1.5px solid var(--muted); }
.bc-ticks span { position: absolute; top: 4px; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.bc-ticks span:first-child { transform: none; }
.bc-ticks span:last-child { transform: translateX(-100%); }
.bchart-legend { margin-top: 10px; }
.bchart-legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.bchart-legend .lg-budget { background: var(--budget-bar); height: 12px; }
.bchart-legend .lg-spent { background: var(--brand); height: 6px; vertical-align: 1px; }
.bchart-legend .lg-target { background: var(--text); width: 3px; height: 14px; vertical-align: -3px; }
.bchart-legend .lg-over { background: var(--neg); height: 6px; vertical-align: 1px; }
.bc-sum { display: none; }
@media (max-width: 560px) {
  /* Phones: name and "$321 of $400 · $79 left" on one line, a full-width bar underneath. */
  .bc-row { grid-template-columns: 1fr auto; grid-template-areas: "label sum" "plot plot"; gap: 4px 10px; padding: 10px 0;
    border-bottom: 1px solid var(--line); }
  .bc-row:last-of-type { border-bottom: 0; }
  .bc-label { grid-area: label; text-align: left; font-size: 14px; white-space: normal; }
  .bc-sum { grid-area: sum; display: block; font-size: 13px; font-weight: 600; text-align: right; white-space: nowrap;
    font-variant-numeric: tabular-nums; color: var(--muted); }
  .bc-row.over .bc-sum { color: var(--neg); }
  .bc-row.close .bc-sum { color: var(--warn); }
  .bc-plot { grid-area: plot; height: 26px; border-left: 0; }
  .bc-budget { top: 3px; bottom: 3px; border-radius: 4px; }
  .bc-spent { top: 8px; bottom: 8px; border-radius: 3px; }
  .bc-limit, .bc-val, .bc-axis, .bc-grid { display: none; }
}
}
.wide-dialog { width: min(560px, calc(100% - 32px)); max-height: calc(100vh - 48px); }
.budget-inputs { display: flex; flex-direction: column; max-height: 52vh; overflow-y: auto; border-top: 1px solid var(--line); }
.budget-input { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-weight: 400; }
.budget-input > span { display: flex; flex-direction: column; gap: 2px; font-weight: 600; }
.budget-input input { width: 120px; flex: none; text-align: right; }
#budgets-suggest { align-self: flex-start; }

/* bills and subscriptions */
.bill-rows { list-style: none; margin: 8px 0 0; padding: 0; }
.bill-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.bill-date { flex: none; width: 44px; border: 1px solid var(--line); border-radius: 10px; text-align: center; padding: 4px 0;
  display: flex; flex-direction: column; line-height: 1.15; }
.bill-date span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.bill-date b { font-size: 17px; }
.bill-row.paid .bill-date { background: var(--surface-2); }
.bill-row.paid .bill-status { color: var(--good); font-weight: 600; }
.bill-row.check .bill-status { color: var(--warn); }
.bill-row.is-hidden { opacity: .55; }
.bill-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.bill-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bill-change { color: var(--warn); font-weight: 600; }
.bill-amt { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
button.bill-hide { min-height: 32px; padding: 4px 10px; color: var(--muted); }
#bills-show-hidden { margin-top: 8px; }
#bills-sub { text-align: right; }
@media (max-width: 560px) {
  .bill-main strong { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
  .bill-row { gap: 10px; }
}

/* split a savings transfer over several buckets */
.split-toggle { margin-top: 6px; }
.split-box { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.split-box > p { margin: 0 0 8px; }
.split-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.split-name { flex: 1; min-width: 0; font-weight: 600; }
.split-row .amt-in { width: 120px; flex: none; text-align: right; }
.split-status { margin: 10px 0; font-weight: 600; color: var(--muted); }
.split-status.good { color: var(--good); }
.split-status.bad { color: var(--neg); }
@media (max-width: 560px) {
  .split-row { flex-wrap: wrap; }
  .split-name { flex-basis: calc(100% - 40px); }
  .split-row .amt-in { flex: 1; width: auto; }
}

/* help page */
.help-page header { flex-wrap: wrap; gap: 12px; }
.help-page .lang-switch { margin: 0; }
.help-page .lead { color: var(--muted); }
.help-toc { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 16px 0 8px; font-size: 14px; }
.help-page h2 { margin-top: 32px; scroll-margin-top: 16px; }
.help-page details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.help-page summary { cursor: pointer; font-weight: 600; padding: 10px 0; list-style-position: outside; }
.help-page summary:hover { color: var(--brand); }
.help-page details p { margin: 0 0 14px; color: var(--text); }

/* Phones: long tables become stacked rows instead of overflowing the screen */
@media (max-width: 760px) {
  .tx-list thead { display: none; }
  .tx-list tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "desc amt" "cat date";
    gap: 6px 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .tx-list tr:last-child { border-bottom: 0; }
  .tx-list td { padding: 0 !important; border: 0; }
  .tx-list td.desc { grid-area: desc; max-width: none; white-space: normal; overflow-wrap: anywhere; font-weight: 600; }
  .tx-list td.amt { grid-area: amt; font-weight: 700; }
  .tx-list td.cat { grid-area: cat; min-width: 0; }
  .tx-list td.cat select { width: 100%; max-width: 230px; }
  .tx-list td.date { grid-area: date; display: block !important; text-align: right; font-size: 13px; white-space: nowrap; }

  .activity-list tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "event when" "device device";
    gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .activity-list tr:last-child { border-bottom: 0; }
  .activity-list td { padding: 0 !important; border: 0; }
  .activity-list .act-event { grid-area: event; font-weight: 600; }
  .activity-list .act-when { grid-area: when; text-align: right; white-space: normal; max-width: 140px; }
  .activity-list .act-device { grid-area: device; }
  .activity-list .act-device div { display: inline; }
  .activity-list .act-device div::before { content: " · "; }
}

/* front page: yearly pricing first, with what it saves */
.lp-period { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); margin: 0 0 22px; }
.lp-period button { border: 0; border-radius: 99px; min-height: 38px; padding: 6px 16px; background: transparent; color: var(--muted); gap: 8px; }
.lp-period button.on { background: var(--brand); color: var(--brand-ink); }
.lp-save { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.lp-period button.on .lp-save { background: rgba(255,255,255,.22); color: inherit; }
.lp-badge { align-self: flex-start; margin: 2px 0 0; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 99px;
  background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.lp-price .lp-was { font-size: 20px; font-weight: 600; color: var(--muted); text-decoration-thickness: 2px; letter-spacing: 0; }
.lp-more { margin-top: 18px; }
/* budget bar in the phone preview */
.lp-budget { margin: 10px 0 4px; }
.lp-budget-head { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; margin-bottom: 4px; }
.lp-budget-head small { color: var(--muted); font-weight: 600; }
.lp-bar { position: relative; height: 12px; border-radius: 4px; background: var(--budget-bar); }
.lp-bar i { position: absolute; left: 0; top: 3px; bottom: 3px; width: 64%; background: var(--brand); border-radius: 3px; }
.lp-bar b { position: absolute; left: 80%; top: -2px; bottom: -2px; width: 2px; background: var(--text); border-radius: 1px; }

/* bank transfer details on the subscription card */
.bank-box { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.bank-box h3 { margin: 0 0 10px; font-size: 16px; }
.bank-details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 10px; align-items: center; }
.bank-details dt { color: var(--muted); font-size: 13px; }
.bank-details dd { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; overflow-wrap: anywhere; }
.copy-btn { min-height: 28px; padding: 2px 10px; font-size: 12px; }

/* operator admin page */
pre.report { white-space: pre-wrap; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2);
  border-radius: 10px; padding: 14px; margin: 12px 0 0; overflow-x: auto; }
.code-big { font: 700 20px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
.row.wrap { flex-wrap: wrap; margin-bottom: 10px; }
.row.wrap input[type=email] { flex: 1 1 220px; }
.fb-message { white-space: pre-wrap; margin: 8px 0; }
/* admin insights: week bars and the sign-up funnel */
.wbars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; align-items: end; height: 170px; margin-top: 12px; }
.wbar { display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.wbar-n { font-size: 11px; font-weight: 700; min-height: 15px; }
.wbar-stack { flex: 1; width: 100%; max-width: 34px; display: flex; flex-direction: column-reverse; border-radius: 4px; overflow: hidden; background: var(--surface-2); }
.wbar-stack i { display: block; width: 100%; }
.wb-brand { background: var(--brand); }
.wb-neg { background: var(--neg); }
.wbar-l { font-size: 10px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.funnel-row { display: grid; grid-template-columns: minmax(120px, 190px) 1fr 40px; gap: 10px; align-items: center; padding: 5px 0; font-size: 14px; }
.funnel-track { height: 12px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.funnel-track i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.funnel-row b { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .wbar-l { font-size: 8px; } .funnel-row { grid-template-columns: 110px 1fr 34px; font-size: 13px; } }
.dbars { grid-auto-columns: minmax(0, 1fr); gap: 2px; }
.dbars .wbar-l { font-size: 9px; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }

/* admin: ready-to-send invitation reply */
.reply-box { margin-top: 14px; display: grid; gap: 8px; }
.reply-box .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.reply-box p { margin: 0; }
.reply-text { width: 100%; box-sizing: border-box; font: 14px/1.5 inherit; font-family: inherit; padding: 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); resize: vertical; }

/* ---- savings: total, compact bucket rows that open, folded sections ---- */
.savings-total { display: flex; flex-direction: column; gap: 2px; }
.savings-total .label { font-size: 13px; color: var(--muted); }
.savings-total .value { font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.plan-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 16px; overflow: hidden; }
.plan-row + .plan-row { border-top: 1px solid var(--line); }
.plan-row > summary, .inbox-sum, .inbox-item > summary { list-style: none; cursor: pointer; display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto 12px; gap: 6px 12px; align-items: center; }
.plan-row > summary { padding: 14px 16px; }
.plan-row > summary::-webkit-details-marker, .inbox-sum::-webkit-details-marker, .inbox-item > summary::-webkit-details-marker,
details.fold > summary::-webkit-details-marker { display: none; }
.plan-row > summary:hover, .inbox-item > summary:hover { background: var(--hi); }
.plan-row .plan-ic, .inbox-sum .plan-ic { width: 36px; height: 36px; }
.pr-main { display: flex; flex-direction: column; min-width: 0; }
.pr-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-amt { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.pr-amt small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }
.pr-bar { grid-column: 2 / 4; } .pr-bar .progress { height: 4px; }
.chev { width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform .15s; justify-self: end; }
details[open] > summary .chev { transform: rotate(45deg); }
.pr-body { padding: 0 16px 16px 64px; display: flex; flex-direction: column; gap: 10px; }
.pr-body form { display: flex; gap: 8px; } .pr-body form input { flex: 1; min-width: 0; }
.pr-actions { display: flex; justify-content: flex-end; }
.inbox-sum { margin: -4px 0; }
details.inbox[open] > .inbox-sum { margin-bottom: 12px; }
.inbox-item { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.inbox-item > summary { padding: 10px 12px; }
.inbox-item > summary .dir-tag { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; }
.inbox-item[open] > .inbox-row { border: 0; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; }
.inbox-row.compact .what { grid-column: 1 / -1; }
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
details.fold > summary h2 { margin: 0; }
details.fold[open] > summary { margin-bottom: 14px; }
@media (max-width: 640px) {
  .pr-body { padding: 0 14px 14px 14px; }
  .plan-row > summary { padding: 12px 14px; gap: 4px 10px; grid-template-columns: 32px minmax(0, 1fr) auto 10px; }
  .plan-row .plan-ic, .inbox-sum .plan-ic { width: 32px; height: 32px; }
  .savings-total .value { font-size: 26px; }
}
.inbox-item > summary .dir-tag.in { background: var(--hi); }
.inbox-item > summary .dir-tag.out { background: rgba(217, 119, 6, .12); }
