/* Theme: only Oat's own variables are overridden. Fonts are self-hosted (no Google requests). */
@font-face {
  font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/vendor/fonts/manrope-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20B9, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/vendor/fonts/manrope-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --font-sans: "Manrope", system-ui, sans-serif;
  --primary: #0f766e; --primary-foreground: #fff; --ring: #14b8a6;
  --radius-small: 10px; --radius-medium: 16px; --radius-large: 22px;
  --sidebar-width: 240px;
  --heat: 15 118 110;
  --surface: #f4f6f5;
  --avg-line: #d97706;
  --prev-line: #94a3b8;
  /* category palette (names must match COLORS in js/icon-list.js) */
  --cat-orange: #ea580c; --cat-amber: #ca8a04; --cat-green: #16a34a; --cat-teal: #0d9488; --cat-blue: #2563eb;
  --cat-violet: #9333ea; --cat-pink: #db2777; --cat-red: #dc2626; --cat-slate: #64748b;
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #2dd4bf; --primary-foreground: #042f2e; --heat: 45 212 191; --surface: #0b0f0e; --avg-line: #fbbf24;
    --cat-orange: #fb923c; --cat-amber: #facc15; --cat-green: #4ade80; --cat-teal: #2dd4bf; --cat-blue: #60a5fa;
    --cat-violet: #c084fc; --cat-pink: #f472b6; --cat-red: #f87171; --cat-slate: #94a3b8;
  }
}

body { background: var(--surface); }
main { padding: var(--space-4); min-width: 0; overflow-x: clip; }
[hidden] { display: none !important; }
svg.i { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; }
button { gap: 6px; }
.danger-text { color: var(--danger); }
.muted { color: var(--muted-foreground); }

/* ===== Sidebar (Oat data-sidebar-layout) ===== */
[data-sidebar] { background: var(--card); }
[data-sidebar] > header { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; padding: var(--space-5) var(--space-4); }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: var(--primary-foreground); display: grid; place-items: center; }
[data-sidebar] nav ul { list-style: none; padding: 0 var(--space-2); margin: 0; display: flex; flex-direction: column; gap: 2px; }
[data-sidebar] nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-small); color: var(--foreground); font-weight: 600; }
[data-sidebar] nav a[aria-current] { background: rgb(var(--heat) / .12); color: var(--primary); }
[data-sidebar] > footer { padding: var(--space-4); }

/* ===== Phone: bottom nav + floating add ===== */
.bottom-nav, .fab { display: none; }
@media (max-width: 768px) {
  /* one row: Oat puts main in row 2, which left an empty 1fr row above short pages */
  [data-sidebar-layout] { grid-template-rows: 1fr; }
  [data-sidebar-layout] > main { grid-row: 1; }
  [data-sidebar] { display: none; }
  /* room for the bottom nav (≈70px) + the floating add button above it (56px) */
  main { padding: var(--space-3) var(--space-3) calc(160px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: flex; position: fixed; inset: auto 0 0 0; z-index: 5; background: var(--card);
    border-top: 1px solid var(--border); padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
  }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: .72rem; font-weight: 600; color: var(--muted-foreground); }
  .bottom-nav a[aria-current] { color: var(--primary); }
  .fab {
    display: inline-flex; position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 6;
    width: 56px; height: 56px; border-radius: 18px; padding: 0; justify-content: center; box-shadow: 0 10px 24px -6px rgb(var(--heat) / .6);
  }
  .fab svg.i { width: 24px; height: 24px; }
}

/* ===== Page header ===== */
.page-hdr { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); flex-wrap: wrap; }
.page-hdr h2 { margin: 0; font-weight: 800; letter-spacing: -.02em; font-size: clamp(1.25rem, 2.2vw, 1.75rem); }
.month-nav { display: flex; align-items: center; gap: 4px; }
.month-nav button.ghost { padding: 6px; }

