/* Duly. The pay packet: bond paper, security-tint liner blue, manila for the tax packet, stamp green for paid.
   Type: Archivo (variable width 62-125 and weight, self-hosted, OFL) for everything; JetBrains Mono only for hashes and code.
   Light and dark are both first-class: tokens below, prefers-color-scheme plus a remembered toggle (data-theme).
   Spacing 4/8/12/16/24/32/48/64/96/128. Motion: 140/240/400 ms; enter decelerates, exit accelerates; transform and
   opacity only; everything rests under reduced motion. */
@font-face { font-family: 'Archivo'; src: url(/fonts/archivo-var.woff2) format('woff2-variations'), url(/fonts/archivo-var.woff2) format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url(/fonts/jbmono-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url(/fonts/jbmono-500.woff2) format('woff2'); font-weight: 500 600; font-display: swap; }
/* Fallback sized like Archivo, so the swap does not move the page. */
@font-face { font-family: 'Archivo Fallback'; src: local('Arial'), local('Helvetica'), local('Liberation Sans'); size-adjust: 104%; ascent-override: 92%; descent-override: 24%; line-gap-override: 0%; }

:root {
  color-scheme: light;
  --bg: #f2f4f0; --surface: #ffffff; --surface-2: #e9ece6; --surface-3: #dfe3dc;
  --ink: #17213a; --ink-2: #384360; --muted: #434c60; --faint: #7b8496;
  --line: rgb(23 33 58 / 13%); --line-2: rgb(23 33 58 / 24%);
  --accent: #1e4c9a; --accent-dark: #163b7a; --accent-soft: #e3eaf6; --accent-line: #b3c5e6; --on-accent: #ffffff; --action: #1e4c9a; --action-hover: #163b7a; --on-action: #ffffff; --term: #0f1830;
  --green: #0b7650; --green-dark: #08603f; --green-soft: #e0f1e8; --green-line: #a6d6bf;
  --manila: #d9a93c; --manila-soft: #f6ecd0; --amber: #7a5200; --amber-mid: #d9a93c; --amber-soft: #f7eed6; --amber-line: #ead7a6;
  --red: #a8251c; --red-soft: #fbe9e7; --red-line: #f0c9c4;
  --blue: #1e4c9a; --blue-mid: #4c78c4; --blue-soft: #e3eaf6; --blue-line: #c8d6ee;
  --sage: #5f9b7f;
  --liner-ground: #d9e2f1; --liner-ink: rgb(30 76 154 / 22%);
  --band: #142246; --band-ink: #e9eef8; --band-muted: #b4c0d8; --band-line: rgb(233 238 248 / 16%); --band-surface: #1b2c57;
  --radius: 8px; --radius-sm: 6px; --radius-xs: 4px;
  --shadow: 0 1px 2px rgb(23 33 58 / 6%), 0 8px 24px -10px rgb(23 33 58 / 14%);
  --shadow-lg: 0 1px 2px rgb(23 33 58 / 6%), 0 32px 56px -24px rgb(23 33 58 / 30%);
  --sans: 'Archivo', 'Archivo Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --t1: 140ms; --t2: 240ms; --t3: 400ms;
  --enter: cubic-bezier(.2, .8, .2, 1); --exit: cubic-bezier(.4, 0, 1, 1); --move: cubic-bezier(.65, 0, .35, 1);
  --page: 1160px;
  /* Page rhythm (desktop / phone) */
  --nav: 72px; --padt: 120px; --padb: 72px; --gut: 80px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1322; --surface: #141d31; --surface-2: #1a2540; --surface-3: #22304f;
  --ink: #e8ecf4; --ink-2: #c5cddc; --muted: #a7b1c3; --faint: #76829a;
  --line: rgb(232 236 244 / 12%); --line-2: rgb(232 236 244 / 22%);
  --accent: #8aacf3; --accent-dark: #a9c2f7; --accent-soft: rgb(138 172 243 / 14%); --accent-line: rgb(138 172 243 / 38%); --on-accent: #0c1322;
  --green: #46c58f; --green-dark: #6fd6aa; --green-soft: rgb(70 197 143 / 14%); --green-line: rgb(70 197 143 / 38%);
  --manila: #e6bc57; --manila-soft: rgb(230 188 87 / 14%); --amber: #ecc66a; --amber-mid: #e6bc57; --amber-soft: rgb(230 188 87 / 13%); --amber-line: rgb(230 188 87 / 34%);
  --red: #f39a90; --red-soft: rgb(243 154 144 / 13%); --red-line: rgb(243 154 144 / 34%);
  --blue: #8aacf3; --blue-mid: #8aacf3; --blue-soft: rgb(138 172 243 / 14%); --blue-line: rgb(138 172 243 / 30%);
  --sage: #7fc0a2;
  --liner-ground: #101b33; --liner-ink: rgb(138 172 243 / 10%);
  --band: #1a2a52; --action: #3566d6; --action-hover: #4775e0; --on-action: #ffffff; --term: #172241;
  --band-x: 0; --band-ink: #e9eef8; --band-muted: #b4c0d8; --band-line: rgb(233 238 248 / 14%); --band-surface: #1f3160;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px -10px rgb(0 0 0 / 50%);
  --shadow-lg: 0 1px 2px rgb(0 0 0 / 30%), 0 32px 64px -24px rgb(0 0 0 / 70%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c1322; --surface: #141d31; --surface-2: #1a2540; --surface-3: #22304f;
    --ink: #e8ecf4; --ink-2: #c5cddc; --muted: #a7b1c3; --faint: #76829a;
    --line: rgb(232 236 244 / 12%); --line-2: rgb(232 236 244 / 22%);
    --accent: #8aacf3; --accent-dark: #a9c2f7; --accent-soft: rgb(138 172 243 / 14%); --accent-line: rgb(138 172 243 / 38%); --on-accent: #0c1322;
    --green: #46c58f; --green-dark: #6fd6aa; --green-soft: rgb(70 197 143 / 14%); --green-line: rgb(70 197 143 / 38%);
    --manila: #e6bc57; --manila-soft: rgb(230 188 87 / 14%); --amber: #ecc66a; --amber-mid: #e6bc57; --amber-soft: rgb(230 188 87 / 13%); --amber-line: rgb(230 188 87 / 34%);
    --red: #f39a90; --red-soft: rgb(243 154 144 / 13%); --red-line: rgb(243 154 144 / 34%);
    --blue: #8aacf3; --blue-mid: #8aacf3; --blue-soft: rgb(138 172 243 / 14%); --blue-line: rgb(138 172 243 / 30%);
    --sage: #7fc0a2;
    --liner-ground: #101b33; --liner-ink: rgb(138 172 243 / 10%);
    --band: #1a2a52; --action: #3566d6; --action-hover: #4775e0; --on-action: #ffffff; --term: #172241;
    --band-x: 0; --band-ink: #e9eef8; --band-muted: #b4c0d8; --band-line: rgb(233 238 248 / 14%); --band-surface: #1f3160;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px -10px rgb(0 0 0 / 50%);
    --shadow-lg: 0 1px 2px rgb(0 0 0 / 30%), 0 32px 64px -24px rgb(0 0 0 / 70%);
  }
}
@media (max-width: 639px) { :root { --nav: 56px; --padt: 96px; --padb: 48px; --gut: 24px; } }
@media (min-width: 640px) and (max-width: 1023px) { :root { --gut: 48px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 0; background: var(--bg); }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--sans); font-stretch: 100%; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; transition: background-color var(--t2) var(--enter); }
::selection { background: var(--accent); color: var(--on-accent); }
html { scrollbar-color: var(--line-2) transparent; }
.boot { padding: 48px 16px; text-align: center; color: var(--muted); }
#app:empty { min-height: 60vh; }
/* Out of flow: an in-flow margin here collapsed through #app into body and the whole page jumped (CLS 0.27) when the app rendered. */
#app:empty::before { content: ''; display: block; position: fixed; left: 0; right: 0; top: 30vh; width: 28px; height: 28px; margin: 0 auto; border: 3px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #app:empty::before { animation-duration: 2.4s; } }
.js .nojs-only { display: none; }
.nojs-hide { display: none; }
.js .nojs-hide { display: inline-flex; }

