/*
 * Token names match bridge getTheme / window.__theme (same GistedColors
 * light/dark values as apps/contacts/styles.css). Update the shell palette
 * first if it changes — do not invent a second Finance palette.
 */
:root {
  --surface: #FFFBF8;
  /* A switch's knob: light on both the off grey and the on green. */
  --switch-knob: #FFFFFF;
  --surface-low: #FFF3EC;
  --ink: #2A1710;
  --muted: #8A5A1E;
  --primary: #A8412A;
  --outline: #8C756B;
  --line: #E0CFC6;
  --danger: #8C3A26;
  --danger-container: #FBE0DA;
  /* Positive/confirming green (Accept swipe action). Deliberately a distinct
     hue from --primary/--danger (both warm clay/red) so Accept reads
     unmistakably apart from Decline. Pairs with --on-primary (near-white)
     text in light mode. */
  --success: #2F6B4A;
  --on-primary: #FFFBF8;
  /* Money-state semantics (approved design): settled = green, part-paid =
     amber, unpaid = --danger. Local to finance — the shared GistedColors
     palette carries no success/warning hue, and clay (--primary) is now
     reserved for actions, not "paid". __theme does not provide these, so
     both light and dark values live here. */
  /* Light --good was #2E8B63: 4.09:1 on --surface, 3.86:1 on --surface-low.
     #23704F (Contacts' value) is 5.83:1 / 5.51:1. Light --warn was #B4740E
     (3.75:1 / 3.54:1); #8F5A00 is 5.62:1 / 5.31:1, and still reads amber.
     design_system_test.js recomputes every ratio. */
  --good: #23704F;
  --warn: #8F5A00;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;

  /* The type scale: the receiver's five roles (apps/receiver/lib/theme/
     gisted_theme.dart), defined once. Every text rule below uses one of
     them; nothing is set smaller than the label role. Money figures keep
     their own display sizes (--type-money-hero / --type-money), always with
     tabular numerals. */
  --fs-title: 30px;
  --lh-title: 1.2;
  --fs-heading: 22px;
  --lh-heading: 1.25;
  --fs-row: 16px;
  --lh-row: 1.3;
  --fs-body: 14px;
  --lh-body: 1.45;
  --fs-label: 11px;
  --lh-label: 1.2;
  --ls-label: 0.8px;
  --type-title: 600 var(--fs-title) / var(--lh-title) var(--font);
  --type-heading: 600 var(--fs-heading) / var(--lh-heading) var(--font);
  --type-row: 600 var(--fs-row) / var(--lh-row) var(--font);
  --type-body: 400 var(--fs-body) / var(--lh-body) var(--font);
  --type-label: 600 var(--fs-label) / var(--lh-label) var(--font);
  --fs-money-hero: 32px;
  --type-money-hero: 700 var(--fs-money-hero) / 1.1 var(--font);
  --type-money: 600 var(--fs-heading) / var(--lh-heading) var(--font);
  /* Form controls: the row size at regular weight — 16px also keeps iOS
     from zooming a focused field. */
  --control-font: var(--fs-row);
  /* Every tap target is at least this big (spec E). */
  --tap: 44px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  /* Viewport top to the app bar's bottom edge (safe area, padding, the 44px
     row, the hairline). syncTopbarHeight (app.js) measures the real value,
     which grows with a two-line title; this is the first-paint estimate. */
  --topbar-h: calc(var(--safe-top) + 44px + 1.1rem);
  /* Pass 2 (the receiver's kit). The three container roles come over the
     bridge (getTheme / __theme); these are the shell's own values, for a
     page opened outside it. */
  --surface-container-low: #FFF3EC;
  --primary-container: #F6DCCF;
  --secondary-container: #F2E3DA;
  --card: var(--surface-container-low);
  --edge: var(--line);
  --tonal: var(--primary-container);
  --tonal-ink: var(--primary);
  --neutral-pill: var(--secondary-container);
  /* From the page background (body is --surface-low here), so the glass
     bar shows no lighter band over it. */
  --glass: color-mix(in srgb, var(--surface-low) 70%, transparent);
  /* Glow only on heroes, primary CTAs and the tab bar. */
  --glow: 0 0 22px -4px color-mix(in srgb, var(--primary) 30%, transparent);
  /* One radius scale: cards and fields, sheet tops, heroes. */
  --r-card: 16px;
  --r-sheet: 20px;
  --r-hero: 24px;
  /* The tallest pinned sheet CTA stack (three buttons, gaps, padding): a
     focused field scrolls above it, never under it. */
  --sheet-actions-reserve: 180px;
  /* Distance from the viewport bottom to the top of the floating bar: its
     own height, its 0.7rem lift and the safe-area inset. JS re-measures it
     (syncTabbarClearance); this fallback matches the rendered ~66px pill. */
  --nav-h: 66px;
  --tabbar-h: calc(var(--nav-h) + 0.7rem + var(--safe-bottom));
  /* Derived from the (JS-measured) bar so FABs sit above it and list views
     clear it — the old fixed 1rem/4.75rem values were tuned to a 3.75rem bar
     and left FABs under the real ~65px pill and content touching its top. */
  --fab-offset: calc(var(--tabbar-h) + 0.85rem);
  /* Spec E: every scrolling view ends nav height + safe-area inset + 16px
     above the viewport bottom, so its last row clears the floating bar. */
  --fab-clearance: calc(var(--tabbar-h) + 16px);
}

[hidden] {
  display: none !important;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface-container-low: #241B18;
    --primary-container: #3A2620;
    --secondary-container: #2E2320;
    --glow: 0 0 26px -6px color-mix(in srgb, var(--primary) 38%, transparent);
    --surface: #17110F;
    --switch-knob: #F7EDE8;
    --surface-low: #241B18;
    --ink: #F7EDE8;
    --muted: #F0C08A;
    --primary: #E8845F;
    --outline: #8E7F79;
    --line: #3A2E2A;
    --danger: #F3B5A2;
    --danger-container: #3A211C;
    /* Lighter green for dark mode, pairing with --on-primary (near-black)
       text — same role-flip as --danger above. */
    --success: #A7D9B9;
    --on-primary: #17110F;
    /* Dark: --good 7.16:1 / 6.46:1, --warn 8.62:1 / 7.78:1 on surface /
       surface-low — both already clear AA. */
    --good: #4FB286;
    --warn: #E0A63A;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--surface-low);
  color: var(--ink);
  font: var(--type-body);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: manipulation;
}

* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-touch-callout: none;
}

button {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  cursor: not-allowed;
}

/* App chrome is not text: no long-press callout, no selection — bars,
   buttons, tabs, the sheet handle, and tappable rows (a long-press on a row
   is a press). Text people copy is listed below and left selectable. */
.topbar,
.tabbar,
button,
.btn,
.bucket-tab,
.sheet-handle,
.item-list > li > a,
.item-list .swipe-front,
.period-toggle {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Text people copy: selectable with its long-press menu, wherever it sits —
   the invite URL, a payout's / receipt's reference, the account number to
   transfer to, the board hero's amounts (copy_wiring_test.js). */
.share-url,
#row-actions-message,
#me-pay-bank-account-number,
.board-total .board-summary-v {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* The pressed state, at once (80ms), on the controls .btn's rule does not
   cover. */
.iconbtn:active:not(:disabled),
.section-action:active:not(:disabled),
.btn-copy:active:not(:disabled),
.bucket-tab:active {
  transform: scale(0.98);
  transition: transform 80ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .iconbtn:active:not(:disabled),
  .section-action:active:not(:disabled),
  .btn-copy:active:not(:disabled),
  .bucket-tab:active {
    transform: none;
  }
}

/* Edge swipe Back (Kit.attachEdgeSwipe + makePeek): the view being swiped
   is opaque above the one Back goes to, casting a shadow on it; that one
   (.is-peek) sits under it at its remembered scroll, sliding in from -30%
   and brightening as --peek (0..1) grows. */
.main.is-peeking {
  position: relative;
}

.view.is-edge-swiping {
  position: relative;
  z-index: 1;
  background: var(--surface-low);
  /* A short page still covers the whole screen while it is swiped. */
  min-height: 100dvh;
  box-shadow: -12px 0 24px -12px rgba(0, 0, 0, 0.35);
}

.view.is-peek {
  position: absolute;
  left: 1rem;
  right: 1rem;
  z-index: 0;
  pointer-events: none;
  transform: translateX(calc(-30% * (1 - var(--peek, 0))));
  filter: brightness(calc(0.82 + 0.18 * var(--peek, 0)));
}

input,
textarea,
select {
  font-family: inherit;
  font-size: var(--control-font);
  line-height: 1.35;
  -webkit-appearance: none;
  appearance: none;
  border-radius: var(--r-card);
}

/* The reset above flattened checkboxes into grey squares: they are native
   again, in the app's colour (screen review 2026-10-20). */
input[type='checkbox'] {
  -webkit-appearance: checkbox;
  appearance: auto;
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--primary);
}

/* A switch row in a form: its words on the left, the switch on the right
   (".stack-form label" would otherwise make it a block). */
.stack-form label.messaging-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

/* An on/off setting is a switch, drawn here rather than by the system
   (owner, 2026-10-20: iOS stretched the native checkbox). The knob is a
   radial gradient, so it needs no pseudo-element on the input. Qualified
   twice so it outranks ".stack-form input" and ".messaging-toggle input". */
input[type='checkbox'][role='switch'][role='switch'] {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  box-sizing: border-box;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  height: 26px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 13px;
  background: radial-gradient(circle 10px at 13px 50%, var(--switch-knob) 9.5px, transparent 10.5px), var(--line);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

input[type='checkbox'][role='switch'][role='switch']:checked {
  background: radial-gradient(circle 10px at 31px 50%, var(--switch-knob) 9.5px, transparent 10.5px), var(--success);
}

input[type='checkbox'][role='switch'][role='switch']:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  input[type='checkbox'][role='switch'][role='switch'] {
    transition: none;
  }
}

/* A photo picker's button is a button of this app, not the browser's. */
input[type='file'] {
  font: var(--type-body);
  color: var(--muted);
}

input[type='file']::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: var(--type-label);
  font-weight: 600;
}

/* Headings and code start from the scale, never the browser's defaults
   (an unstyled h3 is ~19px, a <code> ~13px). */
h1,
h2,
h3,
h4 {
  margin: 0;
}

h2 {
  font: var(--type-heading);
}

h3 {
  font: var(--type-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--muted);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-body);
}

/* The five roles as classes, for markup that is not otherwise styled. */
.t-title {
  font: var(--type-title);
}

.t-heading {
  font: var(--type-heading);
}

.t-row {
  font: var(--type-row);
}

.t-body {
  font: var(--type-body);
}

.t-meta {
  font: var(--type-body);
  color: var(--muted);
}

.t-label {
  font: var(--type-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}

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

/* One focus treatment app-wide: the clay accent, never the browser's blue.
   :focus-visible so a mouse click on a button doesn't ring, but keyboard
   and text-field focus do. */
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.app {
  position: relative;
  height: 100%;
  min-height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface-low);
}

/* Spacing matches the receiver's native app bar (business_screen.dart:
   AppBar(titleSpacing: 0) — a 56dp leading slot, the title at 56dp): the
   44px back hit area starts 4px from the edge (16px padding, -12px margin),
   its chevron centred, and the title starts 8px after it, at 56px. The
   min-height counts the hairline (border-box), so the bar is the same
   height with or without a back button. */
.topbar {
  /* Its own transition group, which never animates (route transitions). */
  view-transition-name: topbar;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: calc(var(--safe-top) + 44px + 1.1rem);
  padding: calc(0.55rem + var(--safe-top)) 16px 0.55rem;
  /* The capsule's reserve as the shell measured and injected it
     (--gisted-capsule-right); 5rem until it does. */
  padding-right: calc(16px + var(--gisted-capsule-right, 5rem) + env(safe-area-inset-right, 0px));
  border-bottom: 0;
  background: var(--glass);
  z-index: 3;
  box-sizing: border-box;
}

