/* Evenly: Apple-style interface for the web.
   Tokens follow iOS semantic colours; sizes are in rem so the user's text size scales the layout. */

:root {
  color-scheme: light;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-rounded: ui-rounded, "SF Pro Rounded", var(--font-display);

  --accent: #5856d6;
  --accent-fill: rgba(88, 86, 214, 0.13);
  --on-accent: #fff;

  --bg: #f2f2f7;
  --cell: #ffffff;
  --bg-elevated: #f2f2f7;
  --cell-elevated: #ffffff;
  --label: #000;
  --label-2: rgba(60, 60, 67, 0.62);
  --label-3: rgba(60, 60, 67, 0.32);
  --separator: rgba(60, 60, 67, 0.22);
  --fill: rgba(120, 120, 128, 0.2);
  --fill-2: rgba(120, 120, 128, 0.14);
  --fill-3: rgba(118, 118, 128, 0.1);
  --press: rgba(0, 0, 0, 0.07);

  --green: #34c759;
  --green-text: #248a3d;
  --orange: #ff9500;
  --orange-text: #c93400;
  --red: #ff3b30;
  --red-text: #d70015;

  --c-indigo: #5856d6; --c-blue: #007aff; --c-teal: #30b0c7; --c-green: #34c759; --c-mint: #00c7be; --c-yellow: #ffcc00;
  --c-orange: #ff9500; --c-red: #ff3b30; --c-pink: #ff2d55; --c-purple: #af52de; --c-brown: #a2845e; --c-gray: #8e8e93;

  --material: rgba(246, 246, 248, 0.74);
  --material-thick: rgba(250, 250, 252, 0.9);
  --material-edge: rgba(255, 255, 255, 0.55);
  --glass-shadow: 0 8px 28px rgba(0, 0, 0, 0.14), 0 1px 3px rgba(0, 0, 0, 0.08);
  --seg-thumb: #fff;
  --card-shadow: 0 0.5px 0 rgba(0, 0, 0, 0.04);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --navbar-h: 3.25rem;
  --tabbar-h: 3.25rem;
  --gutter: 1rem;
  --radius-cell: 0.75rem;
}

:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #7d7aff; --accent-fill: rgba(125, 122, 255, 0.2);
    --bg: #000; --cell: #1c1c1e; --bg-elevated: #1c1c1e; --cell-elevated: #2c2c2e;
    --label: #fff; --label-2: rgba(235, 235, 245, 0.62); --label-3: rgba(235, 235, 245, 0.32);
    --separator: rgba(84, 84, 88, 0.6); --fill: rgba(120, 120, 128, 0.36); --fill-2: rgba(120, 120, 128, 0.3); --fill-3: rgba(118, 118, 128, 0.22); --press: rgba(255, 255, 255, 0.09);
    --green: #30d158; --green-text: #30d158; --orange: #ff9f0a; --orange-text: #ff9f0a; --red: #ff453a; --red-text: #ff6961;
    --c-indigo: #5e5ce6; --c-blue: #0a84ff; --c-teal: #40c8e0; --c-green: #30d158; --c-mint: #63e6e2; --c-yellow: #ffd60a; --c-orange: #ff9f0a; --c-red: #ff453a; --c-pink: #ff375f; --c-purple: #bf5af2; --c-brown: #ac8e68; --c-gray: #8e8e93;
    --material: rgba(28, 28, 30, 0.72); --material-thick: rgba(40, 40, 42, 0.92); --material-edge: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.4);
    --seg-thumb: #636366; --card-shadow: none;
  }
}
:root[data-theme="dark"] {
  --accent: #7d7aff; --accent-fill: rgba(125, 122, 255, 0.2);
  --bg: #000; --cell: #1c1c1e; --bg-elevated: #1c1c1e; --cell-elevated: #2c2c2e;
  --label: #fff; --label-2: rgba(235, 235, 245, 0.62); --label-3: rgba(235, 235, 245, 0.32);
  --separator: rgba(84, 84, 88, 0.6); --fill: rgba(120, 120, 128, 0.36); --fill-2: rgba(120, 120, 128, 0.3); --fill-3: rgba(118, 118, 128, 0.22); --press: rgba(255, 255, 255, 0.09);
  --green: #30d158; --green-text: #30d158; --orange: #ff9f0a; --orange-text: #ff9f0a; --red: #ff453a; --red-text: #ff6961;
  --c-indigo: #5e5ce6; --c-blue: #0a84ff; --c-teal: #40c8e0; --c-green: #30d158; --c-mint: #63e6e2; --c-yellow: #ffd60a; --c-orange: #ff9f0a; --c-red: #ff453a; --c-pink: #ff375f; --c-purple: #bf5af2; --c-brown: #ac8e68; --c-gray: #8e8e93;
  --material: rgba(28, 28, 30, 0.72); --material-thick: rgba(40, 40, 42, 0.92); --material-edge: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.4);
  --seg-thumb: #636366; --card-shadow: none;
}

/* Ease light ↔ dark instead of flashing. */
.theme-fade, .theme-fade * { transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease !important; }

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; background: #000; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--label);
  font: 400 1.0625rem/1.35 var(--font); letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; -webkit-user-select: none; user-select: none; }
button:disabled { cursor: default; opacity: 0.45; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
img { max-width: 100%; display: block; }
svg.i { width: 1.375rem; height: 1.375rem; flex: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--green-text); }
.neg { color: var(--orange-text); }
.muted { color: var(--label-2); }
.center { text-align: center; justify-content: center; }
.accent-text { color: var(--accent); }
.tint-text { color: var(--accent); font-weight: 500; }
.fine { font-size: 0.8125rem; color: var(--label-2); letter-spacing: 0.005em; }

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

#app {
  position: fixed; inset: 0; background: var(--bg); overflow: hidden;
  transform-origin: 50% 0;
}
#app.shell { display: grid; grid-template-columns: 1fr; }
#app.shell .detail { display: none; }
#app.shell.wide { grid-template-columns: minmax(20rem, 36%) 1fr; }
#app.shell.wide .detail { display: block; position: relative; overflow: hidden; background: var(--bg); }
#app.shell.wide .sidebar { box-shadow: 0.5px 0 0 var(--separator); z-index: 2; }
.sidebar { position: relative; overflow: hidden; }
.tab-host, .detail-host { position: absolute; inset: 0; }
.detail .placeholder { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--label-2); gap: 0.5rem; }
.detail .placeholder[hidden] { display: none; }
.ph-art { font-size: 3.5rem; opacity: 0.6; }

/* Phones: the app behind a sheet sinks back, like iOS card sheets. */
@media (max-width: 819px) {
  body.sheet-open #app, #app { transform: scale(calc(1 - var(--sheet-progress, 0) * 0.07)) translateY(calc(var(--sheet-progress, 0) * (var(--safe-top) + 0.25rem)));
    border-radius: calc(var(--sheet-progress, 0) * 0.75rem); }
}

