/* Settld 0.4 design system.
 *
 * Type carries the interface. Lists are hairline-separated rows sitting on the
 * page surface rather than stacked cards, so the amount is always the loudest
 * thing on screen. Dark and light are both designed, not inverted. The accent
 * is a token the user picks; it only ever means "action or selection", so
 * changing it never changes what a number means.
 */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- tokens ---------- */

:root {
  /* accent defaults to coral; [data-accent] blocks below swap the triple */
  --a-fill: oklch(0.72 0.185 31);
  --a-text: oklch(0.78 0.16 31);
  --a-ink: oklch(0.15 0.01 260);

  --bg: oklch(0.135 0.006 255);
  --bg-2: oklch(0.175 0.007 255);
  --raised: oklch(0.215 0.008 255);
  --line: oklch(0.255 0.008 255);
  --line-2: oklch(0.33 0.01 255);
  --text: oklch(0.965 0.011 85);
  --text-2: oklch(0.685 0.013 255);
  --text-3: oklch(0.53 0.012 255);

  --pos: oklch(0.82 0.17 156);
  --debt: var(--text);
  --danger: oklch(0.72 0.18 22);
  --warning: oklch(0.82 0.15 80);

  --accent: var(--a-fill);
  --accent-text: var(--a-text);
  --accent-ink: var(--a-ink);
  --accent-soft: color-mix(in oklab, var(--a-fill) 17%, var(--bg));
  --glass-bg: color-mix(in oklab, var(--bg-2) 72%, transparent);
  --glass-line: color-mix(in oklab, var(--text) 12%, transparent);
  --scrim: color-mix(in oklab, oklch(0.06 0.004 255) 74%, transparent);
  --shadow: 0 20px 60px color-mix(in oklab, oklch(0.05 0 0) 72%, transparent);
  --shadow-soft: 0 8px 26px color-mix(in oklab, oklch(0.05 0 0) 48%, transparent);
  --control-border: oklch(0.54 0.01 255);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --gutter: 20px;
  /* dock is 68px tall and floats 14px above the safe area; the extra 26px
     keeps the last row of any screen clear of it */
  --dock-h: 108px;

  --chart-1: var(--a-fill);
  --chart-2: var(--pos);
  --chart-3: oklch(0.8 0.15 80);
  --chart-4: oklch(0.72 0.13 238);
  --chart-5: oklch(0.7 0.15 320);
  --chart-6: oklch(0.75 0.11 195);

  color-scheme: dark;
}

:root[data-theme="light"] {
  --a-fill: oklch(0.58 0.17 31);
  --a-text: oklch(0.5 0.17 31);
  --a-ink: oklch(0.99 0.006 85);

  --bg: oklch(0.965 0.008 85);
  --bg-2: oklch(0.995 0.004 85);
  --raised: oklch(0.925 0.011 85);
  --line: oklch(0.865 0.012 85);
  --line-2: oklch(0.77 0.014 85);
  --text: oklch(0.235 0.014 65);
  --text-2: oklch(0.48 0.014 65);
  --text-3: oklch(0.585 0.013 65);

  --pos: oklch(0.47 0.14 156);
  --debt: oklch(0.31 0.014 65);
  --danger: oklch(0.5 0.19 25);
  --warning: oklch(0.53 0.13 72);

  --accent-soft: color-mix(in oklab, var(--a-fill) 13%, var(--bg));
  --glass-bg: color-mix(in oklab, var(--bg-2) 80%, transparent);
  --glass-line: color-mix(in oklab, var(--text) 14%, transparent);
  --scrim: color-mix(in oklab, oklch(0.28 0.01 65) 42%, transparent);
  --shadow: 0 20px 56px color-mix(in oklab, oklch(0.3 0.02 65) 20%, transparent);
  --shadow-soft: 0 8px 24px color-mix(in oklab, oklch(0.3 0.02 65) 13%, transparent);
  --control-border: oklch(0.6 0.012 65);

  color-scheme: light;
}

