/* Rendus : components. FINAL. Flat rows, pills, one accent.
   Reads tokens.css only. No borders, no shadows (rings are box-shadow spreads). Nothing under 13px. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg-outer); }
body {
  margin: 0;
  background: var(--bg-outer);
  color: var(--ink);
  font: 400 var(--fs-body)/1.35 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}
@media (max-width: 599px) { body { background: var(--bg); } }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; text-align: inherit; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--flare-text); outline-offset: 3px; }
.moment:focus-visible, .sheet:focus-visible { outline: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; letter-spacing: -.01em; }

/* ---------------- shell ---------------- */
.app {
  position: relative;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}
@media (min-width: 600px) { .app { box-shadow: 0 0 0 1px var(--fill); } }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }
.stack { display: flex; flex-direction: column; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }

/* ---------------- header: ONE pattern on every screen ----------------
   [back 48]  Title (left, 32/800)  ............  [0 to 2 icon buttons]
   Top-level screens have no back button; pushed screens have one. The pay link and Home show the wordmark as the title. */
.hdr {
  flex: none;
  display: flex; align-items: center; gap: 4px;
  min-height: calc(var(--sat) + 64px);
  padding: calc(var(--sat) + 8px) calc(var(--gut) - 8px) 4px calc(var(--gut) - 8px);
}
.hdr__t { flex: 1; min-width: 0; padding-left: 8px; font: 800 var(--fs-title)/1.02 var(--font-display); letter-spacing: -.035em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.hdr__t.is-long { font-size: 22px; line-height: 1.05; }
.hdr__back + .hdr__t, .hdr__back + .hdr__grp { padding-left: 0; }
.hdr__grp { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding-left: 8px; }
.hdr__grp .hdr__t { padding-left: 0; flex: 0 1 auto; }
.hdr__end { flex: none; display: flex; align-items: center; }
.icon-btn { width: var(--tap); height: var(--tap); border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--ink); transition: background-color var(--t-fast); }
.icon-btn:active { background: var(--fill); }
.icon-btn svg { display: block; }
.ico { display: block; flex: none; }
.wm { font: 800 22px/1 var(--font-display); letter-spacing: -.045em; color: var(--ink); display: inline-flex; align-items: baseline; }
.wm i { display: inline-block; width: .27em; height: .27em; border-radius: 50%; background: var(--flare); margin-left: .07em; }
.hdr .wm { font-size: 30px; padding-left: 8px; flex: 1; }
.title { font: 800 var(--fs-title)/1.02 var(--font-display); letter-spacing: -.035em; }
.h2 { font: 700 var(--fs-h2)/1.1 var(--font-display); letter-spacing: -.025em; }
.cap { font-size: var(--fs-cap); line-height: 1.3; color: var(--ink-2); font-weight: 500; }
.lbl { font: 600 var(--fs-cap)/1.2 var(--font-ui); color: var(--ink-2); padding: var(--s6) var(--gut) var(--s2); }
.live { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px 0 9px; border-radius: 14px; background: var(--fill); font: 700 var(--fs-cap)/1 var(--font-ui); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--flare); animation: livedot 1.6s ease-in-out infinite; }
@keyframes livedot { 50% { opacity: .35; } }

/* ---------------- amount: the number is the hero ---------------- */
.amt {
  --amt: var(--fs-amt-2);
  display: inline-flex; align-items: flex-start; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: var(--amt); line-height: .92;
  letter-spacing: -.04em; white-space: nowrap;
  font-feature-settings: "kern" 1;
}
.amt--tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; letter-spacing: -.03em; }
.amt__cur { font-size: .4em; margin: .14em .08em 0 0; letter-spacing: 0; font-weight: 700; }
.amt__dec { font-size: .44em; margin: .1em 0 0 .04em; letter-spacing: -.01em; font-weight: 700; opacity: .72; }
.amt--dim { color: var(--ink-3); }
.amt--sm { --amt: var(--fs-amt-4); }
.amt-box { max-width: 100%; display: flex; justify-content: center; }
@keyframes shake { 0%,100% { transform: translateX(0); } 14% { transform: translateX(-9px); } 30% { transform: translateX(8px); } 46% { transform: translateX(-6px); } 62% { transform: translateX(5px); } 78% { transform: translateX(-2px); } }
.is-shake { animation: shake 340ms var(--ease-out); }
.is-nope { color: var(--flare-text); }