/* ---------- navigation stack ---------- */

.nav { position: absolute; inset: 0; overflow: hidden; touch-action: pan-y; }
.page {
  position: absolute; inset: 0; background: var(--bg); will-change: transform;
  box-shadow: -1px 0 0 var(--separator), -12px 0 24px rgba(0, 0, 0, 0.06);
}
.page.below { box-shadow: none; }
.page .shade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 10; }
.page.fade-in { animation: fade-in 0.2s ease; }
@keyframes fade-in { from { opacity: 0; } }

.navbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  height: calc(var(--navbar-h) + var(--safe-top)); padding: var(--safe-top) 0.5rem 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.25rem;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.page.scrolled > .navbar {
  background: var(--material);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 0.5px 0 var(--separator);
}
.nav-leading { display: flex; align-items: center; min-width: 0; }
.nav-trailing { display: flex; align-items: center; justify-content: flex-end; gap: 0.125rem; min-width: 0; }
.nav-title {
  margin: 0; font: 600 1.0625rem/1.2 var(--font); letter-spacing: -0.01em; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw;
  transition: opacity 0.18s ease;
}
.page.has-large:not(.title-collapsed) .nav-title { opacity: 0; }

.nav-back {
  display: inline-flex; align-items: center; gap: 0.3rem; height: 2.75rem; padding: 0 0.5rem 0 0.25rem;
  background: none; border: 0; color: var(--accent); font-size: 1.0625rem; border-radius: 0.5rem; max-width: 100%;
}
.nav-back svg { width: 0.75rem; height: 1.25rem; flex: none; }
.nav-back span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-btn {
  position: relative; display: inline-grid; place-items: center; min-width: 2.75rem; height: 2.75rem; padding: 0 0.5rem;
  background: none; border: 0; border-radius: 999px; color: var(--accent);
  transition: transform 0.1s ease-out, background-color 0.15s;
}
.nav-btn.text { font-size: 1.0625rem; padding: 0 0.625rem; }
.nav-btn.bold { font-weight: 600; }
.nav-btn.tinted { background: var(--accent-fill); min-width: 2.25rem; height: 2.25rem; }
.nav-btn.is-pressed, .nav-btn:active { opacity: 0.55; }
.nav-btn .badge {
  position: absolute; top: 0.25rem; right: 0.125rem; min-width: 1.125rem; height: 1.125rem; padding: 0 0.3rem;
  border-radius: 999px; background: var(--red); color: #fff; font: 600 0.6875rem/1.125rem var(--font); letter-spacing: 0.01em;
}

.scroller {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain;
  padding: calc(var(--navbar-h) + var(--safe-top)) 0 calc(var(--tabbar-h) + var(--safe-bottom) + 1rem);
  -webkit-overflow-scrolling: touch; touch-action: pan-y;
}
.sheet .scroller { padding-bottom: calc(var(--safe-bottom) + 1.5rem); }
.large-title {
  margin: 0.125rem 0 0.5rem; padding: 0 1.25rem;
  font: 700 2.125rem/1.2 var(--font-display); letter-spacing: -0.022em;
}
.content { padding: 0 var(--gutter); max-width: 48rem; margin: 0 auto; }
.wide .detail .content { padding: 0 1.5rem; }
.bottom-space { height: 5.5rem; }
.bottom-space.small { height: 1rem; }

.accessory {
  position: absolute; right: var(--gutter); bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 0.875rem); z-index: 6;
  display: flex; align-items: center; gap: 0.625rem; pointer-events: none;
}
.accessory > * { pointer-events: auto; }
.detail .accessory, .sheet .accessory { bottom: calc(var(--safe-bottom) + 1rem); }
.detail .scroller { padding-bottom: calc(var(--safe-bottom) + 1rem); }

/* ---------- tab bar ---------- */

.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 8;
  height: calc(var(--tabbar-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--material); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 -0.5px 0 var(--separator);
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.125rem;
  background: none; border: 0; color: var(--label-2); font: 500 0.6875rem/1 var(--font); letter-spacing: 0.01em;
  transition: color 0.15s;
}
.tab svg.i { width: 1.5rem; height: 1.5rem; transition: transform 0.12s ease-out; }
.tab.on { color: var(--accent); }
.tab.is-pressed svg.i { transform: scale(0.88); }
.tab-badge {
  position: absolute; top: 0.3rem; left: calc(50% + 0.5rem); min-width: 1.125rem; height: 1.125rem; padding: 0 0.3rem;
  border-radius: 999px; background: var(--red); color: #fff; font: 600 0.6875rem/1.125rem var(--font); text-align: center;
}
.tab-badge[hidden] { display: none; }

/* ---------- lists & cells (inset grouped) ---------- */

.list {
  background: var(--cell); border-radius: var(--radius-cell); overflow: hidden; margin: 0 0 1.5rem;
  box-shadow: var(--card-shadow);
}
.sheet .list, .sheet .card, .sheet .group-card { background: var(--cell-elevated); }
.cell {
  position: relative; display: flex; align-items: center; gap: 0.75rem; width: 100%;
  min-height: 2.75rem; padding: 0.625rem 1rem; margin: 0;
  background: transparent; border: 0; text-align: left; color: inherit; text-decoration: none;
  transition: background-color 0.18s;
  --sep-inset: 1rem;
}
.cell:has(.cell-leading) { --sep-inset: 3.75rem; }
.list > * + * > .cell::before, .list > .cell + .cell::before, .list > * + .cell::before {
  content: ""; position: absolute; top: 0; left: var(--sep-inset); right: 0; height: 0.5px; background: var(--separator);
}
.cell.top { align-items: flex-start; }
.cell.tappable.is-pressed, .cell.tappable:active { background: var(--press); transition: none; }
.cell.tappable:not(:has(.cell-trailing, .accent-text, .nav-btn, .check-btn)):not(.destructive-cell)::after {
  content: ""; flex: none; width: 0.5rem; height: 0.5rem; margin-left: 0.25rem;
  border-top: 2px solid var(--label-3); border-right: 2px solid var(--label-3); transform: rotate(45deg); border-radius: 1px;
}
.cell-leading { flex: none; display: grid; place-items: center; }
.cell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.125rem; }
.cell-title { font-size: 1.0625rem; line-height: 1.3; overflow-wrap: anywhere; }
.cell-title.big { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.012em; }
.cell-sub { font-size: 0.9375rem; color: var(--label-2); line-height: 1.3; }
.cell-text { font-size: 0.9375rem; line-height: 1.35; }
.cell-meta { font-size: 0.8125rem; color: var(--label-2); margin-top: 0.125rem; letter-spacing: 0.005em; }
.cell-label { flex: none; width: 5.75rem; color: var(--label); }
.cell-trailing { flex: none; display: flex; align-items: center; gap: 0.375rem; color: var(--label-2); text-align: right; }
.cell-trailing.stacked { flex-direction: column; align-items: flex-end; gap: 0; }
.tiny { font-size: 0.75rem; letter-spacing: 0.01em; }
.destructive-cell .cell-title { color: var(--red-text); }
.destructive-cell .cell-sub { color: var(--label-2); }

