:root {
  color-scheme: light;
  font-family: "Inter", "Helvetica Neue", system-ui, sans-serif;
  color: #202a27;
  background: #f6f7f2;
  --paper: #fff;
  --ink: #202a27;
  --forest: #173f37;
  --green: #36775b;
  --lime: #dbed9e;
  --muted: #52635c;
  --line: #d8ded5;
  --wash: #ecf1e8;
  font-synthesis: none;
  font-variant-numeric: tabular-nums;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
a { color: inherit; text-underline-offset: .2em; }
button, select, input { color: inherit; font: inherit; }
button, select, input[type=checkbox], summary { cursor: pointer; }
button, .button { touch-action: manipulation; }
button:disabled { cursor: wait; opacity: .65; }
input, select { accent-color: var(--forest); }
input[type=date], input[type=search], input[type=text], select { width: 100%; min-width: 0; padding: .66rem .72rem; font-size: .9rem; border: 1px solid #bdc8bd; border-radius: 7px; background-color: #fff; color: var(--ink); }
input[type=checkbox] { width: 1rem; height: 1rem; flex-shrink: 0; }
label { font-size: .84rem; font-weight: 600; }
label > select, label > input:not([type=checkbox]) { display: block; margin-top: .4rem; }
::selection { background: var(--lime); color: var(--forest); }
:focus-visible { outline: 3px solid #198269; outline-offset: 3px; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { color: var(--forest); line-height: 1.12; text-wrap: balance; }
h1 { font-size: 2.65rem; font-weight: 620; letter-spacing: -.04em; }
h2 { font-size: 1.32rem; font-weight: 625; letter-spacing: -.025em; }
h3 { font-size: 1rem; font-weight: 650; }
p { line-height: 1.52; }
.skip { position: fixed; top: -100px; left: 1rem; z-index: 10; background: white; padding: .6rem; }
.skip:focus { top: .5rem; }
.masthead { background: var(--paper); border-bottom: 1px solid var(--line); }
.masthead-inner, #main { max-width: 1300px; margin: 0 auto; padding-inline: clamp(1rem, 4.5vw, 4.5rem); }
.masthead-inner { display: flex; align-items: center; min-height: 72px; gap: clamp(1.15rem, 4.5vw, 4.4rem); }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--forest); font-size: 1.32rem; font-weight: 720; letter-spacing: -.045em; text-decoration: none; white-space: nowrap; }
.brand img { width: 34px; height: 34px; }
nav { align-self: stretch; display: flex; gap: 1.35rem; }
.nav-item { display: inline-flex; align-items: center; gap: .4rem; border-bottom: 3px solid transparent; padding: .15rem .1rem 0; color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 580; }
.nav-item:hover, .nav-item[aria-current=page] { color: var(--forest); }
.nav-item[aria-current=page] { border-color: var(--green); }
#session { margin-left: auto; }
#session, .actions { display: flex; align-items: center; gap: .55rem; }
.icon { width: 1.08em; height: 1.08em; display: inline-block; flex: none; vertical-align: -.14em; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; fill: none; }
.status-label { background: var(--wash); color: var(--forest); border-radius: 2rem; padding: .34rem .65rem; font-size: .75rem; font-weight: 620; white-space: nowrap; }
.button, .text-button, .icon-button, .chip { display: inline-flex; align-items: center; justify-content: center; gap: .48rem; font-weight: 600; text-decoration: none; border: 0; }
.button { min-height: 40px; padding: .56rem .86rem; border: 1px solid #c6d0c5; border-radius: 8px; background: white; color: var(--forest); font-size: .88rem; }
.button:hover, .icon-button:hover { background: var(--wash); }
.button.primary { background: var(--forest); border-color: var(--forest); color: white; }
.button.primary:hover { background: #285247; }
.button.lime { background: var(--lime); color: #1b3d30; border-color: var(--lime); }
.button.lime:hover { background: #edfac3; }
.text-button { color: var(--forest); background: transparent; padding: .45rem 0; font-size: .86rem; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.icon-button { border-radius: .45rem; color: var(--muted); background: transparent; padding: .48rem; }
#main { padding-block: 2.55rem 4rem; }
.page-head, .section-head, .list-row, .pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.page-head { align-items: flex-end; margin-bottom: 1.4rem; }
.page-head p, .section-head p, .muted { color: var(--muted); }
.page-head p { margin-top: .35rem; font-size: .95rem; }
.section-head { margin-bottom: 1.1rem; }
.section-head p { font-size: .84rem; margin-top: .35rem; }
.chart-source { color: #52635c; font-size: .8rem; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: .72rem; padding: .9rem 0 1.35rem; }
.filters label { min-width: min(135px, 100%); max-width: 100%; }
.filters .search-field { min-width: min(210px, 100%); flex: 1; }
.filter-chip { display: inline-flex; align-items: center; gap: .4rem; margin-right: .5rem; }
.filters .text-button { align-self: end; min-height: 40px; }
.metrics { display: grid; grid-template-columns: 1.15fr 1fr 1fr; margin: .15rem 0 1.15rem; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: white; }
.metric { min-width: 0; padding: 1.35rem 1.55rem; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric.primary { background: var(--forest); color: white; }
.metric .metric-label { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .86rem; font-weight: 620; }
.metric.primary .metric-label { color: #d8e6d9; }
.metric strong { display: block; margin-top: .58rem; font-size: 2.05rem; font-weight: 590; line-height: 1; letter-spacing: -.04em; overflow-wrap: anywhere; }
.metric small { display: block; color: var(--muted); font-size: .78rem; margin-top: .6rem; }
.metric.primary small { color: #d8e6d9; }
.board { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(0,1fr); gap: 1.15rem; }
.panel { min-width: 0; background: white; border: 1px solid var(--line); border-radius: 14px; padding: 1.35rem 1.5rem; }
.panel.wide { grid-column: 1 / -1; }
.spacer { margin-top: 1.15rem; }
.trend { width: 100%; display: block; }
.trend text { font-family: inherit; font-size: 11px; fill: #52635c; }
.trend .grid { stroke: #dce1d9; stroke-dasharray: 3 4; }
.trend .bar { fill: #428366; }
.legend { display: flex; gap: .45rem; align-items: center; font-size: .78rem; color: var(--muted); }
.legend-dot { width: .65rem; height: .65rem; flex: none; border-radius: 3px; background: var(--green); }
.chart-detail { margin: .4rem 0 0; color: var(--muted); font-size: .79rem; }
.chart-detail summary { width: fit-content; padding: .2rem 0; }
.ranked { display: flex; flex-direction: column; }
.rank-item { display: block; width: 100%; padding: .53rem .1rem; color: var(--ink); border: 0; text-align: left; background: transparent; }
.rank-item:hover .rank-label, .row-link:hover { color: var(--green); text-decoration: underline; }
.list-row { align-items: baseline; font-size: .91rem; }
.rank-label { overflow-wrap: anywhere; }
.rank-amount { font-weight: 650; white-space: nowrap; }
.rank-bar { width: 100%; height: .4rem; margin-top: .43rem; display: block; border: 0; border-radius: .2rem; overflow: hidden; background: #edf1e9; appearance: none; }
.rank-bar::-webkit-progress-bar { background: #edf1e9; }
.rank-bar::-webkit-progress-value { background: #6e987b; border-radius: .2rem; }
.rank-bar::-moz-progress-bar { background: #6e987b; }
.rank-item:first-child .rank-bar::-webkit-progress-value { background: #326e59; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .87rem; }
th { color: var(--muted); font-size: .74rem; font-weight: 620; padding: .63rem .55rem; white-space: nowrap; border-bottom: 1px solid var(--line); }
td { padding: .8rem .55rem; vertical-align: middle; border-bottom: 1px solid #e7ebe4; }
td:first-child, th:first-child { padding-left: 0; }
td:last-child, th:last-child { padding-right: 0; }
tbody tr:last-child td { border-bottom: 0; }
td.amount, th.amount { text-align: right; white-space: nowrap; }
td.amount { font-weight: 620; }
.positive { color: #246544; }
.row-link { padding: 0; background: transparent; border: 0; color: var(--forest); text-align: left; overflow-wrap: anywhere; font-weight: 600; }
.subline { display: block; margin-top: .18rem; color: var(--muted); font-size: .75rem; font-weight: 400; }
.mobile-date { display: none; }
.category-pill { display: inline-flex; align-items: center; gap: .32rem; padding: .24rem .5rem; border: 1px solid #d5ded3; border-radius: 5px; font-size: .74rem; font-weight: 550; background: #f4f7ef; color: #3e5844; }
.category-pill:hover { border-color: var(--green); }
.pagination { margin-top: 1rem; font-size: .85rem; color: var(--muted); }
.account-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(230px,100%),1fr)); gap: .9rem; }
.account { display: flex; flex-direction: column; gap: .55rem; align-items: start; text-align: left; font: inherit; }
.account:hover { border-color: var(--green); }
.account .account-icon { color: var(--green); }
.account .account-total { margin: .55rem 0 .1rem; font-size: 1.8rem; color: var(--forest); letter-spacing: -.035em; font-weight: 610; }
.account small { color: var(--muted); }
.balance-short { display: flex; flex-wrap: wrap; column-gap: .9rem; align-items: baseline; }
.balance-short > span { flex-basis: 100%; font-size: .82rem; color: var(--muted); }
.balance-short strong { font-size: 1.7rem; color: var(--forest); letter-spacing: -.035em; }
.balance-short .text-button { margin-left: auto; }
.overview-list { margin-top: .9rem; border-top: 1px solid var(--line); }
.overview-row { width: 100%; padding: .6rem 0; display: flex; justify-content: space-between; gap: .6rem; color: var(--ink); border: 0; background: transparent; font-size: .86rem; text-align: left; }
.overview-row + .overview-row { border-top: 1px solid #e7ebe4; }
.overview-row:hover > span { text-decoration: underline; color: var(--green); }
.overview-row strong { font-weight: 620; white-space: nowrap; }
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: .5rem .8rem; border-block: 1px solid var(--line); margin: 1rem 0; padding: .85rem 0; font-size: .84rem; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.edit-error:not(:empty) { color: #812f27; margin-bottom: .75rem; font-size: .88rem; }
.empty { color: var(--muted); padding: .9rem 0; }
.notice { background: var(--wash); padding: .68rem .9rem; border-radius: 7px; font-size: .9rem; color: var(--forest); margin-bottom: 1rem; }
.error { color: #812f27; background: #fbefea; }
.welcome { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); background: var(--forest); color: #fff; border-radius: 18px; overflow: hidden; min-height: 400px; }
.welcome-copy { padding: clamp(1.7rem, 4.5vw, 4rem); align-self: center; }
.welcome h1 { color: white; max-width: 12ch; font-size: 3.5rem; font-weight: 580; letter-spacing: -.04em; line-height: 1.03; }
.welcome-copy p { margin: 1.1rem 0 1.45rem; color: #d9e6d7; max-width: 39ch; }
.welcome-copy .actions { flex-wrap: wrap; gap: 1rem; }
.welcome-copy .text-button { color: #f3f7e9; }
.welcome-copy p.setup-note { margin: 1.15rem 0 0; font-size: .82rem; max-width: 44ch; }
.connect-form { display: grid; gap: .45rem; justify-items: start; }
.connect-form .owner-code { color: white; }
.connect-form small { color: #d9e6d7; }
.connect-form small + button { margin-top: .35rem; }
.welcome figure { align-self: stretch; display: flex; flex-direction: column; justify-content: center; background: #e9f0d3; color: var(--forest); padding: clamp(1.6rem, 4.2vw, 3.55rem); }
.welcome figcaption { font-size: .8rem; font-weight: 630; }
.preview-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .7rem; flex-wrap: wrap; margin: .6rem 0 .8rem; }
.preview-heading strong { font-size: 2.1rem; font-weight: 620; letter-spacing: -.04em; }
.preview-heading span { font-size: .8rem; }
.preview-chart { display: block; width: 100%; height: auto; }
.welcome-next { margin-top: 2rem; }
.feature-list { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.6rem; }
.feature-list > div { border-top: 1px solid var(--line); padding-top: 1rem; }
.feature-list h2 { font-size: 1.05rem; }
.feature-list p { font-size: .9rem; color: var(--muted); margin-top: .4rem; max-width: 42ch; }
dialog { width: min(420px,calc(100% - 2rem)); border: 1px solid var(--line); border-radius: 14px; padding: 1.45rem; color: var(--ink); }
dialog::backdrop { background: #132a24a8; }
dialog h2 { margin: 0; }
dialog label { display: block; margin: 1rem 0; }
dialog .check { display: flex; align-items: flex-start; gap: .55rem; font-weight: 500; line-height: 1.45; }
dialog .actions { justify-content: flex-end; }
.announce { position: fixed; bottom: 1rem; right: 1rem; max-width: calc(100vw - 2rem); border-radius: 8px; font-size: .9rem; z-index: 4; }
.announce:not(:empty) { padding: .65rem .85rem; color: white; background: var(--forest); }
@media (max-width: 840px) {
  .board { grid-template-columns: 1fr 1fr; }
  .masthead-inner { gap: 1.15rem; }
  nav { gap: .8rem; }
  .masthead-inner, #main { padding-inline: 1.2rem; }
  .panel { padding: 1.05rem; }
  .metric { padding: 1.1rem; }
  .metric strong { font-size: 1.75rem; }
  .welcome h1 { font-size: 2.7rem; }
}
@media (max-width: 650px) {
  .masthead-inner { flex-wrap: wrap; gap: 0; padding: .7rem 1rem 0; min-height: 58px; }
  nav:not(:empty) { order: 3; flex: 0 0 100%; margin-top: .45rem; gap: 1.05rem; }
  nav:empty { display: none; }
  .masthead-inner:has(nav:empty) { padding-bottom: .7rem; }
  .nav-item { padding-block: .48rem; font-size: .83rem; }
  .brand { font-size: 1.13rem; }
  .brand img { width: 29px; height: 29px; }
  #session .button { min-height: 32px; padding: .35rem .52rem; font-size: .78rem; }
  #main { padding: 1.35rem .9rem 2rem; }
  .page-head { align-items: start; margin-bottom: .65rem; }
  .page-head h1 { font-size: 2rem; }
  .actions { flex-wrap: wrap; }
  .filters { gap: .6rem; padding-block: .55rem 1rem; }
  .filters label { flex: 1 1 40%; min-width: 110px; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric.primary { grid-column: 1 / -1; }
  .metric:nth-child(2) { border-left: 0; }
  .metric { padding: .95rem; }
  .metric strong { font-size: 1.55rem; }
  .metric.primary strong { font-size: 1.9rem; }
  .board, .welcome { grid-template-columns: 1fr; }
  .board { gap: .8rem; }
  .welcome h1 { max-width: 14ch; }
  .welcome figure { padding: 1.2rem 1.6rem; }
  .welcome-copy { padding: 1.7rem 1.5rem; }
  .feature-list { grid-template-columns: 1fr; gap: 1rem; }
  .feature-list p { max-width: none; }
  .welcome-next { margin-top: 1.45rem; }
  .history .aux, .history .datecol { display: none; }
  .history th { white-space: normal; }
  .history .mobile-date { display: block; color: var(--muted); margin-top: .18rem; font-size: .73rem; }
  .trend text { font-size: 16px; }
  .history th, .history td { padding-inline: .28rem; }
  .history td:first-child, .history th:first-child { padding-left: 0; }
  .history td:last-child, .history th:last-child { padding-right: 0; }
  .history td { font-size: .8rem; }
}
@media (max-width: 375px) {
  .nav-item .icon { display: none; }
  .history .datecol { display: none; }
  .section-head { flex-wrap: wrap; }
}
@media print {
  .masthead, .actions, .filters, .text-button, .announce, dialog { display: none; }
  #main { padding: 0; }
  body { background: white; }
  .panel, .metric { break-inside: avoid; }
}