/* ---------------- number pad ---------------- */
.pad { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0 calc(var(--gut) + 8px); }
.key {
  height: var(--key-h, 60px);
  display: grid; place-items: center; position: relative;
  font: 600 34px/1 var(--font-display); letter-spacing: -.02em;
  color: var(--ink);
  -webkit-touch-callout: none;
}
.key::before { content: ""; position: absolute; width: 68px; height: 68px; max-height: 100%; border-radius: 50%; background: var(--fill-hi); opacity: 0; transform: scale(.6); transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out); }
.key.is-down::before { opacity: 1; transform: scale(1); transition-duration: 50ms; }
.key > * { position: relative; }
.key--ico { color: var(--ink); }
.key[data-k='.'] span { font-size: 46px; line-height: .6; }

/* ---------------- pills ---------------- */
.pill {
  --h: 56px;
  height: var(--h); min-width: 120px; padding: 0 28px;
  border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--fill); color: var(--ink);
  font: 700 18px/1 var(--font-display); letter-spacing: -.015em; white-space: nowrap;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-fast), opacity var(--t-fast), filter var(--t-fast);
  position: relative; overflow: hidden;
}
.pill:active { transform: scale(.97); }
.pill--primary { background: var(--flare); color: var(--on-flare); }
.pill--primary:active { filter: brightness(.93); }
.pill--ink { background: var(--ink); color: var(--bg); }
.pill--dark { background: #0A0A0B; color: var(--flare); }
.pill--block { width: 100%; }
.pill--sm { --h: 44px; min-width: 0; padding: 0 20px; font-size: 16px; }
.pill[aria-disabled="true"] { background: var(--fill); color: var(--ink-3); }
.pill[aria-disabled="true"]:active { transform: none; filter: none; }
.pill--ink[aria-disabled="true"] { background: var(--ink); color: var(--bg); } /* a finished state (Paid, Kept), not a disabled one */
.pill-row { display: flex; gap: var(--s3); }
.pill-row > .pill { flex: 1; min-width: 0; padding: 0 12px; }
.link { font: 600 16px/1 var(--font-ui); color: var(--ink-2); min-height: 44px; padding: 0 var(--s4); display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--r-pill); }
.link:active { background: var(--fill); }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: rot 520ms linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
/* the primary pill sits on a fade so a list can scroll under it without a clipped row showing */
.cta { flex: none; position: relative; padding: var(--s3) var(--gut) 38px; background: var(--bg); } /* 38px clears the raised centre disc of the nav */
.cta--nonav { padding-bottom: calc(var(--sab) + 16px); }
.cta::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 44px; background: linear-gradient(0deg, var(--bg) 12%, transparent); pointer-events: none; }
.cta--stack { display: flex; flex-direction: column; gap: var(--s3); }

/* ---------------- avatars ---------------- */
.av {
  --s: 48px;
  position: relative; flex: none;
  width: var(--s); height: var(--s); border-radius: 50%;
  background: var(--tone, var(--p0)); color: var(--on-p);
  display: grid; place-items: center;
  font: 700 calc(var(--s) * .44)/1 var(--font-display); letter-spacing: -.03em;
  user-select: none;
}
.av--20 { --s: 20px; } .av--24 { --s: 24px; } .av--28 { --s: 28px; } .av--32 { --s: 32px; } .av--36 { --s: 36px; }
.av--40 { --s: 40px; } .av--44 { --s: 44px; } .av--52 { --s: 52px; } .av--56 { --s: 56px; } .av--64 { --s: 64px; } .av--72 { --s: 72px; }
.av--96 { --s: 96px; } .av--120 { --s: 120px; } .av--168 { --s: 168px; }
.av--ring { box-shadow: 0 0 0 2.5px var(--ring-bg, var(--bg)), 0 0 0 5px var(--flare); }
.av--ink { box-shadow: 0 0 0 2.5px var(--ring-bg, var(--bg)), 0 0 0 5px var(--ink); }
.av--hush { box-shadow: 0 0 0 2.5px var(--ring-bg, var(--bg)), 0 0 0 4.5px var(--fill-hi); }
.av--live::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid var(--ink-2); opacity: 0; animation: ping 1.9s var(--ease-out) infinite; pointer-events: none; }
.av--live-flare::after { border-color: var(--flare); }
@keyframes ping { 0% { transform: scale(.82); opacity: .95; } 100% { transform: scale(1.1); opacity: 0; } }
.av--off { background: var(--fill-hi); color: var(--ink-2); }
.av__bdg {
  position: absolute; right: -3px; bottom: -3px; width: max(18px, 36%); height: max(18px, 36%); border-radius: 50%;
  background: var(--flare); color: var(--on-flare); display: grid; place-items: center;
  box-shadow: 0 0 0 2.5px var(--ring-bg, var(--bg));
}
.av__bdg--ink { background: var(--ink); color: var(--bg); }
.av__bdg svg { width: 62%; height: 62%; }
.av-stack { display: inline-flex; }
.av-stack .av + .av { margin-left: calc(var(--s, 28px) * -.2); }
.av-stack .av { box-shadow: 0 0 0 2px var(--ring-bg, var(--bg)); }
.av-stack .av--ring { box-shadow: 0 0 0 2px var(--ring-bg, var(--bg)), 0 0 0 4px var(--flare); }
.av-stack--flat .av + .av { margin-left: 4px; }
.av-stack--flat .av { box-shadow: none; }
.av--more { background: var(--fill-hi); color: var(--ink); font-size: calc(var(--s) * .38); }