.section-header {
  margin: 1.25rem 1rem 0.4375rem; font: 400 0.8125rem/1.3 var(--font); color: var(--label-2);
  text-transform: uppercase; letter-spacing: 0.035em;
}
.section-footer { margin: -1rem 1rem 1.5rem; font-size: 0.8125rem; line-height: 1.38; color: var(--label-2); letter-spacing: 0.005em; }
.section-footer.neg { color: var(--orange-text); }
.empty-note { color: var(--label-2); text-align: center; padding: 1.5rem 1rem; margin: 0; font-size: 0.9375rem; }
.empty-note.small { padding: 0.5rem 1rem 1.25rem; }

/* inputs inside cells */
input.inline, textarea.inline {
  width: 100%; border: 0; background: transparent; padding: 0; outline: none; font-size: 1.0625rem; min-height: 1.5rem;
}
textarea.inline { resize: none; line-height: 1.35; }
input.inline::placeholder, textarea::placeholder, .desc-input::placeholder, .amount-input::placeholder { color: var(--label-3); }
input[type="date"].inline { color: var(--label); min-height: 2rem; }
.inline-select {
  border: 0; background: transparent; color: var(--label-2); font-size: 1.0625rem; max-width: 13rem; text-align: right; outline: none;
  -webkit-appearance: none; appearance: none; padding-right: 1rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--label-3) 50%), linear-gradient(135deg, var(--label-3) 50%, transparent 50%);
  background-position: right 0.35rem center, right 0 center; background-size: 0.35rem 0.35rem; background-repeat: no-repeat;
}
.cell-main .inline-select { text-align: left; color: var(--label); max-width: none; width: 100%; }
.inline-select option { color: initial; }
.num-input {
  width: 5.5rem; border: 0; border-radius: 0.5rem; background: var(--fill-3); padding: 0.375rem 0.5rem;
  text-align: right; font-variant-numeric: tabular-nums; outline: none;
}
.num-input:focus { box-shadow: 0 0 0 2px var(--accent); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 2.75rem; padding: 0 1.125rem; border: 0; border-radius: 999px;
  font: 600 1.0625rem/1 var(--font); letter-spacing: -0.01em; text-decoration: none; white-space: nowrap;
  transition: transform 0.1s ease-out, opacity 0.1s ease-out, background-color 0.15s;
}
.btn.is-pressed, .btn:active { transform: scale(0.97); opacity: 0.86; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-tinted { background: var(--accent-fill); color: var(--accent); }
.btn-tinted.on { background: var(--accent); color: var(--on-accent); }
.btn-plain { background: transparent; color: var(--accent); font-weight: 500; }
.btn-small { height: 2rem; padding: 0 0.875rem; font-size: 0.9375rem; background: var(--accent-fill); color: var(--accent); }
.btn-large { height: 3.25rem; padding: 0 1.5rem; }
.btn.wide { width: 100%; }
.button-stack { display: flex; flex-direction: column; gap: 0.625rem; margin: 0 0 1.5rem; }
.link { background: none; border: 0; color: var(--accent); padding: 0; font-size: inherit; }

.capsule {
  display: inline-flex; align-items: center; gap: 0.5rem; height: 3.25rem; min-width: 3.25rem; padding: 0 1.25rem;
  border-radius: 999px; border: 0.5px solid var(--material-edge); color: var(--label);
  font: 600 1.0625rem/1 var(--font); justify-content: center;
  transition: transform 0.12s ease-out;
}
.capsule:not(.primary) { padding: 0; width: 3.25rem; color: var(--accent); }
.capsule.is-pressed, .capsule:active { transform: scale(0.94); }
.glass {
  background: var(--material); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--glass-shadow);
}
/* Colour goes on a solid layer, never on the translucent material. */
.capsule.primary { background: var(--accent); color: var(--on-accent); -webkit-backdrop-filter: none; backdrop-filter: none; border-color: transparent; }

/* ---------- tiles, avatars, icons ---------- */

[class*="tint-"] { --t: var(--c-indigo); }
.tint-indigo { --t: var(--c-indigo); } .tint-blue { --t: var(--c-blue); } .tint-teal { --t: var(--c-teal); } .tint-green { --t: var(--c-green); }
.tint-mint { --t: var(--c-mint); } .tint-yellow { --t: var(--c-yellow); } .tint-orange { --t: var(--c-orange); } .tint-red { --t: var(--c-red); }
.tint-pink { --t: var(--c-pink); } .tint-purple { --t: var(--c-purple); } .tint-brown { --t: var(--c-brown); } .tint-gray { --t: var(--c-gray); }

