/* Quill. One scene carries the look: a writing desk. A sheet of letter paper lies on a navy leather blotter with pink
   blotting paper (it still holds the mirror image of old letters), a goose quill stands in a cut-glass inkwell.
   The letter says what to do next in fresh ink; the ink in the well is the credit on your key. The page is laid paper,
   royal-blue ink is the one colour you press, navy leather frames what is dark, script is only ever handwriting. */

@font-face { font-family: 'Libre Caslon Display'; src: url('/fonts/caslon-display.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Literata'; src: url('/fonts/literata.woff2') format('woff2'); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Literata'; src: url('/fonts/literata-italic.woff2') format('woff2'); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Petit Formal Script'; src: url('/fonts/petit-formal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Xanh Mono'; src: url('/fonts/xanh-mono.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Xanh Mono'; src: url('/fonts/xanh-mono-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --ground: #f4efe3;
  --ground-hi: #fbf8f0;
  --ground-lo: #ebe4d3;
  --line: #dcd3be;
  --line-2: #c2b79e;
  --ink: #1a1d2b;
  --ink-2: #3b3e4d;
  --mute: #6a6870;
  --royal: #2944b8;
  --royal-hi: #3a58d2;
  --royal-lo: #182a7d;
  --wet: #2f4fd0;
  --leather: #1f2b47;
  --leather-hi: #2d3b60;
  --leather-lo: #121a2e;
  --gilt: #c1994a;
  --blot: #ecc2bd;
  --blot-hi: #f4d6d1;
  --blot-lo: #dca9a2;
  --well: #1b2450;
  --good: #2c7448;
  --bad: #b3322b;

  --display: 'Libre Caslon Display', 'Didot', Georgia, serif;
  --text: 'Literata', Georgia, 'Times New Roman', serif;
  --mono: 'Xanh Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --hand: 'Petit Formal Script', 'Snell Roundhand', 'Apple Chancery', cursive;

  --fs-0: .8125rem;
  --fs-1: .9375rem;
  --fs-2: 1.0625rem;
  --fs-3: 1.375rem;
  --fs-4: clamp(2.1rem, 1.4rem + 2.4vw, 3.3rem);
  --fs-5: clamp(2.5rem, 1.1rem + 4.2vw, 4.4rem);

  --page: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --r: 10px;

  /* laid paper: faint chain lines and a fine grain */
  --laid: repeating-linear-gradient(90deg, rgba(120, 100, 60, .035) 0 1px, transparent 1px 26px), repeating-linear-gradient(0deg, rgba(120, 100, 60, .018) 0 1px, transparent 1px 3px);
  --blotting: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9 .4' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .3 0 0 0 0 .28 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0; background: var(--laid), var(--ground); color: var(--ink);
  font: 400 var(--fs-2)/1.6 var(--text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-thickness: .07em; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .12em; text-decoration-color: var(--royal); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--royal); color: #fff; }
:focus-visible { outline: 3px solid var(--royal); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--page)); margin-inline: auto; }
.mono { font-family: var(--mono); font-size: .92em; }
.mute { color: var(--mute); }
.nowrap { white-space: nowrap; }
.hand { font-family: var(--hand); font-weight: 400; color: var(--royal); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- buttons: blocks of ink. A firm edge underneath, pressed down when you push it. */
.key {
  --face: var(--ground-hi); --edge: var(--ink); --rim: var(--ink); --on: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: 0 1.35em; border: 1.5px solid var(--rim); border-radius: 7px;
  background: var(--face); color: var(--on); font: 650 var(--fs-2)/1 var(--text); letter-spacing: -.005em;
  text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 4px 0 var(--edge);
  transform: translateY(0); transition: transform .06s ease-out, box-shadow .06s ease-out, background-color .12s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.key:hover { --face: #fff; }
.key:active, .key[aria-pressed='true'] { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 1px 0 var(--edge); }
.key:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: 0 4px 0 var(--edge); }
.key.go { --face: var(--royal); --edge: var(--royal-lo); --rim: var(--royal-lo); --on: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 4px 0 var(--edge); }
.key.go:hover { --face: var(--royal-hi); }
.key.go:active { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 1px 0 var(--edge); }
.key.dark { --face: var(--leather); --edge: var(--leather-lo); --rim: var(--leather-lo); --on: #fff; }
.key.big { min-height: 60px; padding: 0 1.75em; font-size: 1.1875rem; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 5px 0 var(--edge); }
.key.big:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--edge); }
.key.small { min-height: 40px; padding: 0 1em; font-size: var(--fs-1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 3px 0 var(--edge); }
.key.small:active, .key.small[aria-pressed='true'] { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge); }
.key svg { width: 1.1em; height: 1.1em; flex: none; }
.plain { background: none; border: 0; padding: 0; font-weight: 650; text-decoration: underline; text-decoration-thickness: .07em; text-underline-offset: .2em; }
.plain:hover { text-decoration-thickness: .12em; text-decoration-color: var(--royal); }

/* ---------- a slip: every place that shows a value (the credit, the balance) is a slip of letter paper with the
   amount written in ink. The little inkwell next to it fills with the credit. */
.slip {
  position: relative; border-radius: 3px; color: var(--ink);
  background: var(--laid), linear-gradient(170deg, #fffdf7, #f7f1e3);
  box-shadow: 0 0 0 1px rgba(60, 45, 20, .14), 0 3px 8px rgba(40, 30, 20, .1);
}
.amt-ink { font-family: var(--hand); color: var(--royal); font-variant-numeric: lining-nums; }
.vial { --ink: 0; position: relative; flex: none; width: 15px; height: 17px; border-radius: 2px 2px 4px 4px; border: 1.5px solid var(--ink-2);
  background: linear-gradient(to top, var(--well) calc(var(--ink) * 100%), rgba(255, 255, 255, .6) 0); transition: background .6s; }
.vial::before { content: ''; position: absolute; left: 2.5px; right: 2.5px; top: -5px; height: 4px; border-radius: 1px; background: var(--gilt); }

/* ---------- header */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--ground) 93%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.top.scrolled { border-bottom-color: var(--line); }
.top .wrap { display: flex; align-items: center; gap: clamp(14px, 3vw, 36px); min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 400 1.9rem/1 var(--display); letter-spacing: -.01em; }
.brand span { translate: 0 1px; }
.brand svg { width: 38px; height: 40px; }
.nav { display: flex; gap: clamp(14px, 2.4vw, 30px); margin-left: auto; font-weight: 600; font-size: var(--fs-2); }
.nav a { text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--ink); }
.nav a[aria-current='page'] { border-bottom-color: var(--royal); }
.top-x { display: inline-flex; padding: 8px; margin: -8px; }
.top-x svg { width: 19px; height: 19px; }
/* the credit at the top: a slip with the amount in ink and a small inkwell */
.credit { display: inline-flex; align-items: center; padding: 0; margin: 4px; border: 0; background: none; transition: transform .06s; }
.credit:active { transform: translateY(2px); }
.credit .slip { display: flex; align-items: center; gap: 10px; min-width: 104px; padding: 9px 12px 8px 13px; line-height: 1; }
.credit .amt-ink { font-size: 1.15rem; margin-left: auto; }
.menu-btn { display: none; }

/* ---------- the scene: the desk. Everything is measured in em, so it scales with one font-size. */
.scene { --u: 16px; position: relative; flex: none; width: 36em; height: 29em; font-size: var(--u); }
.pad { position: absolute; left: 0; top: 4.6em; width: 33.75em; height: 23.75em; transform: rotate(-2deg); overflow: visible; }

/* the letter: it is the button. A letterhead, one line in fresh ink, the model it is written with, an empty signature. */
.letter {
  position: absolute; left: 3.3em; top: 2.2em; width: 19em; height: 22.5em; padding: 1.5em 1.7em 1.6em; border: 0; border-radius: .15em;
  display: grid; grid-template-rows: auto 1fr auto auto; text-align: left; color: var(--ink);
  background: var(--laid), linear-gradient(165deg, #fffdf8 0%, #faf6ec 55%, #f1ead9 100%);
  box-shadow: 0 .05em 0 rgba(255, 255, 255, .8) inset, 0 0 0 .04em rgba(60, 45, 20, .16), .2em .5em 1.1em rgba(16, 20, 36, .34), .05em .1em .2em rgba(16, 20, 36, .2);
  transform: rotate(2.6deg); transform-origin: 50% 40%; transition: transform .18s ease-out, box-shadow .18s;
  -webkit-tap-highlight-color: transparent;
}
.letter:hover { transform: rotate(2.6deg) translateY(-.15em); box-shadow: 0 .05em 0 rgba(255, 255, 255, .8) inset, 0 0 0 .04em rgba(60, 45, 20, .16), .25em .8em 1.4em rgba(16, 20, 36, .32), .05em .1em .2em rgba(16, 20, 36, .2); }
.letter:active { transform: rotate(2.6deg) translateY(.05em); }
.letter:focus-visible { outline-offset: .4em; }
.letter .lh { display: flex; align-items: baseline; justify-content: space-between; gap: .8em; padding-bottom: .55em; border-bottom: .06em solid var(--ink); white-space: nowrap; }
.letter .lh-name { font: 400 1.25em/1 var(--display); letter-spacing: .01em; }
.letter .lh-top { font: italic 400 .72em/1 var(--mono); color: var(--ink-2); letter-spacing: .01em; }
.letter .big { align-self: center; display: block; font-size: 2.45em; line-height: 1.15; white-space: nowrap; text-shadow: 0 0 .01em var(--royal); }
.letter .big.l8 { font-size: 2.05em; }
.letter .big.l12 { font-size: 1.7em; }
.letter .feed { position: relative; display: block; height: 1.7em; overflow: hidden; margin-bottom: 1.1em; }
.letter .feed > span { display: flex; align-items: baseline; gap: .55em; white-space: nowrap; }
.letter .feed .hand { font-size: 1.2em; color: var(--ink); }
.letter .feed small { font: 400 .72em/1 var(--mono); color: var(--mute); }
.letter .sign { display: flex; align-items: flex-end; gap: .6em; }
.letter .sign .hand { font-size: 1.1em; color: var(--ink-2); }
.letter .sign i { flex: 1; height: 0; margin-bottom: .45em; border-bottom: .05em solid var(--ink-2); }
/* fresh ink: a new line is written in from left to right, a little wet, then dries */
.write { animation: write 1.1s cubic-bezier(.45, .1, .4, 1) both; }
@keyframes write { from { clip-path: inset(-20% 100% -20% 0); } to { clip-path: inset(-20% -2% -20% 0); } }
.letter .big.write { animation: write 1.1s cubic-bezier(.45, .1, .4, 1) both, dry 2.4s ease-out both; }
@keyframes dry { from { color: var(--wet); text-shadow: 0 0 .03em var(--wet); } }

/* the quill stands in the well; it dips when something new is written */
.quill { position: absolute; left: 23.3em; top: -3.4em; width: 4.6em; height: 27.4em; overflow: visible; transform: rotate(22deg); transform-origin: 60.7% 98.8%; filter: drop-shadow(.5em .55em .35em rgba(14, 18, 34, .28)); }
.quill.dip { animation: dip .9s cubic-bezier(.3, .1, .3, 1); }
@keyframes dip { 40% { transform: rotate(22deg) translateY(.55em); } }
/* the inkwell: the ink in it is the credit */
.well { position: absolute; left: 22.4em; top: 13.6em; width: 12em; height: 12.75em; }
.well svg { width: 100%; height: 100%; overflow: visible; }
.well .ink-fill { transform: translateY(calc((1 - var(--ink)) * 66px)); transition: transform 1.4s cubic-bezier(.3, .1, .2, 1); }

/* ---------- home */
.hero { padding: clamp(24px, 5vw, 60px) 0 clamp(56px, 8vw, 104px); overflow: clip; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: clamp(24px, 4vw, 56px); }
.hero h1 { font: 400 var(--fs-5)/1.02 var(--display); letter-spacing: -.02em; text-wrap: balance; }
.hero h1 em { display: block; margin-top: .14em; font: 400 .74em/1.25 var(--hand); color: var(--royal); letter-spacing: 0; white-space: nowrap; }
.hero .lead { margin-top: 26px; max-width: 30em; font-size: clamp(1.125rem, 1rem + .45vw, 1.3rem); line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.hero .lead b { font-weight: 700; color: var(--ink); }
.hero .acts { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 26px; margin-top: 34px; }

.band { padding: clamp(52px, 8vw, 104px) 0; border-top: 1px solid var(--line); }
.band h2 { font: 400 var(--fs-4)/1.06 var(--display); letter-spacing: -.015em; text-wrap: balance; }
.band h2 em { font-style: italic; color: var(--royal); }
.band .intro { margin-top: 18px; max-width: 34em; color: var(--ink-2); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 6vw, 84px); align-items: start; }

/* price list */
.prices { width: 100%; border-collapse: collapse; font-size: var(--fs-2); }
.prices th { text-align: left; font: 600 var(--fs-0)/1.2 var(--text); color: var(--mute); padding: 0 0 10px; border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
.prices td { padding: 13px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.prices .n { text-align: right; font-family: var(--mono); font-size: 1rem; white-space: nowrap; padding-left: 18px; font-variant-numeric: tabular-nums; }
.prices th.n { font-family: var(--text); font-size: var(--fs-0); }
.prices td:first-child { font-weight: 600; padding-right: 12px; }
.prices tr.front td:first-child { font-weight: 700; font-size: 1.125rem; }
.prices caption { caption-side: bottom; text-align: left; padding-top: 12px; font-size: var(--fs-0); color: var(--mute); }
.prices .id { display: block; font: 400 var(--fs-0)/1.3 var(--mono); color: var(--mute); overflow-wrap: anywhere; }
.prices .tag { font: italic 600 var(--fs-0)/1 var(--text); color: var(--royal); margin-left: 8px; }
.prices tbody tr:hover td { background: color-mix(in srgb, var(--ground-hi) 80%, transparent); }
.more { display: inline-block; margin-top: 24px; font-weight: 700; }

/* code: on the navy leather of the blotter */
.code { background: var(--leather-lo); color: #e8ecf6; border-radius: var(--r); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(193, 153, 74, .35); }
.code-tabs { display: flex; align-items: center; gap: 4px; padding: 8px 8px 0 10px; }
.code-tabs button { background: none; border: 0; padding: 9px 13px; border-radius: 8px 8px 0 0; font: 600 var(--fs-1)/1 var(--text); color: #9aa6c2; }
.code-tabs button:hover { color: #fff; }
.code-tabs button[aria-selected='true'] { background: var(--leather); color: #fff; }
.code-tabs .copy { margin-left: auto; margin-bottom: 6px; }
.code pre { margin: 0; padding: 20px 22px 22px; background: var(--leather); overflow-x: auto; font: 400 .86rem/1.7 var(--mono); tab-size: 2; }
.code pre .c { color: #8794b4; font-style: italic; } .code pre .s { color: var(--blot); } .code pre .k { color: #fff; font-weight: 700; }
.copy { background: #33426a; color: #e8ecf6; border: 0; border-radius: 6px; padding: 7px 12px; font: 600 var(--fs-0)/1 var(--text); }
.copy:hover { background: #3e5080; }
.copy.done { background: var(--gilt); color: var(--leather-lo); }

/* the dark band: navy leather with a gilt line, like the blotter */
.band.dark { background: var(--grain), linear-gradient(160deg, var(--leather-hi), var(--leather) 45%, var(--leather-lo)); color: #eef0f6; border-top: 0; box-shadow: inset 0 10px 0 -8px var(--gilt), inset 0 -10px 0 -8px var(--gilt); }
.band.dark .intro { color: #bdc5d9; }
.band.dark h2 em { color: var(--blot); }
.band.dark .more:hover { text-decoration-color: var(--blot); }
.band.dark + .band { border-top: 0; }

/* what the key remembers, and what never reaches us */
.ledger { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(24px, 5vw, 64px); margin-top: clamp(26px, 4vw, 44px); }
.ledger h3 { font: 400 1.55rem/1.15 var(--display); letter-spacing: -.01em; padding-bottom: 12px; border-bottom: 1.5px solid var(--ink); }
.ledger li { padding: 13px 0; border-bottom: 1px solid var(--line); }
.mem { counter-reset: mem; }
.mem li { display: grid; grid-template-columns: 2.4em 1fr; align-items: baseline; counter-increment: mem; }
.mem li::before { content: counter(mem) '.'; font: 400 1.15rem/1 var(--hand); color: var(--royal); }
/* never kept: each line struck out in ink */
.ledger .no li { color: var(--ink-2); }
.ledger .no li span { text-decoration: line-through; text-decoration-color: var(--royal); text-decoration-thickness: .11em; }
.fine { margin-top: 26px; max-width: 46em; color: var(--ink-2); }

/* questions */
.qa { border-top: 1.5px solid var(--ink); }
.qa details { border-bottom: 1px solid var(--line); }
.qa summary { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 18px 0; font: 650 1.1875rem/1.3 var(--text); cursor: pointer; list-style: none; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: '+'; font: 400 1.5rem/1 var(--display); color: var(--mute); flex: none; }
.qa details[open] summary::after { content: '\2013'; color: var(--royal); }
.qa p { padding: 0 0 20px; max-width: 44em; color: var(--ink-2); }

.foot { border-top: 1px solid var(--line); padding: 34px 0 44px; font-size: var(--fs-1); color: var(--mute); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 14px 34px; align-items: baseline; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-left: auto; }
.foot a { color: var(--ink); font-weight: 600; }
.foot p { max-width: 40em; }

/* ---------- the account sheet */
dialog.sheet {
  width: min(100% - 24px, 500px); max-height: min(100dvh - 24px, 860px); padding: 0; border: 0; border-radius: 12px;
  background: var(--laid), var(--ground-hi); color: var(--ink); overflow: auto;
  box-shadow: 0 0 0 1.5px var(--ink), 0 30px 70px rgba(18, 26, 46, .42);
}
dialog.sheet::backdrop { background: rgba(18, 26, 46, .62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
dialog.sheet[open] { animation: rise .22s cubic-bezier(.2, .9, .3, 1.15); }
@keyframes rise { from { transform: translateY(14px) scale(.985); opacity: 0; } }
.sheet-in { padding: 26px 26px 28px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.sheet-head h2 { font: 400 2rem/1.1 var(--display); letter-spacing: -.015em; }
.x { background: none; border: 0; width: 40px; height: 40px; margin: -8px -10px 0 0; border-radius: 50%; font: 400 1.7rem/1 var(--text); color: var(--mute); }
.x:hover { background: var(--ground-lo); color: var(--ink); }
.sheet p { font-size: var(--fs-1); line-height: 1.5; }
/* the key: typed on a white card */
.keyline { margin: 4px 0 16px; padding: 15px 16px 14px; border: 1.5px solid var(--ink); border-radius: 6px; background: #fff; font: 400 1rem/1.45 var(--mono); word-break: break-all; user-select: all; }
/* the credit: written on a slip, with the well beside it */
.balance { margin: 6px 0 18px; padding: 16px 20px 14px; display: flex; align-items: center; gap: 18px; }
.balance b { font-size: 2.7rem; line-height: 1; font-weight: 400; }
.balance .vial { width: 30px; height: 36px; border-width: 2px; border-radius: 3px 3px 7px 7px; }
.balance .vial::before { top: -8px; left: 6px; right: 6px; height: 6px; }
.balance span { margin-left: auto; font: italic 400 var(--fs-0)/1.3 var(--mono); color: var(--mute); text-align: right; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row.spread { justify-content: space-between; }
.row.center { justify-content: center; }
.full { width: 100%; }
.gap-top { margin-top: 22px; }
.warn { margin: 20px 0 22px; padding-left: 14px; border-left: 3px solid var(--royal); }
.amounts { display: grid; grid-template-columns: repeat(4, 1fr) 1.25fr; gap: 9px; margin: 6px 0 18px; }
.amounts .key { padding: 0; min-height: 46px; }
.amounts .key[aria-pressed='true'] { --face: var(--ink); --edge: #000; --on: #fff; }
.amounts label { position: relative; display: block; }
.amounts label span { position: absolute; left: 13px; top: 50%; translate: 0 -50%; font-weight: 700; pointer-events: none; }
.amounts input { width: 100%; height: 46px; padding: 0 8px 0 27px; border: 1.5px solid var(--ink); border-radius: 7px; background: #fff; font: 650 var(--fs-2)/1 var(--text); }
.pay { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 18px; align-items: start; }
.qr { width: 148px; height: 148px; background: #fff; padding: 8px; border-radius: 6px; box-shadow: 0 0 0 1.5px var(--ink); }
.qr svg, .qr img { width: 100%; height: 100%; image-rendering: pixelated; }
.field { margin-bottom: 12px; }
.field > span { display: block; font: 600 var(--fs-0)/1.2 var(--text); color: var(--mute); margin-bottom: 5px; }
.field .val { display: flex; align-items: flex-start; gap: 8px; }
.field .val b { flex: 1; min-width: 0; font: 400 .8125rem/1.4 var(--mono); overflow-wrap: anywhere; }
.field .val b.amt { font: 700 1.3rem/1.1 var(--mono); letter-spacing: -.01em; }
.mini { background: var(--ink); color: #fff; border: 0; border-radius: 5px; padding: 7px 11px; font: 600 var(--fs-0)/1 var(--text); flex: none; box-shadow: 0 2px 0 #000; }
.mini:hover { background: var(--ink-2); }
.mini:active { transform: translateY(1px); box-shadow: 0 1px 0 #000; }
.mini.done { background: var(--good); }
.status { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 14px 16px; border-radius: 8px; background: var(--ground-lo); font-weight: 600; font-size: var(--fs-1); }
.status.seen { background: #dde4f8; }
.status.ok { background: var(--royal); color: #fff; }
/* waiting: three dots of ink, set down one after the other */
.wait { width: 26px; height: 8px; flex: none; background:
  radial-gradient(circle at 4px 4px, var(--royal) 3.2px, transparent 3.6px) 0 0 / 9px 8px repeat-x;
  animation: wait 1.5s steps(4) infinite; }
@keyframes wait { 0% { clip-path: inset(0 100% 0 0); } 25% { clip-path: inset(0 66% 0 0); } 50% { clip-path: inset(0 33% 0 0); } 75%, 100% { clip-path: inset(0 0 0 0); } }
.notes { margin-top: 16px; font-size: var(--fs-0); color: var(--mute); line-height: 1.5; }
.notes a { color: var(--ink); font-weight: 600; }
.payments { margin-top: 20px; border-top: 1.5px solid var(--ink); }
.payments li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-1); }
.payments li span:last-child { font-family: var(--mono); font-size: var(--fs-0); color: var(--mute); text-align: right; }
.sheet-foot { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: var(--fs-1); }
.sheet-foot .danger { color: var(--bad); }
.paste { display: flex; gap: 10px; margin-top: 12px; }
.paste input { flex: 1; min-width: 0; height: 48px; padding: 0 16px; border: 1.5px solid var(--ink); border-radius: 7px; background: #fff; font: 400 var(--fs-1)/1 var(--mono); }
.err { color: var(--bad); font-weight: 600; margin-top: 10px; font-size: var(--fs-1); }
.credited { text-align: center; padding: 6px 4px 4px; }
.credited .slip { padding: 18px 16px 20px; margin: 4px; }
.credited .slip small { display: block; font: italic 400 var(--fs-0)/1 var(--mono); color: var(--mute); margin-bottom: 10px; }
.credited .slip b { display: block; font-size: 3.6rem; line-height: 1.05; font-weight: 400; }
.credited p { margin: 20px 0 20px; font-size: var(--fs-2); }

.toast { position: fixed; left: 50%; bottom: 26px; translate: -50% 0; z-index: 90; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 8px; font-weight: 600; font-size: var(--fs-1); box-shadow: 0 12px 30px rgba(0, 0, 0, .3); animation: rise .2s ease-out; max-width: calc(100% - 32px); }

/* ---------- text pages */
.page { padding: clamp(30px, 6vw, 70px) 0 clamp(60px, 8vw, 110px); }
.page h1 { font: 400 clamp(2.5rem, 1.4rem + 3.8vw, 4.4rem)/1.04 var(--display); letter-spacing: -.02em; text-wrap: balance; }
.page h1 em { font-style: italic; color: var(--royal); }
.page .lead { margin-top: 20px; max-width: 36em; font-size: 1.25rem; line-height: 1.5; color: var(--ink-2); }
.prose { max-width: 44em; }
.prose h2 { font: 400 1.9rem/1.12 var(--display); letter-spacing: -.015em; margin: 52px 0 14px; }
.prose h3 { font: 700 1.1875rem/1.25 var(--text); margin: 30px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose ul { list-style: square; padding-left: 1.2em; }
.prose ul li::marker { color: var(--royal); }
.prose ol { list-style: decimal; padding-left: 1.3em; }
.prose li { margin-bottom: 6px; }
.prose code { font: 400 .88em var(--mono); background: var(--ground-lo); padding: .12em .38em; border-radius: 4px; }
.prose .code { margin: 16px 0 22px; }
.prose .code code { background: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 14px 0 22px; font-size: var(--fs-1); }
.prose th { text-align: left; font-weight: 700; border-bottom: 1.5px solid var(--ink); padding: 8px 12px 8px 0; }
.prose td { border-bottom: 1px solid var(--line); padding: 10px 12px 10px 0; vertical-align: top; }

/* ---------- small screens */
@media (max-width: 1100px) {
  .scene { --u: 13.5px; }
}
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero .scene { --u: clamp(8px, (100vw - 2 * var(--gutter)) / 37, 16px); margin: 18px auto 0; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav { position: fixed; inset: 76px 0 auto 0; z-index: 29; flex-direction: column; gap: 0; padding: 6px var(--gutter) 18px; background: var(--ground); border-bottom: 1px solid var(--line); box-shadow: 0 18px 30px rgba(18, 26, 46, .14); font-size: 1.25rem; display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav a[aria-current='page'] { border-bottom-color: var(--line); color: var(--royal); }
  .menu-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-left: auto; margin-right: -8px; background: none; border: 0; border-radius: 50%; }
  .menu-btn svg { width: 24px; height: 24px; }
  .top .wrap { gap: 12px; }
  .top-x { display: none; }
  .brand { font-size: 1.65rem; }
  .brand svg { width: 34px; height: 36px; }
  .credit .slip { min-width: 0; padding: 8px 10px 7px; gap: 8px; }
  .credit .amt-ink { font-size: 1.05rem; }
  .ledger { grid-template-columns: 1fr; gap: 34px; }
  .prices .ctx { display: none; }
  .pay { grid-template-columns: 1fr; }
  .qr { margin-inline: auto; }
  .amounts { grid-template-columns: repeat(4, 1fr); }
  .amounts label { grid-column: 1 / -1; }
  .sheet-in { padding: 22px 18px 24px; }
  .hero .acts .key.big { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* CA-Leiste (nur wenn COIN_CA gesetzt ist) */
.ca-bar { background: var(--leather); color: var(--blot); font-size: 13px; box-shadow: inset 0 -1px 0 var(--gilt); }
.ca-bar .wrap { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 12px; min-height: 38px; padding-block: 6px; }
.ca-t { font-family: var(--display); font-size: 17px; color: var(--blot); }
.ca-v { font-family: var(--mono); color: var(--ground-hi); overflow-wrap: anywhere; min-width: 0; }
.ca-copy, .ca-go { font: inherit; font-weight: 700; color: var(--ink); background: var(--ground-hi); border: 0; border-radius: 6px; padding: 4px 11px; cursor: pointer; text-decoration: none; }
.ca-go { background: var(--gilt); color: var(--leather-lo); }
