[hidden] { display: none !important; }
@font-face { font-family: "Public Sans"; font-weight: 400; font-display: swap; src: url("/fonts/public-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 600; font-display: swap; src: url("/fonts/public-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 700; font-display: swap; src: url("/fonts/public-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 700; font-display: swap; src: url("/fonts/bricolage-grotesque-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 800; font-display: swap; src: url("/fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2"); }

:root {
  --paper: #F2F5F4; --surface: #FFFFFF; --ink: #1F2A2E; --ink-2: #4A575C; --ink-3: #6B7880;
  --rule: #E1E7E9; --rule-2: #CBD4D8; --brand: #0B6E5E; --brand-ink: #FFFFFF; --brand-soft: #E3F1EE; --mint: #6FD3B6;
  --income: #0B8F72; --expense: #5B4BB7; --good: #2E7D32; --warn: #9A5B00; --warn-soft: #FFF3DC; --bad: #B3261E; --bad-soft: #FCE8E6;
  --display: "Bricolage Grotesque", "Public Sans", system-ui, sans-serif; --body: "Public Sans", system-ui, sans-serif;
  --r-s: 6px; --r-m: 10px; --r-l: 16px; --shadow: 0 1px 2px rgba(31, 42, 46, .06), 0 4px 16px rgba(31, 42, 46, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111819; --surface: #1A2324; --ink: #E6EDEC; --ink-2: #B6C3C2; --ink-3: #8D9C9B; --rule: #2A3536; --rule-2: #3A4748;
    --brand: #4FC3A1; --brand-ink: #0D1C19; --brand-soft: #1D3631; --income: #4FC3A1; --expense: #A99CF0; --good: #7BC47F;
    --warn: #E8B25C; --warn-soft: #3A2D14; --bad: #F2867D; --bad-soft: #3D1F1C; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #111819; --surface: #1A2324; --ink: #E6EDEC; --ink-2: #B6C3C2; --ink-3: #8D9C9B; --rule: #2A3536; --rule-2: #3A4748;
  --brand: #4FC3A1; --brand-ink: #0D1C19; --brand-soft: #1D3631; --income: #4FC3A1; --expense: #A99CF0; --good: #7BC47F;
  --warn: #E8B25C; --warn-soft: #3A2D14; --bad: #F2867D; --bad-soft: #3D1F1C; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--body); }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.015em; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 800; }
h2 { font-size: 1.45rem; font-weight: 800; }
h3 { font-size: 1.08rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- top bar ---------- */
.top { background: var(--surface); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 20; }
.top .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 1.3rem var(--display); color: var(--ink); text-decoration: none; }
.brand b { color: var(--brand); font-weight: 800; }
.top nav { margin-left: auto; display: flex; gap: 4px; }
.top nav a { text-decoration: none; color: var(--ink-2); font-weight: 600; padding: 8px 12px; border-radius: var(--r-s); }
.top nav a[aria-current="page"], .top nav a:hover { background: var(--brand-soft); color: var(--brand); }
.top nav a { white-space: nowrap; }
@media (max-width: 420px) { .top .wrap { gap: 8px; } .brand { font-size: 1.1rem; gap: 8px; } .top nav a { padding: 8px 9px; font-size: .92rem; } }

/* ---------- buttons and fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 .95rem var(--body); padding: 10px 16px; border-radius: var(--r-m);
  border: 1px solid var(--rule-2); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; min-height: 42px; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); color: var(--brand-ink); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.small { padding: 6px 10px; min-height: 34px; font-size: .85rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
label.field { display: grid; gap: 4px; font-weight: 600; font-size: .875rem; color: var(--ink-2); }
input, select, textarea { font: 400 1rem var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--rule-2); border-radius: var(--r-m);
  padding: 9px 11px; min-height: 42px; width: 100%; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-l); padding: 20px; box-shadow: var(--shadow); }
.note { background: var(--brand-soft); color: var(--ink); border-radius: var(--r-m); padding: 12px 14px; font-size: .92rem; }
.note.warn { background: var(--warn-soft); }
.note.bad { background: var(--bad-soft); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--paper);
  color: var(--ink-2); border: 1px solid var(--rule); white-space: nowrap; }
.chip.open { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.chip.closed { background: var(--paper); color: var(--ink-3); }
.chip.idea { color: var(--expense); } .chip.problem { color: var(--bad); } .chip.question { color: var(--warn); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--r-m);
  font-weight: 600; z-index: 50; max-width: calc(100% - 32px); }

/* ---------- landing ---------- */
.hero { padding: 56px 0 32px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero p.lead { font-size: 1.18rem; color: var(--ink-2); max-width: 52ch; }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); }
.mini-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: .92rem; }
.mini-row:last-child { border: 0; }
.bar { height: 8px; background: var(--paper); border-radius: 99px; overflow: hidden; grid-column: 1 / -1; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.bar i.warn { background: var(--warn); } .bar i.bad { background: var(--bad); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 24px 0 8px; }
.steps .card b { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-family: var(--display); margin-bottom: 8px; }
.promise { padding: 24px 0 48px; }
.promise .card { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; }
.lock { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); display: grid; place-items: center; }
@media (max-width: 800px) { .hero .wrap, .steps { grid-template-columns: 1fr; } .hero { padding-top: 28px; } }

footer.site { border-top: 1px solid var(--rule); padding: 20px 0 32px; color: var(--ink-3); font-size: .875rem; }
footer.site .wrap { display: flex; gap: 16px; flex-wrap: wrap; }
footer.site a { color: var(--ink-2); }

/* ---------- the app ---------- */
.app-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 20px 0 12px; }
.month { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; padding: 4px; }
.month strong { font-family: var(--display); font-size: 1.05rem; min-width: 128px; text-align: center; }
.month button { border: 0; background: transparent; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; color: var(--ink-2); font-size: 1.2rem; }
.month button:hover { background: var(--brand-soft); color: var(--brand); }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--rule); margin-bottom: 18px; scrollbar-width: none; }
.tabs button { border: 0; background: transparent; font: 600 .95rem var(--body); color: var(--ink-2); padding: 10px 14px; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.tabs .count { background: var(--warn-soft); color: var(--warn); border-radius: 99px; padding: 0 7px; font-size: .75rem; margin-left: 4px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-l); padding: 16px 18px; }
.stat span { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.stat strong { display: block; font: 800 1.7rem var(--display); margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat.in strong { color: var(--income); } .stat.out strong { color: var(--expense); }
.stat.left.neg strong { color: var(--bad); }
.grid-2 { display: grid; grid-template-columns: 1.3fr .7fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr; } .stat strong { font-size: 1.45rem; } }
.cat-row { display: grid; grid-template-columns: 14px 1fr auto; gap: 4px 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.cat-row:last-child { border-bottom: 0; }
.dot { width: 12px; height: 12px; border-radius: 4px; }
.cat-row .bar { grid-column: 2 / -1; }
.cat-row .of { font-size: .8rem; color: var(--ink-3); grid-column: 2 / -1; }
.empty { text-align: center; padding: 36px 16px; }
.empty .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.trend { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--ink-2); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select { width: auto; flex: 1 1 180px; }
.tx { width: 100%; border-collapse: collapse; }
.tx th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); padding: 8px; border-bottom: 1px solid var(--rule); }
.tx td { padding: 8px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.tx td.amt { text-align: right; white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.tx td.amt.in { color: var(--income); }
.tx td.date { white-space: nowrap; color: var(--ink-2); font-size: .9rem; }
.tx td.desc { word-break: break-word; }
.tx select { min-height: 36px; padding: 5px 8px; font-size: .9rem; }
.tx tr.dup td { opacity: .55; }
.tx tr.check td.desc::after { content: "check"; margin-left: 8px; font-size: .7rem; font-weight: 700; color: var(--warn); background: var(--warn-soft); padding: 1px 6px; border-radius: 99px; }
.tx .x { border: 0; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 1.1rem; width: 32px; height: 32px; border-radius: 50%; }
.tx .x:hover { background: var(--bad-soft); color: var(--bad); }
@media (max-width: 640px) {
  .tx thead { display: none; }
  .tx tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .tx td { border: 0; padding: 2px 0; }
  .tx td.date { grid-column: 1; } .tx td.amt { grid-column: 2; grid-row: 1; }
  .tx td.desc, .tx td.cat { grid-column: 1 / -1; }
  .tx td.act { grid-column: 2; grid-row: 2; }
}
.drop { border: 2px dashed var(--rule-2); border-radius: var(--r-l); padding: 30px 16px; text-align: center; background: var(--surface); cursor: pointer; }
.drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop strong { display: block; font: 800 1.2rem var(--display); margin-bottom: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.budget-row { display: grid; grid-template-columns: 14px 1fr 150px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.budget-row .typical { font-size: .8rem; color: var(--ink-3); }
.money-in { position: relative; }
.money-in span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.money-in input { padding-left: 30px; text-align: right; }
.section { margin-bottom: 18px; }
.cat-edit { display: grid; grid-template-columns: 44px 1fr 120px 40px; gap: 8px; align-items: center; margin-bottom: 6px; }
.cat-edit input[type="color"] { padding: 2px; height: 38px; min-height: 0; }
@media (max-width: 520px) { .budget-row { grid-template-columns: 14px 1fr 120px; } .cat-edit { grid-template-columns: 40px 1fr 40px; } .cat-edit select { grid-column: 2; } }

/* ---------- feedback ---------- */
.fb-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 28px 0 14px; }
.fb-head p { margin: 0; color: var(--ink-2); max-width: 60ch; }
.fb-layout { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; padding-bottom: 40px; }
@media (max-width: 900px) { .fb-layout { grid-template-columns: 1fr; } .fb-layout aside { order: -1; } }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; font: 600 .88rem var(--body); color: var(--ink-2); padding: 7px 13px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.item { display: block; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-l); padding: 14px 16px; margin-bottom: 10px; text-decoration: none; color: inherit; }
.item:hover { border-color: var(--brand); }
.item h3 { margin: 6px 0 4px; }
.item p { margin: 0; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .meta, .item.meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: .8rem; color: var(--ink-3); }
.thread { margin-top: 18px; }
.cmt { border-left: 3px solid var(--rule); padding: 6px 0 6px 14px; margin: 0 0 14px; }
.cmt.team { border-left-color: var(--brand); }
.cmt.closed, .cmt.reopened { border-left-color: var(--warn); background: var(--warn-soft); border-radius: 0 var(--r-m) var(--r-m) 0; padding: 10px 14px; }
.cmt.closed { background: var(--brand-soft); border-left-color: var(--brand); }
.cmt .who { font-size: .82rem; color: var(--ink-3); margin-bottom: 2px; }
.cmt .who b { color: var(--ink); }
.cmt p, .item-body { white-space: pre-wrap; word-break: break-word; margin: 0; }
.cmt.hidden-c { opacity: .5; }
.team-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 12px; border: 1px dashed var(--brand); border-radius: var(--r-m); margin: 12px 0; }
.legal { max-width: 760px; padding: 32px 16px 48px; margin: 0 auto; }
.legal h2 { margin-top: 1.4em; }

/* ---------- accounts (account.css reads these) ---------- */
:root { --acct-surface: var(--surface); --acct-ink: var(--ink); --acct-muted: var(--ink-2); --acct-rule: var(--rule); --acct-rule-2: var(--rule-2);
  --acct-brand: var(--brand); --acct-brand-ink: var(--brand-ink); --acct-soft: var(--brand-soft); --acct-bad: var(--bad); --acct-bad-soft: var(--bad-soft); }
.acct-card h1, .acct-card h2 { font-family: var(--display); }
@media (max-width: 560px) {
  .top .wrap { gap: 6px; }
  .brand { font-size: 0; gap: 0; }            /* the icon alone on a phone, so the menu fits */
  .brand img { width: 30px; height: 30px; }
  .top nav { gap: 0; }
  .top nav a { padding: 7px 6px; font-size: .84rem; }
  .top nav a:last-child { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 380px) { .top nav a { padding: 6px 4px; font-size: .8rem; } }
