/* Five Loaves. Big type and big targets for users in their 80s. Modern layout, her words. */
:root {
  --bg: #F2F3F5;
  --paper: #FFFFFF;
  --ink: #1F2635;
  --muted: #5A6272;
  --line: #D2D6DD;
  --navy: #36435D;
  --on-navy: #FFFFFF;
  --gold: #F4C452;
  --soft: #E9ECF1;
  --ok: #1F7A4A;
  --ok-soft: #E1F3E8;
  --warn: #9A5B00;
  --warn-soft: #FDF0D8;
  --bad: #B3261E;
  --bad-soft: #FBE4E2;
  --in: #1F7A4A;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10141D; --paper: #1A2130; --ink: #EEF2FA; --muted: #A3AEC4; --line: #323C52;
    --navy: #A9B6CF; --on-navy: #121722; --soft: #262D3B;
    --ok: #5CC98C; --ok-soft: #173326; --warn: #F2B357; --warn-soft: #3A2B12;
    --bad: #F2A39C; --bad-soft: #3A1A18; --in: #5CC98C;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10141D; --paper: #1A2130; --ink: #EEF2FA; --muted: #A3AEC4; --line: #323C52;
  --navy: #A9B6CF; --on-navy: #121722; --soft: #262D3B;
  --ok: #5CC98C; --ok-soft: #173326; --warn: #F2B357; --warn-soft: #3A2B12;
  --bad: #F2A39C; --bad-soft: #3A1A18; --in: #5CC98C;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 19px;
  line-height: 1.5;
  min-height: 100dvh;
}
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }

.loading, .noscript { display: grid; place-items: center; gap: 12px; min-height: 100dvh; color: var(--muted); text-align: center; }

