/* hāpi app — the same beginner PWA design system, reskinned to hāpi's brand.
 *
 * Identical in structure and interaction to /beginner: the sticky app shell,
 * the sliding-thumb tab row, swipeable panels, the wallet card with its drop-in,
 * the tipping scale, the share reveal, the update + install banners. Only the
 * branding differs — hāpi's teal/sage palette and hop mark stand in for
 * beginner's forest green and seed mark. The design-system variable names are
 * kept (--forest / --leaf) so the components port verbatim; only their values
 * carry hāpi's colours.
 *
 * Mobile-first — laid out for a 320×568 portrait viewport with the soft
 * keyboard up, with the inline-button pill restored from 540px. */

:root {
  color-scheme: light;
  --bg: #f5f3ef;
  --surface: #fffdf7;
  --ink: #1f1d1a;
  --muted: #6f6a62;
  --line: #e8e3d8;
  /* hāpi's accent — the wordmark teal in place of beginner's forest green,
     with the hop sage as the bright partner in gradients. Variable names kept. */
  --forest: #2f595b;
  --forest-press: #234748;
  --leaf: #a6c08f;
  --font-sans: "Instrument Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fraunces", "Plus Jakarta Sans", Georgia, "Times New Roman", serif;
  --font-display-settings: "SOFT" 100, "WONK" 0, "opsz" 144;
  --shadow-soft: 0 1px 2px rgba(47, 89, 91, 0.05), 0 4px 16px rgba(47, 89, 91, 0.06);
  --shadow-forest: 0 1px 2px rgba(47, 89, 91, 0.18), 0 6px 18px rgba(47, 89, 91, 0.22);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font-family: inherit; cursor: pointer; border: none; }
button:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }

/* ── Add-to-Home-Screen banner ──────────────────────────────────────────
   A "get the app" card pinned near the bottom, revealed by pwa.js only when
   the page is installable. The button taps the install prompt (Chromium) or
   plays the walkthrough into Picture-in-Picture (/lib/add-to-home.js). */
