/* Fonts: the exact files the PDF embeds (served from @fontsource) */
@font-face { font-family: 'Instrument Sans'; font-weight: 400; font-display: swap;
  src: url(/fonts/sans/instrument-sans-latin-400-normal.woff2) format('woff2'), url(/fonts/sans/instrument-sans-latin-400-normal.woff) format('woff'); }
@font-face { font-family: 'Instrument Sans'; font-weight: 500; font-display: swap;
  src: url(/fonts/sans/instrument-sans-latin-500-normal.woff2) format('woff2'), url(/fonts/sans/instrument-sans-latin-500-normal.woff) format('woff'); }
@font-face { font-family: 'Instrument Sans'; font-weight: 600; font-display: swap;
  src: url(/fonts/sans/instrument-sans-latin-600-normal.woff2) format('woff2'), url(/fonts/sans/instrument-sans-latin-600-normal.woff) format('woff'); }
@font-face { font-family: 'Instrument Serif'; font-weight: 400; font-display: swap;
  src: url(/fonts/serif/instrument-serif-latin-400-normal.woff2) format('woff2'), url(/fonts/serif/instrument-serif-latin-400-normal.woff) format('woff'); }

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --sunken: #efede8;
  --ink: #1a1a19;
  --muted: #77756f;
  --faint: #a8a59d;
  --line: #e4e2dc;
  --line-strong: #d3d0c8;
  --accent: #1f5c45;
  --accent-soft: #e3ece7;
  --danger: #b3261e;

  --sans: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --radius: 6px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131312;
    --surface: #1b1b19;
    --sunken: #222220;
    --ink: #edece7;
    --muted: #9b988f;
    --faint: #6d6b65;
    --line: #2b2a27;
    --line-strong: #3a3935;
    --accent: #7cc3a2;
    --accent-soft: #1e2f27;
    --danger: #f08b82;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.5 var(--sans);
}

a { color: inherit; }
h1, h2 { margin: 0; font-weight: 400; }
h1 { font-family: var(--serif); font-size: 44px; line-height: 1.05; letter-spacing: -0.01em; }
h2 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.link { color: var(--accent); text-decoration: none; font-size: 13px; font-weight: 500; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1320px; margin: 0 auto; padding: 0 32px; height: 60px;
  display: flex; align-items: center; gap: 40px;
}
.wordmark { font-family: var(--serif); font-size: 24px; text-decoration: none; letter-spacing: -0.01em; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  text-decoration: none; color: var(--muted); font-weight: 500;
  padding: 6px 10px; border-radius: var(--radius);
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); background: var(--sunken); }

main { max-width: 1320px; margin: 0 auto; padding: 48px 32px 96px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border-radius: var(--radius); border: 1px solid transparent;
  font: 500 14px var(--sans); text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: color-mix(in srgb, var(--ink) 85%, var(--bg)); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--muted); }
.btn-text { background: none; color: var(--muted); padding: 0 8px; }
.btn-text:hover { color: var(--ink); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.danger { color: var(--danger) !important; }
.btn:focus-visible, .nav a:focus-visible, .segmented button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- form controls ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted); min-width: 0; }
input, select, textarea {
  font: 400 14px var(--sans); color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 8px 10px;
  width: 100%; min-width: 0;
  transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; line-height: 1.45; }
select {
  appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2377756f' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
input[type=number] { font-variant-numeric: tabular-nums; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; margin-top: 14px; }
.check input { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.span-2 { grid-column: span 2; }

/* ---------- page heads ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 32px; }

/* ---------- invoices list ---------- */
.summary {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
.summary > div { padding: 18px 20px 20px 0; }
.summary > div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.summary .k { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-bottom: 6px; }
.summary .v { font-family: var(--serif); font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.summary .s { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.search { max-width: 280px; height: 36px; }
.segmented { display: inline-flex; background: var(--sunken); border-radius: var(--radius); padding: 3px; gap: 2px; }
.segmented button {
  border: 0; background: none; font: 500 13px var(--sans); color: var(--muted);
  padding: 5px 12px; border-radius: 4px; cursor: pointer;
}
.segmented button:hover { color: var(--ink); }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; font-weight: 500; color: var(--muted);
  padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table th.num { text-align: right; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; transition: background-color .1s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--sunken) 55%, transparent); }
.table .strong { font-weight: 500; }
.table .row-actions { text-align: right; width: 1%; padding-top: 8px; padding-bottom: 8px; }
.row-actions .btn { opacity: 0; }
.table tbody tr:hover .row-actions .btn, .row-actions .btn:focus-visible { opacity: 1; }
@media (hover: none) { .row-actions .btn { opacity: 1; } }

.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--faint); box-sizing: border-box; }
.status.sent { color: var(--ink); }
.status.sent::before { border-color: var(--ink); }
.status.paid { color: var(--accent); }
.status.paid::before { background: var(--accent); border-color: var(--accent); }
.status.overdue { color: var(--danger); }
.status.overdue::before { background: var(--danger); border-color: var(--danger); }

.empty { padding: 64px 24px; text-align: center; }
.empty p + p { margin-top: 4px; }
.empty .btn { margin-top: 18px; }

/* ---------- editor ---------- */
.editor-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.back { display: inline-block; color: var(--muted); text-decoration: none; font-size: 13px; margin-bottom: 10px; }
.back:hover { color: var(--ink); }
.actions { display: flex; gap: 8px; align-items: center; }

.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: 48px; align-items: start; }
.editor-form { container-type: inline-size; }

