/* Little Wallet palette (matches Theme in the iOS app). */
:root {
  --bg: #F7F2E8;
  --card: #FFFEFA;
  --ink: #2E3830;
  --muted: #6E756B;
  --accent: #40684F;
  --soft: #E0EDDB;
  --line: #DEDBCF;
  --danger: #B5483C;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
}
.page { max-width: 440px; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 16px 40px; }
.page[aria-busy="true"] .receipt, .page[aria-busy="true"] .pay { opacity: 0; }

.brand { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; letter-spacing: -0.01em; }
.brand-home { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand img, .brand-home img { border-radius: 9px; box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.brand-cta {
  font-size: 13px; font-weight: 600; color: var(--accent); background: var(--soft);
  padding: 6px 12px; border-radius: 999px; text-decoration: none;
}

.hero { text-align: center; padding: 28px 0 22px; }
.avatars { display: flex; justify-content: center; margin-bottom: 14px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; margin-left: -8px;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px;
  border: 3px solid var(--bg); opacity: .55; transition: transform .3s, opacity .3s;
}
.avatar:first-child { margin-left: 0; }
.avatar.you { opacity: 1; transform: scale(1.18); z-index: 1; }
.eyebrow { margin: 0; color: var(--muted); font-size: 15px; }
h1 { margin: 4px 0 2px; font-size: 64px; line-height: 1; letter-spacing: -0.04em; font-weight: 800; font-variant-numeric: tabular-nums; }
h1 .currency { font-size: 34px; vertical-align: 22px; margin-right: 2px; color: var(--muted); font-weight: 700; }
.sub { margin: 8px auto 0; max-width: 32ch; color: var(--muted); font-size: 14px; }

/* Receipt card with a torn bottom edge. */
.receipt {
  background: var(--card); border-radius: 18px 18px 0 0; padding: 8px 18px 20px; position: relative;
  box-shadow: 0 1px 2px rgb(46 56 48 / .06), 0 10px 30px -18px rgb(46 56 48 / .35);
  transition: opacity .4s;
}
.receipt::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px;
  background: linear-gradient(-45deg, transparent 6px, var(--card) 0) 0 0 / 14px 10px,
              linear-gradient(45deg, transparent 6px, var(--card) 0) 0 0 / 14px 10px;
}
.receipt ul { list-style: none; margin: 0; padding: 0; }
.receipt li {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 0; border-bottom: 1px dashed var(--line);
  animation: unroll .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 70ms + 120ms);
}
.receipt .art { width: 44px; height: 44px; display: grid; place-items: center; font-size: 30px; }
.receipt .art img { width: 44px; height: 44px; object-fit: contain; }
.receipt .name { font-weight: 600; }
.receipt .name small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }
.receipt .amount { font-variant-numeric: tabular-nums; font-weight: 600; }
@keyframes unroll { from { opacity: 0; transform: translateY(-8px); } }
.sums { margin: 12px 0 0; }
.sums div { display: flex; justify-content: space-between; padding: 3px 0; color: var(--muted); font-size: 15px; }
.sums dd { margin: 0; font-variant-numeric: tabular-nums; }
.sums .grand { color: var(--ink); font-weight: 700; font-size: 18px; padding-top: 10px; }

