/* iOS look: inset grouped lists on a grey ground, frosted bars, Apple system colours.
   Every colour comes from these tokens; dark mode swaps them with the device setting. */
:root {
  --blue: #007AFF;                 /* buttons, links, progress, icon tiles, selected states */
  --bg: #F2F2F7;                   /* page background (grouped) */
  --card: #FFFFFF;                 /* cards and grouped list cells */
  --separator: #E5E5EA;            /* hairline dividers */
  --label: #000000;                /* main text */
  --label-secondary: #6E6E73;      /* secondary text */
  --label-tertiary: #AEAEB2;       /* tertiary text, chevrons, placeholders */
  --income: #34C759;               /* income */
  --warning: #FF9500;              /* near budget limit */
  --danger: #FF3B30;               /* over budget, destructive */
  --fill: #E9E9EB;                 /* search fields, segmented controls, progress tracks */
  --on-blue: #FFFFFF;              /* text and icons on blue */
  --pressed: #D1D1D6;              /* row highlight while pressed */
  --bar-bg: rgba(255, 255, 255, 0.72); /* frosted nav and tab bars */
  --scrim: rgba(0, 0, 0, 0.32);    /* behind sheets */
  --sheet-bg: #F2F2F7;             /* sheet ground */
  --sheet-cell: #FFFFFF;           /* grouped cells inside sheets */
  --toast-bg: rgba(30, 30, 30, 0.9);
  --toast-label: #FFFFFF;
  --toast-action: #0A84FF;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", sans-serif;
  --text-body: 17px;
  --text-secondary: 15px;
  --text-caption: 13px;
  --radius: 12px;
  --gutter: 16px;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --dur: 0.3s;
  --nav-h: 44px;
  --tab-h: 50px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --blue: #0A84FF;
    --bg: #000000;
    --card: #1C1C1E;
    --separator: #38383A;
    --label: #FFFFFF;
    --label-secondary: #98989F;
    --label-tertiary: #636366;
    --income: #30D158;
    --warning: #FF9F0A;
    --danger: #FF453A;
    --fill: #1C1C1E;
    --pressed: #2C2C2E;
    --bar-bg: rgba(28, 28, 30, 0.72);
    --scrim: rgba(0, 0, 0, 0.5);
    --sheet-bg: #1C1C1E;
    --sheet-cell: #2C2C2E;
    --toast-bg: rgba(58, 58, 60, 0.92);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --blue: #0A84FF;
  --bg: #000000;
  --card: #1C1C1E;
  --separator: #38383A;
  --label: #FFFFFF;
  --label-secondary: #98989F;
  --label-tertiary: #636366;
  --income: #30D158;
  --warning: #FF9F0A;
  --danger: #FF453A;
  --fill: #1C1C1E;
  --pressed: #2C2C2E;
  --bar-bg: rgba(28, 28, 30, 0.72);
  --scrim: rgba(0, 0, 0, 0.5);
  --sheet-bg: #1C1C1E;
  --sheet-cell: #2C2C2E;
  --toast-bg: rgba(58, 58, 60, 0.92);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: var(--text-body);
  line-height: 1.29;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
  padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  padding-bottom: calc(var(--tab-h) + 24px + env(safe-area-inset-bottom, 0px));
}
main { max-width: 680px; margin: 0 auto; padding-inline: var(--gutter); }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.ico { display: block; flex: none; }

/* Press feedback: dim on touch, ease back out */
button, .tappable, .link { transition: opacity var(--dur) var(--ease), background-color var(--dur) var(--ease); }
button:active:not(:disabled), .link:active { opacity: 0.55; transition: none; }

