/* ============================================================
   Fetti Up — "Airy" design system (bright, social, Venmo/IG-fluent)
   ============================================================ */
:root {
  --bg: #F7F7FA;
  --surface: #FFFFFF;
  --surface-alt: #F1F1F6;
  --ink: #15151B;
  --muted: #8A8A99;
  --line: #ECECF2;
  --accent: #7C5CFC;
  --accent-to: #FF6B8B;
  --grad: linear-gradient(135deg, #7C5CFC 0%, #FF6B8B 100%);
  --ok: #1FB877;
  --ok-soft: #E6F7EF;
  --warn: #C26A12;
  --warn-soft: #FDF1E1;
  --venmo: #008CFF;

  --radius: 24px;
  --radius-md: 18px;
  --radius-sm: 13px;
  --pill: 999px;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow-card: 0 1px 2px rgba(21,21,27,.04), 0 8px 24px rgba(21,21,27,.06);
  --shadow-nav: 0 8px 32px rgba(21,21,27,.12);
  --shadow-fab: 0 6px 20px rgba(124,92,252,.42);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.app {
  max-width: 480px; margin: 0 auto; min-height: 100dvh;
  padding: max(env(safe-area-inset-top), 14px) 16px calc(104px + env(safe-area-inset-bottom));
}

/* ---------- type ---------- */
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.1rem; font-weight: 700; }
.muted { color: var(--muted); }
.tiny { font-size: .78rem; }
.center { text-align: center; }
.right { text-align: right; }
.flex { display: flex; align-items: center; gap: 10px; }
.spacer { height: 6px; }
hr.soft { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---------- top app bar ---------- */
.bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; min-height: 44px; }
.bar .grow { flex: 1; min-width: 0; }
.bar .title { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.bar .sub { font-size: .9rem; color: var(--muted); font-weight: 500; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand .logo {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: var(--grad); display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 1.1rem; box-shadow: var(--shadow-fab);
}
.brand .sub { font-size: .82rem; color: var(--muted); }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
  padding: 18px; margin-bottom: 14px;
}
.card h2 { margin-bottom: 4px; }
.section-hint { color: var(--muted); font-size: .85rem; margin: 0 0 14px; font-weight: 500; }
.fund-seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.fund-chip { border: 1px solid var(--line); border-radius: var(--pill); background: #fff; font: 700 .82rem var(--font); color: var(--muted); padding: 7px 13px; cursor: pointer; }
.fund-chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.fund-note { color: var(--muted); font-size: .82rem; margin: 8px 0 0; font-weight: 500; }
.fund-banner { background: var(--surface-alt); border-radius: 14px; padding: 11px 14px; font-size: .85rem; font-weight: 600; color: var(--ink); margin: 0 0 4px; }
.scan-hero { background: linear-gradient(135deg, #7C5CFC, #FF6B8B); color: #fff; text-align: center; }
.scan-hero-icon { font-size: 2rem; line-height: 1; }
.scan-hero h2 { color: #fff; margin: 8px 0 4px; }
.scan-hero-sub { color: rgba(255,255,255,.92); font-size: .9rem; font-weight: 500; margin: 0 0 14px; }
.scan-cta { background: #fff; color: var(--accent); font-weight: 800; width: 100%; }
.linkbtn { background: none; border: none; cursor: pointer; font: inherit; }
.scan-hero .scan-manual { display: block; margin: 12px auto 0; color: #fff; font: 700 .85rem var(--font); text-decoration: underline; opacity: .92; }
.tracker-entry { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; font-size: .9rem; }
.owed-hero { text-align: center; }
.owed-hero .big { font-size: 2rem; font-weight: 800; color: var(--ink); }
.owed-person { display: flex; align-items: center; gap: 12px; }
.owed-person .meta { flex: 1; min-width: 0; }
.owed-person .nm { font-weight: 700; color: var(--ink); }
.owed-person .dt { color: var(--muted); font-size: .78rem; margin-top: 2px; }
.owed-person .amt .big { font-weight: 800; color: var(--ink); }
.owed-person .btn.sm { flex-shrink: 0; }
.or-sep { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; }
.or-sep span { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- inputs ---------- */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: .72rem; color: var(--muted); margin-bottom: 6px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
input, select {
  width: 100%; font: 600 1rem var(--font); padding: 13px 15px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-alt); color: var(--ink); outline: none;
  transition: border-color .15s, background .15s;
}
input:focus, select:focus { border-color: var(--accent); background: #fff; }
input::placeholder { color: #b3b3c2; font-weight: 500; }
input[type="checkbox"] { width: 22px; height: 22px; flex: none; padding: 0; border-radius: 7px; accent-color: var(--accent); }
.row { display: flex; gap: 10px; }
.row > * { min-width: 0; }
.price-input { position: relative; }
.price-input input { padding-left: 27px; }
.price-input::before { content: "$"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }

/* tax & tip — linked %/$ rows */
.tt-line { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.tt-line:last-child { margin-bottom: 0; }
.tt-label { width: 34px; flex: none; font-weight: 800; color: var(--ink); font-size: .95rem; }
.tt-line .pct-input, .tt-line .price-input { flex: 1; min-width: 0; }
.tt-line input { width: 100%; }
.pct-input { position: relative; }
.pct-input input { padding-right: 26px; }
.pct-input::after { content: "%"; position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }

/* ---------- buttons ---------- */
button { font-family: inherit; cursor: pointer; border: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 1rem var(--font); height: 54px; padding: 0 22px; border-radius: var(--pill);
  background: var(--surface-alt); color: var(--ink); width: 100%;
  transition: transform .12s ease, filter .15s ease;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.venmo { background: var(--venmo); color: #fff; }
.btn.cashapp { background: #00C244; color: #fff; }
.btn.green { background: var(--ok); color: #fff; }
.btn.ghost { background: var(--surface-alt); color: var(--ink); }
.btn.share-btn { background: var(--grad); color: #fff; box-shadow: var(--shadow-fab); }
.btn.sm { width: auto; height: 44px; padding: 0 16px; font-size: .92rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { width: auto; flex: 1; }
.wrap-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.wrap-actions .btn { flex: 1 1 calc(50% - 4px); }
.linkbtn { background: none; border: none; color: var(--accent); font: 700 .84rem var(--font); padding: 0; }
.linkbtn.danger { color: #E5484D; }   /* destructive (delete account) */

/* contextual bottom action bar (editor / summary / guest) */
.fab-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: 480px;
  background: linear-gradient(to top, var(--bg) 72%, transparent);
  padding: 16px 16px calc(env(safe-area-inset-bottom) + 16px); z-index: 40;
}

/* ---------- pinned bottom nav (home) ---------- */
.nav {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  width: calc(100% - 32px); max-width: 448px; height: 64px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--pill); box-shadow: var(--shadow-nav);
  display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center;
  padding: 0 14px; z-index: 50;
}
.nav-item {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: 0; border: 0; color: var(--muted); text-decoration: none;
}
.nav-item svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.9; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.nav-item span { font: 700 10px var(--font); color: currentColor; }
.nav-item.active { color: var(--ink); }
.nav-item.active::after { content: ""; width: 5px; height: 5px; border-radius: 999px; background: var(--grad); position: absolute; bottom: 5px; }
.nav-item .nav-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); }
.nav-fab-slot { position: relative; }
.fab {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 56px; height: 56px; border-radius: 50%; background: var(--grad);
  border: 4px solid var(--surface); box-shadow: var(--shadow-fab);
  display: grid; place-items: center;
}
.fab svg { width: 26px; height: 26px; stroke: #fff; stroke-width: 2.6; fill: none; stroke-linecap: round; transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.fab.open svg { transform: rotate(45deg); }   /* + rotates into × */
.fab:active { transform: translate(-50%, -50%) scale(1.07); }

/* ---------- speed-dial menu ---------- */
.fab-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 48; animation: sd-fade .18s ease; }
.fab-menu {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 49;
  width: calc(100% - 48px); max-width: 380px;
  display: flex; flex-direction: column; gap: 12px;
  animation: sd-up .22s cubic-bezier(.2,.8,.2,1);
}
.fab-pill {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--pill);
  padding: 10px 18px 10px 10px; box-shadow: 0 8px 28px rgba(21,21,27,.18); cursor: pointer;
}
.fab-pill-ic { font-size: 20px; width: 46px; height: 46px; flex: none; display: grid; place-items: center; background: var(--grad); border-radius: 50%; }
.fab-pill-tx { display: flex; flex-direction: column; }
.fab-pill-tx strong { font: 800 16px var(--font); color: var(--ink); }
.fab-pill-tx small { font: 600 12px var(--font); color: var(--muted); }
@keyframes sd-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sd-up { from { opacity: 0; transform: translateX(-50%) translateY(14px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* invoice tag on the bill list */
.tag-inv { display: inline-block; font: 800 9px var(--font); letter-spacing: .5px; text-transform: uppercase; color: var(--accent); background: rgba(124,92,252,.12); padding: 2px 6px; border-radius: 999px; vertical-align: middle; margin-right: 3px; }

/* celebration micro-interaction (parity with the iOS Celebration system) */
@keyframes fx-pop { 0% { transform: scale(.7); opacity: 0; } 60% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }
.fx-pop { animation: fx-pop .5s cubic-bezier(.2,.9,.3,1.25); }
@media (prefers-reduced-motion: reduce) { .fx-pop { animation: none; } }

/* celebration settings toggles (account sheet) */
.settings-card { margin-top: 16px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; margin: 0; font-weight: 700; font-size: .92rem; color: var(--ink); cursor: pointer; }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-row input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }

/* ---------- home bill list ---------- */
.list { display: flex; flex-direction: column; gap: 12px; }
.bill-card { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.bill-card .meta { flex: 1; min-width: 0; }
.bill-card .meta .nm { font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bill-card .meta .dt { color: var(--muted); font-size: .82rem; font-weight: 500; }
.bill-card .amt { text-align: right; }
.bill-card .amt .big { font-weight: 800; font-variant-numeric: tabular-nums; }
.bill-card .amt .prog { font-size: .76rem; color: var(--muted); font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 48px 18px; }
.empty .big { font-size: 2.8rem; margin-bottom: 6px; }

/* account */
.acct { display: flex; align-items: center; gap: 8px; flex: none; }
.acct-pic { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--line); }
.acct-pic.lg { width: 52px; height: 52px; }
.signin-card { text-align: center; }
.signin-card #gbtn { display: flex; justify-content: center; }

/* ---- sectioned home: net position + segment pills + payer "you owe" card ---- */
.net { font-weight: 800; font-size: 1.06rem; color: var(--ink); margin-top: 2px; }
.net .muted { font-weight: 600; font-size: .8rem; }
.seg { display: flex; background: var(--surface-alt); border-radius: var(--pill); padding: 4px; gap: 4px; margin: 4px 0 16px; }
.seg-item { flex: 1; height: 38px; border: none; border-radius: var(--pill); background: none; font: 700 .9rem var(--font); color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 5px; }
.seg-item.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }
.seg-item .badge { font: 800 .72rem var(--font); color: var(--accent); }
.bill-card.is-settled .amt .prog { color: var(--ok); }
.owe-card { display: block; }
.owe-card.owe { border-left: 3px solid var(--accent); }
.owe-card.is-settled { background: var(--ok-soft); border-color: #cdeedd; }
.owe-card .owe-top { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.owe-card .owe-top .meta { flex: 1; min-width: 0; }
.owe-card .owe-top .meta .nm { font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.owe-card .owe-top .meta .dt { color: var(--muted); font-size: .82rem; font-weight: 500; }
.owe-card .owe-top .amt { text-align: right; }
.owe-card .owe-label { font: 800 .58rem var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.owe-card .owe-top .amt .big { font-weight: 800; font-variant-numeric: tabular-nums; }
.owe-actions { display: flex; gap: 8px; margin-top: 12px; }
.owe-actions .btn { flex: 1; padding: 11px; font-size: .92rem; }

/* ---- split modes (editor): mode selector + per-person %/$ inputs + per-item Split-evenly ---- */
.seg-split { margin: 4px 0 14px; }
.assign-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.split-section { margin-top: 14px; }
.split-rows { display: flex; flex-direction: column; gap: 8px; }
.split-row { display: flex; align-items: center; gap: 12px; }
.split-row .split-name { flex: 1; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.split-input { display: flex; align-items: center; gap: 4px; background: var(--surface-alt); border-radius: 12px; padding: 0 12px; width: 124px; }
.split-input input { border: none; background: none; text-align: right; width: 100%; padding: 11px 0; font: 700 1rem var(--font); color: var(--ink); }
.split-input input:focus { outline: none; }
.split-input .affix { color: var(--muted); font-weight: 700; }
.split-note { margin-top: 12px; padding: 12px 14px; background: var(--surface-alt); border-radius: 14px; font-size: .95rem; color: var(--ink); }
.split-ind { margin-top: 10px; font-weight: 700; font-size: .85rem; }
.split-ind.ok { color: var(--ok); }
.split-ind.warn { color: #E0883E; }

/* "Me" account sheet */
.acct-row { display: flex; align-items: center; gap: 14px; }
.acct-row .logo.lg {
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  background: var(--grad); display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 1.25rem;
}
.nav-avatar--initials {
  display: grid; place-items: center; background: var(--grad);
  color: #fff; font-weight: 800; font-size: 11px; border-color: transparent !important;
}

/* ---------- editor: items + steppers ---------- */
.item { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px; background: var(--surface); margin-bottom: 0; }
.item .top { display: flex; align-items: center; gap: 8px; }
.item .top .name-input { flex: 1; font-weight: 700; padding: 10px 12px; }
.item .top .price-cell { width: 96px; flex: none; }
.item .top .price-cell input { padding: 10px 12px 10px 24px; font-variant-numeric: tabular-nums; }
.item .top .price-cell::before { left: 11px; }
.item .assign { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 12px; }
.item .assign-label { font-size: .72rem; color: var(--muted); margin-bottom: 8px; font-weight: 700; }
.qtyline { display: flex; align-items: center; gap: 10px; margin-top: 11px; }
.qtyline .qtylabel { font-size: .8rem; color: var(--muted); font-weight: 700; }
.qtyline .each-hint { margin-left: auto; }
.claims { display: flex; flex-direction: column; gap: 8px; }
.claim { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.claim-name { font-size: .96rem; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.claim-status { font-size: .76rem; color: var(--muted); margin-top: 10px; font-weight: 700; }
.claim-status.unassigned-tag { color: var(--warn); }

.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--pill); overflow: hidden; background: #fff; flex: none; }
.stepper .step { width: 36px; height: 36px; font-size: 1.25rem; line-height: 1; background: var(--surface-alt); color: var(--accent); font-weight: 800; }
.stepper .step:active { background: #e6e4f8; }
.stepper .step:disabled { color: #cfcfdb; background: #f6f6fb; }
.stepper .step-n { min-width: 32px; padding: 0 4px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }

/* item adder + scan */
.name-input { font-weight: 700; }

/* totals */
.totals { border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 14px; }
.totline { display: flex; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; font-weight: 600; gap: 12px; }
.totline > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.totline > span:last-child { flex: none; }
.bd-label { text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-bottom: 6px; }
.totline.grand { font-weight: 800; font-size: 1.2rem; border-top: 1.5px solid var(--line); margin-top: 8px; padding-top: 12px; }
.totline .muted { color: var(--muted); }

.banner { border-radius: var(--radius-sm); padding: 11px 14px; font-size: .85rem; margin-bottom: 12px; display: flex; gap: 8px; font-weight: 600; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.info { background: #efeaff; color: var(--accent); }
.banner.ok { background: var(--ok-soft); color: var(--ok); justify-content: center; }

/* ---- bill-accuracy check: review-time scan recon + the summary "Bill check" card ---- */
.scan-check { margin: 4px 0 10px; display: flex; flex-direction: column; gap: 6px; }
.scan-check-row { font-size: .82rem; font-weight: 600; line-height: 1.35; padding: 9px 11px; border-radius: 12px; background: #efeaff; color: var(--accent); }
.scan-check-row.warn { background: var(--warn-soft); color: var(--warn); }
.billcheck { border: 1px solid #f0e6d6; }
.billcheck-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.billcheck-ic { font-size: 1.05rem; }
.billcheck-title { font-weight: 800; color: var(--ink); }
.billcheck-flag { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; font-size: .88rem; font-weight: 600; line-height: 1.4; color: var(--ink); padding: 9px 0; border-top: 1px solid var(--line); }
.billcheck-flag:first-of-type { border-top: none; }
.billcheck-flag .linkbtn { flex-shrink: 0; white-space: nowrap; }
.billcheck-ok { font-weight: 700; }

/* ---- receipt image on the tab: a "View receipt" thumbnail chip ---- */
.receipt-chip { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: .9rem; }
.receipt-chip img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: var(--surface-alt, #f1f1f6); }

/* ---- mandatory fees / surcharges (editor rows) ---- */
.fee-line { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.fee-line .fee-name { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; font: 600 .9rem var(--font); color: var(--ink); background: #fff; }

/* ---------- summary: person cards ---------- */
.person { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; background: var(--surface); box-shadow: var(--shadow-card); transition: opacity .2s; }
.person.paid { background: var(--ok-soft); border-color: #cdeedd; }
.person .phead { display: flex; align-items: center; gap: 11px; }
.person .avatar { width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center; background: #efeaff; color: var(--accent); font-weight: 800; }
.person.paid .avatar { background: var(--ok); color: #fff; }
.person .pname { flex: 1; font-weight: 700; }
.person .ptotal { font-weight: 800; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.person .breakdown { margin: 10px 0 12px; font-size: .85rem; color: var(--muted); }
.person .breakdown .ln { display: flex; justify-content: space-between; padding: 2px 0; font-variant-numeric: tabular-nums; }
.person .paid-flag { color: var(--ok); font-weight: 800; display: flex; align-items: center; gap: 6px; }

/* Auto-mark-paid suggestion (Phase 3): highlight a likely-paid person; never auto-confirms. */
.person.has-pending { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-card); }
.pending-suggest { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 11px 13px; border-radius: 14px; background: rgba(124, 92, 252, .08); border: 1px solid rgba(124, 92, 252, .25); }
.pending-msg { flex: 1 1 200px; font-size: .85rem; font-weight: 600; color: var(--ink); line-height: 1.4; }
.pending-msg strong { color: var(--accent); }
.btn.pulse { background: var(--accent); color: #fff; animation: pendingPulse 1.8s ease-out infinite; }
@keyframes pendingPulse { 0% { box-shadow: 0 0 0 0 rgba(124, 92, 252, .45); } 70% { box-shadow: 0 0 0 10px rgba(124, 92, 252, 0); } 100% { box-shadow: 0 0 0 0 rgba(124, 92, 252, 0); } }
@media (prefers-reduced-motion: reduce) { .btn.pulse { animation: none; } }

/* Phase 4: auto-detect onboarding card (forwarding address + Gmail setup) */
.addr-row { display: flex; align-items: center; gap: 8px; }
.addr { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; background: var(--surface-alt); border-radius: 10px; padding: 8px 10px; font: 600 .82rem ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); }
.setup-steps { margin: 12px 0 4px; padding-left: 18px; font-size: .8rem; color: var(--muted); line-height: 1.5; }
.setup-steps li { margin-bottom: 6px; }
.setup-steps code { background: var(--surface-alt); border-radius: 5px; padding: 1px 5px; font-size: .92em; }

details.bd > summary { cursor: pointer; color: var(--accent); font-size: .84rem; font-weight: 700; list-style: none; padding: 4px 0; }
details.bd > summary::-webkit-details-marker { display: none; }

.person.unassigned-card { background: var(--warn-soft); border-color: #f1e2cb; }
.unassigned-avatar { background: #f3e3c6 !important; color: var(--warn) !important; }

.collect-banner { background: #efeaff; border: 1px solid #e3dcff; border-radius: var(--radius-md); padding: 13px 15px; margin-bottom: 14px; font-weight: 500; }
.collect-banner .who { font-weight: 800; }
.maplink { color: var(--accent); font-weight: 700; text-decoration: none; }

.iconbtn { width: 34px; height: 34px; border-radius: 11px; background: var(--surface-alt); color: var(--muted); display: grid; place-items: center; font-size: 1.2rem; line-height: 1; flex: none; }
.iconbtn:active { background: #e6e6ee; }
.qr-btn { background: #efeaff; color: var(--accent); }
.qr-btn svg { display: block; }
/* per-person Venmo QR popup */
.qr-box { display: inline-block; background: #fff; padding: 14px; border-radius: 18px; border: 1px solid var(--line); margin: 8px 0 6px; }
.qr-box svg { display: block; width: 248px; height: 248px; max-width: 68vw; max-height: 68vw; }

/* ---------- sheets / overlays (scan, share, account) ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(21,21,27,.42); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 480px; border-radius: 28px 28px 0 0; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 -8px 40px rgba(0,0,0,.22); animation: slideup .22s ease; padding-bottom: env(safe-area-inset-bottom); }
@keyframes slideup { from { transform: translateY(100%); } to { transform: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.sheet-body { padding: 18px; overflow: auto; }
.scan-progress { text-align: center; padding: 20px 0; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); margin: 0 auto 14px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.scan-label { font-weight: 700; margin-bottom: 12px; }
.scan-progress .bar { height: 8px; background: var(--surface-alt); border-radius: 999px; overflow: hidden; }
.scan-progress .bar-fill { height: 100%; width: 0; background: var(--grad); transition: width .2s; }
.scan-msg { text-align: center; padding: 16px 0; }
.scan-msg .big { font-size: 2.4rem; margin-bottom: 6px; }
.scan-msg .btn { margin-top: 14px; }
.rev-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.rev-row { display: flex; align-items: center; gap: 8px; }
.rev-row .rev-name-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rev-row .rev-name { width: 100%; padding: 10px 12px; font-weight: 600; }
.rev-sub { font-size: .72rem; color: var(--muted); padding-left: 2px; font-weight: 600; }
.rev-row .price-cell { width: 96px; flex: none; }
.rev-row .price-cell input { padding: 10px 12px 10px 24px; }
.rev-row .price-cell::before { left: 11px; }
.rev-extra { display: flex; align-items: center; gap: 8px; padding: 8px 0; font-size: .9rem; font-weight: 600; }
.share-link { background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; font-size: .8rem; word-break: break-all; font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--ink); }

/* Welcome / how-to carousel */
.intro { display: flex; flex-direction: column; min-height: 100dvh; background: var(--bg); padding: 8px 0 calc(20px + env(safe-area-inset-bottom)); }
.intro-top { display: flex; justify-content: flex-end; padding: 8px 18px; min-height: 32px; }
.intro-skip { color: var(--muted); font-weight: 700; font-size: .9rem; }
.intro-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.intro-track::-webkit-scrollbar { display: none; }
.intro-page { flex: 0 0 100%; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px 32px; gap: 18px; }
.intro-media { width: 132px; height: 132px; border-radius: 32px; background: var(--grad); display: flex; align-items: center; justify-content: center; box-shadow: 0 18px 40px rgba(124,92,252,.30); }
.intro-media-emoji { font-size: 64px; line-height: 1; }
.intro-media-img { width: 76%; height: 76%; object-fit: contain; }
.intro-title { font-size: 1.7rem; font-weight: 800; color: var(--ink); margin: 0; }
.intro-body { font-size: 1.02rem; color: var(--muted); margin: 0; max-width: 19rem; line-height: 1.45; }
.intro-dots { display: flex; gap: 8px; justify-content: center; padding: 14px 0; }
.intro-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition: background .2s, width .2s; }
.intro-dot.on { width: 22px; border-radius: 4px; background: var(--accent); }
.intro-cta { padding: 0 24px; }
.intro-cta .btn { width: 100%; }
@media (prefers-reduced-motion: reduce) { .intro-track { scroll-behavior: auto; } .intro-dot { transition: none; } }

/* Zelle pay block */
.zelle-block { margin-top: 8px; padding: 10px 12px; background: var(--bg); border-radius: 12px; }
.zelle-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; font-size: .9rem; }