/* ---------------- rows: flat, big avatars, no borders ---------------- */
.row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 12px var(--gut); text-align: left; position: relative; transition: background-color var(--t-fast); }
button.row:active, a.row:active { background: var(--fill); transition-duration: 40ms; }
.row--sm { min-height: 60px; }
.row__main { flex: 1; min-width: 0; }
.row__t { font: 600 var(--fs-row)/1.22 var(--font-ui); letter-spacing: -.005em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.row__s { font: 400 var(--fs-body)/1.3 var(--font-ui); color: var(--ink-2); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.row__end { flex: none; text-align: right; font: 700 var(--fs-row)/1.15 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.01em; max-width: 46%; }
.row__end small { display: block; font: 500 var(--fs-cap)/1.3 var(--font-ui); color: var(--ink-2); margin-top: 2px; letter-spacing: 0; }
.row .chev { color: var(--ink-3); }
.row .pill--sm { margin-right: -4px; }
.row__ico { width: 28px; display: grid; place-items: center; color: var(--ink-2); flex: none; }
.row--muted .row__t, .row--muted .row__end { color: var(--ink-2); }
/* a day chip: Fri / 13 */
.when { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 48px; height: 48px; flex: none; font: 700 var(--fs-cap)/1 var(--font-display); color: var(--ink-2); letter-spacing: -.01em; }
.when b { font: 800 22px/1 var(--font-display); color: var(--ink); letter-spacing: -.03em; margin-top: 3px; }
/* a claim mark: ring when it is not mine, flare disc when it is */
.mark { width: 48px; height: 48px; flex: none; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 2.5px var(--ink-3); color: var(--on-flare); transition: background-color var(--t-fast), box-shadow var(--t-fast); }
.mark.on { box-shadow: none; background: var(--flare); }
.row__sub { display: flex; align-items: center; gap: 8px; margin-top: 6px; min-height: 26px; font: 500 var(--fs-body)/1 var(--font-ui); color: var(--ink-2); }

/* ---------------- chips, slices, slice bar ---------------- */
.chip { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--r-pill); background: var(--fill); font: 600 15px/1 var(--font-ui); white-space: nowrap; transition: transform var(--t-press) var(--ease-out), background-color var(--t-fast); }
.chip:active { transform: scale(.97); }
.chip--on { background: var(--ink); color: var(--bg); }
.chip--flare { background: var(--flare); color: var(--on-flare); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--flare); flex: none; }
.chip b { font: 700 15px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.chip-row { display: flex; gap: var(--s2); flex-wrap: wrap; }
/* a fixed slot of chips under the header: scrolls, never reflows the hero */
.strip { flex: none; height: 52px; display: flex; align-items: center; gap: var(--s2); padding: 0 var(--gut); overflow-x: auto; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip .chip { flex: none; max-width: 80%; overflow: hidden; text-overflow: ellipsis; }
/* two-line chip: what is open (name over amount). Two of them share the strip. */
.strip--two { height: 68px; }
.strip--two .chip { flex: 1 1 0; min-width: 0; max-width: none; height: 56px; border-radius: 28px; padding: 0 18px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px; }
.chip__a { display: flex; align-items: center; gap: 7px; max-width: 100%; font: 600 var(--fs-cap)/1 var(--font-ui); color: var(--ink-2); }
.chip__a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip__b { font: 700 19px/1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
/* the slice: a pill whose far end is cut at 20 degrees. Amounts, shares, counts. */
.slice {
  --h: 32px; --c: calc(var(--h) * var(--cut));
  display: inline-flex; align-items: center; gap: 6px; height: var(--h);
  padding: 0 calc(var(--c) + 12px) 0 14px;
  border-radius: var(--r-pill) 0 0 var(--r-pill);
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--c)) 100%, 0 100%);
  background: var(--fill); color: var(--ink);
  font: 700 15px/1 var(--font-display); letter-spacing: -.005em; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.slice--rev { padding: 0 14px 0 calc(var(--c) + 12px); border-radius: 0 var(--r-pill) var(--r-pill) 0; clip-path: polygon(var(--c) 0, 100% 0, 100% 100%, 0 100%); }
.slice--flare { background: var(--flare); color: var(--on-flare); }
.slice--tone { background: var(--tone); color: var(--on-p); }
.slice--lg { --h: 40px; font-size: 17px; padding-left: 18px; padding-right: calc(var(--c) + 16px); }
.slice--sm { --h: 28px; font-size: var(--fs-cap); padding-left: 11px; padding-right: calc(var(--c) + 9px); }
.slice--ink { background: var(--ink); color: var(--bg); }
.slice .dim { opacity: .6; }
/* slice bar: one parallelogram per person; lit = paid */
.sbar { --h: 16px; --c: calc(var(--h) * var(--cut)); display: flex; gap: 4px; height: var(--h); width: 100%; }
.sbar > i { flex: 1; min-width: 6px; background: var(--fill-hi); clip-path: polygon(var(--c) 0, 100% 0, calc(100% - var(--c)) 100%, 0 100%); position: relative; overflow: hidden; }
.sbar > i::after { content: ""; position: absolute; inset: 0; background: var(--flare); transform: scaleY(0); transform-origin: 50% 100%; transition: transform 520ms var(--ease-pour); }
.sbar > i.on::after { transform: scaleY(1); }
/* the drain: the snap countdown */
.drain { --h: 14px; --c: calc(var(--h) * var(--cut)); width: 100%; height: var(--h); background: var(--fill-hi); border-radius: var(--h) 0 0 var(--h); clip-path: polygon(0 0, 100% 0, calc(100% - var(--c)) 100%, 0 100%); position: relative; overflow: hidden; }
.drain i { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--p, 0) * 100%); background: var(--flare); clip-path: polygon(0 0, 100% 0, calc(100% - var(--c)) 100%, 0 100%); transition: width 900ms var(--ease-pour); }