/* ---------- Navigation bars ---------- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  height: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  display: grid; place-items: center;
  background: transparent;
  border-bottom: 0.5px solid transparent;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.navbar.scrolled {
  background: var(--bar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--separator);
}
.nav-title {
  font-size: var(--text-body); font-weight: 600;
  opacity: 0; transform: translateY(4px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.navbar.scrolled .nav-title { opacity: 1; transform: none; }

.large-title + .group-header { margin-top: 20px; }
.large-title {
  font-size: 34px; font-weight: 700; line-height: 41px; letter-spacing: 0.01em;
  margin: 0 0 4px; padding-top: 4px;
}

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--separator);
}
.tabs button {
  border: 0; background: none; cursor: pointer; padding: 6px 0 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10px; font-weight: 500; letter-spacing: 0.01em;
  color: var(--label-tertiary);
}
.tabs button.active { color: var(--blue); }

/* ---------- Month switcher ---------- */
.month-switch { display: flex; align-items: center; gap: 4px; margin: 0 0 16px -6px; }
.month-label { font-size: var(--text-secondary); color: var(--label-secondary); min-width: 0; }
.month-btn {
  width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; cursor: pointer;
  display: grid; place-items: center; color: var(--blue);
}
.month-btn[disabled] { color: var(--label-tertiary); cursor: default; }

