/* Pay My Bills styles.
   Colours, type and spacing follow the Faith AI design system: mocha, platinum and lavender,
   Schibsted Grotesk and Newsreader, body text at least 18px, 4px corners, hairlines, no shadows
   and no hover animations. */

/* Fonts */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("assets/fonts/SchibstedGrotesk-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("assets/fonts/SchibstedGrotesk-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("assets/fonts/SchibstedGrotesk-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("assets/fonts/SchibstedGrotesk-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("assets/fonts/Newsreader-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("assets/fonts/Newsreader-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("assets/fonts/Newsreader-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* Tokens */

:root {
  --mocha: #6f4e37;
  --platinum: #e5e4e2;
  --lavender: #e6e0f0;
  --espresso: #3e2b1f;

  --surface: var(--platinum);
  --surface-raised: #f4f3f1;
  --surface-sunken: #d8d6d3;
  --line: #cbc8c4;
  --ink: #3e2b1f;
  --ink-muted: #5f4e42;
  --accent-ink: var(--mocha);
  --focus: var(--mocha);
  --error: #8a2d1f;

  --button-fill: var(--mocha);
  --button-fill-hover: #5a3f2c;
  --button-ink: var(--platinum);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;

  --radius: 4px;

  --font-sans: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: Newsreader, Georgia, "Times New Roman", serif;

  --wrap: 1160px;
  --gutter: 16px;
  --measure: 38rem;
  --tab-bar: 64px;
}

/* The design system's dark theme on espresso, for the header. */
.band-espresso {
  --surface: var(--espresso);
  --line: #9a7c66;
  --ink: var(--platinum);
  --ink-muted: #e0d5cc;
  --accent-ink: var(--lavender);
  --focus: var(--lavender);
  background: var(--surface);
  color: var(--ink);
}

/* Base */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--tab-bar);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 28px;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1;
}

main:focus {
  outline: none;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure,
blockquote,
fieldset {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

fieldset {
  padding: 0;
  border: 0;
  min-width: 0;
}

legend {
  padding: 0;
}

a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Headings take focus when the screen changes, so screen readers start there. They need no ring. */
h1[tabindex="-1"]:focus,
h2[tabindex="-1"]:focus {
  outline: none;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 40;
  padding: var(--space-3) var(--space-4);
  background: var(--mocha);
  color: var(--platinum);
  border-radius: var(--radius);
}

.skip-link:focus {
  top: var(--space-4);
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

@media (min-width: 760px) {
  :root {
    --gutter: 40px;
  }
  body {
    padding-bottom: 0;
  }
}

/* Type */

.display {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 40px;
  line-height: 44px;
  letter-spacing: -0.01em;
  color: var(--accent-ink);
}

.headline {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 32px;
  line-height: 38px;
  color: var(--accent-ink);
}

.display em,
.headline em {
  font-style: italic;
}

.overline {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.lead {
  font-size: 20px;
  line-height: 31px;
}

.heading {
  font-size: 21px;
  line-height: 28px;
  font-weight: 600;
}

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

.small {
  font-size: 16px;
  line-height: 24px;
}

.prose {
  max-width: var(--measure);
}

.prose > * + * {
  margin-top: var(--space-4);
}

@media (min-width: 900px) {
  .display {
    font-size: 56px;
    line-height: 60px;
  }
  .headline {
    font-size: 40px;
    line-height: 46px;
  }
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 24px;
  border: 2px solid var(--button-fill);
  border-radius: var(--radius);
  background: var(--button-fill);
  color: var(--button-ink);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--button-fill-hover);
  border-color: var(--button-fill-hover);
}

.button:disabled {
  cursor: default;
  opacity: 0.6;
}

.button-secondary,
.button-secondary:hover {
  background: transparent;
  border-color: var(--ink-muted);
  color: var(--ink);
}

.button-secondary:hover {
  border-color: var(--ink);
}

.button-block {
  width: 100%;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

@media (max-width: 479px) {
  .button-row .button {
    width: 100%;
  }
}

.text-button {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-ink);
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.text-button:hover {
  text-decoration-thickness: 2px;
}

/* Demo notice */

/* Stays on screen while the page scrolls, so nobody can miss that this is a demo. */
.demo-note {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: var(--space-2) var(--gutter);
  background: var(--lavender);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 15px;
  line-height: 22px;
  text-align: center;
}

.status-main > .notice,
.help-copy > .notice {
  margin-bottom: var(--space-6);
}

/* Header and navigation */

.app-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  min-height: 64px;
}

.brand {
  display: block;
  padding-block: var(--space-3);
}

.brand img {
  height: 24px;
  width: 140px;
}

.top-nav {
  display: none;
}

.top-nav a,
.tab-bar a {
  text-decoration: none;
}

.top-nav a {
  display: block;
  padding-block: var(--space-2);
  border-bottom: 2px solid transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 24px;
}

.top-nav a:hover {
  border-bottom-color: var(--line);
}

.top-nav a[aria-current="page"] {
  border-bottom-color: var(--accent-ink);
}

/* On phones the main links sit in a bar at the bottom, where thumbs reach them. */
.tab-bar {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: var(--surface-raised);
}

.tab-bar a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tab-bar);
  margin-top: -1px;
  border-top: 2px solid transparent;
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 20px;
  text-align: center;
}

.tab-bar a[aria-current="page"] {
  border-top-color: var(--mocha);
  color: var(--mocha);
  font-weight: 600;
}

@media (min-width: 760px) {
  .app-header .wrap {
    min-height: 80px;
  }
  .brand img {
    height: 28px;
    width: 163px;
  }
  .top-nav {
    display: flex;
    gap: var(--space-6);
  }
  .tab-bar {
    display: none;
  }
}

/* Screens */

.screen {
  padding-block: var(--space-8) var(--space-16);
}

@media (min-width: 900px) {
  .screen {
    padding-block: var(--space-12) 96px;
  }
}

.narrow {
  max-width: calc(46rem + 2 * var(--gutter));
}

.side-block {
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}

.side-block > * + * {
  margin-top: var(--space-3);
}

.nowrap {
  white-space: nowrap;
}

.plain-list {
  padding-left: 1.2em;
  list-style: disc;
}

.plain-list li + li {
  margin-top: var(--space-2);
}

/* Lavender sits behind the parts about a person. */
.notice {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius);
  background: var(--lavender);
}

.notice > * + * {
  margin-top: var(--space-2);
}

/* Home */

.home-grid {
  display: grid;
  gap: var(--space-12);
}

.home-copy > * + * {
  margin-top: var(--space-6);
}

.trust-line {
  display: grid;
  gap: var(--space-1);
  font-size: 16px;
  line-height: 24px;
  color: var(--ink-muted);
}

/* Every item gets a leading dot, and the list clips whichever dot starts a line,
   so a wrapped line never begins with a separator. */
@media (min-width: 640px) {
  .trust-line {
    display: flex;
    flex-wrap: wrap;
    margin-left: -1.5em;
    clip-path: inset(-8px -8px -8px 1.5em);
  }
  .trust-line li::before {
    content: "·";
    display: inline-block;
    width: 1.5em;
    text-align: center;
  }
}

.demo figcaption {
  margin-top: var(--space-3);
  font-size: 15px;
  line-height: 22px;
  color: var(--ink-muted);
}

.home-section {
  margin-top: var(--space-16);
}

.home-section > * + * {
  margin-top: var(--space-6);
}

.method {
  display: grid;
  counter-reset: step;
}

.method > li {
  counter-increment: step;
  padding-block: var(--space-6);
  border-top: 2px solid var(--accent-ink);
}

.method > li > * + * {
  margin-top: var(--space-2);
}

.method > li::before {
  content: counter(step);
  display: block;
  margin-bottom: var(--space-2);
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 36px;
  color: var(--accent-ink);
}

.safety {
  display: grid;
  gap: var(--space-6);
}

.rules li {
  padding-block: var(--space-4);
  border-top: 1px solid var(--line);
}

.rules li:last-child {
  border-bottom: 1px solid var(--line);
}

.rules strong {
  font-weight: 600;
}

.ask-band {
  display: grid;
  gap: var(--space-6);
  padding: var(--space-8) var(--space-6);
  border-radius: var(--radius);
  background: var(--lavender);
}

.ask-band > div > * + * {
  margin-top: var(--space-3);
}

.faq details {
  border-top: 1px solid var(--line);
}

.faq details:last-child {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-4);
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 19px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: none;
  font-weight: 400;
  font-size: 26px;
  line-height: 28px;
  color: var(--accent-ink);
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq .answer {
  padding-bottom: var(--space-6);
  max-width: var(--measure);
}

@media (min-width: 900px) {
  .home-grid {
    grid-template-columns: 6fr 5fr;
    gap: var(--space-16);
    align-items: start;
  }
  .home-section {
    margin-top: 96px;
  }
  .method {
    grid-template-columns: repeat(4, 1fr);
    column-gap: var(--space-8);
  }
  .safety {
    grid-template-columns: 5fr 7fr;
    gap: var(--space-16);
    align-items: start;
  }
  .safety > * + * {
    margin-top: 0;
  }
  .ask-band {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: var(--space-12);
  }
  .ask-band > * + * {
    margin-top: 0;
  }
}

/* Give */

.give-grid {
  display: grid;
  gap: var(--space-12);
}

.deck-col {
  width: 100%;
  max-width: 520px;
}

.deck-col > * + * {
  margin-top: var(--space-6);
}

.deck-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2) var(--space-4);
}