/* Scrolled: the bar takes an edge, a hairline and a raised tint, so it
   reads apart from the page moving under it (2026-10-21). At the top of a
   screen it stays flat. */
.topbar.is-scrolled {
  /* An inset line, not a border: the bar keeps its height. */
  box-shadow: inset 0 -1px 0 var(--line);
  background: var(--card);
}

.topbar {
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

@media (prefers-reduced-motion: reduce) {
  .topbar {
    transition: none;
  }
}

/* The title is the row role and wraps to two lines before it ellipsizes, so
   "Monthly service charge" or a long estate name reads in full. Two 16/1.3
   lines (41.6px) fit in the 44px back-button row; if text zoom makes them
   taller the bar grows (a flex: none item above the scroller) and
   syncTopbarHeight moves --topbar-h with it. max-height is the
   no-line-clamp fallback: two lines, clipped. */
.topbar h1 {
  margin: 0;
  font: var(--type-heading);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.back {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--primary);
  margin: 0 0 0 -12px;
  padding: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.back-chevron {
  display: block;
  width: 0.78rem;
  height: 1.25rem;
}

.back[hidden] {
  display: none;
}

.main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  /* Vertical scrolling is the browser's; a horizontal drag (the left-edge
     Back swipe) stays with the page's pointer handlers. */
  touch-action: pan-y;
  /* Bottom clearance lives on the scrolling child, not here: this is a flex
     column with overflow, and WebKit/Chromium drop a flex scroll container's
     padding-bottom for overflow content — so a padding-bottom here vanishes at
     the scroll end and the last row tucks under the bar. See the .view rule. */
  padding: 1rem 1rem 0;
}

/* Bottom tab bar — floating pill (Home / Groups / Payments / Messages). A capsule
   inset from all three edges, blurred over the content, with the active
   tab filled in the accent. Mirrors the Contacts PWA's bar. */
.tabbar {
  view-transition-name: tabbar;
  flex: none;
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--safe-bottom) + 0.7rem);
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.25rem;
  padding: 6px;
  border-radius: 28px;
  border: 1px solid var(--edge);
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  backdrop-filter: saturate(1.7) blur(26px);
  -webkit-backdrop-filter: saturate(1.7) blur(26px);
  box-shadow: var(--glow), inset 0 1px 0 color-mix(in srgb, var(--surface) 70%, transparent);
  transition: transform 0.24s ease, opacity 0.24s ease;
  will-change: transform;
}

/* Without backdrop-filter the glass can't frost the content behind it, so
   fall back to a near-opaque bar to keep the labels legible. */
@supports not (
  (-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))
) {
  .tabbar {
    background: color-mix(in srgb, var(--surface) 93%, transparent);
  }
}

.tabbar a {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.16rem;
  min-height: 44px;
  padding: 0.35rem 0.2rem 0.3rem;
  border-radius: 22px;
  font: var(--type-label);
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
  transition: color 0.24s ease;
}

@media (prefers-reduced-motion: reduce) {
  .tabbar a {
    transition: none;
  }
}

.tabbar .tab-icon {
  width: 1.35rem;
  height: 1.35rem;
  flex: none;
  display: block;
}

.tab-badge {
  position: absolute;
  top: 2px;
  right: 8px;
  min-width: 1.1rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--accent, #0b6);
  color: #fff;
  font: var(--type-label);
  text-align: center;
}

.tabbar a[aria-current="page"] {
  color: var(--primary);
}

/* The moving highlight: one pill that glides to the active tab. JS sizes it
   to the active tab (offset box) and translates it; CSS animates the move. */
.tabbar-thumb {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  border-radius: 22px;
  background: var(--tonal);
  box-shadow: none;
  transform: translate(0, 0);
  pointer-events: none;
  z-index: 0;
  transition:
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  .tabbar-thumb {
    transition: none;
  }
}

/* Crossfade the home content when switching Home / Groups / Payments — those
   three share view-home, so there is no view-enter animation to carry it. */
.view#view-home.home-fade {
  animation: home-fade 200ms ease-out both;
}

@keyframes home-fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .view#view-home.home-fade {
    animation: none;
  }
}

/* Home / Groups / Payments share view-home; the active tab decides which of
   its two sections shows. Home shows both (no data-home-tab match here). */
.app[data-home-tab="groups"] #home-section-payments,
.app:not([data-home-tab="groups"]) #home-section-member-groups,
.app[data-home-tab="payments"] #home-section-groups,
.app[data-home-tab="groups"] #home-lede,
.app[data-home-tab="payments"] #home-lede,
.app[data-home-tab="groups"] #home-hero,
.app[data-home-tab="groups"] #home-pay-btn {
  display: none;
}

/* Pay under the You owe card, full width (layout proposal 8). */
.home-pay-btn {
  width: 100%;
  margin: 0 0 20px;
}

/* Groups and Payments tabs: the app bar is the screen title, so the section
   heading that repeats it goes (spec B) — the "+ New group" action stays. */
.app[data-home-tab="groups"] #home-groups-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.app[data-home-tab="groups"] #home-section-groups .section-heading {
  justify-content: flex-end;
}

.app[data-home-tab="payments"] #home-payments-heading {
  display: none;
}

.home-section + .home-section {
  margin-top: 28px;
}

/* Focused create/pay flows own the whole screen — no tab bar there. */
.app.tabbar-hidden .tabbar {
  display: none;
}

/* With no bar to clear, FABs and list padding drop back to a plain edge
   inset (--tabbar-h is stale from the last bar view, so don't derive from it
   here). */
.app.tabbar-hidden {
  --fab-offset: calc(1rem + var(--safe-bottom));
  --fab-clearance: calc(16px + var(--safe-bottom));
}

/* When the bar slides away on scroll the FAB follows it down to the edge, so
   it never floats high over empty space. Only the FAB moves — the content
   spacer (--fab-clearance) stays put so the page does not reflow as you
   scroll. The FABs' own `bottom` transition (see below) glides it with the
   bar. */
.app.tabbar-collapsed {
  --fab-offset: calc(1rem + var(--safe-bottom));
}


/* Scroll-away: slide the bar out while scrolling down, back on scroll up.
   Content padding is unchanged (it tracks --tabbar-h), so nothing reflows —
   only the floating bar moves. Distinct from tabbar-hidden, which removes it
   entirely for full-screen create/pay flows. */
.app.tabbar-collapsed .tabbar {
  transform: translateY(calc(100% + var(--safe-bottom) + 1.2rem));
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .tabbar,
  .scroll-top-fab {
    transition: none;
  }
}

.main > .view:not([hidden]) {
  flex: 1 1 auto;
  min-height: 100%;
}

/* The honored bottom clearance for every scrolling view. A real spacer child,
   not padding on .main or the view: the flex scroll column drops both a
   container's padding-bottom and (for a block view under min-height) the
   view's own — a box with height is the one thing counted at the scroll end.
   --fab-clearance tracks the measured bar and collapses on full-screen flows. */
.main > .view:not([hidden])::after {
  content: '';
  display: block;
  flex: 0 0 auto;
  height: var(--fab-clearance);
}

.pull-refresh {
  position: absolute;
  left: 0;
  right: 0;
  /* Tucked just under the app bar's bottom edge, wherever that is: the bar
     grows when its title takes two lines at a larger text zoom. */
  top: calc(var(--topbar-h) - 0.55rem);
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 0.15s ease;
}

.pull-refresh.is-visible {
  opacity: 1;
}

.pull-refresh-spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
}

.pull-refresh.is-loading .pull-refresh-spinner {
  animation: pull-refresh-spin 0.75s linear infinite;
}

@keyframes pull-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

.view[hidden] {
  display: none;
}

.view {
  position: relative;
}

.view.view--enter-forward {
  animation: viewEnterForward 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.view.view--enter-back {
  animation: viewEnterBack 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes viewEnterForward {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes viewEnterBack {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .view.view--enter-forward,
  .view.view--enter-back {
    animation: none;
  }
}

/* ---- Route transitions (Kit.navigate, document.startViewTransition) ----
   <html data-nav> carries the direction. Only the content moves: the top bar
   and the tab bar are their own groups with no animation, and the root
   snapshot is not animated either. */
#main-scroll {
  view-transition-name: content;
}

::view-transition-group(topbar),
::view-transition-old(topbar),
::view-transition-new(topbar),
::view-transition-group(tabbar),
::view-transition-old(tabbar),
::view-transition-new(tabbar),
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
}

/* An un-animated old snapshot stays up for the whole transition; the bars'
   old snapshots would show the previous title through the gap the morphing
   title leaves, so they are not drawn. */
::view-transition-old(topbar),
::view-transition-old(tabbar),
::view-transition-old(root) {
  display: none;
}

html[data-nav='forward']::view-transition-old(content) {
  animation: vt-fade-out 250ms ease-out both;
}

html[data-nav='forward']::view-transition-new(content) {
  animation: vt-in-right 250ms ease-out both;
}

html[data-nav='back']::view-transition-old(content) {
  animation: vt-out-right 250ms ease-out both;
}

html[data-nav='back']::view-transition-new(content) {
  animation: vt-fade-in 250ms ease-out both;
}

/* Tab switches: the default crossfade, a touch quicker. */
html[data-nav='tab']::view-transition-old(content),
html[data-nav='tab']::view-transition-new(content) {
  animation-duration: 200ms;
}

/* The shared-element morphs (row title <-> app bar title, collection row
   <-> board hero). */
::view-transition-group(nav-title),
::view-transition-group(nav-hero) {
  animation-duration: 250ms;
  animation-timing-function: ease-out;
}

/* Reduced motion: Kit.navigate marks it 'fade' (no morphs); a plain, short
   crossfade. */
html[data-nav='fade']::view-transition-group(*),
html[data-nav='fade']::view-transition-old(*),
html[data-nav='fade']::view-transition-new(*) {
  animation-duration: 150ms;
}

@keyframes vt-in-right {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
}

@keyframes vt-out-right {
  to {
    opacity: 0;
    transform: translateX(24px);
  }
}

@keyframes vt-fade-in {
  from {
    opacity: 0;
  }
}

@keyframes vt-fade-out {
  to {
    opacity: 0;
  }
}

.scroll-top-fab {
  position: fixed;
  right: 1rem;
  bottom: var(--fab-offset);
  z-index: 25;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--primary);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--ink) 12%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: bottom 0.24s ease;
}

.scroll-top-fab[hidden] {
  display: none;
}

.scroll-top-fab-icon {
  width: 1.15rem;
  height: 1.15rem;
}

/* Confirmation toast host — pinned above the floating tabbar (bottom:
   --fab-clearance is the same tabbar-h + 1rem gap the scroll spacer already
   honors, so the toast never sits under the bar). Centered, capped width,
   stacks new-on-top-of-old via column-reverse though showToast() only ever
   keeps one at a time. pointer-events is off on the host (so it never blocks
   taps on content behind it) and on for the toast itself. */
.toast-host {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: var(--fab-clearance);
  z-index: 60;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  max-width: 26rem;
  /* One height for every toast, one line or two. */
  min-height: 3.25rem;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--good);
  background: var(--surface-low);
  color: var(--ink);
  box-shadow: 0 10px 28px -10px color-mix(in srgb, var(--ink) 45%, transparent);
  font: var(--type-body);
  font-weight: 600;
  pointer-events: auto;
  animation: toast-in 0.22s ease-out both;
}

.toast.is-danger {
  border-left-color: var(--danger);
}

.toast.is-leaving {
  animation: toast-out 0.18s ease-in both;
}

.toast-icon {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  color: var(--good);
}

.toast.is-danger .toast-icon {
  color: var(--danger);
}

.toast-text {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Reduced motion: appear/disappear as a plain fade, never a slide. */
@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: toast-fade-in 0.15s ease-out both;
  }
  .toast.is-leaving {
    animation: toast-fade-out 0.15s ease-in both;
  }
}