.pay { margin-top: 34px; display: grid; gap: 10px; transition: opacity .4s; }
.paypal-slot:empty { display: none; }
.venmo-app {
  display: flex; align-items: center; justify-content: center; gap: 7px; height: 50px; border-radius: 999px;
  background: #008CFF; color: #fff; text-decoration: none; font-size: 18px; font-weight: 500;
  box-shadow: 0 6px 16px rgba(0, 140, 255, .28); transition: transform .15s ease;
}
.venmo-app:active { transform: scale(.97); }
.venmo-app b { font-size: 24px; font-weight: 800; font-style: italic; letter-spacing: -0.03em; }
.venmo-note { display: block; text-align: center; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.free-link {
  display: block; text-align: center; padding: 14px; border-radius: 999px; text-decoration: none;
  color: var(--accent); font-weight: 600; background: var(--soft);
}
.free-link span { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.error { margin: 0; padding: 12px 14px; border-radius: 12px; background: #F8E3DF; color: var(--danger); font-size: 14px; }
.trust { margin: 6px 0 0; text-align: center; color: var(--muted); font-size: 13px; }

.done { text-align: center; padding: 26px 0 0; animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.done h2 { margin: 12px 0 4px; font-size: 26px; letter-spacing: -0.02em; }
.done p { margin: 0 auto; max-width: 30ch; color: var(--muted); }
.check { width: 76px; height: 76px; }
.check circle { fill: var(--soft); stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .6s ease-out forwards; }
.check path { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .35s .5s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.is-paid h1 { color: var(--accent); }

/* --- Interactive Web Bill Splitter Studio --- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.studio { max-width: 1020px; margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 18px 64px; }
.studio-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.brand-title { display: block; font-size: 18px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.brand-sub { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.header-badges { display: flex; align-items: center; gap: 10px; }
.env-pill {
  font-size: 12px; font-weight: 700; color: var(--accent); background: var(--soft);
  padding: 5px 11px; border-radius: 999px; letter-spacing: 0.01em;
}
.jump-link { font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.jump-link:hover { color: var(--accent); }

.intro { margin: 22px 0 18px; }
.intro h1 { margin: 0 0 6px; font-size: clamp(28px, 4.5vw, 38px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 800; }
.intro p { margin: 0; max-width: 66ch; color: var(--muted); font-size: 15px; }

.quick-bar {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px;
  box-shadow: 0 2px 10px -6px rgb(46 56 48 / .18); margin-bottom: 20px;
}
.quick-form { display: flex; gap: 8px; }
.quick-form input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 15px;
}
.quick-form input:focus { outline: none; border-color: var(--accent); background: #fff; }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  appearance: none; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.chip:hover { background: var(--soft); border-color: var(--accent); color: var(--accent); }
.chip:active { transform: scale(.97); }
.quick-note { margin: 10px 0 0; font-size: 13px; color: var(--accent); background: var(--soft); padding: 8px 12px; border-radius: 10px; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .95fr); gap: 22px; align-items: start; }
@media (max-width: 840px) {
  .workspace { grid-template-columns: 1fr; }
}
.builder-col { display: grid; gap: 16px; }
.sticky-stack { position: sticky; top: 16px; display: grid; gap: 22px; }
@media (max-width: 840px) { .sticky-stack { position: static; } }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px;
  box-shadow: 0 1px 2px rgb(46 56 48 / .04);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.panel-hint { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.panel-note { margin: 0 0 12px; font-size: 13px; color: var(--muted); }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-wide { grid-column: 1 / -1; }
@media (max-width: 480px) { .field-grid { grid-template-columns: 1fr; } }
.field { display: grid; gap: 4px; }
.field span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field small { font-weight: 400; }
.field input, .field select, .add-person-form input, .extras-box input {
  width: 100%; height: 42px; padding: 0 12px; border-radius: 11px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 15px;
}
.field input:focus, .field select:focus, .add-person-form input:focus, .extras-box input:focus {
  outline: none; border-color: var(--accent); background: #fff;
}

.people-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.person-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 6px;
  border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; font-weight: 600;
}
.person-pill.is-org { background: var(--soft); border-color: #BDD5B4; }
.person-pill .dot {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: 12px; font-weight: 700;
}
.org-tag { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.03em; }
.rm-btn {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  font-size: 17px; line-height: 1; padding: 0 2px; cursor: pointer;
}
.rm-btn:hover { color: var(--danger); }
.add-person-form { display: flex; gap: 8px; }
.add-person-form input { flex: 1; min-width: 0; }

.segmented {
  display: inline-flex; background: var(--bg); padding: 3px; border-radius: 999px; border: 1px solid var(--line);
}
.segmented button {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer;
}
.segmented button[aria-selected="true"] { background: var(--accent); color: #fff; }

.items-editor { display: grid; gap: 10px; margin-bottom: 12px; }
.item-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: var(--bg);
  display: grid; gap: 8px;
}
.item-top { display: grid; grid-template-columns: 42px minmax(0, 1fr) 98px 30px; gap: 7px; align-items: center; }
.item-emoji {
  width: 42px; height: 38px; text-align: center; font-size: 20px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card);
}
.item-name {
  min-width: 0; height: 38px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 14.5px; font-weight: 600;
}
.price-input {
  display: flex; align-items: center; height: 38px; padding: 0 8px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); font-size: 14.5px; color: var(--muted);
}
.price-input input {
  width: 100%; min-width: 0; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; outline: none;
}
.icon-del {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  font-size: 20px; height: 32px; width: 30px; border-radius: 8px; cursor: pointer;
}
.icon-del:hover:not(:disabled) { background: #F8E3DF; color: var(--danger); }
.icon-del:disabled { opacity: .3; cursor: default; }

.item-assignees { display: flex; flex-wrap: wrap; gap: 6px; }
.who-chip {
  appearance: none; display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  font: inherit; font-size: 12.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px; cursor: pointer;
  transition: all .12s ease;
}
.who-chip.active {
  background: var(--chip-color, var(--accent)); border-color: var(--chip-color, var(--accent)); color: #fff;
}
.who-chip.active .mini-dot { background: #fff !important; }
.mini-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.extras-box { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); display: grid; gap: 8px; }
.extras-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.extras-head label { font-size: 13px; font-weight: 700; color: var(--ink); }
.pct-pills { display: flex; gap: 5px; }
.mini-pill {
  appearance: none; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font: inherit; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 999px; cursor: pointer;
}
.mini-pill:hover { background: var(--soft); border-color: var(--accent); color: var(--accent); }
.extras-caption { font-size: 12.5px; color: var(--muted); }

/* Buttons */
.btn-primary {
  appearance: none; border: 0; width: 100%; margin-top: 16px; height: 50px; border-radius: 999px;
  background: var(--accent); color: #fff; font: inherit; font-size: 15.5px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 18px -6px rgb(64 104 79 / .55); transition: transform .12s ease, opacity .15s;
}
.btn-primary:hover:not(:disabled) { opacity: .94; }
.btn-primary:active:not(:disabled) { transform: scale(.985); }
.btn-primary:disabled { opacity: .65; cursor: progress; }

.btn-secondary {
  appearance: none; border: 0; height: 44px; padding: 0 16px; border-radius: 12px;
  background: var(--accent); color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.btn-soft {
  appearance: none; border: 1px solid #C8DFC0; background: var(--soft); color: var(--accent);
  height: 42px; padding: 0 16px; border-radius: 11px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.btn-soft:hover { background: #D3E6CB; }
.btn-full { width: 100%; }

/* Live Receipt Preview */
.studio-receipt { padding: 18px 18px 22px; }
.receipt-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.receipt-total { font-size: 40px; font-weight: 800; line-height: 1.05; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.receipt-total .currency { font-size: 22px; vertical-align: 12px; margin-right: 1px; color: var(--muted); font-weight: 700; }
.owed-pill { text-align: right; background: var(--soft); padding: 7px 12px; border-radius: 12px; }
.owed-pill span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.owed-pill strong { font-size: 18px; color: var(--accent); font-variant-numeric: tabular-nums; }
.breakdown-list li { grid-template-columns: 34px 1fr auto; gap: 10px; animation: none; }
.breakdown-av {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 14px; flex: none;
}

/* Live Organizer Board */
.board {
  background: var(--card); border: 1.5px solid #BBD4B2; border-radius: 18px; padding: 18px;
  box-shadow: 0 10px 26px -18px rgb(64 104 79 / .4);
}
.board-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.board-head h3 { margin: 2px 0 0; font-size: 18px; letter-spacing: -0.02em; }
.progress-wrap { margin-bottom: 14px; }
.progress-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.live-dot { color: var(--accent); }
.live-dot::before { content: "● "; font-size: 10px; }
.progress-bar { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .35s ease; }

.board-shares { display: grid; gap: 10px; }
.share-row {
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 10px;
}
.share-row.is-paid { background: #F1F7EE; border-color: #BDD5B4; }
.share-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.share-who { display: flex; align-items: center; gap: 10px; }
.share-who strong { display: block; font-size: 15px; line-height: 1.2; }
.share-amt { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.status-badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-top: 2px; }
.status-sent { background: #E9E6DC; color: var(--muted); }
.status-opened { background: #FCECD2; color: #9A5B13; }
.status-paid { background: var(--soft); color: var(--accent); }

.share-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.action-btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none;
  font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 11px; border-radius: 999px; cursor: pointer;
}
.action-btn:hover { border-color: var(--accent); color: var(--accent); }
.action-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.action-primary:hover { color: #fff; opacity: .92; }
.action-sim { background: #EBF4FF; border-color: #BDD8FF; color: #0066CC; }
.action-sim:hover { border-color: #0066CC; color: #0052A3; }

.board-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.text-link {
  appearance: none; border: 0; background: transparent; padding: 0; font: inherit;
  font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; cursor: pointer;
}
.text-link:hover { text-decoration: underline; }

.recent-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.recent-list { display: grid; gap: 6px; }
.recent-item {
  appearance: none; display: flex; justify-content: space-between; align-items: center; width: 100%;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); padding: 8px 12px;
  border-radius: 11px; font: inherit; font-size: 13.5px; cursor: pointer;
}
.recent-item.active, .recent-item:hover { border-color: var(--accent); background: var(--soft); }

/* Pre-split Showcase */
.pre-split {
  margin-top: 34px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px;
}
.pre-split-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pre-split-head h2 { margin: 2px 0 4px; font-size: 20px; letter-spacing: -0.02em; }
.pre-split-sub { margin: 0; font-size: 14px; color: var(--muted); }
.pre-split-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 720px) { .pre-split-links { grid-template-columns: 1fr; } }
.demo-link {
  display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center;
  padding: 12px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line);
  text-decoration: none; color: inherit; transition: border-color .15s, background .15s;
}
.demo-link:hover { border-color: var(--accent); background: var(--soft); }
.demo-link .avatar { margin: 0; border: 0; opacity: 1; }
.demo-link strong { display: block; font-size: 14.5px; }
.demo-link small { display: block; font-size: 12px; color: var(--muted); }
.demo-amt { font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; font-size: 14.5px; }

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