/* Accent choices. Fill lightness is tuned per theme so the ink on top always
   clears AA, and -text is the on-background variant used for status copy. */
:root[data-accent="amber"] {
  --a-fill: oklch(0.81 0.155 76);
  --a-text: oklch(0.85 0.14 76);
}

:root[data-theme="light"][data-accent="amber"] {
  --a-fill: oklch(0.57 0.13 66);
  --a-text: oklch(0.49 0.12 66);
}

:root[data-accent="mint"] {
  --a-fill: oklch(0.8 0.15 165);
  --a-text: oklch(0.84 0.13 165);
}

:root[data-theme="light"][data-accent="mint"] {
  --a-fill: oklch(0.52 0.12 165);
  --a-text: oklch(0.44 0.11 165);
}

:root[data-accent="azure"] {
  --a-fill: oklch(0.74 0.14 240);
  --a-text: oklch(0.8 0.13 240);
}

:root[data-theme="light"][data-accent="azure"] {
  --a-fill: oklch(0.54 0.15 250);
  --a-text: oklch(0.47 0.14 250);
}

:root[data-accent="violet"] {
  --a-fill: oklch(0.7 0.17 300);
  --a-text: oklch(0.78 0.15 300);
}

:root[data-theme="light"][data-accent="violet"] {
  --a-fill: oklch(0.51 0.19 300);
  --a-text: oklch(0.45 0.18 300);
}

:root[data-accent="rose"] {
  --a-fill: oklch(0.72 0.18 358);
  --a-text: oklch(0.79 0.16 358);
}

:root[data-theme="light"][data-accent="rose"] {
  --a-fill: oklch(0.55 0.19 3);
  --a-text: oklch(0.48 0.18 3);
}

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

html {
  min-width: 280px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  display: block;
  flex-shrink: 0;
}

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 12px;
  z-index: 99;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
  transition: top 0.18s var(--ease);
}

.skip-link:focus {
  top: calc(var(--safe-t) + 12px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 62px) var(--gutter) calc(var(--dock-h) + var(--safe-b));
}

/* ---------- money and meaning ---------- */

.money {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.012em;
}

.pos {
  color: var(--pos);
}

.debt {
  color: var(--debt);
}

.neg,
.danger-text {
  color: var(--danger);
}

.dim {
  color: var(--text-2);
}

/* ---------- press feedback ---------- */

.pressable,
.btn,
.icon-btn,
.chip,
.swatch {
  transition: transform 0.16s var(--ease), background 0.16s var(--ease), color 0.16s var(--ease),
    border-color 0.16s var(--ease), box-shadow 0.16s var(--ease), opacity 0.16s var(--ease);
}

.pressable:active,
.btn:active,
.icon-btn:active,
.chip:active,
.swatch:active {
  transform: scale(0.982);
}

/* ---------- brand mark ---------- */

.brand-mark {
  width: 100%;
  height: 100%;
}

.brand-glyph {
  fill: var(--accent);
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
}

.brand-symbol {
  width: 24px;
  height: 24px;
}

.brand-name {
  font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.022em;
}

.device-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 550;
}

.device-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
}

.device-status.synced i {
  background: var(--pos);
}

.device-status.offline i {
  background: var(--warning);
}

/* ---------- app bar ---------- */

#appbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  padding-top: var(--safe-t);
  pointer-events: none;
}

#appbar .veil {
  position: absolute;
  inset: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--glass-line);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

#appbar .bar {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 4px;
  max-width: 720px;
  height: 58px;
  margin: 0 auto;
  padding: 0 calc(var(--gutter) - 8px);
}

#appbar .bar-title {
  min-width: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.018em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

#appbar.on .veil,
#appbar.on .bar-title {
  opacity: 1;
}

#bar-left,
#bar-right {
  display: flex;
  align-items: center;
  gap: 2px;
  pointer-events: auto;
}

#bar-right {
  justify-content: flex-end;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: var(--text);
}

.icon-btn:hover {
  background: var(--raised);
}