@keyframes toast-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes toast-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.lede {
  margin: 0 0 1rem;
  color: var(--muted);
  font: var(--type-body);
}

.lede-inline {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font: var(--type-body);
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem;
  overflow: hidden;
  margin: 0 0 0.9rem;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem;
  margin: 0 0 0.9rem;
}

.panel h2 {
  margin: 0 0 0.45rem;
  font: var(--type-heading);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

#view-setup > .panel {
  margin-bottom: 0;
}

/* Each section on the group overview is separated from the previous by a
   full-width divider — a consistent rhythm down the screen, not one
   arbitrary line. */
#view-setup > .view-section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

/* The member's collection view keeps the same rhythm below its periods
   (2026-10-20: Group spending and Statement sat flush against the list and
   each other). */
#view-me-bucket > .view-section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

/* Collections leads directly beneath the summary card — no divider above
   the first section. */
#view-setup > .view-section:first-of-type {
  margin-top: 1.5rem;
  padding-top: 0;
  border-top: 0;
}

/* Members overview entry — a single tappable nav row (label · count · ›)
   rather than a heading with an orphaned subtitle. Taps through to the full
   members directory. */
#view-bucket > .bucket-tabs {
  margin-top: 1.25rem;
}

#view-bucket .bucket-tab-panel .item-list,
#view-bucket .bucket-tab-panel .empty,
#view-bucket .bucket-tab-panel .empty-cta,
#view-bucket .bucket-tab-panel .board-accordion {
  margin-bottom: 0;
}

.bucket-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding: 4px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--card);
}

.bucket-tab {
  flex: 1;
  min-height: var(--tap);
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.5rem;
  background: transparent;
  color: var(--muted);
  font: var(--type-body);
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.bucket-tab.is-active {
  background: var(--tonal);
  color: var(--tonal-ink);
}

/* Used by the Enrollment section's open/approval segmented toggle for a
   viewer who can't manage the group (renderSetupEnrollment in app.js) —
   the tabs otherwise used for Periods/Payouts/Receipts and the payouts
   status filter are never themselves disabled. */
.bucket-tab:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bucket-tab-panel {
  display: none;
}

.bucket-tab-panel.is-active {
  display: block;
}

.bucket-tab-panel[hidden] {
  display: none !important;
}

.bucket-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.bucket-panel-lede {
  margin: 0 0 0.75rem;
  font: var(--type-body);
  color: var(--muted);
}

.bucket-panel-head .bucket-panel-lede {
  flex: 1;
  margin-bottom: 0;
}

/* Board-header "Pay out" shortcut (#board-payout-shortcut) — same
   .bucket-panel-head flex-row idiom as the Payouts tab's own lede+action
   header just above, applied to #bucket-meta so the action is visible from
   every #/bucket/:id tab, not just Payouts. */
.bucket-panel-head.panel {
  /* This header is a card but its meta must be free to wrap onto as many
     lines as it needs — never clip it against the floating actions. */
  overflow: visible;
}

.bucket-panel-head .bucket-summary {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

#view-setup > .view-section .item-list,
#view-setup > .view-section .empty,
#view-setup > .view-section .empty-cta,
#view-setup > .view-section .board-accordion {
  margin-bottom: 0;
}

#view-bucket > .share-card {
  margin-bottom: 0;
}

/* Section titles across the app — one consistent restrained warm label, so
   the content (money cards, rows) carries the visual weight rather than the
   headings competing with it. */
.section-heading h2 {
  margin: 0;
  font: var(--type-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--muted);
}

.section-action {
  position: relative;
  flex: none;
  height: 36px;
  min-width: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  background: var(--tonal);
  color: var(--tonal-ink);
  font: var(--type-label);
  text-decoration: none;
  cursor: pointer;
}

/* The 44px hit area around the 36px stadium. */
.section-action::after {
  content: "";
  position: absolute;
  inset: -4px 0;
}

/* "See all groups/payments →" — hands the home preview off to its full tab. */
.section-see-all {
  display: inline-flex;
  align-items: center;
  margin-top: 0.5rem;
  padding: 0.35rem 0;
  color: var(--primary);
  font: var(--type-body);
  font-weight: 600;
  text-decoration: none;
}

.section-see-all:active {
  opacity: 0.7;
}

/* Two actions side by side in one section heading (members: Import, +). */
.section-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-action-icon {
  width: var(--tap);
  min-width: var(--tap);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.section-action-icon-glyph {
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.75rem 1rem;
  font: var(--type-row);
  letter-spacing: 0.01em;
  transition: opacity 0.15s ease, transform 0.08s ease;
}

.btn:active:not(:disabled) {
  transform: scale(0.985);
  opacity: 0.92;
}

.btn:disabled {
  opacity: 1;
  background: var(--surface-low);
  color: var(--muted);
  border-color: var(--line);
  cursor: not-allowed;
}

.btn-primary {
  min-height: 52px;
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
  box-shadow: var(--glow);
}

.btn-secondary {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--edge);
}

.btn-text {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}

.btn-with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.btn-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
}

.btn-checkout {
  width: auto;
  flex: none;
  min-width: 8.5rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.btn-ghost {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--edge);
}

.btn-danger {
  background: var(--danger);
  color: var(--on-primary);
  border-color: var(--danger);
}

/* Message line inside the reusable confirm sheet (#confirm-sheet). */
.confirm-sheet-message {
  margin: 0.15rem 0 0.25rem;
  color: var(--muted);
  font: var(--type-body);
}

/* Rename / Archive inside the group-settings sheet — full-width stacked
   actions. */
.setup-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}

.btn-sm {
  min-height: var(--tap);
  width: auto;
  padding: 0.45rem 0.85rem;
  font: var(--type-body);
}

.btn + .btn {
  margin-top: 0.5rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-row .btn {
  width: auto;
  flex: 1 1 auto;
}

.btn-row .btn + .btn {
  margin-top: 0;
}

.stack-form {
  display: grid;
  gap: 0.75rem;
  margin: 0.75rem 0 1rem;
  min-width: 0;
}

/* Block (not grid) so a label's inline hint stays on the label line
   ("Phone or email required") instead of dropping to its own row; the
   label→control gap moves to a margin on the control below. */
.stack-form label {
  display: block;
  min-width: 0;
  font: var(--type-body);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.stack-form label > input,
.stack-form label > select,
.stack-form label > textarea {
  margin-top: 0.35rem;
}

.field-label {
  display: block;
}

/* A from/to date pair (statement, group report) sits side by side. */
.range-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stack-form input,
.stack-form select,
.stack-form textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  padding: 0.75rem 0.85rem;
}

.messaging-settings {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.messaging-toggle,
.messaging-event {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  color: var(--ink);
  font-weight: 600;
}

.messaging-toggle input,
.messaging-event input {
  appearance: auto;
  -webkit-appearance: checkbox;
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--primary);
}

.messaging-billing-copy {
  margin: -0.25rem 0 0;
}

.messaging-events {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.messaging-events legend {
  margin-bottom: 0.45rem;
  color: var(--muted);
  font: var(--type-body);
  font-weight: 600;
}

.messaging-events > div {
  display: grid;
  gap: 0.65rem;
}

.messaging-events:disabled {
  opacity: 0.55;
}

/* Enrollment section (renderSetupEnrollment in app.js): New link and Turn
   off link as two quiet text actions under Share, Copy and QR code
   (2026-10-20 review: six full-weight buttons). */
.enrollment-link-actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.25rem;
}

.link-action {
  min-height: var(--tap);
  border: 0;
  background: none;
  padding: 0 0.25rem;
  font: var(--type-body);
  font-weight: 600;
  color: var(--primary);
}

/* Share leads the link's actions; Copy and QR code sit beside it. */
.share-actions .btn-share-main {
  flex: 2;
  min-height: var(--tap);
}

.field-hint {
  margin: -0.3rem 0 0;
  font: var(--type-body);
  color: var(--muted);
}

.field-hint-inline {
  font-weight: 400;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.status {
  margin: 0 0 0.75rem;
  font: var(--type-body);
  color: var(--muted);
}

.status.is-error {
  color: var(--danger);
}

/* The retry a failed list read offers, inline after its error (list_load.js). */
.status-retry {
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font: var(--type-body);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* Inline in the status sentence; its tap area is 44px tall. */
.status-retry::after {
  content: '';
  position: absolute;
  left: -8px;
  right: -8px;
  top: 50%;
  height: var(--tap);
  transform: translateY(-50%);
}

.status-retry:disabled {
  opacity: 0.5;
  cursor: default;
}

.empty {
  margin: 0;
  color: var(--muted);
  font: var(--type-body);
}

/* The payer editor's History rows (payer_history.js): a title, one line
   per changed field, then who and when. */
.item-list > li.payer-history-row {
  display: block;
}

.payer-history-line {
  margin: 2px 0 0;
  font: var(--type-body);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

/* --- Lists are rows, not cards (spec C) -----------------------------------
   Every list is ONE grouped container per section — the surface, one hairline
   border, one radius — and its rows carry no border, background or shadow of
   their own: a 1px --line hairline between rows (none after the last), 56px
   minimum, 12px vertical / 16px side padding. A row is a title (row role)
   over one meta line (body role, --muted), plus a trailing slot (amount,
   pill or chevron). Boxes stay only for real objects and summaries: the
   home hero, the group and board summaries, a payout quote. */
.item-list,
.board-accordion,
.dues-list,
.pay-method-list,
.period-detail-list {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: var(--r-card);
  overflow: hidden;
}

.item-list:empty,
.board-accordion:empty,
.dues-list:empty,
.pay-method-list:empty,
.period-detail-list:empty {
  display: none;
}

.item-list > li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 52px;
  margin: 0;
  padding: 10px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* The hairline between rows, inset to the text (68px past a 40px lead). */
.item-list > li + li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 0;
  height: 1px;
  background: var(--edge);
  z-index: 2;
  pointer-events: none;
}

.item-list > li.has-lead + li::before {
  left: 68px;
}

.board-accordion > * + *,
.dues-list > li + li,
.pay-method-list > li + li {
  border-top: 1px solid var(--edge);
}

/* A row's 40px leading disc: initials or an icon on the tonal fill. */
.lead-disc {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: var(--type-label);
  background: var(--tonal);
  color: var(--tonal-ink);
}

/* A row that is one link or one button: the link is the row. */
/* A row whose content is one link is that link. A .btn inside a row (the
   directory's Message) is an action beside the row's content, not the row. */
.item-list > li:has(> a:not(.btn)),
.item-list > li:has(> button.row-link),
.item-list > li.swipe-row {
  padding: 0;
  display: block;
}

.item-list > li > a:not(.btn),
.item-list > li > button.row-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  margin: 0;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  color: inherit;
  font: var(--type-body);
  text-align: left;
  text-decoration: none;
}

.item-list > li > a:not(.btn):active,
.item-list > li > button.row-link:active,
.item-list .swipe-front-link:active,
.item-list > li.row-tappable:active,
.period-member-line.row-menu:active {
  background: color-mix(in srgb, var(--ink) 4%, var(--card));
}

/* Row anatomy (makeRow in app.js). */
.row-main {
  flex: 1 1 auto;
  min-width: 0;
}

.row-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
}

.row-title {
  margin: 0;
  font: var(--type-row);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.row-meta {
  margin: 2px 0 0;
  font: var(--type-body);
  color: var(--muted);
  overflow-wrap: anywhere;
}

.row-reason {
  margin: 2px 0 0;
  font: var(--type-body);
  color: var(--danger);
  overflow-wrap: anywhere;
}

.row-trailing {
  flex: none;
  max-width: 55%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  text-align: right;
}

.row-trailing-inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

/* Money in a row's trailing slot. Owed amounts carry the colour; a zero is
   quiet — muted, regular weight (spec F). */
.row-amount {
  font: var(--type-row);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}

.row-amount.is-owed {
  color: var(--danger);
}

.row-amount.is-paid {
  color: var(--good);
}

.row-amount.is-partial {
  color: var(--warn);
}

.row-amount.is-zero {
  color: var(--muted);
  font-weight: 400;
}

.row-caption {
  font: var(--type-label);
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  white-space: nowrap;
}

.row-trailing-text {
  font: var(--type-body);
  color: var(--muted);
  white-space: nowrap;
}

.row-chevron {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.row-more {
  flex: none;
  width: 20px;
  height: 20px;
  margin-left: 4px;
  color: var(--muted);
}

.badge {
  display: inline-block;
  flex: none;
  margin: 0;
  padding: 3px 9px;
  white-space: nowrap;
  border-radius: 999px;
  border: 0;
  font: var(--type-label);
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  background: var(--neutral-pill);
  vertical-align: middle;
}

.badge-role {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.badge-you {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 16%, transparent);
}

/* Positive lifecycle status (Active / Verified) — green, not clay. Clay is
   reserved for actions ("tap me"); a healthy status reads as --good. */
.badge-ok {
  color: var(--good);
  background: color-mix(in srgb, var(--good) 12%, transparent);
}

.badge-paid {
  color: var(--good);
  background: color-mix(in srgb, var(--good) 12%, transparent);
}

.badge-unpaid {
  color: var(--danger);
  background: var(--danger-container);
}

.badge-warn {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, transparent);
}

.badge-period-done {
  color: var(--muted);
  background: color-mix(in srgb, var(--outline) 8%, transparent);
}

.badge-period-active {
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 14%, transparent);
}

.badge-period-upcoming {
  color: var(--muted);
  background: color-mix(in srgb, var(--outline) 6%, transparent);
}

.badge-muted {
  color: var(--muted);
}

/* --- Member directory (T6-T9): tag-filter chip bar, read-only directory-row
   tag pills, payer-editor's removable tag chips, the directory-row note
   line, and enroll-sheet checkbox rows. Tokens only, no new palette.
   Idioms reused: .bucket-tab/.bucket-tab.is-active for the chip/active-chip
   pattern, .badge-role/.pay-method-badge for the primary-tinted read-only
   pill, .messaging-toggle input for the native-checkbox override. */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
}