/* ---------- frame ---------- */
.frame { min-height: 100dvh; }
.page {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 120px max(16px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.page.wide { max-width: 640px; }
.sidebar { display: none; }

@media (min-width: 900px) {
  .frame.has-nav { display: grid; grid-template-columns: 250px 1fr; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 0; height: 100dvh; overflow-y: auto;
    background: var(--paper); border-right: 1px solid var(--line);
    padding: 24px 14px;
  }
  .side-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; padding: 0 10px 18px; }
  .side-brand img { width: 40px; height: 40px; }
  .sidebar a {
    display: flex; align-items: center; gap: 14px;
    min-height: 54px; padding: 0 14px; border-radius: 12px;
    color: var(--ink); text-decoration: none; font-weight: 600;
  }
  .sidebar a:hover { background: var(--soft); }
  .sidebar a[aria-current="page"] { background: var(--navy); color: var(--on-navy); }
  .tabbar { display: none !important; }
  .page { max-width: 760px; padding-top: 32px; padding-bottom: 60px; }
  .page.wide { max-width: 1040px; }
}

.topbar { display: flex; align-items: center; gap: 10px; }
.topbar img.app-logo { width: 60px; height: 60px; object-fit: contain; flex: 0 0 auto; }
.topbar img.church-logo { width: 60px; height: 60px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; border: 1px solid var(--line); flex: 0 0 auto; }
.topbar .who { min-width: 0; }
.topbar .name { font-weight: 800; font-size: 20px; letter-spacing: -0.01em; display: block; line-height: 1.2; white-space: nowrap; }
.topbar .church { color: var(--muted); font-size: 13px; display: block; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; line-height: 1.25; margin-top: 2px; }
.topbar .spacer { flex: 1; }
/* Small round help button in the top bar: just the question mark */
.topbar .mmh-open { min-height: 0; padding: 0; border: none; background: none; gap: 0; transform: none; }
.topbar .mmh-open > span:not(.mmh-q) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.topbar .mmh-open .mmh-q { width: 40px; height: 40px; font-size: 22px; }

.backlink { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-size: 18px; min-height: 44px; align-self: flex-start; }

h1 { font-size: 30px; line-height: 1.2; margin: 4px 0 0; letter-spacing: -0.01em; }
h2 { font-size: 22px; line-height: 1.25; margin: 0 0 8px; }
h3 { font-size: 20px; margin: 18px 0 6px; }
.section-title { font-size: 20px; margin: 12px 0 0; }
.lead { font-size: 20px; margin: 0; color: var(--muted); }
p { margin: 0; }
.card p + p { margin-top: 8px; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card.pad { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.card.flush { padding: 0; overflow: hidden; }
.card.center { text-align: center; }

a { color: var(--navy); font-weight: 600; }
small { font-size: 16px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.in { color: var(--in); }

/* ---------- home ---------- */
.church-banner { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; display: flex; justify-content: center; }
.church-banner img { max-height: 80px; width: auto; }
.summary-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .summary-grid { grid-template-columns: repeat(3, 1fr); } }
.summary-grid .card { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink); font-weight: 400; }
.summary-grid small { color: var(--muted); font-size: 16px; font-weight: 600; }
.summary-grid strong { font-size: 30px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.summary-grid .muted { font-size: 16px; }
.stat.good { background: var(--ok-soft); border-color: var(--ok); }
.stat.warnbox { background: var(--warn-soft); border-color: var(--warn); }

.big-buttons { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .big-buttons { grid-template-columns: 1fr 1fr; } }
.big {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  min-height: 80px; width: 100%;
  padding: 12px 20px;
  border-radius: 18px;
  border: 2px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 22px; font-weight: 700;
  text-align: left; text-decoration: none;
  cursor: pointer; position: relative;
}
.big small { flex-basis: 100%; margin: -6px 0 0 44px; font-size: 16px; font-weight: 500; color: var(--muted); }
.big.primary { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.big svg { flex: 0 0 auto; }
.big:active { transform: scale(0.99); }
.big .badge { position: absolute; top: 8px; right: 10px; }
.badge { margin-left: auto; background: var(--gold); color: #1F2635; border-radius: 999px; min-width: 34px; height: 34px; display: grid; place-items: center; font-size: 18px; padding: 0 8px; }

.attention { display: flex; flex-direction: column; gap: 4px; border-color: var(--warn); background: var(--warn-soft); }
.attention h2 { color: var(--warn); }
.need {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 56px; padding: 6px 4px; border-top: 1px solid var(--line);
  color: var(--ink); text-decoration: none;
}
.need:first-of-type { border-top: 0; }
.need svg { color: var(--muted); flex: 0 0 auto; }
.card.pad .need { border-top: 1px solid var(--line); }

.reminder { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.reminder.warn { background: var(--warn-soft); border-color: var(--warn); }
.reminder.info { background: var(--soft); }
.reminder-actions { display: flex; gap: 12px; align-items: center; }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 64px; padding: 12px 18px;
  border: 0; border-top: 1px solid var(--line); background: transparent;
  color: var(--ink); text-decoration: none; text-align: left; width: 100%; font-weight: 400; cursor: pointer;
}
.list .row:first-child { border-top: 0; }
a.row:hover, button.row:hover { background: var(--soft); }
.row-main { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.row-main b { overflow-wrap: anywhere; }
.row-main .muted { font-size: 16px; }
.row-amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-amt.void { text-decoration: line-through; color: var(--muted); }
.totals { font-size: 16px; }

.pill { display: inline-block; border-radius: 999px; padding: 2px 12px; font-size: 15px; font-weight: 700; background: var(--soft); color: var(--navy); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.soft { background: var(--soft); color: var(--muted); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.chip { flex: 0 0 auto; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--line); background: var(--paper); font-weight: 600; font-size: 17px; cursor: pointer; }
.chip.on { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }

.search { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .search { grid-template-columns: 2fr 1fr; } }

.action-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.action-row .btn { width: auto; }
.button-stack, .two-buttons { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 600px) { .two-buttons { flex-direction: row; } .two-buttons .btn { flex: 1; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 60px; width: 100%; padding: 0 22px;
  border: 2px solid var(--navy); border-radius: 14px;
  background: var(--navy); color: var(--on-navy);
  font-size: 20px; font-weight: 700; cursor: pointer; text-decoration: none; text-align: center;
}
.btn.small { min-height: 48px; font-size: 17px; padding: 0 16px; width: auto; }
.btn.ghost { background: transparent; color: var(--navy); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger-ghost { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.linkish { background: none; border: 0; color: var(--navy); font-weight: 600; text-decoration: underline; cursor: pointer; min-height: 44px; padding: 0 4px; font-size: 18px; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; margin-bottom: 6px; }
input[type="email"], input[type="password"], input[type="text"], input[type="search"], input[type="date"], input[type="number"], input:not([type]), input[inputmode], select, textarea {
  width: 100%; min-height: 56px;
  padding: 0 14px;
  border: 2px solid var(--line); border-radius: 12px;
  background: var(--paper); font-size: 20px;
}
textarea { padding: 12px 14px; min-height: 100px; resize: vertical; }
select { appearance: auto; }
input:focus, select:focus, textarea:focus { border-color: var(--navy); outline: none; }
.field { display: flex; flex-direction: column; }
.field + .field { margin-top: 2px; }
.inline-field { flex-direction: row; align-items: center; gap: 12px; }
.inline-field label { margin: 0; white-space: nowrap; }
.two { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .two { grid-template-columns: 1fr 1fr; } }
form { display: flex; flex-direction: column; gap: 14px; }
fieldset.line { border: 2px solid var(--line); border-radius: 14px; padding: 12px 16px 16px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
fieldset.line legend { font-weight: 700; padding: 0 6px; }
label.check { display: flex; align-items: center; gap: 12px; font-weight: 500; min-height: 48px; margin: 0; cursor: pointer; }
label.check input { width: 26px; height: 26px; flex: 0 0 auto; }
.money-field, .dollar { display: flex; align-items: center; gap: 6px; }
.money-field span, .dollar::before { font-weight: 700; font-size: 20px; color: var(--muted); }
.dollar::before { content: "$"; }
.gst-amount { font-size: 16px; color: var(--muted); }
.remove-line { align-self: flex-start; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--navy); border-radius: 14px; overflow: hidden; }
.segmented > * { min-height: 54px; border: 0; background: var(--paper); color: var(--navy); font-weight: 700; display: grid; place-items: center; text-decoration: none; cursor: pointer; }
.segmented > .on, .segmented > [aria-pressed="true"], .segmented > [aria-current] { background: var(--navy); color: var(--on-navy); }

.message { border-radius: 12px; padding: 12px 16px; font-weight: 600; }
.message.bad { background: var(--bad-soft); color: var(--bad); }
.message.info { background: var(--soft); color: var(--ink); font-weight: 500; }
.message.ok { background: var(--ok-soft); color: var(--ok); }
.message.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- receipts ---------- */
.reading { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding-top: 20px; }
.spinner { width: 64px; height: 64px; border-radius: 50%; border: 6px solid var(--soft); border-top-color: var(--navy); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.receipt-preview { max-height: 46vh; border-radius: 12px; border: 1px solid var(--line); }
.with-photo { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .with-photo { grid-template-columns: 300px 1fr; } }
.photo-side { display: block; }
.photo-side img { width: 100%; max-height: 50vh; object-fit: contain; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); }
.facts { margin: 0; display: flex; flex-direction: column; }
.facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.facts > div:first-child { border-top: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.saved { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 20px 0; }
.tick { width: 110px; height: 110px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; }
.saved-what { font-size: 24px; font-weight: 700; }
.check-card { display: flex; gap: 16px; flex-wrap: wrap; }
.check-card .thumb { width: 110px; height: 140px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.check-body { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 8px; }
.check-body h2 { margin: 0; }

/* ---------- entry ---------- */
.entry-head { display: flex; flex-direction: column; gap: 4px; }
.entry-amount { font-size: 38px; font-weight: 800; font-variant-numeric: tabular-nums; }
.history summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.history ul { padding-left: 20px; margin: 8px 0 0; }

/* ---------- offering ---------- */
.count-table { width: 100%; border-collapse: collapse; }
.count-table th, .count-table td { padding: 8px 6px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
.count-table th { font-weight: 700; }
.count-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.count-table input { min-height: 54px; font-size: 22px; text-align: right; }
.count-table .extra th input { text-align: left; font-size: 18px; }
.chit { display: flex; flex-direction: column; gap: 0; }
.chit-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 20px; }
.chit-row:first-child { border-top: 0; }
.chit-row.total { font-size: 26px; font-weight: 800; }
.offering-card { display: flex; flex-direction: column; gap: 10px; }
.offering-total { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
table.mini { width: 100%; border-collapse: collapse; font-size: 17px; }
table.mini td { padding: 4px 0; border-top: 1px solid var(--line); }
table.mini td:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- bank ---------- */
.bank-line { display: flex; flex-direction: column; gap: 4px; }
.bank-line strong { font-size: 32px; font-variant-numeric: tabular-nums; }
.bank-line small { color: var(--muted); }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  width: 100%; padding: 16px 18px; min-height: 72px;
  background: var(--paper); border: 2px solid var(--line); border-radius: 14px; text-align: left; cursor: pointer;
}
.choice:hover { border-color: var(--navy); }

/* ---------- budget ---------- */
.bar { position: relative; display: block; height: 12px; border-radius: 999px; background: var(--soft); margin-top: 6px; overflow: visible; width: 100%; }
.bar span { display: block; height: 100%; border-radius: 999px; background: var(--navy); }
.bar span.over { background: var(--bad); }
.bar i { position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--gold); border-radius: 2px; }
.budget-row .row-main { flex: 1; }

/* ---------- ATO ---------- */
.bas.done { opacity: 0.9; }
.bas-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.bas-head h2 { margin: 0; }
.refund { display: flex; flex-direction: column; background: var(--ok-soft); border-radius: 12px; padding: 12px 16px; }
.refund small { color: var(--ok); font-weight: 700; }
.refund strong { font-size: 32px; font-variant-numeric: tabular-nums; }

/* ---------- tables and reports ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 17px; }
.table th, .table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: 15px; color: var(--muted); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr.sub td { font-weight: 800; padding-top: 16px; border-bottom: 2px solid var(--ink); }
.table tr.total td { font-weight: 700; }
.table tr.grand td { font-weight: 800; font-size: 19px; border-top: 2px solid var(--ink); border-bottom: 3px double var(--ink); }
.report-page { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.report-page + .report-page { margin-top: 4px; }
.report-head { display: flex; flex-direction: column; gap: 10px; border-bottom: 2px solid var(--ink); padding-bottom: 14px; margin-bottom: 8px; }
.report-head img { max-height: 70px; width: auto; align-self: flex-start; background: #fff; }
.report-head h1 { font-size: 26px; margin: 0; }
.checks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.checks li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 48px; }
.checks li > span:nth-child(2) { flex: 1; min-width: 180px; }
.checks .dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex: 0 0 auto; }
.checks .ok .dot { background: var(--ok-soft); color: var(--ok); }
.checks .todo .dot { background: var(--warn-soft); color: var(--warn); }

/* ---------- admin ---------- */
.admin-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .admin-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
.tile { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); font-weight: 400; }
.tile svg { color: var(--navy); }
.tile b { font-size: 20px; }
.logos { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .logos { grid-template-columns: 1fr 2fr; } }
.logos > div { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.logo-preview { max-height: 90px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }

/* ---------- sign in ---------- */
.signin { max-width: 440px; margin: 0 auto; min-height: 100dvh; padding: 32px 16px; display: flex; flex-direction: column; justify-content: center; gap: 18px; position: relative; }
.signin .brand { text-align: center; }
.signin .brand img { width: 120px; }
.signin .brand h1 { margin-top: 12px; }
.signin-help { position: absolute; top: 16px; right: 16px; }
.strapline { margin: 4px 0 0; color: var(--muted); font-size: 19px; font-weight: 600; letter-spacing: 0.01em; }
.signin-title { font-size: 22px; margin: 8px 0 0; }
.signin form { display: flex; flex-direction: column; gap: 18px; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center;
  background: var(--paper); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 10;
}
.tabbar nav { display: flex; width: 100%; max-width: 640px; }
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 68px; justify-content: center;
  color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 600;
}
.tabbar a[aria-current="page"] { color: var(--navy); }
.tabbar a[aria-current="page"] svg { stroke-width: 2.4; }

/* ---------- sheet and toast ---------- */
.sheet-wrap { position: fixed; inset: 0; background: rgba(15, 20, 30, 0.5); display: flex; align-items: flex-end; justify-content: center; z-index: 50; padding: 0; }
@media (min-width: 600px) { .sheet-wrap { align-items: center; padding: 20px; } }
.sheet {
  background: var(--paper); width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto;
  border-radius: 20px 20px 0 0; padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px;
}
@media (min-width: 600px) { .sheet { border-radius: 20px; } }
.sheet h2 { margin: 0; font-size: 24px; }
.sheet-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 14px 22px; border-radius: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--bad); color: #fff; }
@media (min-width: 900px) { .toast { bottom: 30px; } }

/* ---------- iPad and computer: denser, like the wireframe. Big and chunky stays on the phone. ---------- */
@media (min-width: 900px) {
  body { font-size: 16px; }
  h1 { font-size: 26px; }
  h2 { font-size: 19px; }
  h3 { font-size: 17px; }
  .section-title { font-size: 17px; }
  .lead { font-size: 17px; }
  small, .row-main .muted, .summary-grid small, .summary-grid .muted, .totals { font-size: 14px; }
  .page { gap: 14px; }
  .card { padding: 14px 16px; border-radius: 12px; }
  .card.pad { padding: 16px 18px; gap: 10px; }
  .sidebar a { min-height: 44px; font-size: 16px; }
  .side-brand { font-size: 18px; }
  .topbar img.app-logo { width: 46px; height: 46px; }
  .topbar img.church-logo { width: 46px; height: 46px; }
  .topbar .name { font-size: 17px; }
  .topbar .church { font-size: 12px; }
  .summary-grid { gap: 12px; }
  .summary-grid strong { font-size: 26px; }
  .big-buttons { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
  .big { min-height: 58px; padding: 8px 16px; font-size: 17px; gap: 10px; border-radius: 12px; }
  .big svg { width: 22px; height: 22px; }
  .big small { margin-left: 32px; font-size: 13px; }
  .mmh-open { transform: scale(0.85); transform-origin: right center; }
  .badge { min-width: 26px; height: 26px; font-size: 14px; }
  .btn { min-height: 44px; font-size: 16px; padding: 0 18px; border-radius: 10px; width: auto; align-self: flex-start; }
  .btn.small { min-height: 38px; font-size: 15px; padding: 0 12px; }
  .btn svg { width: 18px; height: 18px; }
  .sheet .btn, .sheet-buttons .btn { width: 100%; }
  .sheet-buttons { flex-direction: row-reverse; justify-content: flex-start; }
  .sheet-buttons .btn { width: auto; }
  .linkish { font-size: 15px; min-height: 36px; }
  .row { min-height: 48px; padding: 8px 16px; }
  .need { min-height: 42px; }
  .chip { min-height: 36px; font-size: 15px; padding: 0 12px; }
  input[type="email"], input[type="password"], input[type="text"], input[type="search"], input[type="date"], input[type="number"], input:not([type]), input[inputmode], select, textarea {
    min-height: 42px; font-size: 16px; padding: 0 12px; border-width: 1px; border-radius: 8px;
  }
  textarea { padding: 8px 12px; min-height: 80px; }
  label { margin-bottom: 4px; font-size: 15px; }
  label.check { min-height: 36px; font-size: 16px; }
  label.check input { width: 20px; height: 20px; }
  form { gap: 10px; }
  fieldset.line { padding: 8px 14px 12px; gap: 8px; border-width: 1px; }
  .segmented > * { min-height: 42px; }
  .message { padding: 10px 14px; font-size: 15px; }
  .pill { font-size: 13px; padding: 1px 10px; }
  .facts > div { padding: 7px 0; }
  .entry-amount { font-size: 30px; }
  .chit-row { font-size: 17px; padding: 8px 0; }
  .chit-row.total { font-size: 21px; }
  .count-table input { min-height: 42px; font-size: 18px; }
  .offering-total { font-size: 28px; }
  .bank-line strong, .refund strong { font-size: 26px; }
  .choice { min-height: 56px; padding: 10px 14px; }
  .table { font-size: 15px; }
  .table th, .table td { padding: 6px; }
  .checks li { min-height: 38px; }
  .checks .dot { width: 26px; height: 26px; }
  .tick { width: 84px; height: 84px; }
  .reading .btn, .saved ~ .btn { align-self: center; }
  .two-buttons { flex-direction: row; }
  .two-buttons .btn { flex: 0 0 auto; }
  .button-stack { flex-direction: row; flex-wrap: wrap; }
  .search { grid-template-columns: 2fr 1fr; }
}
/* Home on a computer: summary cards and buttons side by side, latest entries beside the attention card. */
@media (min-width: 1200px) {
  .page.wide { max-width: 1120px; }
}

/* ---------- print: the reports become a clean PDF ---------- */
@media print {
  @page { size: A4; margin: 14mm; }
  :root { --bg: #fff; --paper: #fff; --ink: #000; --muted: #444; --line: #bbb; color-scheme: light; }
  body { font-size: 12pt; background: #fff; }
  .sidebar, .tabbar, .topbar, .backlink, .no-print, .toast, .mmh-open, .sheet-wrap { display: none !important; }
  .frame.has-nav { display: block; }
  .page, .page.wide { max-width: none; padding: 0; gap: 0; }
  .report-page { border: 0; border-radius: 0; padding: 0; break-after: page; }
  .report-page:last-child { break-after: auto; }
  .table { font-size: 11pt; }
  .table tr { break-inside: avoid; }
  a { color: inherit; text-decoration: none; font-weight: inherit; }
}