.filters {
  display: grid;
  gap: var(--space-3);
}

/* On phones the chips scroll sideways, edge to edge. */
.chips {
  display: flex;
  gap: var(--space-2);
  margin-inline: calc(-1 * var(--gutter));
  padding: 2px var(--gutter) var(--space-1);
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--ink-muted);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 24px;
  white-space: nowrap;
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  border-color: var(--mocha);
  background: var(--mocha);
  color: var(--platinum);
  font-weight: 600;
}

.state-filter {
  justify-self: start;
}

/* Cards stack in one grid cell, so the deck is as tall as its tallest card. */
.deck {
  display: grid;
  padding-bottom: var(--space-3);
}

.deck > * {
  grid-area: 1 / 1;
}

.deck-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.deck-actions .button {
  min-height: 56px;
}

.side > * + * {
  margin-top: var(--space-8);
}

@media (min-width: 640px) {
  .chips {
    flex-wrap: wrap;
    margin-inline: 0;
    padding-inline: 0;
    overflow: visible;
  }
}

@media (min-width: 960px) {
  .give-grid {
    grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
    gap: var(--space-16);
    align-items: start;
  }
  .side {
    max-width: 26rem;
    padding-top: 70px;
  }
}

/* A bill card */

.bill-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--space-4);
  align-content: start;
  padding: var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