/* ===== Grids: columns may shrink below content (charts must not widen the page) ===== */
.home-grid, .an-grid { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
.kpis { display: grid; gap: var(--space-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-grid > *, .an-grid > *, .kpis > * { min-width: 0; }
@media (min-width: 769px) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .an-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-grid .span-all, .an-grid .span-2 { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  .home-grid { grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); align-items: start; }
  .home-grid .kpis { grid-column: 1 / -1; }
  .day-panel { position: sticky; top: var(--space-4); }
  .an-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: dense; }
  .an-grid .span-2 { grid-column: span 2; }
  .an-grid .row-2 { grid-row: span 2; }
}

.card { box-shadow: none; padding: var(--space-4); }
.card > header { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.card > header h4 { margin: 0; display: flex; align-items: center; gap: 8px; }
.card > header small { color: var(--muted-foreground); }
.kpi small { color: var(--muted-foreground); display: flex; align-items: center; gap: 6px; }
.kpi b { font-size: clamp(1.15rem, 2vw, 1.5rem); font-weight: 800; letter-spacing: -.02em; display: block; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.hero { background: var(--primary); color: var(--primary-foreground); border-color: transparent; }
.kpi.hero small { color: inherit; opacity: .85; }
.up { color: var(--danger); } .down { color: var(--success); }

/* ===== Calendar ===== */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(3px, .6vw, 8px); }
.cal .dow { text-align: center; font-size: .7rem; font-weight: 700; color: var(--muted-foreground); text-transform: uppercase; }
.cal button.d {
  all: unset; box-sizing: border-box; cursor: pointer; border-radius: var(--radius-small); min-width: 0;
  aspect-ratio: 1 / 1; display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(4px, .7vw, 10px); background: rgb(var(--heat) / var(--h, .04)); border: 2px solid transparent;
  transition: border-color .12s, transform .08s ease-out, box-shadow .15s ease-out;
}
.cal button.d:hover { border-color: rgb(var(--heat) / .5); }
.cal button.d:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.cal .n { font-size: clamp(.75rem, 1.1vw, .95rem); font-weight: 700; }
.cal .a { font-size: clamp(.58rem, .9vw, .8rem); font-weight: 700; text-align: right; white-space: nowrap; overflow: hidden; }
.cal .hot { color: #fff; }
@media (prefers-color-scheme: dark) { .cal .hot { color: #042f2e; } }
.cal .today { border-color: var(--foreground) !important; }
.cal .future { opacity: .45; }
/* Selected day. Must be at least as specific as `.cal button.d` (which does `all: unset`),
   otherwise the reset wins and the selection is invisible. */
.cal button.d[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--primary); }
.cal button.d[aria-pressed="true"] .n { color: var(--primary); font-weight: 800; }
.cal button.d.hot[aria-pressed="true"] .n { color: inherit; }
.legend { display: flex; gap: 4px; align-items: center; justify-content: flex-end; font-size: .7rem; color: var(--muted-foreground); margin-top: var(--space-3); }
.legend i { width: 12px; height: 12px; border-radius: 3px; background: rgb(var(--heat) / var(--h)); }
@media (min-width: 1100px) { .cal button.d { aspect-ratio: 1.25 / 1; } }

/* ===== Category icon chip ===== */
.cat-ico {
  --c: var(--cat-slate);
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0;
  color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent);
}
.cat-ico.sm { width: 30px; height: 30px; border-radius: 9px; }
.cat-ico.sm svg.i { width: 16px; height: 16px; }
.cat-ico.large { width: 52px; height: 52px; border-radius: 14px; }
.cat-ico.large svg.i { width: 26px; height: 26px; }

/* ===== Expense rows ===== */
.exp { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.exp:first-child { border-top: none; }
.exp .mid { flex: 1; min-width: 0; }
.exp .mid b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp .mid small { color: var(--muted-foreground); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.exp .amt { text-align: right; white-space: nowrap; }
.exp .amt b { display: block; }
.exp .amt small { color: var(--muted-foreground); font-size: .72rem; }
.exp menu[popover] button { display: flex; gap: 8px; align-items: center; width: 100%; justify-content: flex-start; }
.empty { text-align: center; color: var(--muted-foreground); padding: var(--space-6) 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty svg.i { width: 28px; height: 28px; }

/* ===== Dialogs: bottom sheet on phone ===== */
dialog.sheet { width: min(500px, 100vw - 2rem); }
/* Header and footer stay put; only the middle scrolls. Oat makes .body overflow-y:auto, but it
   only scrolls if the form is height-bounded, otherwise the dialog's overflow:hidden clips the footer. */
dialog > form { display: flex; flex-direction: column; max-height: inherit; }
dialog > form > header, dialog > form > footer { flex-shrink: 0; }
dialog .body { display: flex; flex-direction: column; gap: var(--space-4); padding-block: var(--space-4); min-height: 0; overscroll-behavior: contain; }
dialog form > footer > button { flex: 1; }
dialog form > footer > #expense-delete { flex: 0 0 auto; margin-right: auto; }
@media (max-width: 768px) {
  dialog.sheet { margin: auto 0 0 0; max-width: 100vw; width: 100vw; border-radius: 22px 22px 0 0; max-height: 94dvh; padding-bottom: env(safe-area-inset-bottom); }
}
.amount-in { display: flex; align-items: baseline; justify-content: center; gap: 4px; }
.amount-in span { font-size: 1.7rem; font-weight: 700; color: var(--muted-foreground); }
.amount-in input { font-size: 2.6rem; font-weight: 800; border: none; background: none; width: 230px; max-width: 70vw; text-align: center; padding: 0; box-shadow: none; letter-spacing: -.03em; }
.amount-in input:focus { box-shadow: none; outline: none; }
.amount-in input[aria-invalid="true"] { color: var(--danger); }
.cat-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-pick button { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; }
.cat-pick button svg.i { color: var(--c); width: 16px; height: 16px; }
.cat-pick button[aria-pressed="true"] { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.cat-pick button[aria-pressed="true"] svg.i { color: inherit; }
.new-cat { margin-top: var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); border: 1px dashed var(--border); border-radius: var(--radius-medium); }
.new-cat input { flex: 1; }
.new-cat summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--primary); }
.split-box { background: var(--muted); border-radius: var(--radius-medium); padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-3); }
.split-toggle { justify-content: space-between; font-weight: 700; }
.split-body { display: flex; flex-direction: column; gap: var(--space-3); }
.split-res { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.split-res > * { background: var(--card); border-radius: var(--radius-small); padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.split-res small { color: var(--muted-foreground); font-size: .7rem; font-weight: 700; letter-spacing: .03em; }
.split-res b, .split-res input { font-size: 1.1rem; font-weight: 700; }
.split-res input { border: none; padding: 0; background: none; box-shadow: none; height: auto; }
.split-res input:focus { outline: none; box-shadow: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }

/* Split with people */
.split-with { display: flex; flex-direction: column; gap: 6px; }
.split-with > small, .share-rows small { color: var(--muted-foreground); font-size: .7rem; font-weight: 700; letter-spacing: .03em; }
.new-person { gap: var(--space-2); }
.new-person input { flex: 1; }
.share-rows { display: flex; flex-direction: column; gap: 6px; }
.share-rows:empty { display: none; }
.share-row { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: var(--radius-small); padding: 6px 6px 6px 10px; }
.share-row .name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-in { display: flex; align-items: baseline; gap: 2px; font-weight: 700; color: var(--muted-foreground); }
.share-in input { width: 6.5em; text-align: right; font-size: 1rem; font-weight: 700; color: var(--foreground); border: none; background: none; box-shadow: none; padding: 2px 0; height: auto; }
.share-in input:focus { outline: none; box-shadow: none; }
.share-row button.ghost { padding: 6px; }
.split-body > [data-split-equal] { align-self: flex-start; }

/* Person avatar: initial on a tinted circle */
.avatar {
  --c: var(--cat-slate);
  width: 38px; height: 38px; border-radius: 999px; display: grid; place-items: center; flex-shrink: 0;
  font-weight: 800; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent);
}
.avatar.sm { width: 28px; height: 28px; font-size: .8rem; }

/* ===== Icon picker ===== */
.picker { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-2); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { all: unset; cursor: pointer; width: 28px; height: 28px; border-radius: 999px; background: var(--c); box-shadow: inset 0 0 0 2px rgb(255 255 255 / .6); }
.swatches button[aria-pressed="true"] { outline: 3px solid var(--c); outline-offset: 2px; }
.swatches button:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.icon-groups { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-3); padding-right: 4px; }
.icon-groups h6 { margin: 0 0 6px; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-foreground); }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.icon-grid button { all: unset; cursor: pointer; aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); }
.icon-grid button:hover { background: var(--muted); }
.icon-grid button[aria-pressed="true"] { background: var(--c); color: #fff; border-color: var(--c); }
.icon-grid button:focus-visible { outline: 2px solid var(--ring); }

/* ===== Analytics ===== */
.insights ul { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); }
@media (min-width: 1100px) { .insights ul { grid-template-columns: repeat(3, 1fr); } }
.insights li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-small); background: var(--muted); font-size: .9rem; line-height: 1.4; }
.insights li svg.i { color: var(--c, var(--primary)); margin-top: 2px; }
.catrow { display: flex; align-items: center; gap: 12px; padding: 8px 6px; margin: 0 -6px; border-radius: var(--radius-small); cursor: pointer; width: calc(100% + 12px); background: none; border: 0; color: inherit; font: inherit; text-align: left; }
.catrow:hover { background: var(--muted); }
.catrow.static { cursor: default; }
.catrow.static:hover { background: none; }
.catrow .bar { flex: 1; min-width: 0; }
.catrow .bar > div:first-child { display: flex; justify-content: space-between; gap: 8px; font-size: .88rem; font-weight: 600; margin-bottom: 5px; }
.catrow progress { height: 7px; }
.catrow progress::-webkit-progress-value { background: var(--c); }
.catrow progress::-moz-progress-bar { background: var(--c); }
.catrow .meta { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted-foreground); margin-top: 5px; }
.delta { font-weight: 700; }
.top-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.top-row:first-child { border-top: 0; }
.top-row .rank { width: 18px; font-weight: 800; color: var(--muted-foreground); }
.top-row .mid { flex: 1; min-width: 0; }
.top-row .mid b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }
.top-row .mid small { color: var(--muted-foreground); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.stat-grid > div { background: var(--muted); border-radius: var(--radius-small); padding: 10px 12px; min-width: 0; }
.stat-grid small { color: var(--muted-foreground); display: block; font-size: .72rem; }
.stat-grid b { font-size: 1.1rem; }
.hint { margin: var(--space-3) 0 0; font-size: .82rem; color: var(--muted-foreground); }
.pace-head { margin: 0 0 var(--space-3); font-size: .95rem; }
.pace-head b { font-size: 1.1rem; }
.series { display: flex; gap: var(--space-4); flex-wrap: wrap; font-size: .75rem; color: var(--muted-foreground); margin-top: var(--space-2); }
.series span { display: flex; align-items: center; gap: 6px; }
.series i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; background: var(--c); }
.series i.dash { background: repeating-linear-gradient(90deg, var(--avg-line) 0 4px, transparent 4px 7px); }