.group-tile, .cat-icon, .sq {
  display: inline-grid; place-items: center; flex: none; color: #fff; line-height: 1;
  background: linear-gradient(160deg, color-mix(in srgb, var(--t) 72%, #fff), var(--t) 70%);
}
.group-tile { width: 2.75rem; height: 2.75rem; border-radius: 0.75rem; font-size: 1.5rem; }
.group-tile.sm { width: 1.875rem; height: 1.875rem; border-radius: 0.5rem; font-size: 1rem; }
.group-tile.lg { width: 3.25rem; height: 3.25rem; border-radius: 0.875rem; font-size: 1.75rem; }
.group-tile.xl { width: 3.75rem; height: 3.75rem; border-radius: 1rem; font-size: 2rem; }
.group-tile.xxl { width: 5.25rem; height: 5.25rem; border-radius: 1.375rem; font-size: 2.875rem; }
.cat-icon { width: 2.25rem; height: 2.25rem; border-radius: 0.625rem; font-size: 1.25rem; }
.cat-icon.lg { width: 2.75rem; height: 2.75rem; border-radius: 0.75rem; font-size: 1.5rem; }
.cat-icon.xl { width: 4.5rem; height: 4.5rem; border-radius: 1.25rem; font-size: 2.5rem; }
.sq { width: 1.875rem; height: 1.875rem; border-radius: 0.5rem; }
.sq svg.i { width: 1.125rem; height: 1.125rem; }

.avatar {
  display: inline-grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: linear-gradient(160deg, hsl(var(--h) 65% 64%), hsl(var(--h) 55% 48%)); color: #fff;
  font: 600 1rem/1 var(--font-rounded);
}
.avatar.sm { width: 1.75rem; height: 1.75rem; font-size: 0.8125rem; }
.avatar.lg { width: 2.75rem; height: 2.75rem; font-size: 1.25rem; }
.avatar.xl { width: 3.75rem; height: 3.75rem; font-size: 1.75rem; }
.avatar.xxl { width: 5.25rem; height: 5.25rem; font-size: 2.5rem; }
.cur-badge { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--fill-2); font-weight: 600; font-size: 0.9375rem; }
.dot { display: inline-block; width: 0.625rem; height: 0.625rem; border-radius: 50%; background: var(--t); }

/* ---------- dashboard ---------- */

.summary { display: flex; align-items: center; gap: 0.75rem; margin: 0 0.25rem 1rem; }
.summary-line { flex: 1; margin: 0; font: 600 1.0625rem/1.35 var(--font); letter-spacing: -0.01em; }
.filter-note { margin: -0.5rem 0.25rem 0.75rem; font-size: 0.875rem; color: var(--label-2); }
.cards { display: flex; flex-direction: column; gap: 0.625rem; }
.group-card {
  display: flex; gap: 0.875rem; align-items: flex-start; width: 100%; padding: 0.875rem; border: 0; border-radius: 1rem;
  background: var(--cell); text-align: left; box-shadow: var(--card-shadow);
  transition: transform 0.12s ease-out, background-color 0.15s;
}
.group-card.is-pressed, .group-card:active { transform: scale(0.985); background: color-mix(in srgb, var(--cell) 92%, var(--label)); }
.gc-main { display: flex; flex-direction: column; gap: 0.1875rem; min-width: 0; padding-top: 0.125rem; }
.gc-name { font: 600 1.0625rem/1.25 var(--font); letter-spacing: -0.01em; }
.gc-bal { font-size: 0.9375rem; font-weight: 500; }
.gc-line { font-size: 0.875rem; color: var(--label-2); }
.settled-note { text-align: center; color: var(--label-2); font-size: 0.875rem; margin: 1.5rem 0; }
.settled-note p { margin: 0 0 0.75rem; }

.empty { text-align: center; padding: 2.5rem 1.25rem 1rem; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.empty.compact { padding: 1.5rem 1rem; }
.empty h2 { margin: 0.25rem 0 0; font: 700 1.375rem/1.2 var(--font-display); letter-spacing: -0.015em; }
.empty p { margin: 0 0 0.5rem; color: var(--label-2); max-width: 26rem; line-height: 1.45; }
.empty-art { font-size: 3.5rem; line-height: 1; }

/* ---------- hero headers ---------- */

.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.375rem; margin: 0.25rem 0 1.25rem; }
.hero.small { margin-bottom: 1rem; }
.hero h2 { margin: 0.5rem 0 0; font: 700 1.5rem/1.2 var(--font-display); letter-spacing: -0.018em; }
.hero-bal { margin: 0; font-weight: 500; }
.hero-amount { margin: 0; font: 700 2.25rem/1.15 var(--font-rounded); letter-spacing: -0.02em; }
.hero-meta { margin: 0; font-size: 0.875rem; color: var(--label-2); line-height: 1.45; }
.group-hero { flex-direction: row; text-align: left; gap: 1rem; align-items: center; }
.group-hero .hero-text { display: flex; flex-direction: column; align-items: flex-start; gap: 0.375rem; min-width: 0; }
.group-hero h2 { margin: 0; font-size: 1.75rem; overflow-wrap: anywhere; }
.pill-note { display: inline-flex; align-items: center; gap: 0.375rem; margin: 0.375rem 0 0; padding: 0.375rem 0.75rem; border-radius: 999px; background: var(--fill-3); font-size: 0.8125rem; color: var(--label-2); border: 0; }
.pill-note svg.i { width: 1rem; height: 1rem; }
.pill-note.link { color: var(--accent); }

.chips { display: flex; gap: 0.5rem; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)) 1.25rem; padding: 0.125rem var(--gutter); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 0.375rem; height: 2.25rem; padding: 0 1rem; border-radius: 999px;
  border: 0; background: var(--cell); color: var(--label); font: 500 0.9375rem/1 var(--font); box-shadow: var(--card-shadow);
  transition: transform 0.1s ease-out;
}
.chip.small { height: 1.875rem; padding: 0 0.75rem; font-size: 0.8125rem; background: var(--fill-2); color: var(--label-2); box-shadow: none; }
.chip.small svg.i { width: 1rem; height: 1rem; }
.chip.accent { background: var(--accent); color: var(--on-accent); }
.chip.is-pressed, .chip:active { transform: scale(0.95); }

.balance-card { background: var(--cell); border-radius: 1rem; margin: 0 0 1rem; overflow: hidden; box-shadow: var(--card-shadow); }
.bc-head { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.875rem 1rem 0.5rem; border: 0; background: none; text-align: left; }
.bc-total { flex: 1; font: 600 1.0625rem/1.35 var(--font); letter-spacing: -0.01em; }
.bc-chev { color: var(--label-3); transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); transform: rotate(90deg); }
.balance-card.expanded .bc-chev { transform: rotate(-90deg); }
.bc-lines { padding: 0 1rem 0.875rem; }
.bc-lines p { margin: 0.25rem 0; font-size: 0.9375rem; color: var(--label-2); }
.bc-lines p span.num { font-weight: 600; }

