
/* Layout: clean bank-app column — small greeting row, a royal-blue summary card holding month, total, budget and stats, then white cards: pie chart with legend, day bars, 6-month bars, expense list. Orange is the action colour (Add button, highlights). Light only. */
:root {
  color-scheme: light;
  --page: #f3f5fa;
  --surface: #ffffff;
  --sunken: #f1f4fa;
  --ink: #0e1a33;
  --ink-2: #4a5672;
  --muted: #8590a8;
  --line: #e3e8f2;
  --base: #c8d0e0;
  --accent: #1f4fd6;
  --accent-deep: #143a9e;
  --accent-soft: #eaf0ff;
  --accent-border: #c9d7fb;
  --orange: #ea580c;
  --orange-hi: #f97316;
  --orange-ink: #a8430a;
  --orange-soft: #fff1e6;
  --good: #0a7d55; --warn: #a35a00; --bad: #c42b2b;
  --good-bg: #ebfaf3; --warn-bg: #fff8eb; --bad-bg: #fdf1f1;
  --good-bd: #b8ead2; --warn-bd: #fde3b0; --bad-bd: #f6caca;
  /* categories — validated together on white (lightness, chroma, colour-blind, contrast) */
  --c1: #059669; --c2: #2563eb; --c3: #d97706; --c4: #db2777;
  --c5: #0891b2; --c6: #9333ea; --c7: #65a30d; --c8: #5b4cf0;
  --bar: #1f4fd6; --bar-dim: #c9d7fb;
  --shadow: 0 1px 2px rgb(14 26 51 / .05), 0 10px 30px -18px rgb(14 26 51 / .25);
  --f-display: "Outfit", "DM Sans", system-ui, sans-serif;
  --f-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  background: var(--page); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 110px; overflow-x: hidden;
}
.wrap { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; padding-top: 14px; }
h1, h2 { font-family: var(--f-display); margin: 0; text-wrap: balance; }
h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* top row */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-ic { width: 42px; height: 42px; border-radius: 14px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; font-family: var(--f-display); position: relative; flex: none; }
.brand-ic::after { content: ""; position: absolute; right: -3px; top: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--orange-hi); border: 2.5px solid var(--page); }
.who small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.who h1 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.iconbtn { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; height: 40px; padding: 0 14px; font-size: 14px; font-weight: 600; color: var(--ink); box-shadow: var(--shadow); }

