/* Expenses. The look lives in the tokens below (from the ChatGPT mockups, 2026-11-05:
   warm watercolour paper, olive by day, amber by night, serif headings).
   Phone frame, same as ivolopes.com: the window never scrolls; #page scrolls over a
   still background that reaches past every edge (a strip above the screen, --above,
   and below Safari's bars, --below), and nothing is pinned to the top or bottom edge
   (iPhone Safari paints a solid band over pinned things). js/frame.js keeps the window
   scrolled down by the strip, so the clock sits on the paper. */
:root {
  --paper: #f7e4cf; --paper-2: #efe1cd; --card: rgba(252, 246, 236, .88); --card-solid: #fbf3e7; --card-edge: #ead9c2;
  --field: #f4ebde; --field-edge: #dfd0ba;
  --ink: #2a2620; --ink-2: #5a5246; --ink-3: #6b6356; --rule: #e6d7c1;
  --accent: #66734a; --accent-ink: #ffffff; --accent-soft: #e3e5cc;
  --good: #3d6a29; --bad: #a3261e; --bad-soft: #f6ddd3;
  --mark: #7f8b51; --mark-hover: #5d6941; --grid: #eadcc8;
  --tile-1: #e3e3c8; --tile-2: #f5dcbf; --tile-3: #d9e3e2;
  --bg-image: url(img/paper.webp);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232a2620' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --radius: 16px; --radius-s: 10px; --shadow: 0 1px 2px rgba(90, 60, 30, .05), 0 10px 30px -18px rgba(90, 60, 30, .28);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: ui-serif, "New York", "Iowan Old Style", Charter, Georgia, "Times New Roman", serif;
  --gutter: 16px; --above: 160px; --below: 0px;
  color-scheme: light;
}
@media (pointer: coarse) { :root { --below: 120px; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1c1a16; --paper-2: #26231c; --card: rgba(33, 31, 26, .9); --card-solid: #211f1a; --card-edge: #37322a;
    --field: #29261f; --field-edge: #403a30;
    --ink: #efe6d6; --ink-2: #c6bcaa; --ink-3: #a99f8d; --rule: #3a352c;
    --accent: #d1a35f; --accent-ink: #1c1a16; --accent-soft: #3b3021;
    --good: #9cc27a; --bad: #ff8a80; --bad-soft: #3a1f1c;
    --mark: #d1a35f; --mark-hover: #e6bf82; --grid: #35312a;
    --tile-1: #2d301f; --tile-2: #42341f; --tile-3: #2a3332;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23efe6d6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23efe6d6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    --bg-image: radial-gradient(90% 60% at 10% 0%, #2a261e, transparent 70%), radial-gradient(80% 60% at 100% 100%, #29241b, transparent 70%);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -16px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1c1a16; --paper-2: #26231c; --card: rgba(33, 31, 26, .9); --card-solid: #211f1a; --card-edge: #37322a;
  --field: #29261f; --field-edge: #403a30;
  --ink: #efe6d6; --ink-2: #c6bcaa; --ink-3: #a99f8d; --rule: #3a352c;
  --accent: #d1a35f; --accent-ink: #1c1a16; --accent-soft: #3b3021;
  --good: #9cc27a; --bad: #ff8a80; --bad-soft: #3a1f1c;
  --mark: #d1a35f; --mark-hover: #e6bf82; --grid: #35312a;
  --tile-1: #2d301f; --tile-2: #42341f; --tile-3: #2a3332;
  --bg-image: radial-gradient(90% 60% at 10% 0%, #2a261e, transparent 70%), radial-gradient(80% 60% at 100% 100%, #29241b, transparent 70%);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -16px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* The base colour is the paper's top colour: Safari paints the status bar and any gap with it */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--paper); overscroll-behavior-y: none; }
html, body { height: 100%; overflow: hidden; }
body { margin: 0; font: 16px/1.45 var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
.bg, .page { position: absolute; top: 0; left: 0; right: 0; height: calc(100vh + var(--above) + var(--below)); height: calc(100lvh + var(--above) + var(--below)); }
.bg { z-index: 0; background-color: var(--paper); background-image: var(--bg-image); background-position: center; background-size: cover; background-repeat: no-repeat; }
.page { z-index: 1; padding-top: var(--above); overflow-x: hidden; overflow-y: auto; overscroll-behavior: none; -webkit-overflow-scrolling: touch; }
h1, h2 { font-family: var(--font-head); font-weight: 600; letter-spacing: -.01em; margin: 0; }
h1 { font-size: clamp(1.6rem, 1.25rem + 1.4vw, 2.2rem); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: calc(var(--above) - 80px); z-index: 10; background: var(--card-solid); padding: 12px 16px; min-height: 44px; border-radius: var(--radius-s); }
.skip:focus { top: calc(var(--above) + 12px + env(safe-area-inset-top)); }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.shell { max-width: 1240px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) calc(40px + 100lvh - 100svh + var(--below) + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left)); }
.top { display: flex; align-items: center; gap: 16px; padding: 6px 0 18px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font: 600 1.55rem var(--font-head); letter-spacing: -.01em; min-height: 44px; }
.brand-mark { width: 34px; height: 34px; color: var(--accent); }
.nav { display: flex; gap: 4px; flex: 1; justify-content: center; }
.nav button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; white-space: nowrap; font-family: var(--font-head); font-size: 1.02rem; }
.nav button svg { width: 20px; height: 20px; flex: none; }
.nav button:hover { background: var(--accent-soft); color: var(--ink); }
.nav button[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.tools { display: flex; gap: 6px; align-items: center; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--accent-soft); color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }
.lang-btn { min-width: 48px; height: 48px; border: 1px solid var(--field-edge); border-radius: 999px; background: var(--card); color: var(--ink); cursor: pointer; font: 500 .95rem var(--font-head); letter-spacing: .03em; }
#theme .i-sun { display: none; }
:root[data-theme="dark"] #theme .i-sun { display: inline; }
:root[data-theme="dark"] #theme .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #theme .i-sun { display: inline; } :root:not([data-theme="light"]) #theme .i-moon { display: none; } }

/* ---------- cards & forms ---------- */
.card { background: var(--card); border: 1px solid var(--card-edge); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.card-title { font-size: 1.4rem; margin-bottom: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.card-head .card-title { margin: 0; }
.f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.f > span { font: 600 .92rem var(--font-head); color: var(--ink); }
input, select { height: 46px; }
input[type="checkbox"] { height: 22px; }
input, select, textarea { min-height: 44px; padding: 9px 12px; border: 1px solid var(--field-edge); border-radius: var(--radius-s); background: var(--field); width: 100%; min-width: 0; }
/* Drawn by the page (WebKit's own dark dropdown ignores the colours) */
select { -webkit-appearance: none; appearance: none; color: var(--ink); background: var(--field) var(--chevron) right 10px center / 18px no-repeat; padding-right: 36px; }
option { color: var(--ink); background-color: var(--card-solid); }
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); margin: 0; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); outline-offset: 0; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--bad); }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.add-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.add-row .f { flex: 1 1 140px; }
.add-row .f-desc { flex: 3 1 220px; }
.add-row .f-amount { flex: 1 1 110px; }
.add-row .f-date { flex: 1 1 150px; }
.add-row .f-account { flex: 1 1 130px; }
.add-row .f-cat { flex: 1 1 150px; }
.hint { margin: 8px 0 0; font-size: .85rem; color: var(--ink-2); min-height: 1.2em; }
.error { margin: 6px 0 0; color: var(--bad); font-size: .9rem; }
.error:empty { display: none; }
.note { color: var(--ink-2); margin: 0 0 12px; max-width: 70ch; }
.note.warn { color: var(--bad); }
button.primary, button.ghost, button.danger, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; font: 600 1.02rem var(--font-head); text-decoration: none; white-space: nowrap; }
button.primary { background: var(--accent); color: var(--accent-ink); }
button.primary:hover { filter: brightness(1.08); }
button.primary { box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 4px 12px -6px rgba(60, 50, 20, .45); }
button.ghost, .btn.ghost { background: transparent; border-color: var(--accent); color: var(--ink); }
button.ghost:hover, .btn.ghost:hover { background: var(--accent-soft); }
button.danger { background: var(--bad-soft); color: var(--bad); }
button.small { min-height: 44px; padding: 0 14px; font-size: .9rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.file-btn:focus-within { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.split-box { margin-top: 6px; }
.split-box summary { cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font: 600 .95rem var(--font-head); list-style: none; }
.split-box summary::-webkit-details-marker { display: none; }
.split-box summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid currentColor; border-radius: 6px; font-weight: 700; line-height: 1; }
.split-box[open] summary::before { content: "−"; }
.split-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 6px; }
.split-row .f { flex: 1 1 140px; }
.links { margin: 14px 0 0; }
.links a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- month ---------- */
.month-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.month-head h1 { min-width: 9ch; text-align: center; }
.month-head #today { margin-left: auto; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0 18px; }
.stats div { background: var(--tile-1); border: 1px solid color-mix(in srgb, var(--ink) 6%, transparent); border-radius: var(--radius); padding: 16px 22px 14px; box-shadow: var(--shadow); min-width: 0; }
.stats div:nth-child(2) { background: var(--tile-2); }
.stats div:nth-child(3) { background: var(--tile-3); }
.stats dt { font: 500 1rem var(--font-head); color: var(--ink); }
.stats dd { margin: 4px 0 0; font: 500 clamp(1.4rem, 1rem + 2vw, 2.6rem) / 1.1 var(--font-head); overflow-wrap: anywhere; }
.month-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
table { width: 100%; border-collapse: collapse; }
.entries th, .entries td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.entries thead th { font: 600 .98rem var(--font-head); color: var(--ink); background: var(--accent-soft); border-bottom: 0; }
.entries thead th:first-child { border-radius: 10px 0 0 10px; } .entries thead th:last-child { border-radius: 0 10px 10px 0; }
.entries tbody tr { cursor: pointer; }
.entries tbody tr:hover, .entries tbody tr:focus-within { background: var(--accent-soft); }
.entries .num, .summary .num { text-align: right; white-space: nowrap; }
.entries .c-cat, .entries .c-date { color: var(--ink-2); white-space: nowrap; }
.row-btn { all: unset; display: block; cursor: pointer; min-height: 24px; overflow-wrap: anywhere; }
.row-btn:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.tag { display: inline-block; font-size: .72rem; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); margin-left: 6px; font-weight: 600; vertical-align: 1px; }
.tag.open { background: var(--bad-soft); color: var(--bad); }
.sub { display: block; font-size: .8rem; color: var(--ink-3); }
.empty { color: var(--ink-2); text-align: center; margin: 18px 0 6px; }
.summary th, .summary td { padding: 7px 0; border-bottom: 1px solid var(--rule); text-align: left; font-weight: 400; vertical-align: top; }
.summary tbody th { font: 600 1.02rem var(--font-head); }
.summary .big { display: block; font-size: .78rem; color: var(--ink-3); overflow-wrap: anywhere; }
.summary .saving th { color: var(--ink-2); font-style: italic; }
.summary tfoot th, .summary tfoot td { font: 600 1.2rem var(--font-head); border-bottom: 0; padding: 10px 12px; background: var(--tile-1); }
.summary tfoot th { border-radius: 10px 0 0 10px; } .summary tfoot td { border-radius: 0 10px 10px 0; }
.summary .zero td { color: var(--ink-3); }
#conclusion { margin-bottom: 10px; font-family: var(--font-head); font-style: italic; }
.left-off { list-style: none; margin: 0; padding: 0; }
.left-off li { padding: 8px 0; border-bottom: 1px solid var(--rule); }
.left-off li:last-child { border-bottom: 0; }
.left-off strong { display: block; }
.left-off span { color: var(--ink-2); font-size: .88rem; overflow-wrap: anywhere; }

