/* SharpFiles design system — "paper and ink".
 * One stylesheet, no build step, no external requests: system fonts only.
 * Tokens and the component set come from docs/spec/40-design-brief.md.
 *
 * Naming: block__element and block--variant (BEM), with a few standalone
 * utilities (.muted, .small, .measure). Pages from P0–P3 keep their class hooks
 * (.data-table, .section--alt, .product-card-free names); aliases are grouped in
 * the same rule so one concept still has one implementation.
 */

:root {
  /* Colour */
  --paper: #fbfaf6;
  --surface: #ffffff;
  --surface-alt: #f4f1ea;
  --ink: #15181b;
  --body: #3d444b;
  --muted: #666e76;
  --line: #e1ddd3;
  --line-strong: #cfc9bc;
  --accent: #0e5c4a;
  --accent-ink: #0a4437;
  --accent-soft: #e6f0ec;
  --warn: #9a5b1e;
  --danger: #a23b32;

  /* Shape and elevation: exactly one shadow in the system */
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(21, 24, 27, 0.06), 0 8px 24px rgba(21, 24, 27, 0.05);

  /* Layout */
  --measure: 68ch;
  --container: 1080px;

  /* Type: 12.5 / 14 / 16 / 18 / 22 / 28 / 36 / 48 */
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-xs: 0.78125rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.375rem;
  --text-xl: 1.75rem;
  --text-2xl: 2.25rem;
  --text-3xl: 3rem;

  /* Spacing: 4, 8, 12, 16, 24, 32, 48, 64, 96 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;

  --transition: 140ms ease;
}

/* Reset ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

/* Base typography -------------------------------------------------------- */

body {
  background: var(--paper);
  color: var(--body);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

h1 { font-size: clamp(var(--text-xl), 4vw, var(--text-3xl)); }
h2 { font-size: clamp(var(--text-xl), 3vw, var(--text-2xl)); }
h3 { font-size: var(--text-md); }
p + p { margin-top: var(--space-4); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Typography utilities */
.display {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 4.4vw, var(--text-3xl));
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.serif { font-family: var(--font-display); }
.eyebrow {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lede { color: var(--body); font-size: var(--text-md); max-width: var(--measure); }
.muted { color: var(--muted); }
.small { font-size: var(--text-sm); }
.footnote { color: var(--muted); font-size: var(--text-sm); margin-top: var(--space-6); }
.measure { max-width: var(--measure); }
.error-code { color: var(--muted); font-family: var(--font-display); font-size: var(--text-xl); }

.skip-link {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  left: var(--space-4);
  padding: var(--space-2) var(--space-3);
  position: absolute;
  top: -100px;
  z-index: 10;
}
.skip-link:focus { top: var(--space-4); }

/* Layout ----------------------------------------------------------------- */

.container {
  margin-inline: auto;
  max-width: var(--container);
  padding-inline: var(--space-6);
  width: 100%;
}
.container--narrow { max-width: 720px; }

.section { padding-block: var(--space-24); }
/* .section-alt is the documented name; .section--alt is what P0–P3 pages use. */
.section--alt, .section-alt { background: var(--surface-alt); border-block: 1px solid var(--line); }
.section > .container > h2 { margin-bottom: var(--space-6); }

.stack { display: flex; flex-direction: column; gap: var(--space-6); }
.stack--tight { gap: var(--space-3); }

.grid-2, .grid-3, .grid-4 { display: grid; gap: var(--space-6); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.split { align-items: center; display: grid; gap: var(--space-12); grid-template-columns: 55fr 45fr; }

.rule, hr { border: 0; border-top: 1px solid var(--line); }

.prose { max-width: var(--measure); }
.prose h1 { margin-bottom: var(--space-6); }
.prose h2 { font-size: var(--text-xl); margin-block: var(--space-8) var(--space-3); }
.prose p, .prose ul { color: var(--body); }

.bullets { list-style: disc; margin-bottom: var(--space-6); padding-left: var(--space-6); }
.bullets li + li { margin-top: var(--space-2); }

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

/* Header ----------------------------------------------------------------- */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}

.site-header__inner {
  align-items: center;
  display: flex;
  gap: var(--space-8);
  min-height: 68px;
}

.wordmark {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.wordmark:hover { text-decoration: none; }

.site-nav { display: flex; gap: var(--space-6); }
.site-nav a, .link-muted { color: var(--body); font-size: var(--text-sm); }
.site-nav a:hover, .link-muted:hover { color: var(--ink); text-decoration: none; }
.site-header__actions { align-items: center; display: flex; gap: var(--space-4); margin-left: auto; }

.app-nav { display: flex; gap: var(--space-6); }
.app-nav a { color: var(--body); font-size: var(--text-sm); }
.app-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.credits-chip {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent-ink);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 4px var(--space-3);
  white-space: nowrap;
}
.credits-chip:hover { background: var(--surface); color: var(--accent-ink); text-decoration: none; }
.inline-form { margin: 0; }

/* Account menu: the signed-in counterpart of .nav-menu. A native <details>
   disclosure, so it opens with Enter or Space and needs no script. */
.account-menu { position: relative; }
.account-menu__toggle {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font-size: var(--text-sm);
  font-weight: 550;
  list-style: none;
  min-height: 36px;
  padding: 0 var(--space-3);
}
.account-menu__toggle::-webkit-details-marker { display: none; }
.account-menu[open] .account-menu__toggle { border-color: var(--accent); color: var(--accent); }
.account-menu__panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 220px;
  padding: var(--space-3);
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2));
  z-index: 6;
}
.account-menu__email { overflow-wrap: anywhere; padding-inline: var(--space-3); }
.account-menu__panel a {
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-3);
}
.account-menu__panel a:hover { background: var(--surface-alt); text-decoration: none; }
.account-menu__panel .btn { width: 100%; }