.icon-btn svg {
  width: 23px;
  height: 23px;
}

/* ---------- page headers ---------- */

.display {
  padding: 6px 0 2px;
}

.display h1 {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.036em;
}

.display .sub {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 500;
}

.display .sub b {
  color: var(--text);
  font-weight: 650;
}

.section-cap {
  margin: 30px 0 8px;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 28px 0 2px;
  text-align: left;
}

.section-heading h2 {
  font-size: 19px;
  font-weight: 680;
  letter-spacing: -0.024em;
}

.section-heading .section-cap {
  margin: 3px 0 0;
}

.day {
  margin: 24px 0 0;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- hairline rows ---------- */

.list {
  display: flex;
  flex-direction: column;
}

.list.ruled {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.row {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 62px;
  padding: 11px 0;
  color: inherit;
  text-align: left;
}

.list .row + .row,
.list .trail-row + .trail-row,
.list .settle-row + .settle-row {
  border-top: 1px solid var(--line);
}

button.row:hover,
a.row:hover {
  background: color-mix(in oklab, var(--raised) 55%, transparent);
  box-shadow: 0 0 0 10px color-mix(in oklab, var(--raised) 55%, transparent);
  border-radius: 3px;
}

.row .grow {
  flex: 1;
  min-width: 0;
}

.row .ttl {
  display: block;
  overflow: hidden;
  font-size: 15.5px;
  font-weight: 620;
  letter-spacing: -0.014em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row .cap {
  display: block;
  margin-top: 2px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
}

.row .end {
  flex-shrink: 0;
  max-width: 44%;
  text-align: right;
}

.row .amt {
  display: block;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.016em;
}

.row .end .cap {
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 550;
}

.row .chev,
.chev {
  flex-shrink: 0;
  width: 18px;
  color: var(--text-3);
}

.row .chev svg,
.chev svg {
  width: 18px;
  height: 18px;
}

.tile {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--raised);
  font-size: 19px;
  line-height: 1;
}

.tile svg {
  width: 20px;
  height: 20px;
  color: var(--text-2);
}

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

.group-row .tile {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  font-size: 21px;
}

.balance-label {
  display: block;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 550;
}

/* ---------- big money block ---------- */

.money-block {
  margin-top: 24px;
}

.money-block .lbl {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 550;
}

.money-block .val {
  margin-top: 2px;
  font-size: 43px;
  font-weight: 700;
  letter-spacing: -0.042em;
  line-height: 1.02;
}

.money-block .note {
  margin-top: 7px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
}

/* ---------- group screen ---------- */

.group-title-line {
  display: flex;
  align-items: center;
  gap: 13px;
}

.group-emoji {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: var(--raised);
  font-size: 24px;
  line-height: 1;
}

.group-title-line h1 {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.034em;
  line-height: 1.1;
}

.group-people {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
}

.act-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.act-row .btn {
  flex: 1;
  min-width: 0;
}

.owe-list {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.owe-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 0;
  text-align: left;
}

.owe-row + .owe-row {
  border-top: 1px solid var(--line);
}

.owe-row .who {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owe-row .amt {
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.016em;
}

/* ---------- expense rows ---------- */

.ex-row {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 64px;
  padding: 11px 0;
  text-align: left;
}

.ex-list .ex-row + .ex-row {
  border-top: 1px solid var(--line);
}

button.ex-row:hover {
  background: color-mix(in oklab, var(--raised) 55%, transparent);
  box-shadow: 0 0 0 10px color-mix(in oklab, var(--raised) 55%, transparent);
  border-radius: 3px;
}

.ex-row .ico {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 30px;
  height: 30px;
  font-size: 20px;
  line-height: 1;
}

.ex-row .m {
  flex: 1;
  min-width: 0;
}

.ex-row .m b {
  display: block;
  overflow: hidden;
  font-size: 15.5px;
  font-weight: 620;
  letter-spacing: -0.016em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ex-row .m span {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
  overflow: hidden;
  color: var(--text-2);
  font-size: 12.8px;
  font-weight: 500;
  white-space: nowrap;
}

.ex-row .e {
  flex-shrink: 0;
  max-width: 42%;
  text-align: right;
}

.ex-row .e b {
  display: block;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ex-row .e span {
  display: block;
  margin-top: 2px;
  color: var(--text-2);
  font-size: 12.3px;
  font-weight: 550;
}

.proof-dot {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  color: var(--text-3);
}

.proof-dot svg {
  width: 12px;
  height: 12px;
}

/* ---------- badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 21px;
  padding: 0 7px;
  border-radius: 7px;
  background: var(--raised);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.badge svg {
  width: 11px;
  height: 11px;
}

.badge.ok {
  color: var(--pos);
}

.badge.edited {
  color: var(--warning);
}

/* ---------- avatars ---------- */

.avatar {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: oklch(0.98 0.008 85);
  font-size: 14px;
  font-weight: 700;
}

.avatar.sm {
  width: 26px;
  height: 26px;
  font-size: 10.5px;
}

.avatar-stack,
.avatar-pair {
  display: inline-flex;
  align-items: center;
}

.avatar-stack .avatar + .avatar,
.avatar-pair .avatar + .avatar {
  margin-left: -8px;
  box-shadow: 0 0 0 2px var(--bg);
}

.avatar-more {
  background: var(--raised);
  color: var(--text-2);
}

/* ---------- chips ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 580;
}

.chip:hover {
  border-color: var(--control-border);
}

.chip.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 650;
}

.member-tag {
  padding-right: 6px;
}

.chip-remove {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: var(--text-2);
}

.chip-remove:hover {
  background: var(--raised);
  color: var(--text);
}

.chip-remove svg {
  width: 15px;
  height: 15px;
}

.payer-multi-toggle {
  margin-top: 10px;
  color: var(--accent-text);
  font-size: 13.5px;
  font-weight: 600;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 15px;
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -0.012em;
}

.btn svg {
  width: 19px;
  height: 19px;
}

.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn.primary:hover {
  background: color-mix(in oklab, var(--accent) 88%, var(--text));
}

.btn.secondary {
  background: var(--raised);
  color: var(--text);
}

.btn.secondary:hover {
  background: color-mix(in oklab, var(--raised) 84%, var(--text));
}

.btn.ghost {
  box-shadow: inset 0 0 0 1.5px var(--line-2);
  color: var(--text);
}

.btn.ghost:hover {
  box-shadow: inset 0 0 0 1.5px var(--control-border);
}

.btn.quiet {
  color: var(--text-2);
}

.btn.quiet:hover {
  background: var(--raised);
  color: var(--text);
}

.btn.danger {
  color: var(--danger);
}

.btn.danger:hover {
  background: color-mix(in oklab, var(--danger) 13%, transparent);
}

.btn.small {
  width: auto;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 13px;
  font-size: 14px;
}

.btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

.btn-row {
  display: flex;
  gap: 10px;
}

.btn-row .btn {
  flex: 1;
}

.made-by {
  display: inline-block;
  margin-top: 16px;
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 550;
}

.made-by:hover {
  color: var(--accent-text);
}

/* ---------- segmented control ---------- */

.seg {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 4px;
  border-radius: 15px;
  background: var(--raised);
  scrollbar-width: none;
}

.seg::-webkit-scrollbar {
  display: none;
}

.seg button {
  flex: 1;
  min-width: fit-content;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 11px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 580;
  white-space: nowrap;
}

.seg button:hover {
  color: var(--text);
}

.seg button.on {
  background: var(--bg);
  color: var(--text);
  font-weight: 650;
}

/* ---------- accent swatches ---------- */

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

/* Swatches preview the fill this accent actually produces in the current
   theme, so what you tap is what you get. */
.swatch {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: var(--sw);
  color: var(--a-ink);
}

.swatch[data-a="coral"] {
  --sw: oklch(0.72 0.185 31);
}
.swatch[data-a="amber"] {
  --sw: oklch(0.81 0.155 76);
}
.swatch[data-a="mint"] {
  --sw: oklch(0.8 0.15 165);
}
.swatch[data-a="azure"] {
  --sw: oklch(0.74 0.14 240);
}
.swatch[data-a="violet"] {
  --sw: oklch(0.7 0.17 300);
}
.swatch[data-a="rose"] {
  --sw: oklch(0.72 0.18 358);
}

:root[data-theme="light"] .swatch[data-a="coral"] {
  --sw: oklch(0.58 0.17 31);
}
:root[data-theme="light"] .swatch[data-a="amber"] {
  --sw: oklch(0.57 0.13 66);
}
:root[data-theme="light"] .swatch[data-a="mint"] {
  --sw: oklch(0.52 0.12 165);
}
:root[data-theme="light"] .swatch[data-a="azure"] {
  --sw: oklch(0.54 0.15 250);
}
:root[data-theme="light"] .swatch[data-a="violet"] {
  --sw: oklch(0.51 0.19 300);
}
:root[data-theme="light"] .swatch[data-a="rose"] {
  --sw: oklch(0.55 0.19 3);
}

.swatch svg {
  width: 20px;
  height: 20px;
  opacity: 0;
  transition: opacity 0.14s var(--ease);
}

.swatch.on {
  box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 5px var(--sw);
}

.swatch.on svg {
  opacity: 1;
}

/* ---------- inputs ---------- */

.cap-label {
  display: block;
  margin: 22px 0 8px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}

.in {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 1.5px solid var(--control-border);
  border-radius: 15px;
  background: var(--bg-2);
  color: var(--text);
  font-size: 16px;
  font-weight: 520;
}

.in:hover {
  border-color: var(--line-2);
}

.in:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.in::placeholder {
  color: var(--text-3);
}

.hint {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
}

.hint.bad {
  color: var(--warning);
}

.hint.good {
  color: var(--pos);
}

/* Left-aligned so the caret never jumps as digits are typed, and so the entry
   amount sits on the same axis as every other amount in the app. */
.amount-shell {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 10px 0 2px;
  font-size: 46px;
  font-weight: 700;
  letter-spacing: -0.042em;
}

.amount-in {
  width: 100%;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 46px;
  font-weight: 700;
  letter-spacing: -0.042em;
  outline: none;
}

.amount-in::placeholder {
  color: var(--text-3);
}

.expense-desc {
  margin-top: 6px;
}

/* ---------- disclosure ---------- */

.expense-more {
  margin-top: 24px;
  border-top: 1px solid var(--line);
}

.expense-more summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  cursor: pointer;
  list-style: none;
}

.expense-more summary::-webkit-details-marker {
  display: none;
}

.expense-more summary > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.expense-more summary strong {
  display: block;
  font-size: 15px;
  font-weight: 620;
}

.expense-more summary small {
  display: block;
  margin-top: 2px;
  color: var(--text-2);
  font-size: 12.8px;
}

.summary-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--raised);
  color: var(--text-2);
}

.summary-icon svg,
.summary-chev svg {
  width: 18px;
  height: 18px;
}

.summary-chev {
  color: var(--text-3);
  transition: transform 0.2s var(--ease);
}

.expense-more[open] .summary-chev {
  transform: rotate(90deg);
}

.expense-more-body {
  padding-bottom: 8px;
}

.proof-add-copy {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 12px;
  color: var(--text-2);
}

.proof-add-copy > svg {
  width: 19px;
  height: 19px;
  margin-top: 2px;
}

.proof-add-copy strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 620;
}

.proof-add-copy small {
  display: block;
  margin-top: 1px;
  font-size: 12.5px;
}

.split-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.split-row .nm {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.split-row .in {
  width: 108px;
  min-height: 48px;
  flex-shrink: 0;
  border-radius: 13px;
  text-align: right;
}

.split-row .unit {
  width: 40px;
  flex-shrink: 0;
  color: var(--text-2);
  font-size: 13px;
}

/* ---------- dock ---------- */

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid var(--glass-line);
}

#dock {
  position: fixed;
  bottom: calc(var(--safe-b) + 14px);
  left: 50%;
  z-index: 45;
  display: flex;
  gap: 2px;
  width: min(430px, calc(100% - 32px));
  padding: 6px;
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  transform: translateX(-50%);
  transition: transform 0.26s var(--ease), opacity 0.2s var(--ease);
}