.block { padding: 24px 0; border-top: 1px solid var(--line); }
.block:first-child { padding-top: 0; border-top: 0; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; min-height: 32px; }
.picker { width: auto; height: 32px; padding-top: 0; padding-bottom: 0; font-size: 13px; }

.from-summary {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; font-size: 13px; color: var(--muted); line-height: 1.55;
}
.from-summary strong { color: var(--ink); font-weight: 500; font-size: 14px; display: block; }
.from-summary.missing { border-style: dashed; background: none; }

.items-head, .item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 110px 110px 28px;
  gap: 8px; align-items: center;
}
.items-head { font-size: 12px; font-weight: 500; color: var(--muted); padding-bottom: 8px; }
.item + .item { margin-top: 8px; }
.item .amount { font-weight: 500; padding-right: 2px; }
.remove {
  border: 0; background: none; color: var(--faint); font-size: 18px; line-height: 1;
  width: 28px; height: 28px; border-radius: var(--radius); cursor: pointer;
}
.remove:hover { color: var(--danger); background: var(--sunken); }
#btn-add-item { margin: 10px 0 0 -8px; color: var(--accent); }

.adjustments {
  display: grid; grid-template-columns: 110px 140px 1fr; gap: 14px; align-items: end;
  margin-top: 20px; padding-top: 20px; border-top: 1px dashed var(--line);
}
.mini-totals { margin: 0; display: grid; grid-template-columns: auto auto; justify-content: end; column-gap: 24px; row-gap: 2px; font-size: 13px; }
.mini-totals dt { color: var(--muted); text-align: right; }
.mini-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.mini-totals .grand { font-weight: 600; color: var(--ink); font-size: 14px; }