/* Charts.css: fixed-height boxes; the table fills them */
.chart-box { position: relative; }
.chart-box > table.charts-css { height: 100% !important; width: 100%; min-width: 0; --color: var(--primary); }
.chart-box > table.charts-css > tbody { height: 100%; }
.charts-css th { font-size: .68rem; color: var(--muted-foreground); font-weight: 600; }
.charts-css.column td { border-radius: 4px 4px 0 0; }
.charts-css.line { --line-size: 3px; }
.h-pace { height: clamp(150px, 16vw, 220px); }
.h-dow { height: 140px; margin-bottom: 22px; }
.h-trend { height: clamp(140px, 14vw, 200px); margin-bottom: 22px; }
.h-drill { height: 120px; margin-bottom: 22px; }
.axis { display: flex; justify-content: space-between; font-size: .7rem; color: var(--muted-foreground); margin-top: 6px; }
.avg-line { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--avg-line); pointer-events: none; }
.avg-line span { position: absolute; right: 0; top: -20px; font-size: .7rem; font-weight: 700; color: var(--avg-line); background: var(--card); padding: 0 4px; border-radius: 4px; }
.projected { opacity: .5; background: repeating-linear-gradient(45deg, var(--color) 0 6px, transparent 6px 10px) !important; }
.mini-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.mini-kpis > div { background: var(--muted); border-radius: var(--radius-small); padding: 8px 10px; }
.mini-kpis small { display: block; color: var(--muted-foreground); font-size: .7rem; }

