/*
 * Receiver web page styling (PRD §10.2.1). Mirrors the app's §4 itemized layout in
 * our design system (tokens.css). Reads honestly as "xyzwallet live split": no fake
 * native chrome (no fake tab bar / status bar). Phone-first, centered on wide screens.
 */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-system);
  font-size: var(--size-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

.tabular { font-variant-numeric: tabular-nums; }

/* Page shell — a single phone-width column, centered. */
.shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Honest brand bar — "xyzwallet live split", not faked native chrome. */
.brandbar {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-md) var(--space-sm);
}
.brandbar .wordmark {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--brand-primary);
}
.brandbar .tagline {
  font-size: var(--size-footnote);
  color: var(--text-muted);
}

.screen {
  flex: 1;
  padding: 0 var(--space-md) var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Typography roles */
.t-title { font-size: var(--size-title); line-height: var(--lh-title); font-weight: 700; margin: 0; }
.t-headline { font-size: var(--size-headline); line-height: var(--lh-headline); font-weight: 600; margin: 0; }
.t-body { font-size: var(--size-body); line-height: var(--lh-body); margin: 0; }
.t-subhead { font-size: var(--size-subhead); line-height: var(--lh-subhead); color: var(--text-muted); margin: 0; }
.t-footnote { font-size: var(--size-footnote); line-height: var(--lh-footnote); color: var(--text-muted); margin: 0; }
.t-caption {
  font-size: var(--size-caption); line-height: var(--lh-caption);
  font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase;
  color: var(--text-muted); margin: 0;
}
.t-flavor { font-family: var(--font-flavor); font-size: 14px; line-height: 19px; color: var(--text-muted); }

.amount-lg { font-size: var(--size-amount-lg); line-height: var(--lh-amount-lg); font-weight: 700; }
.amount-md { font-size: var(--size-amount-md); line-height: var(--lh-amount-md); font-weight: 600; }
.owed { color: var(--status-owed); }
.you-owe { color: var(--status-you-owe); }
.muted { color: var(--text-muted); }
.center { text-align: center; }

/* Cards & rows */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.card.tint { background: var(--summary-bg); }
.card.soft { background: var(--bg-tint-soft); }

.row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-height: var(--tap-min);
}
/* Flex filler so the trailing element (amount, tag, "Tap →") right-aligns. Global utility,
   used by .row, .pick (identify), and .claim-item (honor) so amounts line up on the right. */
.grow { flex: 1; min-width: 0; }
.hairline { height: 1px; background: var(--hairline); border: 0; margin: var(--space-xs) 0; }

/* Avatars — user (generative indigo) vs guest (dashed neutral ring, §12 treatment) */
.avatar {
  width: 40px; height: 40px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--size-subhead); font-weight: 700; flex: 0 0 auto;
}
.avatar.user { background: var(--brand-primary); color: var(--on-brand); }
.avatar.guest {
  background: transparent; color: var(--text-muted);
  border: 1.5px dashed var(--text-muted);
  font-weight: 600;
}
.avatar.sm { width: 28px; height: 28px; font-size: var(--size-footnote); }

/* Buttons */
.btn {
  appearance: none; border: 0; cursor: pointer;
  font-family: inherit; font-size: var(--size-headline); font-weight: 600;
  min-height: var(--tap-min); border-radius: var(--radius-pill);
  padding: 0 var(--space-lg);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm);
  width: 100%;
}
.btn.primary { background: var(--brand-primary); color: var(--on-brand); }
.btn.primary:active { opacity: 0.85; }
.btn.ghost { background: transparent; color: var(--brand-primary); }
.btn.surface { background: var(--bg-surface); color: var(--text-primary); }
.btn:disabled, .btn.disabled {
  background: var(--bg-surface); color: var(--text-muted);
  cursor: not-allowed; opacity: 1;
}
.btn-link {
  appearance: none; background: none; border: 0; cursor: pointer;
  color: var(--brand-primary); font-family: inherit; font-size: var(--size-subhead);
  padding: var(--space-sm); font-weight: 600;
}

/* Selectable party / item rows */
.pick {
  appearance: none; cursor: pointer; text-align: left; width: 100%;
  background: var(--bg-surface); border: 1.5px solid transparent;
  border-radius: var(--radius-md); padding: var(--space-sm) var(--space-md);
  display: flex; align-items: center; gap: var(--space-md);
  min-height: var(--tap-min); color: var(--text-primary); font-family: inherit;
  font-size: var(--size-body);
}
.pick.selected { border-color: var(--brand-primary); background: var(--summary-bg); }
.pick .check {
  margin-left: auto; color: var(--brand-primary); font-weight: 700; opacity: 0;
}
.pick.selected .check { opacity: 1; }