.bill-card.is-top {
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

.bill-card.is-dragging {
  cursor: grabbing;
}

.bill-card.is-under {
  z-index: 0;
  transform: translateY(12px) scale(0.96);
  transform-origin: bottom center;
}

.bill-card.is-moving {
  transition: transform 240ms ease-out;
}

.bill-amount {
  font-family: var(--font-serif);
  font-size: 52px;
  line-height: 56px;
  color: var(--accent-ink);
}

.bill-sub {
  margin-top: var(--space-1);
  font-size: 16px;
  line-height: 24px;
  color: var(--ink-muted);
}

.bill-due.is-soon {
  color: var(--mocha);
  font-weight: 600;
}

.bill-progress > * + * {
  margin-top: var(--space-2);
}

/* Paid in mocha, then the part a giver is holding in lavender, on a sunken track. */
.meter {
  display: flex;
  height: 8px;
  border-radius: var(--radius);
  background: var(--surface-sunken);
  overflow: hidden;
}

.meter-paid {
  background: var(--mocha);
}

/* Paid by a giver but not yet confirmed by the household: a lighter mocha. */
.meter-way {
  background: #b39a87;
}

.meter-held {
  background: #b9a9d0;
}

.report-link {
  justify-self: start;
  min-height: 0;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 22px;
}

progress.meter {
  display: block;
  width: 100%;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
}

progress.meter::-webkit-progress-bar {
  background: var(--surface-sunken);
}

progress.meter::-webkit-progress-value {
  background: var(--mocha);
}

progress.meter::-moz-progress-bar {
  background: var(--mocha);
}

.household {
  padding: var(--space-4);
  border-radius: var(--radius);
  background: var(--lavender);
}

.household > * + * {
  margin-top: var(--space-1);
}

.facts div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: var(--space-3);
  padding-block: var(--space-2);
  border-top: 1px solid var(--line);
  font-size: 16px;
  line-height: 24px;
}

.facts dt {
  color: var(--ink-muted);
}

/* "Pay" and "Next" labels that show while a card is dragged. */
.stamp {
  position: absolute;
  top: var(--space-6);
  padding: var(--space-1) var(--space-3);
  border: 2px solid var(--mocha);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--mocha);
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
}