/* ---------- search ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 14px; }
.filters .f { flex: 1 1 150px; }
.filters .f-q { flex: 3 1 240px; }
.filters .f-num { flex: 1 1 100px; }
.found { font-weight: 600; margin: 0 0 10px; min-height: 1.4em; }
#more { margin: 0 auto; display: flex; }

/* ---------- charts ---------- */
.seg { display: inline-flex; gap: 4px; background: var(--card); border: 1px solid var(--card-edge); border-radius: 999px; padding: 5px; margin: 14px 0 16px; flex-wrap: wrap; box-shadow: var(--shadow); }
.seg button { min-height: 44px; padding: 0 22px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; font: 500 1.02rem var(--font-head); }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }
.chart { position: relative; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg .grid { stroke: var(--grid); stroke-width: 1; }
.chart-svg .axis { stroke: var(--ink-3); stroke-width: 1; }
.chart-svg .tick { fill: var(--ink-2); stroke: none; font: 12px var(--font); }
.chart-svg .mark { fill: var(--mark); stroke: none; }
.chart-svg .hit { fill: transparent; stroke: none; }
.chart-svg .bar { outline: none; cursor: default; }
.chart-svg .bar:hover .mark, .chart-svg .bar:focus .mark { fill: var(--mark-hover); }
.chart-svg .bar:focus-visible .hit { stroke: var(--accent); stroke-width: 2; }
.tip { position: absolute; top: -6px; transform: translate(-50%, -100%); background: var(--card-solid); color: var(--ink); border: 1px solid var(--card-edge); padding: 8px 14px; border-radius: 12px; font-size: .95rem; pointer-events: none; white-space: nowrap; box-shadow: 0 8px 24px -10px rgba(60, 40, 20, .35); }
.tip strong { display: block; font: 600 1.02rem var(--font-head); }
.chart-table { margin-top: 12px; max-height: 360px; overflow: auto; }
.chart-table th, .chart-table td { padding: 6px 8px; border-bottom: 1px solid var(--rule); text-align: left; }
.chart-table td { text-align: right; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hbars li { display: grid; grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.hb-name { font: 600 1.02rem var(--font-head); overflow-wrap: anywhere; }
.hb-track { height: 18px; display: block; }
.hb-bar { display: block; height: 100%; background: var(--mark); border-radius: 4px; }
.hb-val { color: var(--ink-2); font-size: .9rem; white-space: nowrap; }

/* ---------- split bills & goals ---------- */
.balances { list-style: none; margin: 14px 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.balances li { background: var(--card); border: 1px solid var(--card-edge); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); font-weight: 600; }
.balances .pos { color: var(--good); }
.balances .neg { color: var(--bad); }
.balances .none { color: var(--ink-2); font-weight: 400; grid-column: 1 / -1; }
.open-bills { list-style: none; margin: 0; padding: 0; }
.open-bills li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.open-bills li > div { flex: 1 1 200px; min-width: 0; }
.goal { display: grid; gap: 10px; }
.goal-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.goal-nums { display: flex; gap: 18px; flex-wrap: wrap; color: var(--ink-2); }
.goal-nums b { color: var(--ink); }
.progress { height: 10px; background: var(--paper-2); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--mark); border-radius: 999px; }
.moves { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; }
.moves li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: .92rem; }
.moves li span:first-child { overflow-wrap: anywhere; }
.goal .add-row .f { flex: 1 1 120px; }

/* ---------- settings ---------- */
.cat-list { list-style: none; margin: 0 0 14px; padding: 0; }
.cat-list li { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.cat-list li input[type="text"] { flex: 1 1 160px; }
.cat-list li select { flex: 0 1 200px; width: auto; }
.cat-list .muted input { color: var(--ink-3); }
.cat-list .count { color: var(--ink-3); font-size: .85rem; min-width: 4ch; text-align: right; }

/* ---------- dialogs & toast ---------- */
dialog { border: 1px solid var(--card-edge); border-radius: 18px; background: var(--card-solid); color: var(--ink); padding: 20px; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); }
dialog::backdrop { background: rgba(20, 16, 10, .45); }
dialog form { display: grid; gap: 12px; }
dialog h2 { font-size: 1.25rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dialog-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.spacer { flex: 1; }
/* Not pinned: placed in the frame (body), which never scrolls, just above the bottom of the smallest screen */
.toast { position: absolute; left: 50%; top: calc(var(--above) + 100svh - 24px - env(safe-area-inset-bottom)); translate: 0 -100%; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--paper); padding: 10px 12px 10px 18px; border-radius: 14px; font-size: .92rem; width: max-content; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast button.ghost { color: var(--paper); border-color: rgba(255, 255, 255, .35); }
.noscript { padding: 24px; text-align: center; }

/* ---------- phone & tablet ---------- */
@media (max-width: 1020px) {
  .month-grid { grid-template-columns: minmax(0, 1fr); }
  .nav { order: 3; flex-basis: 100%; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
  .nav::-webkit-scrollbar { display: none; }
  .tools { margin-left: auto; }
}
@media (max-width: 640px) {
  .shell { padding-top: calc(6px + env(safe-area-inset-top)); }
  .top { padding-bottom: 12px; gap: 8px; }
  .brand { font-size: 1.4rem; }
  /* All six sections in one row, like the mockup: icon over a short label */
  .nav { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; overflow: visible; margin: 0 -6px; padding: 0; }
  .nav button { flex-direction: column; justify-content: flex-start; gap: 3px; padding: 8px 2px 7px; border-radius: 14px; font-size: .68rem; line-height: 1.15; white-space: normal; hyphens: manual; text-align: center; min-width: 0; min-height: 60px; }
  .nav button svg { width: 22px; height: 22px; }
  .nav button[aria-current="page"] { box-shadow: var(--shadow); }
  .toast { max-width: calc(100vw - 32px); width: auto; }
  .stats { gap: 8px; }
  .stats div { padding: 10px 12px; }
  .stats dt { font-size: .9rem; }
  .stats dd { font-size: clamp(1.15rem, 5.4vw, 1.6rem); white-space: nowrap; overflow-wrap: normal; }
  .card { padding: 16px 18px; }
  .add-row .f, .add-row .f-desc, .add-row .f-amount, .add-row .f-date { flex: 1 1 100%; }
  .add-row .f-cat, .add-row .f-amount { flex: 1 1 calc(50% - 5px); }
  .add-row button.primary { flex: 1 1 100%; }
  .entries .c-date { display: none; }
  .two { grid-template-columns: 1fr; }
  .hbars li { grid-template-columns: minmax(0, 1fr) auto; }
  .hb-track { grid-column: 1 / -1; grid-row: 2; }
  .month-head h1 { flex: 1; }
  .month-head #today { margin-left: 0; }
}
@media (prefers-reduced-motion: no-preference) { .nav button, .icon-btn, button.primary, button.ghost { transition: background-color .15s, color .15s; } }
@media (forced-colors: active) { .chart-svg .mark, .hb-bar, .progress span { fill: CanvasText; background: CanvasText; } }
.doc article h2 { font-size: 1.1rem; margin: 18px 0 6px; }
.doc article p { max-width: 70ch; }