/* Honor claim item: one big tap target. Tapping fills the whole row + shows a checkmark. */
.claim-item {
  appearance: none; cursor: pointer; width: 100%; text-align: left; font-family: inherit;
  display: flex; align-items: center; gap: var(--space-md);
  background: var(--bg-surface); color: var(--text-primary);
  border: 2px solid transparent; border-radius: var(--radius-md);
  padding: var(--space-md); min-height: 56px; font-size: var(--size-body);
  transition: background 0.12s ease, border-color 0.12s ease;
}
.claim-item.claimed { background: var(--summary-bg); border-color: var(--brand-primary); }
.claim-name { font-weight: 600; }
.claim-ic {
  width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%;
  border: 2px solid var(--hairline); display: inline-flex; align-items: center; justify-content: center;
  color: var(--on-brand); font-weight: 800; font-size: 14px;
}
.claim-item.claimed .claim-ic { background: var(--brand-primary); border-color: var(--brand-primary); }

/* Live animated status: a pulsing dot (waiting) or a checkmark (ready). Shared by the
   host-unlock gate and the Honor waiting / everyone's-in states. */
.gate { gap: var(--space-md); }
.live-status {
  display: flex; align-items: center; gap: var(--space-sm);
  background: var(--bg-canvas);
  border: 1.5px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--size-subhead); font-weight: 600;
}
.live-status.waiting { border-color: var(--status-you-owe); color: var(--status-you-owe); }
.live-status.ready { border-color: var(--status-owed); color: var(--status-owed); }
.live-ic { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--status-you-owe); position: relative; }
.live-dot::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: var(--status-you-owe); animation: live-pulse 1.4s ease-out infinite;
}
@keyframes live-pulse { 0% { transform: scale(1); opacity: 0.55; } 100% { transform: scale(2.6); opacity: 0; } }
.live-check { color: var(--status-owed); font-weight: 800; font-size: 16px; }
@media (prefers-reduced-motion: reduce) { .live-dot::after { animation: none; } }

/* "Your share" highlight band */
.you-band {
  background: var(--summary-bg);
  border: 1.5px solid var(--brand-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}

/* Breakdown person block */
.person { display: flex; flex-direction: column; gap: var(--space-xs); }
.person .line { display: flex; justify-content: space-between; gap: var(--space-md); }
.person .sub { font-size: var(--size-footnote); color: var(--text-muted); }
.person .sub .lbl { display: inline-block; }

/* Notices / banners */
.banner {
  border-radius: var(--radius-md); padding: var(--space-sm) var(--space-md);
  font-size: var(--size-subhead);
}
.banner.info { background: var(--summary-bg); color: var(--text-primary); }
.banner.warn { background: var(--bg-surface); color: var(--status-you-owe); }
.pill-flag {
  display: inline-block; font-size: var(--size-caption); font-weight: 700;
  letter-spacing: 0.4px; text-transform: uppercase;
  color: var(--text-muted); background: var(--bg-surface);
  border: 1px dashed var(--hairline);
  border-radius: var(--radius-pill); padding: 2px 10px;
}

/* Pay mark (placeholder brand artwork — not official trademark, swap pre-launch) */
.paymark {
  width: 24px; height: 24px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #fff; flex: 0 0 auto;
}
.paymark.venmo { background: #3d95ce; }
.paymark.cashapp { background: #00d54b; }
.paymark.generic { background: var(--brand-primary); }

/* Dev scenario switcher — clearly labeled, removable. */
.dev-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: #101019; color: #f4f2e6;
  border-top: 2px solid var(--status-you-owe);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  font-size: 12px; line-height: 1.3;
}
.dev-panel .dev-head {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; letter-spacing: 0.4px; margin-bottom: 8px;
}
.dev-panel .dev-head .tag { color: var(--status-you-owe); text-transform: uppercase; }
.dev-note { margin: 0 0 8px; color: #9a9aa2; font-size: 11px; line-height: 1.4; }
.dev-note b { color: #f4f2e6; font-weight: 700; }
.dev-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dev-grid label { display: block; color: #9a9aa2; margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.4px; font-size: 10px; }
.dev-seg { display: flex; gap: 0; border: 1px solid #3a3a47; border-radius: 8px; overflow: hidden; }
.dev-seg button {
  flex: 1; appearance: none; border: 0; cursor: pointer;
  background: #1e1e27; color: #9a9aa2; font-family: inherit; font-size: 11px;
  padding: 6px 4px;
}
.dev-seg button.on { background: var(--brand-primary); color: #101019; font-weight: 700; }
.dev-panel .dev-reset {
  appearance: none; border: 1px solid #3a3a47; background: transparent; color: #f4f2e6;
  border-radius: 8px; padding: 4px 10px; cursor: pointer; font-family: inherit; font-size: 11px;
}
.dev-spacer { height: 220px; } /* keeps content clear of the fixed dev panel */