.chip-row:empty {
  display: none;
}

/* Quiet "Filter" label at the start of a tap-to-filter chip row (T-audit) —
   marks the row as an interactive control bar, distinct from the .chip
   buttons themselves and from the read-only .tag-pill labels in each row
   below. Same small-caps treatment as .checkout-form-label/.checkout-stage-
   label elsewhere in this file. */
.chip-row-label {
  display: inline-flex;
  align-items: center;
  flex: none;
  font: var(--type-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--muted);
}

.chip {
  position: relative;
  flex: none;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  background: var(--neutral-pill);
  color: var(--ink);
  font: var(--type-label);
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* The chip draws at 36px; its tap area is the full 44px (spec E). */
.chip::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: var(--tap);
  transform: translateY(-50%);
}

.chip.chip-active {
  background: var(--tonal);
  color: var(--tonal-ink);
}

/* Container shared by the directory row's read-only tags and the
   payer-editor's removable tag chips. */
.tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0;
}

.tag-pills:empty {
  margin: 0;
}

/* Directory-row read-only tag: small + primary-tinted, non-interactive
   (distinct from the tappable filter .chip above). */
.tag-pill {
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--tonal);
  color: var(--tonal-ink);
  font: var(--type-label);
  letter-spacing: 0;
  text-transform: none;
}

/* Member directory — dense rows: name + (masked phone · note) on the left,
   tag pills right-aligned, denser than a standard card so a big roster
   scans without endless scrolling. */
.item-list > li.dir-row {
  cursor: pointer;
}

.dir-row-main {
  flex: 1 1 auto;
  min-width: 0;
}

.dir-row-name {
  margin: 0;
  font: var(--type-row);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.dir-row-meta {
  margin: 2px 0 0;
  font: var(--type-body);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dir-row-tags {
  margin-left: auto;
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* The name is the row's button to its actions sheet for a keyboard or
   screen reader; it looks like the plain name. A tap anywhere on the row
   opens the same sheet. */
.dir-row-open {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

/* The contact keeps its words; when the tags do not fit beside it they
   drop under it rather than squeeze it. */
.dir-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}

.dir-row-contact {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dir-row-reach {
  flex: none;
  display: inline-flex;
  gap: 4px;
}

.dir-row-add {
  flex: none;
  appearance: none;
  margin: 0;
  padding: 0 2px;
  border: 0;
  background: none;
  font: var(--type-label);
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
}

.dir-row-open:focus-visible,
.dir-row-add:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Messages, design A (2026-11-21): one New message, the Who owes card,
   then Conversations / Notices as tabs. */
#messages-threads-section,
#messages-notices-section {
  margin-top: 4px;
}

.messages-new-btn {
  width: 100%;
  margin: 0 0 12px;
}

.messages-owing {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--card);
}

.messages-owing-text {
  flex: 1;
  min-width: 0;
}

.messages-owing-title {
  margin: 0;
  font: var(--type-body);
  font-weight: 600;
  color: var(--ink);
}

.messages-owing .row-meta {
  margin: 2px 0 0;
}

.messages-owing .btn {
  flex: none;
  width: auto;
  min-height: 36px;
  padding: 0 16px;
}

.btn-tonal {
  border: 0;
  background: var(--tonal);
  color: var(--tonal-ink);
}

/* A tab's unread count, in the clay of the other unread marks. */
.seg-count {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--primary);
  color: var(--on-primary);
  font: var(--type-label);
  line-height: 18px;
  vertical-align: 1px;
}

/* How a member is reached, or how a message went out: App, SMS, Email or
   none. Tinted from the app's tokens so both themes read. */
.channel-tag,
.channel-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font: var(--type-label);
  letter-spacing: 0.2px;
  vertical-align: 1px;
  background: var(--secondary-container);
  color: var(--muted);
  white-space: nowrap;
}

.channel-tag.is-app,
.channel-badge.is-app {
  background: color-mix(in srgb, var(--good) 14%, transparent);
  color: var(--good);
}

.channel-tag.is-sms,
.channel-badge.is-sms {
  background: color-mix(in srgb, var(--ink) 9%, transparent);
  color: var(--ink);
}

.channel-tag.is-email,
.channel-badge.is-email {
  background: var(--tonal);
  color: var(--tonal-ink);
}

.channel-tag.is-none {
  background: var(--danger-container);
  color: var(--danger);
}

/* A notice is a card: the text, who sent it and when, who it reached. */
.notice-cards {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.notice-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 14px 12px 10px;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--card);
}

.notice-card.is-unread {
  border-color: var(--primary);
}

.notice-card .row-main {
  min-width: 0;
  flex: 1;
}

.notice-card .row-meta {
  margin: 6px 0 0;
}

.notice-reach {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
}

.messages-notices-note {
  margin: 0 0 8px;
}

/* New message: To, the message, Send by, who it reaches. */
.compose-label {
  margin: 4px 0 -4px;
  font: var(--type-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--muted);
}

.compose-to {
  margin-bottom: 0;
}

.compose-chosen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compose-chosen .row-meta {
  margin: 0;
}

.compose-count {
  margin-top: -6px;
  text-align: right;
}

.compose-channels {
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.compose-channel,
.stack-form label.compose-channel {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 12px;
}

.compose-channel + .compose-channel {
  border-top: 1px solid var(--line);
}

.compose-channel .channel-badge {
  flex: none;
  min-width: 34px;
  text-align: center;
}

.compose-channel-text {
  display: grid;
  flex: 1;
  min-width: 0;
  font: var(--type-body);
  color: var(--muted);
}

.compose-channel-text b {
  font: var(--type-row);
  color: var(--ink);
}

.compose-reach {
  margin: 0;
  font: var(--type-body);
  color: var(--ink);
}

.compose-reach .link-action {
  padding: 0;
}

/* In the pinned footer the warning needs its own opaque fill: the
   footer's gradient starts transparent. */
.sheet-actions .compose-warn {
  background: color-mix(in srgb, var(--warn) 14%, var(--card));
}

.compose-warn {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--warn) 14%, transparent);
  color: var(--ink);
  font: var(--type-body);
}

/* Who gets what: a member, how they are reached, the channels this time. */
.reach-row .channel-tag {
  flex: none;
}

/* A conversation's banner: a member without the app, or one who turned
   messages off. */
.thread-banner {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  font: var(--type-body);
}

/* Messages (redesign 2026-10-20): the group chip and "+" share a line. */
.messages-bar {
  margin-bottom: 1rem;
}

.group-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  max-width: 100%;
  padding: 0 14px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: var(--type-row);
}

.group-chip > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-chip-chevron {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--muted);
}

/* One group: the chip only names it. */
.group-chip.is-static {
  cursor: default;
  opacity: 1;
}

.group-chip.is-static .group-chip-chevron {
  display: none;
}

/* A notice: unread dot, the text in full, then when it was sent. */
.notice-list > li.notice-row {
  align-items: flex-start;
  gap: 8px;
  padding-left: 10px;
}

.notice-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: transparent;
}

.notice-row.is-unread .notice-dot {
  background: var(--primary);
}

.notice-body {
  margin: 0;
  font: var(--type-body);
  color: var(--ink);
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.notice-row.is-unread .notice-body {
  font-weight: 600;
}

/* A conversation row: when it last moved beside the name, the last line
   under it, the unread count on the right. */
.thread-row .row-title-line {
  justify-content: space-between;
  gap: 8px;
}

.thread-when {
  flex: none;
  font: var(--type-label);
  color: var(--muted);
}

.thread-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.thread-unread {
  flex: none;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--on-primary);
  font: var(--type-label);
  line-height: 20px;
  text-align: center;
}

/* A conversation (2026-10-20): a chat. Bubbles, yours on the right, a day
   line between days, and the box to write in pinned above the tab bar. */
.thread-view {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.thread-bar {
  align-items: flex-start;
}

.thread-bar > .row-meta {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.thread-list {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0 0 12px;
  list-style: none;
}

.thread-day {
  align-self: center;
  margin: 10px 0 2px;
  font: var(--type-label);
  color: var(--muted);
}

.thread-line {
  display: flex;
  max-width: 80%;
}

.thread-line.is-mine {
  align-self: flex-end;
}

.thread-bubble {
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--edge);
  border-radius: 18px 18px 18px 6px;
  background: var(--card);
}

.thread-line.is-mine .thread-bubble {
  border-color: transparent;
  border-radius: 18px 18px 6px 18px;
  background: var(--primary-container);
}

.thread-text {
  margin: 0;
  font: var(--type-body);
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.thread-meta {
  margin: 3px 0 0;
  font: var(--type-label);
  font-weight: 400;
  color: var(--muted);
}

.thread-line.is-mine .thread-meta {
  text-align: right;
}

.thread-tag {
  display: inline-block;
  margin-bottom: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface);
  font: var(--type-label);
  color: var(--muted);
}

.thread-composer {
  position: sticky;
  bottom: calc(var(--tabbar-h) + 4px);
  z-index: 2;
  display: grid;
  gap: 6px;
  margin: 0 -16px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.thread-composer > .field-hint,
.thread-composer > .status {
  margin: 0;
}

.thread-composer-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.thread-composer-line {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.thread-composer-line textarea {
  flex: 1 1 auto;
  min-width: 0;
  min-height: var(--tap);
  max-height: 132px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  resize: none;
}

.thread-send {
  flex: none;
  width: var(--tap);
  height: var(--tap);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
}

.thread-send svg {
  width: 20px;
  height: 20px;
}

.thread-send:disabled {
  opacity: 0.5;
}

.thread-count:empty {
  display: none;
}

/* A per-message option above the box: a chip that is on or off. The
   switch inside is kept for its role and its state, out of sight. */
.toggle-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: var(--type-label);
  color: var(--muted);
  cursor: pointer;
}

.toggle-chip input[type='checkbox'][role='switch'][role='switch'] {
  position: absolute;
  inset: 0;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.toggle-chip:has(input:checked) {
  border-color: transparent;
  background: var(--primary-container);
  color: var(--primary);
}

.toggle-chip:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* A switch's one-line explanation under its words. */
.toggle-note {
  display: block;
  font: var(--type-body);
  font-weight: 400;
  color: var(--muted);
}

/* Faint count in the "Members · N" directory header. */
.dir-count {
  color: var(--muted);
  font-weight: 400;
}

/* Payer-editor's removable tag chip: label text + an x remove control. */
.tag-pill.tag-pill-removable {
  gap: 0.3rem;
  padding: 0.15rem 0.3rem 0.15rem 0.55rem;
}

.tag-pill-label {
  overflow-wrap: anywhere;
}

.tag-pill-remove {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: color-mix(in srgb, var(--primary) 24%, transparent);
  color: var(--primary);
  font: var(--type-body);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* The x draws at 1.4rem; its tap area is 44px square, centred on it. */
.tag-pill-remove::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--tap);
  height: var(--tap);
  transform: translate(-50%, -50%);
}

/* Directory-row note (rendered as class="row-meta member-note") — color and
   size come from .row-meta above; this adds the single-line ellipsis. */
.member-note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Enroll-sheet checkbox row. ID-qualified: .enroll-member-row is itself a
   <label>, and its form has class="stack-form sheet-form", so the generic
   ".stack-form label" rule (0,1,1) would otherwise outrank a bare
   ".enroll-member-row" (0,1,0) and force display:grid over our display:flex.
   Same story for the checkbox vs. ".stack-form input". */
#enroll-members-sheet .enroll-member-row,
#member-picker-sheet .enroll-member-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  color: var(--ink);
  font: var(--type-body);
  font-weight: 400;
  cursor: pointer;
}

#enroll-members-sheet .enroll-member-row input[type="checkbox"],
#member-picker-sheet .enroll-member-row input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: checkbox;
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  accent-color: var(--primary);
}