/* ---------------- who is here: big avatars, presence as ring state ---------------- */
.here { flex: none; display: flex; gap: 4px; padding: 10px calc(var(--gut) - 6px) 4px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 20px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 20px), transparent); }
.here::-webkit-scrollbar { display: none; }
.here.fits { -webkit-mask-image: none; mask-image: none; justify-content: space-between; }
.who { flex: none; width: clamp(52px, 16vw, 64px); display: flex; flex-direction: column; align-items: center; gap: 9px; padding-top: 7px; scroll-snap-align: start; }
.who__n { max-width: 100%; font: 600 var(--fs-cap)/1 var(--font-ui); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who--me .who__n { color: var(--ink); }
.here .chip { align-self: flex-start; margin-top: 8px; flex: none; }

/* ---------------- bottom navigation: Home, Spaces, TAB (centre), Activity, You ---------------- */
.nav {
  flex: none; position: relative; z-index: 5;
  display: grid; grid-template-columns: 1fr 1fr 1.15fr 1fr 1fr; align-items: stretch;
  height: calc(68px + var(--sab)); padding-bottom: var(--sab);
  background: var(--bg);
}
.nav::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 22px; background: linear-gradient(0deg, var(--bg), transparent); pointer-events: none; }
.nav__i { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink-2); font: 600 var(--fs-cap)/1 var(--font-ui); min-height: 48px; transition: color var(--t-fast); }
.nav__i:active { transform: scale(.94); transition: transform var(--t-press); }
.nav__i[aria-current="page"] { color: var(--ink); font-weight: 700; }
.nav__i[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 50%; width: 26px; height: 4px; margin-left: -13px; background: var(--flare); clip-path: polygon(0 0, 100% 0, calc(100% - 2px) 100%, 0 100%); border-radius: 3px 0 0 3px; }
.nav__me .av { box-shadow: 0 0 0 2px var(--bg); }
.nav__i[aria-current="page"] .nav__me .av { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.nav__c { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; padding-bottom: 12px; color: var(--ink-2); font: 600 var(--fs-cap)/1 var(--font-ui); }
.nav__c[aria-current="page"] { color: var(--ink); font-weight: 700; }
.nav__cb {
  position: relative; width: 64px; height: 64px; margin-top: -26px; border-radius: 50%;
  background: var(--ink); color: var(--bg);
  display: grid; place-items: center;
  box-shadow: 0 0 0 7px var(--bg);
  transition: transform var(--t-press) var(--ease-out);
}
.nav__c:active .nav__cb { transform: scale(.94); }
.nav__cb::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 2px solid var(--flare); opacity: 0; animation: ping 2.2s var(--ease-out) infinite; pointer-events: none; }
.nav__cb::before { content: ""; position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--flare); box-shadow: 0 0 0 3px var(--bg); }
.nav__cb[data-live="off"]::after, .nav__cb[data-live="off"]::before { display: none; }

