:root {
  --ink: #111111;
  --muted: #77736e;
  --line: #e8e4de;
  --paper: #fffdf9;
  --bg: #f4f1eb;
  --lime: #C7D9C0;
  --lime-dark: #AFC3A7;
  --orange: #ff7a47;
  --cream: #fff8e8;
  --shadow: 0 18px 50px rgba(34, 28, 20, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 5%, rgba(217,255,112,.28), transparent 24rem),
    var(--bg);
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }

button { cursor: pointer; color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 70px;
  padding: 0 max(22px, calc((100vw - 1120px)/2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(244,241,235,.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(17,17,17,.06);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -1px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px 11px 11px 3px;
  background: var(--ink);
  color: var(--lime);
  font-size: 18px;
}

.top-actions { display: flex; align-items: center; gap: 12px; }

.save-status {
  color: var(--muted);
  font-size: 13px;
  opacity: .9;
}

.shell {
  width: min(1120px, calc(100% - 34px));
  margin: 0 auto;
  padding: 58px 0 90px;
}

.hero {
  min-height: 300px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  padding: 18px 8px 46px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 18px;
  padding: 7px 11px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

h1, h2 {
  font-family: "Manrope", sans-serif;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(54px, 7vw, 88px);
  line-height: .91;
  letter-spacing: -5px;
}

h1 span {
  display: inline-block;
  position: relative;
  z-index: 0;
}

h1 span::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -3px;
  right: -5px;
  bottom: 3px;
  height: 23px;
  background: var(--lime);
  transform: rotate(-1deg);
}

.hero p {
  max-width: 560px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.bill-pill {
  flex: 0 0 auto;
  align-self: center;
  padding: 10px 15px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 13px;
  font-weight: 700;
}

.card {
  margin-bottom: 20px;
  padding: 30px;
  background: rgba(255,253,249,.94);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.upload-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 18px;
}

.step-badge {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  border-radius: 50%;
  background: var(--lime);
  border: 1px solid var(--ink);
  font-weight: 800;
  box-shadow: 2px 2px 0 var(--ink);
}

.upload-copy h2, .section-head h2 {
  margin: 1px 0 4px;
  font-size: 22px;
  letter-spacing: -.6px;
}

.upload-copy p, .section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.dropzone {
  grid-column: 1 / -1;
  position: relative;
  min-height: 230px;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed #bdb7ae;
  border-radius: 18px;
  background: #faf8f4;
  overflow: hidden;
  transition: .2s ease;
}

.dropzone:hover, .dropzone.dragging {
  border-color: var(--ink);
  background: #f7f6ee;
  transform: translateY(-1px);
}

.receipt-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 10px;
  border-radius: 15px;
  background: var(--lime);
  font-size: 27px;
  transform: rotate(-5deg);
}

.dropzone strong { font-size: 17px; }
.dropzone span { margin-top: 4px; color: var(--muted); font-size: 13px; }

.receipt-preview {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  background: #ece9e3;
}

.dropzone.has-image .receipt-preview { display: block; }

.upload-actions {
  grid-column: 1 / -1;
  margin-top: 16px;
  display: flex;
  gap: 10px;
}

.btn {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 12px;
  font-weight: 700;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { cursor: not-allowed; opacity: .45; }

.btn-primary {
  background: var(--lime);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}

.btn-dark { background: var(--ink); color: white; }
.btn-secondary { background: white; color: var(--ink); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink); }
.btn-small { min-height: 36px; padding: 0 13px; font-size: 13px; }

.spark { margin-right: 5px; }

.message {
  grid-column: 1 / -1;
  min-height: 20px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.message.error { color: #a33525; }

.workspace.hidden, .hidden { display: none !important; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.head-left { display: flex; gap: 15px; align-items: flex-start; }

.person-form {
  display: flex;
  gap: 9px;
  max-width: 480px;
}

.person-form input {
  flex: 1;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #d7d1c8;
  border-radius: 11px;
  background: white;
  outline: none;
}

.person-form input:focus, .item-fields input:focus, .money-input input:focus {
  border-color: var(--ink);
}

.people-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}

.person-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  font-size: 13px;
  font-weight: 700;
}

.avatar {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  border: 1px solid rgba(17,17,17,.55);
}

.person-chip button {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #aaa49b;
  font-size: 17px;
}

.mode-toggle {
  display: flex;
  padding: 3px;
  border-radius: 11px;
  background: #eeeae4;
}

.mode-toggle button {
  height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.mode-toggle button.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.even-notice {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 13px 15px;
  border: 1px solid #CBD9C4;
  border-radius: 13px;
  background: #EDF3EA;
  color: #53644F;
  font-size: 13px;
}

.even-notice > span {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 9px;
  background: var(--lime);
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
}

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

.item-row {
  padding: 18px 2px;
  border-bottom: 1px solid var(--line);
}

.item-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.item-fields {
  flex: 1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.item-fields input {
  height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  outline: none;
}

.item-fields input:hover { background: #f8f5f0; }

.item-name {
  width: min(440px, 62%);
  padding: 0 8px;
  font-weight: 700;
  font-size: 15px;
}

.item-meta {
  display: flex;
  gap: 8px;
}

.item-meta label {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.item-qty { width: 52px; padding: 0 5px; }
.item-price { width: 82px; padding: 0 5px; text-align: right; }

.icon-btn {
  border: 0;
  background: transparent;
  color: #aaa49b;
  font-size: 23px;
  line-height: 1;
}

.assignees {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 11px 0 0 7px;
}

.assign-chip {
  height: 30px;
  padding: 0 10px 0 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #dcd6cd;
  border-radius: 999px;
  background: white;
  color: #69645e;
  font-size: 12px;
  font-weight: 700;
}

.assign-chip .mini-avatar {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(17,17,17,.35);
  font-size: 8px;
}

.assign-chip.selected {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.assign-chip.selected .mini-avatar {
  color: var(--ink);
}

.no-people {
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}

.add-item {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed #cfc8be;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.totals-editor {
  width: min(400px, 100%);
  margin: 26px 0 0 auto;
  padding-top: 16px;
}

.totals-editor > div,
.totals-editor > label {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
}

.money-input {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
}

.money-input input {
  width: 90px;
  height: 31px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  text-align: right;
  outline: none;
}

.grand-total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--ink);
  color: var(--ink) !important;
  font-size: 17px !important;
  font-weight: 800;
}

.grand-total strong { font-size: 22px; }

.summary-card {
  background: var(--ink);
  color: white;
}

.summary-card .step-badge {
  color: var(--ink);
}

.summary-card .section-head p { color: #9d9992; }

.summary-list {
  display: grid;
  gap: 10px;
}

.summary-person {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  min-height: 66px;
  padding: 10px 15px 10px 10px;
  border: 1px solid #343434;
  border-radius: 15px;
  background: #1a1a1a;
}

.summary-person .avatar {
  width: 42px;
  height: 42px;
  font-size: 13px;
}

.summary-name { font-weight: 700; }
.summary-detail { margin-top: 2px; color: #9c9c9c; font-size: 12px; }
.summary-amount { font-family: "Manrope"; font-size: 22px; font-weight: 800; }

.unassigned-box {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #72523c;
  border-radius: 12px;
  background: #2e2119;
  color: #ffc8a9;
  font-size: 13px;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 20px;
  bottom: 20px;
  max-width: 340px;
  padding: 12px 15px;
  border-radius: 12px;
  background: var(--ink);
  color: white;
  font-size: 13px;
  box-shadow: 0 10px 35px rgba(0,0,0,.2);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: .2s ease;
}

.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 720px) {
  .shell { width: min(100% - 22px, 1120px); padding-top: 22px; }
  .topbar { padding: 0 13px; }
  .save-status { display: none; }
  .hero { min-height: 250px; padding: 15px 5px 30px; align-items: flex-start; flex-direction: column; gap: 18px; }
  h1 { font-size: 54px; letter-spacing: -3.6px; }
  h1 span::after { height: 16px; }
  .hero p { font-size: 15px; margin-top: 20px; }
  .bill-pill { align-self: flex-start; }
  .card { padding: 21px 17px; border-radius: 18px; }
  .upload-card { grid-template-columns: auto 1fr; }
  .dropzone { min-height: 190px; }
  .upload-actions { flex-direction: column; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .items-head .head-left { width: 100%; }
  .mode-toggle { width: 100%; }
  .mode-toggle button { flex: 1; }
  .person-form { max-width: none; }
  .item-fields { flex-direction: column; gap: 0; }
  .item-name { width: 100%; }
  .item-meta { justify-content: flex-end; }
  .summary-amount { font-size: 19px; }
}


/* v2 — custom tip distribution + Venmo settlement */
.person-form {
  max-width: 720px;
}
.person-form input {
  min-width: 0;
}
.person-chip {
  padding-right: 10px;
}
.person-chip-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.person-chip-copy strong {
  font-size: 13px;
}
.person-chip-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.payer-panel {
  margin-top: 18px;
  padding: 14px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #faf8f3;
}
.payer-panel > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.payer-panel strong {
  font-size: 13px;
}
.payer-panel span {
  color: var(--muted);
  font-size: 11px;
}
.payer-panel select {
  min-width: 180px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #d5cfc5;
  border-radius: 9px;
  background: white;
  color: var(--ink);
  font-weight: 700;
}

.tip-splitter {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #faf8f3;
}
.tip-split-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.tip-split-head > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tip-split-head strong {
  font-size: 14px;
}
.tip-split-head span {
  color: var(--muted);
  font-size: 11px;
}
.tip-mode-toggle {
  display: flex;
  padding: 3px;
  border-radius: 10px;
  background: #ebe7df;
}
.tip-mode-toggle button {
  min-height: 31px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.tip-mode-toggle button.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 2px 7px rgba(0,0,0,.07);
}

.custom-tip-panel {
  margin-top: 15px;
  border-top: 1px solid var(--line);
}
.custom-tip-row {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.custom-tip-person {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 700;
}
.custom-tip-person .avatar {
  width: 28px;
  height: 28px;
  font-size: 9px;
}
.custom-tip-row .money-input input {
  background: white;
  border-color: #ddd7ce;
}
.tip-status {
  margin-top: 11px;
  color: var(--muted);
  font-size: 11px;
}
.tip-status.good { color: #61725C; }
.tip-status.warn { color: #a2552f; }

.summary-person {
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.summary-breakdown {
  margin-top: 5px;
  color: #737373;
  font-size: 10px;
}
.summary-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}
.venmo-btn {
  min-height: 29px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: #008cff;
  color: white;
  font-size: 10px;
  font-weight: 800;
}
.venmo-note {
  margin-top: 13px;
  color: #777;
  font-size: 10px;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .person-form {
    flex-direction: column;
  }
  .payer-panel {
    align-items: stretch;
    flex-direction: column;
  }
  .payer-panel select {
    width: 100%;
  }
  .tip-split-head {
    align-items: stretch;
    flex-direction: column;
  }
  .tip-mode-toggle {
    width: 100%;
  }
  .tip-mode-toggle button {
    flex: 1;
  }
  .summary-person {
    grid-template-columns: auto minmax(0,1fr);
  }
  .summary-right {
    grid-column: 2;
    align-items: flex-start;
  }
}

/* v3 — live collaborative bill rooms */
.hero-side {
  flex: 0 0 auto;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
}
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid #d7d1c8;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  font-size: 11px;
}
.live-badge > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #76c442;
  box-shadow: 0 0 0 3px rgba(118,196,66,.14);
}
.live-badge strong { font-size: 11px; }
.live-badge small { color: var(--muted); font-size: 10px; }

.guest-banner {
  margin-bottom: 20px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #b9da55;
  border-radius: 16px;
  background: #efffc4;
  color: #26300c;
  box-shadow: var(--shadow);
}
.guest-banner strong { font-size: 14px; }
.guest-banner span { color: #5d6a32; font-size: 12px; }

.assign-chip:disabled {
  cursor: default;
  opacity: .42;
}
.assign-chip.selected:disabled {
  opacity: .78;
}
.item-fields input:disabled,
.money-input input:disabled,
.payer-panel select:disabled {
  cursor: default;
  color: inherit;
  opacity: .72;
  -webkit-text-fill-color: currentColor;
}
.mode-toggle button:disabled,
.tip-mode-toggle button:disabled {
  cursor: default;
}

.join-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(17,17,17,.68);
  backdrop-filter: blur(10px);
}
.join-card {
  width: min(430px, 100%);
  padding: 30px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 28px 90px rgba(0,0,0,.28);
}
.join-logo {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  border-radius: 15px 15px 15px 4px;
  background: var(--ink);
  color: var(--lime);
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 22px;
}
.join-card .eyebrow { margin-bottom: 12px; }
.join-card h2 {
  margin: 0 0 7px;
  font-size: 28px;
  letter-spacing: -1px;
}
.join-card > p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.join-card label {
  display: block;
  margin: 12px 0;
  font-size: 12px;
  font-weight: 800;
}
.join-card label > span { color: var(--muted); font-weight: 500; }
.join-card input {
  width: 100%;
  height: 46px;
  margin-top: 6px;
  padding: 0 13px;
  border: 1px solid #d8d2c9;
  border-radius: 11px;
  background: white;
  outline: none;
}
.join-card input:focus { border-color: var(--ink); }
.join-card .btn { width: 100%; margin-top: 9px; }
.join-card .message { margin-top: 10px; }

@media (max-width: 720px) {
  .hero-side { align-self: flex-start; align-items: flex-start; }
  .guest-banner { align-items: flex-start; flex-direction: column; }
  .join-card { padding: 24px 20px; border-radius: 20px; }
}


/* PWA / installable web app */
.btn-install {
  background: var(--lime);
  box-shadow: 2px 2px 0 var(--ink);
}

.install-overlay {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(17,17,17,.66);
  backdrop-filter: blur(12px);
}
.install-card {
  position: relative;
  width: min(440px, 100%);
  padding: 30px;
  border-radius: 25px;
  background: var(--paper);
  border: 1px solid rgba(255,255,255,.55);
  box-shadow: 0 28px 90px rgba(0,0,0,.28);
}
.install-close {
  position: absolute;
  top: 13px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #eeeae4;
  color: var(--ink);
  font-size: 23px;
  line-height: 1;
}
.install-app-icon {
  width: 74px;
  height: 74px;
  margin-bottom: 19px;
  overflow: hidden;
  border-radius: 22px;
  box-shadow: 0 7px 20px rgba(0,0,0,.14);
}
.install-app-icon img { width: 100%; height: 100%; display: block; }
.install-card .eyebrow { margin-bottom: 12px; }
.install-card h2 {
  margin: 0 0 8px;
  font-size: 30px;
  letter-spacing: -1.2px;
}
.install-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.install-steps {
  display: grid;
  gap: 8px;
  margin: 20px 0;
}
.install-steps span {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #faf8f3;
  font-size: 12px;
  font-weight: 700;
}
.install-steps b {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--lime);
  border: 1px solid var(--ink);
  font-size: 10px;
}
.install-card .btn { width: 100%; }

@media (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top); }
  .topbar {
    height: calc(70px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
  }
}

@media (max-width: 720px) {
  .top-actions { gap: 7px; }
  .top-actions .btn-small { padding: 0 10px; }
  .install-card { padding: 25px 20px; border-radius: 21px; }
}


/* v4 — sharing-first live claiming */
.invite-card {
  margin-bottom: 20px;
  padding: 22px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--ink);
  border-radius: 22px;
  background: var(--lime);
  box-shadow: 4px 4px 0 var(--ink);
}
.invite-icon {
  display: grid; place-items: center; width: 52px; height: 52px;
  border-radius: 16px 16px 16px 5px; background: var(--ink); color: var(--lime);
  font-size: 26px; font-weight: 800;
}
.invite-copy h2 { margin: 1px 0 3px; font-size: 22px; letter-spacing: -.6px; }
.invite-copy p { margin: 0; max-width: 650px; font-size: 13px; line-height: 1.45; }
.invite-kicker { font-size: 9px; font-weight: 900; letter-spacing: 1.4px; }
.invite-stats { display: flex; gap: 8px; margin-top: 9px; }
.invite-stats span { padding: 4px 8px; border: 1px solid rgba(17,17,17,.25); border-radius: 999px; background: rgba(255,255,255,.4); font-size: 10px; font-weight: 800; }
.invite-button { min-width: 135px; background: var(--ink); color: white; box-shadow: none; }

.guest-banner { justify-content: space-between; }
.guest-banner-copy { display: flex; flex-direction: column; gap: 2px; }
#doneBtn.done-active { background: var(--lime); color: var(--ink); }

.avatar-wrap { position: relative; display: inline-flex; }
.presence-dot { position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border: 2px solid white; border-radius: 50%; background: #c8c3ba; }
.presence-dot.online { background: #62be37; }
.person-done { background: #f0f9d6; border-color: #bfd970; }

.activity-panel { margin-top: 18px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #faf8f3; }
.activity-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 9px; }
.activity-head > div { display: flex; flex-direction: column; gap: 2px; }
.activity-head strong { font-size: 13px; }
.activity-head span { color: var(--muted); font-size: 10px; }
.activity-live { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; background: white; border: 1px solid var(--line); font-weight: 800; }
.activity-live i { width: 7px; height: 7px; border-radius: 50%; background: #62be37; }
.activity-list { display: grid; gap: 5px; }
.activity-row { min-height: 31px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 5px 7px; border-radius: 9px; background: white; font-size: 11px; }
.activity-dot { width: 9px; height: 9px; border: 1px solid rgba(17,17,17,.25); border-radius: 50%; background: var(--lime); }
.activity-row time { color: #aaa49b; font-size: 9px; }
.activity-empty { padding: 8px 4px; color: var(--muted); font-size: 11px; }

.claim-wrap { display: inline-flex; align-items: center; border-radius: 999px; }
.claim-qty-controls { height: 30px; margin-left: 3px; display: inline-flex; align-items: center; overflow: hidden; border: 1px solid #dcd6cd; border-radius: 999px; background: white; }
.claim-qty-controls button { width: 27px; height: 28px; padding: 0; border: 0; background: transparent; color: var(--ink); font-weight: 900; }
.claim-qty-controls strong { min-width: 18px; text-align: center; font-size: 11px; }
.smart-share-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 6px 0; }
.share-everyone-btn { min-height: 28px; padding: 0 10px; border: 1px solid #d8d2c9; border-radius: 999px; background: #fff; color: #5f5b54; font-size: 10px; font-weight: 800; }
.share-everyone-btn:hover { border-color: var(--ink); color: var(--ink); }
.item-share-summary { color: #6e6a64; font-size: 10px; font-weight: 700; }
.item-share-summary.unclaimed { color: #b25637; }

@media (max-width: 720px) {
  .invite-card { grid-template-columns: auto 1fr; padding: 18px; }
  .invite-button { grid-column: 1 / -1; width: 100%; }
  .invite-icon { width: 44px; height: 44px; border-radius: 14px 14px 14px 4px; }
  .guest-banner { align-items: stretch; }
  #doneBtn { width: 100%; }
  .smart-share-row { align-items: flex-start; flex-direction: column; }
}


/* =========================================================
   DIVVIE v4.1 — visual polish
   Sage / white / black palette + understated motion
   ========================================================= */

:root {
  --sage: #C7D9C0;
  --sage-light: #EDF3EA;
  --sage-deep: #71856B;
  --paper: #FFFFFF;
  --bg: #F7F6F2;
  --ink: #111111;
  --muted: #77746F;
  --line: rgba(17,17,17,.09);
  --shadow-soft: 0 14px 38px rgba(34, 31, 27, .065);
  --shadow-hover: 0 18px 44px rgba(34, 31, 27, .09);
  --ease-spring: cubic-bezier(.2,.78,.24,1);
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 84% 2%, rgba(199,217,192,.34), transparent 26rem),
    var(--bg);
}

/* Frosted, translucent header */
.topbar {
  background: rgba(255,255,255,.72) !important;
  border-bottom: 1px solid rgba(17,17,17,.055) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,.8);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  transition:
    background .28s ease,
    box-shadow .28s ease,
    border-color .28s ease,
    backdrop-filter .28s ease;
}

.topbar.scrolled {
  background: rgba(255,255,255,.87) !important;
  border-bottom-color: rgba(17,17,17,.08) !important;
  box-shadow: 0 8px 28px rgba(24,22,19,.055);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}

/* Sage accents */
.brand-mark,
.step-badge,
.receipt-icon,
.even-notice > span {
  background: var(--sage) !important;
}

.btn-primary {
  background: var(--sage) !important;
}

.btn-primary:hover:not(:disabled) {
  background: #BDD0B5 !important;
}

.eyebrow {
  background: rgba(255,255,255,.62);
  backdrop-filter: blur(8px);
}

h1 span::after {
  background: var(--sage) !important;
  opacity: .9;
}

.bill-pill {
  box-shadow: 0 6px 20px rgba(17,17,17,.10);
}

/* Consistent interactive motion */
button,
.btn,
.assign-chip,
.person-chip,
.item-row,
.card,
.add-item,
.venmo-btn,
.mode-toggle button,
.tip-mode-toggle button,
.payer-panel select {
  -webkit-tap-highlight-color: transparent;
}

button,
.btn,
.assign-chip,
.add-item,
.venmo-btn {
  transition:
    transform .16s var(--ease-spring),
    box-shadow .18s ease,
    background-color .18s ease,
    border-color .18s ease,
    opacity .18s ease;
}

button:active:not(:disabled),
.btn:active:not(:disabled),
.assign-chip:active:not(:disabled),
.add-item:active:not(:disabled),
.venmo-btn:active:not(:disabled) {
  transform: scale(.975);
}

@media (hover:hover) {
  .btn:hover:not(:disabled),
  .assign-chip:hover:not(:disabled),
  .add-item:hover:not(:disabled),
  .venmo-btn:hover:not(:disabled) {
    transform: translateY(-1.5px);
  }

  .card:hover {
    box-shadow: var(--shadow-hover);
  }

  .item-row:hover {
    background: rgba(199,217,192,.075);
  }
}

.card {
  box-shadow: var(--shadow-soft);
  transition:
    transform .26s var(--ease-spring),
    box-shadow .26s ease,
    opacity .42s ease;
}

/* Scroll reveal */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(11px);
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Live claim / row update feedback */
.item-row {
  position: relative;
  border-radius: 10px;
  transition:
    background-color .32s ease,
    transform .18s var(--ease-spring);
}

.item-row.just-updated {
  animation: divvieItemPulse 720ms ease-out;
}

@keyframes divvieItemPulse {
  0%   { background: rgba(199,217,192,.42); transform: scale(.995); }
  42%  { background: rgba(199,217,192,.24); transform: scale(1); }
  100% { background: transparent; }
}

.assign-chip.selected {
  background: var(--ink) !important;
  color: white !important;
}

.assign-chip.selected .mini-avatar {
  background: var(--sage) !important;
}

/* New people / activity elements glide in */
.person-chip,
.summary-person,
.activity-item,
.live-activity-item {
  animation: divvieFadeUp .28s var(--ease-spring) both;
}

@keyframes divvieFadeUp {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Share card emphasis — one subtle pass only */
.share-card,
.share-panel,
.invite-card,
.share-divvie-card,
#shareCard,
#inviteCard {
  border-color: rgba(113,133,107,.32) !important;
  background:
    linear-gradient(180deg, rgba(237,243,234,.88), rgba(255,255,255,.96)) !important;
}

.share-card.share-attention,
.share-panel.share-attention,
.invite-card.share-attention,
.share-divvie-card.share-attention,
#shareCard.share-attention,
#inviteCard.share-attention {
  animation: divvieShareAttention 1.15s ease-out 1;
}

@keyframes divvieShareAttention {
  0%   { box-shadow: 0 0 0 0 rgba(113,133,107,.00), var(--shadow-soft); }
  35%  { box-shadow: 0 0 0 8px rgba(199,217,192,.18), 0 18px 42px rgba(34,31,27,.08); }
  100% { box-shadow: var(--shadow-soft); }
}

/* Live room status feels softer */
.live-room,
.live-pill,
.live-status {
  background: rgba(255,255,255,.82) !important;
  border-color: rgba(113,133,107,.26) !important;
  backdrop-filter: blur(10px);
}

.live-room .dot,
.live-dot,
.status-dot {
  background: var(--sage-deep) !important;
  box-shadow: 0 0 0 4px rgba(199,217,192,.26);
}

/* Inputs */
input:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(199,217,192,.32);
}

/* Done/check states */
.done,
.is-done,
.status-done {
  transition: transform .2s var(--ease-spring), opacity .2s ease;
}

.done.is-new,
.is-done.is-new,
.status-done.is-new {
  animation: divvieCheckIn .34s var(--ease-spring);
}

@keyframes divvieCheckIn {
  0% { transform: scale(.72); opacity: .35; }
  70% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

/* Mobile keeps glass effect but reduces blur for performance */
@media (max-width: 720px) {
  .topbar {
    background: rgba(255,255,255,.78) !important;
    backdrop-filter: blur(14px) saturate(130%);
    -webkit-backdrop-filter: blur(14px) saturate(130%);
  }

  .topbar.scrolled {
    background: rgba(255,255,255,.91) !important;
  }
}

/* Respect accessibility preference */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }

  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}


/* =========================================================
   DIVVIE v4.2 — payment tracking
   ========================================================= */

.payment-progress {
  margin: 0 0 16px;
  padding: 15px 16px;
  border: 1px solid rgba(199,217,192,.28);
  border-radius: 14px;
  background: rgba(255,255,255,.045);
}

.payment-progress-top,
.payment-progress-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.payment-progress-top strong {
  color: #fff;
}

.payment-progress-top span,
.payment-progress-bottom {
  color: #8f8f8f;
}

.payment-progress-track {
  height: 7px;
  margin: 10px 0 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #2a2a2a;
}

.payment-progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #C7D9C0;
  transition: width .35s cubic-bezier(.2,.78,.24,1);
}

.settled-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 15px;
  border-radius: 14px;
  background: #EDF3EA;
  color: #111;
}

.settled-banner .settled-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #111;
  color: #C7D9C0;
  font-weight: 900;
}

.settled-banner > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settled-banner strong {
  font-size: 14px;
}

.settled-banner span {
  font-size: 11px;
}

.settled-pop {
  animation: divvieSettledPop .42s cubic-bezier(.2,.78,.24,1);
}

@keyframes divvieSettledPop {
  0% { opacity: 0; transform: translateY(7px) scale(.985); }
  70% { opacity: 1; transform: translateY(0) scale(1.01); }
  100% { transform: scale(1); }
}

.summary-person.is-paid {
  border-color: rgba(199,217,192,.34);
  background: linear-gradient(180deg, #1b1d1a, #191919);
}

.payment-state {
  display: inline-flex;
  margin-top: 6px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.payment-state.pending {
  color: #a2a2a2;
  background: #252525;
}

.payment-state.paid {
  color: #111;
  background: #C7D9C0;
}

.paid-btn,
.host-paid-btn {
  min-height: 29px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
}

.paid-btn {
  border: 1px solid #C7D9C0;
  background: #C7D9C0;
  color: #111;
}

.paid-btn.paid {
  background: transparent;
  color: #C7D9C0;
}

.host-paid-btn {
  border: 1px solid #444;
  background: transparent;
  color: #aaa;
}

.host-paid-btn:hover {
  border-color: #C7D9C0;
  color: #C7D9C0;
}

@media (max-width: 720px) {
  .payment-progress-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}


/* =========================================================
   DIVVIE v5 — guided 5-step flow
   Receipt → People → Items → Tip → Pay
   ========================================================= */

.brand-mark {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #111111 !important;
  color: #C7D9C0 !important;
  font-family: "Manrope", sans-serif !important;
  font-size: 19px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}

.flow-stepper {
  position: sticky;
  top: 70px;
  z-index: 18;
  border-bottom: 1px solid rgba(17,17,17,.055);
  background: rgba(247,246,242,.78);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
}

.flow-stepper-inner {
  width: min(760px, calc(100% - 34px));
  height: 62px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flow-stepper-inner > i {
  width: 54px;
  height: 1px;
  background: #d9d6cf;
  transition: background .24s ease;
}

.flow-step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: #9a9690;
  font-size: 11px;
  font-weight: 800;
}

.flow-step > span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid #d4d0c8;
  border-radius: 50%;
  background: rgba(255,255,255,.72);
  font-size: 10px;
  transition: all .2s ease;
}

.flow-step.active {
  color: #111;
}

.flow-step.active > span {
  border-color: #111;
  background: #C7D9C0;
  color: #111;
  box-shadow: 1.5px 1.5px 0 #111;
}

.flow-step.complete {
  color: #71856B;
}

.flow-step.complete > span {
  border-color: #71856B;
  background: #EDF3EA;
  color: #52644D;
}

.flow-step:disabled {
  cursor: default;
  opacity: .45;
}

.mobile-step-label {
  display: none;
}

.flow-panel {
  transform-origin: top center;
}

.flow-panel.flow-hidden {
  display: none !important;
}

.flow-panel.flow-active {
  animation: divvieStepIn .34s cubic-bezier(.2,.78,.24,1) both;
}

@keyframes divvieStepIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.flow-nav {
  position: sticky;
  z-index: 16;
  bottom: 18px;
  width: min(560px, calc(100% - 12px));
  margin: 24px auto 0;
  padding: 9px;
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 9px;
  border: 1px solid rgba(17,17,17,.08);
  border-radius: 16px;
  background: rgba(255,255,255,.84);
  box-shadow: 0 16px 42px rgba(34,31,27,.12);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.flow-nav .btn {
  width: 100%;
}

.tip-step-card .tip-splitter {
  margin-top: 0;
}

.flow-panel[data-flow-step="3"] .step-badge {
  background: #C7D9C0 !important;
}

@media (max-width: 720px) {
  .flow-stepper {
    top: 70px;
    padding: 10px 13px 9px;
    background: rgba(247,246,242,.88);
  }

  .flow-stepper-inner {
    display: none;
  }

  .mobile-step-label {
    display: block;
    width: min(100%, 620px);
    margin: 0 auto;
  }

  .mobile-step-label > span {
    display: block;
    margin-bottom: 7px;
    color: #57534e;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1px;
  }

  .mobile-progress {
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: #dedbd4;
  }

  .mobile-progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #71856B;
    transition: width .3s cubic-bezier(.2,.78,.24,1);
  }

  .flow-nav {
    bottom: 10px;
    width: calc(100% - 4px);
    margin-top: 18px;
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flow-panel.flow-active {
    animation: none !important;
  }
}


/* =========================================================
   DIVVIE v5.1 — cleaner guided navigation
   ========================================================= */

.flow-stepper {
  top: 70px;
  padding: 10px 0;
  border-bottom: 0 !important;
  background: rgba(247,246,242,.94) !important;
  box-shadow: 0 10px 30px rgba(34,31,27,.045);
  backdrop-filter: blur(20px) saturate(125%);
  -webkit-backdrop-filter: blur(20px) saturate(125%);
}

.flow-stepper-inner {
  width: min(760px, calc(100% - 34px));
  height: 52px;
  padding: 0 18px;
  border: 1px solid rgba(17,17,17,.075);
  border-radius: 16px;
  background: rgba(255,255,255,.92);
  box-shadow:
    0 1px 0 rgba(255,255,255,.9) inset,
    0 8px 24px rgba(34,31,27,.055);
}

.flow-stepper-inner > i {
  width: 54px;
  background: rgba(17,17,17,.12);
}

.flow-step {
  border-radius: 10px;
  transition:
    color .2s ease,
    background-color .2s ease,
    transform .16s cubic-bezier(.2,.78,.24,1);
}

.flow-step:hover:not(:disabled) {
  background: rgba(199,217,192,.13);
}

.flow-step:active:not(:disabled) {
  transform: scale(.975);
}

.flow-step.active {
  color: #111;
  background: rgba(199,217,192,.18);
}

.flow-step.active > span {
  border-color: #111;
  background: #C7D9C0;
  box-shadow: none;
}

.flow-step.complete > span {
  background: #EDF3EA;
  border-color: #AFC3A7;
}

@media (max-width: 720px) {
  .flow-stepper {
    padding: 9px 12px 10px;
    background: rgba(247,246,242,.96) !important;
    box-shadow: 0 8px 24px rgba(34,31,27,.05);
  }

  .mobile-step-label {
    padding: 10px 12px 11px;
    border: 1px solid rgba(17,17,17,.075);
    border-radius: 13px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 6px 18px rgba(34,31,27,.045);
  }

  .mobile-step-label > span {
    margin-bottom: 8px;
    color: #4f4c47;
  }

  .mobile-progress {
    height: 5px;
    background: #E7E4DE;
  }

  .mobile-progress > span {
    background: #71856B;
  }
}


/* =========================================================
   DIVVIE v6 — optional accounts
   ========================================================= */

.account-btn {
  min-height: 38px;
  padding: 4px 11px 4px 5px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(17,17,17,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.80);
  color: #111;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.account-avatar {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #C7D9C0;
  color: #111;
  font-size: 10px;
  font-weight: 900;
}

.account-overlay {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: flex;
  justify-content: flex-end;
}

.account-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17,17,17,.22);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: accountFade .2s ease both;
}

.account-sheet {
  position: relative;
  width: min(440px, 100%);
  height: 100%;
  padding: 24px;
  overflow-y: auto;
  background: #F7F6F2;
  box-shadow: -22px 0 65px rgba(17,17,17,.16);
  animation: accountSlide .32s cubic-bezier(.2,.78,.24,1) both;
}

@keyframes accountFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes accountSlide {
  from { opacity: .6; transform: translateX(22px); }
  to { opacity: 1; transform: translateX(0); }
}

.account-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 24px;
}

.account-sheet-head h2 {
  margin: 4px 0 0;
  font-size: 27px;
  letter-spacing: -1px;
}

.account-kicker {
  color: #71856B;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.5px;
}

.account-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(17,17,17,.10);
  border-radius: 50%;
  background: white;
  font-size: 22px;
}

.auth-unavailable {
  margin-bottom: 14px;
  padding: 11px 12px;
  border-radius: 10px;
  background: #FFF2E9;
  color: #8C4C2D;
  font-size: 11px;
  line-height: 1.45;
}

.auth-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid rgba(17,17,17,.07);
  border-radius: 17px;
  background: white;
}

.account-brand-mark {
  width: 46px !important;
  height: 46px !important;
  flex: 0 0 46px;
  border-radius: 15px 15px 15px 5px !important;
  font-size: 25px !important;
}

.auth-hero strong {
  font-size: 16px;
}

.auth-hero p {
  margin: 4px 0 0;
  color: #77746F;
  font-size: 12px;
  line-height: 1.45;
}

.oauth-btn {
  width: 100%;
  min-height: 50px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 800;
}

.google-btn {
  border: 1px solid #D9D6D0;
  background: white;
  color: #111;
}

.apple-btn {
  border: 1px solid #111;
  background: #111;
  color: white;
}

.oauth-logo {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 11px;
  font-weight: 900;
}

.apple-logo {
  border: 0;
  font-size: 18px;
}

.guest-account-btn {
  width: 100%;
  min-height: 42px;
  margin-top: 4px;
  border: 0;
  background: transparent;
  color: #71856B;
  font-size: 12px;
  font-weight: 800;
}

.account-fineprint {
  max-width: 310px;
  margin: 12px auto 0;
  color: #99958F;
  text-align: center;
  font-size: 10px;
  line-height: 1.5;
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 22px;
}

.profile-avatar {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #C7D9C0;
  color: #111;
  font-weight: 900;
}

.profile-summary > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.profile-summary strong {
  font-size: 17px;
}

.profile-summary span {
  overflow: hidden;
  color: #77746F;
  font-size: 11px;
  text-overflow: ellipsis;
}

.profile-fields {
  padding: 17px;
  border: 1px solid rgba(17,17,17,.07);
  border-radius: 15px;
  background: white;
}

.profile-fields label {
  display: block;
  margin-bottom: 13px;
}

.profile-fields label > span {
  display: block;
  margin-bottom: 6px;
  color: #77746F;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.profile-fields input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #DAD6CF;
  border-radius: 10px;
  background: #FBFAF8;
}

.venmo-profile-input {
  display: flex;
  align-items: center;
  border: 1px solid #DAD6CF;
  border-radius: 10px;
  background: #FBFAF8;
  overflow: hidden;
}

.venmo-profile-input > span {
  padding-left: 12px;
  color: #77746F;
  font-weight: 800;
}

.venmo-profile-input input {
  border: 0;
  background: transparent;
}

.history-head {
  margin: 25px 0 10px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.history-head > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-head strong {
  font-size: 15px;
}

.history-head span {
  color: #77746F;
  font-size: 10px;
}

.history-refresh {
  border: 0;
  background: transparent;
  color: #71856B;
  font-size: 10px;
  font-weight: 800;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-empty {
  padding: 24px 15px;
  border: 1px dashed #D5D0C8;
  border-radius: 13px;
  color: #99958F;
  text-align: center;
  font-size: 11px;
}

.history-row {
  width: 100%;
  min-height: 68px;
  padding: 12px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border: 1px solid rgba(17,17,17,.07);
  border-radius: 13px;
  background: white;
  text-align: left;
}

.history-row-main,
.history-row-right {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.history-row-main {
  min-width: 0;
}

.history-row-main strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.history-row small {
  color: #88847E;
  font-size: 9px;
}

.history-row-right {
  flex: 0 0 auto;
  align-items: flex-end;
}

.history-row-right .settled {
  color: #71856B;
  font-weight: 800;
}

.sign-out-btn {
  width: 100%;
  min-height: 42px;
  margin-top: 22px;
  border: 1px solid #DAD6CF;
  border-radius: 11px;
  background: transparent;
  color: #77746F;
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 720px) {
  .account-btn #accountLabel {
    display: none;
  }

  .account-btn {
    padding-right: 5px;
  }

  .account-sheet {
    width: 100%;
    height: min(88vh, 760px);
    margin-top: auto;
    padding: 20px 17px 28px;
    border-radius: 24px 24px 0 0;
    animation-name: accountSlideMobile;
  }

  @keyframes accountSlideMobile {
    from { opacity: .7; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* =========================================================
   DIVVIE v6.1 — clearer account experience
   ========================================================= */

.account-sheet {
  padding: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(199,217,192,.28), transparent 34%),
    #F7F6F2;
}

.account-sheet-head {
  margin-bottom: 18px;
}

.account-sheet-head h2 {
  font-size: 25px;
}

.account-identity-card {
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(17,17,17,.07);
  border-radius: 16px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 8px 28px rgba(17,17,17,.045);
}

.account-profile-summary {
  min-width: 0;
  margin-bottom: 0;
}

.profile-avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  box-shadow: inset 0 0 0 1px rgba(17,17,17,.06);
}

.profile-venmo-badge {
  max-width: 145px;
  padding: 7px 10px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(113,133,107,.20);
  border-radius: 999px;
  background: rgba(199,217,192,.38);
  color: #50634C;
  font-size: 10px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.profile-venmo-badge.needs-setup {
  border-style: dashed;
  background: #fff;
  color: #71856B;
}

.account-tabs {
  margin: 14px 0 18px;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  border: 1px solid rgba(17,17,17,.07);
  border-radius: 13px;
  background: rgba(17,17,17,.035);
}

.account-tab {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #77746F;
  font-size: 11px;
  font-weight: 850;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.account-tab.active {
  background: #fff;
  color: #111;
  box-shadow: 0 2px 9px rgba(17,17,17,.07);
}

.account-tab:active {
  transform: scale(.985);
}

.account-pane {
  animation: accountPaneIn .18s ease both;
}

@keyframes accountPaneIn {
  from { opacity: .55; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.account-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.account-stat {
  min-width: 0;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid rgba(17,17,17,.065);
  border-radius: 13px;
  background: #fff;
}

.account-stat span {
  color: #111;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -.7px;
}

.account-stat small {
  color: #88847E;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .45px;
}

.account-section-head {
  margin-top: 20px;
}

.history-refresh {
  padding: 6px 8px;
  border-radius: 8px;
}

.history-refresh:hover {
  background: rgba(199,217,192,.28);
}

.history-list {
  gap: 9px;
}

.history-empty {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: rgba(255,255,255,.52);
}

.history-empty strong {
  color: #4D4A46;
  font-size: 12px;
}

.history-empty span {
  max-width: 230px;
  font-size: 10px;
  line-height: 1.45;
}

.history-row {
  min-height: 72px;
  padding: 11px 10px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  box-shadow: 0 5px 18px rgba(17,17,17,.03);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.history-row:hover {
  transform: translateY(-1px);
  border-color: rgba(113,133,107,.22);
  box-shadow: 0 8px 22px rgba(17,17,17,.055);
}

.history-row:active {
  transform: scale(.992);
}

.history-row-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(199,217,192,.45);
  color: #50634C;
  font-size: 13px;
  font-weight: 950;
}

.history-row-main strong {
  font-size: 12px;
}

.history-row small {
  font-size: 9px;
}

.history-row-right {
  gap: 4px;
}

.history-row-right > strong {
  font-size: 12px;
}

.history-status {
  width: fit-content;
  padding: 3px 6px;
  border-radius: 999px;
  background: #F0EEE9;
  font-weight: 850;
}

.history-status.settled,
.history-status.paid {
  background: rgba(199,217,192,.48);
  color: #50634C;
}

.history-status.pending {
  background: #F4EEE6;
  color: #8A684A;
}

.history-chevron {
  color: #AAA69F;
  font-size: 19px;
  font-weight: 500;
}

.profile-card-head {
  margin: 2px 2px 10px;
}

.profile-card-head > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.profile-card-head strong {
  font-size: 14px;
}

.profile-card-head span {
  color: #77746F;
  font-size: 10px;
}

.account-profile-fields {
  padding: 16px;
  border-radius: 15px;
}

.field-help {
  display: block;
  margin-top: 6px;
  color: #99958F;
  font-size: 9px;
  line-height: 1.4;
}

.account-save-btn {
  width: 100%;
  margin-top: 2px;
}

.account-save-btn:disabled {
  opacity: .68;
  cursor: wait;
}

.account-security-card {
  margin-top: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid rgba(17,17,17,.065);
  border-radius: 13px;
  background: rgba(255,255,255,.58);
}

.account-security-label {
  color: #88847E;
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .45px;
}

.account-security-card strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-security-card > span:last-child {
  color: #99958F;
  font-size: 9px;
  line-height: 1.45;
}

.sign-out-btn {
  margin-top: 14px;
  background: rgba(255,255,255,.50);
}

@media (max-width: 720px) {
  .account-sheet {
    padding: 18px 16px 24px;
  }

  .account-identity-card {
    padding: 12px;
  }

  .profile-venmo-badge {
    max-width: 112px;
  }

  .history-row {
    grid-template-columns: 32px minmax(0, 1fr) auto 10px;
    gap: 8px;
  }

  .history-row-icon {
    width: 32px;
    height: 32px;
  }
}


/* =========================================================
   DIVVIE v6.2 — collapsing mobile header + compact account
   + QR invite sheet
   ========================================================= */

.topbar {
  transition:
    transform .26s cubic-bezier(.2,.78,.24,1),
    background .28s ease,
    box-shadow .28s ease,
    border-color .28s ease,
    backdrop-filter .28s ease !important;
  will-change: transform;
}

.flow-stepper {
  transition: top .26s cubic-bezier(.2,.78,.24,1), box-shadow .2s ease;
}

.invite-share-overlay {
  position: fixed;
  z-index: 130;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.invite-share-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17,17,17,.27);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: accountFade .2s ease both;
}

.invite-share-sheet {
  position: relative;
  width: min(460px, calc(100% - 22px));
  margin: 0 auto 12px;
  padding: 20px;
  border: 1px solid rgba(17,17,17,.08);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(199,217,192,.30), transparent 34%),
    #F7F6F2;
  box-shadow: 0 24px 70px rgba(17,17,17,.22);
  animation: inviteSheetUp .28s cubic-bezier(.2,.78,.24,1) both;
}

@keyframes inviteSheetUp {
  from { opacity: .65; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}

.invite-share-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.invite-share-kicker {
  color: #71856B;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.5px;
}

.invite-share-head h2 {
  margin: 5px 0 4px;
  font-size: 25px;
  letter-spacing: -1px;
}

.invite-share-head p {
  max-width: 330px;
  margin: 0;
  color: #77746F;
  font-size: 11px;
  line-height: 1.45;
}

.invite-qr-wrap {
  margin: 18px 0 14px;
  padding: 18px;
  display: grid;
  place-items: center;
  gap: 10px;
  border: 1px solid rgba(17,17,17,.07);
  border-radius: 18px;
  background: rgba(255,255,255,.9);
}

.invite-qr {
  width: 226px;
  height: 226px;
  padding: 8px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(17,17,17,.06);
}

.invite-qr img,
.invite-qr canvas {
  max-width: 100%;
  height: auto !important;
  border-radius: 6px;
}

.invite-qr-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}

.invite-qr-copy strong { font-size: 13px; }
.invite-qr-copy span { color: #88847E; font-size: 10px; }

.invite-link-row {
  min-height: 46px;
  padding: 5px 5px 5px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(17,17,17,.08);
  border-radius: 13px;
  background: rgba(255,255,255,.74);
}

.invite-share-url {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #66625D;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-native-share {
  width: 100%;
  margin-top: 10px;
}

@media (max-width: 720px) {
  body.header-collapsed .topbar {
    transform: translateY(-100%);
  }

  .flow-stepper {
    top: 70px !important;
  }

  body.header-collapsed .flow-stepper {
    top: 0 !important;
  }

  .account-overlay {
    align-items: flex-end;
    justify-content: center;
  }

  .account-sheet {
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    max-height: min(88svh, 760px);
    margin-top: auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -18px 55px rgba(17,17,17,.14);
  }

  .account-sheet-head {
    margin-bottom: 14px;
  }

  .account-fineprint {
    margin-bottom: 0;
  }

  .invite-share-sheet {
    width: 100%;
    margin: 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
  }

  .invite-qr-wrap {
    margin-top: 14px;
    padding: 14px;
  }

  .invite-qr {
    width: min(210px, 62vw);
    height: min(210px, 62vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  .topbar,
  .flow-stepper,
  .invite-share-sheet {
    transition: none !important;
    animation: none !important;
  }
}


/* =========================================================
   Divvie v6.3 — social people + groups
   ========================================================= */
.social-quick-add { margin: 0 0 16px; padding: 14px; border: 1px solid #E4E9E1; border-radius: 18px; background: #F8FAF7; }
.social-quick-head, .people-pane-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.social-quick-head > div, .people-pane-head > div { display:flex; flex-direction:column; gap:2px; }
.social-kicker { font-size:10px; letter-spacing:.12em; font-weight:800; color:#7E8D79; }
.social-quick-head strong, .people-pane-head strong { font-size:15px; }
.people-pane-head span { font-size:12px; color:#77736D; }
.mini-action { border:0; background:transparent; color:#52664C; font-weight:800; font-size:12px; cursor:pointer; }
.recent-people-chips, .quick-groups { display:flex; gap:8px; overflow-x:auto; padding:10px 1px 1px; scrollbar-width:none; }
.recent-people-chips::-webkit-scrollbar, .quick-groups::-webkit-scrollbar { display:none; }
.recent-person-chip, .quick-group-chip { flex:0 0 auto; display:flex; align-items:center; gap:7px; min-height:38px; padding:5px 10px 5px 6px; border:1px solid #DDE5D9; border-radius:999px; background:white; cursor:pointer; font:inherit; }
.recent-person-chip > span { width:28px; height:28px; display:grid; place-items:center; border-radius:50%; background:#DDEAD8; font-size:10px; font-weight:900; }
.recent-person-chip strong, .quick-group-chip strong { font-size:12px; white-space:nowrap; }
.recent-person-chip i { font-style:normal; font-weight:900; color:#70836A; }
.quick-group-chip { padding:7px 11px; }
.quick-group-chip small { min-width:20px; height:20px; display:grid; place-items:center; border-radius:50%; background:#EEF3EB; color:#64705F; font-size:10px; font-weight:800; }

.people-pane-head { margin-bottom:14px; }
.group-composer { padding:14px; margin-bottom:18px; border-radius:18px; background:#F7F9F5; border:1px solid #DFE6DB; }
.group-composer label { display:flex; flex-direction:column; gap:6px; font-size:12px; font-weight:800; }
.group-composer input[type="text"], .group-composer > label > input { width:100%; padding:11px 12px; border:1px solid #D8DED5; border-radius:12px; background:white; font:inherit; }
.group-picker-label { display:block; margin:12px 0 7px; font-size:12px; font-weight:800; }
.group-people-picker { display:flex; flex-wrap:wrap; gap:7px; max-height:150px; overflow:auto; }
.group-person-choice { display:flex !important; flex-direction:row !important; align-items:center; gap:6px !important; padding:7px 9px; border:1px solid #DDE4D9; border-radius:999px; background:white; font-size:12px !important; cursor:pointer; }
.group-person-choice input { accent-color:#71866A; }
.group-picker-empty { color:#817C75; font-size:12px; }
.group-composer-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:12px; }
.social-section + .social-section { margin-top:20px; }
.groups-list, .recent-people-list { display:flex; flex-direction:column; gap:8px; }
.social-empty { display:flex; flex-direction:column; gap:2px; padding:15px; border:1px dashed #D9DED6; border-radius:14px; color:#77736D; }
.social-empty strong { color:#2B2B29; font-size:13px; }
.social-empty span { font-size:11px; }
.social-person-row, .group-row { display:flex; align-items:center; gap:10px; min-height:56px; padding:9px 10px; border:1px solid #E5E8E2; border-radius:14px; background:white; }
.social-avatar, .group-icon { flex:0 0 36px; width:36px; height:36px; display:grid; place-items:center; border-radius:50%; background:#DDEAD8; font-size:11px; font-weight:900; }
.group-icon { border-radius:12px; font-size:16px; }
.social-person-main, .group-main { min-width:0; flex:1; display:flex; flex-direction:column; gap:2px; }
.social-person-main strong, .group-main strong { font-size:13px; }
.social-person-main small, .group-main small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#7B7771; font-size:10px; }
.social-person-row button, .group-add-btn { border:0; border-radius:999px; background:#EEF4EB; color:#53664D; padding:7px 10px; font-size:11px; font-weight:800; cursor:pointer; }
.group-delete-btn { width:28px; height:28px; border:0; background:transparent; color:#A09B94; font-size:18px; cursor:pointer; }

@media (max-width:720px) {
  .account-tabs { grid-template-columns: repeat(3, 1fr); }
  .account-tab { padding-left:6px; padding-right:6px; font-size:11px; }
  .social-quick-add { margin-left:-2px; margin-right:-2px; }
}

/* Divvie v6.3.1 — social section cleanup */
.social-section {
  padding-top: 2px;
}

.social-section + .social-section {
  margin-top: 30px;
  padding-top: 2px;
}

.social-section .account-section-head {
  margin: 0 0 12px;
}

.social-section .account-section-head > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.social-section .account-section-head strong {
  display: block;
  color: #171715;
  font-size: 17px;
  font-weight: 850;
  line-height: 1.15;
  letter-spacing: -0.25px;
}

.social-section .account-section-head span {
  display: block;
  max-width: 36rem;
  color: #817D77;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.groups-list,
.recent-people-list {
  gap: 9px;
}

.social-empty {
  position: relative;
  min-height: 82px;
  justify-content: center;
  gap: 3px;
  padding: 14px 16px 14px 54px;
  border: 1px dashed #D8DED5;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
}

.social-empty::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 50%;
  width: 27px;
  height: 27px;
  transform: translateY(-50%);
  border-radius: 9px;
  background: #E6EFE2;
  box-shadow: inset 0 0 0 1px rgba(91, 112, 84, 0.08);
}

.groups-list .social-empty::after,
.recent-people-list .social-empty::after {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-52%);
  color: #53664D;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.groups-list .social-empty::after {
  content: "2+";
  letter-spacing: -1px;
  font-size: 10px;
}

.recent-people-list .social-empty::after {
  content: "↻";
  font-size: 16px;
}

.social-empty strong {
  color: #2B2B29;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.social-empty span {
  color: #817D77;
  font-size: 11px;
  line-height: 1.35;
}

@media (max-width: 720px) {
  .social-section + .social-section {
    margin-top: 26px;
  }

  .social-section .account-section-head {
    margin-bottom: 10px;
  }

  .social-section .account-section-head strong {
    font-size: 16px;
  }

  .social-section .account-section-head span {
    font-size: 11px;
  }

  .social-empty {
    min-height: 78px;
    padding: 13px 14px 13px 51px;
  }

  .social-empty::before {
    left: 14px;
    width: 25px;
    height: 25px;
  }

  .groups-list .social-empty::after,
  .recent-people-list .social-empty::after {
    left: 20px;
  }
}


/* =========================================================
   Divvie v6.3.2 — matching close animations for sheets
   ========================================================= */

.account-overlay.closing,
.invite-share-overlay.closing {
  pointer-events: none;
}

.account-overlay.closing .account-backdrop,
.invite-share-overlay.closing .invite-share-backdrop {
  animation: divvieOverlayFadeOut .22s ease both;
}

.account-overlay.closing .account-sheet {
  animation: divvieAccountSlideOut .28s cubic-bezier(.4,0,.7,.2) both;
}

.invite-share-overlay.closing .invite-share-sheet {
  animation: divvieInviteSheetDown .28s cubic-bezier(.4,0,.7,.2) both;
}

@keyframes divvieOverlayFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes divvieAccountSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: .65; transform: translateX(24px); }
}

@keyframes divvieInviteSheetDown {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: .65; transform: translateY(28px); }
}

@media (max-width: 720px) {
  .account-overlay.closing .account-sheet {
    animation: divvieAccountSheetDown .28s cubic-bezier(.4,0,.7,.2) both;
  }

  @keyframes divvieAccountSheetDown {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: .68; transform: translateY(28px); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .account-overlay.closing .account-backdrop,
  .invite-share-overlay.closing .invite-share-backdrop,
  .account-overlay.closing .account-sheet,
  .invite-share-overlay.closing .invite-share-sheet {
    animation-duration: .01ms !important;
  }
}

/* =========================================================
   Divvie v6.3.3 — snappier, smoother sheet motion
   ========================================================= */

/* Keep sheet motion on the compositor for smoother mobile Safari animation. */
.account-sheet,
.invite-share-sheet,
.account-backdrop,
.invite-share-backdrop {
  will-change: transform, opacity;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Faster spring-like entrances. */
.account-sheet {
  animation: divvieAccountIn .24s cubic-bezier(.22,1,.36,1) both !important;
}

.invite-share-sheet {
  animation: divvieInviteIn .22s cubic-bezier(.22,1,.36,1) both !important;
}

.account-backdrop,
.invite-share-backdrop {
  animation: divvieBackdropIn .18s ease-out both !important;
}

@keyframes divvieBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes divvieAccountIn {
  from { opacity: .82; transform: translate3d(18px,0,0) scale(.995); }
  to { opacity: 1; transform: translate3d(0,0,0) scale(1); }
}

@keyframes divvieInviteIn {
  from { opacity: .82; transform: translate3d(0,20px,0) scale(.995); }
  to { opacity: 1; transform: translate3d(0,0,0) scale(1); }
}

/* Close slightly faster than open, like a native bottom sheet. */
.account-overlay.closing .account-backdrop,
.invite-share-overlay.closing .invite-share-backdrop {
  animation: divvieBackdropOut .16s ease-in both !important;
}

.account-overlay.closing .account-sheet {
  animation: divvieAccountOut .19s cubic-bezier(.4,0,.8,.2) both !important;
}

.invite-share-overlay.closing .invite-share-sheet {
  animation: divvieInviteOut .19s cubic-bezier(.4,0,.8,.2) both !important;
}

@keyframes divvieBackdropOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes divvieAccountOut {
  from { opacity: 1; transform: translate3d(0,0,0) scale(1); }
  to { opacity: 0; transform: translate3d(18px,0,0) scale(.995); }
}

@keyframes divvieInviteOut {
  from { opacity: 1; transform: translate3d(0,0,0) scale(1); }
  to { opacity: 0; transform: translate3d(0,20px,0) scale(.995); }
}

@media (max-width: 720px) {
  .account-sheet {
    animation: divvieMobileAccountIn .22s cubic-bezier(.22,1,.36,1) both !important;
  }

  .account-overlay.closing .account-sheet {
    animation: divvieMobileAccountOut .19s cubic-bezier(.4,0,.8,.2) both !important;
  }

  @keyframes divvieMobileAccountIn {
    from { opacity: .84; transform: translate3d(0,20px,0) scale(.995); }
    to { opacity: 1; transform: translate3d(0,0,0) scale(1); }
  }

  @keyframes divvieMobileAccountOut {
    from { opacity: 1; transform: translate3d(0,0,0) scale(1); }
    to { opacity: 0; transform: translate3d(0,20px,0) scale(.995); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .account-sheet,
  .invite-share-sheet,
  .account-backdrop,
  .invite-share-backdrop,
  .account-overlay.closing .account-sheet,
  .invite-share-overlay.closing .invite-share-sheet,
  .account-overlay.closing .account-backdrop,
  .invite-share-overlay.closing .invite-share-backdrop {
    animation-duration: .01ms !important;
  }
}

/* =========================================================
   Divvie v6.3.4 — floating stepper
   Remove the full-width shelf behind progress navigation so
   the white progress card visually floats over the page.
   ========================================================= */
.flow-stepper {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.flow-stepper-inner {
  box-shadow:
    0 1px 0 rgba(255,255,255,.95) inset,
    0 10px 30px rgba(34,31,27,.08) !important;
}

@media (max-width: 720px) {
  .flow-stepper {
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .mobile-step-label {
    box-shadow:
      0 1px 0 rgba(255,255,255,.95) inset,
      0 8px 24px rgba(34,31,27,.075) !important;
  }

  body.header-collapsed .flow-stepper {
    top: 8px !important;
  }
}

/* =========================================================
   Divvie v6.3.5 — opaque, higher-contrast floating stepper
   Keep the progress card floating, but make the card itself
   solid white with a clearer outline against the page.
   ========================================================= */
.flow-stepper-inner {
  background: #ffffff !important;
  border: 2px solid rgba(17,17,17,.16) !important;
  box-shadow:
    0 1px 0 rgba(255,255,255,1) inset,
    0 10px 28px rgba(34,31,27,.10) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

@media (max-width: 720px) {
  .mobile-step-label {
    background: #ffffff !important;
    border: 2px solid rgba(17,17,17,.16) !important;
    box-shadow:
      0 1px 0 rgba(255,255,255,1) inset,
      0 8px 22px rgba(34,31,27,.09) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* =========================================================
   Divvie v6.4 — social inbox + landing page
   ========================================================= */

/* Landing page ------------------------------------------------ */
.landing-page {
  min-height: 100vh;
  padding: 22px clamp(20px, 5vw, 72px) 28px;
  background:
    radial-gradient(circle at 82% 12%, rgba(199,217,192,.42), transparent 28%),
    linear-gradient(180deg, #FBFAF7 0%, #F4F2ED 100%);
  color: #111;
}

body:not(.landing-mode) .landing-page { display: none !important; }
body.landing-mode > .topbar,
body.landing-mode > .flow-stepper,
body.landing-mode > main.shell { display: none !important; }
body.landing-mode { background: #F7F5F0; }

.landing-nav {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.landing-brand { text-decoration: none; }
.landing-account-btn { background: #fff !important; }

.landing-hero {
  max-width: 1180px;
  margin: 88px auto 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, .75fr);
  align-items: center;
  gap: clamp(46px, 8vw, 110px);
}

.landing-kicker {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 7px 10px;
  border: 1px solid rgba(17,17,17,.11);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: #71856B;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
}

.landing-hero h1 {
  max-width: 720px;
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: clamp(48px, 7vw, 92px);
  line-height: .95;
  letter-spacing: -.065em;
}

.landing-hero h1 span { color: #71856B; }
.landing-hero-copy > p {
  max-width: 610px;
  margin: 25px 0 0;
  color: #65615C;
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.55;
}

.landing-actions {
  margin-top: 31px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.landing-start-btn {
  min-height: 54px;
  padding: 0 22px;
  border-radius: 14px;
  background: #111;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(17,17,17,.13);
}
.landing-start-btn span { margin-left: 12px; }
.landing-start-btn:hover { transform: translateY(-1px); }
.landing-start-btn:active { transform: translateY(0) scale(.985); }
.landing-secondary-link {
  color: #4F4C47;
  font-size: 13px;
  font-weight: 800;
  text-underline-offset: 4px;
}

.landing-proof {
  margin-top: 24px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: #77736D;
  font-size: 11px;
  font-weight: 700;
}
.landing-proof span { display:flex; align-items:center; gap:7px; }
.landing-proof i,
.landing-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #71856B;
  box-shadow: 0 0 0 4px rgba(113,133,107,.13);
}

.landing-demo {
  position: relative;
  padding: 24px;
  border: 2px solid rgba(17,17,17,.12);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(40,36,31,.12);
  transform: rotate(1.2deg);
}
.landing-demo::before {
  content: "";
  position: absolute;
  inset: 10px -12px -12px 12px;
  z-index: -1;
  border-radius: 28px;
  background: #C7D9C0;
  opacity: .55;
}
.landing-demo-top { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:10px; }
.landing-demo-top strong { font-size: 14px; }
.landing-demo-top small { color:#77736D; font-size:10px; font-weight:700; }
.landing-demo-people { display:flex; margin:20px 0 16px; }
.landing-demo-people span {
  width: 36px; height: 36px; margin-left:-7px; display:grid; place-items:center;
  border:3px solid #fff; border-radius:50%; background:#C7D9C0; font-size:9px; font-weight:900;
}
.landing-demo-people span:first-child { margin-left:0; }
.landing-demo-people span:nth-child(2) { background:#E9DBCA; }
.landing-demo-people span:nth-child(3) { background:#D7E5F0; }
.landing-demo-people span:nth-child(4) { background:#111; color:#fff; }
.landing-demo-item {
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:15px 0; border-top:1px solid #ECE9E3;
}
.landing-demo-item div { display:flex; flex-direction:column; gap:3px; }
.landing-demo-item strong { font-size:13px; }
.landing-demo-item small { color:#827E78; font-size:10px; }
.landing-demo-item b { font-size:13px; }
.landing-demo-activity {
  margin-top: 8px; padding: 12px 13px; border-radius: 12px; background:#F2F6F0;
  color:#5F7059; font-size:10px; font-weight:800;
}
.landing-demo-activity span { margin-right:7px; }

.landing-how {
  max-width: 1180px;
  margin: 0 auto;
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.landing-how article {
  padding: 22px;
  border: 1px solid rgba(17,17,17,.10);
  border-radius: 18px;
  background: rgba(255,255,255,.72);
}
.landing-how article > span { color:#71856B; font-size:10px; font-weight:900; letter-spacing:.12em; }
.landing-how strong { display:block; margin-top:14px; font-family:"Manrope",sans-serif; font-size:18px; }
.landing-how p { margin:7px 0 0; color:#77736D; font-size:12px; line-height:1.5; }
.landing-footer { max-width:1180px; margin:58px auto 0; color:#8A857E; font-size:10px; font-weight:700; }

/* Bigger, clearer account control -------------------------------- */
.account-btn {
  position: relative;
  min-height: 44px !important;
  padding: 5px 13px 5px 5px !important;
  gap: 8px !important;
  border: 1.5px solid rgba(17,17,17,.16) !important;
  background: #fff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 4px 12px rgba(17,17,17,.05);
}
.account-avatar {
  width: 32px !important;
  height: 32px !important;
  font-family: "Manrope", sans-serif;
  font-size: 11px !important;
  font-weight: 900;
}
#accountLabel, #landingAccountLabel { font-size: 12px; font-weight: 900; }
.account-unread-badge {
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  display:grid;
  place-items:center;
  border:2px solid #fff;
  border-radius:999px;
  background:#111;
  color:#fff;
  font-size:8px;
  font-weight:900;
  line-height:1;
}
#accountUnreadBadge { position:absolute; top:-5px; right:-5px; }

/* Inbox ----------------------------------------------------------- */
.account-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.inbox-tab { position:relative; }
.inbox-tab-badge {
  min-width:16px; height:16px; padding:0 4px; margin-left:4px;
  display:inline-grid; place-items:center; border-radius:999px;
  background:#111; color:#fff; font-size:8px; font-weight:900;
}
.inbox-head { margin-bottom: 12px; }
.inbox-list { display:flex; flex-direction:column; gap:8px; }
.inbox-row {
  width:100%; min-height:68px; padding:12px;
  display:grid; grid-template-columns:38px minmax(0,1fr) auto; align-items:center; gap:11px;
  border:1px solid #E4E0D9; border-radius:14px; background:#fff; text-align:left; color:#111;
}
.inbox-row.unread { background:#F6F9F4; border-color:#C9D7C4; }
.inbox-row:hover { border-color:#C8C2BA; }
.inbox-icon {
  width:38px; height:38px; display:grid; place-items:center; border-radius:12px;
  background:#EEF3EB; font-size:15px; font-weight:900;
}
.inbox-main { min-width:0; display:flex; flex-direction:column; gap:4px; }
.inbox-main strong { font-size:12px; line-height:1.35; }
.inbox-main small { color:#78736D; font-size:10px; line-height:1.4; }
.inbox-meta { align-self:start; display:flex; align-items:center; gap:7px; color:#99938B; font-size:9px; font-weight:800; }
.inbox-meta i { width:7px; height:7px; border-radius:50%; background:#71856B; }

@media (max-width: 820px) {
  .landing-hero { margin-top:58px; grid-template-columns:1fr; gap:42px; }
  .landing-demo { max-width:520px; transform:none; }
  .landing-how { grid-template-columns:1fr; }
}

@media (max-width: 720px) {
  .account-btn #accountLabel { display: inline !important; }
  .account-btn { padding-right: 10px !important; }
  .top-actions .account-btn { min-width: 92px; }
  .landing-page { padding: 16px 17px 24px; }
  .landing-hero { margin: 58px auto 48px; }
  .landing-hero h1 { font-size: clamp(46px, 15vw, 66px); }
  .landing-hero-copy > p { font-size:16px; }
  .landing-actions { align-items:stretch; }
  .landing-start-btn { width:100%; }
  .landing-secondary-link { text-align:center; padding:8px; }
  .landing-demo { padding:18px; border-radius:22px; }
  .landing-how article { padding:18px; }
  .account-tabs { gap:4px !important; }
  .account-tab { padding-inline:6px !important; font-size:9px !important; }
}


/* v6.4.1 account-only quick add + invite states */
.recent-person-chip:disabled { cursor: default; opacity: 1; }
.recent-person-chip.is-pending { border-color: #C9D8C4; background: #F5F8F3; }
.recent-person-chip.is-added:not(.is-pending) { border-color: #B9CEB2; background: #EEF4EB; }
.recent-person-chip.is-pending i { color: #6C7C67; font-size: 10px; font-weight: 850; }
.social-person-row button:disabled { cursor: default; opacity: 1; color: #687665; background: #EEF4EB; }
.social-person-row.invite-pending { border-color: #D4DED0; background: #FAFCF9; }
.person-chip.person-pending { border-style: dashed; border-color: #BACBB4; background: #FBFDF9; }
.person-chip.person-pending .person-chip-copy small { color: #74816F; font-weight: 800; }
.person-chip.person-invited-joined { border-color: #B8CDAF; }
.person-chip.person-invited-joined .person-chip-copy small { color: #5D7455; font-weight: 800; }


/* v6.4.3 — cleaner invite hierarchy + compact invite states */
.recent-person-chip.is-pending i {
  font-size: 9px !important;
  line-height: 1 !important;
  font-weight: 800 !important;
  letter-spacing: .02em;
  color: #6F806A !important;
}

.flow-panel > .invite-card-compact {
  margin: 2px 0 18px;
  padding: 12px 14px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  border: 1px solid #D9E2D5;
  border-radius: 16px;
  background: #F8FAF7;
  box-shadow: none;
}
.flow-panel > .invite-card-compact .invite-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px 12px 12px 4px;
  font-size: 18px;
}
.flow-panel > .invite-card-compact .invite-copy { min-width: 0; }
.flow-panel > .invite-card-compact .invite-kicker { color: #758571; }
.flow-panel > .invite-card-compact .invite-copy h2 {
  margin: 0 0 1px;
  font-size: 15px;
  letter-spacing: -.2px;
}
.flow-panel > .invite-card-compact .invite-copy p {
  font-size: 11px;
  line-height: 1.35;
  color: #77736D;
}
.flow-panel > .invite-card-compact .invite-stats { margin-top: 6px; gap: 5px; }
.flow-panel > .invite-card-compact .invite-stats span {
  padding: 3px 7px;
  border-color: #D8E0D4;
  background: #fff;
  color: #6C7169;
  font-size: 9px;
}
.flow-panel > .invite-card-compact .invite-button {
  min-width: 86px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 12px;
}

@media (max-width: 720px) {
  .flow-panel > .invite-card-compact {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    padding: 11px 12px;
    gap: 10px;
    margin-bottom: 15px;
  }
  .flow-panel > .invite-card-compact .invite-icon { width:34px; height:34px; font-size:16px; }
  .flow-panel > .invite-card-compact .invite-copy p { display:none; }
  .flow-panel > .invite-card-compact .invite-stats { margin-top:4px; }
  .flow-panel > .invite-card-compact .invite-button {
    grid-column: auto;
    width: auto;
    min-width: 72px;
    min-height: 34px;
    padding: 0 11px;
  }
}


/* =========================================================
   DIVVIE v6.4.5 — mobile button legibility + cleaner header
   ========================================================= */

/* iOS/Safari can apply its blue control tint unless button text is explicit. */
.join-card #joinSubmit,
.btn-primary,
.btn-secondary,
.btn-ghost,
.google-btn,
.guest-account-btn,
.history-refresh,
.mini-action,
.account-tab,
.mode-toggle button,
.tip-mode-toggle button,
.add-item,
.share-everyone-btn {
  color: var(--ink) !important;
  -webkit-text-fill-color: var(--ink);
}

/* Keep deliberately dark buttons light. */
.btn-dark,
.apple-btn,
.invite-button,
.venmo-btn {
  color: #fff !important;
  -webkit-text-fill-color: #fff;
}

.invite-short-label { display: none; }
.install-top-icon { display: none; }

@media (max-width: 720px) {
  /* Give the brand and actions breathing room instead of squeezing 3 text pills. */
  .topbar {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .brand { gap: 7px; font-size: 22px; }
  .brand-mark { width: 32px; height: 32px; }
  .top-actions { gap: 6px !important; }

  /* Install becomes a compact icon action on phones. */
  .top-actions .btn-install {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0 !important;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    box-shadow: none;
  }
  .top-actions .btn-install.hidden { display: none !important; }
  .install-top-label { display: none; }
  .install-top-icon {
    display: inline-block;
    color: var(--ink);
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    transform: translateY(-1px);
  }

  /* Keep Sign in readable without reserving a huge fixed width. */
  .top-actions .account-btn {
    min-width: 0 !important;
    max-width: 104px;
    min-height: 40px !important;
    padding: 4px 9px 4px 4px !important;
    gap: 6px !important;
    box-shadow: none;
  }
  .top-actions .account-avatar {
    width: 30px !important;
    height: 30px !important;
    flex: 0 0 30px;
  }
  #accountLabel {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px !important;
  }

  /* The bill action is shorter on mobile, while retaining its full accessible meaning. */
  #shareBtn {
    min-height: 40px;
    padding: 0 11px !important;
    white-space: nowrap;
  }
  .invite-full-label { display: none; }
  .invite-short-label { display: inline; }
}

@media (max-width: 390px) {
  .brand { font-size: 20px; }
  .topbar { padding-left: 10px !important; padding-right: 10px !important; }
  .top-actions { gap: 5px !important; }
  .top-actions .account-btn { max-width: 88px; }
  #shareBtn { padding-inline: 9px !important; }
}

/* =========================================================
   Divvie v6.4.7 — compact history + remove controls
   ========================================================= */
.history-row-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.history-row-wrap .history-row {
  flex: 1 1 auto;
  min-width: 0;
}
.history-delete {
  flex: 0 0 34px;
  align-self: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(17,17,17,.12);
  background: #fff;
  color: #666;
  font: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .14s ease, border-color .14s ease, background .14s ease, color .14s ease;
}
.history-delete:hover {
  transform: scale(1.04);
  border-color: rgba(17,17,17,.25);
  background: #f7f7f5;
  color: #111;
}
.history-delete:disabled { opacity: .45; cursor: wait; }
.history-expand {
  width: 100%;
  margin-top: 10px;
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(17,17,17,.14);
  background: #fff;
  color: #111;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.history-expand:hover { background: #f7f8f5; }
.history-expand.hidden { display: none !important; }
@media (max-width: 640px) {
  .history-row-wrap { gap: 6px; }
  .history-delete { flex-basis: 32px; width: 32px; height: 32px; font-size: 19px; }
}

/* =========================================================
   DIVVIE v6.6.0 — product polish pass
   motion · loading · mobile ergonomics · account carousel
   ========================================================= */
:root {
  --sage: #C7D9C0;
  --sage-ink: #52644D;
  --surface: #FFFFFF;
  --surface-soft: #F8F7F3;
  --border-soft: rgba(17,17,17,.09);
  --border-strong: rgba(17,17,17,.18);
  --radius-control: 12px;
  --radius-card: 18px;
  --control-h: 44px;
  --ease-snappy: cubic-bezier(.2,.8,.2,1);
  --ease-standard: cubic-bezier(.4,0,.2,1);
  --shadow-float: 0 14px 38px rgba(17,17,17,.10);
}

html { -webkit-text-size-adjust: 100%; }
body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }

/* A consistent interaction language across the product. */
.btn:not(.btn-small),
.oauth-btn,
.account-btn,
.history-expand {
  min-height: var(--control-h);
}
.btn,
.oauth-btn,
.account-btn,
.account-tab,
.history-refresh,
.mini-action,
.add-item,
.group-add-btn,
.social-person-row button,
.recent-person-chip,
.quick-group-chip {
  transition: transform .14s var(--ease-snappy), background .16s ease, border-color .16s ease, opacity .16s ease, box-shadow .16s ease;
}
.btn:active:not(:disabled),
.oauth-btn:active:not(:disabled),
.account-btn:active:not(:disabled),
.history-expand:active:not(:disabled),
.recent-person-chip:active:not(:disabled),
.quick-group-chip:active:not(:disabled) {
  transform: scale(.975);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(113,133,107,.28);
  outline-offset: 2px;
}

/* Busy buttons clearly acknowledge the tap. */
button.is-loading {
  position: relative;
  cursor: wait !important;
  opacity: .72 !important;
}
button.is-loading::after {
  content: "";
  width: 12px;
  height: 12px;
  margin-left: 8px;
  display: inline-block;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: divvieSpin .62s linear infinite;
}
@keyframes divvieSpin { to { transform: rotate(360deg); } }

/* Lightweight skeletons for account data instead of blank/jumping panels. */
.skeleton-row {
  min-height: 68px;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  overflow: hidden;
}
.skeleton-avatar,
.skeleton-copy i {
  display: block;
  background: linear-gradient(90deg, #ECEAE5 25%, #F7F6F2 42%, #ECEAE5 62%);
  background-size: 220% 100%;
  animation: divvieShimmer 1.15s ease-in-out infinite;
}
.skeleton-avatar { width: 38px; height: 38px; border-radius: 12px; }
.skeleton-copy { display: grid; gap: 8px; }
.skeleton-copy i { width: 64%; height: 10px; border-radius: 999px; }
.skeleton-copy i:last-child { width: 42%; height: 8px; }
@keyframes divvieShimmer { to { background-position: -220% 0; } }

/* Account tabs: stable sheet size + horizontal carousel motion. */
.account-sheet.account-signed-in { overflow: hidden; }
#signedInPanel:not(.hidden) {
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}
.account-pane-viewport {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
  isolation: isolate;
}
.account-pane-viewport > .account-pane {
  position: absolute;
  inset: 0;
  padding: 1px 2px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  transform: translateZ(0);
}
.account-tabs {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
}
.account-identity-card { flex: 0 0 auto; }

/* Empty states should tell the user what to do next. */
.empty-action {
  min-height: 34px;
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid rgba(113,133,107,.24);
  border-radius: 999px;
  background: #EEF4EB;
  color: #52644D !important;
  font: inherit;
  font-size: 10px;
  font-weight: 900;
}

/* Directional step transitions make the five-step flow feel continuous. */
.flow-panel.flow-active.flow-enter-forward {
  animation: divvieStepForward .28s var(--ease-snappy) both !important;
}
.flow-panel.flow-active.flow-enter-backward {
  animation: divvieStepBackward .28s var(--ease-snappy) both !important;
}
@keyframes divvieStepForward {
  from { opacity: .18; transform: translate3d(26px,0,0); }
  to { opacity: 1; transform: translate3d(0,0,0); }
}
@keyframes divvieStepBackward {
  from { opacity: .18; transform: translate3d(-26px,0,0); }
  to { opacity: 1; transform: translate3d(0,0,0); }
}

/* AI review cues: only flag lines that actually look uncertain. */
.item-row.needs-review {
  border-color: rgba(151,119,63,.36) !important;
  background: #FFFCF5;
}
.review-chip {
  width: fit-content;
  margin-bottom: 7px;
  padding: 4px 7px;
  border: 1px solid #DCCBAA;
  border-radius: 999px;
  background: #FFF4DD;
  color: #735E37;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .02em;
}
.review-chip::before { content: "! "; }

/* Live room changes feel alive without becoming distracting. */
.activity-row.activity-new {
  animation: liveActivityIn .32s var(--ease-snappy) both;
}
.activity-row.activity-new .activity-dot {
  animation: liveDotPulse .8s ease-out 1;
}
@keyframes liveActivityIn {
  from { opacity: 0; transform: translate3d(0,-5px,0); background: #EDF4EA; }
  to { opacity: 1; transform: translate3d(0,0,0); background: #fff; }
}
@keyframes liveDotPulse {
  0% { box-shadow: 0 0 0 0 rgba(113,133,107,.42); }
  100% { box-shadow: 0 0 0 9px rgba(113,133,107,0); }
}
.presence-dot.online { animation: presenceBreath 2.2s ease-in-out infinite; }
@keyframes presenceBreath { 50% { box-shadow: 0 0 0 4px rgba(98,190,55,.13); } }

/* Landing page demonstrates the social behavior instead of only describing it. */
.landing-demo-activity { animation: landingActivity 3.4s ease-in-out infinite; }
.landing-demo-people span:nth-child(3) { animation: landingAvatar 3.4s ease-in-out infinite; }
@keyframes landingActivity {
  0%, 18% { transform: translateY(2px); opacity: .68; }
  28%, 84% { transform: translateY(0); opacity: 1; }
  100% { opacity: .68; }
}
@keyframes landingAvatar { 30% { transform: translateY(-3px); } 45%,100% { transform: translateY(0); } }

/* Secondary containers use spacing more than heavy borders. */
.activity-panel,
.payer-panel,
.tip-splitter,
.totals-editor {
  border-color: rgba(17,17,17,.075) !important;
  box-shadow: none !important;
}
.activity-panel { background: rgba(250,248,243,.64) !important; }

/* Toasts read as quick confirmations, not permanent UI. */
.toast {
  border: 1px solid rgba(255,255,255,.13);
  box-shadow: 0 12px 34px rgba(17,17,17,.18);
}

/* Installed mode: remove browser-ish install affordances and honor safe areas. */
body.standalone-mode #installBtn { display: none !important; }
body.standalone-mode .topbar {
  padding-top: env(safe-area-inset-top);
  height: calc(70px + env(safe-area-inset-top));
}
body.standalone-mode .landing-nav { padding-top: env(safe-area-inset-top); }
body.standalone-mode .flow-nav { padding-bottom: max(9px, env(safe-area-inset-bottom)); }

@media (max-width: 720px) {
  /* A stable native-like account sheet: header/tabs stay put, only pane content scrolls. */
  .account-sheet.account-signed-in {
    height: min(80svh, 720px) !important;
    max-height: min(80svh, 720px) !important;
    padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
  }
  .account-sheet.account-signed-in .account-sheet-head { flex: 0 0 auto; }
  .account-sheet.account-signed-in .account-tabs {
    margin-bottom: 12px;
    background: #EEECE7;
  }
  .account-pane-viewport { touch-action: pan-y; }
  .account-pane-viewport > .account-pane { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }

  /* Main step action stays reachable when a long bill is being edited. */
  .flow-nav {
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
    width: calc(100% - 18px) !important;
    margin-top: 18px;
    padding: 7px !important;
    border: 1.5px solid rgba(17,17,17,.16) !important;
    background: #fff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: var(--shadow-float) !important;
  }

  /* Larger invisible/visible touch targets for tiny destructive controls. */
  .account-close,
  .history-delete,
  .group-delete-btn,
  .icon-btn,
  .remove-item {
    min-width: 40px !important;
    min-height: 40px !important;
  }
  .person-chip > button {
    min-width: 36px;
    min-height: 36px;
    margin: -7px -5px -7px 0;
  }

  /* Inputs and numeric controls are comfortable with the iOS keyboard. */
  .person-form input,
  .join-card input,
  .profile-fields input,
  .item-fields input,
  .money-input input {
    font-size: 16px !important;
  }

  /* Keep the mobile visual hierarchy airy. */
  .card { box-shadow: 0 8px 28px rgba(17,17,17,.045); }
  .activity-panel { margin-top: 14px; }
  .social-quick-add { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .flow-panel.flow-active.flow-enter-forward,
  .flow-panel.flow-active.flow-enter-backward,
  .activity-row.activity-new,
  .activity-row.activity-new .activity-dot,
  .presence-dot.online,
  .landing-demo-activity,
  .landing-demo-people span:nth-child(3),
  .skeleton-avatar,
  .skeleton-copy i,
  button.is-loading::after {
    animation: none !important;
  }
}

/* Keep account pane motion controlled by the directional JS carousel. */
.account-pane-viewport > .account-pane { animation: none !important; }

/* One avatar/status grammar everywhere people appear. */
.avatar,
.mini-avatar,
.social-avatar,
.profile-avatar,
.account-avatar,
.landing-demo-people span {
  font-family: "Manrope", sans-serif;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(17,17,17,.07);
}
.person-chip-copy small,
.social-person-main small,
.summary-detail,
.payment-state,
.inbox-meta {
  font-variant-numeric: tabular-nums;
}

@media (min-width: 721px) {
  .account-sheet.account-signed-in {
    height: 100%;
    display: flex;
    flex-direction: column;
  }
}