/* Mobile disclosure: hidden on desktop, opened with <details> on small screens. */
.nav-menu { display: none; position: relative; }
.nav-menu__toggle {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 550;
  min-height: 44px;
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
}
.nav-menu[open] .nav-menu__toggle { border-color: var(--accent); color: var(--accent); }
.nav-menu__links {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-width: 200px;
  padding: var(--space-2);
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2));
  z-index: 6;
}
.nav-menu__links a {
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-3);
}
.nav-menu__links a:hover { background: var(--surface-alt); text-decoration: none; }

/* Footer ----------------------------------------------------------------- */

.site-footer { border-top: 1px solid var(--line); padding-block: var(--space-12) var(--space-6); }
.footer {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
}
.footer__brand { max-width: 34ch; }
.footer__about { margin-block: var(--space-2); }
.footer__heading {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-3);
  text-transform: uppercase;
}
.footer__col { display: flex; flex-direction: column; gap: var(--space-2); }
.footer__col a { color: var(--body); font-size: var(--text-sm); width: fit-content; }
.footer__col a:hover { color: var(--ink); }
.footer__legal { margin-top: var(--space-8); }

/* Buttons ---------------------------------------------------------------- */

.btn {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 550;
  gap: var(--space-2);
  height: 44px;
  justify-content: center;
  padding-inline: 20px;
  text-align: center;
  text-decoration: none;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--accent); color: var(--surface); }
.btn--primary:hover { background: var(--accent-ink); }
.btn--secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn--secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn--ghost { background: transparent; color: var(--ink); padding-inline: var(--space-2); }
.btn--ghost:hover { color: var(--accent); text-decoration: underline; }
.btn--danger { background: transparent; color: var(--danger); padding-inline: 0; }
.btn--danger:hover { color: var(--danger); text-decoration: underline; }
.btn--small { font-size: var(--text-sm); height: 36px; padding-inline: var(--space-4); }
.btn:disabled, .btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}
.btn--primary:disabled, .btn--primary[aria-disabled="true"] { background: var(--accent); }
.btn:disabled:hover, .btn[aria-disabled="true"]:hover { text-decoration: none; }

/* Forms ------------------------------------------------------------------ */

.field { display: flex; flex-direction: column; }
label { color: var(--ink); display: block; font-size: var(--text-sm); font-weight: 550; margin-bottom: var(--space-2); }