.banner {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0.875rem; margin: 0 0 1rem; border-radius: 0.875rem;
  background: color-mix(in srgb, var(--t) 14%, var(--cell)); font-size: 0.9375rem; line-height: 1.35;
}
.banner > span { flex: 1; }
.banner .btn-small { background: var(--t); color: #fff; }

/* ---------- expense feed ---------- */

.month-header { margin: 1.25rem 0.25rem 0.5rem; font: 600 0.9375rem/1.2 var(--font); color: var(--label-2); letter-spacing: -0.005em; }
.feed { display: flex; flex-direction: column; }
.swipe-row { position: relative; border-radius: var(--radius-cell); overflow: hidden; margin-bottom: 0.375rem; touch-action: pan-y; }
.swipe-actions { position: absolute; inset: 0 0 0 auto; width: 5.5rem; display: flex; justify-content: flex-end; background: var(--red); }
.swipe-row:not(.swiping) .swipe-actions { visibility: hidden; }
.swipe-del {
  width: 100%; border: 0; background: var(--red); color: #fff; font: 600 0.9375rem/1 var(--font);
  transform: scale(calc(0.7 + var(--reveal, 0) * 0.3)); opacity: calc(var(--reveal, 0) * 1.2);
}
.exp-row {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 0.75rem; width: 100%; min-height: 4rem; padding: 0.625rem 0.875rem;
  background: var(--cell); border: 0; border-radius: var(--radius-cell); text-align: left; will-change: transform;
  transition: background-color 0.18s;
}
.exp-row.static { margin-bottom: 0.375rem; background: var(--fill-3); }
.exp-row.is-pressed { background: color-mix(in srgb, var(--cell) 90%, var(--label)); transition: none; }
.date-block { display: flex; flex-direction: column; align-items: center; width: 2.25rem; flex: none; line-height: 1.05; color: var(--label-2); }
.date-block .mon { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.date-block .day { font: 600 1.25rem/1.1 var(--font-rounded); color: var(--label); }
.exp-row .cell-title { font-size: 1rem; font-weight: 500; display: flex; align-items: center; gap: 0.25rem; }
.exp-row .cell-sub { font-size: 0.875rem; }
.exp-row .cell-trailing .num { font-weight: 600; font-size: 1rem; }
.rep svg.i { width: 0.9375rem; height: 0.9375rem; color: var(--label-2); }

/* ---------- balances / totals / charts ---------- */

.bal-member { border-bottom: 0.5px solid var(--separator); }
.bal-member:last-child { border-bottom: 0; }
.chev-rot svg.i { transform: rotate(90deg); color: var(--label-3); transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
.bal-member.open .chev-rot svg.i { transform: rotate(-90deg); }
.bal-lines { padding: 0 1rem 0.75rem 4.5rem; }
.bal-line { padding: 0.5rem 0; }
.bal-line + .bal-line { border-top: 0.5px solid var(--separator); }
.bal-line p { margin: 0 0 0.5rem; font-size: 0.9375rem; }
.bal-actions { display: flex; gap: 0.5rem; }

.card { background: var(--cell); border-radius: 1rem; padding: 1rem; margin: 0 0 1.5rem; box-shadow: var(--card-shadow); }
.center-row { display: flex; justify-content: center; margin: 0 0 1rem; }
.totals-sub { text-align: center; color: var(--label-2); margin: 0 0 0.75rem; font-weight: 500; }
.chart-card { padding-bottom: 0.75rem; }
.bars { display: flex; align-items: flex-end; height: calc(var(--h) + 1.75rem); gap: 0.25rem; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 0.375rem; height: 100%; }
.bar-track { flex: 1; width: 100%; max-width: 2.5rem; display: flex; align-items: flex-end; }
.bar { position: relative; width: 100%; min-height: 2px; border-radius: 0.375rem 0.375rem 0.25rem 0.25rem; background: color-mix(in srgb, var(--c-indigo) 35%, transparent); overflow: hidden; transition: height 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.bar-col.hl .bar { background: color-mix(in srgb, var(--c-indigo) 75%, transparent); }
.bar-mine { position: absolute; left: 0; right: 0; bottom: 0; background: var(--c-mint); }
.bar-label { font-size: 0.75rem; color: var(--label-2); letter-spacing: 0.01em; }
.bar-col.hl .bar-label { color: var(--label); font-weight: 600; }
.legend-inline { display: flex; align-items: center; justify-content: center; gap: 0.375rem; margin: 0.75rem 0 0; font-size: 0.8125rem; color: var(--label-2); }
.legend-inline .dot { margin-left: 0.5rem; }
.legend-inline .tint-mint { background: var(--c-mint); }
.legend-inline .tint-indigo { background: color-mix(in srgb, var(--c-indigo) 75%, transparent); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 0 0 1.25rem; }
.stat { background: var(--cell); border-radius: 1rem; padding: 0.875rem 1rem; display: flex; flex-direction: column; gap: 0.25rem; box-shadow: var(--card-shadow); }
.stat-label { font-size: 0.8125rem; color: var(--label-2); letter-spacing: 0.01em; }
.stat-value { font: 700 1.5rem/1.15 var(--font-rounded); letter-spacing: -0.015em; }
.stat-foot { font-size: 0.8125rem; color: var(--label-2); }
.stepper-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.stepper { flex: 1; display: flex; align-items: center; justify-content: space-between; background: var(--cell); border-radius: 999px; padding: 0 0.25rem; min-width: 14rem; }
.stepper.disabled { opacity: 0.5; }
.stepper-label { font-weight: 600; }

.donut-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1.25rem; }
.donut-bg { stroke: var(--fill-3); }
.donut-total { font: 700 4.2px var(--font-rounded); fill: var(--label); text-anchor: middle; }
.donut-sub { font: 400 2.6px var(--font); fill: var(--label-2); text-anchor: middle; }
[class*="stroke-"] { transition: stroke-dasharray 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.stroke-indigo { stroke: var(--c-indigo); } .stroke-blue { stroke: var(--c-blue); } .stroke-teal { stroke: var(--c-teal); } .stroke-green { stroke: var(--c-green); }
.stroke-mint { stroke: var(--c-mint); } .stroke-yellow { stroke: var(--c-yellow); } .stroke-orange { stroke: var(--c-orange); } .stroke-red { stroke: var(--c-red); }
.stroke-pink { stroke: var(--c-pink); } .stroke-purple { stroke: var(--c-purple); } .stroke-brown { stroke: var(--c-brown); } .stroke-gray { stroke: var(--c-gray); }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 13rem; }
.legend li { display: grid; grid-template-columns: auto 1fr auto 2.5rem; align-items: center; gap: 0.5rem; padding: 0.375rem 0; font-size: 0.9375rem; }
.legend li + li { border-top: 0.5px solid var(--separator); }
.legend .pct { color: var(--label-2); text-align: right; font-size: 0.8125rem; }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.625rem; }
.hbars li { display: grid; grid-template-columns: minmax(5rem, 9rem) 1fr auto; align-items: center; gap: 0.75rem; font-size: 0.9375rem; }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { height: 0.5rem; border-radius: 999px; background: var(--fill-3); overflow: hidden; }
.hb-fill { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }

.whiteboard textarea {
  width: 100%; min-height: 55vh; border: 0; border-radius: 1rem; padding: 1rem; background: var(--cell);
  font-size: 1.0625rem; line-height: 1.5; resize: vertical; outline: none; margin-bottom: 1.25rem;
}

/* ---------- segmented control & switch ---------- */

.segmented {
  position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  min-width: min(100%, calc(var(--n) * 4.5rem)); height: 2rem; padding: 0.125rem; border-radius: 0.5625rem; background: var(--fill-2);
}
.segmented button {
  position: relative; z-index: 1; border: 0; background: none; border-radius: 0.4375rem; padding: 0 0.5rem;
  font: 600 0.8125rem/1 var(--font); letter-spacing: 0.005em; color: var(--label); white-space: nowrap;
}
.segmented button[aria-selected="false"], .segmented button[aria-selected=""] { font-weight: 500; }
.seg-thumb {
  position: absolute; top: 0.125rem; bottom: 0.125rem; left: 0.125rem; width: calc((100% - 0.25rem) / var(--n));
  border-radius: 0.4375rem; background: var(--seg-thumb); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04);
  transform: translateX(calc(var(--i) * 100%)); transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.segmented button.is-pressed { opacity: 0.6; }

.switch { position: relative; display: inline-block; width: 3.1875rem; height: 1.9375rem; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--fill); transition: background-color 0.25s ease; }
.switch .thumb {
  position: absolute; top: 0.125rem; left: 0.125rem; width: 1.6875rem; height: 1.6875rem; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.15s ease;
}
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track .thumb { transform: translateX(1.25rem); }
.switch input:active + .track .thumb { width: 1.9375rem; }
.switch input:checked:active + .track .thumb { transform: translateX(1rem); }

/* ---------- search ---------- */

.searchbar { position: relative; display: flex; align-items: center; margin: 0 0 1rem; }
.searchbar input {
  width: 100%; height: 2.25rem; border: 0; border-radius: 0.625rem; background: var(--fill-3); padding: 0 0.75rem 0 2.125rem;
  font-size: 1.0625rem; outline: none;
}
.sb-icon { position: absolute; left: 0.5rem; color: var(--label-2); display: grid; }
.sb-icon svg.i { width: 1.125rem; height: 1.125rem; }

/* ---------- sheets ---------- */

.sheet-layer { position: fixed; inset: 0; z-index: 50; }
.sheet-layer .scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.36); opacity: 0; }
.sheet {
  --bg: var(--bg-elevated);
  position: absolute; left: 0; right: 0; bottom: 0; top: calc(var(--safe-top) + 0.75rem);
  background: var(--bg); border-radius: 0.75rem 0.75rem 0 0; overflow: hidden; will-change: transform;
  box-shadow: 0 -2px 18px rgba(0, 0, 0, 0.12);
  transition: scale 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.35s;
}
.sheet .page { background: var(--bg); box-shadow: none; }
.sheet .page.below { visibility: visible; }
.sheet .navbar { padding-top: 0.375rem; height: calc(var(--navbar-h) + 0.375rem); }
.sheet .scroller { padding-top: calc(var(--navbar-h) + 0.5rem); }
.sheet-nav { position: absolute; inset: 0; }
.grabber { position: absolute; top: 0.3125rem; left: 50%; translate: -50% 0; width: 2.25rem; height: 0.3125rem; border-radius: 999px; background: var(--label-3); z-index: 9; }
.sheet-layer.pushed-back .sheet { scale: 0.94; filter: brightness(0.92); }
.sheet-layer.fade-in { animation: fade-in 0.2s ease; }
.sheet-layer.fade-out { opacity: 0; transition: opacity 0.2s ease; }
@media (min-width: 820px) {
  .sheet { left: 50%; right: auto; translate: -50% 0; width: min(38rem, calc(100vw - 3rem)); top: max(3vh, calc(var(--safe-top) + 1rem)); bottom: max(3vh, 1rem); border-radius: 1rem; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28); }
  .sheet-layer.size-medium .sheet { top: 12vh; bottom: 12vh; }
}

