/* Köck Finance: Mosaic, Dusk.
   A warm plum-grey evening ground. Colour always means a category, and each
   top-level category keeps its one dusty colour everywhere: mosaic tile, row
   square, picker tile. Everything else is soft white on the ground, separated
   by thin lines rather than boxes. Funnel Display for totals and headings,
   Funnel Sans for the interface. */

:root {
  color-scheme: dark;
  --page: #1c1a21;
  --raised: #26232c;
  --sheet: #24212a;
  --field: #302c37;
  --seg-on: #3a3542;
  --ink: #f0edf3;
  --muted: #a7a1b0;
  --line: #2f2b36;
  --line-2: #423d4a;
  --aug: #736d7e;
  --btn-bg: #f0edf3;
  --btn-fg: #1c1a21;
  --tile-ink: #fbf8fd;
  --unset: rgba(240, 237, 243, 0.38);
  --up: #ff8373;
  --back: #5fd39a;
  --danger: #ff8a7a;
  --focus: #c9b9f2;
  --scrim: rgba(0, 0, 0, 0.58);

  --c-food: #86692a;
  --c-leisure: #8f4f5f;
  --c-home: #586f3f;
  --c-car: #3d6b88;
  --c-moto: #56609c;
  --c-health: #3a7a6e;
  --c-subscriptions: #8a5a3a;
  --c-work: #5a6474;
  --c-travel: #6f5690;
  --c-tech: #2d7584;
  --c-clothing: #85507a;
  --c-other: #5a5562;
  --c-rest: #48444f;

  --display: 'Funnel Display', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font: 'Funnel Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --tabbar: calc(64px + env(safe-area-inset-bottom));
  --shadow-float: 0 18px 40px -16px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--page); color: var(--ink); min-height: 100dvh;
  font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.num, .amt { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.good { color: var(--back); }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: -4px; }
.ic.sm { width: 16px; height: 16px; vertical-align: -3px; }