/* ===== Categories screen ===== */
.cat-card { max-width: 640px; }
.cat-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.cat-item:first-child { border-top: 0; }
.cat-item b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-intro { margin: 0 0 var(--space-2); font-size: .88rem; }

/* ===== Account / log out ===== */
.account { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-3); }
.account small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-card { margin-top: var(--space-4); }
.account-card .account { margin-top: 0; }
.conn-title { margin: var(--space-4) 0 var(--space-2); }
.conn-item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-2) 0; }
.conn-item + .conn-item { border-top: 1px solid var(--border); }

/* ===== Sign in ===== */
body.signed-out [data-sidebar], body.signed-out .bottom-nav, body.signed-out .fab { display: none !important; }
body.signed-out[data-sidebar-layout] { grid-template-columns: 1fr; }
body.signed-out main { display: grid; place-items: center; min-height: 100dvh; padding: var(--space-4); }
.login-card { width: min(400px, 100%); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.login-card form { display: flex; flex-direction: column; gap: var(--space-4); }
.login-card h3 { margin: 0; }
.login-card p { margin: 0; }
.login-card > header.login-brand { display: flex; align-items: center; justify-content: flex-start; gap: 10px; margin: 0; font-weight: 800; font-size: 1.2rem; }
.code-input { font-size: 1.5rem; letter-spacing: .3em; text-align: center; font-weight: 700; }
.login-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2); }