/* ---------- forms ---------- */

.with-row { background: var(--cell); border-radius: var(--radius-cell); margin-bottom: 1rem; box-shadow: var(--card-shadow); }
.sheet .with-row { background: var(--cell-elevated); }
.entry-card { padding: 0.5rem 1rem; }
.entry-row { display: flex; align-items: center; gap: 0.875rem; padding: 0.5rem 0; }
.entry-row + .entry-row { border-top: 0.5px solid var(--separator); }
.cat-btn, .cur-btn { flex: none; border: 0; background: none; padding: 0; border-radius: 0.75rem; transition: transform 0.1s ease-out; }
.cat-btn.is-pressed, .cur-btn.is-pressed { transform: scale(0.92); }
.cur-btn { width: 2.75rem; height: 2.75rem; border-radius: 0.75rem; background: var(--fill-2); font: 600 1.25rem/1 var(--font-rounded); color: var(--label); }
.desc-input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: 500 1.25rem/1.3 var(--font); letter-spacing: -0.012em; padding: 0.25rem 0; }
.amount-input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: 700 2.25rem/1.15 var(--font-rounded); letter-spacing: -0.02em; padding: 0.125rem 0; }
.amount-input[readonly] { color: var(--label-2); }
.entry-note { margin: 0 0 0.5rem; font-size: 0.8125rem; color: var(--label-2); }
.form-status { margin-top: -1rem; }
.form-status.shake { animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.mini-receipt { width: 2.25rem; height: 2.25rem; object-fit: cover; border-radius: 0.5rem; }
.form-intro p { color: var(--label-2); margin: 0 0.25rem 1rem; font-size: 0.9375rem; line-height: 1.45; }

.mode-title { text-align: center; margin: 0.25rem 0 0; font: 600 1.0625rem/1.3 var(--font); }
.mode-help { text-align: center; margin: 0.25rem 1rem 1rem; color: var(--label-2); font-size: 0.875rem; line-height: 1.4; }
.share-preview { font-size: 0.8125rem; color: var(--label-2); }
.split-status-bar {
  position: sticky; bottom: calc(var(--safe-bottom) + 0.75rem); margin: 0.5rem auto 0; width: fit-content; max-width: 100%;
  padding: 0.625rem 1.125rem; border-radius: 999px; font-size: 0.9375rem; font-weight: 500; text-align: center;
}
.check {
  display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  border: 1.5px solid var(--label-3); color: #fff; transition: background-color 0.15s, border-color 0.15s, transform 0.12s ease-out;
}
.check.on { background: var(--accent); border-color: var(--accent); }
.check svg.i { width: 0.9375rem; height: 0.9375rem; stroke-width: 3; }
.check-btn { flex: none; border: 0; background: none; padding: 0.25rem; display: grid; }
.check-btn.is-pressed .check { transform: scale(0.88); }
.item-card { padding: 0.75rem; margin-bottom: 0.75rem; }
.item-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.625rem; }
.item-head .item-name { flex: 1; font-weight: 500; }
.pill-row { display: flex; flex-wrap: wrap; gap: 0.375rem; margin: 0 0 1.25rem; }
.card .pill-row { margin: 0; }
.pill {
  height: 2rem; padding: 0 0.875rem; border-radius: 999px; border: 0; background: var(--fill-2); color: var(--label);
  font: 500 0.875rem/1 var(--font); transition: background-color 0.15s, transform 0.1s ease-out;
}
.pill.on { background: var(--accent); color: var(--on-accent); }
.pill.is-pressed { transform: scale(0.94); }
.btn.wide.btn-tinted { margin-bottom: 1.25rem; }