@media (max-width: 359px) { .hdr__grp .hdr__t { font-size: 22px; } .link { padding: 0 10px; } }
@media (max-height: 640px) {
  .hdr { min-height: calc(var(--sat) + 52px); padding-top: calc(var(--sat) + 2px); }
  .nav { height: calc(60px + var(--sab)); }
  .nav__cb { width: 54px; height: 54px; margin-top: -20px; box-shadow: 0 0 0 5px var(--bg); }
  .nav__cb svg { width: 28px; height: 28px; }
  .nav__c { padding-bottom: 8px; }
  .pill { --h: 52px; }
  .strip { height: 44px; }
  .strip--two { height: 52px; }
  .strip--two .chip { flex: 0 0 auto; height: 44px; padding: 0 14px; flex-direction: row; align-items: center; gap: 8px; }
  .chip__a span { max-width: 12ch; }
  .chip__b { font-size: 15px; }
}

/* a spring pop for anything that arrives: a person confirming, a reaction */
.pop { animation: pop 420ms var(--ease-spring); }
@keyframes pop { 0% { transform: scale(.82); opacity: .4; } 100% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pop { animation: none; } }

/* ---------------- fields: the only text input, for words (a place, a name), never for money ---------------- */
.field { display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 20px; border-radius: var(--r-pill); background: var(--fill); font: 500 17px/1 var(--font-ui); }
.field input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; font-size: 17px; caret-color: var(--flare); }
.field input::placeholder { color: var(--ink-2); }
.field:focus-within { box-shadow: inset 0 0 0 2px var(--ink); }
.field--big { height: auto; padding: 0; background: none; border-radius: 0; }
.field--big input { font: 800 44px/1.1 var(--font-display); letter-spacing: -.04em; height: auto; padding: 8px 0; }
.field--big input::placeholder { color: var(--ink-3); }
.field--big:focus-within { box-shadow: none; }

/* ---------------- sheet ---------------- */
.scrim { position: fixed; inset: 0; z-index: 80; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity var(--t-base) var(--ease-out); }
.scrim.is-open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 90; left: 50%; bottom: 0; width: 100%; max-width: 430px;
  transform: translate(-50%, 100%); visibility: hidden;
  background: var(--bg-raised); --ring-bg: var(--bg-raised);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  padding: 0 0 calc(var(--sab) + 20px);
  max-height: 90vh; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain;
  transition: transform var(--t-sheet) var(--ease-drawer), visibility 0s linear var(--t-sheet);
  scrollbar-width: none;
}
.sheet::-webkit-scrollbar { display: none; }
.sheet.is-open { transform: translate(-50%, 0); visibility: visible; transition-delay: 0s; }
.sheet.is-drag { transition: none; }
.sheet__grab { display: block; width: 100%; height: 28px; position: sticky; top: 0; z-index: 2; background: var(--bg-raised); touch-action: none; cursor: grab; }
.sheet__grab::after { content: ""; position: absolute; left: 50%; top: 11px; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: var(--fill-hi); }
.sheet__hd { padding: var(--s2) var(--gut) var(--s4); }
.sheet__ft { padding: var(--s4) var(--gut) 0; }
/* a tall sheet whose top is a flood of flare (the pay moment) */
.sheet--flood { padding-bottom: calc(var(--sab) + 20px); }
.sheet--flood .sheet__grab { background: transparent; position: absolute; }
.sheet--flood .sheet__grab::after { background: rgb(10 10 11 / .28); }