.stamp-pay {
  right: var(--space-6);
}

.stamp-next {
  left: var(--space-6);
  border-color: var(--ink-muted);
  color: var(--ink-muted);
}

/* Skeletons while something loads */

.skeleton-card {
  display: grid;
  gap: var(--space-6);
  padding: var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

.skeleton-block {
  display: block;
  border-radius: var(--radius);
  background: var(--surface-sunken);
  animation: skeleton-pulse 1.6s ease-in-out infinite;
}

.sk-line {
  height: 16px;
  width: 45%;
}

.sk-amount {
  height: 52px;
  width: 55%;
}

.sk-bar {
  height: 8px;
}

.sk-household {
  height: 104px;
}

.sk-facts {
  display: grid;
  gap: var(--space-3);
}

.sk-facts .skeleton-block {
  height: 20px;
}

@keyframes skeleton-pulse {
  50% {
    opacity: 0.55;
  }
}

.deck-empty {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-8) var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

/* The pay sheet: a bottom sheet on phones, a centred panel on wider screens. */

.sheet {
  width: min(100% - 32px, 480px);
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--ink);
}

.sheet::backdrop {
  background: rgb(62 43 31 / 0.6);
}

.sheet-inner {
  display: grid;
  gap: var(--space-6);
  padding: var(--space-6);
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: var(--space-4);
}

.sheet-head .heading {
  margin-top: var(--space-1);
}

.sheet-close {
  flex: none;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--ink-muted);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}

.sheet-step {
  display: grid;
  gap: var(--space-6);
}

.sheet-step .text-button {
  justify-self: start;
}

.amounts legend {
  margin-bottom: var(--space-3);
  font-weight: 600;
}

.amount-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.amount-options input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.amount-options label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--ink-muted);
  border-radius: var(--radius);
  font-size: 18px;
  cursor: pointer;
}

.amount-options input:checked + label {
  border-color: var(--mocha);
  background: var(--mocha);
  color: var(--platinum);
  font-weight: 600;
}

.amount-options input:focus-visible + label {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.other-amount {
  margin-top: var(--space-3);
}

.hold-note {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--mocha);
  border-radius: var(--radius);
  font-size: 16px;
  line-height: 24px;
}

.bpay {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.bpay div {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0 var(--space-3);
  padding: var(--space-3) var(--space-4);
}

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

.bpay dt {
  grid-column: 1;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.bpay dd {
  grid-column: 1;
  font-size: 22px;
  line-height: 30px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.copy {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 84px;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--ink-muted);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}

.mini-steps {
  counter-reset: mini;
}

.mini-steps li {
  counter-increment: mini;
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  padding-block: var(--space-1);
}

.mini-steps li::before {
  content: counter(mini) ".";
  color: var(--ink-muted);
}

.sheet-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: calc(-1 * var(--space-3));
}

@media (max-width: 759px) {
  .sheet {
    width: 100%;
    margin: auto 0 0;
    border-width: 1px 0 0;
    border-radius: var(--radius) var(--radius) 0 0;
  }
  .sheet-inner {
    padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: no-preference) {
  .sheet[open] {
    animation: sheet-in 200ms ease-out;
  }
}

@keyframes sheet-in {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}

/* Forms */

.field {
  display: grid;
  gap: var(--space-2);
}

.field > label,
.label {
  font-weight: 600;
}

.hint {
  font-size: 16px;
  line-height: 24px;
  color: var(--ink-muted);
}

.text-input,
.select,
.textarea {
  width: 100%;
  min-height: 52px;
  padding: var(--space-3) 14px;
  border: 1px solid var(--ink-muted);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--ink);
  font: inherit;
}

.textarea {
  min-height: 112px;
  resize: vertical;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%236F4E37' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}

.select-small {
  width: auto;
  min-height: 44px;
  padding-block: var(--space-2);
  font-size: 16px;
}

.money-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--ink-muted);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

.money-input span {
  padding-left: 14px;
  color: var(--ink-muted);
}

.money-input input {
  flex: 1;
  min-width: 0;
  min-height: 50px;
  padding: var(--space-2) 14px var(--space-2) var(--space-1);
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.money-input:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.money-input input:focus-visible {
  outline: none;
}

[aria-invalid="true"],
.money-input:has([aria-invalid="true"]) {
  border-color: var(--error);
  box-shadow: inset 0 0 0 1px var(--error);
}

.money-input [aria-invalid="true"] {
  box-shadow: none;
}

.field-row {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 600px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
}

.choices {
  display: grid;
  gap: var(--space-2);
}

.choice {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  cursor: pointer;
}

.choice:has(input:checked) {
  border-color: var(--mocha);
}

.choice input {
  width: 22px;
  height: 22px;
  margin: 3px 0 0;
  accent-color: var(--mocha);
}

.form-error,
.field-error {
  color: var(--error);
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
}

.form-error ul {
  margin-top: var(--space-1);
  padding-left: 1.2em;
  list-style: disc;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
}

.form-actions [data-apply-next] {
  margin-left: auto;
}

.summary div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: var(--space-3);
  padding-block: var(--space-2);
  border-top: 1px solid var(--line);
  font-size: 16px;
  line-height: 24px;
}

.summary div:last-child {
  border-bottom: 1px solid var(--line);
}

.summary dt {
  color: var(--ink-muted);
}

.summary dd {
  overflow-wrap: anywhere;
}

/* Ask for help */

.back-link {
  display: inline-block;
  margin-bottom: var(--space-6);
  font-size: 16px;
}

.apply-head > * + * {
  margin-top: var(--space-2);
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-1);
  margin-top: var(--space-4) !important;
}