input, select, textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  padding: var(--space-3);
  transition: border-color var(--transition);
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 2px; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-alt); color: var(--muted); cursor: not-allowed; }
input[readonly] { background: var(--surface-alt); color: var(--body); cursor: default; }
input[readonly]:focus { border-color: var(--line-strong); outline-color: var(--line-strong); }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }
.help { color: var(--muted); font-size: var(--text-sm); margin-top: var(--space-1); }
.field-error { color: var(--danger); font-size: var(--text-sm); margin-top: var(--space-1); }

/* Flash ------------------------------------------------------------------ */

/* A floor on the region keeps a one-line message from pushing the page down. */
.flash-region {
  margin-inline: auto;
  max-width: var(--container);
  min-height: var(--space-6);
  padding-inline: var(--space-6);
}

.flash {
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
}
.flash + .flash { margin-top: var(--space-2); }
.flash--success { background: var(--accent-soft); border-left-color: var(--accent); }
.flash--error { border-left-color: var(--danger); color: var(--danger); }
.flash--info { background: var(--surface-alt); }

/* Cards, lists, tags ----------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-6);
}
.card h2 { font-size: var(--text-lg); margin-bottom: var(--space-4); }
.card + .card { margin-top: var(--space-6); }
.card p + p, .card .bullets + p { margin-top: var(--space-4); }
/* .card-actions is a row of buttons at the end of a card. */
.card-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-4); }

.tag, .badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-block;
  font-size: var(--text-xs);
  padding: 2px var(--space-2);
  white-space: nowrap;
}
.tag--received, .badge--received, .is-success {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.tag--waiting, .badge--waiting, .is-waiting {
  background: var(--surface-alt);
  border-color: var(--line-strong);
  color: var(--warn);
}

.file-list { display: flex; flex-direction: column; }
.file-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  font-size: var(--text-sm);
  gap: var(--space-3);
  justify-content: space-between;
  padding-block: var(--space-3);
}
.file-row:first-child { border-top: 0; }
.file-row__name { color: var(--ink); }
.file-row__meta { display: block; font-size: var(--text-sm); }