.pwa-banner {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  width: min(440px, calc(100% - 28px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-forest);
}
.pwa-banner__icon { flex: 0 0 auto; width: 44px; height: 44px; }
.pwa-banner__icon svg { width: 100%; height: 100%; border-radius: 11px; display: block; }
.pwa-banner__copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pwa-banner__title { font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.pwa-banner__sub { font-size: 12px; color: var(--muted); line-height: 1.35; }
.pwa-banner__btn {
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid var(--forest);
  border-radius: 999px;
  background: var(--forest);
  color: #f5f3ef;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 9px 14px;
  white-space: nowrap;
  cursor: pointer;
}
.pwa-banner__btn:hover { background: var(--forest-press); }
.pwa-banner__close {
  flex: 0 0 auto;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pwa-banner__close:hover { background: rgba(45, 42, 38, 0.06); color: var(--ink); }
.pwa-banner__close svg { width: 15px; height: 15px; }
/* Spell out the hidden state, and never show it once installed or on the
   "Back others" view (it would sit over the card stack). */
.pwa-banner[hidden] { display: none; }
html.is-installed .pwa-banner { display: none; }
html.cards-open .pwa-banner { display: none; }
@media (max-width: 380px) {
  .pwa-banner__sub { display: none; } /* tighten on the smallest phones */
}

/* ── Update banner ──────────────────────────────────────────────────────
   A slim bar across the very top, shown when a new app version is ready; the
   Update button activates it and reloads. */
.updatebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding:
    max(8px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    8px
    max(14px, env(safe-area-inset-left));
  background: var(--forest);
  color: #fffdf7;
  font-size: 13px;
  line-height: 1.3;
  animation: updatebar-in 320ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes updatebar-in {
  from { opacity: 0; transform: translateY(-100%); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) { .updatebar { animation: none; } }
.updatebar__note { flex: 1; margin: 0; }
.updatebar__note b { font-weight: 700; }
.updatebar__update {
  flex: none;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.16);
  color: #fffdf7;
  font-weight: 600;
  font-size: 13px;
  padding: 5px 16px;
  border-radius: 999px;
}
.updatebar__update:hover { background: rgba(255, 255, 255, 0.26); }
.updatebar__update:disabled { opacity: 0.6; }
.updatebar__update:focus-visible { outline: 2px solid #fffdf7; outline-offset: 2px; }
.updatebar__close {
  flex: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 253, 247, 0.85);
}
.updatebar__close:hover { color: #fffdf7; background: rgba(255, 255, 255, 0.16); }
.updatebar__close svg { width: 15px; height: 15px; }
/* The pill shows focus on the whole control via :focus-within, so the inner
   input must not draw its own outline box on top of it. */
.gate__pill input:focus,
.gate__pill input:focus-visible { outline: none; }
[hidden] { display: none !important; }

/* ── App shell ────────────────────────────────────────────────────────── */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  /* Soft brand wash — hāpi's hop sage + teal, used only as background. */
  background:
    radial-gradient(circle at 20% 10%, rgba(166, 192, 143, 0.16), transparent 42%),
    radial-gradient(circle at 88% 14%, rgba(63, 113, 115, 0.10), transparent 40%),
    radial-gradient(circle at 50% 112%, rgba(166, 192, 143, 0.08), transparent 52%),
    var(--bg);
}

.app__head {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding:
    calc(max(14px, env(safe-area-inset-top)) + 4px)
    16px 12px;
  background: rgba(255, 253, 247, 0.86);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}

.app__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.app__wordmark {
  font-family: var(--font-display);
  font-variation-settings: var(--font-display-settings);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* Sliding tabs: a clean row with a forest underline that glides along a faint
   baseline from tab to tab (and can be swiped). */
.app__tabs {
  position: relative;
  display: inline-flex;
  gap: 4px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: inset 0 -1.5px 0 var(--line); /* baseline the indicator rides on */
  touch-action: pan-y;
}
/* The sliding indicator: a small forest line that glides under the active tab.
   tabs.js sets its width + x from the selected tab; the transition makes it
   slide, hinting the whole control can be swiped. */
.app__tabs-thumb {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0;
  border-radius: 999px 999px 0 0;
  background: var(--forest);
  transform: translateX(0);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transition: transform 280ms cubic-bezier(0.22, 0.61, 0.36, 1),
              width 280ms cubic-bezier(0.22, 0.61, 0.36, 1),
              opacity 160ms ease;
}
.app__tab {
  position: relative;
  z-index: 1;
  appearance: none;
  /* Tighter than beginner's 16px: hāpi carries four tabs, so the row still fits
     the 320px target. */
  padding: 9px 12px 11px;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: color 180ms ease;
}
/* The sliding line marks the active tab; the label just deepens to forest. */
.app__tab[aria-selected="true"] { color: var(--forest); }
.no-thumb .app__tab[aria-selected="true"] { color: var(--forest); }
/* Fallback for when JS hasn't positioned the thumb yet (or is unavailable):
   keep the old solid pill so a tab is always clearly selected. */
.no-thumb .app__tab[aria-selected="true"] {
  background: var(--forest);
  box-shadow: var(--shadow-forest);
}
@media (prefers-reduced-motion: reduce) {
  .app__tabs-thumb { transition: opacity 160ms ease; }
}

/* The tab row: the segmented tabs, with Cards as a round control beside it. */
.app__tabrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.app__cards {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px 0 12px;
  flex: none;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--forest);
  box-shadow: var(--shadow-soft);
  font-size: 13px;
  font-weight: 600;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.app__cards svg { flex: none; }
.app__cards-label { line-height: 1; letter-spacing: -0.01em; }
.app__cards:hover { border-color: var(--forest); }
.app__cards[aria-pressed="true"] {
  background: var(--forest);
  color: #fffdf7;
  border-color: var(--forest);
  box-shadow: var(--shadow-forest);
}

/* The panels host the swipe: pan-y hands horizontal drags to JS while keeping
   vertical scroll native, and clip-x keeps a dragged panel from bleeding out
   the side. */
.app__panels { flex: 1 1 auto; display: flex; touch-action: pan-y; overflow-x: clip; }
.panel { flex: 1 1 auto; width: 100%; }
/* The newly shown panel slides in from the direction of travel — so a tap or a
   swipe both read as moving along a track. Enter-only; the old panel unmounts. */
@keyframes panel-in-right { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }
@keyframes panel-in-left  { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: translateX(0); } }
.panel--in-right { animation: panel-in-right 240ms cubic-bezier(0.22, 0.61, 0.36, 1); }
.panel--in-left  { animation: panel-in-left 240ms cubic-bezier(0.22, 0.61, 0.36, 1); }
@media (prefers-reduced-motion: reduce) {
  .panel--in-right, .panel--in-left { animation: none; }
}

/* ── Sign in (the gate, now a panel) ──────────────────────────────────── */

.gate {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  padding:
    24px
    max(16px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

.gate__inner {
  max-width: 460px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-top: 4vh;
  text-align: center;
}

.gate__title {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-variation-settings: var(--font-display-settings);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.gate__lede {
  margin: 0;
  max-width: 360px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}
.gate__lede strong { color: var(--ink); font-weight: 600; }

.gate__pill {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 6px;
  padding: 8px;
  gap: 8px;
  align-items: center;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.gate__pill:focus-within {
  border-color: var(--forest);
  box-shadow: 0 0 0 4px rgba(45, 90, 61, 0.16), var(--shadow-soft);
}

.gate__cc {
  flex-shrink: 0;
  padding-left: 8px;
  font-weight: 600;
  font-size: 16px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.gate__pill input {
  flex: 1 1 200px;
  min-width: 0;
  height: 48px;
  padding: 0 12px;
  background: transparent;
  /* iOS Safari draws its own field border/inset unless appearance is reset —
     border:none alone leaves a box around the input inside the pill. */
  -webkit-appearance: none;
  appearance: none;
  border: none;
  box-shadow: none;
  border-radius: 0;
  /* 16px is the iOS Safari floor — anything smaller zooms on focus. */
  font-size: 16px;
  color: #000;
}
.gate__pill input::placeholder { color: var(--muted); }

.gate__pill--pin input {
  flex-basis: 100%;
  font-feature-settings: "tnum";
  font-size: 22px;
  letter-spacing: 0.55em;
  padding-right: 0.55em;
  text-align: center;
}

.gate__begin {
  flex: 1 1 100%;
  height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--forest);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-forest);
  transition: background 0.15s ease, transform 0.05s ease;
}
.gate__begin:hover { background: var(--forest-press); }
.gate__begin:active { transform: scale(0.98); }

.gate__status {
  min-height: 1.2em;
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.gate__status[data-kind="error"] { color: #b3261e; }
.gate__status[data-kind="ok"]    { color: var(--forest); }

.gate__link {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  transition: color 0.15s ease, background 0.15s ease;
}
.gate__link:hover { color: var(--ink); background: rgba(45, 90, 61, 0.06); }

.gate__fineprint {
  margin: 4px 0 0;
  max-width: 340px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}

/* ── Passkey ───────────────────────────────────────────────────────────── */

.gate__alt {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.gate__or {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}
.gate__or::before,
.gate__or::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
}

.gate__passkey {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.05s ease;
}
.gate__passkey:hover { border-color: var(--forest); background: rgba(45, 90, 61, 0.04); }
.gate__passkey:active { transform: scale(0.99); }
.gate__passkey svg { color: var(--forest); }

.gate__passkey--save {
  width: auto;
  margin-top: 4px;
  min-height: 44px;
}

.gate__passkey-note {
  min-height: 1.2em;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.gate__passkey-note[data-kind="error"] { color: #b3261e; }
.gate__passkey-note[data-kind="ok"]    { color: var(--forest); }

/* Post-sign-in passkey enrollment prompt (on the gate). */
.gate__enroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.gate__enroll-lede { margin: 0; font-size: 14px; color: var(--ink); text-align: center; }
.gate__enroll .gate__passkey--save { width: 100%; margin-top: 0; }

/* Fundraising target on the Ask page (above the QR). */
.raise-target {
  /* Match the QR card's width and centering so they line up. */
  width: 100%;
  max-width: 360px;
  margin: 0 auto 20px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  text-align: left;
}
.raise-target__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.raise-target__amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--forest);
  line-height: 1.05;
}
.raise-target__goal { font-size: 13px; color: var(--muted); }
.raise-target__bar {
  margin: 12px 0 8px;
  height: 10px;
  border-radius: 999px;
  background: rgba(45, 90, 61, 0.1);
  overflow: hidden;
}
.raise-target__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--forest), var(--leaf));
  transition: width 900ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
@media (prefers-reduced-motion: reduce) { .raise-target__fill { transition: none; } }
.raise-target__meta { margin: 0; font-size: 13px; color: var(--muted); }

/* Unlink Stripe — a quiet, secondary control under the connected Wallet. */
.cards__unlink {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 4px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cards__unlink:hover { color: #b3261e; }
.cards__unlink:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; border-radius: 6px; }

/* ── Tipping scale + share (Back me) ───────────────────────────────────────
   The amount picker is a sliding segmented control in the tab bar's style: a
   forest indicator glides under the chosen amount ($9 / $45 / $90). Mirrors
   .app__tabs / .app__tabs-thumb / .app__tab. Driven by raise.js. */
.tip-scale {
  position: relative;
  display: inline-flex;
  gap: 4px;
  padding: 0;
  margin: 0 0 4px;
  background: transparent;
  border: 0;
  box-shadow: inset 0 -1.5px 0 var(--line); /* baseline the indicator rides on */
  touch-action: pan-y;
  transition: opacity 160ms ease;
}
/* The sliding indicator — same forest line as the tab bar's thumb. */
.tip-scale__thumb {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0;
  border-radius: 999px 999px 0 0;
  background: var(--forest);
  transform: translateX(0);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transition: transform 280ms cubic-bezier(0.22, 0.61, 0.36, 1),
              width 280ms cubic-bezier(0.22, 0.61, 0.36, 1),
              opacity 160ms ease;
}
.tip-scale__opt {
  position: relative;
  z-index: 1;
  appearance: none;
  border: 0;
  padding: 9px 18px 11px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-display);
  font-variation-settings: var(--font-display-settings);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: color 180ms ease;
}
.tip-scale__opt[aria-checked="true"] { color: var(--forest); }
/* Fallback before JS positions the thumb (or if unavailable): a solid pill so
   the chosen amount still reads as selected. */
.no-thumb .tip-scale__opt[aria-checked="true"] {
  background: var(--forest);
  color: #fff;
  border-radius: 999px;
  box-shadow: var(--shadow-forest);
}
.tip-scale__opt:focus-visible { outline: 2px solid var(--forest); outline-offset: 4px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  .tip-scale__thumb { transition: opacity 160ms ease; }
}

/* Share the tip — slides up from below after payment; the button opens the
   native share sheet (AirDrop on iOS). Revealed by raise.js. */
.seed__share { margin: 18px 0 0; text-align: center; }
.seed__share[hidden] { display: none; }
.seed__share.is-in { animation: seed-share-up 320ms cubic-bezier(0.22, 0.61, 0.36, 1) both; }
@keyframes seed-share-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .seed__share.is-in { animation: none; }
}
.seed__share-note { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.seed__share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 22px;
  border: 0;
  border-radius: 14px;
  background: var(--forest);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(45, 90, 61, 0.28);
  transition: transform 0.12s ease;
}
.seed__share-btn:active { transform: translateY(1px); }
.seed__share-btn:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; }

/* ── Raise ────────────────────────────────────────────────────────────── */

.raise {
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  padding:
    24px
    max(20px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
}

.raise__title {
  margin: 0;
  font-family: var(--font-display);
  font-variation-settings: var(--font-display-settings);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.raise__ask {
  margin: 10px 0 16px;
}
.raise__ask-amount {
  display: block;
  font-family: var(--font-display);
  font-variation-settings: var(--font-display-settings);
  font-size: clamp(44px, 12vw, 64px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--forest);
}
.raise__ask-note {
  display: block;
  margin-top: 8px;
  max-width: 360px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.raise__progress {
  margin: 0 0 20px;
}
.raise__bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(45, 90, 61, 0.10);
  overflow: hidden;
}
.raise__bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--forest);
  transition: width 0.6s ease;
}
.raise__progress-text {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.raise__progress-text strong { color: var(--forest); font-weight: 600; }

.raise__lede {
  margin: 4px 0 20px;
  color: var(--muted);
  font-size: 15px;
}

.raise__stats {
  display: grid;
  /* minmax(0,1fr) lets columns shrink below their content so a long, unbroken
     route string can't push a card past the screen edge. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.raise__stat {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(45, 90, 61, 0.04);
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}
.raise__stat strong {
  display: block;
  font-family: var(--font-display);
  font-variation-settings: var(--font-display-settings);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--forest);
}
.raise__stat-routes {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.raise__stat-routes code {
  max-width: 100%;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px;
  color: var(--muted);
  background: rgba(45, 90, 61, 0.06);
  padding: 2px 6px;
  border-radius: 6px;
  /* Long, space-less endpoints must wrap instead of overflowing the card. */
  overflow-wrap: anywhere;
  word-break: break-word;
}

.raise__costs {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.raise__costs-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-variation-settings: var(--font-display-settings);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.raise__costs-total {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-variation-settings: var(--font-display-settings);
  font-size: 24px;
  font-weight: 600;
  color: var(--forest);
}
.raise__costs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.raise__costs-table td {
  padding: 8px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  vertical-align: top;
}
.raise__costs-table td:last-child {
  text-align: right;
  white-space: nowrap;
  color: var(--muted);
}
.costs__src {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

.raise__talk {
  margin: 18px 0 0;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}
.raise__talk a {
  color: var(--forest);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.raise__talk a:hover { text-decoration: underline; }

.raise__qr {
  margin: 22px 0 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.raise__qr-code {
  /* Fill the content width like the other tabs, capped so it stays square,
     and centre the QR within the padded white field. */
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  display: grid;
  place-items: center;
}
.raise__qr-code svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
}
.raise__qr-cap {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* ── Back me — sliding scale + in-page Apple Pay ────────────────────────
   Ported from the founder profile's backer view, on the beginner tokens. */
.seed { text-align: left; margin: 4px 0 8px; }
.seed .pitch__card { margin-bottom: 18px; }
.seed__lede {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-variation-settings: var(--font-display-settings);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.seed__pitch {
  margin: 0 0 22px;
  font-family: var(--font-display);
  font-variation-settings: var(--font-display-settings);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
}
/* The whole pay block hides (so the fallback note can take its place) when
   Apple Pay is unavailable; the hidden attribute must win over the author
   display rules, so pin it. */
.seed__pay[hidden],
.seed-ece[hidden] { display: none; }
.seed__scale { margin: 2px 0 16px; }
/* Amount readout sits to the right of the slider, not stacked above it. */
.seed__pick { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.seed__pick .tip-scale { margin: 0; }
.seed__amount {
  flex: none;
  font-family: var(--font-display);
  font-variation-settings: var(--font-display-settings);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.02em;
  color: var(--forest);
  line-height: 1.05;
  margin: 0;
}
/* Back others' action: a forest, beginner-branded button that opens the share
   sheet (in place of an Apple Pay button). */
.seed__share-tip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin: 4px 0 0;
  padding: 13px 18px;
  border-radius: 14px;
  background: var(--forest);
  color: #f5f3ef;
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  box-shadow: var(--shadow-forest);
}
.seed__share-tip:hover { background: var(--forest-press); }
.seed__share-mark { width: 22px; height: 22px; flex: none; }
.seed__slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--forest), var(--leaf));
  margin: 4px 0 10px;
}
.seed__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--forest);
  border: 3px solid var(--bg);
  box-shadow: 0 1px 2px rgba(45, 90, 61, 0.25), 0 4px 12px rgba(45, 90, 61, 0.3);
  cursor: pointer;
}
.seed__slider::-moz-range-thumb {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--forest);
  border: 3px solid var(--bg);
  box-shadow: 0 1px 2px rgba(45, 90, 61, 0.25), 0 4px 12px rgba(45, 90, 61, 0.3);
  cursor: pointer;
}
.seed__slider:focus-visible { outline: 2px solid var(--forest); outline-offset: 6px; }
.seed__ticks {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.seed__slider[hidden], .seed__ticks[hidden] { display: none; }
.seed__custom {
  display: flex; align-items: center; gap: 6px; margin: 14px 0 0;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--surface);
}
.seed__custom:focus-within { border-color: var(--forest); }
.seed__custom-prefix { font-family: var(--font-display); font-weight: 700; color: var(--forest); font-size: 18px; }
.seed__custom-input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); outline: none; min-width: 0; }
.seed__custom-input::placeholder { color: var(--muted); font-size: 15px; }
.preseed__split { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.preseed__split strong { color: var(--forest); font-weight: 600; }
/* The Apple Pay button (Stripe's Express Checkout Element) mounts here; a
   min-height reserves its space so the layout doesn't jump on render. */
.seed-ece { min-height: 48px; }
.seed-ece--once { margin-top: 2px; }
.seed__once-note { margin: 16px 0 8px; font-size: 14px; color: var(--muted); }
.seed__unavailable { margin: 6px 0 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.seed__error { margin: 12px 0 0; font-size: 13px; color: #b3261e; }

/* ── Pitch / Vision ─────────────────────────────────────────────────────
   The founder's contact card and vision essay — the lockup the founder
   profile carried before, rebuilt on the beginner design tokens (cream
   surfaces, forest accent, the Fraunces display face). */

.pitch {
  max-width: 560px;
  margin: 0 auto;
  padding:
    24px
    max(20px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
}

.pitch__card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  margin: 0 0 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
}
.pitch__photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 10px rgba(45, 42, 38, 0.14);
  background: var(--line);
}
.pitch__meta { min-width: 0; }
.pitch__name {
  margin: 0 0 3px;
  font-family: var(--font-display);
  font-variation-settings: var(--font-display-settings);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.pitch__role,
.pitch__location,
.pitch__phone {
  margin: 2px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.pitch__brandmark { width: 15px; height: 15px; flex: none; border-radius: 4px; }
.pitch__location svg,
.pitch__phone svg { width: 14px; height: 14px; flex: none; }
/* A teaser phone number — present but blurred (a placeholder; the digits
   never un-blur, and a CSS blur doesn't reveal DOM text). */
.pitch__phone-blur {
  filter: blur(4.5px);
  user-select: none;
  -webkit-user-select: none;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  /* Keep the digits black under the blur. iOS Safari auto-detects phone
     numbers and tints them link-blue; -webkit-text-fill-color wins over that,
     and the plain color covers everywhere else. */
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
}

.pitch__essay {
  margin: 0 0 22px;
  padding: 0;
  font-family: var(--font-display);
  font-variation-settings: var(--font-display-settings);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
}
.pitch__essay p { margin: 0 0 18px; }
.pitch__essay p:last-child { margin-bottom: 0; }

.pitch__signoff {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-variation-settings: var(--font-display-settings);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
}
.pitch__signoff p { margin: 0; }
.pitch__signoff-role { color: var(--muted); }

/* ── Cards ─────────────────────────────────────────────────────────────── */

.cards {
  max-width: 460px;
  margin: 0 auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.cards__title {
  margin: 0;
  font-family: var(--font-display);
  font-variation-settings: var(--font-display-settings);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.cards__lede { margin: 4px 0 20px; max-width: 360px; color: var(--muted); font-size: 15px; }

/* Undeposited funds — a small readout above the card. */
.cards__undeposited {
  width: 100%;
  max-width: 480px;
  margin: 0 0 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.cards__undeposited-label { font-size: 13px; color: var(--muted); }
.cards__undeposited-amount {
  font-family: var(--font-display);
  font-variation-settings: var(--font-display-settings);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--forest);
}

/* The white-label hāpi card — the same Provecho/beginner-format face: a
   1.586:1 face, a radial brand highlight over a linear base, a sheen, the
   brand mark top-left, and a bottom row of the card number (left) + a network
   column (right: kind + the beginner issuer wordmark). In cream, matching the
   logo's background so the hop mark sits on it seamlessly, with teal ink. */
.bcard {
  position: relative;
  width: 100%;
  /* Nearly the full width of the screen — the Wallet column's content box
     governs (so ~20px breathing room each side on a phone), keeping the
     credit-card 1.586:1 proportions. */
  max-width: 480px;
  aspect-ratio: 1.586 / 1;
  margin: 0 0 20px;
  border-radius: 20px;
  padding: 22px;
  color: var(--forest);
  overflow: hidden;
  text-align: left;
  border: 1px solid #ece5d4;
  background:
    radial-gradient(120% 120% at 85% 12%, rgba(166, 192, 143, 0.26), transparent 55%),
    linear-gradient(150deg, #fffefa 0%, #fffcf2 45%, #f6efde 100%);
  box-shadow: 0 18px 44px rgba(47, 89, 91, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: filter 0.4s ease;
}
/* The card isn't shown until onboarding completes; when it's issued it drops
   in from the top with the deposit animation (mirrors welcome's deposit-drop). */
@keyframes bcard-drop {
  0%   { opacity: 0; transform: translateY(-150px) rotate(-7deg) scale(0.95); }
  34%  { opacity: 1; }
  72%  { transform: translateY(12px) rotate(0) scale(1); }
  100% { transform: translateY(0) rotate(0) scale(1); }
}
.bcard.is-issued { animation: bcard-drop 920ms cubic-bezier(0.2, 0.74, 0.24, 1) both; }
@media (prefers-reduced-motion: reduce) {
  .bcard.is-issued { animation: none; }
}

/* The embedded Stripe onboarding mounts here — full content width. */
.cards__embed {
  width: 100%;
  max-width: 420px;
  margin: 0 0 16px;
  text-align: left;
}
.bcard__sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 38%, rgba(255, 255, 255, 0.35) 50%, transparent 62%);
}
.bcard__top { display: flex; align-items: flex-start; justify-content: space-between; }
.bcard__brand { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 42px; }
.bcard__brand svg { width: 40px; height: 40px; flex: none; }
/* The hop mark sits straight on the card's cream — no tile — so it reads like
   the logo, with the wordmark beside it. */
.bcard__mark { width: 42px; height: 42px; background: transparent; flex: none; }
.bcard__word {
  font-family: var(--font-display);
  font-variation-settings: var(--font-display-settings);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--forest);
}
.bcard__bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; position: relative; }
.bcard__number {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: rgba(47, 89, 91, 0.70);
  font-variant-numeric: tabular-nums;
}
.bcard__network { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.bcard__cash {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(47, 89, 91, 0.65);
}
.bcard__beginner {
  font-family: var(--font-display);
  font-variation-settings: var(--font-display-settings);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--forest);
}

/* "Get started with beginner" — the primary forest action, in the beginner
   design system (the same pill as the sign-in button). */
.gate__connect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 360px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--forest);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-forest);
  transition: background 0.15s ease, transform 0.05s ease;
}
.gate__connect:hover { background: var(--forest-press); }
.gate__connect:active { transform: scale(0.98); }
.gate__connect:disabled { opacity: 0.7; }
.gate__connect svg { color: #fff; }
/* "Connect with Stripe" — Stripe's brand blurple, so the whole button reads as
   the Stripe hosted action that opens their OAuth flow. */
.gate__connect--stripe { background: #635bff; box-shadow: 0 1px 2px rgba(99, 91, 255, 0.18), 0 6px 18px rgba(99, 91, 255, 0.22); }
.gate__connect--stripe:hover { background: #5851e6; }

/* "powered by <provider>" attribution — pulled from the web, sitting outside
   the action button. The Wallet shows Stripe's horizontal wordmark logo; the
   sign-in form shows the Stytch favicon beside its wordmark. */
.powered {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.powered__logo { height: 16px; width: 16px; display: block; border-radius: 4px; }
.powered__name { font-weight: 700; letter-spacing: -0.01em; }
.powered__name--stytch { color: #0d1b2a; }
/* Horizontal provider wordmarks — no separate mark, just the logo. */
.powered__wordmark { display: block; height: 20px; width: auto; }
/* The Stripe SVG carries its own internal padding, so nudge it left to close
   the gap after "powered by". */
.powered__wordmark--stripe { height: 22px; margin-left: -6px; }
.powered__wordmark--stytch { height: 20px; }

/* ── Log out ────────────────────────────────────────────────────────────
   A quiet text button on the Pitch (admin) tab; tabs.js shows it only to the
   signed-in founder. */
.gate__logout {
  margin: 18px 0 0;
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.gate__logout:hover { color: var(--ink); border-color: var(--forest); background: rgba(45, 90, 61, 0.04); }

/* ── ≥540px: restore the inline-button pill, optical centring ─────────── */

@media (min-width: 540px) {
  .gate { align-items: center; }
  .gate__inner {
    gap: 18px;
    padding-top: 0;
    margin-top: -2vh;
  }
  .gate__title { font-size: 34px; }

  .gate__pill {
    flex-wrap: nowrap;
    max-width: 460px;
    height: 56px;
    padding: 0 6px 0 20px;
    border-radius: 999px;
  }
  .gate__cc { padding-left: 0; }
  .gate__pill input { flex: 1 1 auto; height: auto; padding: 0 4px; }
  .gate__pill--pin { padding-left: 28px; }
  .gate__pill--pin input { flex: 1 1 auto; height: auto; font-size: 18px; }
  .gate__begin { flex: 0 0 auto; height: 44px; padding: 0 22px; font-size: 14px; }
  .gate__link { min-height: auto; padding: 6px 10px; font-size: 13px; }
}

@media (min-width: 720px) {
  .gate__title { font-size: 38px; }
}

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

/* ── hāpi additions ─────────────────────────────────────────────────────
   The handful of components beginner doesn't carry, on the same tokens:
   the illustrative use-of-funds breakdown on the Raise tab, and the demo
   Apple Pay button — the static stand-in for beginner's live Stripe Express
   Checkout (hāpi is a self-contained page, so nothing is charged). */

.raise__demo { margin: 0 0 14px; font-size: 12px; font-weight: 600; color: var(--muted); }

/* Use-of-funds breakdown — a segmented bar + legend, in a card matching the
   fundraising target above it. */
.breakdown {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  text-align: left;
}
.breakdown__title { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--ink); }
.breakdown__segbar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(47, 89, 91, 0.1);
}
.breakdown__seg { height: 100%; }
.breakdown__legend { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 9px; }
.breakdown__legend li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); }
.breakdown__dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.breakdown__legend b { margin-left: auto; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Demo Apple Pay button — the static stand-in for the Express Checkout
   Element. Apple's own black pill, so it reads like the real wallet button. */
.seed-mock-ap {
  appearance: none;
  width: 100%;
  height: 48px;
  margin-top: 2px;
  border: 0;
  border-radius: 16px;
  background: #000;
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}
.seed-mock-ap:active { transform: translateY(1px); }
.seed-mock-ap__logo { width: 22px; height: 22px; flex: none; }
.seed__note { margin: 12px 0 0; font-size: 13px; color: var(--muted); min-height: 16px; }

/* ── Your backings (Transactions) ──────────────────────────────────────
   The person's own backings, listed in the Cards (wallet) tab. */
.txns { width: 100%; max-width: 480px; margin: 8px 0 0; text-align: left; }
.txns__title { margin: 0 0 10px; font-family: var(--font-display); font-variation-settings: var(--font-display-settings); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; color: var(--ink); }
.txns__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.txns__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-soft); }
.txns__who { min-width: 0; }
.txns__name { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txns__date { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.txns__amt { flex: none; font-family: var(--font-display); font-variation-settings: var(--font-display-settings); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; color: var(--forest); font-variant-numeric: tabular-nums; }
.txns__empty { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.txns__empty[hidden] { display: none; }

/* Transactions: a running total + clearer separation from the backing form. */
.txns { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.txns__total { margin: 0 0 12px; font-family: var(--font-display); font-variation-settings: var(--font-display-settings); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; color: var(--forest); }
.txns__total[hidden] { display: none; }
