/* Mobile first: big tap targets, system fonts, nothing to download. */
:root {
  --ink: #1b1f24;
  --muted: #5b6470;
  --bg: #ffffff;
  --line: #d5dae0;
  --accent: #0b6e4f;
  --accent-ink: #ffffff;
  --error: #b42318;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef1f4;
    --muted: #a3acb7;
    --bg: #14171a;
    --line: #333a42;
    --accent: #3fbf8f;
    --accent-ink: #0b1a14;
    --error: #ff8a80;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main { max-width: 32rem; margin: 0 auto; padding: 0 16px 32px; }

.top, .bottom { max-width: 32rem; margin: 0 auto; padding: 16px; }
.brand { font-weight: 700; color: var(--accent); text-decoration: none; }
.bottom { color: var(--muted); }

h1 { font-size: 1.6rem; line-height: 1.2; margin: 8px 0 12px; }

a { color: var(--accent); }

.stack { display: flex; flex-direction: column; gap: 12px; }

fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px 16px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
legend { font-weight: 700; padding: 0 4px; }

label { font-weight: 600; }

input[type="text"], input:not([type]), input[type="tel"] {
  font: inherit;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
}

input.short { width: 4.5rem; text-align: center; text-transform: uppercase; }

.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 500;
}

.choice input { width: 22px; height: 22px; flex: none; }
.choice-text { display: flex; flex-direction: column; }
.fee { color: var(--muted); font-size: 0.9rem; font-weight: 400; }

button.big, a.button.big {
  display: block;
  width: 100%;
  min-height: 56px;
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-ink);
  text-align: center;
  text-decoration: none;
  padding: 14px;
}

.muted { color: var(--muted); font-size: 0.95rem; }
.error { color: var(--error); font-weight: 600; }
.big-text { font-size: 1.3rem; font-weight: 600; }
.secondary { margin-top: 24px; }

/* Demo and payee preview */
.demo-banner { background: #fff4ce; color: #4a3b00; padding: 8px 16px; font-size: 0.95rem; text-align: center; }
.demo-banner a { color: inherit; font-weight: 700; }
@media (prefers-color-scheme: dark) { .demo-banner { background: #3d3200; color: #ffe9a3; } }
.demo-links { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 8px; }
.demo-links ul { padding-left: 20px; }

h2 { font-size: 1.15rem; margin: 24px 0 8px; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.tile-label { color: var(--muted); font-size: 0.85rem; }
.tile-value { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }

table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.amount { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger { display: block; overflow-x: auto; }
.lines tfoot th { font-size: 1.1rem; border-bottom: 0; }

.checkout { display: flex; flex-direction: column; gap: 12px; }
button.secondary-button { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.link-button { background: none; border: 0; padding: 0 0 0 6px; color: var(--accent); font: inherit; font-size: 0.85rem; text-decoration: underline; cursor: pointer; }
details summary { cursor: pointer; }

/* Public pages */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.top-links { display: flex; gap: 16px; font-size: 0.95rem; }
.top-links a { color: var(--muted); text-decoration: none; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 8px; }
.footer-links a { color: var(--muted); }

.prose { line-height: 1.6; }
.prose h2 { margin-top: 28px; }
.prose h3 { font-size: 1rem; margin: 20px 0 6px; }
.prose ol, .prose ul { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose table { margin: 8px 0 12px; }
.lead { font-size: 1.1rem; }
.legal { font-size: 0.97rem; }
.draft-notice { background: #fff4ce; color: #4a3b00; border-radius: 10px; padding: 10px 12px; font-weight: 600; }
@media (prefers-color-scheme: dark) { .draft-notice { background: #3d3200; color: #ffe9a3; } }
.contact dt { font-weight: 700; margin-top: 10px; }
.contact dd { margin: 2px 0 0; }
code { font-size: 0.9em; }

/* Payee area */
.notice { background: color-mix(in srgb, var(--accent) 15%, transparent); border-radius: 10px; padding: 10px 12px; font-weight: 600; }
.house-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.house-list a { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
.small-link { font-size: 0.85rem; margin-left: 6px; }
.inline-form { display: inline; }
.fine-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.fine-row input:not([type]) { flex: 1 1 10rem; width: auto; }
.fine-row input.short { flex: 0 0 6rem; }
label.inline { display: flex; align-items: center; gap: 6px; font-weight: 500; }
button.small { font: inherit; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--accent); background: transparent; color: var(--accent); }
select { font: inherit; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
input.short { width: 6rem; }
.add-fine { margin-top: 16px; }

.onboarding { min-height: 320px; margin-top: 12px; }