/* ---------- Views ---------- */
.view { display: none; }
.view.active { display: block; animation: fade var(--dur) var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Text styles ---------- */
.secondary { font-size: var(--text-secondary); color: var(--label-secondary); }
.caption-label { display: block; font-size: var(--text-caption); color: var(--label-secondary); }
.footnote { font-size: var(--text-caption); color: var(--label-secondary); margin: 8px var(--gutter) 0; line-height: 1.38; }
.group-foot { margin: 8px var(--gutter) 24px; }
.example { color: var(--label); font-weight: 500; }
.pos { color: var(--income); }
.neg { color: var(--danger); }
.link { background: none; border: 0; padding: 0; cursor: pointer; color: var(--blue); font-size: var(--text-secondary); }
.link-text { color: var(--blue); }
.danger-text { color: var(--danger); }

/* ---------- Balance card ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 24px; }
.balance { display: flex; flex-direction: column; gap: 4px; }
.balance-figure {
  font-size: 40px; font-weight: 700; line-height: 1.1; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; margin: 2px 0;
  transition: color var(--dur) var(--ease);
}
.balance-figure.over { color: var(--danger); }
.balance .meter { margin: 12px 0 14px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats.four .stat { font-size: var(--text-secondary); }
.over-note { margin: 4px 0 0; font-size: var(--text-secondary); color: var(--danger); line-height: 1.35; }
.hero-prompt { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin: 6px 0 4px; }
.hero-prompt .secondary { margin: 0; font-size: var(--text-body); color: var(--label); font-weight: 600; }
.stat { display: block; font-size: var(--text-body); font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* ---------- Progress ---------- */
.meter { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.meter-fill {
  height: 100%; width: 0; border-radius: 3px; background: var(--blue);
  transition: width var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.meter-fill.warn { background: var(--warning); }
.meter-fill.over { background: var(--danger); }

/* ---------- Entry (search-field style) ---------- */
.entry { margin-bottom: 24px; }
.entry-row { display: flex; gap: 8px; align-items: center; }
.search-field {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px;
  background: var(--fill); border-radius: 10px; padding: 0 10px; height: 40px;
  color: var(--label-secondary);
}
.search-field input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font-size: var(--text-body); color: var(--label); padding: 0; height: 100%;
}
.search-field input::placeholder { color: var(--label-secondary); }
.search-field input::-webkit-search-cancel-button { filter: grayscale(1); }
.field-icon { color: var(--label-secondary); }

.btn {
  border: 0; cursor: pointer; background: var(--blue); color: var(--on-blue);
  font-size: var(--text-body); font-weight: 600; border-radius: var(--radius); padding: 12px 20px;
}
.btn.pill { border-radius: 999px; padding: 9px 18px; }
.btn.block { width: 100%; }
.btn.destructive { background: var(--danger); }
.btn:disabled { opacity: 0.35; cursor: default; }

.preview { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.preview-item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 999px; border: 0;
  background: var(--card); color: var(--label); font-size: var(--text-secondary);
}
.chip.amount { font-weight: 600; font-variant-numeric: tabular-nums; }
.chip.amount.income { color: var(--income); }
.chip.amount.expense { color: var(--label); }
.chip.cat { color: var(--blue); cursor: pointer; }
.chip.missing { color: var(--warning); }
.chip.unsure { box-shadow: inset 0 0 0 1.5px var(--warning); }
.chip-note { font-size: var(--text-caption); color: var(--label-secondary); }

/* ---------- Inset grouped lists ---------- */
.group-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 var(--gutter) 6px; }
.group-header {
  display: block; margin: 0 var(--gutter) 6px;
  font-size: var(--text-caption); font-weight: 400; text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--label-secondary);
}
.group-head .group-header { margin: 0; }
.group {
  list-style: none; margin: 0 0 24px; padding: 0;
  background: var(--card); border-radius: var(--radius); overflow: hidden;
}
.group + .footnote.group-foot { margin-top: -16px; }
.row { display: flex; align-items: center; padding-left: var(--gutter); min-height: 44px; }
.row.tappable { cursor: pointer; }
.row.tappable:active { background: var(--pressed); transition: none; }
.row .tile { margin-right: 12px; }
.row-body {
  flex: 1; min-width: 0; align-self: stretch;
  display: flex; align-items: center; gap: 8px;
  padding: 11px var(--gutter) 11px 0; min-height: 44px;
}
/* Hairline divider starts after the icon */
.row + .row > .row-body { border-top: 0.5px solid var(--separator); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.row-title { font-size: var(--text-body); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-title.capitalize::first-letter { text-transform: uppercase; }
.row-sub { font-size: var(--text-secondary); color: var(--label-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-caption { font-size: var(--text-caption); color: var(--label-secondary); font-variant-numeric: tabular-nums; }
.row-value { font-size: var(--text-body); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-value.secondary-value { font-size: var(--text-secondary); color: var(--label-secondary); }
.row-value.income { color: var(--income); }
.row .meter { margin: 6px 0 4px; }
.row.zero .row-title, .row.zero .row-value { color: var(--label-secondary); }
.chev { color: var(--label-tertiary); margin-left: 2px; }
.check { color: var(--blue); }
.row-empty { padding: 14px var(--gutter); color: var(--label-secondary); font-size: var(--text-secondary); text-align: center; }
.file-row { cursor: pointer; }
.budget-btn {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--blue); font-size: var(--text-secondary); font-variant-numeric: tabular-nums;
}
.budget-input {
  width: 96px; border: 0; border-radius: 8px; padding: 3px 8px; text-align: right;
  background: var(--fill); color: var(--label); font-size: var(--text-secondary);
}

/* Icon tiles, like iOS Settings: solid blue, white glyph */
.tile {
  flex: none; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--blue); color: var(--on-blue);
}
.tile .ico { width: 18px; height: 18px; }
.tile.lg { width: 44px; height: 44px; border-radius: 11px; }
.tile.lg .ico { width: 26px; height: 26px; }

/* ---------- Transactions ---------- */
.filters { display: flex; gap: 8px; margin-bottom: 20px; }
.filter-select {
  flex: 0 1 42%; min-width: 0; height: 40px; border: 0; border-radius: 10px; padding: 0 10px;
  background: var(--fill); color: var(--blue); font-size: var(--text-secondary);
}
.day-head { display: flex; justify-content: space-between; }
.day-head span:last-child { text-transform: none; font-variant-numeric: tabular-nums; }

/* ---------- Sheets ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 20; background: var(--scrim);
  animation: fade-in var(--dur) var(--ease);
}
.sheet {
  /* Cells inside a sheet sit one step above the sheet ground */
  --card: var(--sheet-cell);
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21;
  max-width: 680px; margin: 0 auto; max-height: 90vh; overflow-y: auto;
  background: var(--sheet-bg); border-radius: 12px 12px 0 0;
  padding: 6px var(--gutter) calc(24px + env(safe-area-inset-bottom, 0px));
  animation: slide-up var(--dur) var(--ease);
}
.sheet.closing { animation: slide-down 0.25s var(--ease) forwards; }
.sheet-backdrop.closing { animation: fade-out 0.25s var(--ease) forwards; }
@keyframes slide-up { from { transform: translateY(100%); } }
@keyframes slide-down { to { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.sheet-handle { width: 36px; height: 5px; border-radius: 3px; background: var(--label-tertiary); opacity: 0.5; margin: 0 auto 6px; }
.sheet-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 44px; margin-bottom: 12px; }
.sheet-nav h3 { margin: 0; font-size: var(--text-body); font-weight: 600; text-align: center; }
.sheet-nav .left { justify-self: start; }
.sheet-nav .right { justify-self: end; }
.nav-btn { border: 0; background: none; padding: 6px 0; cursor: pointer; color: var(--blue); font-size: var(--text-body); }
.nav-btn.strong { font-weight: 600; }
.sheet .group { margin-bottom: 20px; }
.sheet .group-header { margin-top: 4px; }
.sheet-hero { display: flex; gap: 14px; align-items: center; margin: 0 4px 16px; }
.sheet-hero .secondary { display: block; margin-top: 2px; }
.sheet-hero h3 { margin: 0; font-size: 22px; font-weight: 700; }
.sheet .meter { margin: 0 4px 20px; }

.field { cursor: text; }
.field .row-body { gap: 12px; }
.field-label { flex: none; min-width: 104px; white-space: nowrap; font-size: var(--text-body); }
.field input, .field textarea {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent; padding: 0;
  font-size: var(--text-body); color: var(--label); text-align: right;
}
.field textarea { text-align: left; resize: vertical; min-height: 66px; font-size: var(--text-secondary); line-height: 1.35; }
.field.stack .row-body { flex-direction: column; align-items: stretch; gap: 6px; }
.field input::placeholder, .field textarea::placeholder { color: var(--label-tertiary); }
/* Day-of-month dropdown: an iOS-style pop-up button */
.day-select {
  flex: none; -webkit-appearance: none; appearance: none; cursor: pointer;
  border: 0; border-radius: 8px; padding: 5px 10px; margin-left: auto;
  background: var(--fill); color: var(--blue); font-size: var(--text-body); text-align: center;
}
.sheet .day-select { background: var(--bg); }
.day-select:invalid, .day-select:has(option[value=""]:checked) { color: var(--label-secondary); }

.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--fill); border-radius: 9px; padding: 2px; margin-bottom: 20px; }
.sheet .seg { background: var(--separator); }
.seg button {
  border: 0; background: none; border-radius: 7px; padding: 6px; cursor: pointer;
  font-size: var(--text-caption); font-weight: 500; color: var(--label);
}
.seg button.on { background: var(--card); font-weight: 600; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin-bottom: 12px; }
.cat-grid button {
  border: 0; border-radius: var(--radius); padding: 12px 4px 10px; cursor: pointer;
  background: var(--card); color: var(--label);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: var(--text-caption);
  box-shadow: inset 0 0 0 2px transparent;
}
.cat-grid button.on { box-shadow: inset 0 0 0 2px var(--blue); }
.cat-grid button.new-cat { color: var(--blue); }

.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 10px; padding: 12px; }
.icon-pick button {
  border: 0; padding: 0; background: none; cursor: pointer; justify-self: center; border-radius: 10px;
  box-shadow: 0 0 0 2px transparent;
}
.icon-pick button.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--blue); }