/* ---------------- flood: a block of the one colour with a wave edge. The pay moment, not a card. ---------------- */
.flood { position: relative; background: var(--flare); color: var(--on-flare); padding: 40px var(--gut) 28px; text-align: center; margin-bottom: 21px; }
.flood::after {
  content: ""; position: absolute; left: 0; right: 0; top: calc(100% - 1px); height: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 22'%3E%3Cpath fill='%23FF5B1F' d='M0 0V11C17.5 22 52.5 22 70 11S122.5 0 140 11V0Z'/%3E%3C/svg%3E") repeat-x 0 0 / 140px 22px;
}
.flood .cap { color: rgb(10 10 11 / .84); font-weight: 600; }
.flood .amt { color: #0A0A0B; }
.flood .av { --ring-bg: var(--flare); }
.flood .slice { background: #0A0A0B; color: var(--flare); }

/* ---------------- toast: top, never over the primary pill ---------------- */
.toast {
  position: fixed; z-index: 300; left: 50%; top: calc(var(--sat) + 10px);
  transform: translate(-50%, -140%); max-width: calc(100% - 32px);
  background: var(--ink); color: var(--bg);
  padding: 12px 20px; border-radius: var(--r-pill);
  font: 700 15px/1.2 var(--font-display); letter-spacing: -.01em; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;
  transition: transform 360ms var(--ease-drawer);
  pointer-events: none;
}
.toast.is-on { transform: translate(-50%, 0); }

/* ---------------- states: empty, offline, error ---------------- */
.state { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 0 var(--gut) var(--s8); }
.state__g { width: 112px; height: 112px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; color: var(--ink); margin-bottom: 6px; }
.state__g--flare { background: var(--flare); color: var(--on-flare); }
.state__t { font: 800 34px/1.02 var(--font-display); letter-spacing: -.035em; max-width: 12em; }
.state__s { font: 400 var(--fs-row)/1.3 var(--font-ui); color: var(--ink-2); max-width: 17em; }
.state .pill { margin-top: 10px; min-width: 200px; }
.banner { flex: none; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 var(--gut); background: var(--fill); font: 600 15px/1.2 var(--font-ui); }
.banner svg { color: var(--ink-2); }
.err-line { font: 700 15px/1.2 var(--font-display); color: var(--flare-text); }

/* ---------------- option tiles (games, memes): the only tinted blocks ---------------- */
.opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 var(--gut) 12px; }
.opt { aspect-ratio: 1; border-radius: var(--r-card); background: var(--tone, var(--fill)); color: var(--on-p); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 10px; font: 800 17px/1.05 var(--font-display); letter-spacing: -.03em; text-align: center; transition: transform var(--t-press) var(--ease-out); }
.opt:active { transform: scale(.96); }
.opt.on { box-shadow: 0 0 0 3px var(--bg-raised), 0 0 0 6px var(--flare); }
.opt--n { background: var(--fill); color: var(--ink); }
.opt--off { background: var(--fill); color: var(--ink-2); }

/* ---------------- chat bubbles (@rendus) ---------------- */
.bubble { max-width: 86%; padding: 14px 18px; border-radius: 22px; font: 500 var(--fs-row)/1.3 var(--font-ui); }
.bubble--me { align-self: flex-end; background: var(--fill-hi); border-bottom-right-radius: 8px; }
.bubble--rn { align-self: flex-start; padding-left: 0; }

/* ---------------- the moment: a full-bleed pour of the one colour ---------------- */
.moment {
  position: fixed; z-index: 200; top: 0; bottom: 0; left: 50%; width: 100%; max-width: 430px;
  transform: translateX(-50%); overflow: hidden; visibility: hidden;
  display: flex; flex-direction: column; color: var(--on-flare);
}
.moment.is-on { visibility: visible; }
.moment__fill { position: absolute; inset: 0; background: var(--flare); transform: translateY(104%); will-change: transform; }
.moment__fill::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(100% - 1px); height: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 22'%3E%3Cpath fill='%23FF5B1F' d='M0 22V11C17.5 0 52.5 0 70 11S122.5 22 140 11V22Z'/%3E%3C/svg%3E") repeat-x 0 100% / 140px 22px;
  transform-origin: 50% 100%;
  transform: scaleY(var(--wv, 1));
  transition: transform 380ms var(--ease-out);
  animation: drift 1.1s linear infinite;
}
@keyframes drift { to { background-position-x: 140px; } }
.moment__body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: var(--s4); padding: calc(var(--sat) + 16px) var(--gut) 0; opacity: 0; }
.moment__foot { position: relative; padding: var(--s4) var(--gut) calc(var(--sab) + 24px); opacity: 0; }
.moment__alt { display: flex; margin: 8px auto 0; color: #0A0A0B; }
.moment__alt:active { background: rgb(10 10 11 / .12); }
.moment .amt-box { width: 100%; }
.moment__wm { position: absolute; z-index: 1; top: calc(var(--sat) + 22px); left: var(--gut); color: #0A0A0B; opacity: 0; }
.moment__wm.wm i { background: #0A0A0B; }
.moment.is-in .moment__wm { opacity: 1; transition: opacity 400ms 200ms; }
.moment__rip { position: absolute; left: 50%; top: 46%; width: 220px; height: 220px; margin: -110px 0 0 -110px; border-radius: 50%; border: 2px solid rgb(10 10 11 / .22); opacity: 0; pointer-events: none; }
.moment.is-in .moment__rip { animation: rip 1500ms var(--ease-out) both; }
.moment.is-in .moment__rip:nth-of-type(2) { animation-delay: 140ms; }
.moment.is-in .moment__rip:nth-of-type(3) { animation-delay: 280ms; }
@keyframes rip { 0% { transform: scale(.35); opacity: .9; } 100% { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .moment__rip { display: none; } }
.moment__word { font: 800 28px/1 var(--font-display); letter-spacing: -.03em; }
.moment__sub { font: 600 20px/1.1 var(--font-display); letter-spacing: -.02em; color: rgb(10 10 11 / .84); }
.moment__chk { width: 64px; height: 64px; border-radius: 50%; background: #0A0A0B; display: grid; place-items: center; }
.moment__chk svg { width: 34px; height: 34px; color: var(--flare); }
.moment__chk path { stroke-dasharray: 32; stroke-dashoffset: 32; }
.moment.is-in .moment__chk path { animation: draw 380ms var(--ease-out) 120ms forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.moment .av { --ring-bg: var(--flare); }
.moment .amt { color: #0A0A0B; }
@media (prefers-reduced-motion: reduce) { .moment__fill::before { animation: none; } .moment__chk path { stroke-dashoffset: 0; } }

/* ---------------- switch ---------------- */
.switch { position: relative; width: 54px; height: 32px; border-radius: 16px; background: var(--fill-hi); flex: none; transition: background-color var(--t-fast); }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); transition: transform 260ms var(--ease-out); }
.switch[aria-checked="true"] { background: var(--flare); }
.switch[aria-checked="true"]::after { transform: translateX(22px); background: #0A0A0B; }

/* ---------------- you: stats and badges are numbers and discs, not boxes ---------------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; padding: var(--s4) var(--gut) var(--s2); }
.stat b { display: block; font: 800 44px/1 var(--font-display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 6px; font: 500 var(--fs-cap)/1.2 var(--font-ui); color: var(--ink-2); }
.badges { display: flex; gap: 14px; padding: 0 var(--gut) var(--s4); overflow-x: auto; scrollbar-width: none; }
.badges::-webkit-scrollbar { display: none; }
.badge { flex: none; width: 76px; display: flex; flex-direction: column; align-items: center; gap: 8px; font: 600 var(--fs-cap)/1.15 var(--font-ui); text-align: center; color: var(--ink-2); }
.badge i { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--tone); color: var(--on-p); }
.badge--off i { background: var(--fill); color: var(--ink-3); }

/* press feedback where hover exists must not stick on touch */
@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover, .link:hover { background: var(--fill); }
  button.row:hover, a.row:hover { background: var(--fill); }
}
@media (prefers-reduced-motion: reduce) {
  .av--live::after, .nav__cb::after { animation: none; }
  .is-shake { animation: none; }
  .live i { animation: none; }
}

/* a glyph disc: the avatar-sized home for an icon in a row (modes, games, settings) */
.glyph { width: 48px; height: 48px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; flex: none; color: var(--ink); }
.glyph--flare { background: var(--flare); color: var(--on-flare); }
.glyph--tone { background: var(--tone); color: var(--on-p); }
.glyph--lg { width: 64px; height: 64px; }