.enroll-member-text {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 0.1rem;
}

.panel-section {
  margin-top: 1.25rem;
}

.board-table th.is-current-cycle,
.board-table td.is-current-cycle {
  background: color-mix(in srgb, var(--primary) 9%, var(--surface-low));
}

.board-table th.is-current-cycle {
  color: var(--primary);
  box-shadow: inset 0 -2px 0 var(--primary);
}

/* Bucket board — cycles x members matrix, horizontally scrollable. */
.board-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -1rem 0.9rem;
  padding: 0 1rem;
}

.board-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 30rem;
}

.board-table th,
.board-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font: var(--type-body);
  white-space: nowrap;
}

.board-table thead th {
  color: var(--muted);
  font: var(--type-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}

.board-table td.member-cell {
  font-weight: 650;
  color: var(--ink);
  white-space: normal;
}

.board-table td.member-status {
  color: var(--muted);
  font: var(--type-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}

.board-cell {
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font-weight: 600;
  font: var(--type-body);
}

.board-cell.is-settled {
  background: color-mix(in srgb, var(--good) 16%, transparent);
  color: var(--good);
}

.board-cell.is-partial {
  background: color-mix(in srgb, var(--warn) 20%, transparent);
  color: var(--warn);
}

.board-cell.is-open {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
}

.board-cell.is-absent {
  color: var(--muted);
  opacity: 0.55;
}

.board-totals-row td {
  font-weight: 650;
  border-top: 2px solid var(--line);
}

.share-box {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  margin: 0 0 0.9rem;
  font: var(--type-body);
  overflow-wrap: anywhere;
}

.share-box .share-code {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.empty-cta {
  display: grid;
  gap: 0.8rem;
  padding-top: 0.5rem;
}

a.btn {
  text-align: center;
}

.quote-panel {
  margin: 0.35rem 0 0.15rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.quote-net {
  margin: 0;
  font: var(--type-money-hero);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.quote-sentence {
  margin: 0.45rem 0 0;
  font: var(--type-body);
  color: var(--ink);
}

/* --- Redesign: bucket board accordion --- */

.bucket-summary {
  margin: 0 0 0.25rem;
}

.board-total {
  margin: 0 0 0.65rem;
  font-weight: 600;
}

/* Board balance summary: Collected / Available / Still due as stacked
   label · value rows in one card. Each amount gets the full row width, so a
   large ₦ figure reads in full rather than being clamped into a cramped
   3-cell grid. "Still due" is emphasized (danger) when greater than zero. */
.board-summary {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-low);
  overflow: hidden;
}

.board-summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.6rem 0.85rem;
}

.board-summary-row + .board-summary-row {
  border-top: 1px solid var(--line);
}

.board-summary-k {
  flex: none;
  font: var(--type-body);
  color: var(--muted);
}

.board-summary-v {
  min-width: 0;
  font-weight: 650;
  font: var(--type-row);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  text-align: right;
  overflow-wrap: anywhere;
}

.board-summary-row.is-due {
  background: color-mix(in srgb, var(--danger) 6%, var(--surface-low));
  box-shadow: inset 3px 0 0 var(--danger);
}

.board-summary-row.is-due .board-summary-v {
  color: var(--danger);
}

/* Why Available is zero (split or track mode): a quiet line under the row. */
.board-summary-row.has-hint {
  flex-wrap: wrap;
  row-gap: 2px;
}

.board-summary-hint {
  flex-basis: 100%;
  margin: 0;
  font: var(--type-body);
  color: var(--muted);
}

/* Board header actions — "Pay out" + the settings gear, floating right of
   the write-up (invite link + Manage members live in the gear's sheet). */
.bucket-head-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Collection-settings sheet — even vertical rhythm for its stacked blocks
   (this sheet-form isn't a stack-form grid, so give it its own gap); the
   invite label sits tight to its input, then even gaps to the actions. */
#bucket-settings-modal .sheet-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

#bucket-settings-modal .sheet-form h2 {
  margin: 0;
}

#bucket-settings-modal .field-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* W1-5: a daily board's Previous / Next under its periods. */
.board-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

/* W1-5: the late-fee rule card sits under its own hairline. */
#bucket-settings-modal .late-fee-card {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.share-card {
  display: grid;
  gap: 0.75rem;
}

.field-label {
  margin: 0;
  font: var(--type-body);
  font-weight: 600;
  color: var(--muted);
}

.share-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

/* Copy / Share / Open under the link, sharing the row's width. */
.share-actions {
  display: flex;
  gap: 0.5rem;
}

.share-actions .btn-copy {
  flex: 1;
}

.share-url {
  /* A link people copy: keep its long-press menu and selection. */
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  user-select: text;
  display: block;
  min-width: 0;
  min-height: var(--tap);
  text-decoration: underline;
  text-underline-offset: 2px;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-low);
  font: var(--type-body);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.btn-copy {
  flex: none;
  min-height: var(--tap);
  min-width: var(--tap);
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  background: color-mix(in srgb, var(--outline) 12%, var(--surface));
  color: var(--muted);
  font: var(--type-body);
  font-weight: 600;
}

/* Group overview header: the group name with its lifecycle status as a
   quiet meta line beside it — status leads the card, not orphaned at the
   bottom. */
.group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.group-head-id {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.group-head h2 {
  margin: 0;
}

/* Header settings gear — a quiet outlined icon button (actions only, no
   fill), top-right of the group identity row. Opens the settings sheet. */
.iconbtn {
  flex: none;
  width: var(--tap);
  height: var(--tap);
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.iconbtn svg {
  width: 18px;
  height: 18px;
}

.group-status {
  margin: 0;
  font: var(--type-body);
  color: var(--muted);
}

/* Group overview summary — a two-stat glance grid: the total due across
   collections (hero, semantic stripe) and the group's distinct member
   count. So an admin reads the group's health before drilling into a
   collection. Mirrors the audit mockup's .stats/.stat proportions. */
.group-stats {
  display: grid;
  /* The money hero carries a full ₦ amount (can run to hundreds of
     thousands) while the member stat is a 1-2 digit count — give the hero
     the larger share so a big amount + its label sit on their own lines
     without crowding, and the count tile isn't left half-empty. */
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.group-stat {
  min-width: 0;
  /* Tiles sit a shade lighter than the panel that holds them, so they read
     as distinct tiles rather than borders drawn inside a flat card. */
  background: var(--surface-low);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0.7rem 0.8rem;
}

.group-stat.is-hero {
  background: color-mix(in srgb, var(--danger) 6%, var(--surface-low));
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
  border-radius: var(--r-hero);
  box-shadow: var(--glow);
}

/* Nothing due: a neutral tile, not a green one (spec F). */
.group-stat.is-hero.is-clear {
  background: var(--surface-low);
  border-color: var(--line);
}

/* The hero's caption picks up a softened tint of its semantic hue — tied to
   the amount without shouting. The amount itself keeps the full colour. */
.group-stat.is-hero .group-stat-k {
  color: color-mix(in srgb, var(--danger) 50%, var(--muted));
}

.group-stat.is-hero.is-clear .group-stat-k {
  color: var(--muted);
}

.group-stat-v {
  margin: 0;
  font-weight: 650;
  font: var(--type-money);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.group-stat.is-hero .group-stat-v {
  /* Shrinks on narrow phones / very large amounts so the figure never
     overflows its tile; floors above the member count so the hero stays
     the larger of the two. */
  font: var(--type-money);
  font-variant-numeric: tabular-nums;
  color: var(--danger);
}

.group-stat.is-hero.is-clear .group-stat-v {
  color: var(--muted);
  font-weight: 400;
}

.group-stat-k {
  margin: 0.2rem 0 0;
  font: var(--type-body);
  color: var(--muted);
}

/* The member-count tile doubles as the entry to the members directory — a
   tappable stat card with a corner chevron marking it navigable. */
.group-stat.is-link {
  position: relative;
  display: block;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.group-stat-go {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
}

/* Payer collection summary: both cells hold a ₦ amount, so equal width
   (the group overview's money-hero + member-count grid stays asymmetric). */
#me-bucket-summary {
  grid-template-columns: 1fr 1fr;
}

/* Give the payer's obligation sections room to breathe — below the summary
   and between the Unpaid / Paid groups. */
#me-obligations-host .list-section-heading {
  margin-top: 1.6rem;
}

/* Home hero — a warm clay summary card that gives the landing screen a
   "home" feel. A deliberate committed look: a fixed clay gradient with a
   soft top-right highlight and white text, so it reads as an accent panel
   on both the light and dark app grounds. */
.home-hero {
  margin: 0.25rem 0 1.2rem;
  padding: 1.3rem 1.15rem;
  border-radius: var(--r-hero);
  color: #fff;
  background:
    radial-gradient(130% 90% at 85% 0%, rgba(255, 255, 255, 0.16), transparent 60%),
    linear-gradient(135deg, #a8412a 0%, #6e2a1a 100%);
  box-shadow: var(--glow);
}

.home-hero-label {
  margin: 0;
  font: var(--type-body);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.home-hero-amount {
  margin: 0.3rem 0 0;
  font: var(--type-money-hero);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.home-hero-sub {
  margin: 0.35rem 0 0;
  font: var(--type-body);
  color: rgba(255, 255, 255, 0.85);
}

/* Compact invite chip — a single row (faint label · code · Copy pushed
   right), matching the collection board's invite treatment rather than the
   old chunky input box. */
.invite-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.7rem;
  padding: 0.5rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: var(--type-body);
  color: var(--muted);
}

/* Layout proposal 5 (2026-10-20): one group view, two pages. The group page
   (data-mode main) shows the day-to-day parts; Manage group (manage) shows
   only the setup sections, marked .is-config. Two panels of "This cycle"
   moved there as well: recent expenses (Expenses) and settlement (the bank
   banner on the group page, Bank and payout accounts here). */
#view-setup[data-mode='main'] > .is-config,
#view-setup[data-mode='main'] #dashboard-expenses-section,
#view-setup[data-mode='main'] #dashboard-settlement-section {
  display: none;
}

#view-setup[data-mode='manage'] > :not(.is-config) {
  display: none;
}

/* Opened at one section (#/setup/:id/manage/joining): clear of the top bar. */
#view-setup > .is-config {
  scroll-margin-top: 72px;
}

/* The group page's one warning that payments cannot settle. */
.settlement-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--warn) 14%, var(--card));
  font: var(--type-body);
  color: var(--ink);
}

.settlement-banner[hidden] {
  display: none;
}

.settlement-banner > .section-action {
  flex: none;
}

/* A Manage group row whose area needs attention (an unverified bank). */
.row-meta.row-warn {
  color: var(--warn);
}

/* A destructive action (archive) sits apart, after everything else. */
.danger-zone {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Tapping the invite code opens the invite sheet (layout proposal 7). */
#setup-share-box.is-tappable {
  cursor: pointer;
}

.invite-chip-label {
  flex: none;
}

.invite-chip-code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font: var(--type-body);
  letter-spacing: 0.02em;
}