@container (max-width: 600px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .items-head { display: none; }
  .item { grid-template-columns: 1fr 1fr minmax(80px, auto) 28px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .item [data-f=description] { grid-column: 1 / -1; }
  .adjustments { grid-template-columns: 1fr 1fr; }
  .mini-totals { grid-column: 1 / -1; }
}

/* ---------- paper preview (mirrors pdf.js; sizes in PDF points, A4 = 595pt wide) ---------- */
.preview-col { position: sticky; top: 92px; container-type: inline-size; }
.paper {
  --pt: calc(100cqw / 595);
  --p-ink: #1a1a19; --p-muted: #77756f; --p-line: #e4e2dc; --p-accent: #1f5c45;
  background: #fff; color: var(--p-ink);
  aspect-ratio: 595 / 842;
  padding: calc(48 * var(--pt)) calc(56 * var(--pt)) 0;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 12px 32px -8px rgba(40,35,20,.18);
  font-size: calc(9 * var(--pt)); line-height: 1.35;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.paper .serif { font-family: var(--serif); font-weight: 400; }
.p-label { font-size: calc(7 * var(--pt)); font-weight: 600; letter-spacing: calc(.9 * var(--pt)); text-transform: uppercase; color: var(--p-muted); }
.p-muted { color: var(--p-muted); }
.p-head { display: flex; justify-content: space-between; gap: calc(16 * var(--pt)); padding-bottom: calc(30 * var(--pt)); border-bottom: calc(.75 * var(--pt)) solid var(--p-line); }
.p-head > div:first-child { max-width: 60%; }
.p-from { font-size: calc(26 * var(--pt)); line-height: 1.15; }
.p-title { font-size: calc(34 * var(--pt)); line-height: 1.1; color: var(--p-accent); text-align: right; margin-top: calc(-4 * var(--pt)); }
.p-no { text-align: right; font-size: calc(9.5 * var(--pt)); }
.p-paid { text-align: right; margin-top: calc(5 * var(--pt)); color: var(--p-accent); font-size: calc(7.5 * var(--pt)); }
.p-meta { display: grid; grid-template-columns: 42% 18% 18% 22%; padding: calc(18 * var(--pt)) 0 calc(34 * var(--pt)); }
.p-meta .p-label { margin-bottom: calc(5 * var(--pt)); }
.p-meta .v { font-weight: 500; font-size: calc(10.5 * var(--pt)); }
.p-meta .bill { padding-right: calc(16 * var(--pt)); }
.p-meta .due { font-size: calc(22 * var(--pt)); line-height: 1; text-align: right; margin-top: calc(-3 * var(--pt)); }
.p-meta > div:last-child .p-label { text-align: right; }
.p-items { width: 100%; border-collapse: collapse; font-size: calc(9.5 * var(--pt)); }
.p-items th { padding-bottom: calc(5 * var(--pt)); border-bottom: calc(.75 * var(--pt)) solid var(--p-ink); text-align: right; }
.p-items td { padding: calc(9 * var(--pt)) 0 calc(9 * var(--pt)) calc(8 * var(--pt)); border-bottom: calc(.75 * var(--pt)) solid var(--p-line); text-align: right; vertical-align: top; }
.p-items th:first-child, .p-items td:first-child { text-align: left; padding-left: 0; width: 52%; white-space: pre-wrap; word-break: break-word; }
.p-items td:last-child { font-weight: 500; }
.p-totals { margin: calc(16 * var(--pt)) 0 0 auto; width: 42%; font-size: calc(9.5 * var(--pt)); }
.p-totals > div { display: flex; justify-content: space-between; height: calc(18 * var(--pt)); }
.p-totals > div span:first-child { color: var(--p-muted); }
.p-totals > div span:last-child { font-weight: 500; }
.p-totals .p-grand { height: auto; border-top: calc(.75 * var(--pt)) solid var(--p-ink); margin-top: calc(2 * var(--pt)); padding-top: calc(10 * var(--pt)); align-items: baseline; }
.p-totals .p-grand span:first-child { color: var(--p-ink); font-weight: 500; font-size: calc(10.5 * var(--pt)); }
.p-totals .p-grand span:last-child { font-family: var(--serif); font-weight: 400; font-size: calc(24 * var(--pt)); }
.p-blocks { display: grid; grid-template-columns: 1fr 1fr; gap: calc(32 * var(--pt)); margin-top: calc(24 * var(--pt)); padding-top: calc(18 * var(--pt)); border-top: calc(.75 * var(--pt)) solid var(--p-line); }
.p-blocks.single { grid-template-columns: 60%; }
.p-blocks .p-label { margin-bottom: calc(5 * var(--pt)); }
.p-blocks p { white-space: pre-wrap; line-height: 1.5; }
.p-footer { margin-top: auto; display: flex; justify-content: space-between; border-top: calc(.75 * var(--pt)) solid var(--p-line); padding: calc(10 * var(--pt)) 0 calc(34 * var(--pt)); color: var(--p-muted); font-size: calc(8 * var(--pt)); }
.pre { white-space: pre-line; }

/* ---------- online payment ---------- */
.tag { font-size: 11.5px; font-weight: 500; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 1px 8px; }
.pay-link { display: flex; gap: 8px; }
.pay-link input { color: var(--muted); font-size: 13px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.hint code { font-size: 12px; background: var(--sunken); padding: 1px 5px; border-radius: 4px; }
.paid-note { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 500; }
.paid-note a { margin-left: auto; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.stack .check { margin-top: 12px; }
.p-pay { margin-top: calc(24 * var(--pt)); padding-top: calc(18 * var(--pt)); border-top: calc(.75 * var(--pt)) solid var(--p-line); }
.p-pay .p-label { margin-bottom: calc(5 * var(--pt)); }
.p-pay a { color: var(--p-accent); font-weight: 500; text-decoration: underline; word-break: break-all; }

/* ---------- public pay page ---------- */
.pay-body { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.pay-card {
  width: min(480px, 100%); padding: 40px 36px 28px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px -12px rgba(40,35,20,.15);
}
.pay-card h1 { margin: 6px 0 16px; }
.pay-card .pay-amount { font-size: 52px; margin-bottom: 24px; font-variant-numeric: tabular-nums; }
.pay-form { display: flex; flex-direction: column; gap: 16px; }
.pay-element { min-height: 120px; }
.pay-loading { display: grid; place-items: center; height: 120px; color: var(--muted); font-size: 13px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.pay-error { color: var(--danger); font-size: 13px; margin: 0; }
.pay-btn:disabled { opacity: .55; cursor: not-allowed; }
.pay-from { font-weight: 500; color: var(--muted); }
.pay-meta { margin: 0 0 28px; border-top: 1px solid var(--line); }
.pay-meta div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.pay-meta dt { color: var(--muted); }
.pay-meta dd { margin: 0; font-weight: 500; }
.pay-btn { width: 100%; height: 44px; font-size: 15px; }
.pay-note { margin-top: 12px; font-size: 13px; text-align: center; color: var(--muted); }
.pay-status { padding: 12px 14px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); font-weight: 500; text-align: center; }
.pay-pdf { display: block; text-align: center; margin-top: 18px; }
.pay-foot { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); text-align: center; }

/* ---------- login ---------- */
.logout { margin: 0; }
.auth-body { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 400px); place-content: center; padding: 24px 16px; }
.auth-card {
  display: flex; flex-direction: column; gap: 16px;
  padding: 36px 32px 32px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px -12px rgba(40,35,20,.15);
}
.auth-mark { font-size: 22px; margin-bottom: 18px; }
.auth-card h1 { font-size: 40px; }
.auth-sub { margin-top: -10px; margin-bottom: 4px; font-size: 13.5px; }
.auth-btn { height: 42px; margin-top: 6px; font-size: 15px; }
.auth-btn:disabled { opacity: .5; cursor: not-allowed; }
.auth-error { margin: 0; padding: 10px 12px; border-radius: var(--radius); font-size: 13px;
  color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, transparent); }
.auth-error code { font-size: 12px; }

/* ---------- landing ---------- */
.landing-body { min-height: 100vh; }
.landing {
  min-height: 100vh; max-width: 1320px; margin: 0 auto; padding: 32px;
  display: grid; grid-template-rows: 1fr auto;
}
.landing-hero { align-self: center; padding: 64px 0; }
.landing-hero h1 {
  font-size: clamp(64px, 13vw, 184px); line-height: .92; letter-spacing: -0.025em;
  max-width: 12ch; text-wrap: balance;
}
.landing-cta { margin-top: 40px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px;
  font-size: 15px; color: var(--muted); }
.landing-cta a {
  font-family: var(--serif); font-size: clamp(26px, 3.4vw, 40px); color: var(--ink);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px;
  text-decoration-color: var(--line-strong); transition: text-decoration-color .15s, color .15s;
}
.landing-cta a:hover { color: var(--accent); text-decoration-color: currentColor; }
.landing-foot { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }

/* ---------- settings ---------- */
.settings { max-width: 880px; }
.settings-row { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; padding: 28px 0; border-top: 1px solid var(--line); }
.settings-row:first-child { border-top-color: var(--ink); }
.settings-intro p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.settings-actions { display: flex; justify-content: flex-end; padding-top: 24px; border-top: 1px solid var(--line); }

/* ---------- dialog ---------- */
.dialog {
  border: 1px solid var(--line); border-radius: 10px; padding: 0;
  background: var(--surface); color: var(--ink);
  width: min(520px, calc(100vw - 32px));
  box-shadow: 0 24px 64px -12px rgba(0,0,0,.3);
}
.dialog::backdrop { background: rgba(20, 18, 12, .35); }
.dialog form { padding: 24px; }
.dialog h2 { font-family: var(--serif); font-size: 28px; font-weight: 400; margin-bottom: 20px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  z-index: 100; animation: toast-in .18s ease-out;
}
.toast.error { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 6px); } }

/* ---------- responsive ---------- */
.mobile-only { display: none; }
@media (max-width: 1080px) {
  .editor-grid { grid-template-columns: 1fr; }
  .preview-col { position: static; max-width: 620px; }
}
@media (max-width: 720px) {
  .landing { padding: 20px 16px; }
  .auth-card { padding: 28px 20px 24px; }
  .pay-card { padding: 28px 20px 20px; }
  .pay-card .pay-amount { font-size: 44px; }
  main { padding: 28px 16px 64px; }
  .topbar-inner { padding: 0 16px; gap: 16px; }
  .nav a { padding: 6px 6px; }
  .topbar-inner > .btn { display: none; }
  .mobile-only { display: inline-flex; }
  h1 { font-size: 36px; }
  .summary { grid-template-columns: 1fr; }
  .summary > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .settings-row { grid-template-columns: 1fr; gap: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .search { max-width: none; }
  .editor-head .actions { width: 100%; }
  .editor-head .actions .btn-primary { margin-left: auto; }
}