/* Cross-page continuity where the browser supports it; off under reduced motion. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; animation-timing-function: var(--enter); }
.nav .brand, .top .brand { view-transition-name: brand; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* ---------- type ---------- */
h1, h2, h3, h4 { font-family: var(--sans); font-weight: 600; color: var(--ink); margin: 0; text-wrap: balance; }
h1 { font-size: clamp(40px, 6.2vw, 56px); line-height: 1.04; letter-spacing: -.03em; font-stretch: 112%; }
h2 { font-size: 28px; line-height: 1.15; letter-spacing: -.02em; font-stretch: 108%; }
h3 { font-size: 17px; line-height: 1.35; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: text-decoration-color var(--t1) var(--enter), color var(--t1) var(--enter); }
a:hover { text-decoration-color: currentColor; color: var(--accent-dark); }
strong { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 13px; font-weight: 400; letter-spacing: 0; overflow-wrap: anywhere; }
code, pre, kbd { font-family: var(--mono); font-size: 13px; }
code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; overflow-wrap: anywhere; color: var(--ink-2); }
pre { white-space: pre-wrap; word-break: break-all; background: var(--surface-2); border: 1px solid var(--line); padding: 12px 14px; border-radius: var(--radius-sm); margin: 0; line-height: 1.6; color: var(--ink-2); }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--accent); display: inline-flex; align-items: center; gap: 8px; }
.ico { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- layout (app and invoice pages) ---------- */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.wrap { max-width: 920px; margin: 0 auto; padding: 8px 16px 112px; }
.narrow { max-width: 640px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.container { max-width: var(--page); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 32px; } }

/* ---------- header ---------- */
.testbar { background: var(--amber-soft); color: var(--amber); text-align: center; font-size: 13px; padding: 6px 16px; font-weight: 600; border-bottom: 1px solid var(--amber-line); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; max-width: 920px; margin: 0 auto; min-height: 68px; }
.top:has(+ main.narrow) { max-width: 640px; }
.brand { font: 650 20px/1 var(--sans); font-stretch: 118%; letter-spacing: -.02em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
/* The mark: a pay packet, flap closed. */
.brand::before { content: ''; width: 26px; height: 20px; flex: none; border-radius: 3px; background: linear-gradient(160deg, transparent 49%, var(--bg) 49.5% 54%, transparent 54.5%) top / 100% 62% no-repeat, linear-gradient(20deg, transparent 49%, var(--bg) 49.5% 54%, transparent 54.5%) top / 100% 62% no-repeat, var(--accent); }
.brand:hover { color: var(--ink); }

/* ---------- controls ---------- */
button, .btn { font: 500 15px/1.2 var(--sans); letter-spacing: -.005em; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); padding: 11px 18px; min-height: 44px; cursor: pointer; text-decoration: none; display: inline-flex; justify-content: center; align-items: center; gap: 8px; -webkit-tap-highlight-color: transparent; transition: background-color var(--t1) var(--enter), border-color var(--t1) var(--enter), color var(--t1) var(--enter), transform var(--t1) var(--enter); }
@media (hover: hover) {
  button:hover, .btn:hover { border-color: var(--ink-2); background: var(--surface-2); color: var(--ink); transform: translateY(-1px); }
}
/* Pressed state on pointerdown, within one frame; paint and transform only. */
button:active:not(:disabled), .btn:active { transform: translateY(1px) scale(.985); transition-duration: 90ms; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary { background: var(--action); border-color: var(--action); color: var(--on-action); }
@media (hover: hover) { .primary:hover { background: var(--action-hover); border-color: var(--action-hover); color: var(--on-action); } }
.btn.lg { min-height: 48px; padding: 13px 22px; font-size: 16px; }
.btn.ghost { border-color: transparent; background: none; color: var(--ink-2); }
@media (hover: hover) { .btn.ghost:hover { background: var(--surface-3); } }
.btn .ico { width: 16px; height: 16px; }
.danger { color: var(--red); }
.link { border: 0; background: none; padding: 0; min-height: 0; color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; font-weight: 500; }
.link:hover, .link:active:not(:disabled) { background: none; transform: none; }
.wide { width: 100%; }
.copy { display: none; align-items: center; justify-content: center; width: 28px; height: 28px; min-height: 28px; padding: 0; border-radius: 4px; border: 1px solid transparent; background: none; color: var(--faint); flex: none; }
.js .copy { display: inline-flex; }
@media (hover: hover) { .copy:hover { background: var(--surface-3); border-color: transparent; color: var(--ink); transform: none; } }
.copy.done { color: var(--green); }
.copy .ico { width: 14px; height: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.hint { font-size: 13px; color: var(--muted); }
input, select, textarea { font: 16px var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px; width: 100%; transition: border-color var(--t1) var(--enter), box-shadow var(--t1) var(--enter); }
input:hover, select:hover, textarea:hover { border-color: var(--ink-2); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
textarea { min-height: 72px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card h2 { font-size: 20px; letter-spacing: -.015em; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .value { font: 600 28px/1.2 var(--sans); font-stretch: 108%; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; line-height: 1.4; border: 1px solid transparent; }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.chip.good { background: var(--green-soft); color: var(--green-dark); border-color: var(--green-line); }
.chip.pending { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-line); }
.chip.bad { background: var(--red-soft); color: var(--red); border-color: var(--red-line); }
.chip.neutral { background: var(--surface-3); color: var(--muted); border-color: var(--line); }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabs a { flex: 1; max-width: 200px; text-align: center; padding: 14px 8px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; transition: color var(--t1) var(--enter); }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--accent); box-shadow: inset 0 2px 0 var(--accent); }
.tabs a:active, .item:active { background-color: var(--surface-2); }

.list { display: flex; flex-direction: column; }
.item { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
a.item { transition: background-color var(--t1) var(--enter); }
a.item:hover { background: var(--surface-2); }
.item:last-child { border-bottom: 0; }
.item .right { text-align: right; flex: none; }

/* ---------- invoice document ---------- */
.invoice { position: relative; overflow: hidden; padding: 28px; view-transition-name: invoice-sheet; }
/* The perforation where the sheet tore from the pad. */
.invoice::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: radial-gradient(circle at 5px 0, var(--bg) 3px, transparent 3.5px) 0 0 / 12px 6px repeat-x, linear-gradient(var(--accent), var(--accent)) 0 5px / 100% 1px no-repeat; }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.inv-head > div:first-child { min-width: 0; }
.inv-note { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
@media (max-width: 520px) { .inv-head { flex-wrap: nowrap; } .inv-head h2 { font-size: 20px; } }
.inv-head h2 { font-size: 26px; font-stretch: 112%; }
.parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px 24px; margin: 20px 0; }
.parties .muted.small, .kv dt { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
.lines { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; }
.lines th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); padding: 10px 12px 10px 0; }
.lines td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.lines tr:last-child td { border-bottom: 0; }
.lines .amt { text-align: right; white-space: nowrap; padding-left: 12px; padding-right: 0; }
.totals { margin-left: auto; max-width: 340px; padding-top: 12px; font-variant-numeric: tabular-nums; }
.totals div { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; color: var(--ink-2); }
.totals .grand { font: 600 22px/1.3 var(--sans); font-stretch: 108%; letter-spacing: -.015em; color: var(--ink); border-top: 1px solid var(--ink); margin-top: 8px; padding-top: 12px; }
.inv-no { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
/* The rubber stamp, inked in stamp green, set slightly off true like a real one. */
.stamp { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--green); color: var(--green); background: transparent; font: 750 15px/1 var(--sans); font-stretch: 125%; padding: 7px 12px 6px; border-radius: 4px; letter-spacing: .08em; transform: rotate(-4deg); }
.stamp::before { content: ''; width: 12px; height: 12px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }

.banner { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; line-height: 1.5; border: 1px solid transparent; }
.banner.good { background: var(--green-soft); color: var(--green-dark); border-color: var(--green-line); }
.banner.warn { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-line); }
.banner.bad { background: var(--red-soft); color: var(--red); border-color: var(--red-line); }
.banner.info { background: var(--blue-soft); color: var(--blue); border-color: var(--blue-line); }

.qr { display: block; margin: 0 auto; image-rendering: pixelated; border-radius: var(--radius-sm); max-width: 100%; height: auto; border: 1px solid var(--line); background: #fff; padding: 8px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.steps li::before { content: ''; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; }
.steps li.done { color: var(--ink); }
.steps li.done::before { background: var(--green); border-color: var(--green); }
.steps li.now { color: var(--ink); font-weight: 600; }
.steps li.now::before { border-color: var(--accent); }
.split { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-3); }
.split span { display: block; }
.line-row { display: grid; grid-template-columns: 1fr 72px 104px 40px; gap: 8px; align-items: center; }
.toast { position: fixed; left: 16px; right: 16px; bottom: 80px; max-width: 480px; margin: 0 auto; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 8px; font-size: 14px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .13s var(--exit), transform .13s var(--exit); z-index: 30; }
.toast.show { opacity: 1; transform: none; transition-duration: .2s; transition-timing-function: var(--enter); }
.toast.bad { background: var(--red); color: #fff; }
details > summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; align-items: center; gap: 8px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ''; width: 8px; height: 8px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform var(--t2) var(--move); flex: none; margin-right: 2px; }
details[open] > summary::before { transform: rotate(45deg); }
details[open] > summary { margin-bottom: 12px; }

/* Onboarding in the app */
.onboard { padding: 32px 28px; }
.onboard h2 { font-size: 28px; font-stretch: 112%; }
.onboard-steps { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: ob; }
.onboard-steps li { counter-increment: ob; display: flex; gap: 12px; align-items: baseline; font-size: 15px; color: var(--ink-2); }
.onboard-steps li::before { content: counter(ob); flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; transform: translateY(-1px); }

/* ---------- receipt rows (landing proof, invoice and app cards) ---------- */
.txs { list-style: none; margin: 0; padding: 0; }
.tx { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 5px 0; min-height: 38px; border-top: 1px solid var(--line); }
.tx .net { font-size: 13px; font-weight: 600; font-stretch: 112%; color: var(--muted); }
.tx .net.base { color: var(--accent); }
.tx .net.near { color: var(--green); }
.tx .h { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.tx .h a.mono { color: var(--ink); text-decoration: none; white-space: nowrap; }
.tx .h a.mono:hover { color: var(--accent); text-decoration: underline; }
.tx .what { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tx .acts { display: flex; align-items: center; gap: 2px; }
.tx .acts a.ext { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 4px; color: var(--faint); }
.tx .acts a.ext:hover { background: var(--surface-3); color: var(--ink); }
.tx .acts a.alt { font-size: 13px; color: var(--muted); padding: 0 6px; text-decoration: none; }
.tx .acts a.alt:hover { color: var(--ink); text-decoration: underline; }
.txs.flush { margin: 0 -24px -24px; padding: 0 24px; }
@media (max-width: 520px) { .txs.flush { margin: 0 -18px -18px; padding: 0 18px; } .tx .h { flex-direction: column; gap: 0; } .tx .what { white-space: normal; } }

/* ================= Landing ================= */
.landing { overflow-x: clip; }
.landing .wrap { width: min(100% - 2 * var(--gut), 1280px); max-width: none; margin: 0 auto; padding: 0; position: relative; z-index: 1; }
.landing h2 { font-size: clamp(30px, 1.8vw + 22px, 48px); line-height: 1.06; letter-spacing: -.028em; font-stretch: 116%; font-weight: 600; max-width: 18em; }
.landing h3 { font-size: 20px; line-height: 1.3; font-stretch: 108%; letter-spacing: -.012em; }
.landing .intro { margin-top: 20px; font-size: 18px; line-height: 1.6; color: var(--ink-2); max-width: 40em; }
.landing .section { min-height: 100svh; padding: var(--padt) 0 var(--padb); position: relative; }
.landing .section + .section { border-top: 0; }
.skip { position: absolute; left: 0; top: 8px; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; z-index: 30; }
.skip:focus { width: auto; height: auto; clip-path: none; background: var(--surface); padding: 8px 12px; border-radius: 4px; }

/* Nav: fixed, opaque, one hairline, the same at every scroll depth. */
.landing .nav { position: fixed; top: 0; left: 0; right: 0; z-index: 20; height: var(--nav); background: var(--bg); border-bottom: 1px solid var(--line); }
.landing .testbar + .nav { top: 0; }
.nav-in { display: flex; align-items: center; gap: 32px; height: 100%; }
.nav-links { display: none; gap: 28px; }
.nav-links a, .nav-src, .foot-links a { position: relative; color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500; white-space: nowrap; padding: 6px 0; transition: color var(--t1) var(--enter); }
.nav-links a::after, .nav-src::after, .foot-links a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform 200ms var(--enter); }
@media (hover: hover) {
  .nav-links a:hover, .nav-src:hover, .foot-links a:hover { color: var(--ink); }
  .nav-links a:hover::after, .nav-src:hover::after, .foot-links a:hover::after { transform: scaleX(1); transform-origin: left; transition-duration: 140ms; }
}
.nav-cta { margin-left: auto; display: flex; gap: 20px; align-items: center; }
.nav-src { display: none; }
.nav-cta .btn { display: none; }
.theme-toggle { display: none; width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; border-color: var(--line-2); background: transparent; color: var(--ink); position: relative; overflow: hidden; }
.js .theme-toggle { display: inline-flex; }
.theme-toggle .ico { position: absolute; width: 18px; height: 18px; transition: transform var(--t3) var(--enter), opacity var(--t2) var(--enter); }
.theme-toggle .ico:last-child { transform: translateY(24px) rotate(-60deg); opacity: 0; }
:root[data-theme="dark"] .theme-toggle .ico:first-child { transform: translateY(-24px) rotate(60deg); opacity: 0; }
:root[data-theme="dark"] .theme-toggle .ico:last-child { transform: none; opacity: 1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .ico:first-child { transform: translateY(-24px) rotate(60deg); opacity: 0; }
  :root:not([data-theme="light"]) .theme-toggle .ico:last-child { transform: none; opacity: 1; }
}
.nav-cta .btn { display: inline-flex; }
@media (max-width: 639px) { .nav-cta { gap: 10px; } .landing .nav .btn { min-height: 40px; padding: 8px 12px; font-size: 14px; } .theme-toggle { width: 40px; height: 40px; min-height: 40px; } .nav .brand { font-size: 18px; } }
@media (min-width: 1024px) { .nav-links, .nav-src { display: flex; } }
.landing .testbar { position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; border-bottom: 0; border-top: 1px solid var(--amber-line); }

/* ---------- Hero ---------- */
.hero { min-height: 100svh; padding: calc(var(--nav) + 48px) 0 64px; display: flex; }
.hero-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
.hero-text { grid-column: 1 / span 6; display: flex; flex-direction: column; min-width: 0; }
.notice a { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none; }
.notice a:hover { color: var(--ink); }
.notice.test { font-size: 14px; font-weight: 600; color: var(--amber); }
.nav-test { margin-left: -16px; }
@media (max-width: 639px) { .nav-test { display: none; } }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); position: relative; flex: none; }
.dot::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--green); opacity: 0; }
.motion .notice .dot::after { animation: ring 2.4s var(--enter) infinite; }
@keyframes ring { 0% { transform: scale(.5); opacity: .9; } 70%, 100% { transform: scale(1.4); opacity: 0; } }
.hero h1 { margin-top: 24px; font-size: clamp(38px, 2.4vw + 26px, 62px); line-height: 1.0; letter-spacing: -.035em; font-stretch: 120%; font-weight: 640; }
.lead { margin-top: 24px; font-size: 19px; line-height: 1.55; color: var(--ink-2); max-width: 30em; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.landing .btn { min-height: 48px; padding: 13px 22px; font-size: 16px; }
.landing .nav .btn { min-height: 44px; padding: 10px 18px; font-size: 15px; }
.fact { margin-top: 20px; font-size: 14px; color: var(--muted); }

/* The hero frame: the security-tint liner of a business envelope, the pay window laid on it. */
.hero-art { grid-column: 7 / span 6; margin: 0; position: relative; border-radius: var(--radius); padding: 44px 44px 64px; min-height: min(716px, calc(100svh - var(--nav) - 112px));
  background-color: var(--liner-ground);
  background-image: repeating-linear-gradient(45deg, var(--liner-ink) 0 1px, transparent 1px 7px), repeating-linear-gradient(-45deg, var(--liner-ink) 0 1px, transparent 1px 7px);
  display: flex; flex-direction: column; justify-content: flex-start; }
.pay-win { position: static; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--line); overflow: visible; }
.win-bar { display: flex; align-items: center; gap: 14px; height: 36px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.win-dots { display: inline-flex; gap: 6px; }
.win-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.win-url { font: 400 12.5px/1 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet { position: relative; padding: 22px 24px 20px; overflow: hidden; }
.sheet::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: radial-gradient(circle at 5px 0, var(--surface-2) 3px, transparent 3.5px) 0 0 / 12px 6px repeat-x; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet-title { font-size: 18px; font-weight: 600; font-stretch: 112%; letter-spacing: -.01em; line-height: 1.35; }
.sheet-head .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.pay-win[data-step="done"] .proof-chip, .pay-win[data-step="4"] .proof-chip { opacity: 0; }
.proof-chip { position: relative; transition: opacity var(--t2) var(--enter), background-color var(--t2) var(--enter), color var(--t2) var(--enter), border-color var(--t2) var(--enter); }
.sheet-amt { display: flex; align-items: baseline; gap: 8px; margin-top: 14px; }
.sheet-amt b { font-variant-numeric: normal; font-size: 46px; line-height: 1; font-weight: 640; font-stretch: 112%; letter-spacing: -.03em; }
.sheet-amt span { font-size: 15px; font-weight: 500; color: var(--muted); }
.sheet-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); }
.sheet-kv dt { font-size: 13px; color: var(--muted); }
.sheet-kv dd { margin: 2px 0 0; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.sheet-kv dd .ico { width: 14px; height: 14px; color: var(--muted); }
.pay-with { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.lbl { font-size: 13px; color: var(--muted); }
.chain-pick { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chain-pick li { font-size: 13px; font-weight: 500; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); transition: background-color var(--t2) var(--enter), color var(--t2) var(--enter), border-color var(--t2) var(--enter), transform 90ms var(--enter); }
.chain-pick li.on { background: var(--action); border-color: var(--action); color: var(--on-action); }
.quote { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.quote b { font-weight: 600; color: var(--ink); font-variant-numeric: normal; }
.route { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.route-line { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: auto minmax(16px, 1fr) auto minmax(16px, 1fr) auto; align-items: center; gap: 8px; }
.r-node { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.r-node.end { color: var(--green); font-family: var(--mono); font-weight: 500; font-size: 12.5px; }
.r-wire { position: relative; height: 2px; background: repeating-linear-gradient(90deg, var(--line-2) 0 4px, transparent 4px 8px); }
.r-wire i { position: absolute; left: 0; top: -3px; width: 100%; height: 8px; opacity: 0; }
.r-wire i::after { content: ''; position: absolute; right: -5px; top: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.clock { margin-top: 8px; display: flex; align-items: baseline; gap: 10px; font-size: 13px; color: var(--muted); }
.clock b { font-size: 15px; color: var(--ink); font-weight: 650; min-width: 4.6ch; white-space: nowrap; font-variant-numeric: normal; }
.packets { display: grid; grid-template-columns: 4fr 1.6fr; gap: 6px; margin-top: 14px; }
.packet { position: relative; overflow: hidden; border-radius: 3px; padding: 10px 12px 9px; display: flex; flex-direction: column; gap: 2px; min-width: 0; isolation: isolate; }
.packet::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 14px; background: linear-gradient(172deg, rgb(0 0 0 / 17%) 50%, transparent 50.5%) top left / 50.4% 100% no-repeat, linear-gradient(-172deg, rgb(0 0 0 / 17%) 50%, transparent 50.5%) top right / 50.4% 100% no-repeat; z-index: 1; filter: drop-shadow(0 1px 0 rgb(0 0 0 / 12%)); }
.packet .pk-l { font-size: 13px; font-weight: 500; position: relative; z-index: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.packet b { font-variant-numeric: normal; font-size: 16px; font-weight: 650; position: relative; z-index: 1; white-space: nowrap; }
.packet .pk-fill { position: absolute; inset: 0; z-index: 0; transform-origin: left bottom; }
.packet.you { color: var(--on-action); }
.packet.you .pk-fill { background: var(--action); }
.packet.tax { color: #2b1d00; }
.packet.tax .pk-fill { background: var(--manila); }
.packet.sub { color: #062a1c; }
.packet.empty, .js .scene.s3 .packet.empty, .js .stage-in[data-active="3"] .s3 .packet.empty { color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line-2); background: repeating-linear-gradient(-45deg, transparent 0 6px, var(--line) 6px 7px); }
.packet.empty::before { opacity: .5; }
.packet.sub .pk-fill { background: var(--sage); }
.pk-note { margin-top: 8px; font-size: 13px; color: var(--muted); }
.paid-stamp { position: absolute; right: 22px; top: 86px; width: 132px; height: 48px; transform: rotate(-8deg); opacity: .92; pointer-events: none; overflow: visible; }
.paid-stamp rect { fill: none; stroke: var(--green); stroke-width: 3; }
.paid-stamp text { fill: var(--green); font: 780 28px var(--sans); font-stretch: 125%; letter-spacing: .1em; text-anchor: middle; dominant-baseline: central; }
.settle-card { position: absolute; left: 44px; bottom: 14px; width: min(340px, 60%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 12px 14px; z-index: 2; }
.settle-card p { font-size: 13px; line-height: 1.45; color: var(--muted); }
.settle-card .mono { font-size: 12.5px; }
.settle-card .hash { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.settle-card .hash a { color: var(--ink); text-decoration: none; font-size: 14px; }
.settle-card .hash a:hover { color: var(--accent); text-decoration: underline; }
.replay { display: none; position: absolute; right: 16px; bottom: 14px; min-height: 36px; padding: 6px 12px; font-size: 13px; background: var(--surface); }
.js .replay { display: inline-flex; }

/* The payment, played once. Served finished; .motion (boot.js) and data-step (app.js) drive it. */
.motion .pay-win[data-step="0"] .chain-pick li.on { background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.motion .pay-win[data-step="0"] .quote,
.motion .pay-win[data-step="1"] .quote { opacity: 0; transform: translateY(4px); }
.quote { transition: opacity var(--t2) var(--enter), transform var(--t2) var(--enter); }
.pay-with { position: relative; }
.quote-wait { display: none; position: absolute; left: 0; bottom: 0; font-size: 14px; color: var(--muted); }
.motion .pay-win[data-step="0"] .quote-wait, .motion .pay-win[data-step="1"] .quote-wait { display: block; }
.motion .pay-win[data-step="1"] .chain-pick li.on { transform: scale(.96); }
.motion .pay-win:not([data-step="4"]):not([data-step="done"]) .pk-fill { transform: scaleY(0); }
.motion .pay-win:not([data-step="4"]):not([data-step="done"]) .packet { color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); }
.pay-win[data-step="4"] .pk-fill, .pay-win[data-step="done"] .pk-fill { transition: transform .5s var(--enter) .35s; }
.pay-win[data-step="4"] .packet, .pay-win[data-step="done"] .packet { transition: color .3s var(--enter), box-shadow .3s var(--enter); }
.pay-win[data-step="4"] .packet.tax .pk-fill { transition-delay: .53s; }
.motion .pay-win:not([data-step="done"]):not([data-step="4"]) .paid-stamp { opacity: 0; transform: rotate(-8deg) scale(1.35); }
.pay-win[data-step="4"] .paid-stamp { transition: opacity .1s linear, transform .22s cubic-bezier(.2, .9, .3, 1); }
.motion .pay-win:not([data-step="done"]) .settle-card { opacity: 0; transform: translateY(10px); }
.settle-card { transition: opacity var(--t3) var(--enter), transform var(--t3) var(--enter); }
.motion .pay-win[data-step="2"] .r-wire:nth-child(2) i { animation: travel .9s var(--move) both; }
.motion .pay-win[data-step="3"] .r-wire:nth-child(4) i { animation: travel .9s var(--move) both; }
.motion .pay-win[data-step="2"] .route, .motion .pay-win[data-step="3"] .route { box-shadow: inset 0 0 0 1px var(--accent-line); }
.route { transition: box-shadow var(--t2) var(--enter); }
.proof-chip.due { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-line); }
@keyframes travel { 0% { transform: translateX(-100%); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { transform: none; opacity: 0; } }

/* ---------- How it works: one stage, three scenes, driven by the scroll ---------- */
.landing .how { min-height: 200svh; }
.how-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; margin-top: 48px; }
.how-steps { grid-column: 1 / span 6; list-style: none; margin: 0; padding: 0; counter-reset: st; }
.how-steps li { counter-increment: st; position: relative; padding: 0 0 0 56px; min-height: 420px; }
.how-steps li + li { margin-top: 24px; }
.how-steps li::before { content: counter(st); position: absolute; left: 0; top: -2px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 15px; font-weight: 600; color: var(--muted); }
.how-steps li::after { content: ''; position: absolute; left: 18px; top: 42px; bottom: -18px; width: 1px; background: var(--line-2); }
.how-steps li:last-child::after { display: none; }
.how-steps h3 { font-size: 24px; color: var(--ink); }
.how-steps p { margin-top: 12px; font-size: 17px; line-height: 1.6; color: var(--ink-2); max-width: 30em; }
.how-steps li.on::before { background: var(--action); border-color: var(--action); color: var(--on-action); }
.how-stage { grid-column: 7 / span 6; }
.stage-in { display: flex; flex-direction: column; gap: 24px; }
.scene { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); padding: 32px; box-shadow: var(--shadow); }
.js .how-stage { position: relative; }
.js .stage-in { position: sticky; top: calc(var(--nav) + 48px); height: min(640px, calc(100svh - var(--nav) - 120px)); display: block; border-radius: var(--radius);
  background-color: var(--liner-ground);
  background-image: repeating-linear-gradient(45deg, var(--liner-ink) 0 1px, transparent 1px 7px), repeating-linear-gradient(-45deg, var(--liner-ink) 0 1px, transparent 1px 7px); }
.js .scene { position: absolute; inset: 40px; display: flex; flex-direction: column; justify-content: center; opacity: 0; transform: translateY(18px) scale(.985); transition: opacity .45s var(--enter), transform .6s var(--enter); pointer-events: none; }
.js .stage-in[data-active="1"] .s1, .js .stage-in[data-active="2"] .s2, .js .stage-in[data-active="3"] .s3 { opacity: 1; transform: none; }
.mini-sheet { display: flex; flex-direction: column; gap: 0; }
.ms-title { display: flex; justify-content: space-between; align-items: baseline; font-size: 22px; font-weight: 650; font-stretch: 112%; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.ms-no { font-size: 14px; font-weight: 500; font-stretch: 100%; color: var(--muted); }
/* Line items as the client will never see them from a server: hidden behind the security tint. */
.ms-lines { display: flex; flex-direction: column; gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.ms-lines p { display: flex; justify-content: space-between; gap: 24px; }
.redact { display: block; height: 14px; width: 62%; border-radius: 2px; background-color: var(--liner-ground); background-image: repeating-linear-gradient(45deg, var(--liner-ink) 0 1px, transparent 1px 5px), repeating-linear-gradient(-45deg, var(--liner-ink) 0 1px, transparent 1px 5px); }
.redact.short { width: 44%; }
.redact.amt { width: 16%; }
.ms-row { display: flex; justify-content: space-between; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
.ms-k { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; color: var(--ink); }
.ms-k .ico { color: var(--accent); }
.ms-v { color: var(--muted); text-align: right; }
.ms-row.total { border-bottom: 0; font-size: 22px; font-stretch: 108%; }
.ms-row.total .ms-v { color: var(--ink); font-weight: 650; }
.ms-link { margin-top: 16px; display: flex; gap: 10px; align-items: center; padding: 8px 8px 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--accent-line); background: var(--accent-soft); }
.ms-url { flex: 1; min-width: 0; display: block; font: 400 13px/1.3 var(--mono); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-url .ico { vertical-align: -3px; margin-right: 8px; }
.ms-url .ico { color: var(--accent); }
.ms-btn { flex: none; font-size: 14px; font-weight: 500; background: var(--action); color: var(--on-action); border-radius: 4px; padding: 8px 14px; transition: transform 90ms var(--enter); }
.js .stage-in[data-active="1"] .ms-btn { animation: press 3.2s var(--enter) .8s infinite; }
@keyframes press { 0%, 20%, 100% { transform: none; } 8% { transform: scale(.94); } }
/* The cross-chain diagram: every route converges on NEAR Intents, one line runs on to the contract. */
.flow { width: 100%; height: auto; display: block; overflow: visible; }
.fp { fill: none; stroke: var(--line-2); stroke-width: 1.5; }
.fp.hot { stroke: var(--accent-line); stroke-width: 2; }
.pz { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 10 600; stroke-dashoffset: 10; opacity: 0; }
.motion .pz { animation: pulse 3.2s var(--move) infinite; }
.motion .pz.p1 { animation-delay: .5s; } .motion .pz.p2 { animation-delay: 1.1s; } .motion .pz.p3 { animation-delay: 1.7s; } .motion .pz.p4 { animation-delay: .8s; } .motion .pz.p5 { animation-delay: 2.1s; }
.motion .pz.pout { stroke: var(--green); stroke-dasharray: 10 120; animation: pulse-out 3.2s linear infinite; }
@keyframes pulse { 0% { stroke-dashoffset: 10; opacity: 0; } 8% { opacity: 1; } 70% { stroke-dashoffset: -230; opacity: 1; } 76%, 100% { stroke-dashoffset: -240; opacity: 0; } }
@keyframes pulse-out { 0%, 62% { stroke-dashoffset: 10; opacity: 0; } 66% { opacity: 1; } 92% { stroke-dashoffset: -50; opacity: 1; } 100% { stroke-dashoffset: -56; opacity: 0; } }
.flow-v { display: none; }
.fn.hub circle { fill: var(--action); }
.motion .pz.s { animation-name: pulse-s; }
.motion .pz.s.pout { animation-name: pulse-out-s; stroke-dasharray: 10 120; }
@keyframes pulse-s { 0% { stroke-dashoffset: 10; opacity: 0; } 8% { opacity: 1; } 60% { stroke-dashoffset: -60; opacity: 1; } 66%, 100% { stroke-dashoffset: -66; opacity: 0; } }
@keyframes pulse-out-s { 0%, 62% { stroke-dashoffset: 10; opacity: 0; } 66% { opacity: 1; } 92% { stroke-dashoffset: -72; opacity: 1; } 100% { stroke-dashoffset: -78; opacity: 0; } }
.fn rect { fill: var(--surface); stroke: var(--line-2); }
.fn text { fill: var(--ink); font: 600 14px var(--sans); text-anchor: middle; dominant-baseline: middle; }
.fn.hot rect { stroke: var(--accent); fill: var(--accent-soft); }
.fn.hub rect { fill: var(--action); stroke: none; }
.fn.hub text { fill: var(--on-action); font-size: 12.5px; }
.fn.dest rect { fill: var(--surface); stroke: var(--green); stroke-width: 1.5; }
.fn.dest text { font-family: var(--mono); font-weight: 500; font-size: 13px; }
.fn.dest text.t2 { fill: var(--green); font-size: 11.5px; }
.pk-row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(112px, 1.7fr) minmax(136px, 1.7fr); gap: 8px; height: 200px; }
.landing .packet.empty b { font-size: 17px; font-weight: 500; }
.packet.big { padding: 18px 16px 14px; justify-content: flex-end; }
.packet.big::before { height: 34px; }
.packet.big .pk-l { font-size: 15px; }
.packet.big b { font-size: 28px; font-stretch: 112%; }
.js .scene.s3 .pk-fill { transform: scaleY(0); transition: transform .7s var(--enter); }
.js .scene.s3 .packet { color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); transition: color .4s var(--enter) .3s, box-shadow .4s var(--enter); }
.js .stage-in[data-active="3"] .s3 .pk-fill { transform: none; }
.js .stage-in[data-active="3"] .s3 .packet.you { color: var(--on-action); box-shadow: none; }
.js .stage-in[data-active="3"] .s3 .packet.tax { color: #2b1d00; box-shadow: none; }
.js .stage-in[data-active="3"] .s3 .packet.sub { color: #062a1c; box-shadow: none; }
.js .stage-in[data-active="3"] .s3 .tax .pk-fill { transition-delay: .2s; }
.js .stage-in[data-active="3"] .s3 .sub .pk-fill { transition-delay: .4s; }
.csv { margin-top: 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.csv-name { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: 14px; font-weight: 500; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.csv-name .ico { color: var(--green); }
.csv table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.csv th { text-align: left; font-weight: 500; color: var(--muted); padding: 8px 14px; }
.csv td { padding: 8px 14px; border-top: 1px solid var(--line); }

/* ---------- Proof: one event held large, the rest as a ledger ---------- */
.landing .proof { min-height: 200svh; }
.contract { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; margin: 40px 0 0; padding: 0; }
.contract > div { min-width: 0; }
.contract > div:nth-child(1) { grid-column: span 3; }
.contract > div:nth-child(2) { grid-column: span 6; }
.contract > div:nth-child(3) { grid-column: span 3; }
.contract dt { font-size: 13px; color: var(--muted); }
.contract dd { margin: 4px 0 0; display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 15px; }
.contract dd code { background: none; border: 0; padding: 0; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contract dd a.mono { color: var(--ink); text-decoration: none; font-size: 14px; }
.ledger { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 32px; margin-top: 40px; align-items: start; }
.ledger-main { grid-column: 1 / span 6; min-width: 0; }
.event { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 28px 24px; position: relative; overflow: hidden; }
.event::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: radial-gradient(circle at 5px 0, var(--bg) 3px, transparent 3.5px) 0 0 / 12px 6px repeat-x; }
.event-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.event-head h3 { font-size: 26px; font-stretch: 116%; }
.event-amt { font-variant-numeric: normal; font-size: 22px; font-weight: 650; margin-left: auto; }
.event-steps { list-style: none; margin: 20px 0 0; padding: 0; }
.event-steps > li { padding: 16px 0 0; }
.es-what { font-size: 16px; line-height: 1.55; color: var(--ink-2); margin-bottom: 10px; }
.es-k { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.event-steps > li.key-tx .es-k { color: var(--green); }
.es-gap { display: flex; align-items: center; gap: 12px; padding: 12px 0 0 !important; font-size: 14px; font-weight: 650; color: var(--accent); }
.es-gap::before, .es-gap::after { content: ''; flex: 1; height: 1px; background: repeating-linear-gradient(90deg, var(--accent-line) 0 4px, transparent 4px 8px); }
.event-split { display: grid; grid-template-columns: 4fr minmax(84px, 1fr); gap: 4px; margin-top: 20px; height: 40px; }
.event-split span { display: flex; align-items: center; padding: 0 12px; font-size: 13px; font-weight: 600; border-radius: 3px; white-space: nowrap; overflow: hidden; }
.event-split .you { background: var(--action); color: var(--on-action); }
.event-split .tax { background: var(--manila); color: #2b1d00; }
.moves { grid-column: 7 / span 6; list-style: none; margin: 0; padding: 0; }
.move { padding: 18px 0 14px; border-top: 1px solid var(--line-2); }
.move:first-child { padding-top: 0; border-top: 0; }
.move-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tag { font-size: 15px; font-weight: 650; font-stretch: 110%; color: var(--ink); }
.move-amt { font-size: 15px; font-weight: 600; color: var(--ink); }
.move p { margin: 4px 0 8px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.live { display: flex; gap: 10px; align-items: baseline; margin-top: 24px; font-size: 14px; color: var(--muted); }
.live .dot { transform: translateY(-1px); }
.verify { margin-top: 24px; border-radius: var(--radius); overflow: hidden; background: var(--term); color: #dfe6f3; border: 1px solid rgb(255 255 255 / 10%); }
.verify-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px; font-size: 14px; font-weight: 500; border-bottom: 1px solid rgb(255 255 255 / 9%); }
.verify-bar .copy { margin-left: auto; color: #aeb9cf; }
.verify-bar .copy:hover { background: rgb(255 255 255 / 8%); color: #fff; }
.verify pre { background: none; border: 0; color: #e9eef8; padding: 18px 18px 6px; font-size: 13.5px; }
.verify pre .p { color: #7f8db0; }
.verify > p { padding: 6px 18px 18px; font-size: 14px; color: #aeb9cf; line-height: 1.6; }
.verify a { color: #a9c2f7; text-decoration-color: rgb(169 194 247 / 45%); }

/* ---------- Try it ---------- */
.tries { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 0; margin-top: 16px; }
.landing #try .intro { margin-top: 12px; }
.try { grid-column: 7 / span 6; padding: 16px 0; border-top: 1px solid var(--line-2); display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; align-items: start; }
.try:nth-child(2) { border-top: 0; padding-top: 0; }
.try > * { grid-column: 1; }
.try .go { grid-column: 2; grid-row: 1 / span 4; align-self: center; }
.try-net { font-size: 13px; font-weight: 500; color: var(--muted); }
.try h3 { font-size: 19px; margin-top: 2px; }
.try p { margin-top: 4px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.try p.small { font-size: 14px; color: var(--muted); }
.primary-try { align-self: start; grid-column: 1 / span 6; grid-row: 1 / span 4; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 28px; display: flex; flex-direction: column; gap: 0; }

.primary-try h3 { font-size: 24px; }
.try-steps { margin: 12px 0 10px; padding: 0; list-style: none; counter-reset: ts; display: flex; flex-direction: column; gap: 6px; }
.try-steps li { counter-increment: ts; position: relative; padding-left: 36px; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.try-steps li::before { content: counter(ts); position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; display: grid; place-items: center; }
.primary-try .go { margin-top: auto; padding-top: 14px; align-self: flex-start; }
.try .go .btn { min-width: 184px; }

/* ---------- What is real: the liner band ---------- */
.real { background: var(--band); color: var(--band-ink); box-shadow: inset 0 1px 0 var(--band-line), inset 0 -1px 0 var(--band-line); }
.real h2 { color: var(--band-ink); }
.real .intro { color: var(--band-muted); }
.real::before { content: ''; position: absolute; inset: 0; background-image: repeating-linear-gradient(45deg, rgb(255 255 255 / 4%) 0 1px, transparent 1px 7px), repeating-linear-gradient(-45deg, rgb(255 255 255 / 4%) 0 1px, transparent 1px 7px); pointer-events: none; }
.table-card { margin-top: 48px; border-top: 1px solid var(--band-line); border-bottom: 1px solid var(--band-line); }
.facts-table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
.facts-table th { text-align: left; font-size: 13px; font-weight: 500; color: var(--band-muted); padding: 14px 24px 14px 0; border-bottom: 1px solid var(--band-line); }
.facts-table td { padding: 18px 24px 18px 0; border-bottom: 1px solid var(--band-line); vertical-align: top; color: var(--band-muted); line-height: 1.5; font-size: 16px; }
.facts-table tr:last-child td { border-bottom: 0; }
.facts-table td:first-child { color: var(--band-ink); font-weight: 500; width: 30%; }
.facts-table .ok { color: var(--band-ink); }
.facts-table .ok.sim { color: #f0cf7e; }
.facts-table .mono { overflow-wrap: normal; white-space: nowrap; font-size: 13.5px; }

/* ---------- Closing ---------- */
.closing { min-height: 100svh; padding: var(--padt) 0 var(--padb); display: flex; border-top: 1px solid var(--line); }
.closing > .wrap { display: flex; flex-direction: column; justify-content: space-between; gap: 64px; }
.close-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: end; }
.close-row { grid-column: 1 / span 8; display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }
.close-qr { grid-column: 10 / span 3; margin: 0; padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; }
.close-qr::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: radial-gradient(circle at 5px 0, var(--bg) 3px, transparent 3.5px) 0 0 / 12px 6px repeat-x; }
.cq-title { font-size: 17px; font-weight: 650; font-stretch: 110%; margin-bottom: 14px; }
.close-qr svg { display: block; width: 100%; height: auto; border-radius: 4px; }
.cq-bg { fill: #ffffff; }
.cq-ink { fill: #17213a; }
.cq-url { margin-top: 12px; font-size: 13px; line-height: 1.4; color: var(--muted); overflow-wrap: normal; }
@media (max-width: 1023px) { .close-row { grid-column: 1 / -1; } .close-qr { display: none; } }
.close-row h2 { font-size: clamp(40px, 4vw + 20px, 88px); line-height: .98; letter-spacing: -.04em; font-stretch: 122%; max-width: 12em; }
.close-row p { font-size: 18px; color: var(--ink-2); max-width: 40em; text-wrap: balance; }
.close-row .btn--xl { padding: 13px 28px; font-size: 17px; }
.foot-dir { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding-top: 32px; border-top: 1px solid var(--line); }
.foot-brand { display: flex; flex-direction: column; gap: 12px; max-width: 34em; }
.foot-brand p { font-size: 14px; color: var(--muted); }
.foot-brand p a { white-space: nowrap; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 28px; align-content: flex-start; }

/* ---------- Short screens and tablets: the pay window drops its account row ---------- */
@media (max-width: 1023px), (max-height: 820px) {
  .sheet-kv { display: none; }
  .hero-art { padding: 28px 28px 64px; min-height: 0; }
  .settle-card { left: 28px; }
  .sheet-amt { margin-top: 10px; }
  .pay-with { margin-top: 12px; padding-top: 12px; }
}
@media (min-width: 1024px) and (max-height: 820px) {
  .hero { padding-top: calc(var(--nav) + 32px); padding-bottom: 32px; }
  .hero h1 { font-size: clamp(38px, 2vw + 24px, 54px); margin-top: 16px; }
  .lead { margin-top: 16px; font-size: 18px; }
  .btn-row { margin-top: 24px; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .hero { padding-top: calc(var(--nav) + 40px); padding-bottom: 32px; }
  .hero-art { margin-top: 28px; padding: 16px; }
  .fact, .sheet-head .sub, .lbl, .settle-card, .win-bar { display: none; }
  .sheet { padding: 16px 20px; }
  .sheet::before { display: none; }
  .sheet-amt b { font-size: 34px; }
  .sheet-amt { margin-top: 2px; }
  .pay-with { margin-top: 8px; padding-top: 0; border-top: 0; }
  .route { margin-top: 10px; }
  .packets { margin-top: 10px; }
  .paid-stamp { top: 40px; }
  .replay { position: static; margin-top: 12px; align-self: flex-end; }
  .hero h1 { font-size: clamp(40px, 4vw + 16px, 54px); }
}
/* ---------- Phones and tablets ---------- */
@media (max-width: 1023px) {
  .hero-text { grid-column: 1 / -1; }
  .hero-art { grid-column: 1 / -1; margin-top: 40px; min-height: 0; }
  .how-steps { grid-column: 1 / -1; }
  .how-grid { --stage-h: 440px; }
  .how-stage { grid-column: 1 / -1; grid-row: 1; margin-bottom: 32px; }
  .how-steps li { min-height: 300px; }
  /* One grid cell: the stage sticks over the steps while they scroll under it. */
  .js .how-stage { grid-row: 1; grid-column: 1 / -1; margin-bottom: 0; z-index: 2; pointer-events: none; }
  .js .how-steps { grid-row: 1; grid-column: 1 / -1; padding-top: calc(var(--stage-h) + 40px); }
  .js .stage-in { top: calc(var(--nav) + 16px); height: var(--stage-h); z-index: 2; box-shadow: 0 -16px 0 var(--bg); }
  /* Text slides under the stage behind a short fade instead of a hard edge. */
  .js .stage-in::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 40px; background: linear-gradient(var(--bg), transparent); pointer-events: none; }
  .ledger-main, .moves { grid-column: 1 / -1; }
  .primary-try, .try { grid-column: 1 / -1; grid-row: auto; }
  .try:nth-child(2) { border-top: 1px solid var(--line-2); padding-top: 20px; margin-top: 24px; }
}
@media (max-width: 639px) {
  .landing .intro { font-size: 17px; margin-top: 16px; }
  .hero { padding: calc(var(--nav) + 20px) 0 20px; }
  .hero-grid { display: flex; flex-direction: column; align-items: stretch; }
  .n-more { display: none; }
  .hero-text { display: contents; }
  .notice { order: 1; }
  .hero h1 { order: 2; margin-top: 14px; font-size: 37px; line-height: 1.02; }
  .lead { order: 3; margin-top: 12px; font-size: 16px; line-height: 1.5; }
  .hero-art { order: 4; margin-top: 18px; padding: 10px; border-radius: 6px; }
  .chain-pick li:nth-child(n+5) { display: none; }
  .packets { grid-template-columns: 3fr 2fr; }
  .btn-row { order: 5; margin-top: 16px; flex-direction: column; gap: 10px; }
  .btn-row .btn { width: 100%; }
  .fact { display: none; }
  .win-bar { display: none; }
  .sheet::before { display: none; }
  .win-url { font-size: 11.5px; }
  .sheet { padding: 14px 14px 12px; }
  .sheet-title { font-size: 16px; }
  .sheet-head .sub, .sheet-kv, .pk-note, .settle-card, .lbl { display: none; }
  .sheet-amt { margin-top: 4px; }
  .sheet-amt b { font-size: 30px; }
  .pay-with { margin-top: 8px; padding-top: 0; border-top: 0; }
  .chain-pick { margin-top: 0; gap: 4px; }
  .chain-pick li { font-size: 12.5px; padding: 3px 8px; }
  .quote { margin-top: 6px; font-size: 13px; }
  .route { margin-top: 8px; padding: 8px 10px; }
  .r-node { font-size: 12px; } .r-node.end { font-size: 11.5px; }
  .clock { margin-top: 4px; font-size: 12px; } .clock b { font-size: 13px; }
  .packets { margin-top: 8px; }
  .packet { padding: 7px 10px 6px; }
  .packet .pk-l { font-size: 12.5px; } .packet b { font-size: 14px; }
  .paid-stamp { top: 44px; right: 16px; width: 92px; height: 34px; }
  .replay { right: 8px; bottom: auto; top: -46px; display: none !important; }
  .how { min-height: 200lvh; }
  .how-grid { margin-top: 32px; }
  .how-grid { --stage-h: 330px; }
  .js .stage-in { top: calc(var(--nav) + 8px); }
  .js .scene { inset: 16px; }
  .scene { padding: 20px; }
  .how-steps li { padding-left: 48px; min-height: 330px; }
  .how-steps h3 { font-size: 21px; }
  .how-steps p { font-size: 16px; }
  .ms-row { padding: 10px 0; font-size: 14px; }
  .ms-lines + .ms-row .ms-v { display: none; }
  .ms-row .ms-v { font-size: 12.5px; }
  .ms-title { font-size: 17px; padding-bottom: 8px; }
  .ms-lines { padding: 8px 0; gap: 6px; }
  .ms-lines p:nth-child(2) { display: none; }
  .redact { height: 10px; }
  .ms-v { font-size: 13px; }
  .ms-row.total .ms-v { font-size: 18px; }
  .pk-row { height: 104px; grid-template-columns: 1.2fr 1fr 1.2fr; gap: 6px; }
  .packet.big { padding: 12px 10px 10px; }
  .packet.big::before { height: 20px; }
  .packet.big .pk-l { font-size: 13px; }
  .packet.empty .pk-l { font-size: 12px; overflow: visible; white-space: normal; }
  .landing .packet.empty b { font-size: 13px; }
  .csv { margin-top: 12px; }
  .csv-name { padding: 8px 12px; }
  .csv th:nth-child(2), .csv td:nth-child(2) { display: none; }
  .csv th, .csv td { padding: 6px 12px; }
  .flow-h { display: none; }
  .flow-v { display: block; max-height: 100%; }
  .js .scene.s2 { padding: 12px; }
  .packet.big b { font-size: 22px; }
  .csv th:nth-child(4), .csv td:nth-child(4) { display: none; }
  .proof { min-height: 200lvh; }
  .contract { grid-template-columns: 1fr; row-gap: 12px; }
  .contract > div:nth-child(n) { grid-column: 1; }
  .event { padding: 22px 18px 18px; }
  .event-head h3 { font-size: 22px; }
  .tx { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .try { grid-template-columns: 1fr; }
  .try .go { grid-column: 1; grid-row: auto; margin-top: 14px; }
  .try .go .btn { width: 100%; }
  .primary-try { padding: 22px 18px; }
  .table-card { margin-top: 32px; }
  .facts-table { min-width: 0; }
  .facts-table thead { display: none; }
  .facts-table tr { display: block; padding: 16px 0; border-bottom: 1px solid var(--band-line); }
  .facts-table tr:last-child { border-bottom: 0; }
  .facts-table td { display: block; padding: 4px 0; border: 0; width: auto; }
  .facts-table td:first-child { width: auto; font-size: 16px; padding-bottom: 8px; }
  .facts-table td:not(:first-child)::before { content: attr(data-label); display: block; font-size: 13px; font-weight: 500; color: var(--band-muted); margin-bottom: 2px; }
  .close-row .btn { width: 100%; }
  .landing .testbar { font-size: 12.5px; }
}
@media (max-width: 380px) { .hero h1 { font-size: 33px; } }

/* ---------- Reduced motion: final states, nothing travels ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .js .scene, .how-steps li::before, .pk-fill, .packet, .quote, .settle-card, .paid-stamp, .chain-pick li, .proof-chip, .route, .theme-toggle .ico { transition: none !important; }
  .js .scene { transform: none; }
  button, .btn, .theme-toggle .ico { transition-property: background-color, color, opacity !important; }
  button:hover, .btn:hover, button:active:not(:disabled), .btn:active { transform: none !important; }
  .pz { opacity: 0 !important; }
}

@media print {
  body { background: #fff; color: #000; }
  .top, .tabs, .testbar, .no-print, .toast, .nav { display: none !important; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .invoice::before { display: none; }
  .wrap { padding: 0; }
}