.action-sheet { display: flex; flex-direction: column; gap: 8px; }
.action-sheet .message { text-align: center; padding: 14px 16px; font-size: var(--text-caption); color: var(--label-secondary); border-bottom: 0.5px solid var(--separator); }
.action-sheet .message strong { display: block; font-size: var(--text-caption); font-weight: 600; margin-bottom: 4px; color: var(--label-secondary); }
.action-sheet .group { margin: 0; }
.action-sheet button.sheet-action {
  width: 100%; border: 0; background: var(--card); min-height: 56px; cursor: pointer;
  font-size: 20px; color: var(--blue);
}
.action-sheet button.sheet-action.destructive { color: var(--danger); }
.action-sheet button.sheet-action.cancel { font-weight: 600; border-radius: var(--radius); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 30;
  bottom: calc(var(--tab-h) + 12px + env(safe-area-inset-bottom, 0px));
  display: flex; gap: 16px; align-items: center;
  max-width: calc(100% - 32px); width: max-content;
  padding: 12px 18px; border-radius: 999px;
  background: var(--toast-bg); color: var(--toast-label); font-size: var(--text-secondary);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  animation: toast-in var(--dur) var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
.toast button { border: 0; background: none; padding: 0; cursor: pointer; font-weight: 600; color: var(--toast-action); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Locked history (free plan) ---------- */
.lock-card { display: none; }
.view.locked .lock-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 28px 20px;
}
.view.locked .lock-card h3 { margin: 4px 0 0; font-size: var(--text-body); font-weight: 600; }
.view.locked .lock-card .secondary { margin: 0; line-height: 1.4; max-width: 34ch; }
.lock-card .soon {
  margin-top: 6px; padding: 6px 14px; border-radius: 999px;
  background: var(--fill); color: var(--label-secondary); font-size: var(--text-caption); font-weight: 600;
}
/* Hide the period's content while it's locked; the title, period switcher and lock card stay. */
/* Debit orders (.not-period) also stay: they don't belong to any one pay-month. */
.view.locked > :not(.large-title):not(.month-switch):not(.lock-card):not(.not-period) { display: none !important; }

/* ---------- Home tip ---------- */
.tip-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px 12px 12px 16px; margin-top: -12px; }
.tip-card[hidden] { display: none; }
.tip-text { flex: 1; font-size: var(--text-secondary); color: var(--label-secondary); line-height: 1.38; }
.tip-close { border: 0; background: none; padding: 2px; color: var(--label-tertiary); cursor: pointer; }

