
:root {
  --ground: #f5f5f7;
  --card: #ffffff;
  --ink: #1d1d1f;
  --body: #424245;
  --pencil: #6e6e73;
  --rule: #e5e5ea;
  --rule-soft: #f0f0f2;
  --field: #d2d2d7;
  --accent: #0066cc;
  --accent-hover: #0058b0;
  --quiet: #e8e8ed;
  --quiet-hover: #dcdce1;
  --focus: #80b3e6;
  --green: #1a6b32;
  --green-wash: #e6f4ea;
  --amber: #9a4500;
  --amber-ink: #b25000;
  --amber-wash: #fff1e0;
  --red: #b3261e;
  --red-wash: #fdecec;
  --blue-wash: #e8f0fb;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
/* Dark colors when the device asks for them, unless he chose Light on More; always when he chose Dark. */
:root { color-scheme: light dark; }
:root.light { color-scheme: light; }
:root.dark { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    --ground: #000000;
    --card: #1c1c1e;
    --ink: #f5f5f7;
    --body: #d1d1d6;
    --pencil: #a1a1a6;
    --rule: #38383a;
    --rule-soft: #2c2c2e;
    --field: #48484a;
    --accent: #2997ff;
    --accent-hover: #4aa8ff;
    --button: #0a6fd6;
    --button-hover: #0862bf;
    --quiet: #2c2c2e;
    --quiet-hover: #3a3a3c;
    --focus: #1f6fbf;
    --green: #6fd08c;
    --green-wash: #13301c;
    --amber: #ffb35c;
    --amber-ink: #ffb35c;
    --amber-wash: #3a2610;
    --red: #ff8a80;
    --red-wash: #3a1614;
    --blue-wash: #10263f;
  }
}
:root.dark {
  --ground: #000000;
  --card: #1c1c1e;
  --ink: #f5f5f7;
  --body: #d1d1d6;
  --pencil: #a1a1a6;
  --rule: #38383a;
  --rule-soft: #2c2c2e;
  --field: #48484a;
  --accent: #2997ff;
  --accent-hover: #4aa8ff;
  --button: #0a6fd6;
  --button-hover: #0862bf;
  --quiet: #2c2c2e;
  --quiet-hover: #3a3a3c;
  --focus: #1f6fbf;
  --green: #6fd08c;
  --green-wash: #13301c;
  --amber: #ffb35c;
  --amber-ink: #ffb35c;
  --amber-wash: #3a2610;
  --red: #ff8a80;
  --red-wash: #3a1614;
  --blue-wash: #10263f;
}
* { box-sizing: border-box; }
html { background: var(--ground); color: var(--ink); font: 16px/1.5 var(--font); -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
body { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 0.2em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

/* The bar along the top. */
.masthead { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; padding: 0.9rem max(1.25rem, calc((100% - 65rem) / 2)); background: color-mix(in srgb, var(--card) 88%, transparent); border-bottom: 1px solid var(--rule); backdrop-filter: saturate(180%) blur(20px); }
.masthead .name { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; font-size: 1.0625rem; color: var(--ink); text-decoration: none; margin-right: auto; }
.masthead .mark { width: 2rem; height: 2rem; border-radius: 0.55rem; background: var(--ink); color: var(--card); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9375rem; }
.masthead nav { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.masthead nav a { color: var(--body); font-size: 0.875rem; font-weight: 500; padding: 0.45rem 1rem; border-radius: 980px; text-decoration: none; }
.masthead nav a:hover { background: var(--quiet); color: var(--ink); }
.masthead nav a[aria-current="page"] { background: var(--ink); color: var(--card); }
.demo-note { margin: 0; padding: 0.5rem max(1.25rem, calc((100% - 65rem) / 2)); font-size: 0.8125rem; color: var(--pencil); background: var(--rule-soft); }

main { max-width: 65rem; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
footer { max-width: 65rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; color: var(--pencil); font-size: 0.8125rem; }

h1 { font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.125rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 0.5rem; }
h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.0625rem; font-weight: 600; margin: 2rem 0 0.5rem; }
h1 + .hint, h2 + .hint { margin-top: 0; }
.hint, .lead { color: var(--pencil); max-width: 44em; margin: 0 0 1rem; }
.lead { font-size: 1.0625rem; }
.hint.after { margin-top: 0.75rem; }
.what { color: var(--pencil); display: block; font-size: 0.875rem; }
.late, .hold { color: var(--amber-ink); font-weight: 600; }
.settled { color: var(--green); }
.problem { background: var(--red-wash); color: var(--red); border-radius: 14px; padding: 1rem 1.25rem; max-width: 44em; margin: 0 0 1rem; }

/* Cards: the basic surface. */
.card, .sum, .message, form.entry, .ask, .asks li, .warning, .ledger-wrap, .empty, .facts, .start-note, .paper-wrap { background: var(--card); border-radius: 20px; }
.card { padding: 1.5rem 1.75rem; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }

/* Buttons and fields. */
button, .button { font: inherit; font-size: 0.9375rem; font-weight: 500; min-height: 2.75rem; padding: 0 1.25rem; border: 0; border-radius: 980px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; white-space: nowrap; background: var(--button, var(--accent)); color: #ffffff; text-decoration: none; }
button:hover, .button:hover { background: var(--button-hover, var(--accent-hover)); color: #ffffff; text-decoration: none; }
button.quiet, .button.quiet { background: var(--quiet); color: var(--ink); }
button.quiet:hover, .button.quiet:hover { background: var(--quiet-hover); color: var(--ink); }
button.link { background: none; color: var(--accent); padding: 0 0.5rem; }
button.link:hover { background: none; color: var(--accent-hover); text-decoration: underline; }
label { display: grid; gap: 0.35rem; font-size: 0.875rem; font-weight: 500; color: var(--ink); }
input, select, textarea { font: inherit; font-size: 1rem; color: var(--ink); background: var(--card); border: 1px solid var(--field); border-radius: 12px; padding: 0 0.85rem; min-height: 3rem; width: 100%; min-width: 0; font-variant-numeric: tabular-nums; }
textarea { padding: 0.75rem 0.85rem; line-height: 1.5; resize: vertical; }
textarea.mono, .message pre { font: 0.8125rem/1.55 var(--mono); }
textarea[readonly] { color: var(--pencil); background: var(--rule-soft); }
input[type="checkbox"], input[type="radio"] { width: 1.25rem; min-height: 0; height: 1.25rem; accent-color: var(--accent); margin: 0; }
form.entry { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem; align-items: end; max-width: 52em; margin: 0.75rem 0 0; padding: 1.5rem 1.75rem; }
form.entry .wide { grid-column: span 2; }
form.entry .full { grid-column: 1 / -1; }
form.entry .more-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem; align-items: end; }
.back { margin: 0 0 0.25rem; }
.back a { display: inline-block; padding: 0.5rem 0; color: var(--accent); text-decoration: none; font-size: 1rem; }
form.entry .buttons, .buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.ask-box .buttons { margin-top: 1rem; }
form.inline { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: end; }
form.inline label { width: 9rem; }
form.inline.paid { margin-top: 0.75rem; }
form.inline button, form.inline input, form.inline select { min-height: 2.5rem; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.kinds { display: grid; gap: 0.5rem; }
fieldset legend { font-size: 0.875rem; font-weight: 500; padding: 0; margin-bottom: 0.5rem; }
label.choice { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400; font-size: 0.9375rem; }
label.choice input { margin-top: 0.15rem; flex-shrink: 0; }

/* Tables: quiet rows on a card. */
.ledger-wrap { overflow-x: auto; margin: 0.75rem 0 0; padding: 0.5rem 0; }
table.ledger { border-collapse: collapse; width: 100%; min-width: 40rem; font-size: 0.9375rem; }
.ledger th { text-align: left; font-weight: 500; font-size: 0.8125rem; color: var(--pencil); padding: 0.6rem 1rem; white-space: nowrap; }
.ledger th:first-child, .ledger td:first-child { padding-left: 1.75rem; }
.ledger th:last-child, .ledger td:last-child { padding-right: 1.75rem; }
.ledger td { padding: 0.85rem 1rem; vertical-align: top; border-top: 1px solid var(--rule-soft); }
.ledger .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger .ccy { color: var(--pencil); padding-right: 0; width: 1%; font-size: 0.8125rem; }
.ledger .ccy + .num { padding-left: 0.4rem; }
.ledger .nowrap { white-space: nowrap; }
.ledger tfoot td { font-weight: 600; }
table.ledger.stands { min-width: 0; max-width: 36rem; }
.empty { padding: 1.25rem 1.75rem; color: var(--pencil); margin: 0.75rem 0 0; }

/* Facts about one record. */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 2rem; margin: 1.25rem 0; padding: 1.5rem 1.75rem; max-width: 44em; }
.facts dt { color: var(--pencil); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }

/* Warnings, now quiet cards with a coloured dot. */
.warnings { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.75rem; }
.warning { padding: 1.1rem 1.5rem; max-width: 52em; }
.warning .kind { font-weight: 600; display: block; }
.warning .kind::before { content: ""; display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--red); margin-right: 0.5rem; vertical-align: 0.05em; }
.warning.medium .kind::before { background: var(--amber-ink); }
.warning.resolved { color: var(--pencil); }
.warning.resolved .kind::before { background: var(--field); }
.warning .number { font-weight: 400; color: var(--pencil); }
.warning .quoted { display: block; margin-top: 0.5rem; font-size: 0.875rem; color: var(--pencil); }
.warning .where, td .where { display: block; margin-top: 0.35rem; font-size: 0.875rem; }

/* The amount check, set out as a sum. */
.sum { margin: 0.75rem 0 0; padding: 1.5rem 1.75rem; max-width: 44em; }
.sum .verdict { font-weight: 600; font-size: 1.0625rem; margin: 0 0 1rem; }
.sum table { border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sum td { padding: 0.2rem 0; vertical-align: baseline; }
.sum td.label { padding-right: 1.5rem; }
.sum td.ccy { color: var(--pencil); font-size: 0.8125rem; padding-right: 0.4rem; }
.sum td.num { text-align: right; white-space: nowrap; }
.sum tr.result td { border-top: 1px solid var(--rule); font-weight: 600; padding-top: 0.45rem; }
.sum .source { margin: 1rem 0 0; font-size: 0.8125rem; color: var(--pencil); overflow-wrap: anywhere; }
.sum .rests { margin: 0.6rem 0 0; padding-left: 1.1rem; font-size: 0.875rem; color: var(--pencil); }

.history { list-style: none; margin: 0.75rem 0 0; padding: 0; max-width: 52em; }
.history li { padding: 0.35rem 0; border-top: 1px solid var(--rule); }
.card-what { min-width: 0; overflow-wrap: anywhere; }
.history time { color: var(--pencil); font-variant-numeric: tabular-nums; margin-right: 0.75rem; }

.message { margin: 0.75rem 0 0; max-width: 52em; overflow: hidden; }
.message .said { padding: 1.1rem 1.5rem; margin: 0; }
.message .said b { font-weight: 600; }
.message .said .what { margin-top: 0.35rem; }
.message details { border-top: 1px solid var(--rule-soft); }
.message summary { padding: 0.75rem 1.5rem; cursor: pointer; color: var(--accent); font-size: 0.9375rem; }
.message pre { margin: 0; padding: 0 1.5rem 1.25rem; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--body); }
.message form.entry { border-radius: 0; border-top: 1px solid var(--rule-soft); margin: 0; max-width: none; }
.message .pad { padding: 0 1.5rem 1.1rem; margin: 0; display: block; color: var(--pencil); font-size: 0.875rem; }

.questions { margin: 0.75rem 0 0; padding-left: 1.5rem; max-width: 48em; }
.questions li { padding: 0.35rem 0; }
ul.plain, ol.steps { max-width: 44em; padding-left: 1.4rem; }
ul.plain li, ol.steps li { margin: 0 0 0.5rem; }

/* A question the helper asks (pay them now?). */
.ask { padding: 1.5rem 1.75rem; max-width: 52em; margin: 1.5rem 0 0; }
.ask .asking { font-weight: 600; font-size: 1.0625rem; margin: 0 0 1rem; }
.asking { overflow-wrap: anywhere; }
.ask .what { margin: 1rem 0 0; }
.ask.waiting .what { margin: 0 0 1rem; }
.asks { margin: 0.75rem 0 0; padding: 0; list-style: none; max-width: 52em; display: grid; gap: 0.75rem; }
.asks li { padding: 1.1rem 1.5rem; }
.start-note { margin: 1.5rem 0 0; padding: 1rem 1.5rem; max-width: 44em; }
.position { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 0.5rem; max-width: 26em; }
.position .fig { font-variant-numeric: tabular-nums; white-space: nowrap; }
.as-of { color: var(--pencil); margin: 0 0 2rem; }

/* Home. */
.welcome { display: flex; flex-wrap: wrap; gap: 1.5rem 2rem; align-items: flex-start; margin-bottom: 2rem; }
.welcome > div { flex: 1 1 30rem; }
.welcome h2 { margin: 0 0 1rem; font-size: 1.375rem; }
.three { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.5rem; }
.three b { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.three span { color: var(--pencil); font-size: 0.9375rem; }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.total { background: var(--card); border-radius: 20px; padding: 1.5rem 1.75rem; display: grid; gap: 0.25rem; align-content: start; }
.total .label { color: var(--pencil); font-size: 0.875rem; }
.total .big { font-size: 2.125rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.total .big small { font-size: 0.5em; font-weight: 500; color: var(--pencil); letter-spacing: 0; margin-right: 0.3rem; }
.total .big.alert { color: var(--amber-ink); }
.total .note { color: var(--pencil); font-size: 0.875rem; }
.needs { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.need { background: var(--card); border-radius: 20px; padding: 1.25rem 1.75rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.need .icon { width: 2.5rem; height: 2.5rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 700; background: var(--amber-wash); color: var(--amber-ink); }
.need .icon.danger { background: var(--red-wash); color: var(--red); }
.need .icon.info { background: var(--blue-wash); color: var(--accent); }
.need .text { flex: 1 1 18rem; display: grid; gap: 0.2rem; }
.need .text b { font-weight: 600; }
.need .text span { color: var(--pencil); font-size: 0.9375rem; }
.need form { margin: 0; }
.done-note { background: var(--card); border-radius: 20px; padding: 1.1rem 1.75rem; color: var(--green); }
/* Home's box comes first in the page (design pass item 1); on a wide screen the numbers still sit above it. */
.home-top { display: flex; flex-direction: column; gap: 1rem; }
@media (min-width: 40.0625rem) { .home-top > .totals { order: -1; } .home-top > .ask-box { margin-top: 1rem; } }
/* Day one: three steps, each ticked once done. */
.welcome-steps { margin-bottom: 1.5rem; }
.welcome-steps h1 { margin-bottom: 1rem; }
.welcome-steps .need.later .text span { color: var(--pencil); opacity: 0.7; }
.welcome-steps .need.done .text span { color: var(--pencil); }
.welcome-steps .icon:not(.info) { background: var(--quiet); color: var(--pencil); }
.button[aria-disabled="true"] { opacity: 0.55; cursor: default; pointer-events: none; }
/* The read page's main button (design pass item 5): with "Something else" chosen it reads "File it" and files. CSS only, no script. */
form .main-file { display: none; }
form:has(input[name="kind"][value="other"]:checked) .main-check { display: none; }
form:has(input[name="kind"][value="other"]:checked) .main-file { display: inline-flex; }
/* A problem said beside its own field (design pass item 3). */
.field-problem { display: block; color: var(--red); font-size: 0.875rem; font-weight: 500; margin-top: 0.25rem; }
.problems { margin: 0 0 1rem; padding-left: 1.25rem; color: var(--red); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 2.5rem 0 0.75rem; }
.section-head h2 { margin: 0; }
.rows { background: var(--card); border-radius: 20px; padding: 0.5rem 0; list-style: none; margin: 0; }
.rows li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 0.9rem 1.75rem; border-top: 1px solid var(--rule-soft); }
.rows li:first-child { border-top: 0; }
.rows .who { flex: 1 1 12rem; font-weight: 500; }
.rows .who a { color: var(--ink); }
.rows .who .what { font-weight: 400; }
.rows .who .what a { color: var(--accent); }
.rows .amount { font-variant-numeric: tabular-nums; text-align: right; min-width: 8rem; }
.pill { display: inline-block; font-size: 0.8125rem; font-weight: 500; border-radius: 980px; padding: 0.2rem 0.75rem; white-space: nowrap; background: var(--rule-soft); color: var(--body); }
.pill.paid { background: var(--green-wash); color: var(--green); }
.pill.warn { background: var(--amber-wash); color: var(--amber); }
.pill.sent { background: var(--blue-wash); color: var(--accent); }
.drop { display: grid; gap: 1rem; }
.drop textarea { min-height: 8rem; }

/* The invoice creator and the invoice itself. */
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr)); gap: 2rem; align-items: start; }
.lines { display: grid; grid-template-columns: 1fr 9rem; gap: 0.5rem 0.75rem; }
.lines .head { font-size: 0.875rem; font-weight: 500; }
.paper-wrap { padding: 2.5rem; display: grid; gap: 1.75rem; color: #1d1d1f; background: #ffffff; box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.06); border-radius: 12px; }
.paper-top { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.paper-top b { font-size: 1.0625rem; }
.paper-top .word { font-size: 1.5rem; font-weight: 600; text-align: right; }
.paper-small { font-size: 0.8125rem; color: #6e6e73; white-space: pre-line; }
.paper-label { font-size: 0.75rem; color: #6e6e73; text-transform: uppercase; letter-spacing: 0.06em; }
.paper-lines { border-top: 1px solid #e5e5ea; border-bottom: 1px solid #e5e5ea; padding: 0.75rem 0; display: grid; gap: 0.5rem; }
.paper-line { display: flex; justify-content: space-between; gap: 1rem; font-variant-numeric: tabular-nums; }
.paper-total { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 1rem; }
.paper-total .big { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.paper-pay { background: #f5f5f7; border-radius: 10px; padding: 1rem 1.1rem; font-size: 0.8125rem; color: #424245; white-space: pre-line; }
.paper-pay b { display: block; color: #1d1d1f; margin-bottom: 0.25rem; }
.ready-icon { width: 3.5rem; height: 3.5rem; border-radius: 50%; background: var(--green-wash); color: var(--green); display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 700; }
.more-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; list-style: none; margin: 0; padding: 0; }
.more-list a { display: grid; gap: 0.25rem; background: var(--card); border-radius: 20px; padding: 1.25rem 1.5rem; color: var(--ink); height: 100%; }
.more-list a:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--accent) inset; }
.more-list a span { color: var(--pencil); font-size: 0.9375rem; }

.section-head.top { margin-top: 0; }
.rows.flush { padding: 0; background: none; border-radius: 0; }
.rows.flush li { padding: 0.75rem 0; }
.amount-field { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; color: var(--pencil); }
.amount-field input { width: 8.5rem; text-align: right; }
.split.tight { gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.stack.roomy { gap: 1.25rem; }
.what.inline { display: inline; }
.steps.flush { margin: 0; }
.grow { flex: 1 1 10rem; }
details summary { cursor: pointer; color: var(--accent); }
details[open] summary { margin-bottom: 0.25rem; }
/* Phone sweep, 30 November 2026: gaps where things touched, and taps of at least 44px. */
details:not(.message details) { margin-top: 0.75rem; }
details:not(.message details) > summary { padding: 0.6rem 0; }
.message > form.buttons { padding: 0 1.5rem 0.75rem; }
.rows .who .buttons { margin: 0.6rem 0 0.25rem; }
main > .card + .card, main > section.card + section.card { margin-top: 1rem; }
.needs + .hint { margin-top: 0.75rem; }
.needs + .hint a { display: inline-block; padding: 0.6rem 0; }
.card-what > h2:first-child { margin-top: 0; }
form.entry .ask { padding: 0; margin: 0.75rem 0 0; }
.ask-box p.what { margin: 0.75rem 0 0; }
form.card.buttons { align-items: flex-end; }
.warning .where a { display: inline-block; padding: 0.6rem 0; }
.warning .where { margin-top: 0; }
.back a { padding: 0.65rem 0; }
fieldset.kinds { gap: 0; }
label.choice { padding: 0.6rem 0; }

main.signin { max-width: 26rem; margin: 4rem auto; padding: 0 1rem; }
main.signin form.entry { grid-template-columns: 1fr; }
/* Read by password managers, not shown: Safari ignores hidden and display:none boxes (finding 297). */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
ul.passkeys { list-style: none; padding: 0; display: grid; gap: .6rem; }
ul.passkeys li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: var(--card); border-radius: 14px; padding: .8rem 1.1rem; }
ul.passkeys li > span { display: grid; gap: .2rem; }
/* Where to pay someone (docs/PAYEE-DETAILS-PLAN.md): one line each, the number grouped, monospace and selected in one tap. */
.payee-account { display: grid; gap: 0.15rem; margin: 0.5rem 0; }
.payee-account .what { margin: 0; }
code.acct { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1rem; letter-spacing: 0.02em; user-select: all; -webkit-user-select: all; overflow-wrap: anywhere; }
.changed { display: block; margin: 0.35rem 0; font-weight: 500; }
/* The first-payment checks on Pay people: one column, so the form does not size the card past a phone (W3). */
.checks form.entry { grid-template-columns: 1fr; padding: 1rem 0 0; max-width: 32rem; }
.checks .full { grid-column: auto; }
.checks > *, .checks form.entry > * { min-width: 0; }
.checks button { white-space: normal; text-align: left; }

@media (max-width: 40rem) {
  form.entry .wide { grid-column: auto; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 0.6rem; }
  .lines { grid-template-columns: 1fr 6.5rem; }
  .paper-wrap { padding: 1.5rem; }
  .masthead nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  /* A table marked "cards" becomes one labelled card per row on a phone, so nothing is cut off (first-day walk W4). */
  table.ledger.cards { min-width: 0; }
  table.ledger.cards thead { display: none; }
  table.ledger.cards tr { display: block; padding: 0.9rem 1.25rem; border-top: 1px solid var(--rule-soft); }
  table.ledger.cards td { display: block; border: 0; padding: 0.2rem 0; text-align: left; white-space: normal; }
  table.ledger.cards td:first-child, table.ledger.cards td:last-child { padding-left: 0; padding-right: 0; }
  table.ledger.cards td[data-label]::before { content: attr(data-label); display: block; font-size: 0.75rem; color: var(--pencil); margin-top: 0.35rem; }
  table.ledger.cards td:first-child::before { display: none; }
  table.ledger.cards td:first-child { font-weight: 600; }
  table.ledger.cards td.ccy, table.ledger.cards td.ccy + td.num { display: inline; font-size: 1rem; }
  table.ledger.cards td.ccy { margin-right: 0.3rem; }
  table.ledger.cards td:empty { display: none; }
  /* Home's three numbers as one card of three short rows (design pass item 1). */
  .totals { display: block; background: var(--card); border-radius: 20px; padding: 0.35rem 1.25rem; }
  .total { background: none; border-radius: 0; padding: 0.6rem 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0.45rem; border-top: 1px solid var(--rule-soft); }
  .total:first-child { border-top: 0; }
  .total .label { flex: 0 0 100%; font-size: 0.8125rem; }
  .welcome-steps .need { flex-wrap: nowrap; align-items: flex-start; padding: 1rem 1.25rem; gap: 0.75rem; }
  .welcome-steps .need .text { flex: 1 1 auto; display: grid; gap: 0.6rem; }
  .welcome-steps .need { display: grid; grid-template-columns: 2.5rem 1fr; }
  .welcome-steps .need > a, .welcome-steps .need > span.button { grid-column: 2; justify-self: start; }
  .total .big { font-size: 1.0625rem; letter-spacing: 0; }
  .total .big small { font-size: 0.8125rem; margin-right: 0.2rem; }
  .total .big + .big::before { content: "· "; color: var(--pencil); font-weight: 400; }
  .total .note { font-size: 0.8125rem; }
  .total .note.aside { display: none; }
  .masthead { position: static; }
  .masthead nav a { padding: 0.7rem 1rem; }
  .card { padding: 1.25rem; }
  .rows .amount { text-align: left; min-width: 0; }
  form.inline label { flex: 1 1 9rem; width: auto; }
  form.inline button, form.inline input, form.inline select { min-height: 2.75rem; }
  table.ledger.cards tbody tr:first-child { border-top: 0; }
}