h1 { font: 600 28px/1.1 var(--display); letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h2 { font: 600 17px/1.25 var(--display); margin: 0; letter-spacing: -0.005em; }
p { margin: 0 0 10px; }

.amt { white-space: nowrap; }
.amt.back { color: var(--back); }

/* A category is a colour square; uncategorized is a dashed outline. */
.csq { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.csq.lg { width: 14px; height: 14px; border-radius: 4px; }
.csq.none { background: none; border: 1.5px dashed var(--unset); }

/* Icon holders in pickers and lists: a quiet icon, no tinted badge. */
.badge { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; color: var(--muted); }
.badge .ic { width: 18px; height: 18px; vertical-align: 0; }
.badge.lg { width: 36px; height: 36px; }
.badge.lg .ic { width: 24px; height: 24px; }
.glyph { width: 20px; height: 20px; flex: none; display: block; }

/* ---------- shell ---------- */

.topbar {
  position: sticky; top: 0; z-index: 12;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px 16px; min-height: calc(60px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--page) 90%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.brand { font: 600 17px/1 var(--display); letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.top-title { font: 600 26px/1.1 var(--display); letter-spacing: -0.02em; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  border: 0; background: none; color: var(--ink); cursor: pointer; text-decoration: none;
}
.icon-btn .ic { vertical-align: 0; }
.icon-btn:hover, .icon-btn[aria-current='page'] { background: var(--raised); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; text-decoration: none;
  background: var(--raised); color: var(--ink); font-weight: 600; font-size: 13px; flex: none;
}
main { max-width: 1240px; margin: 0 auto; padding: 4px 16px calc(var(--tabbar) + 28px); }

.tabs {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: color-mix(in srgb, var(--page) 94%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); padding: 4px 6px env(safe-area-inset-bottom);
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 56px; justify-content: center;
  text-decoration: none; font-size: 11px; color: var(--muted); font-weight: 500;
}
.tabs a .ic { width: 22px; height: 22px; vertical-align: 0; stroke-width: 1.7; }
.tabs a[aria-current='page'] { color: var(--ink); font-weight: 600; }
.tabs a[aria-current='page'] .ic { stroke-width: 2; }
.tabs .fab-slot { display: grid; place-items: center; min-height: 56px; }
.tabs .side-only { display: none; }
.fab {
  width: 56px; height: 42px; border-radius: 14px; border: 0; cursor: pointer;
  background: var(--btn-bg); color: var(--btn-fg); display: grid; place-items: center;
}
.fab .ic { width: 24px; height: 24px; stroke-width: 2.2; vertical-align: 0; }
.fab:active { transform: scale(0.96); }
.sidebar { display: contents; }
.sidebar .side-user, .sidebar .side-add, .sidebar .side-gap { display: none; }

/* Desktop: a sidebar with the brand, the add button, navigation and the account. */
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
  .sidebar {
    grid-column: 1; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 4px;
    border-right: 1px solid var(--line); padding: 26px 14px 18px;
  }
  .topbar { position: static; padding: 0 8px 22px; min-height: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .topbar .top-actions, .topbar .top-title { display: none; }
  .topbar .brand { display: inline-flex !important; }
  .sidebar .side-add { display: flex; margin: 0 0 18px; }
  .tabs {
    position: static; display: flex; flex-direction: column; align-items: stretch; gap: 2px; border: 0; background: none;
    backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0; flex: 1;
  }
  .tabs a, .tabs .side-only {
    display: flex; flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 14.5px; min-height: 40px;
    border-radius: 10px; padding: 0 10px; color: var(--muted); font-weight: 500;
  }
  .tabs a .ic { width: 19px; height: 19px; }
  .tabs a[aria-current='page'] { background: var(--raised); color: var(--ink); font-weight: 600; }
  .tabs a:hover:not([aria-current='page']) { color: var(--ink); }
  .tabs .fab-slot { display: none; }
  .tabs .side-gap { display: block; margin-top: auto; }
  .sidebar .side-user {
    display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
    padding: 14px 8px 0; margin-top: 12px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600;
  }
  .side-user small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
  main { grid-column: 2; padding: 34px 40px 64px; margin: 0; width: 100%; }
  .page-head h1 { display: block; }
}
@media (max-width: 899px) {
  .page-head > h1, .page-head > div:not(.page-title) > h1, .chat-head > h1 { display: none; }
  .page-title h1 { font-size: 24px; }
  .page-head:not(:has(> :not(h1))) { display: none; }
}

/* ---------- page furniture ---------- */

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-size: 14.5px; margin: 6px 0 0; }
.section { margin-top: 30px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 6px; }
.section-head a, .section-head button {
  font-size: 13.5px; font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-2);
  text-underline-offset: 3px; background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink);
}
.panel { padding: 0; }
.panel > h2 { margin-bottom: 10px; }
.stack > * + * { margin-top: 30px; }

/* ---------- controls ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  background: var(--btn-bg); color: var(--btn-fg); font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn .ic { width: 18px; height: 18px; vertical-align: 0; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn:not(:disabled):active { transform: translateY(1px); }
.btn.secondary { background: none; color: var(--ink); border-color: var(--line-2); }
.btn.secondary:hover { background: var(--raised); }
.btn.quiet { background: var(--raised); color: var(--ink); }
.btn.danger { background: none; color: var(--danger); border-color: var(--line-2); }
.btn.small { min-height: 36px; padding: 0 13px; font-size: 14px; border-radius: 10px; }
.btn.icon-only { width: 38px; min-height: 38px; padding: 0; border-radius: 12px; border: 0; }
.btn.block { width: 100%; }
.linkish {
  background: none; border: 0; padding: 0; color: var(--ink); cursor: pointer; font-size: 14px; font-weight: 500;
  text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px;
}
.linkish:hover { text-decoration-color: var(--ink); }
.linkish.icon { display: inline-flex; align-items: center; gap: 6px; }

label.field { display: block; }
label.field > span, .field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 12px;
  border: 1px solid transparent; background: var(--field); color: var(--ink);
}
.input::placeholder { color: var(--muted); }
.input:focus { outline: 2px solid var(--focus); outline-offset: -2px; }
textarea.input { min-height: 76px; resize: vertical; }
select.input option, select.input optgroup { background: var(--sheet); color: var(--ink); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 140px; }
.search { position: relative; display: block; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 42px; background: var(--raised); }

/* Filter pills: outlined until set. */
.chiprow { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.chiprow::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .chiprow { margin: 0; padding: 2px 0; flex-wrap: wrap; } }
.fchip {
  display: inline-flex; align-items: center; gap: 6px; flex: none; white-space: nowrap;
  min-height: 34px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line-2);
  background: none; color: var(--ink); font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.fchip .ic { width: 15px; height: 15px; vertical-align: 0; color: var(--muted); }
.fchip.set { background: var(--seg-on); border-color: var(--seg-on); font-weight: 600; }
.fchip.set .ic { color: var(--ink); }
.fchip.clear { border-style: dashed; color: var(--muted); }

/* Segmented control: one choice of a few. */
.segmented { display: flex; background: var(--raised); border-radius: 12px; padding: 3px; gap: 2px; }
.segmented button {
  flex: 1 1 0; border: 0; background: none; min-height: 32px; padding: 0 10px; border-radius: 9px;
  font-size: 13.5px; color: var(--muted); cursor: pointer; font-weight: 500; white-space: nowrap;
}
.segmented button[aria-pressed='true'], .segmented button[aria-selected='true'] { background: var(--seg-on); color: var(--ink); font-weight: 600; }
.segmented.compact { display: inline-flex; }
.segmented.compact button { min-height: 28px; font-size: 13px; padding: 0 11px; flex: none; }
.segmented:empty { display: none; }

.error { color: var(--danger); font-size: 14px; margin: 6px 0 0; }
.error:empty { display: none; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar) + 16px); transform: translateX(-50%); z-index: 60;
  background: var(--btn-bg); color: var(--btn-fg); padding: 12px 16px; border-radius: 12px; font-size: 14.5px; font-weight: 500;
  box-shadow: var(--shadow-float); max-width: calc(100vw - 32px); display: flex; gap: 10px; align-items: center;
}
.toast .ic { color: #1f7a4f; }
@media (min-width: 900px) { .toast { bottom: 32px; left: calc(50% + 116px); } }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
  @keyframes toast-in { from { transform: translate(-50%, 12px); opacity: 0; } }
}