.group-editor { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; margin: 0.5rem 0 1.25rem; }
.group-editor .preview { transition: transform 0.2s ease-out; }
.title-input {
  width: 100%; border: 0; border-radius: 0.75rem; background: var(--cell-elevated); padding: 0.75rem 1rem; text-align: center;
  font: 600 1.375rem/1.2 var(--font-display); letter-spacing: -0.015em; outline: none;
}
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.75rem, 1fr)); gap: 0.25rem; }
.emoji-btn { height: 2.75rem; border: 0; border-radius: 0.75rem; background: none; font-size: 1.5rem; transition: transform 0.1s ease-out, background-color 0.15s; }
.emoji-btn.on { background: var(--accent-fill); box-shadow: inset 0 0 0 2px var(--accent); }
.emoji-btn.is-pressed { transform: scale(0.9); }
.swatches { display: flex; flex-wrap: wrap; gap: 0.625rem; justify-content: center; margin-top: 0.875rem; padding-top: 0.875rem; border-top: 0.5px solid var(--separator); }
.swatch { width: 1.875rem; height: 1.875rem; border-radius: 50%; border: 0; background: var(--t); transition: transform 0.12s ease-out; }
.swatch.on { box-shadow: 0 0 0 2px var(--bg-elevated), 0 0 0 4px var(--t); }
.swatch.is-pressed { transform: scale(0.88); }
.add-person { margin: 0; }

/* ---------- expense detail ---------- */

.expense-hero .cat-btn { margin-bottom: 0.25rem; }
.receipt-thumb { display: block; margin: 0 auto 1.25rem; padding: 0; border: 0; border-radius: 0.875rem; overflow: hidden; max-width: 14rem; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15); }
.receipt-thumb img { width: 100%; max-height: 16rem; object-fit: cover; }
.receipt-full img { width: 100%; border-radius: 0.75rem; }
.notes { line-height: 1.5; }
.comments { display: flex; flex-direction: column; gap: 0.625rem; margin: 0 0 1.5rem; }
.comment { display: flex; gap: 0.5rem; align-items: flex-end; }
.comment.mine { flex-direction: row-reverse; }
.bubble { max-width: 80%; background: var(--cell); border-radius: 1.125rem; padding: 0.5rem 0.875rem; }
.comment.mine .bubble { background: var(--accent); color: var(--on-accent); }
.comment.mine .c-name { color: rgba(255, 255, 255, 0.75); }
.c-name { display: block; font-size: 0.75rem; color: var(--label-2); margin-bottom: 0.125rem; }
.bubble p { margin: 0; overflow-wrap: anywhere; }
.history .cell { min-height: 2.5rem; }
.composer {
  display: flex; align-items: center; gap: 0.375rem; width: min(36rem, calc(100vw - 2rem)); height: 3rem; padding: 0 0.25rem 0 1rem; border-radius: 999px;
  border: 0.5px solid var(--material-edge); margin: 0;
}
.composer input { flex: 1; border: 0; background: none; outline: none; font-size: 1.0625rem; min-width: 0; }
.composer .send { width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; }
.composer .send svg.i { width: 1.25rem; height: 1.25rem; transform: rotate(-90deg); }
.wide .detail .composer { width: min(36rem, calc(64vw - 3rem)); }

/* ---------- payments ---------- */