#dock.off {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 140%);
}

#dock a {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 56px;
  border-radius: 18px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 620;
}

#dock a svg {
  width: 22px;
  height: 22px;
}

#dock a:hover {
  color: var(--text-2);
}

#dock a.on {
  background: var(--accent-soft);
  color: var(--accent-text);
}

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

.sheetwrap {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  animation: fade 0.22s var(--ease);
}

.sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: calc(100dvh - 12px);
  padding: 0 var(--gutter) calc(var(--safe-b) + 18px);
  border-radius: 26px 26px 0 0;
  background: var(--bg);
  box-shadow: var(--shadow);
  animation: sheet-up 0.28s var(--ease);
}

.sheet:focus {
  outline: none;
}

.sheetwrap.out .sheet {
  animation: sheet-down 0.22s var(--ease) forwards;
}

.sheetwrap.out .scrim {
  animation: fade-out 0.22s var(--ease) forwards;
}

.grab {
  width: 38px;
  height: 4px;
  flex-shrink: 0;
  margin: 10px auto 2px;
  border-radius: 3px;
  background: var(--line-2);
}

.shead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  padding: 8px 0 4px;
}

.shead h2 {
  min-width: 0;
  overflow: hidden;
  font-size: 20px;
  font-weight: 680;
  letter-spacing: -0.026em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shead .icon-btn {
  margin-right: -10px;
}

.sbody {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 8px;
  overscroll-behavior: contain;
}

.sfoot {
  flex-shrink: 0;
  padding-top: 14px;
}

/* ---------- empty states ---------- */

.empty {
  padding: 40px 0;
  text-align: center;
}

.empty.compact {
  padding: 24px 0;
}

.empty .mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  padding: 14px;
  border-radius: 20px;
  background: var(--accent-soft);
}