/* ---------- home ---------- */

.home { display: grid; grid-template-columns: minmax(0, 1fr); }
.hero .lbl { font-size: 14.5px; font-weight: 500; color: var(--muted); }
.hero .total { font: 500 46px/1 var(--display); letter-spacing: -0.03em; margin-top: 8px; white-space: nowrap; }
.pace-s { font-size: 14px; color: var(--muted); margin-top: 10px; }
.pace-s b { font-weight: 600; }
.pace-s .up { color: var(--up); }
.pace-s .down { color: var(--back); }
.facts { display: flex; gap: 28px; margin: 16px 0 0; }
.facts > div { display: flex; flex-direction: column-reverse; gap: 2px; margin: 0; }
.facts dd { margin: 0; font: 500 20px/1.1 var(--display); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.facts dt { font-size: 12.5px; color: var(--muted); }
.mosaic { position: relative; margin-top: 20px; }
.mosaic-empty { margin-top: 20px; }
.pace-box { display: none; }
.home-side { margin-top: 26px; }

/* Mosaic tiles: category colour with light lettering; the size decides what shows. */
.mosaic .tile {
  position: absolute; display: flex; flex-direction: column; align-items: flex-start; overflow: hidden;
  padding: 11px 12px 12px; border-radius: 16px; background: var(--c); color: var(--tile-ink); text-decoration: none;
}
.mosaic .tile:hover { filter: brightness(1.08); }
.mosaic .tile .tn { font-weight: 600; font-size: 13px; line-height: 1.2; color: rgba(251, 248, 253, 0.86); }
.mosaic .tile .ts { position: absolute; top: 11px; right: 12px; font-size: 12.5px; font-weight: 500; color: rgba(251, 248, 253, 0.86); }
.mosaic .tile .ta { margin-top: auto; font: 500 17px/1 var(--display); letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.mosaic .tile.lg .tn { padding-right: 40px; font-size: 14px; }
.mosaic .tile.lg .ta { font-size: var(--fs, 26px); }
.mosaic .tile.sm { padding: 8px 9px; }
.mosaic .tile.sm .ta { font-size: 14px; }
.mosaic .tile.ln { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; padding-top: 0; padding-bottom: 0; }
.mosaic .tile.ln .ta { margin-top: 0; font-size: 16px; }
.mosaic .tile.xs { padding: 0; }
.mosaic .tile.none { background: none; border: 1.5px dashed var(--unset); color: var(--ink); }
.mosaic .tile.none .tn, .mosaic .tile.none .ts { color: var(--muted); }
.mosaic .tile.more { background: var(--c-rest); }

.pace-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 34px 0 8px; }
.key { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.key span { display: inline-flex; align-items: center; gap: 8px; }
.key i { display: block; width: 18px; border-top: 2px solid var(--ink); }
.key i.dash { border-top: 2px dashed var(--aug); }
.pace { position: relative; }
.pace svg { display: block; width: 100%; height: auto; overflow: visible; }
.pace .gridl { stroke: var(--line); stroke-width: 1; }
.pace .this { fill: none; stroke: var(--ink); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.pace .last { fill: none; stroke: var(--aug); stroke-width: 1.75; stroke-dasharray: 4 4; stroke-linejoin: round; }
.pace .dot { fill: var(--ink); stroke: var(--page); stroke-width: 2; }
.pace .gap { stroke-width: 2; }
.pace .gap.up { stroke: var(--up); }
.pace .gap.down { stroke: var(--back); }
.pace .gapl { font: 600 12.5px var(--font); paint-order: stroke; stroke: var(--page); stroke-width: 4px; stroke-linejoin: round; }
.pace .gapl.up { fill: var(--up); }
.pace .gapl.down { fill: var(--back); }
.pace .axis { fill: var(--muted); font: 500 11.5px var(--font); font-variant-numeric: tabular-nums; }
.pace .cross { stroke: var(--line-2); }

/* The review line: a dashed square, like an uncategorized tile. */
.look {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) 18px; column-gap: 12px; align-items: start;
  padding: 2px 0 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit;
}
.look .csq { margin-top: 6px; }
.look b { display: block; font-size: 14.5px; font-weight: 600; line-height: 21px; }
.look span.lt { display: block; font-size: 12.5px; line-height: 17px; color: var(--muted); margin-top: 1px; }
.look > .ic { color: var(--muted); margin-top: 2px; width: 18px; height: 18px; }
.home-side .section { margin-top: 26px; }
.home-side .section:first-child { margin-top: 0; }

.trip-rows { display: grid; }
.trip-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid var(--line); text-decoration: none; color: inherit;
}
.trip-row b { display: block; font-size: 14.5px; font-weight: 500; line-height: 20px; }
.trip-row span span { display: block; font-size: 12.5px; color: var(--muted); line-height: 17px; margin-top: 1px; }
.trip-row .num { font-size: 14.5px; font-weight: 600; line-height: 20px; white-space: nowrap; }

@media (min-width: 900px) {
  .home { grid-template-columns: minmax(0, 1fr) 300px; gap: 0 44px; align-items: start; }
  .hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
  .hero .total { font-size: 68px; margin-top: 10px; }
  .hero .facts { margin: 0 0 2px; gap: 32px; }
  .hero .facts dd { font-size: 24px; }
  .mosaic { margin-top: 28px; }
  .pace-box { display: block; }
  .home-side { margin-top: 0; padding-top: 2px; }
}

/* ---------- lists of expenses ---------- */

.day { margin-bottom: 6px; }
.day-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 600;
  padding: 16px 0 8px; border-bottom: 1px solid var(--line);
}
.day-head .num { font-weight: 500; color: var(--muted); }
.list { display: grid; }
.item {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; column-gap: 12px; row-gap: 1px; align-items: start;
  width: 100%; text-align: left; padding: 11px 0; background: none; border: 0; border-bottom: 1px solid var(--line);
  cursor: pointer; color: inherit; text-decoration: none;
}
.item:hover .d { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.item > .b { grid-row: span 2; padding-top: 5px; display: flex; }
.item .d { font-size: 14.5px; font-weight: 500; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.item .a { font-size: 14.5px; font-weight: 600; line-height: 20px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.item .a .back { color: var(--back); }
.item .c { font-size: 12.5px; line-height: 17px; color: var(--muted); grid-column: 2 / -1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.item .c > span { display: flex; align-items: center; gap: 5px; min-width: 0; flex-wrap: wrap; }
.item .c .ic { width: 13px; height: 13px; vertical-align: 0; }
.people-split { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.people-split button { display: inline-flex; align-items: center; gap: 5px; color: inherit; }
.people-split b { color: var(--ink); font-weight: 600; }
.item .c .guess { font-size: 11.5px; text-decoration: underline dashed var(--unset); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.tag { font-size: 11.5px; padding: 0 6px; border-radius: 6px; border: 1px dashed var(--unset); color: var(--ink); line-height: 17px; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); font-size: 14.5px; }
.empty .ic { width: 28px; height: 28px; display: block; margin: 0 auto 10px; }
.more-row { display: flex; justify-content: center; margin: 18px 0; }

.month-row { display: flex; align-items: center; gap: 2px; margin: 0 -8px 12px; }
.month-row .step {
  width: 36px; height: 36px; border-radius: 10px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--ink); flex: none;
}
.month-row .step:hover:not(:disabled) { background: var(--raised); }
.month-row .step:disabled { opacity: 0.3; cursor: default; }
.month-row .ms-label { font-size: 16px; font-weight: 600; background: none; border: 0; cursor: pointer; padding: 6px 6px; border-radius: 10px; }
.month-row .ms-label:hover { background: var(--raised); }
.month-row .ms-label .ic { width: 15px; height: 15px; vertical-align: -2px; color: var(--muted); margin-left: 4px; }
.month-row .ms-total { margin-left: auto; text-align: right; padding-right: 8px; line-height: 1.2; }
.month-row .ms-total b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.month-row .ms-total > span { display: block; font-size: 12px; color: var(--muted); }
.tools { display: grid; gap: 12px; margin-bottom: 8px; }
.phone-only { display: block; }
@media (max-width: 899px) { .expenses-page .page-head { display: none; } }
@media (min-width: 900px) {
  .phone-only { display: none !important; }
  .expenses-page { max-width: 820px; }
  .month-row .ms-total b { font-size: 18px; }
}

/* ---------- dialogs & sheets ---------- */

dialog {
  width: min(520px, calc(100vw - 24px)); border: 0; border-radius: 22px;
  background: var(--sheet); color: var(--ink); padding: 20px; max-height: 90dvh;
  box-shadow: 0 0 0 1px var(--line-2), 0 30px 80px -20px rgba(0, 0, 0, 0.7);
}
dialog::backdrop { background: var(--scrim); }
dialog form { display: grid; gap: 14px; }
dialog h2 { margin: 0; font-size: 20px; }
dialog .source { font-size: 13px; color: var(--muted); margin: 0; }
.dialog-actions { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; margin-top: 4px; }
.dialog-actions > div { display: flex; gap: 10px; }
@media (max-width: 640px) {
  dialog {
    width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 28px 28px 0 0;
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 92dvh;
    box-shadow: 0 -1px 0 var(--line-2);
  }
  dialog::before { content: ''; display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 10px; }
  .dialog-actions { flex-direction: column-reverse; align-items: stretch; }
  .dialog-actions .btn { flex: 1; }
  .dialog-actions > div { flex: 1; }
}
@media (min-width: 641px) and (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: pop 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
  @keyframes pop { from { transform: translateY(12px) scale(0.985); opacity: 0; } }
}
@media (max-width: 640px) and (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: sheet-up 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); }
  @keyframes sheet-up { from { transform: translateY(60px); opacity: 0.4; } }
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-right: -8px; }
.sheet-head + * { margin-top: 10px; }
.sheet-list { display: grid; margin: 0 -8px; overflow-y: auto; max-height: min(64dvh, 560px); }
.sheet-group { font-size: 13px; color: var(--muted); padding: 14px 8px 4px; font-weight: 500; }
.opt {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; text-align: left;
  min-height: 48px; padding: 6px 8px; border: 0; background: none; border-radius: 10px; cursor: pointer; width: 100%; color: inherit;
}
.opt > span:first-child { display: grid; place-items: center; }
.opt:hover { background: var(--raised); }
.opt.sub { padding-left: 28px; }
.opt .o-label { font-weight: 500; }
.opt .o-meta { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.opt .check { color: var(--ink); }
.opt[aria-selected='true'] { background: var(--seg-on); }

/* ---------- add sheet ---------- */

@media (min-width: 641px) { .add-sheet { width: min(500px, calc(100vw - 24px)); } }
.add-sheet form { gap: 0; }
.add-sheet .sheet-head h2 { font-size: 20px; }
.entry-line {
  width: 100%; margin-top: 10px; border: 0; background: var(--field); border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--ink);
  font-size: 21px; font-weight: 500; padding: 0 16px; height: 56px; caret-color: var(--ink);
}
.entry-line::placeholder { color: var(--muted); font-weight: 400; }
.entry-line:focus { outline: none; }
.entry-hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.readout { display: flex; align-items: baseline; gap: 12px; margin-top: 16px; min-height: 40px; min-width: 0; }
.readout .r-amount { font: 500 38px/1 var(--display); letter-spacing: -0.02em; }
.readout .r-amount .back { color: var(--back); }
.readout .desc { font-size: 17px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.readout .hint { color: var(--muted); font-size: 14px; align-self: center; }
.cat-h { display: flex; justify-content: space-between; align-items: baseline; margin-top: 18px; font-size: 14px; font-weight: 600; }
.cat-h .linkish { font-size: 13px; font-weight: 500; }
.cpicks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.cpick {
  position: relative; height: 58px; border-radius: 16px; padding: 8px 10px; border: 0; cursor: pointer; text-align: left;
  display: flex; align-items: flex-end; font-size: 13px; font-weight: 600; line-height: 1.2; background: var(--c); color: var(--tile-ink);
}
.cpick[aria-pressed='true'] { box-shadow: 0 0 0 2px var(--sheet), 0 0 0 4px var(--ink); }
.cpick .ic { position: absolute; top: 7px; right: 8px; width: 16px; height: 16px; }
.cpick.none { background: none; border: 1.5px dashed var(--unset); color: var(--ink); }
.sugg { margin-top: 10px; font-size: 12.5px; color: var(--muted); min-height: 17px; }
.frows { margin-top: 12px; border-top: 1px solid var(--line); }
.frow {
  position: relative; display: flex; align-items: center; gap: 6px; width: 100%; height: 50px; border: 0; border-bottom: 1px solid var(--line);
  background: none; color: inherit; font-size: 14.5px; cursor: pointer; padding: 0; text-align: left;
}
.frow .fk { color: var(--muted); }
.frow .fv { margin-left: auto; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.frow .fv span { color: var(--muted); font-weight: 400; margin-left: 4px; }
.frow .ic { color: var(--muted); width: 16px; height: 16px; }
.frow input[type='date'] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.frow input[type='date']::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.entry-actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 8px; margin-top: 16px; }
.entry-actions .btn { width: 100%; padding: 0 12px; min-height: 50px; }
@media (prefers-reduced-motion: no-preference) {
  .entry-saved .entry-line { animation: saved 0.5s ease-out; }
  @keyframes saved { from { box-shadow: inset 0 0 0 1.5px var(--back); } }
}

/* ---------- statistics ---------- */

.stats-filters { display: grid; gap: 10px; margin-bottom: 22px; }
@media (min-width: 900px) { .stats-filters { grid-template-columns: auto 1fr; align-items: center; gap: 12px; } .stats-filters .segmented { width: 340px; } }
.total-block { margin: 0 0 8px; }
.total-block .tb-label { font-size: 14px; color: var(--muted); font-weight: 500; }
.total-block .tb-amount { font: 500 40px/1.05 var(--display); letter-spacing: -0.03em; margin-top: 6px; }
.total-block .tb-delta { font-size: 14px; color: var(--muted); margin-top: 8px; }
.total-block .tb-delta b { font-weight: 600; }
.total-block .tb-delta .more { color: var(--up); }
.total-block .tb-delta .less { color: var(--back); }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.kpis > div { min-width: 0; display: flex; flex-direction: column-reverse; gap: 2px; }
.kpis .k { font-size: 12.5px; color: var(--muted); }
.kpis .v { font: 500 19px/1.1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpis .v.good { color: var(--back); }
@media (min-width: 900px) { .kpis { max-width: 560px; } .total-block .tb-amount { font-size: 56px; } }

.card { padding: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 26px 0 6px; }
.hint-line { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; }
.hint-line span { display: inline-flex; gap: 6px; align-items: center; }
.hint-line .linkish { font-size: 12.5px; }
.panel-tabs { margin: 26px 0 8px; }
@media (min-width: 1000px) {
  .explore-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 44px; align-items: start; }
  .explore-grid > .card { position: sticky; top: 24px; }
  .explore-grid .card-head, .explore-grid .panel-tabs { margin-top: 8px; }
}

.strip { position: relative; height: 26px; margin: 4px 0 6px; }
.strip i { position: absolute; top: 0; height: 26px; border-radius: 8px; background: var(--c); display: block; }
.strip i.none { background: none; border: 1.5px dashed var(--unset); }
.ranks { display: grid; }
.rank {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 16px; gap: 2px 12px; align-items: center;
  padding: 11px 0; border: 0; border-bottom: 1px solid var(--line); background: none; width: 100%; text-align: left;
  color: inherit; cursor: pointer; text-decoration: none;
}
.rank:hover .r-name { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.rank .r-main { min-width: 0; }
.rank .r-name { font-size: 14.5px; font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .r-sub { font-size: 12.5px; color: var(--muted); display: block; }
.rank .r-bar { display: block; height: 3px; margin-top: 7px; background: var(--line); border-radius: 2px; overflow: hidden; }
.rank .r-bar i { display: block; height: 100%; background: var(--c, var(--muted)); border-radius: 2px; min-width: 2px; }
.rank .r-val { text-align: right; font-size: 14.5px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rank .r-val small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.rank .chev { color: var(--muted); width: 16px; height: 16px; }
.rank.plain { grid-template-columns: minmax(0, 1fr) auto 16px; }
.rank.static { cursor: default; }
.rank.static .chev { visibility: hidden; }

/* ---------- charts ---------- */

.chart { position: relative; margin-top: 4px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .baseline { stroke: var(--line-2); stroke-width: 1; }
.chart .tick { fill: var(--muted); font: 500 11px var(--font); font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--ink); transition: opacity 0.12s; }
.chart .bar.low, .chart .bar.partial { stroke: var(--ink); stroke-width: 1.5; }
.chart .bar.partial { fill: var(--page); }
.chart .bar.dim { opacity: 0.3; }
.chart .hit { fill: transparent; outline: none; }
.chart .avg { stroke: var(--muted); stroke-width: 1.25; stroke-dasharray: 4 3; }
.chart .avgl, .chart .vl { fill: var(--ink); font: 600 11.5px var(--font); paint-order: stroke; stroke: var(--page); stroke-width: 4px; stroke-linejoin: round; }
.tooltip {
  position: absolute; pointer-events: none; z-index: 3; background: var(--btn-bg); color: var(--btn-fg);
  padding: 8px 11px; border-radius: 10px; font-size: 13px; white-space: nowrap; transform: translate(-50%, -100%);
  box-shadow: var(--shadow-float); line-height: 1.4;
}
.tooltip b { font-weight: 700; font-size: 14px; }
.swatch-avg { width: 16px; height: 0; border-top: 1.5px dashed var(--muted); }
.swatch-hatch, .swatch-partial { width: 11px; height: 11px; border-radius: 2px; border: 1.5px solid var(--ink); }
.swatch-hatch { background: repeating-linear-gradient(45deg, var(--ink) 0 1.5px, transparent 1.5px 4px); }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.data td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
table.data td.r, table.data th.r { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: 0; }

/* ---------- trips ---------- */

.trip-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 0; }
.trip-facts > div { display: flex; flex-direction: column-reverse; gap: 2px; min-width: 0; }
.trip-facts dt { font-size: 12.5px; color: var(--muted); }
.trip-facts dd { margin: 0; font: 500 22px/1.15 var(--display); font-variant-numeric: tabular-nums; }
.trip-facts dd small { display: block; font: 400 12.5px/1.3 var(--font); letter-spacing: 0; color: var(--muted); margin-top: 2px; }
.trip-facts > div:first-child dd { font-size: 40px; letter-spacing: -0.03em; }
@media (min-width: 760px) { .trip-facts { grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); align-items: end; } }
.two-col { display: grid; gap: 30px; margin-top: 30px; }
@media (min-width: 900px) { .two-col { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 44px; align-items: start; } }
.item-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.item-row .item { border-bottom: 0; flex: 1; min-width: 0; }
.item-row .remove { flex: 0 0 40px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; border-radius: 10px; }
.item-row .remove:hover { color: var(--danger); background: var(--raised); }
.suggestions { display: grid; }
.suggestion { padding: 14px 0; border-bottom: 1px solid var(--line); }
.s-head { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.s-head strong { font-weight: 600; }
.s-head .num { font-weight: 600; }
.s-meta { font-size: 12.5px; margin-top: 2px; }
.s-examples { font-size: 13px; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.s-match { font-size: 13px; margin-top: 6px; }
.s-actions { display: flex; gap: 8px 14px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.picklist { max-height: min(46vh, 420px); overflow-y: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 4px; }
.pick { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 9px 2px; border-top: 1px solid var(--line); cursor: pointer; min-height: 50px; }
.pick:first-child { border-top: 0; }
.pick input { width: 18px; height: 18px; accent-color: var(--ink); }
.pick .p-d { overflow-wrap: anywhere; }
.pick .p-d small { display: block; color: var(--muted); font-size: 12px; }
.pick-toggle { display: flex; gap: 8px; align-items: center; font-size: 14px; min-height: 44px; }
.pick-head { display: flex; justify-content: space-between; align-items: center; }
.trip-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.trip-controls select.input { width: auto; min-height: 36px; padding: 4px 10px; }
.page-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.page-title h1 { display: block; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; margin: 0 0 12px; }
.back-link:hover { color: var(--ink); }
.trip-mosaic .mosaic { margin-top: 12px; }

/* ---------- login ---------- */

.login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login form { width: min(380px, 100%); display: grid; gap: 14px; }
.login .login-mosaic { position: relative; height: 120px; margin-bottom: 18px; }
.login .login-mosaic i { position: absolute; border-radius: 14px; background: var(--c); }
.login .brand { margin-bottom: 4px; }
.login h1 { font-size: 30px; }
.login p { margin: 6px 0 0; }
.login .btn { margin-top: 6px; }

/* ---------- settings ---------- */

.link-row {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 0; text-decoration: none; color: inherit;
  border: 0; border-bottom: 1px solid var(--line); background: none; width: 100%; text-align: left; cursor: pointer;
}
.link-row .lr-text { flex: 1; min-width: 0; }
.link-row .lr-text b { display: block; font-weight: 600; font-size: 14.5px; }
.link-row .lr-text span { font-size: 12.5px; color: var(--muted); }
.link-row > .ic:last-child { color: var(--muted); width: 18px; height: 18px; }
.link-row .csq { margin: 0 0 0 0; }
.cat-tree { display: grid; }
.cat-tree .top { font-weight: 600; }
.cat-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 46px; border-bottom: 1px solid var(--line); }
.cat-line > span:first-child { display: inline-flex; align-items: center; gap: 12px; min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cat-line .linkish { font-size: 13px; }
.cat-line.sub { padding-left: 22px; color: var(--muted); min-height: 42px; }
.cat-line.archived { opacity: 0.5; }
.cat-line .row { flex-wrap: nowrap; flex: none; }
.cat-line .row > * { flex: none; }
.settings { max-width: 760px; }

/* ---------- assistant ---------- */

.chat { display: flex; flex-direction: column; min-height: calc(100dvh - 190px); max-width: 760px; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 16px; }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 18px; padding-bottom: 12px; }
.chat-empty p { color: var(--muted); margin-top: 0; max-width: 60ch; }
.chat-empty .chips { display: grid; gap: 8px; margin-top: 14px; }
.chat-empty .chip {
  text-align: left; min-height: 48px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-2);
  background: none; color: var(--ink); cursor: pointer; font-size: 14.5px;
}
.chat-empty .chip:hover { background: var(--raised); }
.msg.user { align-self: flex-end; max-width: 85%; }
.msg.user > div { background: var(--seg-on); padding: 10px 14px; border-radius: 18px 18px 6px 18px; overflow-wrap: anywhere; }
.msg-via { display: block; text-align: right; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.msg.assistant { max-width: 100%; }
.msg.assistant .md { overflow-wrap: anywhere; }
.md p { margin: 8px 0; }
.md ul, .md ol { margin: 8px 0; padding-left: 22px; }
.md li + li { margin-top: 3px; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.md code { font-size: 0.9em; background: var(--raised); padding: 1px 4px; border-radius: 4px; }
.md-table { overflow-x: auto; margin: 8px 0; }
.md-table table { min-width: 320px; }
.chat-tools { font-size: 12.5px; color: var(--muted); margin: 0 0 4px; }
.chat-batch { font-size: 13px; color: var(--muted); margin: 6px 0 0; display: flex; gap: 10px; align-items: baseline; }
.composer {
  position: sticky; bottom: var(--tabbar); z-index: 4;
  display: flex; gap: 8px; align-items: flex-end; padding: 10px 0 12px; background: var(--page);
}
.composer textarea { resize: none; min-height: 48px; max-height: 180px; line-height: 1.4; border-radius: 14px; padding: 13px 16px; }
.composer .btn { flex: 0 0 auto; min-height: 48px; }
@media (min-width: 900px) { .composer { bottom: 0; } }
.composer { flex-wrap: wrap; }
.composer textarea { flex: 1 1 0; min-width: 0; }
@media (max-width: 599px) { .composer { gap: 4px; } .composer textarea { padding: 13px 12px; } }
.composer-extra { flex: 1 0 100%; display: flex; flex-direction: column; gap: 6px; }
.composer-extra:has(> :not([hidden])) { margin-bottom: 2px; }
.composer-btn { flex: 0 0 auto; width: 36px; height: 48px; display: inline-flex; align-items: center; justify-content: center; border-radius: 14px; cursor: pointer; color: var(--muted); }
.composer-btn:hover { color: var(--ink); }
.composer-btn.recording { color: #fff; background: #b4474f; }
@media (prefers-reduced-motion: no-preference) { .composer-btn.recording { animation: pulse 1.4s ease-in-out infinite; } }
.composer-status { margin: 0; font-size: 13px; color: var(--muted); }
.chat-files { display: flex; flex-wrap: wrap; gap: 8px; }
.pending-file { position: relative; }
.pending-file button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); color: var(--ink); border: 1px solid var(--line); cursor: pointer; }
.msg.user > .msg-files { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 6px; background: none; padding: 0; border-radius: 0; }
.msg-file.img img { display: block; width: 88px; height: 88px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.msg-file.doc { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 8px 12px; border-radius: 12px; background: var(--raised); color: var(--ink); font-size: 13px; text-decoration: none; }
.msg-file.doc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) {
  .chat-tools.working { animation: pulse 1.4s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: 0.45; } }
}

/* ---------- budgets ---------- */

.brows { display: grid; }
.brow {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; column-gap: 12px; align-items: start;
  width: 100%; padding: 11px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit;
  text-align: left; cursor: pointer; font: inherit;
}
.brow > .csq { margin-top: 5px; }
.brow:disabled { cursor: default; }
.brow.sub { padding-left: 22px; grid-template-columns: 10px minmax(0, 1fr) auto; }
.brow .bm { min-width: 0; display: grid; gap: 1px; }
.brow .bn { font-size: 14.5px; font-weight: 500; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brow .bn:empty { display: none; }
.brow .bs { font-size: 12.5px; line-height: 17px; color: var(--muted); font-variant-numeric: tabular-nums; }
.brow .bv { font-size: 14px; font-weight: 600; line-height: 20px; font-variant-numeric: tabular-nums; }
.brow.over .bv, .brow.over .bs { color: var(--up); }
.brow.none .bn { color: var(--muted); }
.brow.none .bv { font-weight: 500; font-size: 13px; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.bbar { position: relative; display: block; height: 6px; margin-top: 8px; border-radius: 3px; background: var(--line); }
.bbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--c, var(--ink)); min-width: 2px; }
.brow.over .bbar i { background: var(--up); }
.bbar b { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--ink); opacity: 0.55; }
.bmore {
  display: inline-flex; align-items: center; gap: 4px; margin: 0 0 0 22px; padding: 8px 0; border: 0; background: none;
  color: var(--muted); font-size: 12.5px; cursor: pointer;
}
.bmore:hover { color: var(--ink); }
.bgroup { border-bottom: 1px solid var(--line); }
.bgroup > .brow:last-child { border-bottom: 0; }
.bgroup > .brow.sub:not(:last-child) { border-bottom: 1px dashed var(--line); }
.bgroup > .brow:first-child { border-bottom: 0; }
.bsum { margin-top: 8px; }
.bsum-fig { font: 500 40px/1.05 var(--display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.bsum-fig span { display: block; font: 400 14px/1.4 var(--font); letter-spacing: 0; color: var(--muted); margin-top: 6px; }
.bsum .brow { border-bottom: 0; padding-top: 4px; grid-template-columns: 0 minmax(0, 1fr) auto; column-gap: 0; }
.bsum .brow .bs { display: none; }
.budgets-page { max-width: 720px; }
.budgets-page .month-row { margin-top: 4px; }
.budgets-page .ms-label { cursor: default; }
.budgets-page .ms-label:hover { background: none; }
.trip-budget { margin-top: 18px; max-width: 560px; }
.trip-budget .brow { grid-template-columns: 0 minmax(0, 1fr) auto; column-gap: 0; border-bottom: 0; }

/* A budgeted mosaic tile: "of $1,200" and a thin bar of how much is used. */
.mosaic .tile .tbud { font-size: 12px; color: rgba(251, 248, 253, 0.8); margin-top: 4px; font-variant-numeric: tabular-nums; }
.mosaic .tile .tbar { position: absolute; left: 12px; right: 12px; bottom: 7px; height: 3px; border-radius: 2px; background: rgba(0, 0, 0, 0.28); overflow: hidden; }
.mosaic .tile .tbar i { display: block; height: 100%; background: rgba(251, 248, 253, 0.9); border-radius: 2px; }
.mosaic .tile .tbar.over i { background: #ffb3a8; }
.mosaic .tile.budgeted { padding-bottom: 17px; }
.mosaic .tile.none .tbar { background: var(--line); }
.mosaic .tile.none .tbar i { background: var(--ink); }
.scope-switch { margin: 14px 0 2px; max-width: 420px; }
