:root {
  --bg: #0a1420; --card: #152536; --line: #2c4253; --field: #0b1b2a;
  --text: #eaf2f3; --muted: #a4b9c4; --accent: #60d6b5; --accent-ink: #0b2530;
  --warn: #ffc48a; --bad: #f7a8a8; --quiet: #293d50;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--text); background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }

/* The header and tab bar have solid backgrounds and keep clear of the notch and home bar. */
#topbar {
  position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
}
main {
  max-width: 760px; margin: auto;
  padding: 16px max(16px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--bg); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
}
#tabs button { background: none; color: var(--muted); font-weight: 600; font-size: 13px; padding: 10px 2px; border-radius: 9px; }
#tabs button[aria-current="page"] { color: var(--accent); background: var(--card); }
#message {
  position: fixed; left: 16px; right: 16px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 6;
  max-width: 728px; margin: 0 auto; padding: 12px 16px; border-radius: 12px;
  background: #24384a; color: var(--text); border: 1px solid var(--line); text-align: center;
}

h1 { font-size: 20px; margin: 0; }
h1 small { font-size: 14px; color: var(--accent); margin-left: 6px; font-weight: 600; }
h2 { margin: 0 0 10px; font-size: 20px; }
h3 { margin: 0 0 6px; font-size: 18px; }
p { color: #adc1ce; line-height: 1.5; margin: 0 0 10px; }
small { display: block; color: var(--muted); margin-top: 4px; line-height: 1.4; font-size: 13px; }
code { color: var(--text); }
footer { font-size: 12px; color: #90a9b7; margin-top: 20px; }
.legend { font-size: 12px; color: #90a9b7; }
.warn { color: var(--warn); }
.good { color: var(--accent); }
.negative { color: var(--bad); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 14px; }
.card > :last-child { margin-bottom: 0; }
.highlight { background: #103b38; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid .card { margin-bottom: 0; }
.grid .card h2 { margin-bottom: 0; font-size: 22px; }
.grid .card p { margin-bottom: 4px; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.split { display: flex; justify-content: space-between; gap: 12px; }
.pill { font-size: 11px; background: var(--quiet); padding: 4px 9px; border-radius: 99px; white-space: nowrap; }

label { display: block; color: #b9d0d9; font-size: 13px; margin: 12px 0; }
input, select {
  display: block; width: 100%; background: var(--field); color: white; border: 1px solid #405b6b;
  border-radius: 9px; padding: 11px; margin-top: 6px; font-size: 16px; font-family: inherit;
}
input[type=range] { padding: 0; accent-color: var(--accent); }
input[type=file] { flex: 1; min-width: 0; margin-top: 0; }
output { color: #fff; font-weight: 700; }
button {
  background: var(--accent); border: 0; border-radius: 9px; padding: 11px 16px; color: var(--accent-ink);
  font-weight: 700; font-size: 15px; min-height: 44px; cursor: pointer; font-family: inherit;
}
button:hover { filter: brightness(1.1); }
button.danger { background: var(--bad); }
button.quiet { background: var(--quiet); color: var(--text); }
button.small { min-height: 36px; padding: 6px 12px; font-size: 13px; }
a { color: var(--accent); }
a.button { display: block; text-align: center; background: #fff; color: #1f2933; font-weight: 700; text-decoration: none; border-radius: 9px; padding: 13px 16px; margin: 6px 0 4px; }
button.link { background: none; color: var(--accent); padding: 8px 0; font-weight: 600; text-decoration: underline; }
#authOr { text-align: center; margin: 12px 0 0; }
#passwordform, #deleteform { margin: 0; }
.check { display: flex; align-items: center; gap: 10px; }
.check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--accent); }
.fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 12px; align-items: end; margin-top: 8px; }
.fields.two { grid-template-columns: 1fr 1fr; }
.fields .actions { grid-column: 1 / -1; margin-top: 4px; }
details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
summary { cursor: pointer; color: var(--text); font-weight: 600; padding: 6px 0; }

.monthnav { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.monthnav strong { font-size: 20px; min-width: 150px; text-align: center; }
.monthnav button { padding: 8px 14px; font-size: 18px; }
.monthnav #thisMonth { font-size: 13px; margin-left: auto; }

.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row > :first-child { min-width: 0; flex: 1; }
.row .amount { font-weight: 700; white-space: nowrap; text-align: right; }
.row select { width: auto; max-width: 140px; margin-top: 0; padding: 7px; font-size: 14px; }
.row.debt strong { margin-right: 8px; }
.row.debt { align-items: flex-start; }
button.rowbutton { display: block; width: 100%; text-align: left; background: none; color: var(--text); font-weight: 400; padding: 12px 0; border-radius: 0; border-bottom: 1px solid var(--line); }
button.rowbutton:last-child { border-bottom: 0; }
.rowline { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.rowline strong { font-weight: 600; }
.empty { color: var(--muted); padding: 6px 0; }

progress { display: block; width: 100%; height: 8px; margin-top: 8px; border: 0; border-radius: 99px; overflow: hidden; background: var(--quiet); appearance: none; -webkit-appearance: none; }
progress::-webkit-progress-bar { background: var(--quiet); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
progress.over::-webkit-progress-value { background: var(--bad); }
progress.over::-moz-progress-bar { background: var(--bad); }

/* Budget group colours: one per group, used by the split bar and its legend. */
.g0 { fill: #60d6b5; background: #60d6b5; } .g1 { fill: #f2c14e; background: #f2c14e; }
.g2 { fill: #7aa8f7; background: #7aa8f7; } .g3 { fill: #f08a5d; background: #f08a5d; }
.g4 { fill: #c58af9; background: #c58af9; } .g5 { fill: #f7a8a8; background: #f7a8a8; }
.g6 { fill: #9be28a; background: #9be28a; } .g7 { fill: #8fa6b5; background: #8fa6b5; }
#groupBar { width: 100%; height: 28px; border-radius: 8px; display: block; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; }
.grouphead { display: flex; justify-content: space-between; gap: 12px; margin: 16px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }

.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar .weekday { text-align: center; color: var(--muted); font-size: 12px; padding: 4px 0; }
.calendar button { background: var(--field); color: var(--text); font-weight: 400; min-height: 52px; padding: 4px 2px; border-radius: 9px; border: 1px solid transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 14px; }
.calendar button.today { border-color: var(--accent); }
.calendar button.selected { background: var(--quiet); }
.mark { font-weight: 800; font-size: 13px; margin: 0 1px; }
.mark.paid { color: var(--accent); } .mark.due { color: #7aa8f7; } .mark.late { color: var(--bad); } .mark.none { color: var(--muted); }
.legend .mark { margin-left: 10px; }
.legend .mark:first-child { margin-left: 0; }
#dayDetail { margin-top: 8px; border-top: 1px solid var(--line); }

.option { margin-bottom: 0; }
.option .pill { display: inline-block; margin-top: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 5px 10px; }
#plan { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 20px; }
#planChart, #historyChart { width: 100%; height: auto; margin-top: 8px; }
#planChart polyline { fill: none; stroke-width: 3; stroke-linejoin: round; }
#planChart .line-plan { stroke: var(--accent); }
#planChart .line-now { stroke: #8fa6b5; stroke-dasharray: 7 6; }
#planChart .axis, #historyChart .axis { stroke: var(--line); }
/* Chart text is sized in chart units (600 wide), so it stays readable when scaled down to a phone. */
#planChart text, #historyChart text { fill: var(--muted); font-size: 22px; }
#historyChart rect { fill: #3d5a70; }
#historyChart rect.current { fill: var(--accent); }
#historyChart rect.income { fill: #7aa8f7; }
#worthChart { width: 100%; height: auto; margin-top: 8px; }
#worthChart .axis { stroke: var(--line); }
#worthChart .line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; }
#worthChart .dot { fill: var(--accent); }
#worthChart text { fill: var(--muted); font-size: 22px; }
#worthChart text.value { fill: var(--text); }
.row .amount small { text-align: right; }
.row.tx { flex-wrap: wrap; }
.row.tx .rowactions { flex-basis: 100%; justify-content: flex-end; gap: 8px; }
.splitform { flex-basis: 100%; display: flex; gap: 8px; align-items: center; }
.splitform input { margin-top: 0; min-width: 0; flex: 1; }
.splitform select { max-width: 150px; }
.check.wide { grid-column: 1 / -1; }
#ideas { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 20px; }
.idea { padding: 12px 0; border-bottom: 1px solid var(--line); }
.idea:last-child { border-bottom: 0; }
.idea p { margin: 4px 0 0; }
.idea .gain { color: var(--accent); font-weight: 600; }
ul.tips { color: #d5e3ea; padding-left: 20px; line-height: 1.6; margin: 0 0 10px; }
ul.codes { list-style: none; padding: 0; margin: 4px 0 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-family: ui-monospace, Menlo, monospace; font-size: 15px; color: var(--text); }
ul.codes li { background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; letter-spacing: .03em; }
#codes .check { margin: 14px 0; }
#recoverCode { font-family: ui-monospace, Menlo, monospace; text-transform: uppercase; }
@media (max-width: 480px) { ul.codes { grid-template-columns: 1fr; } }
.receiptpanel { flex-basis: 100%; background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px 12px; }
.receiptpanel label:first-child select { width: 100%; max-width: none; margin-top: 6px; padding: 11px; font-size: 16px; }
.receiptpanel .row { flex-wrap: wrap; gap: 8px; }
.receiptpanel .row > :first-child { flex-basis: 100%; }
.receiptpanel .row strong { overflow-wrap: anywhere; }
.receiptimg { display: block; max-width: 100%; max-height: 70vh; margin: 10px auto 4px; border-radius: 8px; background: #fff; }
button:disabled { opacity: .5; cursor: default; filter: none; }
#view-reports progress { margin-bottom: 2px; }
#historyChart text.value { fill: var(--text); font-size: 20px; }
ol { color: #d5e3ea; padding-left: 20px; line-height: 1.7; margin: 0 0 10px; }
.goal form { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.goal form input { margin-top: 0; max-width: 140px; }

@media (max-width: 680px) {
  .grid { grid-template-columns: 1fr; }
  .fields, .fields.two { grid-template-columns: 1fr 1fr; }
  .row.debt { flex-direction: column; }
  .monthnav strong { min-width: 0; flex: 1; }
}
@media (max-width: 400px) {
  .fields.two { grid-template-columns: 1fr; }
}

/* import preview */
.preview { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.preview h3 { margin: 0 0 8px; overflow-wrap: anywhere; }
.preview h4 { margin: 14px 0 4px; font-size: 14px; }
.preview .pick { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.preview .pick .what { overflow-wrap: anywhere; }
.preview .pick .controls { grid-column: 2; display: flex; gap: 8px; }
.preview .pick .controls input { flex: 0 0 8.5em; min-width: 0; min-height: 38px; padding: 6px 8px; }
.preview .pick .controls select { flex: 1 1 auto; min-width: 0; min-height: 38px; padding: 6px 8px; }
.preview .pick .detail { grid-column: 2; color: var(--muted); font-size: 13px; }
.hint { color: var(--muted); font-size: 14px; }

/* due days for reminders */
.dueRow { display: grid; grid-template-columns: 1fr 5.5em auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.dueRow .what { overflow-wrap: anywhere; }
.dueRow input { min-width: 0; min-height: 38px; padding: 6px 8px; }
#remindCard label { margin-top: 10px; }
.accountSwitch { padding: 6px 0 6px 12px; font-size: 14px; color: var(--muted); }
.mark.rec { color: #c9a5f7; }
.filter { background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; }

/* safe-to-spend card is a button */
button.statbutton { display: block; width: 100%; text-align: left; font: inherit; font-weight: 400; color: inherit; cursor: pointer; }
button.statbutton .hint { display: block; margin-top: 6px; font-size: 12px; }
.breakline { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.breakline.total { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--line); margin-top: 4px; padding-top: 10px; }
.center { text-align: center; }
button.link { background: none; border: 0; padding: 4px; color: var(--accent); text-decoration: underline; font-weight: 400; min-height: 0; }
/* first-open walkthrough */
.welcome { position: fixed; inset: 0; background: rgba(5, 10, 18, .85); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.welcomebox { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; width: 100%; max-width: 440px; max-height: 90vh; overflow: auto; }
.welcomebox h2 { margin-top: 4px; }
.welcomebox ul { padding-left: 20px; }
.roomrow input { width: 7.5em; min-height: 38px; padding: 6px 8px; }

/* ---------- design pass ---------- */
body { font-variant-numeric: tabular-nums; }
h1 { display: flex; align-items: center; gap: 8px; }
h1 .logo { width: 28px; height: 28px; flex: none; }
h1 .brand { letter-spacing: -.2px; }
h1 small { margin-left: 2px; }
.iconbtn { display: inline-flex; align-items: center; gap: 6px; }
.iconbtn svg { width: 20px; height: 20px; }
@media (max-width: 420px) { .iconbtn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .iconbtn { padding: 10px; } }

#tabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; padding: 7px 2px 6px; }
#tabs button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#tabs button[aria-current="page"] svg { stroke-width: 2.2; }

#message { box-shadow: 0 10px 30px rgba(0, 0, 0, .45); border-radius: 999px; }

/* Home hero: the one number people open the app for */
.card.hero { background: linear-gradient(160deg, #17423f 0%, #152536 70%); border-color: #2c5a55; padding-bottom: 14px; }
.hero .statbutton { background: none; border: 0; padding: 0; min-height: 0; }
.hero #statSafeLabel { margin: 0; color: #bfe9de; font-weight: 600; }
.hero #statSafe { font-size: 44px; line-height: 1.05; margin: 4px 0 6px; letter-spacing: -1px; }
.hero #statSafe.negative { color: var(--bad); }
.hero .daily { color: var(--text); font-size: 17px; font-weight: 600; margin: 0 0 6px; }
.hero small { display: block; color: var(--muted); }
.monthbar { position: relative; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .1); margin: 14px 0 12px; overflow: visible; }
.monthbar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--accent); }
.monthbar span.over { background: var(--bad); }
.monthbar i { position: absolute; top: -4px; width: 2px; height: 16px; background: #fff; border-radius: 2px; opacity: .8; }
.ministats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ministats div { background: rgba(0, 0, 0, .18); border-radius: 12px; padding: 10px 12px; }
.ministats p { margin: 0; font-size: 13px; color: var(--muted); }
.ministats strong { display: block; font-size: 20px; margin: 2px 0; }
.ministats small { font-size: 12px; line-height: 1.35; }

/* spending by group */
.donutwrap { position: relative; width: 168px; height: 168px; margin: 4px auto 12px; }
.donutwrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
#donutCentre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
#donutCentre strong { font-size: 20px; }
#donutCentre small { color: var(--muted); font-size: 12px; }
.gicon { display: inline-flex; width: 30px; height: 30px; border-radius: 9px; align-items: center; justify-content: center; font-size: 16px; margin-right: 10px; flex: none; }
.rowline .gname { display: flex; align-items: center; }
.meter.g span, .meter span.g { background: var(--gc, var(--accent)); }

/* Home tiles for the other screens */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.tile { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; color: var(--text); font: inherit; min-height: 120px; display: flex; flex-direction: column; gap: 4px; }
.tile strong { font-size: 15px; }
.tile p { font-size: 13px; margin: 0; color: var(--muted); }
.ticon { font-size: 22px; }

/* Can I afford it */
.affordrow { display: flex; gap: 8px; }
.affordrow input { flex: 1; min-width: 0; }
#affordResult .verdict { font-weight: 700; margin: 12px 0 4px; }
#affordResult .verdict.ok { color: var(--accent); }
#affordResult .verdict.tight { color: var(--warn); }
#affordResult .verdict.no { color: var(--bad); }

/* sign-in: a welcoming first screen */
.brandhero { text-align: center; padding: 18px 8px 6px; }
.brandhero svg { width: 64px; height: 64px; }
.brandhero h2 { font-size: 28px; margin: 12px 0 6px; }
.brandhero p { font-size: 16px; }
.perks { list-style: none; padding: 0; margin: 10px 0 18px; display: grid; gap: 8px; }
.perks li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--text); font-size: 15px; }
footer { color: var(--muted); }
progress.g:not(.over)::-webkit-progress-value { background: var(--gc, var(--accent)); }
progress.g:not(.over)::-moz-progress-bar { background: var(--gc, var(--accent)); }
.checks { display: grid; gap: 10px; margin-bottom: 12px; }
#paydayCard .daily { color: var(--text); font-weight: 600; margin-top: 10px; }

.plusbadge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .6px; color: #0b2530; background: linear-gradient(90deg, #60d6b5, #9be7ff); border-radius: 6px; padding: 2px 6px; vertical-align: middle; }
.plusteaser { background: rgba(96, 214, 181, .08); border: 1px dashed #2c5a55; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.roomrow { align-items: flex-start; }
.roomrow .more { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.roomrow .more.warn { color: var(--warn); }
.roomrow .more.bad { color: var(--bad); }
.wide { grid-column: 1 / -1; }
.bad { color: var(--bad); }
.subhero h2 { font-size: 36px; margin: 4px 0; }
.subhero p { margin: 0; }
.subrow { align-items: flex-start; }
.subline { display: block; margin-top: 2px; }
.subactions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.subactions button { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.quickcat { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.quickcat h3 { margin: 0 0 4px; }
.suggestfields { display: grid; grid-template-columns: 1fr 5.5em auto; gap: 8px; margin-top: 8px; }
.suggestfields input { min-width: 0; min-height: 38px; padding: 6px 8px; }
.suggestrow > div { width: 100%; }

/* tidy-up: jump chips, back links */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 14px; padding-bottom: 2px; }
.chips a { flex: none; background: var(--card); border: 1px solid var(--line); color: var(--text); text-decoration: none; border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 600; }
.backlink { background: none; border: 0; color: var(--accent); font-weight: 600; padding: 4px 0 12px; min-height: 0; }
[id] { scroll-margin-top: 80px; }
.suggestfields.two { grid-template-columns: 1fr 6.5em; }
.bankfresh { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mortgagehead { background: rgba(0, 0, 0, .18); border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.mortgagehead p { margin: 0; color: var(--muted); font-size: 13px; }
.mortgagehead strong { display: block; font-size: 22px; margin: 2px 0; }
.row.mine { background: rgba(96, 214, 181, .08); border-radius: 10px; padding: 10px; }
.tipline { background: rgba(255, 211, 92, .08); border: 1px solid rgba(255, 211, 92, .25); border-radius: 10px; padding: 10px; font-size: 14px; }
.checkhead { margin: 14px 0 4px; font-size: 15px; }
.checkrow small { display: block; margin-top: 2px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); font-size: 14px; }
.kv span { color: var(--muted); }
.kv.total strong { font-size: 16px; }
.kv.good strong, p.good { color: var(--accent); }
.kv.bad strong { color: #ff8a80; }
button.small.on { background: rgba(96, 214, 181, .18); color: var(--accent); }

/* review pass */
button.dangertext { color: var(--bad); }
.row.tx .rowactions { gap: 6px; }
.row.tx .rowactions button.small { min-height: 32px; padding: 4px 10px; font-size: 12.5px; }
.rowbutton.unused { padding-top: 8px; padding-bottom: 8px; opacity: .72; }
.rowbutton.unused .rowline span:last-child { color: var(--muted); font-size: 13px; }
details.habits { margin-top: 12px; }
details.habits summary { font-weight: 600; cursor: pointer; }

/* Section tabs on Goals and Settings */
nav.segtabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 0 12px; padding: 4px; background: var(--bg); border: 1px solid rgba(255, 255, 255, .06); border-radius: 14px; position: sticky; top: 64px; z-index: 5; backdrop-filter: blur(8px); }
nav.segtabs::-webkit-scrollbar { display: none; }
nav.segtabs button { flex: 1 0 auto; min-height: 40px; padding: 6px 12px; border-radius: 10px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; box-shadow: none; }
nav.segtabs button.on { background: rgba(96, 214, 181, .16); color: var(--accent); }
nav.segtabs button svg { width: 16px; height: 16px; }
.offsec { display: none !important; }
/* Icons on buttons */
svg.bicon, nav.segtabs svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button:has(> svg.bicon) { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button.small svg.bicon { width: 13px; height: 13px; }
nav.segtabs button { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 11.5px; min-height: 50px; }
nav.segtabs button svg { width: 18px; height: 18px; }
.row.tx .rowactions { gap: 5px; flex-wrap: nowrap; }
.row.tx .rowactions button.small { padding: 4px 8px; }
.card form + h3, .card .actions + h3, .card > h3 { margin-top: 20px; }
.matched { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: 12.5px; color: var(--accent); }
.matched .linkbutton { font-size: 12.5px; }
button.linkbutton { background: none; border: 0; box-shadow: none; padding: 2px 0; min-height: 0; color: var(--muted); text-decoration: underline; font-weight: 600; cursor: pointer; }
.stackbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin: 8px 0 10px; background: rgba(255, 255, 255, .06); }
.stackbar span { display: block; min-width: 3px; }
.dotlabel { display: inline-flex; align-items: center; gap: 8px; }
.dotlabel i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.bigline { font-size: 26px; font-weight: 700; margin: 4px 0 0; }
#respKids .more { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
#respKids .more.warn { color: var(--warn, #ffd35c); }
nav.segtabs button { white-space: normal; line-height: 1.1; text-align: center; font-size: 11px; }
.schedpanel { margin: -4px 0 12px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .06); }
.schedpick { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.schedtable { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
.schedtable th { text-align: right; color: var(--muted); font-weight: 600; padding: 6px 4px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.schedtable td { text-align: right; padding: 6px 4px; border-bottom: 1px solid rgba(255, 255, 255, .05); font-variant-numeric: tabular-nums; }
.schedtable th:first-child, .schedtable td:first-child { text-align: left; }
/* Home: to-do list and next-up line */
#homeTodo:not(:has(.todo:not([hidden]))) { display: none; }
#homeTodo h2 { margin-bottom: 6px; }
.todo { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; }
.todo:not([hidden]) ~ .todo { border-top: 1px solid rgba(255, 255, 255, .06); }
.todo p { margin: 0; font-size: 14px; }
.todoacts { display: flex; flex-wrap: wrap; gap: 8px; }
.nextup { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.nextchip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: rgba(255, 255, 255, .07); color: var(--text); }
.nextchip.warn { background: rgba(255, 211, 92, .12); color: var(--warn); }
.nextchip svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.segpick { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255, 255, 255, .05); margin: 12px 0 4px; }
.segpick button { flex: 1; min-height: 36px; background: transparent; color: var(--muted); box-shadow: none; font-size: 13px; font-weight: 600; border-radius: 9px; }
.segpick button.on { background: rgba(255, 255, 255, .12); color: var(--text); }
.tablewrap { max-height: 520px; overflow-y: auto; border-radius: 10px; }
.amorttable thead th { position: sticky; top: 0; background: var(--card, #16202c); }
.amorttable td.int { color: #ff8a80; }
.amorttable td.prin { color: #6aa9ff; }
.amorttable td.bal { color: var(--accent); }
.amorttable tr.now td { font-weight: 700; }
.amorttable tfoot td { font-weight: 700; border-top: 1px solid rgba(255, 255, 255, .15); }
.legallinks a { color: var(--accent); }
.bankhelp { margin: 10px 0; font-size: 14px; }
.bankhelp summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.bankhelp li { margin: 4px 0; }
#stPreview label.check { display: flex; gap: 8px; align-items: center; margin: 6px 0; font-size: 14px; }

/* "LiFin has a new address" card, shown only at the old address */
.card.moved { border-color: var(--accent); }
.card.moved h2 { margin-top: 0; }
.card.moved a:not(.button) { color: var(--accent); font-weight: 700; }
.card.moved .actions a.button { display: inline-block; margin: 0; }
.card.moved a.button.quiet { background: var(--quiet); color: var(--text); font-weight: 600; }