.stepper span {
  height: 4px;
  border-radius: var(--radius);
  background: var(--surface-sunken);
}

.stepper span.is-done {
  background: var(--mocha);
}

.apply-form {
  display: grid;
  gap: var(--space-8);
  margin-top: var(--space-8);
}

.apply-form > fieldset {
  display: grid;
  gap: var(--space-6);
}

.id-check,
.dropzone {
  display: grid;
  gap: var(--space-3);
  justify-items: start;
  padding: var(--space-6);
  border: 1px dashed var(--ink-muted);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

/* Checking ID */

.id-panel {
  display: grid;
  gap: var(--space-4);
  width: 100%;
}

.id-panel .text-button {
  justify-self: start;
}

.id-step-title {
  font-weight: 600;
}

.id-step-title:focus {
  outline: none;
}

.routes {
  display: grid;
  gap: var(--space-3);
}

.routes-small {
  grid-template-columns: 1fr 1fr;
}

.route {
  display: grid;
  gap: var(--space-1);
  min-height: 56px;
  padding: var(--space-4);
  border: 1px solid var(--ink-muted);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.route:hover {
  border-color: var(--mocha);
}

.route:disabled {
  border-style: dashed;
  border-color: var(--line);
  color: var(--ink-muted);
  cursor: default;
}

.soon {
  display: block;
  margin-top: var(--space-1);
  font-size: 13px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.route-title {
  font-weight: 600;
}

.route-text {
  font-size: 16px;
  line-height: 24px;
  color: var(--ink-muted);
}

.text-button.inline {
  min-height: 0;
  font-size: inherit;
}

.keep summary {
  cursor: pointer;
  color: var(--accent-ink);
  font-size: 16px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.keep p {
  margin-top: var(--space-2);
  font-size: 16px;
  line-height: 24px;
  color: var(--ink-muted);
}

/* Where the camera view sits in the finished app: an ID card shape, then an oval for a face. */
.capture-frame {
  display: grid;
  place-items: center;
  aspect-ratio: 1.586;
  max-width: 360px;
  padding: var(--space-4);
  border: 2px dashed var(--ink-muted);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 16px;
  text-align: center;
}

.capture-frame.is-busy {
  place-items: stretch;
  align-content: center;
}

.capture-oval {
  width: 180px;
  aspect-ratio: 3 / 4;
  border: 2px dashed var(--ink-muted);
  border-radius: 50%;
  background: var(--surface);
}

.waiting {
  display: grid;
  gap: var(--space-2);
}

.waiting .sk-line:last-child {
  width: 70%;
}

.id-panel.is-done .summary {
  background: var(--surface-raised);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-input:focus-visible + label {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.bill-fields {
  display: grid;
  gap: var(--space-6);
}

.reading {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.reading .sk-line:last-child {
  width: 70%;
}

.check-list {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  font-size: 16px;
  line-height: 24px;
}

.review-grid {
  display: grid;
  gap: var(--space-8);
}

.review-grid > div > * + * {
  margin-top: var(--space-3);
}

@media (min-width: 900px) {
  .review-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Get help */

.help-grid,
.status-grid {
  display: grid;
  gap: var(--space-12);
}

.help-copy > * + *,
.status-main > * + * {
  margin-top: var(--space-6);
}

.help-existing > * + * {
  margin-top: var(--space-3);
}

.help-facts > * + * {
  margin-top: var(--space-8);
}

.status-side > * + * {
  margin-top: var(--space-3);
}

@media (min-width: 960px) {
  .help-grid {
    grid-template-columns: 6fr 5fr;
    gap: var(--space-16);
    align-items: start;
  }
  .help-facts {
    padding-top: var(--space-8);
  }
  .status-grid {
    grid-template-columns: 7fr 5fr;
    gap: var(--space-16);
    align-items: start;
  }
}

/* Request timeline: a filled dot for done, a ringed dot for now. */
.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  column-gap: var(--space-4);
  padding-bottom: var(--space-6);
}

.timeline li > * {
  grid-column: 2;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
}

.timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 26px;
  bottom: 2px;
  width: 2px;
  background: var(--line);
}

.timeline li.is-done::before {
  border-color: var(--mocha);
  background: var(--mocha);
}

.timeline li.is-done::after {
  background: var(--mocha);
}

.timeline li.is-current::before {
  border-color: var(--mocha);
  background: var(--lavender);
}

.timeline li:last-child {
  padding-bottom: 0;
}

.thanks-box > * + *,
.status-payments > * + * {
  margin-top: var(--space-3);
}

.sent-notes:not(:empty) {
  margin-top: var(--space-4);
}

.demo-controls {
  padding: var(--space-4) var(--space-6);
  border: 1px dashed var(--ink-muted);
  border-radius: var(--radius);
}

.demo-controls > * + * {
  margin-top: var(--space-2);
}

/* Buttons that stand in for the household or our team in the demo. */
.demo-actions {
  margin-top: var(--space-3) !important;
  padding: var(--space-3) var(--space-4);
  border: 1px dashed var(--ink-muted);
  border-radius: var(--radius);
}

.demo-actions > * + * {
  margin-top: var(--space-2);
}

.warning {
  padding: var(--space-4) var(--space-6);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

.warning > * + * {
  margin-top: var(--space-2);
}

.check-bad {
  color: var(--error);
}

.withdraw-confirm {
  margin-top: var(--space-4) !important;
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}

.withdraw-confirm > * + * {
  margin-top: var(--space-3);
}

/* Paid */

.paid > * + * {
  margin-top: var(--space-6);
}

/* Your giving */

.giving-grid {
  display: grid;
  gap: var(--space-12);
}

.giving-main > * + * {
  margin-top: var(--space-6);
}

.giving-empty > * + * {
  margin-top: var(--space-6);
}

.totals li {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: var(--space-4);
  align-items: baseline;
  padding-block: var(--space-4);
  border-top: 1px solid var(--line);
}

.totals li:last-child {
  border-bottom: 1px solid var(--line);
}

.total-figure {
  font-family: var(--font-serif);
  font-size: 40px;
  line-height: 44px;
  color: var(--accent-ink);
}

.holds > * + * {
  margin-top: var(--space-3);
}

.feed li {
  padding-block: var(--space-4);
  border-top: 1px solid var(--line);
}

.feed li:last-child {
  border-bottom: 1px solid var(--line);
}

.feed li > * + * {
  margin-top: var(--space-2);
}

.feed li .button-row {
  margin-top: var(--space-3);
}

.feed-title {
  font-weight: 600;
}

.thanks {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 21px;
  line-height: 30px;
}

.giving-side > * + * {
  margin-top: var(--space-6);
}

@media (min-width: 960px) {
  .giving-grid {
    grid-template-columns: 5fr 6fr;
    gap: var(--space-16);
    align-items: start;
  }
}

/* Toast: a short message after an action, above the tab bar on phones. */

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(var(--tab-bar) + var(--space-4) + env(safe-area-inset-bottom));
  width: max-content;
  max-width: calc(100% - 32px);
  transform: translateX(-50%);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--espresso);
  color: var(--platinum);
  font-size: 16px;
  line-height: 24px;
}

@media (min-width: 760px) {
  .toast {
    bottom: var(--space-6);
  }
}

/* Footer */

.app-footer {
  padding-block: var(--space-8);
  border-top: 1px solid var(--line);
  font-size: 16px;
  line-height: 24px;
  color: var(--ink-muted);
}

.app-footer .wrap > * + * {
  margin-top: var(--space-1);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