.pay-hero { display: flex; align-items: center; justify-content: center; gap: 1.25rem; margin: 0.75rem 0 0.5rem; }
.pay-person { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; font-weight: 600; min-width: 6rem; text-align: center; }
.pay-pick { position: relative; display: grid; }
.pay-pick select { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pay-arrow { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 0; background: var(--fill-2); color: var(--label-2); }
.pay-sentence { text-align: center; color: var(--label-2); margin: 0 0 1rem; }
.amount-card { display: flex; align-items: center; justify-content: center; gap: 0.25rem; }
.amount-card .cur { font: 600 1.75rem/1 var(--font-rounded); color: var(--label-2); }
.amount-card .amount-input { flex: 0 1 12rem; text-align: center; }
.amount-input.big { font-size: 2.75rem; }

/* ---------- sync ---------- */

.invite-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.5rem; margin: 0.5rem 0 1.25rem; }
.invite-head h2 { margin: 0.25rem 0 0; font: 700 1.375rem/1.2 var(--font-display); letter-spacing: -0.015em; }
.invite-head p { margin: 0; color: var(--label-2); line-height: 1.45; max-width: 28rem; }
.qr-card { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; margin: 0 0 1.25rem; }
.qr { width: min(16rem, 70vw); aspect-ratio: 1; background: #fff; border-radius: 1rem; padding: 0.75rem; display: grid; place-items: center; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12); }
.qr svg { width: 100%; height: 100%; }
.qr.empty-qr { background: var(--cell); aspect-ratio: auto; padding: 1rem; }
.spinner { width: 1.75rem; height: 1.75rem; border-radius: 50%; border: 3px solid rgba(0, 0, 0, 0.1); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.paste-box { width: 100%; border: 0; background: none; outline: none; resize: none; font: 0.9375rem/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.camera video { width: 100%; border-radius: 1rem; margin-bottom: 1rem; }
.step { margin: 0 0.25rem 0.875rem; color: var(--label-2); font-size: 0.9375rem; line-height: 1.4; }
.status-line { text-align: center; color: var(--label-2); }
.live-dot { position: relative; }
.live-dot::after { content: ""; position: absolute; right: -0.25rem; top: -0.25rem; width: 0.875rem; height: 0.875rem; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--bg); }
.remind-text { width: 100%; border: 0; background: none; outline: none; resize: vertical; line-height: 1.45; font-size: 1rem; }
.progress { width: min(18rem, 80%); height: 0.375rem; border-radius: 999px; background: var(--fill-2); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width 0.3s ease; }
.scan-preview { max-height: 12rem; border-radius: 0.75rem; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15); }

/* ---------- about ---------- */

.about-card { display: flex; gap: 0.875rem; align-items: flex-start; }
.about-emoji { font-size: 1.75rem; line-height: 1.2; }
.about-card h3 { margin: 0 0 0.25rem; font: 600 1.0625rem/1.3 var(--font); }
.about-card p { margin: 0; color: var(--label-2); line-height: 1.45; font-size: 0.9375rem; }

/* ---------- activity ---------- */

.act-cell { align-items: flex-start; }
.act-cell .cell-leading { padding-top: 0.125rem; }
.act-cell.unread { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.unread-dot { flex: none; width: 0.5625rem; height: 0.5625rem; border-radius: 50%; background: var(--accent); margin-top: 0.4rem; }
.friend-cell { align-items: flex-start; }
.friend-cell .cell-trailing { padding-top: 0.25rem; }
.profile-cell { padding-top: 0.875rem; padding-bottom: 0.875rem; }

/* ---------- menus, action sheets, toasts ---------- */

.menu-scrim { position: fixed; inset: 0; z-index: 70; }
.menu {
  position: fixed; z-index: 71; min-width: 15rem; max-width: calc(100vw - 1rem); padding: 0.25rem 0; border-radius: 0.875rem;
  background: var(--material-thick); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.22), 0 0 0 0.5px var(--separator);
  transform: scale(0.4); opacity: 0; transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.18s ease;
}
.menu.open { transform: none; opacity: 1; }
.menu-title { padding: 0.5rem 1rem; font-size: 0.8125rem; color: var(--label-2); }
.menu-item { display: flex; align-items: center; gap: 0.5rem; width: 100%; height: 2.75rem; padding: 0 1rem 0 0.75rem; border: 0; background: none; text-align: left; font-size: 1.0625rem; }
.menu-item + .menu-item { box-shadow: inset 0 0.5px 0 var(--separator); }
.menu-item.is-pressed { background: var(--press); }
.menu-item.destructive { color: var(--red-text); }
.menu-check { width: 1rem; color: var(--accent); font-weight: 700; }

.action-sheet-layer { position: fixed; inset: 0; z-index: 80; }
.action-sheet-layer .scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.36); opacity: 0; transition: opacity 0.25s ease; }
.action-sheet-layer.open .scrim { opacity: 1; }
.action-sheet {
  position: absolute; left: 0.5rem; right: 0.5rem; bottom: calc(var(--safe-bottom) + 0.5rem); max-width: 30rem; margin: 0 auto;
  display: flex; flex-direction: column; gap: 0.5rem; transform: translateY(110%); transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.action-sheet-layer.open .action-sheet { transform: none; }
.as-group, .as-cancel { border-radius: 0.875rem; overflow: hidden; background: var(--material-thick); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); }
.as-head { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.875rem 1rem; text-align: center; font-size: 0.8125rem; color: var(--label-2); border-bottom: 0.5px solid var(--separator); }
.as-head strong { font-weight: 600; color: var(--label-2); }
.as-btn { display: block; width: 100%; height: 3.5rem; border: 0; background: none; font-size: 1.25rem; color: var(--accent); }
.as-btn.destructive { color: var(--red-text); }
.as-cancel { height: 3.5rem; font-weight: 600; }
.as-btn.is-pressed { background: var(--press); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 5rem); z-index: 90; translate: -50% 0;
  display: flex; align-items: center; gap: 0.875rem; max-width: calc(100vw - 2rem); padding: 0.75rem 0.75rem 0.75rem 1.125rem; border-radius: 999px;
  background: rgba(30, 30, 32, 0.9); color: #fff; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); font-size: 0.9375rem; font-weight: 500;
  opacity: 0; transform: translateY(1rem) scale(0.96); pointer-events: none;
  transition: opacity 0.22s ease, transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.toast-action { border: 0; background: rgba(255, 255, 255, 0.18); color: #fff; height: 2rem; padding: 0 0.875rem; border-radius: 999px; font-weight: 600; font-size: 0.9375rem; }
.toast-error { background: rgba(160, 30, 24, 0.94); }
.toast > span { padding-right: 0.375rem; }

/* ---------- onboarding & lock ---------- */

#app.onboarding { display: block; }
.welcome-page .navbar { display: none; }
.welcome-page .scroller { padding-top: calc(var(--safe-top) + 2rem); padding-bottom: calc(var(--safe-bottom) + 2rem); }
.welcome { max-width: 30rem; margin: 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; }
.app-icon {
  width: 5.5rem; height: 5.5rem; border-radius: 1.375rem; display: grid; place-items: center;
  background: linear-gradient(150deg, #8e8cf0, #5856d6 55%, #3d3bb8); box-shadow: 0 12px 30px rgba(88, 86, 214, 0.35);
  color: #fff; font: 700 3.5rem/1 var(--font-rounded);
}
.app-icon span { transform: translateY(-0.125rem); }
.welcome-title { margin: 1rem 0 0.25rem; font: 800 2.5rem/1.1 var(--font-display); letter-spacing: -0.025em; }
.welcome-sub { margin: 0 0 1.75rem; color: var(--label-2); font-size: 1.0625rem; line-height: 1.45; }
.welcome-points { list-style: none; padding: 0; margin: 0 0 1.75rem; display: flex; flex-direction: column; gap: 1rem; text-align: left; width: 100%; }
.welcome-points li { display: flex; gap: 0.875rem; align-items: flex-start; }
.welcome-points .sq { width: 2.25rem; height: 2.25rem; border-radius: 0.625rem; }
.welcome-points span:last-child { color: var(--label-2); font-size: 0.9375rem; line-height: 1.4; }
.welcome-points strong { display: block; color: var(--label); font-size: 1rem; font-weight: 600; }
.welcome .list { width: 100%; text-align: left; }
.welcome .btn-plain { margin-top: 0.5rem; }

.lock-layer {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
  background: var(--material-thick); -webkit-backdrop-filter: blur(40px) saturate(160%); backdrop-filter: blur(40px) saturate(160%);
  transition: opacity 0.3s ease;
}
.lock-layer h2 { margin: 0 0 0.5rem; font: 600 1.25rem/1.2 var(--font-display); }
.lock-layer.out { opacity: 0; }
.fatal { padding: 3rem 1.5rem; text-align: center; }

/* ---------- tablet split view tweaks ---------- */

.wide .sidebar .content { padding: 0 0.875rem; }
.wide .sidebar .accessory .capsule.primary span { display: none; }
.wide .sidebar .accessory .capsule.primary { width: 3.25rem; padding: 0; }
.wide .sidebar .group-card[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--accent); }

/* ---------- accessibility preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .seg-thumb, .switch .thumb, .menu, .action-sheet, .toast, .bar, .hb-fill, [class*="stroke-"] { transition-property: opacity !important; transition-duration: 0.15s !important; }
  .menu { transform: none; }
  .action-sheet { transform: none; opacity: 0; transition: opacity 0.2s !important; }
  .action-sheet-layer.open .action-sheet { opacity: 1; }
  .toast { transform: none; }
  .btn.is-pressed, .chip.is-pressed, .capsule.is-pressed, .group-card.is-pressed { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --material: var(--cell); --material-thick: var(--cell); }
  .glass, .tabbar, .page.scrolled > .navbar, .menu, .as-group, .as-cancel, .lock-layer, .toast { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}
@media (prefers-contrast: more) {
  :root { --separator: rgba(60, 60, 67, 0.6); --label-2: rgba(60, 60, 67, 0.85); --material: var(--cell); }
  .tabbar, .page.scrolled > .navbar { box-shadow: 0 0 0 1px var(--label-2); }
  .chip, .group-card, .list { box-shadow: 0 0 0 1px var(--separator); }
}
@supports not (backdrop-filter: blur(1px)) {
  :root { --material: var(--cell); }
}