/* Invite Copy — a clay-outlined action with a copy glyph (clay = actions),
   matching the proposal rather than the old grey fill. */
.invite-copy-btn {
  flex: none;
  min-height: var(--tap);
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--primary);
  border-radius: 9px;
  background: transparent;
  color: var(--primary);
  font: var(--type-body);
  font-weight: 600;
  cursor: pointer;
}

.invite-copy-btn svg {
  width: 0.9rem;
  height: 0.9rem;
}

/* Periods: rows in one container (spec C). A row toggles open to show its
   member lines on a quiet inset, still inside the container. */
.board-accordion {
  display: block;
}

.period-card {
  margin: 0;
}

.period-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 12px 16px;
}

.period-toggle:active {
  background: color-mix(in srgb, var(--ink) 4%, var(--surface));
}

.period-toggle-main {
  min-width: 0;
}

.period-toggle-title {
  margin: 0;
  font: var(--type-row);
}

.period-toggle-meta {
  margin: 2px 0 0;
  font: var(--type-body);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.period-toggle-trailing {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.period-chevron {
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.period-card.is-expanded .period-chevron {
  transform: rotate(180deg);
}

.board-view-all {
  margin: 0;
  text-align: center;
}

.board-view-all a,
.period-view-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0 12px;
  font: var(--type-body);
  font-weight: 600;
  color: var(--primary);
}

.period-view-all {
  display: flex;
}

.period-chevron-forward {
  width: 18px;
  height: 18px;
}

.list-load-more-wrap {
  padding: 0.75rem 0 0.25rem;
  text-align: center;
}

.period-detail {
  border-top: 1px solid var(--line);
  background: var(--surface-low);
  padding: 4px 16px;
}

.period-member-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 0;
  font: var(--type-body);
  color: var(--ink);
}

.period-member-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.period-member-name {
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* A levy's member list, then its receipts: the same gap as between any
   two sections. */
#levy-members {
  margin-bottom: 1.25rem;
}

/* A row whose action sheet is running a chosen action. */
.row-menu.is-busy {
  opacity: 0.55;
  pointer-events: none;
}

.period-member-line.row-menu {
  cursor: pointer;
}

.period-member-line + .period-member-line {
  border-top: 1px solid var(--line);
}

/* On the period detail screen the member lines are the rows themselves. */
.period-detail-list > .period-member-line,
.period-detail-list > .list-page > .period-member-line {
  min-height: 56px;
  padding: 12px 16px;
  font: var(--type-row);
}

.period-member-amount {
  font: var(--type-label);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.period-member-amount.line-paid {
  color: var(--good);
}

.period-member-amount.line-unpaid {
  color: var(--danger);
}

.period-member-amount.line-partial {
  color: var(--warn);
}

/* --- Payer checkout ----------------------------------------------------- */

.checkout-hero {
  margin: 4px 0 20px;
  padding: 20px;
  border: 1px solid var(--edge);
  border-radius: var(--r-hero);
  background: var(--card);
  box-shadow: var(--glow);
}

.checkout-hero-label {
  margin: 0;
  font: var(--type-body);
  font-weight: 600;
  color: var(--muted);
}

.checkout-hero-amount {
  margin: 4px 0 0;
  font: var(--type-money-hero);
  font-variant-numeric: tabular-nums;
}

.checkout-hero-amount.is-zero {
  color: var(--muted);
  font-weight: 400;
}

.dues-list {
  list-style: none;
  padding: 0;
}

.dues-list > li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 16px;
}

.due-line-main {
  min-width: 0;
}

.due-line-title {
  margin: 0;
  font: var(--type-row);
}

.due-line-meta {
  margin: 2px 0 0;
  font: var(--type-body);
  color: var(--muted);
}

.checkout-form {
  margin-top: 0;
  margin-bottom: 0;
}

/* The one action: the button says what happens ("Pay ₦30,000"). */
.checkout-pay-btn {
  margin-top: 4px;
}

.checkout-breakdown {
  margin-top: 24px;
}

/* Method picker and the waiting state sit on the page, not in a box — the
   method list is its own grouped container. */
.checkout-stage {
  margin-top: 4px;
}

.checkout-stage-head {
  margin-bottom: 16px;
}

.checkout-stage-heading {
  margin: 0 0 4px;
  font: var(--type-heading);
}

.checkout-stage-amount {
  margin: 0;
  font: var(--type-money-hero);
  font-variant-numeric: tabular-nums;
}

.checkout-stage-lede {
  margin: 4px 0 0;
  font: var(--type-body);
  color: var(--muted);
}

.pay-method-list {
  list-style: none;
  padding: 0;
}

.pay-method-card {
  margin: 0;
}

.pay-method-card.is-unavailable .pay-method-row {
  cursor: not-allowed;
}

.pay-method-card.is-unavailable .pay-method-title,
.pay-method-card.is-unavailable .pay-method-icon {
  opacity: 0.6;
}

.pay-method-card.is-unavailable .pay-method-chevron {
  visibility: hidden;
}

.pay-method-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  color: inherit;
  font: var(--type-body);
  text-align: left;
  cursor: pointer;
}

.pay-method-row:active:not(:disabled) {
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.pay-method-row:disabled {
  color: inherit;
}

.pay-method-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  color: var(--primary);
}

.pay-method-icon svg {
  width: 20px;
  height: 20px;
}

.pay-method-icon-bank,
.pay-method-icon-card {
  background: color-mix(in srgb, var(--ink) 6%, var(--surface));
  color: var(--ink);
}

.pay-method-body {
  flex: 1;
  min-width: 0;
}

.pay-method-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.pay-method-title {
  font: var(--type-row);
}

.pay-method-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  color: var(--primary);
  font: var(--type-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}

.pay-method-subtitle {
  display: block;
  margin-top: 2px;
  font: var(--type-body);
  color: var(--muted);
}

.pay-method-chevron {
  flex: none;
  color: var(--muted);
}

.pay-method-chevron svg {
  width: 0.65rem;
  height: 1rem;
}

.pay-method-cancel {
  width: 100%;
  margin-top: 16px;
}

.checkout-stage-waiting {
  text-align: center;
  padding: 24px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.pay-waiting-spinner {
  width: 2rem;
  height: 2rem;
  margin: 0 auto 0.85rem;
  border: 2px solid color-mix(in srgb, var(--primary) 18%, var(--line));
  border-top-color: var(--primary);
  border-radius: 999px;
  animation: pay-wait-spin 0.8s linear infinite;
}

@keyframes pay-wait-spin {
  to {
    transform: rotate(360deg);
  }
}

.pay-waiting-title {
  margin: 0;
  font: var(--type-heading);
}

.pay-waiting-body {
  margin: 8px 0 0;
  font: var(--type-body);
  color: var(--muted);
}

.checkout-breakdown-heading {
  margin: 0 0 12px;
  font: var(--type-heading);
}

/* Payout OTP: show the co-signer what they're approving (amount + destination). */
.payout-otp-summary {
  background: var(--surface-low);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
}

.payout-otp-summary-k {
  margin: 0;
  font: var(--type-body);
  color: var(--muted);
}

.payout-otp-summary-amount {
  margin: 0.1rem 0 0;
  font: var(--type-money);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: var(--ink);
}

.payout-otp-summary-dest {
  margin: 0.15rem 0 0;
  font: var(--type-body);
  color: var(--muted);
}

/* Grouped-list section header ("Due now", "Unpaid", "Pending requests"):
   the label role, just above its container. */
.list-section-heading {
  margin: 20px 4px 8px;
  font: var(--type-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--muted);
}

.list-section-heading:first-child {
  margin-top: 0;
}

.list-section + .list-section-heading {
  margin-top: 24px;
}

.bank-details {
  margin: 0 0 0.85rem;
  display: grid;
  gap: 0.75rem;
}

.bank-details > div {
  display: grid;
  gap: 0.2rem;
}

.bank-details dt {
  font: var(--type-body);
  font-weight: 600;
  color: var(--muted);
}

.bank-details dd {
  margin: 0;
  font: var(--type-row);
  letter-spacing: -0.01em;
}

.bank-account-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.me-pay-bank {
  margin-top: 0.5rem;
}

/* Bank-transfer waiting state: an amber/--warn-tinted pending panel (the
   audit's ".pending" mock, rebuilt on this file's own color-mix idiom —
   see .badge-warn) so a payer knows the app is still watching for their
   transfer, not stuck. Display only; the verify poll it sits next to is
   unchanged. */
.me-pay-bank-pending {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.85rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: 11px;
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  color: var(--muted);
  font: var(--type-body);
}

.me-pay-bank-pending-dots {
  display: inline-flex;
  flex: none;
  gap: 3px;
}

.me-pay-bank-pending-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warn);
  animation: me-pay-bank-pending-blink 1.1s infinite;
}

.me-pay-bank-pending-dots i:nth-child(2) {
  animation-delay: 0.18s;
}

.me-pay-bank-pending-dots i:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes me-pay-bank-pending-blink {
  0%,
  80%,
  100% {
    opacity: 0.25;
  }
  40% {
    opacity: 1;
  }
}

.me-thanks .me-thanks-title {
  margin: 0 0 0.35rem;
  font: var(--type-heading);
  letter-spacing: -0.01em;
}

.me-thanks .btn-row {
  margin-top: 0.85rem;
}

/* --- Swipe list rows (members, setup overview, admins) --- */

#view-bucket:not([hidden]) {
  display: flex;
  flex-direction: column;
}

/* The view is sized to the scroll area (.main > .view's min-height: 100%
   caps its flex shrink there), so its children are squeezed to fit. A
   .panel is overflow: hidden, which drops its automatic min-height to 0 —
   the rotating collection's Rotation panel collapsed to its heading and hid
   the order list, schedule form and Pay next. Children keep their content
   height; the view grows and .main scrolls. */
#view-bucket:not([hidden]) > * {
  flex-shrink: 0;
}

.bucket-tab-panel.is-active {
  flex: 1 1 auto;
}

/* A swipe row is still just a row of its list: the front layer carries the
   row padding and the surface (it must cover the actions beneath it), and
   the hairline between rows comes from ".item-list > li + li". A tap on the
   front opens the row's action sheet (appendSwipeRow in app.js). */
.item-list > li.swipe-row {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}

.item-list .swipe-actions {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: stretch;
  z-index: 0;
}