/* Tables: .table is the current name, .data-table is the P0–P3 hook. */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.table, .data-table { background: var(--surface); border-collapse: collapse; font-size: var(--text-sm); width: 100%; }
.table caption, .data-table caption {
  caption-side: top;
  color: var(--muted);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  padding: var(--space-3) var(--space-4);
  text-align: left;
  text-transform: uppercase;
}
.table th, .table td, .data-table th, .data-table td { padding: var(--space-3) var(--space-4); text-align: left; vertical-align: top; }
.table th, .data-table th {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.table td, .data-table td { border-top: 1px solid var(--line); }
.table tbody tr:first-child td, .data-table tbody tr:first-child td { border-top: 0; }
.table .num, .data-table .num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.data-table__note { color: var(--muted); display: block; overflow-wrap: anywhere; }
.data-table__negative { color: var(--danger); }
.table code, .data-table code { color: var(--body); font-size: var(--text-xs); }

/* Hero and the product mock ---------------------------------------------- */

.hero { padding-block: var(--space-16) var(--space-24); }
.hero__inner { align-items: center; display: grid; gap: var(--space-12); grid-template-columns: 55fr 45fr; }
.hero__title { margin-block: var(--space-4); }
.hero__subhead { font-size: var(--text-md); max-width: 46ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-block: var(--space-6) var(--space-4); }
.hero__trust { max-width: 52ch; }
.hero__mock { display: flex; justify-content: flex-end; }

/* The hero card is plain HTML/CSS, not an image: it must stay legible and
   honest at every width. aria-hidden in the markup keeps it out of the a11y
   tree, because the copy beside it carries the meaning. */
.mock {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 380px;
  padding: var(--space-6);
  width: 100%;
}
.mock__eyebrow { color: var(--muted); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; }
.mock__title { color: var(--ink); font-family: var(--font-display); font-size: var(--text-lg); margin-block: var(--space-1) var(--space-4); }
.mock__list { display: flex; flex-direction: column; }
.mock__row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  font-size: var(--text-sm);
  gap: var(--space-3);
  grid-template-columns: 1.25rem minmax(0, 1fr) auto;
  padding-block: var(--space-3);
}
.mock__state { color: var(--line-strong); text-align: center; }
.mock__state--received { color: var(--accent); }
.mock__name { color: var(--ink); overflow-wrap: anywhere; }
.mock__tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: var(--text-xs);
  padding: 2px var(--space-2);
}
.mock__tag--received { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.mock__meta { border-top: 1px solid var(--line); margin-top: var(--space-4); padding-top: var(--space-3); }

/* Audience band ---------------------------------------------------------- */

.audience {
  border-block: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  padding-block: var(--space-4);
  text-align: center;
  text-transform: uppercase;
}

/* Steps, claims, FAQ ----------------------------------------------------- */

.steps { display: grid; gap: var(--space-8); grid-template-columns: repeat(3, 1fr); }
.step + .step { border-left: 1px solid var(--line); padding-left: var(--space-8); }
.step__number { color: var(--accent); font-family: var(--font-display); font-size: var(--text-xl); }
.step h3 { margin-block: var(--space-2); }

.claims { display: grid; gap: var(--space-8); grid-template-columns: repeat(2, 1fr); }
.claim h3 { font-size: var(--text-base); margin-bottom: var(--space-2); }

.faq details { border-top: 1px solid var(--line); padding-block: var(--space-4); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { color: var(--ink); cursor: pointer; font-weight: 550; }
.faq summary:hover { color: var(--accent); }
.faq details p { color: var(--body); margin-top: var(--space-3); max-width: var(--measure); }

/* Pricing ---------------------------------------------------------------- */

.pack-grid { display: grid; gap: var(--space-6); grid-template-columns: repeat(3, 1fr); margin-top: var(--space-8); }
.pack { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-6); position: relative; }
/* The recommended pack: an accent border plus the tab above. */
.pack--recommended { border-color: var(--accent); }
/* The flag is a tab across the card's top edge, not a line of the card: it is
   out of flow, so the highlighted pack keeps its name and price on the same
   baseline as its neighbours. The grid's top margin and gap leave room for the
   half that hangs outside. */
.pack__flag {
  background: var(--accent);
  border-radius: 999px;
  color: var(--surface);
  font-size: var(--text-xs);
  font-weight: 600;
  left: 50%;
  letter-spacing: 0.08em;
  padding: 2px var(--space-3);
  position: absolute;
  text-transform: uppercase;
  top: 0;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}
.pack__name { font-size: var(--text-lg); }
.pack__price { color: var(--ink); font-family: var(--font-display); font-size: var(--text-2xl); }
.pack__credits { color: var(--ink); font-weight: 550; }
.pack__each, .pack__list { color: var(--muted); font-size: var(--text-sm); }
.pack__list { flex: 1; margin-top: var(--space-2); }
.pack__list li { border-top: 1px solid var(--line); padding-block: var(--space-2); }
.pack__cta { margin-top: var(--space-4); width: 100%; }
.pack__form { display: flex; flex-direction: column; }
.pack__form .pack__cta { margin-top: var(--space-4); }

/* Final CTA -------------------------------------------------------------- */

.final-cta {
  background: var(--surface-alt);
  border-top: 1px solid var(--line);
  padding-block: var(--space-16);
  text-align: center;
}
.final-cta h2 { margin-inline: auto; max-width: 22ch; }
.final-cta__actions { margin-block: var(--space-6) var(--space-3); }

/* Auth pages ------------------------------------------------------------- */

.auth { display: flex; justify-content: center; padding: var(--space-16) var(--space-6); }
.auth__card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 420px;
  padding: var(--space-8);
  width: 100%;
}
.auth__wordmark { color: var(--ink); display: inline-block; margin-bottom: var(--space-6); }
.auth__title { font-size: clamp(var(--text-lg), 4vw, var(--text-xl)); margin-bottom: var(--space-2); }
.auth__intro { color: var(--muted); font-size: var(--text-sm); margin-bottom: var(--space-6); }
.auth__form { display: flex; flex-direction: column; gap: var(--space-4); }
.auth__form > div + div { margin-top: var(--space-1); }
.auth__submit { width: 100%; }
.auth__alt { border-top: 1px solid var(--line); color: var(--body); font-size: var(--text-sm); margin-top: var(--space-6); padding-top: var(--space-4); text-align: center; }
/* The code field is typed from a phone or read off one: wide tracking in the
   display serif makes six digits easy to check at a glance. */