/* ===== Loading ===== */
.skeleton.box { height: 120px; border-radius: var(--radius-medium); }

/* ===== Motion: short, and off when the device asks for reduced motion ===== */
.day-panel { scroll-margin-top: var(--space-3); }

/* tap feedback, so a touch always feels registered */
.cal button.d:active, .cat-pick button:active, .fab:active, .bottom-nav a:active, .catrow:active,
.month-nav button:active, .split-box button:active { transform: scale(.95); }
.fab, .bottom-nav a, .cat-pick button, .catrow { transition: transform .08s ease-out; }

/* switching Home / Analytics / Categories */
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.view-in { animation: view-in .22s ease-out both; }

/* the selected day's expenses, one after another */
@keyframes row-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#day-list.animate > .exp, #day-list.animate > .empty { animation: row-in .24s ease-out both; animation-delay: calc(var(--i, 0) * 40ms); }

/* the expense you just saved */
@keyframes row-flash { 0%, 30% { background: rgb(var(--heat) / .22); } 100% { background: transparent; } }
.exp.flash { animation: row-flash 1.6s ease-out both; border-radius: var(--radius-small); }
#day-list.animate > .exp.flash { animation: row-in .24s ease-out both, row-flash 1.6s ease-out both; }

/* add/edit sheet: slides up on phones (Oat already fades + zooms dialogs on larger screens) */
@media (max-width: 768px) {
  dialog.sheet {
    transform: translateY(100%);
    transition: transform .26s cubic-bezier(.2, .8, .2, 1), opacity .2s ease, overlay .26s allow-discrete, display .26s allow-discrete;
  }
  dialog.sheet[open] { transform: none; }
  @starting-style { dialog.sheet[open] { transform: translateY(100%); } }
}

/* charts grow in when Analytics opens */
@keyframes bar-grow { from { transform: scaleY(0); } to { transform: none; } }
.charts-css.column tbody td { transform-origin: bottom; animation: bar-grow .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--d, 0) * 15ms); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.charts-css.line tbody, .catrow progress { animation: fade-in .5s ease-out both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-delay: 0ms !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}