/* ---------- First-run setup ---------- */
body.onboarding { overflow: hidden; }
.onboard {
  position: fixed; inset: 0; z-index: 25; overflow-y: auto; background: var(--bg);
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
  animation: fade var(--dur) var(--ease);
}
.onboard[hidden] { display: none; }
.ob-inner { max-width: 560px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; padding: 8px var(--gutter) 24px; }
.ob-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: var(--nav-h); }
.ob-back { display: inline-flex; align-items: center; gap: 2px; justify-self: start; }
.ob-count { font-size: var(--text-secondary); font-weight: 600; }
.ob-meter { margin: 4px 0 24px; }
.ob-title { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 8px; }
.ob-sub { font-size: var(--text-body); color: var(--label-secondary); margin: 0 0 20px; line-height: 1.35; }
.ob-body { flex: 1; }
.ob-options .row .tile { margin-right: 12px; }
.ob-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.ob-chip {
  display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer;
  padding: 9px 14px; border-radius: 999px; background: var(--card); color: var(--label);
  font: inherit; font-size: var(--text-secondary);
}
.ob-chip.on { background: var(--blue); color: var(--on-blue); }
.ob-chip:disabled { opacity: 0.4; cursor: default; }
.ob-fixed .field-label { width: auto; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-fixed input { width: 96px; flex: none; }
.ob-fixed .day-select { width: 92px; }
.ob-actions { position: sticky; bottom: 0; padding-top: 16px; background: linear-gradient(to bottom, transparent, var(--bg) 16px); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ob-next { padding: 15px; font-size: var(--text-body); font-weight: 600; }
.ob-skip { font-size: var(--text-body); padding: 4px 12px; }
.ob-error { margin: 0; color: var(--danger); font-size: var(--text-caption); align-self: stretch; text-align: center; }
.ob-result { text-align: center; padding-top: 40px; display: flex; flex-direction: column; align-items: center; }
.ob-result .tile.lg { margin-bottom: 16px; }
.ob-result .ob-sub { margin: 0; }
.ob-big { font-size: 56px; font-weight: 700; letter-spacing: -0.03em; margin: 4px 0; font-variant-numeric: tabular-nums; }
.ob-big span { font-size: 22px; font-weight: 600; color: var(--label-secondary); letter-spacing: 0; }
.ob-sum { align-self: stretch; margin: 28px 0 0; text-align: left; }
.ob-result .footnote { text-align: center; margin-top: 12px; }
.ob-premium { color: var(--blue); }
.ob-cols { display: flex; justify-content: flex-end; gap: 12px; padding: 0 var(--gutter) 6px; font-size: var(--text-caption); color: var(--label-secondary); }
.ob-cols span:first-child { width: 96px; text-align: right; }
.ob-cols span:last-child { width: 92px; text-align: center; }

/* ---------- Savings goals ---------- */
#goalCards { display: flex; flex-direction: column; }
.goal-card { display: flex; flex-direction: column; gap: 10px; }
.goal-head { display: flex; align-items: center; gap: 12px; }
.goal-titles { min-width: 0; }
.goal-titles h3 { margin: 1px 0 0; font-size: var(--text-body); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.goal-amounts { font-size: var(--text-body); font-weight: 600; font-variant-numeric: tabular-nums; }
.goal-status { font-size: var(--text-secondary); color: var(--label-secondary); min-width: 0; }
.goal-done { display: inline-flex; align-items: center; gap: 4px; color: var(--income); font-weight: 600; }
.goal-done .ico { stroke-width: 2.5; }
.goal-btn { font-size: var(--text-secondary); padding: 7px 16px; }
.goal-note { margin: 0; }
/* Progress towards a goal is never a warning, so it stays blue (green once reached). */
.goal-meter .meter-fill { background: var(--blue); }
.goal-meter .meter-fill.goal-reached { background: var(--income); }

/* Inline form errors */
.row.invalid .field-label { color: var(--danger); }
.form-errors {
  list-style: none; margin: -12px var(--gutter) 16px; padding: 0;
  display: flex; flex-direction: column; gap: 2px;
  font-size: var(--text-caption); color: var(--danger);
}
.field input[type="date"] { min-height: 22px; color: var(--label); }

/* ---------- Accounts: welcome, sign up, log in ---------- */
/* Until someone is signed in, only the account screens show. */
body.booting main, body.booting .tabs, body.booting .navbar { visibility: hidden; }
.auth { z-index: 26; }
.auth-inner { justify-content: flex-start; }
.auth-hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 48px 0 24px; }
.auth-logo { width: 96px; height: 96px; border-radius: 22px; }
.auth-logo.small { width: 64px; height: 64px; border-radius: 15px; margin-bottom: 12px; }
.auth-title { margin: 14px 0 0; font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.auth-tagline { margin: 0; font-size: var(--text-body); color: var(--label-secondary); }
.auth-actions { margin-top: auto; }
.auth-link { font-size: var(--text-body); padding: 6px 12px; }
.auth-google { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--card); color: var(--label); box-shadow: inset 0 0 0 1px var(--separator); }
.auth-legal { text-align: center; margin: 4px 0 0; }
.auth-legal a, .consent a { color: var(--blue); }
.auth-result { padding-top: 56px; }
.auth-result .ob-sub { margin-top: 4px; }
.auth-working { justify-content: center; min-height: 60vh; }
.auth-note { color: var(--income); }
.auth-errors { margin: 0 var(--gutter) 12px; }
.consent { display: flex; align-items: flex-start; gap: 10px; margin: 0 4px 16px; font-size: var(--text-secondary); color: var(--label); line-height: 1.35; cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--blue); }
.consent.invalid span { color: var(--danger); }
.sync-status { display: inline-flex; align-items: center; gap: 6px; }
.sync-status.offline, .sync-status.error { color: var(--warning); }