.auth__code { font-family: var(--font-display); font-size: var(--text-xl); letter-spacing: 0.28em; }
.verify__sent { color: var(--ink); font-weight: 550; margin-bottom: var(--space-2); overflow-wrap: anywhere; }
.verify__resend { margin-top: var(--space-6); }

/* App shell -------------------------------------------------------------- */

/* Signed-in pages keep the paper rhythm but sit denser than the marketing
   sections: 96px of air above a dashboard is noise. */
.section--app { padding-block: var(--space-12) var(--space-16); }

.app-head {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  justify-content: space-between;
  margin-bottom: var(--space-8);
}
.app-head h1 { margin-block: var(--space-2) var(--space-1); }
.balance-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 168px;
  padding: var(--space-4) var(--space-6);
}
.balance-card__label { color: var(--muted); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.balance-card__value { color: var(--ink); font-family: var(--font-display); font-size: var(--text-2xl); line-height: 1.1; }
.app-empty { margin-bottom: var(--space-6); }
.app-empty p + p { margin-top: var(--space-4); }
.settings-form { display: flex; flex-direction: column; gap: var(--space-4); }
.settings-form button { align-self: flex-start; }
.settings-row { border-top: 1px solid var(--line); margin-top: var(--space-6); padding-top: var(--space-4); }
.settings-label { color: var(--muted); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.08em; margin-bottom: var(--space-3); text-transform: uppercase; }
.settings-facts { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 0 0 var(--space-4); }
.settings-facts dt { margin-bottom: var(--space-1); }
.settings-facts dd { color: var(--ink); margin: 0; overflow-wrap: anywhere; }

/* Requests: dashboard list, create form, detail -------------------------- */

.filter-tabs { border-bottom: 1px solid var(--line); display: flex; gap: var(--space-6); margin-bottom: var(--space-6); }
.filter-tab { border-bottom: 2px solid transparent; color: var(--muted); font-size: var(--text-sm); padding-block: var(--space-3); }
.filter-tab:hover { color: var(--ink); text-decoration: none; }
.filter-tab--active { border-bottom-color: var(--accent); color: var(--ink); font-weight: 600; }
.filter-tab__count { color: var(--muted); font-weight: 400; margin-left: var(--space-1); }

.request-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.request-row {
  align-items: center;
  background: var(--surface);
  border-top: 1px solid var(--line);
  color: var(--body);
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.1fr) minmax(0, 1.5fr) auto 1.25rem;
  padding: var(--space-4) var(--space-6);
}
.request-row:first-child { border-top: 0; }
.request-row:hover { background: var(--surface-alt); text-decoration: none; }
.request-row__who { display: flex; flex-direction: column; min-width: 0; }
.request-row__name { color: var(--ink); font-weight: 550; overflow-wrap: anywhere; }
.request-row__email { font-size: var(--text-sm); overflow-wrap: anywhere; }
.request-row__date, .request-row__progress { font-size: var(--text-sm); }
.request-row__progress { display: flex; flex-direction: column; gap: 2px; }
.request-row__bar { accent-color: var(--accent); height: 6px; width: 100%; }
.request-row__chevron { color: var(--line-strong); justify-self: end; }

/* Create form ------------------------------------------------------------ */

/* The create form is a 620px column centred in the container, so the heading, the
   form and the summary above it share one vertical line. */
.new-request { margin-inline: auto; max-width: 620px; }
.new-request__section { border: 0; margin: 0; padding: 0; }
.new-request__section + .new-request__section:not(fieldset) {
  border-top: 1px solid var(--line);
  margin-top: var(--space-2);
  padding-top: var(--space-6);
}
.new-request h2 { font-size: var(--text-md); margin-bottom: var(--space-2); }
.new-request .field + .field { margin-top: var(--space-4); }
.add-slot { margin-top: var(--space-4); }
.slot-row { display: grid; gap: var(--space-3); grid-template-columns: 1.75rem minmax(0, 1fr); }
.slot-row + .slot-row { margin-top: var(--space-4); }
.slot-row__number { align-self: center; color: var(--muted); font-family: var(--font-display); text-align: center; }
.slot-row__field { min-width: 0; }
.cost-summary {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  margin-top: var(--space-6);
  padding: var(--space-4) var(--space-6);
}
.cost-summary__line { color: var(--ink); font-weight: 550; }
.cost-summary .btn { margin-top: var(--space-4); width: 100%; }