/* blue summary card */
.hero {
  position: relative; isolation: isolate; overflow: hidden; border-radius: 26px; padding: 18px; color: #fff;
  display: flex; flex-direction: column; gap: 14px;
  background: linear-gradient(150deg, #2b62f2 0%, #1f4fd6 45%, #143a9e 100%);
  box-shadow: 0 24px 50px -24px rgb(20 58 158 / .7);
}
.hero::before { content: ""; position: absolute; z-index: -1; width: 340px; height: 340px; right: -150px; top: -150px; border-radius: 50%;
  background: repeating-radial-gradient(circle, rgb(255 255 255 / .09) 0 1.5px, transparent 1.5px 26px); }
.hero::after { content: ""; position: absolute; z-index: -1; width: 220px; height: 220px; left: -60px; bottom: -150px; border-radius: 50%; background: var(--orange-hi); opacity: .35; filter: blur(60px); }
.month { display: flex; align-items: center; gap: 8px; }
.month .label { flex: 1; text-align: center; font-weight: 600; font-family: var(--f-display); font-size: 16px; }
.glass { border: 1px solid rgb(255 255 255 / .25); background: rgb(255 255 255 / .14); color: #fff; border-radius: 12px; height: 36px; min-width: 36px; display: inline-grid; place-items: center; font-size: 18px; font-weight: 600; }
.glass:disabled { opacity: .3; cursor: default; }
.badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; background: rgb(255 255 255 / .16); padding: 4px 12px; font-size: 12px; font-weight: 600; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--orange-hi); }
.eyebrow { font-size: 13.5px; color: rgb(255 255 255 / .8); font-weight: 500; }
.total { font-family: var(--f-display); font-size: 44px; font-weight: 700; line-height: 1.05; letter-spacing: -.02em; margin-top: 2px; }
.total small { font-size: .5em; opacity: .8; margin-right: 3px; font-weight: 600; vertical-align: .35em; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row:empty { display: none; }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 700; background: #fff; }
.pill.good { color: var(--good); } .pill.warn { color: var(--orange-ink); } .pill.bad { color: var(--bad); }
.field { display: flex; flex-direction: column; gap: 6px; }
.meter { height: 10px; border-radius: 6px; background: rgb(255 255 255 / .2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 6px; background: #fff; transition: width .4s ease; }
.meter.warn > span { background: #ffc53d; }
.meter.bad > span { background: #ff6b6b; }
.budgetline { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: rgb(255 255 255 / .88); flex-wrap: wrap; }
.linkbtn { background: none; border: 0; padding: 0; color: #fff; font-weight: 700; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: rgb(255 255 255 / .12); border: 1px solid rgb(255 255 255 / .16); border-radius: 16px; padding: 10px 11px; min-width: 0; }
.stat b { display: block; font-family: var(--f-display); font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat span { font-size: 11.5px; color: rgb(255 255 255 / .75); }

.banner { border-radius: 16px; padding: 11px 14px; font-size: 13.5px; background: var(--orange-soft); border: 1px solid #fcd6b8; color: var(--ink); }
.exb { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.exbtn { border: 0; background: var(--accent); color: #fff; border-radius: 10px; padding: 8px 14px; font-weight: 700; font-size: 13px; }
.btn.wide { flex: none; width: 100%; }
.hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.banner.info { background: var(--accent-soft); border-color: var(--accent-border); }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; box-shadow: var(--shadow); }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.chart-head p { margin: 0; font-size: 12.5px; color: var(--muted); }
.chart-head .tag { font-size: 12px; font-weight: 700; color: var(--orange-ink); background: var(--orange-soft); border-radius: 999px; padding: 4px 10px; }

/* pie */
.pie { position: relative; width: min(240px, 72vw); margin: 4px auto 0; }
.pie svg { display: block; width: 100%; height: auto; overflow: visible; }
.pie path { cursor: pointer; transition: transform .2s ease, opacity .2s; transform-origin: 120px 120px; }
.pie.sel path { opacity: .35; }
.pie.sel path.on { opacity: 1; }
.pie-mid { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.pie-mid div { max-width: 46%; }
.pie-mid span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.pie-mid b { display: block; font-family: var(--f-display); font-size: 20px; font-weight: 700; line-height: 1.15; }
.pie-mid em { display: block; font-style: normal; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.catlist { display: flex; flex-direction: column; gap: 2px; }
.cat { display: grid; grid-template-columns: auto 1fr auto; gap: 0 12px; align-items: center; border: 0; background: none; width: 100%; text-align: left; padding: 8px; border-radius: 14px; }
.cat:hover, .cat[aria-pressed="true"] { background: var(--sunken); }
.cat .ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; }
.cat .nm { font-weight: 600; font-size: 14.5px; min-width: 0; }
.cat .nm small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.cat .amt { font-size: 14.5px; font-weight: 700; text-align: right; }

.svgbox { position: relative; width: 100%; }
.svgbox svg { display: block; width: 100%; height: auto; overflow: visible; }
.svgbox text { fill: var(--muted); font-family: var(--f-body); font-size: 10px; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; border-radius: 10px; padding: 6px 10px; font-size: 12px; line-height: 1.3; white-space: nowrap; transform: translate(-50%, -100%); top: 0; left: 0; box-shadow: 0 10px 24px -10px rgb(14 26 51 / .6); }
.tip b { display: block; font-size: 14px; font-family: var(--f-display); }
.tip span { display: block; opacity: .75; font-size: 11.5px; }

/* list */
.daygroup { display: flex; flex-direction: column; }
.dayhead { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 600; padding: 12px 2px 6px; text-transform: uppercase; letter-spacing: .06em; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 8px; margin: 0 -8px; border: 0; border-radius: 14px; background: none; width: calc(100% + 16px); text-align: left; }
.item:hover:not(:disabled) { background: var(--sunken); }
.item .dot { width: 40px; height: 40px; border-radius: 13px; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; }
.item .txt { flex: 1; min-width: 0; }
.item .txt b { display: block; font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .txt span { font-size: 12.5px; color: var(--muted); }
.item .val { font-weight: 700; font-size: 15px; font-family: var(--f-display); }
.empty { text-align: center; color: var(--muted); font-size: 14px; padding: 18px 8px; }

/* buttons + sheets */
.grad-btn { color: #fff; border: 0; background: linear-gradient(135deg, var(--orange-hi), var(--orange)); box-shadow: 0 12px 24px -12px var(--orange), inset 0 1px 0 rgb(255 255 255 / .25); transition: transform .15s, filter .2s; }
.grad-btn:hover:not(:disabled) { filter: brightness(1.05); }
.grad-btn:active:not(:disabled) { transform: scale(.98); }
.fab { position: fixed; right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); height: 56px; padding: 0 22px; border-radius: 28px; font-weight: 700; font-size: 16px; display: inline-flex; align-items: center; gap: 8px; z-index: 5; }
.fab span { font-size: 24px; line-height: 0; margin-top: -2px; }
.scrim { position: fixed; inset: 0; background: rgb(14 26 51 / .45); backdrop-filter: blur(3px); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 560px; border-radius: 28px 28px 0 0; max-height: 92%; overflow-y: auto;
  padding-top: 10px; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 14px; animation: up .22s ease; }
@keyframes up { from { transform: translateY(30px); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } .meter > span, .grad-btn, .pie path { transition: none; } }
.grab { width: 40px; height: 4px; border-radius: 2px; background: var(--base); align-self: center; }
.sheet h2 { font-size: 21px; }
.field label, .lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); }
input, select { font: inherit; font-size: 16px; color: var(--ink); background: var(--sunken); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; width: 100%; min-width: 0; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgb(31 79 214 / .15); outline: none; }
.amountin { font-family: var(--f-display); font-size: 30px; font-weight: 700; padding: 10px 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 12px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.chip i { width: 9px; height: 9px; border-radius: 50%; }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions { display: flex; gap: 10px; }
.btn { flex: 1; height: 50px; border-radius: 14px; font-weight: 700; font-size: 16px; }
.btn.ghost { background: var(--sunken); color: var(--ink); border: 1.5px solid var(--line); flex: 0 0 auto; padding: 0 18px; box-shadow: none; }
.btn.danger { background: var(--bad-bg); color: var(--bad); border: 1.5px solid var(--bad-bd); flex: 0 0 auto; padding: 0 18px; box-shadow: none; }
.err { color: var(--bad); font-size: 13px; margin: 0; }
.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 14px; font-weight: 600; font-size: 14px; z-index: 30; white-space: nowrap; }
.foot { font-size: 12px; color: var(--muted); text-align: center; }
/* v6 additions: manage, select, filter */
:root { --c9: #c2410c; --c10: #0d9488; --c11: #be185d; --c12: #4d7c0f; --more: #a3acbf; }
.stats { grid-template-columns: repeat(2, 1fr); }
.mini { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 7px 12px; font-size: 13px; font-weight: 700; color: var(--ink); }
.mini.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.mini:disabled { opacity: .45; cursor: default; }
.search { position: relative; }
.search input { padding-left: 40px; font-size: 15px; }
.search::before { content: ""; position: absolute; left: 14px; top: 50%; width: 13px; height: 13px; border: 2px solid var(--muted); border-radius: 50%; transform: translateY(-62%); }
.search::after { content: ""; position: absolute; left: 26px; top: 58%; width: 6px; height: 2px; background: var(--muted); transform: rotate(45deg); border-radius: 1px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters:empty { display: none; }
.fchip { border: 0; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.fchip b { font-size: 15px; line-height: 1; }
.listsum { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.listsum b { color: var(--ink); }
.item .ck { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--base); flex: none; display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800; }
.item[aria-checked="true"] { background: var(--accent-soft); }
.item[aria-checked="true"] .ck { background: var(--accent); border-color: var(--accent); }
.item[aria-checked="true"] .ck::after { content: "✓"; }
.selbar { position: fixed; z-index: 6; left: calc(12px + env(safe-area-inset-left, 0px)); right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  max-width: 540px; margin: 0 auto; background: var(--ink); color: #fff; border-radius: 20px; padding: 10px 10px 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; box-shadow: 0 20px 40px -16px rgb(14 26 51 / .6); }
.selbar .info { min-width: 0; }
.selbar .info b { display: block; font-size: 14px; }
.selbar .info span { font-size: 12px; color: rgb(255 255 255 / .7); }
.selbar .btns { display: flex; gap: 6px; flex: none; }
.selbar button { border: 0; border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: 13px; background: rgb(255 255 255 / .14); color: #fff; }
.selbar button.del { background: #e5484d; }
.selbar button:disabled { opacity: .4; cursor: default; }
.datechips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip.small { padding: 5px 11px; font-size: 13px; }
.chip.add { border-style: dashed; color: var(--accent); }
.catrow { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.catrow .sw { width: 16px; height: 16px; border-radius: 5px; }
.catrow input { padding: 10px 12px; font-size: 15px; }
.xbtn { border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; height: 44px; padding: 0 12px; font-weight: 700; font-size: 13px; color: var(--bad); }
.xbtn.sure { background: var(--bad); color: #fff; border-color: var(--bad); }
.xbtn:disabled { color: var(--muted); }
.addrow { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.addrow .btn { flex: none; padding: 0 18px; height: 46px; }
.sect { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.sect h3 { margin: 0; font-family: var(--f-display); font-size: 15px; }
.linkrow { display: flex; flex-direction: column; gap: 8px; }
.wide-btn { width: 100%; height: 48px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--sunken); font-weight: 700; font-size: 15px; color: var(--ink); text-align: left; padding: 0 14px; display: flex; justify-content: space-between; align-items: center; }
.wide-btn.bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-bd); }
.wide-btn span { font-weight: 500; font-size: 12.5px; color: var(--muted); }
.toast { display: flex; align-items: center; gap: 14px; }
.toast button { background: none; border: 0; color: #ffb37a; font-weight: 800; font-size: 14px; padding: 0; }
.actions.three .btn.ghost { padding: 0 14px; }
/* v7: change amount by + / − */
.adj { display: flex; flex-direction: column; gap: 8px; background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 16px; padding: 12px; }
.adjrow { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.adjrow input { background: var(--surface); padding: 10px 12px; }
.adjbtn { border: 0; border-radius: 12px; padding: 0 14px; height: 46px; font-weight: 700; font-size: 14px; color: #fff; background: var(--accent); white-space: nowrap; }
.adjbtn.minus { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }
.adjquick { display: flex; flex-wrap: wrap; gap: 6px; }
.adjquick .chip { background: var(--surface); }
.adjnote { margin: 0; font-size: 13px; color: var(--ink-2); }
.adjnote b { color: var(--ink); }
.item .val small { display: block; text-align: right; font-family: var(--f-body); font-size: 11.5px; font-weight: 600; color: var(--accent); }
/* v8: tabs, books, quick add, monthly, limits, money in, owed, goals, receipts, report */
.toast { white-space: normal; width: max-content; max-width: calc(100vw - 32px); }
.topbtns { display: flex; gap: 8px; flex: none; }
.iconbtn.book { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn.book.fam { background: var(--orange-soft); border-color: #fcd6b8; color: var(--orange-ink); }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 4px; box-shadow: var(--shadow); }
.tabs button { border: 0; background: none; border-radius: 12px; height: 40px; font-weight: 700; font-size: 13.5px; color: var(--ink-2); padding: 0 4px; white-space: nowrap; }
.tabs button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.monthbar { display: flex; align-items: center; gap: 8px; }
.monthbar .label { flex: 1; text-align: center; font-family: var(--f-display); font-weight: 700; font-size: 17px; }
.mbtn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 20px; font-weight: 600; box-shadow: var(--shadow); color: var(--ink); }
.mbtn:disabled { opacity: .35; cursor: default; }
.pane { display: flex; flex-direction: column; gap: 16px; }
.herotop { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.herotop .badge { align-self: center; }
.glass.pillbtn { height: 32px; padding: 0 12px; font-size: 13px; font-weight: 700; border-radius: 999px; }
.flow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.flow:empty { display: none; }
.flow .linkbtn { grid-column: 1 / -1; justify-self: start; }
.stat.in b { color: #c9f7df; }
.stat.neg b { color: #ffd0d0; }

.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.qchip { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 14px; padding: 9px 12px; font-size: 14px; font-weight: 600; max-width: 100%; text-align: left; color: var(--ink); }
.qchip i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.qchip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qchip b { font-family: var(--f-display); color: var(--accent); white-space: nowrap; }
.qchip.add { border-style: dashed; color: var(--accent); }
.qchip:active:not(:disabled) { transform: scale(.97); }
.quick.editing .qchip:not(.add) { border-color: var(--orange); background: var(--orange-soft); }

.rows { display: flex; flex-direction: column; }
.rrow { display: flex; align-items: center; gap: 12px; padding: 10px 8px; margin: 0 -8px; border: 0; background: none; border-radius: 14px; width: calc(100% + 16px); text-align: left; color: var(--ink); }
.rrow:hover { background: var(--sunken); }
.rrow .dot { width: 40px; height: 40px; border-radius: 13px; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; }
.rrow .txt { flex: 1; min-width: 0; }
.rrow .txt b { display: block; font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rrow .txt span { font-size: 12.5px; color: var(--muted); }
.rrow .end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.rrow .end b { font-family: var(--f-display); font-weight: 700; font-size: 15px; }
.rrow .end b.plus { color: var(--good); }
.st { display: inline-block; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.st.good { background: var(--good-bg); color: var(--good); }
.st.warn { background: var(--warn-bg); color: var(--warn); }
.st.bad { background: var(--bad-bg); color: var(--bad); }
.st.muted { background: var(--sunken); color: var(--muted); }
.sumline { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 12px; flex-wrap: wrap; }
.sumline:empty { display: none; }
.sumline b { color: var(--ink); }

.lim { display: block; height: 6px; border-radius: 4px; background: var(--sunken); overflow: hidden; margin-top: 6px; }
.lim > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.lim.warn > span { background: #f59e0b; }
.lim.bad > span { background: var(--bad); }
.cat .amt small { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.cat .amt small.bad { color: var(--bad); }
.limrow { display: grid; grid-template-columns: auto 1fr 140px; gap: 10px; align-items: center; }
.limrow .sw { width: 14px; height: 14px; border-radius: 5px; }
.limrow label { font-weight: 600; font-size: 14.5px; color: var(--ink); min-width: 0; }
.limrow input { padding: 10px 12px; font-size: 15px; text-align: right; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tiles.two { grid-template-columns: 1fr 1fr; }
.tile { background: var(--sunken); border-radius: 16px; padding: 12px; min-width: 0; }
.tile.lift { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 14px; }
.tile span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.tile b { display: block; font-family: var(--f-display); font-size: 19px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.good b { color: var(--good); }
.tile.bad b { color: var(--bad); }
.tile.acc b { color: var(--accent); }

.goal { width: 100%; text-align: left; font: inherit; color: var(--ink); gap: 10px; }
.goal .ghead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.goal .ghead b { font-family: var(--f-display); font-size: 18px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal .ghead span { font-family: var(--f-display); font-weight: 700; color: var(--accent); }
.gbar { height: 12px; border-radius: 7px; background: var(--sunken); overflow: hidden; }
.gbar > span { display: block; height: 100%; border-radius: 7px; background: linear-gradient(90deg, var(--accent), #4b7bff); }
.goal.done .gbar > span { background: var(--good); }
.goal.done .ghead span { color: var(--good); }
.goal .gfoot { font-size: 14px; color: var(--ink-2); }
.goal .gfoot b { color: var(--ink); }
.emptycard { text-align: center; color: var(--ink-2); font-size: 14px; }

.rcpt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.thumbbtn { border: 0; padding: 0; background: none; border-radius: 12px; }
.thumbbtn img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: var(--sunken); display: block; }
.tagmini { display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px; }
.photo { width: 100%; border-radius: 16px; background: var(--sunken); }
.formlinks { display: flex; flex-wrap: wrap; gap: 8px; }
.reportimg { width: 100%; border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.copytext { font: inherit; font-size: 13px; width: 100%; min-height: 160px; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; background: var(--sunken); color: var(--ink); }
.opt { display: flex; flex-direction: column; gap: 3px; text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 16px; padding: 14px; width: 100%; color: var(--ink); }
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.opt b { font-size: 15px; }
.opt span { font-size: 13px; color: var(--ink-2); }
.steps { margin: 0; padding-left: 20px; font-size: 13.5px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }
details summary { cursor: pointer; font-weight: 700; font-family: var(--f-display); font-size: 16px; }
details[open] summary { margin-bottom: 6px; }
.payrow { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.payrow input { background: var(--surface); padding: 10px 12px; }
.payrow .adjbtn { height: 46px; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.btnrow .btn { flex: 1 1 140px; }
.gbody { display: flex; flex-direction: column; gap: 14px; }
.big { font-family: var(--f-display); font-size: 26px; font-weight: 700; }
.goal .gbar, .goal .gfoot, .goal > .hint { display: block; }

/* app: sign in, invite code, links that look like buttons */
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html, body { margin: 0; }
img { max-width: 100%; }
.auth { min-height: 92vh; display: flex; flex-direction: column; justify-content: center; gap: 18px; max-width: 420px; margin: 0 auto; padding-block: 28px; }
.brandrow { display: flex; align-items: center; gap: 12px; }
.brandrow .brand-ic { width: 52px; height: 52px; font-size: 22px; border-radius: 16px; }
.auth h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.auth .lead { margin: 0; color: var(--ink-2); }
.authcard { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.authcard h2 { font-size: 21px; }
.authcard .btn { flex: none; width: 100%; }
.authfoot { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.authfoot a { color: var(--accent); font-weight: 700; }
.linkbtn.dark { color: var(--accent); }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.mini.sure { background: var(--bad); color: #fff; border-color: var(--bad); }
.big.code { letter-spacing: .14em; }