.empty h3 {
  font-size: 19px;
  font-weight: 680;
  letter-spacing: -0.024em;
}

.empty p {
  max-width: 42ch;
  margin: 8px auto 0;
  color: var(--text-2);
  font-size: 14.5px;
}

.empty .btn {
  max-width: 340px;
  margin: 20px auto 0;
}

.empty .btn + .btn {
  margin-top: 10px;
}

/* ---------- welcome ---------- */

.welcome-hero {
  padding: 20px 0 6px;
}

.welcome-hero.compact {
  padding-bottom: 0;
}

.welcome-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.welcome-lockup .mark {
  width: 30px;
  height: 30px;
}

.welcome-lockup strong {
  font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.026em;
}

.welcome-hero h2 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.038em;
  line-height: 1.1;
}

.welcome-hero p {
  margin-top: 10px;
  color: var(--text-2);
  font-size: 15px;
}

.trust-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 18px;
}

.trust-points span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 550;
}

.trust-points svg {
  width: 16px;
  height: 16px;
  color: var(--accent-text);
}

.au-slot {
  margin-top: 22px;
}

.au-skip {
  margin-top: 10px;
}

/* ---------- proof thumbnails ---------- */

.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.thumb,
.thumb-add,
.thumb-button {
  width: 76px;
  height: 92px;
  border-radius: 14px;
}