/* Request detail --------------------------------------------------------- */

.detail-meta { align-items: baseline; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.message-body { overflow-wrap: anywhere; white-space: pre-line; }
.file-row__state { align-items: center; display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; }
.download-all { border-top: 1px solid var(--line); margin-top: var(--space-4); padding-top: var(--space-4); }
.download-all h3 { font-size: var(--text-base); margin-bottom: var(--space-2); }
.download-all ul { display: flex; flex-direction: column; gap: var(--space-2); }

.slot-fieldset {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--space-2) 0 0;
  padding: var(--space-6) 0 0;
}
.slot-fieldset legend { color: var(--ink); font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; margin-bottom: var(--space-2); }
.slot-fieldset .slot-row { margin-top: var(--space-4); }
.credit-line { color: var(--ink); font-weight: 550; }
.copy-field { align-items: end; display: flex; flex-wrap: wrap; gap: var(--space-3); }
.copy-field label { flex-basis: 100%; margin-bottom: 0; }
.copy-field input { flex: 1 1 260px; font-size: var(--text-sm); }
.detail-actions { display: flex; flex-wrap: wrap; gap: var(--space-4); }

/* Recipient upload page -------------------------------------------------- */

.recipient { max-width: 640px; }
.recipient h1 { font-size: clamp(var(--text-xl), 4vw, var(--text-2xl)); margin-block: var(--space-2) var(--space-6); }
.recipient .card + .card, .recipient .card + p, .recipient p + .card { margin-top: var(--space-6); }
.recipient-message { border-left: 3px solid var(--accent); }
.recipient-success { background: var(--accent-soft); border-color: var(--accent); }
.recipient-success h2 { font-size: var(--text-lg); margin-bottom: var(--space-2); }
.recipient-row { align-items: stretch; flex-direction: column; gap: var(--space-2); padding-block: var(--space-4); }
.recipient-row__head { align-items: baseline; display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between; }
.recipient-row__name { color: var(--ink); font-weight: 550; overflow-wrap: anywhere; }
.recipient-row__number { color: var(--muted); font-family: var(--font-display); margin-right: var(--space-2); }
.recipient-row__file { overflow-wrap: anywhere; }

.upload-control { display: flex; flex-direction: column; gap: var(--space-2); }
/* The file inputs are styled as buttons through their <label>, so they stay
   44px tap targets and keep the native picker. The input itself is clipped but
   still focusable; focus is drawn on the label beside it. */
.upload-actions { align-items: center; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.upload-input {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}
.upload-label { cursor: pointer; min-height: 44px; }
.upload-input:focus-visible + .upload-label { outline: 2px solid var(--accent); outline-offset: 2px; }
.upload-input:disabled + .upload-label { cursor: not-allowed; opacity: 0.55; }
.upload-hint { color: var(--muted); font-size: var(--text-sm); }
.upload-progress { align-items: center; display: flex; gap: var(--space-3); min-height: 20px; }
.upload-progress progress { accent-color: var(--accent); height: 8px; width: 100%; }
.upload-percent { color: var(--muted); font-size: var(--text-sm); min-width: 4ch; text-align: right; }

/* Credits and admin ------------------------------------------------------ */

.purchase-panel { border-color: var(--accent); }
.purchase-panel h2 { margin-bottom: var(--space-3); }
.purchase-panel form { margin-top: var(--space-4); }
.purchase-panel code { background: var(--surface-alt); border-radius: var(--radius-sm); padding: 1px var(--space-1); }

.credits-heading { font-size: var(--text-lg); margin-block: var(--space-12) var(--space-4); }
.balance-figure { color: var(--ink); font-family: var(--font-display); font-size: clamp(var(--text-2xl), 6vw, var(--text-3xl)); line-height: 1; }
.balance-meta { color: var(--muted); font-size: var(--text-sm); }
.danger-zone { border-left: 3px solid var(--danger); }
.error-page { padding-block: var(--space-8) var(--space-16); }
.error-page h1 { margin-block: var(--space-2) var(--space-4); }
.error-page__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }

