@font-face { font-family: "League Gothic"; src: url("../fonts/league-gothic-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("../fonts/public-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("../fonts/public-sans-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* The Tip Jar (#200): a pale jar-glass ground, a soft dollar-green shell, and two light green fields with dark ink.
   Always light, whatever the system setting (owner, 2026-11-14). */
:root {
  --display: "League Gothic", "Arial Narrow", sans-serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shell: #3a7558;
  --shell-deep: #2f6249;
  --on-shell: #ffffff;
  --on-shell-muted: #e8f2eb;
  --need: #8fcfc0;
  --want: #b9dcc3;
  --deep: #16261d;
  /* Chip in and other filled marks on a field: a deep green, never black (#200 finish review). */
  --press: #2f6249;
  /* Chip in is the masking-tape marigold, the one warm note, so giving never blends into the green chrome (owner, 2026-11-14). */
  --chip: #ffd166;
  --chip-hover: #f5c04a;
  --on-field: #16261d;
  --on-field-muted: #2f4a3a;
  --field-track: rgb(22 38 29 / 0.2);
  --bg: #f4f6f0;
  --surface: #ffffff;
  --ink: #16261d;
  --muted: #4d5c52;
  --line: #dbe2d8;
  --edge: #86958a;
  --action-bg: #3a7558;
  --action-fg: #ffffff;
  --action-hover: #2f6249;
  --good: #12784a;
  --good-tint: #dcf1e6;
  --bad: #c4302b;
  --bad-text: #b0261f;
  --bad-tint: #fbe3e1;
  --info-tint: #e5ece4;
  --mark-empty: #dbe2d8;
  --radius: 8px;
  /* The iOS app draws under the status bar, so the bar grows by the top inset (#193); it's 0 in a browser. */
  --bar-h: calc(52px + env(safe-area-inset-top));
  --nav-h: 64px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 140ms;
  color-scheme: light;
  accent-color: var(--shell);
}

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

/* Keep the old page on screen until the next one has painted, so moving between asks never flashes. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
[hidden] { display: none !important; }

body {
  overflow-x: clip; /* A card thrown off the stage never adds a sideways scroll. */
  margin: 0;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.5 var(--sans);
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
p, li { text-wrap: pretty; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
input, textarea { caret-color: var(--ink); }
::placeholder { color: var(--muted); opacity: 1; }
html { scrollbar-color: var(--edge) var(--bg); }

h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { margin: 12px 0 20px; font: 400 clamp(2.5rem, 11vw, 3.25rem) / 0.95 var(--display); text-transform: uppercase; letter-spacing: 0.01em; }
.section-title { font: 700 1.125rem/1.3 var(--sans); }
h3.section-title { font-size: 1rem; }

.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 20;
  padding: 10px 14px;
  font-weight: 700;
  color: var(--on-shell);
  background: var(--shell);
  border-radius: var(--radius);
}
.skip-link:focus { top: 8px; }
.container:focus { outline: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Shell: a green bar on top, and on phones the nav sits at the bottom within thumb reach. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  height: var(--bar-h);
  /* Clear the notch when an installed app is turned sideways (#185). */
  padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  color: var(--on-shell);
  background: var(--shell);
}
.topbar a { color: inherit; text-decoration: none; }
.topbar :focus-visible { outline-color: var(--on-shell); }
.brand { font: 400 1.75rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
/* Logged out, the one filled action in the bar. */
.topbar .topbar-signup { min-height: 36px; margin-left: auto; padding: 6px 14px; color: var(--deep); background: var(--on-shell); }
.topbar .topbar-signup:hover { background: #e2eee6; }
/* The front door (home and the How stories, logged out) keeps only the way in (#196). */
.front-door { --nav-h: 0px; }
.topbar .topbar-login { display: inline-flex; align-items: center; min-height: 44px; margin-left: auto; padding: 0 14px; font-weight: 700; color: var(--on-shell-muted); transition: color var(--fast) ease-out; }
.topbar .topbar-login:hover { color: var(--on-shell); }
.topbar .topbar-login + .topbar-signup { margin-left: 4px; }
.topbar > nav {
  position: fixed;
  inset: auto 0 0;
  z-index: 10;
  display: flex;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--shell);
  border-top: 1px solid var(--shell-deep);
}
.topbar > nav a {
  position: relative;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  color: var(--on-shell-muted);
  font-size: 0.75rem;
  font-weight: 700;
  transition: color var(--fast) ease-out;
}
.topbar > nav a:hover, .topbar > nav a[aria-current="page"] { color: var(--on-shell); }
.topbar > nav a[aria-current="page"] .icon { stroke-width: 2.5; }
/* On phones the current tab sits in a deeper green cell with a white rule along its top. */
.topbar > nav a[aria-current="page"] { background: var(--shell-deep); }
.topbar > nav a[aria-current="page"]::before { content: ""; position: absolute; inset: 0 22% auto; height: 3px; background: var(--on-shell); border-radius: 0 0 2px 2px; }
.nav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-inline: 4px; }
.badge {
  position: absolute;
  top: 6px;
  left: calc(50% + 6px);
  min-width: 18px;
  padding: 0 5px;
  font-size: 0.75rem;
  line-height: 18px;
  text-align: center;
  color: var(--deep);
  background: var(--on-shell);
  border-radius: 9px;
  font-variant-numeric: tabular-nums;
}
.container { max-width: 640px; margin: 0 auto; padding: 16px; }

/* The feed stage: one person's ask owns the screen. */
.container-wide:has(> .feed) { max-width: none; padding: 0; }
/* On phones the tabs and rail float over the stage; on wide screens they sit around the card. */
.deck-layout { position: relative; }
.stage {
  position: relative;
  height: calc(100dvh - var(--bar-h) - var(--nav-h) - env(safe-area-inset-bottom));
  min-height: 520px;
  overflow: hidden;
  color: var(--ink);
  background: var(--bg);
}
.deck-layout > .tabs {
  position: absolute;
  inset: 0 0 auto;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 22px;
  margin: 0;
  padding: 12px 16px;
  border: 0;
  pointer-events: none;
}
.deck-layout > .tabs a {
  padding: 6px 0;
  font-weight: 700;
  color: var(--on-field-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  pointer-events: auto;
}
.deck-layout > .tabs a:hover, .deck-layout > .tabs a[aria-current="page"] { color: var(--on-field); }
.deck-layout > .tabs a[aria-current="page"] { border-bottom-color: var(--on-field); }
.deck-layout > .tabs :focus-visible { outline-color: var(--on-field); }

.deck { position: absolute; inset: 0; }
.ticket { --field: var(--need); }
.ticket-want { --field: var(--want); }
.deck-ticket {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  color: var(--on-field);
  background: var(--field);
  touch-action: pan-y; /* A card drags sideways while the page still scrolls under the finger. */
}
/* While a card is moving, the real neighbor waits underneath it. */
.is-moving > .deck-ticket { z-index: 2; user-select: none; }
.deck .deck-under { z-index: 1; pointer-events: none; }
.card-body { position: relative; z-index: 1; display: flex; flex: 1; flex-direction: column; justify-content: flex-end; min-height: 0; padding: 64px 84px 18px 18px; }
/* A poster's photo fills the card; it fades into the field under the words, so dark ink stays readable on any photo. */
.has-photo { background: var(--field); }
.ticket-photo { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; }
/* The photo itself fades out into the field, so the words and Chip in always sit on solid field. */
.ticket-photo { -webkit-mask-image: linear-gradient(to bottom, transparent 4%, #000 18%, #000 30%, transparent 58%); mask-image: linear-gradient(to bottom, transparent 4%, #000 18%, #000 30%, transparent 58%); }
.has-photo .card-body { background: linear-gradient(to bottom, color-mix(in srgb, var(--field) 85%, transparent), transparent 22%); }
.has-photo .card-title { margin-block: auto 0; }
.card-title { margin-block: auto; font: 400 clamp(3.25rem, 15vw, 4.75rem) / 0.92 var(--display); text-transform: uppercase; letter-spacing: 0.005em; overflow-wrap: break-word; }
.card-title a { color: inherit; text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; }
.deck-ticket:hover .card-title a { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.08em; }
.card-title a:focus-visible { outline: none; }
.card-title a:focus-visible::after { outline: 2px solid var(--on-field); outline-offset: -6px; }
.ticket-foot { flex: none; margin-top: 14px; }
.ticket-foot p { margin: 0; }
.ticket .card-head { font-size: 0.9375rem; color: var(--on-field-muted); }
.ticket .card-head a { position: relative; z-index: 1; font-weight: 700; text-decoration: none; }
.ticket .card-head a:hover { text-decoration: underline; }
.ticket-story { margin-top: 6px !important; font-size: 1rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ticket .amounts { margin-top: 14px !important; font-size: 1rem; font-variant-numeric: tabular-nums; }
.ticket .amounts strong { font-size: 1.75rem; line-height: 1; }
.ticket .meter { height: 3px; margin-top: 10px; }
.tear-tab {
  position: relative;
  z-index: 1;
  display: block;
  margin: 0 18px 18px;
  padding: 15px;
  font-size: 1.0625rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  color: var(--deep);
  background: var(--chip);
  border-radius: 12px;
  transition: background-color var(--fast) ease-out;
}
.tear-tab:hover { background: var(--chip-hover); }
.tear-tab:focus-visible { outline-color: var(--deep); outline-offset: 3px; }

/* The rail: Back and Next as glyphs on the right edge. The one you're dragging toward lights up. */
.rail {
  position: absolute;
  right: 10px;
  bottom: 96px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  pointer-events: none;
}
.rail-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 700; color: var(--on-field); text-decoration: none; pointer-events: auto; }
.rail-btn .icon {
  width: 52px;
  height: 52px;
  padding: 12px;
  border-radius: 50%;
  transition: background-color var(--fast) ease-out, color var(--fast) ease-out, transform var(--fast) var(--ease-out);
}
.rail-btn:hover .icon { color: #ffffff; background: var(--press); }
.rail-btn:focus-visible { outline: none; }
.rail-btn:focus-visible .icon { color: #ffffff; background: var(--press); outline: 2px solid var(--press); outline-offset: 2px; }
.deck-layout[data-toward="next"] .deck-next .icon, .deck-layout[data-toward="back"] .deck-back .icon { color: #ffffff; background: var(--press); transform: scale(1.08); }
.deck-back { order: 1; }
.deck-next { order: 2; }
.deck-hint { display: none; }
.deck-count { order: 3; font-size: 0.75rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--on-field); }
.stage-empty { display: flex; flex-direction: column; justify-content: center; height: 100%; padding: 64px 24px; }
.stage-empty p { margin: 0; color: var(--muted); }
.stage-empty-title { font: 400 3rem/0.95 var(--display); text-transform: uppercase; color: var(--ink) !important; margin-bottom: 12px !important; }
.stage-empty a { color: var(--ink); font-weight: 700; }

/* Ten marks toward the goal, filled once on the post page. */
.meter { height: 4px; background: var(--mark-empty); border-radius: 2px; }
.meter i { display: block; width: var(--p); max-width: 100%; height: 100%; background: var(--ink); border-radius: 2px; }
.ticket .meter, .post-hero .meter { background: var(--field-track); }
.ticket .meter i, .post-hero .meter i { background: var(--deep); }

.amounts { margin: 0; font-variant-numeric: tabular-nums; }
.amounts strong { font-size: 1.25rem; }

/* The post page: the same color field as a header, then the story on the page. */
.post { --field: var(--need); margin-bottom: 16px; }
.post-want { --field: var(--want); }
.post-hero { margin: -16px -16px 0; padding: 28px 16px 22px; color: var(--on-field); background: var(--field); }
.post-hero h1 { margin: 0 0 14px; font-size: clamp(3rem, 14vw, 4.5rem); line-height: 0.92; }
.post-hero .card-head { margin: 0; font-size: 0.9375rem; color: var(--on-field-muted); }
.post-hero .amounts { margin: 18px 0 10px; font-size: 1rem; }
.post-hero .amounts strong { font-size: 2rem; }
.post-hero .meter { height: 4px; }
.post-hero :focus-visible { outline-color: var(--on-field); }
.post-hero.has-photo { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: min(72vh, 600px); overflow: hidden; }
.post-hero.has-photo > :not(.hero-photo) { position: relative; z-index: 1; }
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 62%); mask-image: linear-gradient(to bottom, #000 30%, transparent 62%); }
.card-head a { font-weight: 700; text-decoration: none; }
.card-head a:hover { text-decoration: underline; }
.post-body { max-width: 68ch; margin: 20px 0; font-size: 1.0625rem; white-space: pre-line; }
.update-body { margin: 8px 0 0; font-size: 1rem; }
.update-due { margin: 0; font-weight: 700; }

/* Panels and forms */
.group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0 0;
  padding: 18px 16px;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-radius: 14px;
}
.group legend { float: left; width: 100%; padding: 0; font-weight: 700; font-size: 1.125rem; }
.group legend + * { clear: both; }
.plain-group { margin: 0; padding: 0; border: 0; }
.plain-group legend { padding: 0; margin-bottom: 4px; font-weight: 700; }
.form { display: flex; flex-direction: column; gap: 16px; }
.page-form { margin-bottom: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.field small { font-size: 0.875rem; font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--edge);
  border-radius: var(--radius);
  transition: border-color var(--fast) ease-out;
}
.group .field input, .group .field select, .group .field textarea { background: var(--bg); }
.field input, .field select { min-height: 48px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline-offset: 1px; border-color: var(--ink); }
.field [aria-invalid="true"], .field [aria-invalid="true"]:focus-visible { border-color: var(--bad); border-width: 2px; }
.field textarea { min-height: 128px; }
.field input[type="file"] { min-height: 0; padding: 10px; font-size: 0.9375rem; color: var(--muted); }
.field input[type="file"]::file-selector-button { margin-right: 12px; padding: 8px 14px; font: inherit; font-weight: 700; color: var(--ink); background: transparent; border: 1.5px solid var(--edge); border-radius: var(--radius); cursor: pointer; }
.field input[type="file"]::file-selector-button:hover { border-color: var(--ink); }
.error, .field small.error { color: var(--bad-text); font-weight: 700; }
.muted, .hint, .field small:not(.error) { color: var(--muted); }
.hint { margin: 0; font-size: 0.9375rem; }
.choices { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.choice { display: flex; align-items: center; gap: 10px; min-height: 36px; font-weight: 400; }
.choice input { width: 20px; height: 20px; margin: 0; }

.flash, .notice { margin: 0 0 14px; padding: 12px 14px; color: var(--ink); background: var(--info-tint); border-radius: var(--radius); }
.flash-success { background: var(--good-tint); }
.flash-error, .notice-error { background: var(--bad-tint); }
.stage-page .container-wide > .flash { margin: 0; border-radius: 0; }
.group .notice { margin: 0; background: var(--bg); }

/* Buttons: one filled action, everything else outlined. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  color: var(--action-fg);
  background: var(--action-bg);
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color var(--fast) ease-out, border-color var(--fast) ease-out, transform var(--fast) var(--ease-out);
}
.btn:hover:not(:disabled) { background: var(--action-hover); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { color: var(--ink); background: transparent; border-color: var(--edge); }
.btn-secondary:hover:not(:disabled) { background: transparent; border-color: var(--ink); }
.btn-danger { color: #ffffff; background: var(--bad); }
.btn-danger:hover:not(:disabled) { background: var(--bad-text); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions form { margin: 0; }
.danger-zone { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.danger-zone .section-title { margin-bottom: 8px; }
.confirm-prompt { margin: 0 0 12px; }

/* Chipping in */
.chip-in { display: flex; flex-direction: column; gap: 12px; }
.step-pay { display: flex; flex-direction: column; gap: 12px; }
.chip-in h3.step-pay { display: block; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.sent-row .field label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.chip-in[data-step="sent"] .step-pay { display: none; }
.sent-question { margin: 0; font-size: 1.25rem; font-weight: 700; line-height: 1.25; }
.sent-question:focus { outline: none; }
.chip-in[data-step="sent"] .sent-row .btn { flex: 1; }
.chip-in[data-step="sent"] button[type="submit"] { color: var(--action-fg); background: var(--action-bg); border-color: transparent; }
.pay-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.pay-buttons .btn { flex: 1 1 96px; flex-direction: column; gap: 0; }
.pay-buttons small { display: block; font-size: 0.8125rem; font-weight: 400; opacity: 0.8; }
.sent-row { display: flex; align-items: flex-end; gap: 8px; }
.sent-row .field { flex: 1; }
.sent-row .btn { min-height: 48px; }
.side-amount { font-size: 1rem; }
.side-amount strong { font-size: 2rem; }

.reactions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.reactions form { margin: 0; }
.react { min-height: 40px; padding: 6px 14px; font-variant-numeric: tabular-nums; }
.react[aria-pressed="true"] { background: var(--good-tint); border-color: var(--good); }
.reaction-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.reactions-hint { margin-top: 8px; }

/* State marks: a shape and a word, never a pill. */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 0.875rem; font-weight: 700; white-space: nowrap; }
.chip::before { content: ""; width: 10px; height: 10px; border: 2px solid var(--muted); border-radius: 50%; }
.chip-confirmed::before { background: var(--good); border-color: var(--good); }
.chip-disputed { color: var(--bad-text); }
.chip-disputed::before { background: var(--bad); border-color: var(--bad); border-radius: 2px; }
.chip-expired { color: var(--muted); }
.chip-expired::before { background: var(--mark-empty); border-color: var(--mark-empty); }

/* Lists: hairline rows, dense, no cards inside cards. */
.count { font-family: var(--sans); font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.gift-section { margin-bottom: 36px; }
.gift-section > .section-title { margin-bottom: 4px; }
.gift-section > .hint { margin-bottom: 12px; }
.cards { margin: 0; padding: 0; list-style: none; }
.gift { padding: 16px 0; border-top: 1px solid var(--line); }
.gift + .gift { margin-top: 0; }
:where(.gift) p { margin: 0; }
.gift-amount { font-size: 1.75rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.gift-meta { margin-top: 2px; }
.gift-prompt { margin-top: 14px; font-weight: 700; }
.gift-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.gift-prompt + .gift-actions { margin-top: 10px; }
.gift-actions form { margin: 0; }
.gift-list, .leader-list { margin: 8px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.leader-list { display: grid; grid-template-columns: auto 1fr auto; column-gap: 14px; }
.leader-list li { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: baseline; padding: 12px 4px; }
.gift-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline; padding: 12px 0; }
.gift-list li + li, .leader-list li + li { border-top: 1px solid var(--line); }
.gift-list a.gift-list-title { font-weight: 700; text-decoration: none; }
.gift-list-title:hover { text-decoration: underline; }
.gift-list-amount { justify-self: end; font-weight: 700; font-variant-numeric: tabular-nums; }
.gift-list-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: 0.9375rem; color: var(--muted); }
.gift-list-note { margin-top: 8px; }

/* Leaders */
.tabs { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs + .tabs { margin-top: -6px; }
.tabs a { padding: 10px 0; margin-bottom: -1px; font-weight: 700; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.leaders-hint { margin: -6px 0 16px; }
.leader-list .is-you { font-weight: 700; background: var(--good-tint); }
.leader-rank { justify-self: end; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.leader-people { justify-self: end; font-variant-numeric: tabular-nums; }
.leader-you { margin: 12px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.leader-cta { margin: 18px 0 0; }

/* Profile */
.rewards { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; padding: 18px 16px; background: var(--surface); border-radius: 14px; }
.rewards p { margin: 0; }
.rewards-level { font: 400 2.25rem/1 var(--display); text-transform: uppercase; }
.rewards-stats { font-variant-numeric: tabular-nums; }
.rewards-streak { font-weight: 700; }
.badge-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; padding: 0; list-style: none; }
.badge-list li { padding: 3px 10px; font-size: 0.875rem; font-weight: 700; background: var(--good-tint); border-radius: 6px; }
.follow-through { margin: 16px 0 0; font-weight: 700; }
.follow-through-hint { margin-top: 2px; }
.handles { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 12px 0; }
.handles dt { color: var(--muted); }
.handles dd { margin: 0; font-weight: 700; }

.empty { color: var(--muted); }
.rules { padding-left: 20px; }
.rules li { margin-bottom: 10px; }
.profile-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.profile-head h1 { min-width: 0; overflow-wrap: anywhere; }
.profile-head .btn { flex: none; min-height: 40px; padding: 6px 14px; }
.profile-tabs { margin-top: 32px; }
.profile-tabs + .gift-section, .profile-tabs + .profile-posts { margin-top: 0; }
.profile-posts { margin-top: 32px; }
.gift-section + .profile-posts { margin-top: 28px; }
.post-list .meter { grid-column: 1 / -1; margin: 6px 0 2px; }
.settings-back { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-weight: 700; text-decoration: none; }
.settings-back .icon { width: 18px; height: 18px; }
.post-list-goal { font-weight: 400; color: var(--muted); }
.post-list-actions { display: inline-flex; gap: 16px; margin-left: auto; }
.post-list-actions a { display: inline-block; padding-block: 8px; margin-block: -8px; font-weight: 700; color: var(--ink); }
.post-hero .post-edited { margin: 4px 0 0; font-size: 0.875rem; color: var(--on-field-muted); }
.report-link { margin-top: 28px; font-size: 0.875rem; text-align: center; }
.report-link a { color: var(--muted); }
.admin-item { margin-bottom: 12px; }
.admin-item h3 { margin: 0 0 4px; font-size: 1rem; }
.admin-item .actions { margin-top: 10px; }
.admin-photo { display: block; width: 160px; height: 200px; margin-top: 8px; object-fit: cover; border-radius: var(--radius); }
.legal h2 { margin: 24px 0 6px; font-size: 1.125rem; font-family: var(--sans); }
.legal h2:first-of-type { margin-top: 8px; }
.legal p { margin: 0 0 10px; }
.legal-note { color: var(--muted); font-size: 0.875rem; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; padding: 22px 16px 26px; font-size: 0.875rem; }
.site-footer a { color: var(--muted); }
.stage-page .site-footer { padding-top: 18px; }

@media (forced-colors: active) {
  .meter { border: 1px solid CanvasText; }
  .meter i { background: CanvasText; forced-color-adjust: none; }
  .deck-ticket, .post-hero, .group, .rewards, .flash, .notice, .rail-btn .icon { border: 1px solid CanvasText; }
  .chip::before { forced-color-adjust: none; }
}

@media (max-width: 380px) {
  .card-body { padding-right: 76px; }
  .tabs { gap: 16px; }
}

/* Website: the nav moves up into the bar, and the stage stands beside the Chip in panel. */
@media (min-width: 960px) {
  :root { --bar-h: 60px; --nav-h: 0px; }
  body { padding-bottom: 0; }
  .topbar { justify-content: space-between; padding: 0 max(24px, calc((100% - 1120px) / 2)); }
  .topbar > nav { position: static; height: auto; padding: 0; gap: 4px; background: none; border: 0; }
  .topbar > nav a { flex: none; flex-direction: row; gap: 8px; padding: 8px 12px; font-size: 0.9375rem; border-radius: var(--radius); }
  .topbar > nav a[aria-current="page"] { background: var(--shell-deep); }
  .topbar > nav a[aria-current="page"]::before { display: none; }
  .topbar > nav .icon { width: 20px; height: 20px; }
  .topbar > nav { margin-left: auto; }
  .topbar > nav a[href="/signup"] { display: none; }
  .join-page .topbar > nav a[href^="/login"] { display: none; }
  .topbar .topbar-signup { margin-left: 12px; }
  .nav-user .nav-label { max-width: 14ch; }
  .badge { position: static; margin-left: -2px; }
  .container { padding: 28px 16px; }
  /* The feed card takes the post page's shape: the ask on the left, Chip in on the right, arrows outside. */
  .feed { max-width: 1240px; margin: 0 auto; padding: 20px 24px 8px; }
  .deck-layout {
    display: grid;
    grid-template-columns: 88px minmax(0, 660px) 400px 88px;
    grid-template-areas: "tabs tabs tabs tabs" "back stage side next" ". count count .";
    justify-content: center;
    align-items: center;
    row-gap: 16px;
  }
  .deck-layout > .tabs { position: static; grid-area: tabs; padding: 0; }
  .stage { grid-area: stage; height: min(620px, calc(100dvh - var(--bar-h) - 170px)); min-height: 460px; border-radius: 18px 0 0 18px; }
  .deck-layout:not(:has(.deck-side)) .stage { grid-column: stage / side; border-radius: 18px; }
  .deck-side { grid-area: side; align-self: stretch; display: flex; flex-direction: column; overflow-y: auto; padding: 28px; background: var(--surface); border-radius: 0 18px 18px 0; }
  .deck-side .group, .post .post-side > .group { padding: 0; background: none; border-radius: 0; }
  .deck-side .group { margin: 0; }
  .deck .tear-tab { display: none; }
  .card-body { padding: 32px; }
  .card-title { margin-block: auto 0; }
  .rail { display: contents; }
  .deck-back { grid-area: back; justify-self: start; }
  .deck-next { grid-area: next; justify-self: end; }
  .rail-btn { font-size: 0.8125rem; color: var(--muted); }
  .rail-btn:hover { color: var(--ink); }
  .rail-btn .icon { width: 60px; height: 60px; padding: 17px; color: var(--ink); border: 1.5px solid var(--edge); }
  .rail-btn:hover .icon { color: var(--bg); background: var(--ink); }
  .deck-count { grid-area: count; justify-self: center; font-size: 0.8125rem; color: var(--muted); }
  .deck-hint { display: inline; font-weight: 400; }
  .stage-page .container-wide:not(:has(> .feed)) { max-width: 1120px; margin: 0 auto; padding: 28px 24px; }
  .post-hero { margin: 0; padding: 36px 32px 28px; border-radius: 18px; }
  .post-hero h1 { font-size: 5rem; }
  .post-hero.has-photo { min-height: 520px; }
  .post:has(> .post-side > .group) { display: grid; grid-template-columns: minmax(0, 1fr) 400px; column-gap: 28px; align-items: start; }
  .post:has(> .post-side > .group) > :not(.post-side) { grid-column: 1; }
  .post > .post-side:has(> .group) { grid-column: 2; grid-row: 1 / span 4; }
  .post .post-side > .group:first-child { margin-top: 0; }
  .post-body { margin-inline: 4px; }
}
@media (max-width: 959px) {
  .deck-side { display: none; }
}

/* Home (#120): two doors. Each opens its own story, one step per page, and the door you take becomes the screen. */
body.stage-page .container-wide:has(> .home, > .how, > .join) { max-width: none; padding: 0; }
.home-door-help, .how-story-help .how-field, .how-other-help { --field: var(--want); }
.home-door-ask, .how-story-ask .how-field, .how-other-ask { --field: var(--need); }
.home { --door-h: clamp(260px, calc((100svh - var(--bar-h) - var(--nav-h) - env(safe-area-inset-bottom) - 96px) / 2), 420px); color: var(--ink); }
.home-doors { display: grid; }
.home-door {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  min-height: var(--door-h);
  padding: 24px 18px 20px;
  color: var(--on-field);
  text-decoration: none;
  background: var(--field);
}
/* Real photos from posts tile the top of a door, turned to the door's own color, and the field takes over under the words. */
.home-door { position: relative; isolation: isolate; overflow: hidden; }
.home-door > span:not(.home-mosaic) { position: relative; z-index: 2; }
.home-mosaic { position: absolute; inset: 0 0 auto; z-index: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; height: 48%; isolation: isolate; }
.home-mosaic img:nth-child(n + 4) { display: none; }
.home-mosaic img { display: block; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.1); }
.home-mosaic::after { content: ""; position: absolute; inset: 0; background: var(--field); mix-blend-mode: multiply; }
.home-door:has(.home-mosaic)::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to bottom, transparent 18%, var(--field) 50%); pointer-events: none; }
.home-door-line { font: 400 clamp(3.25rem, 15vw, 4.75rem) / 0.92 var(--display); text-transform: uppercase; letter-spacing: 0.005em; }
.home-door-text { max-width: 34ch; font-size: 1.0625rem; }
.home-door-go, .how-other-go { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.home-door-go { margin-top: 6px; }
.home-door-go .icon, .how-other-go .icon { width: 20px; height: 20px; transition: transform var(--fast) var(--ease-out); }
.home-door:hover .home-door-go, .how-other:hover .how-other-go { text-decoration: underline; text-underline-offset: 0.18em; }
.home-door:hover .home-door-go .icon, .how-other:hover .how-other-go .icon { transform: translateX(4px); }
.home-door:focus-visible, .how-other:focus-visible { outline: 2px solid var(--on-field); outline-offset: -6px; }
.home-promise { margin: 0; padding: 20px 18px; color: var(--muted); }
.home-promise strong { color: var(--ink); }

/* A story step: one field fills the screen, and the other door waits docked at its foot. */
.how { display: flex; flex-direction: column; min-height: calc(100svh - var(--bar-h) - var(--nav-h) - env(safe-area-inset-bottom)); color: var(--ink); }
.how-field {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 20px;
  padding: 16px 18px 8px;
  color: var(--on-field);
  background: var(--field);
  touch-action: pan-y;
}
/* The door's photos carry into its story: three across the top of the field, fading to solid behind the headline. */
.how-field:has(.home-mosaic) { position: relative; isolation: isolate; overflow: hidden; }
.how-field > :not(.home-mosaic, .sr-only) { position: relative; z-index: 2; }
.how-field .home-mosaic { height: 44%; grid-template-rows: 1fr; }
/* The headline sits on the band on phones, so its photos stay pale enough for dark ink. */
.how-field .home-mosaic img { filter: grayscale(1) contrast(0.7) brightness(1.25); }
.how-field:has(.home-mosaic)::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to bottom, transparent 6%, var(--field) 30%); pointer-events: none; }
.how-progress { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.how-progress li { flex: 1; height: 3px; background: var(--field-track); border-radius: 2px; }
.how-progress li.on { background: var(--deep); }
.how-step { display: flex; flex: 1; flex-direction: column; gap: 20px; }
.how-line { margin: 0; font: 400 clamp(2.75rem, 12.5vw, 4.25rem) / 0.92 var(--display); text-transform: uppercase; letter-spacing: 0.005em; text-wrap: balance; }
.how-piece { margin: 0; }
.how-example { display: inline-block; margin-bottom: 10px; padding: 3px 8px; font-size: 0.75rem; font-weight: 700; border: 1.5px solid var(--on-field); border-radius: 6px; }
.how-piece .group { max-width: 400px; margin: 0; }
.how-piece .btn { cursor: default; }
.how-piece .btn:active { transform: none; }
.how-panel p { margin: 0; }
/* The example ask card is a plain panel like every other example, never the other door's color. */
.how-ask { max-width: 360px; padding: 20px 18px 16px; color: var(--ink); background: var(--surface); border-radius: 14px; }
.how-ask p { margin: 0; }
.how-ask .how-ask-title { margin-bottom: 8px; font: 400 2.5rem/0.92 var(--display); text-transform: uppercase; }
.how-ask-tab { display: block; margin-top: 14px; padding: 12px; text-align: center; font-weight: 700; color: var(--deep); background: var(--chip); border-radius: 12px; }
.how-confirmed { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.how-thanks { display: flex; flex-direction: column; gap: 6px; }
.how-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
.how-nav a:not(.btn) { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; color: var(--on-field); text-decoration: none; }
.how-nav a:not(.btn):hover { text-decoration: underline; text-underline-offset: 0.18em; }
.how-nav .icon { width: 20px; height: 20px; }
.how-count { font-size: 0.875rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.how-other {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  min-height: 72px;
  padding: 12px 18px;
  color: var(--on-field);
  text-decoration: none;
  background: var(--field);
}
.how-other-line { font: 400 1.75rem/1 var(--display); text-transform: uppercase; }

/* Sign up (#120): the story's white Sign up grows into this card, and the story's field sinks into the strip at the foot. */
.join { display: flex; flex-direction: column; min-height: calc(100svh - var(--bar-h) - var(--nav-h) - env(safe-area-inset-bottom)); color: var(--ink); }
.join-step { flex: 1; width: 100%; max-width: 480px; margin: 0 auto; padding: 12px 18px 28px; }
.join-line { margin: 0 0 8px; font: 400 clamp(3.25rem, 15vw, 4.75rem) / 0.92 var(--display); text-transform: uppercase; letter-spacing: 0.005em; }
.join-lede { margin: 0 0 14px; max-width: 40ch; color: var(--muted); }
.join-card { padding: 16px 18px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; }
.join-card .form { color: var(--ink); }
.join-login { margin: 20px 0 0; color: var(--muted); }
.join-login a { color: var(--ink); font-weight: 700; }
.join-back { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 3; justify-content: flex-start; gap: 8px; min-height: 56px; font-weight: 700; }
.join-back .icon { width: 20px; height: 20px; }

/* The door you take grows into the story while the other shrinks into the strip; each step's words cut in from the right. */
@media (prefers-reduced-motion: no-preference) {
  .home-door-help, .how-story-help .how-field, .how-other-help { view-transition-name: field-help; }
  .home-door-ask, .how-story-ask .how-field, .how-other-ask { view-transition-name: field-ask; }
  .how-step, .join-step { view-transition-name: how-step; }
  .how-end, .join-card { view-transition-name: join-card; }
  /* The button grows into the form card in front of the field sinking to the foot; the step words ride on top too. */
  ::view-transition-group(field-help), ::view-transition-group(field-ask) { z-index: 1; }
  ::view-transition-group(how-step), ::view-transition-group(join-card) { z-index: 2; }
  ::view-transition-group(join-card) { overflow: clip; border-radius: var(--radius); animation-duration: 460ms; animation-timing-function: var(--ease-out); }
  ::view-transition-old(join-card) { height: 100%; object-fit: none; object-position: center; animation: how-fade-out 120ms 100ms ease-in both; }
  ::view-transition-new(join-card) { height: 100%; object-fit: none; object-position: left top; animation: how-fade-in 200ms ease-out both; }
  ::view-transition-group(field-help), ::view-transition-group(field-ask) { overflow: clip; animation-duration: 460ms; animation-timing-function: var(--ease-out); }
  /* When both pages carry a field, its group holds the field's own color so a growing door never shows a ghosted band.
     A field with no partner just fades (how.js names the pairs). */
  html:active-view-transition-type(keep-help)::view-transition-group(field-help) { background: var(--want); }
  html:active-view-transition-type(keep-ask)::view-transition-group(field-ask) { background: var(--need); }
  ::view-transition-old(field-help), ::view-transition-new(field-help),
  ::view-transition-old(field-ask), ::view-transition-new(field-ask) { height: 100%; object-fit: none; object-position: left bottom; animation-duration: 460ms; }
  ::view-transition-group(how-step) { animation-duration: 420ms; animation-timing-function: var(--ease-out); }
  ::view-transition-new(how-step) { animation: how-cut 420ms var(--ease-out) both; }
  ::view-transition-old(how-step) { animation: how-leave 220ms ease-in both; }
  html:active-view-transition-type(back)::view-transition-new(how-step) { animation-name: how-cut-back; }
  html:active-view-transition-type(back)::view-transition-old(how-step) { animation-name: how-leave-back; }
  html:active-view-transition-type(open)::view-transition-new(how-step) { animation-delay: 220ms; }
}
/* The doors arrive (#203): on a fresh open each door's color fills up from its foot like a tip jar,
   help then ask, the words rise in as their field lands, and the money line comes last. */
@media (prefers-reduced-motion: no-preference) {
  .arrive .home-door { animation: door-fill 520ms var(--ease-out) both; }
  .arrive .home-door-ask { animation-delay: 110ms; }
  .arrive .home-door > span:not(.home-mosaic) { animation: door-words 420ms var(--ease-out) 300ms both; }
  .arrive .home-door-ask > span:not(.home-mosaic) { animation-delay: 410ms; }
  .arrive .home-promise { animation: how-fade-in 360ms ease-out 560ms both; }
}
@media (prefers-reduced-motion: reduce) {
  .arrive .home-door, .arrive .home-promise { animation: how-fade-in 200ms ease-out both; }
}
@keyframes door-fill { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } }
@keyframes door-words { from { opacity: 0; transform: translateY(12px); } }
@keyframes how-cut { from { clip-path: inset(0 0 0 100%); transform: translateX(32px); } to { clip-path: inset(0); transform: none; } }
@keyframes how-cut-back { from { clip-path: inset(0 100% 0 0); transform: translateX(-32px); } to { clip-path: inset(0); transform: none; } }
@keyframes how-leave { to { opacity: 0; transform: translateX(-32px); } }
@keyframes how-fade-out { to { opacity: 0; } }
@keyframes how-fade-in { from { opacity: 0; } }
@keyframes how-leave-back { to { opacity: 0; transform: translateX(32px); } }

@media (min-width: 960px) {
  .home { --door-h: clamp(420px, calc(100svh - var(--bar-h) - 96px), 640px); }
  .home-doors { grid-template-columns: 1fr 1fr; gap: 16px; max-width: 1240px; margin: 0 auto; padding: 20px 24px 0; }
  /* The two doors share rows, so their headlines sit on one line whatever the sentences below them do. */
  .home-doors { grid-template-rows: minmax(0, 1fr) auto auto auto; min-height: calc(var(--door-h) + 20px); }
  .home-door { display: grid; grid-row: span 4; grid-template-rows: subgrid; grid-template-columns: minmax(0, 1fr); row-gap: 8px; min-height: 0; }
  .home-door-line { grid-area: 2 / 1; align-self: end; }
  .home-door-text { grid-area: 3 / 1; }
  .home-door-go { grid-area: 4 / 1; justify-self: start; }
  .home-door { padding: 32px; border-radius: 18px; }
  .home-mosaic { grid-template-rows: repeat(2, 1fr); height: 62%; }
  .home-mosaic img:nth-child(n + 4) { display: block; }
  /* The last seam falls in the gap left of the example column, never through the Example tag. */
  .how-field .home-mosaic { height: 52%; grid-template-rows: 1fr; grid-template-columns: 1fr 1fr calc(400px + 40px + 28px); }
  .how-field:has(.home-mosaic)::after { background: linear-gradient(to bottom, transparent 22%, var(--field) 50%); }
  .home-door:has(.home-mosaic)::after { background: linear-gradient(to bottom, transparent 22%, var(--field) 62%); }
  .home-promise { max-width: 1240px; margin: 0 auto; padding: 18px 24px; }
  .how { gap: 12px; max-width: 1240px; min-height: calc(100svh - var(--bar-h)); margin: 0 auto; padding: 20px 24px 24px; }
  .how-field { gap: 28px; padding: 28px 40px 20px; border-radius: 18px; }
  .how-step { display: grid; grid-template-columns: minmax(0, 1fr) 400px; align-items: center; gap: 56px; }
  .how-line { font-size: 5.5rem; }
  .how-other { padding: 16px 40px; border-radius: 18px; }
  .join { max-width: 1240px; min-height: calc(100svh - var(--bar-h)); margin: 0 auto; padding: 0 24px 24px; }
  .join-step { padding-top: 24px; }
  .join-back { bottom: 24px; }
  ::view-transition-group(field-help), ::view-transition-group(field-ask) { border-radius: 18px; }
}