.thumb {
  background: var(--raised);
  object-fit: cover;
}

.thumb-button {
  overflow: hidden;
  padding: 0;
}

.thumb-add {
  display: grid;
  place-items: center;
  border: 1.5px dashed var(--line-2);
  color: var(--text-2);
}

.thumb-add:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

.thumb-add svg {
  width: 22px;
  height: 22px;
}

.proof-gallery .thumb,
.proof-gallery .thumb-button {
  width: 96px;
  height: 116px;
}

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

.expense-hero {
  padding: 6px 0 18px;
  border-bottom: 1px solid var(--line);
}

.expense-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 550;
}

.expense-hero .val {
  margin-top: 8px;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.expense-hero .note {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 14px;
}

.expense-hero blockquote {
  margin-top: 12px;
  padding-left: 13px;
  border-left: 2px solid var(--line-2);
  color: var(--text-2);
  font-size: 14px;
  font-style: italic;
}

.proof-status {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 16px;
  color: var(--text-2);
}

.proof-status > svg {
  width: 19px;
  height: 19px;
}

.proof-status > span {
  flex: 1;
  min-width: 0;
}

.proof-status strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 620;
}

.proof-status small {
  display: block;
  margin-top: 1px;
  font-size: 12.5px;
}

.proof-status.has-proof > svg {
  color: var(--pos);
}