.stat-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: var(--space-8); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4) var(--space-6); }
.stat__value { color: var(--ink); display: block; font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.2; }
.stat__label { color: var(--muted); font-size: var(--text-xs); letter-spacing: 0.06em; text-transform: uppercase; }

.admin-nav { display: flex; gap: var(--space-4); }
.admin-nav a { color: var(--body); font-size: var(--text-sm); }
.admin-heading { font-size: var(--text-lg); margin-block: var(--space-8) var(--space-4); }

/* Responsive ------------------------------------------------------------- */

@media (max-width: 1080px) {
  .container { padding-inline: var(--space-6); }
  .hero__inner { gap: var(--space-8); }
}

@media (max-width: 860px) {
  .section { padding-block: var(--space-16); }
  .hero { padding-block: var(--space-12) var(--space-16); }
  .hero__inner, .split { grid-template-columns: 1fr; }
  .hero__mock { justify-content: flex-start; }
  .steps, .claims, .pack-grid, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .step + .step { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: var(--space-6); }
  .footer { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
  .request-row { grid-template-columns: minmax(0, 1fr) auto; }
  .request-row__date { display: none; }
  .request-row__progress { grid-column: 1 / -1; }
  .request-row__chevron { display: none; }

  /* Marketing header: nav links and sign-in fold into the disclosure. */
  .site-nav, .header-signin { display: none; }
  .nav-menu { display: block; }
}

@media (max-width: 620px) {
  .container { padding-inline: var(--space-4); }
  .section { padding-block: var(--space-12); }
  .site-header__inner { gap: var(--space-4); }
  .site-header__actions { gap: var(--space-3); }
  .site-header .btn--primary { padding-inline: var(--space-4); }
  /* The signed-in nav keeps its links on tablets; on phones the wordmark
     ("/" redirects to /app) and the credits chip carry the same paths. */
  .app-nav { display: none; }
  .footer { gap: var(--space-6); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .auth { padding: var(--space-8) var(--space-4); }
  .auth__card { padding: var(--space-6); }
  .card, .pack, .mock { padding: var(--space-4); }
  .flash-region { padding-inline: var(--space-4); }
  .final-cta { padding-block: var(--space-12); }
  .hero__actions .btn { width: 100%; }
  .section--app { padding-block: var(--space-8) var(--space-12); }
  .app-head { margin-bottom: var(--space-6); }

  /* The dashboard list becomes stacked blocks below 620px. Each cell carries a
     data-label that CSS prints as its heading, so a row reads as a small card
     with no horizontal scrolling. */
  .request-row {
    align-items: start;
    gap: var(--space-2);
    grid-template-columns: 1fr;
    padding: var(--space-4);
  }
  .request-row__date { display: flex; }
  .request-row__progress { grid-column: auto; }
  .request-row__date,
  .request-row__progress,
  .request-row__status {
    align-items: baseline;
    display: flex;
    gap: var(--space-3);
    justify-content: space-between;
  }
  .request-row__bar { flex: 1 1 auto; }
  .request-row [data-label]::before {
    color: var(--muted);
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .file-row { align-items: flex-start; flex-direction: column; }
  .file-row__state { justify-content: flex-start; }
  .detail-actions .btn, .detail-actions form { width: 100%; }
  .detail-actions form .btn { width: 100%; }
  .copy-field input { flex-basis: 100%; }
  .account-menu__panel { min-width: 200px; }
}

/* Motion ----------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print ------------------------------------------------------------------ */

@media print {
  @page { margin: 18mm; }

  body { background: #fff; color: #000; font-size: 11pt; }
  .site-header, .site-footer, .skip-link, .nav-menu, .account-menu, .btn, .flash-region, .filter-tabs { display: none !important; }
  .cost-summary { box-shadow: none; position: static; }
  .request-row__chevron { display: none; }
  h1, h2, h3 { color: #000; }
  a { color: #000; text-decoration: underline; }
  .section, .hero, .final-cta { padding-block: 0; }
  .section--alt, .section-alt, .final-cta { background: #fff; border: 0; }
  .card, .pack, .request-list, .table-wrap { border: 1px solid #999; box-shadow: none; }
  .pack-grid, .steps, .claims, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .recipient, .container, .measure, .prose { max-width: none; }
  .step + .step { border-left: 0; padding-left: 0; }
}