.item-list .swipe-action {
  border: 0;
  margin: 0;
  min-width: 4.75rem;
  padding: 0 0.85rem;
  font: var(--type-body);
  font-weight: 600;
  color: var(--on-primary, #fff);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-list .swipe-action-neutral {
  background: color-mix(in srgb, var(--primary) 82%, #1a1a1a);
}

.item-list .swipe-action-remove {
  background: var(--danger);
}

.item-list .swipe-action-accept {
  background: var(--success);
}

.item-list .swipe-front {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  margin: 0;
  padding: 10px 16px;
  background: var(--card);
  touch-action: pan-y;
  will-change: transform;
}

.item-list .swipe-front-link,
.item-list .swipe-front-tappable {
  cursor: pointer;
}

.item-list .swipe-row.is-dragging .swipe-front {
  transition: none !important;
}

.item-list .swipe-row.is-open .swipe-front,
.item-list .swipe-row.is-dragging .swipe-front {
  box-shadow: -4px 0 12px color-mix(in srgb, var(--ink) 8%, transparent);
}

.btn-danger-text {
  color: var(--danger);
  margin-top: 0.75rem;
  padding-left: 0;
  padding-right: 0;
}

@media (prefers-reduced-motion: reduce) {
  .item-list .swipe-front {
    transition: none !important;
  }
}

/* Modal sheets (matches apps/contacts) */
.sheet {
  width: 100%;
  max-width: 100%;
  max-height: 88dvh;
  margin: auto 0 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--edge);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 -8px 40px -12px rgba(0, 0, 0, 0.35);
}

/* A dark scrim in both themes — must NOT key off --ink, which is the light
   text colour in dark mode and would wash the backdrop lighter. */
.sheet::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

/* Sheets move like native ones: up from the bottom on a spring-like curve
   while the scrim fades in; down and out (Kit.closeSheet adds .is-closing,
   then closes the dialog when it has played). A drag sets the transform
   inline (Kit.attachSheetDrag). */
.sheet[open] {
  animation: sheet-in 320ms cubic-bezier(.2, .9, .25, 1) both;
}

.sheet[open]::backdrop {
  animation: scrim-in 320ms ease-out both;
}

.sheet.is-closing {
  animation: sheet-out 220ms ease-in both;
  /* On its way out: a tap must not land on a sheet that is leaving. */
  pointer-events: none;
}

.sheet.is-closing::backdrop {
  animation: scrim-out 220ms ease-in both;
}

@keyframes sheet-in {
  from {
    transform: translateY(100%);
  }
}

@keyframes sheet-out {
  to {
    transform: translateY(100%);
  }
}

@keyframes scrim-in {
  from {
    opacity: 0;
  }
}

@keyframes scrim-out {
  to {
    opacity: 0;
  }
}

/* Sheets under reduced motion: a short fade, no travel. */
@media (prefers-reduced-motion: reduce) {
  .sheet[open],
  .sheet[open]::backdrop {
    animation: scrim-in 150ms ease-out both;
  }
}

.sheet.is-closing.is-fade,
.sheet.is-closing.is-fade::backdrop {
  animation: scrim-out 120ms ease-out both;
}

/* While it slides away a closing sheet is no longer modal (Kit.closeSheet
   closes it at once, so the page behind is live — a tap on Send SOS is not
   lost) and is re-shown non-modally just to animate: kept where the modal
   sheet was, above the page, taking no taps. Its scrim is a separate
   overlay, fading on its own. */
.sheet.is-closing:not(:modal) {
  position: fixed;
  left: 0;
  right: 0;
  top: auto;
  bottom: 0;
  margin: 0;
  z-index: 1001;
  pointer-events: none;
}

.sheet-scrim-out {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.62);
  pointer-events: none;
  animation: scrim-out 220ms ease-in both;
}

.sheet-scrim-out.is-fade {
  animation-duration: 120ms;
}

.sheet-form {
  /* The sheet's own scroll never rubber-bands the page behind it. */
  overscroll-behavior: contain;
  padding: 24px 1rem 16px;
  scroll-padding-bottom: var(--sheet-actions-reserve);
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 88dvh;
}

.sheet-form h2 {
  margin: 0 0 0.75rem;
  padding-right: var(--tap);
  font: var(--type-heading);
}

/* Dragging a sheet down (Kit.attachSheetDrag) starts on its handle or
   header: those take the whole gesture, so the browser does not claim it
   for scrolling and cancel the drag. */
.sheet-handle,
.sheet-form > h2 {
  touch-action: none;
}

/* The 4px handle's grab area: a finger-sized box around it. */
.sheet-handle::after {
  content: '';
  position: absolute;
  inset: -16px -48px;
}

/* The sheet's own chrome (kit.js sheetChrome): a drag handle and an X. */
.sheet-handle {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 36px;
  height: 4px;
  margin-left: -18px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--ink) 35%, transparent);
}

.sheet-x {
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  top: 12px;
  right: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
}

/* The close button is a bare X, never ringed (owner, 2026-10-20): opening
   a sheet can put focus on it, and iOS draws that focus as an outline.
   Keyboard focus still shows, as a quiet disc behind the X. */
.sheet-x:focus,
.sheet-x:focus-visible {
  outline: none;
  box-shadow: none;
}

.sheet-x:focus-visible {
  background: color-mix(in srgb, var(--ink) 10%, transparent);
}

.sheet-x:active {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

/* A sheet takes focus when it opens (so its X does not) and draws no ring. */
dialog.sheet:focus,
dialog.sheet:focus-visible {
  outline: none;
}

.sheet-actions {
  position: sticky;
  bottom: 0;
  /* Above a list's row hairlines (z-index 2), which otherwise draw across
     the pinned button as rows scroll under it (member picker, 2026-11-21). */
  z-index: 3;
  display: grid;
  gap: 0.5rem;
  margin-top: 0.25rem;
  padding: 12px 0 calc(8px + var(--safe-bottom));
  background: linear-gradient(to bottom, transparent, var(--card) 30%);
}

.sheet-actions .btn + .btn {
  margin-top: 0;
}

/* Row action sheet (#row-actions-sheet): the same bottom sheet. Lists the
   row's swipe actions, destructive last. */
.action-sheet .sheet-form {
  padding-bottom: calc(16px + var(--safe-bottom));
}

.action-sheet .sheet-form:focus {
  outline: none;
}

.action-sheet .sheet-form h2 {
  margin-bottom: 4px;
}

.action-sheet-message {
  margin: 0 0 12px;
  font: var(--type-body);
  color: var(--muted);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.action-sheet-list {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.action-sheet-list .btn + .btn {
  margin-top: 0;
}

.sheet-action.is-destructive {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
}

#add-member-new-fields.is-hidden {
  display: none;
}

.view-invite {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100dvh - 5rem);
}

.invite-card {
  max-width: 22rem;
  margin: 0 auto;
  text-align: center;
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--ink) 6%, transparent);
}

.invite-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--muted) 18%, transparent);
  color: var(--muted);
}

.invite-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.invite-title {
  margin: 0 0 0.5rem;
  font: var(--type-title);
}

.invite-lede {
  margin: 0;
  font: var(--type-body);
  color: var(--muted);
}

.invite-actions {
  display: grid;
  gap: 0.55rem;
  margin-top: 1.25rem;
}

/* --- Design pass 2026-09-27: page headers without a card ---------------- */

/* Section header whose left side is a quiet meta line (Members, Admins,
   the member directory) rather than a heading that repeats the app bar. */
.section-heading > .row-meta {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

/* Collection board: the current period as the heading, the start date as
   one meta line, Pay out + settings on the right. */
.bucket-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 16px;
}

.bucket-head-id {
  /* Room for "Week of 2026-10-19" on one line; past that the actions drop
     under the name rather than squeezing it. */
  flex: 1 1 12rem;
  min-width: 0;
}

.bucket-head-id h2 {
  margin: 0;
}

.bucket-head-id .row-meta {
  margin-top: 2px;
}

#view-bucket > .bucket-tabs {
  margin-top: 20px;
}

/* A non-default group status (Archived) above the summary. */
#setup-meta {
  margin: 0 0 8px;
  font: var(--type-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--warn);
}

.me-bucket-meta {
  margin: 0 0 12px;
}

.me-bucket-pay {
  margin-top: 12px;
}

.pending-section {
  margin: 0 0 20px;
}

.pending-section .list-section-heading {
  margin-top: 0;
}

.form-page {
  padding-top: 4px;
}

/* Pending requests: the row's text on top, Accept / Decline (the primary
   task, visible — not only behind a swipe) on their own line below it. */
.pending-list .swipe-front {
  flex-wrap: wrap;
}

.pending-list .row-main {
  flex-basis: 100%;
}

/* A select reads as a choice, not a text field: a chevron on the right
   (the control is appearance: none). */
.stack-form select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238C756B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

/* Rotation panel: the summary line, then its sub-sections with room. */
#rotation-panel h2 {
  margin-bottom: 4px;
}

#rotation-panel .section-heading {
  margin: 16px 0 8px;
}

#rotation-panel .item-list {
  margin-bottom: 12px;
}

/* A quiet line above a list (a view-all screen's collection name, a
   period's total, "Available to pay out") sits clear of the container. */
.view > .row-meta,
.bucket-tab-panel > .row-meta:not(.board-view-all) {
  margin: 0 4px 12px;
}

/* Bank transfer: Copy sits beside the number at its own width. */
.bank-account-row {
  justify-content: space-between;
}

.bank-account-row .btn {
  width: auto;
  flex: none;
  min-height: var(--tap);
  padding: 0 16px;
}

/* The actions under a swipe row show only while it is dragged or open —
   at rest a rounding pixel of them could peek out below the front. */
.item-list .swipe-row:not(.is-open):not(.is-dragging) .swipe-actions {
  visibility: hidden;
}

/* ---- kit.js: list skeletons, busy buttons, the Signal meter ---- */
.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 16px;
}

.skeleton-disc {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.skeleton-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-line {
  height: 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.skeleton-line.is-short {
  width: 55%;
}

.btn.is-busy {
  cursor: progress;
}

/* Sits where the label was; setBusy holds the button at its width. */
.btn-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
}

/* The Signal meter: segments, the lit ones in --good (or --primary), the
   last lit one glowing. */
.meter {
  display: flex;
  gap: 2px;
  height: 6px;
  margin-top: 8px;
}

.meter-seg {
  flex: 1;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 12%, transparent);
}

.meter-seg.on {
  background: var(--good);
}

.meter-seg.tip {
  box-shadow: 0 0 6px color-mix(in srgb, var(--good) 70%, transparent);
}

.meter.is-primary .meter-seg.on {
  background: var(--primary);
}

.meter.is-primary .meter-seg.tip {
  box-shadow: 0 0 6px color-mix(in srgb, var(--primary) 70%, transparent);
}

/* Shimmer and spin only for people who have not asked for less motion. */
@media (prefers-reduced-motion: no-preference) {
  .skeleton-line,
  .skeleton-disc {
    animation: kit-shimmer 1.4s ease-in-out infinite;
  }

  .btn-spinner {
    animation: kit-spin 0.8s linear infinite;
  }
}

@keyframes kit-shimmer {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

@keyframes kit-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Member import sheet (GIST-41): two sources side by side, then the
   preview — each row says what will happen to that person. */
.import-sources {
  display: flex;
  gap: 0.5rem;
}

.import-sources .btn {
  flex: 1;
}

.import-preview {
  max-height: 50vh;
  overflow-y: auto;
}

.import-row-status {
  margin: 0;
  font: var(--type-label);
  color: var(--muted);
}

.import-row-status.is-new {
  color: var(--good);
}

.import-row-status.is-bad {
  color: var(--danger);
}

/* Track mode (GIST-9): the proof photo fits the sheet. */

/* Cash and offline payments (GIST-38): "Recorded by admin" or "Proof to
   review" sits under the amount, not beside it. */
.period-member-amount > .period-member-recorded {
  display: block;
  font: var(--type-label);
  font-weight: 500;
  color: var(--muted);
}

.proof-photo {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  margin: 0 auto;
  border-radius: var(--radius);
  object-fit: contain;
}

/* Failed payment retry prompt (GIST-39). */
.me-retry .btn {
  margin-top: 12px;
}

/* Refunds (GIST-68): the status over its note, then the admin's actions. */
#refunds-list > li {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

/* The welcome for someone with no payments and no groups (owner,
   2026-10-20). It is the start screen alone: the hero, Pay and both lists
   stay out of view while it shows. */
#view-home.is-welcome > :not(#home-welcome) {
  display: none;
}