/* ---------- trail ---------- */

.trail-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 4px 0 16px;
  color: var(--text-2);
}

.trail-note > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 10px;
  background: color-mix(in oklab, var(--pos) 16%, transparent);
  color: var(--pos);
}

.trail-note svg {
  width: 16px;
  height: 16px;
}

.trail-note strong {
  display: block;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 620;
}

.trail-note p {
  margin-top: 3px;
  font-size: 13px;
}

.trail-row {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 13px 0;
}

.trail-dot {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 11px;
  background: var(--raised);
  color: var(--text-2);
}

.trail-dot svg {
  width: 15px;
  height: 15px;
}

.trail-dot.settle {
  color: var(--pos);
}

.trail-dot.delete {
  color: var(--danger);
}

.trail-txt {
  flex: 1;
  min-width: 0;
  font-size: 14.5px;
  font-weight: 550;
  line-height: 1.42;
}

.trail-txt .cap {
  display: block;
  margin-top: 3px;
  color: var(--text-3);
  font-size: 12.3px;
  font-weight: 500;
}

/* ---------- trip summary ---------- */

.summary-chart-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 8px 0 4px;
}

.spend-donut {
  position: relative;
  display: grid;
  place-items: center;
  width: 126px;
  height: 126px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--chart);
}

.spend-donut::before {
  content: "";
  position: absolute;
  inset: 26px;
  border-radius: 50%;
  background: var(--bg);
}

.spend-donut > div {
  position: relative;
  text-align: center;
}

.spend-donut span,
.spend-donut small {
  display: block;
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 600;
}

.spend-donut strong {
  display: block;
  margin: 1px 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.022em;
}

.summary-legend {
  flex: 1;
  min-width: 0;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
  font-size: 13px;
  font-weight: 550;
}

.legend-row i {
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  border-radius: 3px;
}

.legend-row span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-row strong {
  font-weight: 700;
}