/* The first load, before the start screen is decided: the placeholder
   alone (the sections' defaults would flash and vanish), and never after. */
#view-home.is-starting > :not(#home-start) {
  display: none !important;
}

#view-home:not(.is-starting) > #home-start {
  display: none;
}

.home-start {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}

.home-start-hero {
  height: 148px;
  border-radius: var(--r-hero);
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.home-start-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-welcome {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}

.home-welcome-title {
  margin: 0;
  font: var(--type-heading);
  color: var(--ink);
  text-wrap: balance;
}

.home-welcome-lede {
  margin: 0;
  font: var(--type-body);
  color: var(--muted);
}

.home-welcome-verify {
  margin: 0;
}

/* The example group that leads the welcome: the home hero's clay, white
   ink, an Example tag so nobody reads it as their own money. */
.welcome-hero {
  display: grid;
  gap: 10px;
  padding: 18px 18px 16px;
  border-radius: var(--r-hero);
  color: #fff;
  background:
    radial-gradient(130% 90% at 85% 0%, rgba(255, 255, 255, 0.16), transparent 60%),
    linear-gradient(135deg, #a8412a 0%, #6e2a1a 100%);
  box-shadow: var(--glow);
}

.welcome-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.welcome-hero-group {
  font: var(--type-body);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.welcome-example {
  padding: 5px 8px;
  border-radius: 999px;
  font: var(--type-label);
  background: rgba(255, 255, 255, 0.16);
}

.welcome-hero-amount {
  margin: 4px 0 0;
  font: var(--type-title);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.welcome-hero-of,
.welcome-hero-foot {
  margin: -6px 0 0;
  font: var(--type-body);
  color: rgba(255, 255, 255, 0.78);
}

.welcome-hero-foot {
  margin: 0;
}

.welcome-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.welcome-bar > span {
  display: block;
  width: 75%;
  height: 100%;
  border-radius: inherit;
  background: #fff;
  transform-origin: left;
}

.welcome-members {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.welcome-member {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font: var(--type-label);
  background: rgba(255, 255, 255, 0.2);
}

.welcome-member.is-paid {
  background: #fff;
  color: #a8412a;
}

/* The paid tick: a small green disc on the member's edge. */
.welcome-member.is-paid::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #8a3520;
  background: #2f6b4a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.2l2 2 4-4.4' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* One moment when the welcome appears: the paid members tick off in turn
   and the bar fills. It plays each time [hidden] lifts, then sits still. */
@keyframes welcome-pop {
  0% { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes welcome-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.welcome-member.is-paid {
  animation: welcome-pop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.welcome-member:nth-child(1) { animation-delay: 0.25s; }
.welcome-member:nth-child(2) { animation-delay: 0.37s; }
.welcome-member:nth-child(3) { animation-delay: 0.49s; }
.welcome-member:nth-child(4) { animation-delay: 0.61s; }
.welcome-member:nth-child(5) { animation-delay: 0.73s; }
.welcome-member:nth-child(6) { animation-delay: 0.85s; }

.welcome-bar > span {
  animation: welcome-fill 1.4s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s both;
}

@media (prefers-reduced-motion: reduce) {
  .welcome-member.is-paid,
  .welcome-bar > span {
    animation: none;
  }
}

.welcome-paths {
  display: grid;
  gap: 10px;
}

.welcome-path {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: start;
  padding: 16px;
  border-radius: var(--r-card);
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.welcome-path-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary-container);
  color: var(--primary);
}

.welcome-path-icon svg {
  width: 22px;
  height: 22px;
}

.welcome-path-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.welcome-path-title {
  font: var(--type-row);
}

.welcome-path-meta {
  font: var(--type-body);
  color: var(--muted);
}

/* The organiser's way in leads: it is the one that sets everything up. */
.welcome-path.is-lead {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.welcome-path.is-lead .welcome-path-icon {
  background: color-mix(in srgb, var(--on-primary) 16%, transparent);
  color: var(--on-primary);
}

.welcome-path.is-lead .welcome-path-meta {
  color: var(--on-primary);
  opacity: 0.85;
}

.welcome-cta {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  font: var(--type-row);
  background: var(--on-primary);
  color: var(--primary);
}

.welcome-cta svg {
  width: 14px;
  height: 14px;
}

.welcome-gets {
  display: grid;
  gap: 12px;
  margin: 4px 0 0;
  padding: 0 2px;
  list-style: none;
  font: var(--type-body);
  color: var(--ink);
}

.welcome-gets li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
}

.welcome-gets svg {
  width: 20px;
  height: 20px;
  justify-self: center;
  color: var(--primary);
}

/* A new collection with no members (owner, 2026-10-21): the welcome's hero
   and path cards, with example rows instead of the group's members. */
.board-welcome {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}

a.welcome-cta {
  min-height: var(--tap);
  text-decoration: none;
}

.welcome-rows {
  display: grid;
  gap: 6px;
}

.welcome-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
}

.welcome-row-disc {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font: var(--type-label);
  background: #fff;
  color: #a8412a;
}

.welcome-row-name {
  font: var(--type-body);
  font-weight: 600;
  min-width: 0;
}

.welcome-row-status {
  padding: 4px 8px;
  border-radius: 999px;
  font: var(--type-label);
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.2);
}

.welcome-row-status.is-paid {
  background: #2f6b4a;
  color: #fff;
}

/* The example rows rise in, one after another, each time it shows. */
@keyframes welcome-rise {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.welcome-row {
  animation: welcome-rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.welcome-row:nth-child(2) { animation-delay: 0.12s; }
.welcome-row:nth-child(3) { animation-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .welcome-row {
    animation: none;
  }
}

/* The everyday empty spot (owner, 2026-10-21): a soft icon tile, a short
   title, one line of help and, where there is a next step, one button.
   Good news (no one overdue) gets a green tick. */
.empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 22px 18px;
  border-radius: var(--r-card);
  background: var(--card);
  border: 1px solid var(--edge);
  text-align: center;
}

.empty-state-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--primary-container);
  color: var(--primary);
}

.empty-state-icon svg {
  width: 28px;
  height: 28px;
}

.empty-state.is-good .empty-state-icon {
  background: color-mix(in srgb, var(--good) 14%, transparent);
  color: var(--good);
}

.empty-state-title {
  margin: 0;
  font: var(--type-row);
  color: var(--ink);
}

.empty-state-text {
  margin: -4px 0 0;
  max-width: 30ch;
  font: var(--type-body);
  color: var(--muted);
}

.empty-state .btn {
  width: auto;
  margin-top: 4px;
  padding: 0 1.25rem;
}

.link-action.btn-danger-text {
  margin-top: 0;
  color: var(--danger);
}

/* Refund sheet: the one surprising rule, apart and in the warning tone. */
.refund-owe-note {
  color: var(--warn);
  font-weight: 600;
}

/* ---- First-run help (walkthrough spec 2026-11-20) ----------------------- */

/* "Add my phone" under the welcome and on My payments (B4). */
.home-welcome-verify,
.add-phone-card {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.add-phone-btn {
  width: auto;
  padding: 0 1.25rem;
}

/* "Get your group ready · N of 5 done" (B11): one card, a row per step. */
.setup-checklist {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 14px 14px 10px;
  border-radius: var(--r-card);
  background: var(--card);
  border: 1px solid var(--edge);
}

.setup-checklist[hidden] {
  display: none;
}

.setup-checklist.is-complete {
  padding-bottom: 14px;
}

.setup-checklist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.setup-checklist-heading {
  margin: 0;
  font: var(--type-row);
  color: var(--ink);
}

.setup-checklist-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.setup-checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font: var(--type-body);
  color: var(--ink);
}

.setup-checklist-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid var(--outline);
  color: var(--on-primary);
  font: var(--type-label);
}

.setup-checklist-item.is-done .setup-checklist-mark {
  border-color: var(--good);
  background: var(--good);
}

.setup-checklist-item.is-done .setup-checklist-text {
  color: var(--muted);
}

.setup-checklist-text {
  flex: 1;
  min-width: 0;
}

.setup-checklist-meta,
.setup-checklist-optional {
  color: var(--muted);
}

.setup-checklist-action {
  flex: none;
}

/* After Remind unpaid with texts off (B14). */
.board-remind-tip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}

.board-remind-tip[hidden] {
  display: none;
}

#bucket-share-howto {
  margin-top: 8px;
}

/* Coach-mark tour (kit.js showTour, B7): the page dimmed but for one
   control, and a card beside it. Above every sheet and the tab bar. */
.coach {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: transparent;
}

.coach.is-center {
  display: grid;
  place-items: center;
  padding: 16px;
  background: color-mix(in srgb, #000 55%, transparent);
}

.coach-spot {
  position: fixed;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px color-mix(in srgb, #000 55%, transparent);
  pointer-events: none;
  transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
}

.coach-bubble {
  position: fixed;
  left: 16px;
  right: 16px;
  max-width: 420px;
  margin: 0 auto;
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: var(--r-card);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--edge);
  outline: none;
  transition: top 0.2s ease, bottom 0.2s ease;
}

.coach.is-center .coach-bubble {
  position: static;
  width: 100%;
}

.coach-count {
  margin: 0;
  font: var(--type-label);
  color: var(--muted);
}

.coach-title {
  margin: 0;
  font: var(--type-row);
}

.coach-body {
  margin: 0;
  font: var(--type-body);
}

.coach-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.coach-skip,
.coach-next {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font: var(--type-row);
  cursor: pointer;
}

.coach-skip {
  border: 1px solid var(--edge);
  background: transparent;
  color: var(--ink);
}

.coach-next {
  border: 0;
  background: var(--primary);
  color: var(--on-primary);
}

.coach-skip:focus-visible,
.coach-next:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.coach.is-instant .coach-spot,
.coach.is-instant .coach-bubble {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .coach .coach-spot,
  .coach .coach-bubble {
    transition: none;
  }
}

/* Replies and polls on notices (step 5, 2026-11-22). */
.channel-tag.is-replies {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--edge);
  color: var(--muted);
}

.compose-notice-opts {
  display: grid;
  gap: 8px;
}

.compose-notice-opts .compose-poll-add {
  justify-self: start;
}

.compose-poll {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
}

.poll-inputs {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.poll-input {
  display: flex;
  align-items: center;
  gap: 6px;
}

.poll-input input {
  flex: 1;
  min-width: 0;
}

.poll-input-remove {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: var(--type-body);
  color: var(--muted);
  cursor: pointer;
}

.poll-input-remove:hover,
.poll-input-remove:focus-visible {
  background: var(--secondary-container);
  color: var(--ink);
}

.poll-input-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.poll-input-actions .link-action {
  margin-top: 0;
}

.notice-poll {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface);
}

.poll-tally {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.poll-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  align-items: baseline;
  font: var(--type-body);
  color: var(--ink);
}

.poll-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.poll-row.is-leading .poll-label,
.poll-row.is-mine .poll-label {
  font-weight: 600;
}

.poll-count {
  font: var(--type-label);
  color: var(--muted);
}

.poll-bar {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 999px;
  background: var(--secondary-container);
  overflow: hidden;
}

.poll-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.notice-poll.is-closed .poll-fill {
  background: var(--muted);
}

.poll-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.poll-foot .row-meta {
  margin: 0;
}

.poll-foot .link-action {
  margin-top: 0;
}

.thread-ref {
  margin: 0 0 4px;
  padding-left: 8px;
  border-left: 2px solid var(--edge);
  font: var(--type-label);
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* A member's vote on the notice card. */
.poll-choice {
  justify-self: stretch;
  padding: 10px 12px;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--card);
  font: var(--type-body);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.poll-choice[aria-pressed="true"] {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
  font-weight: 600;
}

.poll-choice:disabled {
  cursor: default;
  opacity: 0.75;
}

.poll-choice[aria-pressed="true"]:disabled {
  opacity: 1;
}

.poll-row .poll-choice {
  grid-column: 1 / -1;
}