.summary-metrics {
  display: flex;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.summary-metrics > div {
  flex: 1;
  min-width: 0;
  padding: 14px 0;
}

.summary-metrics > div + div {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.summary-metrics span {
  display: block;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 550;
}

.summary-metrics strong {
  display: block;
  margin-top: 3px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.022em;
}

.summary-note {
  margin-top: 14px;
  color: var(--text-2);
  font-size: 13px;
}

/* ---------- settle rows ---------- */

.settle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 66px;
  padding: 12px 0;
}

.settle-row .grow {
  flex: 1;
  min-width: 0;
}

.settle-row .ttl {
  display: block;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settle-row .cap {
  display: block;
  margin-top: 2px;
  color: var(--text-2);
  font-size: 12.5px;
}

.settle-row .amt {
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.016em;
}

.settle-row .btn {
  flex-shrink: 0;
}

/* ---------- invite and membership ---------- */

.invite-code {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 62px;
  margin-top: 4px;
  padding: 12px 16px;
  border: 1.5px dashed var(--line-2);
  border-radius: 15px;
  background: var(--bg-2);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
  text-align: center;
}

.member-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 550;
}

.member-state svg {
  width: 13px;
  height: 13px;
}

.member-state.joined {
  color: var(--pos);
}

/* ---------- toast ---------- */

#toast {
  position: fixed;
  bottom: calc(var(--safe-b) + var(--dock-h) + 16px);
  left: 50%;
  z-index: 70;
  max-width: min(420px, calc(100% - 40px));
  padding: 13px 20px;
  border-radius: 15px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- proof viewer ---------- */

.proof-viewer {
  display: grid;
  place-items: center;
  padding: 8px 0;
}

.proof-viewer img {
  max-height: 62vh;
  border-radius: 16px;
  object-fit: contain;
}

/* ---------- motion ---------- */

.enter {
  animation: rise 0.2s var(--ease);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes fade-out {
  to {
    opacity: 0;
  }
}

@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
}

@keyframes sheet-down {
  to {
    transform: translateY(100%);
  }
}

/* ---------- responsive ---------- */

@media (max-width: 400px) {
  :root {
    --gutter: 16px;
  }

  .display h1 {
    font-size: 30px;
  }

  .money-block .val {
    font-size: 37px;
  }

  .group-title-line h1 {
    font-size: 24px;
  }

  .settle-row {
    flex-wrap: wrap;
  }

  .settle-row .btn {
    width: 100%;
    margin-left: 46px;
  }
}

/* Only genuinely narrow phones need the two group actions stacked; at 390px
   they sit side by side comfortably. */
@media (max-width: 340px) {
  :root {
    --gutter: 13px;
  }

  .act-row {
    flex-direction: column;
  }

  .row .ttl,
  .ex-row .m b {
    font-size: 14.5px;
  }

  .row .amt,
  .ex-row .e b {
    font-size: 14px;
  }
}

@media (min-width: 760px) {
  :root {
    --gutter: 32px;
    --dock-h: 100px;
  }

  .display h1 {
    font-size: 38px;
  }

  .sheetwrap {
    align-items: center;
    padding: 24px;
  }

  .sheet {
    max-height: min(860px, calc(100dvh - 48px));
    border-radius: 26px;
  }

  .sheetwrap.out .sheet {
    animation-name: fade-out;
  }
}

/* Touch browsers leave :hover applied after a tap, which strands a row looking
   selected. Where there is no real pointer, hold every hover affordance at its
   resting value. */
@media (hover: none) {
  button.row:hover,
  a.row:hover,
  button.ex-row:hover {
    background: none;
    box-shadow: none;
  }

  .icon-btn:hover,
  .chip-remove:hover,
  .btn.quiet:hover,
  .btn.danger:hover {
    background: none;
  }

  .btn.primary:hover {
    background: var(--accent);
  }

  .btn.secondary:hover {
    background: var(--raised);
  }

  .btn.ghost:hover {
    box-shadow: inset 0 0 0 1.5px var(--line-2);
  }

  .chip:hover,
  .in:hover {
    border-color: var(--line-2);
  }

  .chip.on:hover {
    border-color: var(--accent);
  }

  .thumb-add:hover {
    border-color: var(--line-2);
    color: var(--text-2);
  }

  #dock a:hover {
    color: var(--text-3);
  }

  #dock a.on:hover {
    color: var(--accent-text);
  }

  .seg button:hover {
    color: var(--text-2);
  }

  .seg button.on:hover {
    color: var(--text);
  }

  .made-by:hover {
    color: var(--text-3);
  }
}

/* Reduced motion removes travel and scale but keeps state changes visible,
   so feedback never disappears entirely. */
@media (prefers-reduced-motion: reduce) {
  .enter,
  .scrim,
  .sheet,
  .sheetwrap.out .sheet {
    animation: none;
  }

  .pressable:active,
  .btn:active,
  .icon-btn:active,
  .chip:active,
  .swatch:active {
    transform: none;
  }

  #dock,
  .summary-chev,
  .skip-link {
    transition-duration: 0.01ms;
  }
}
