@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 300 500; font-display: swap; src: url(assets/fonts/newsreader-latin.woff2) format('woff2'); }
@font-face { font-family: 'Newsreader'; font-style: italic; font-weight: 300 500; font-display: swap; src: url(assets/fonts/newsreader-italic-latin.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 600; font-display: swap; src: url(assets/fonts/instrument-sans-latin.woff2) format('woff2'); }

:root {
  --night: #1C1F3B;
  --night-2: #252946;
  --night-rule: #3A3E63;
  --bone: #F1E9DD;
  --paper: #FAF6EF;
  --saffron: #D9A53F;
  --umber: #8A590F;
  --dusk: #A9A5B8;
  --muted: #55526A;
  --rule: #D3C9B5;
  --rule-soft: #E4DCCD;
  --green-bg: #E1EADD; --green-fg: #2C5A3E; --green-dot: #3F7A55;
  --wait-bg: #E6E3EE;  --wait-fg: #47436A;  --wait-dot: #7D7898;
  --yellow-bg: #F5E5C1; --yellow-fg: #6E460A; --yellow-dot: #D9A53F;
  --red-bg: #F3DAD3;   --red-fg: #8C2A1F;   --red-dot: #B23A2C;
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Instrument Sans', system-ui, sans-serif;
  --radius: 4px;
  --tab-h: 64px;
  --top-h: 56px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bone); color: var(--night); font: 400 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 1px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p, dl, dd, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 300; letter-spacing: -.015em; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--night); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.noscript { padding: 40px 20px; font-family: var(--serif); font-size: 22px; }
.i { width: 20px; height: 20px; flex: none; }
.chev { width: 18px; height: 18px; color: var(--dusk); margin-left: auto; }

/* ── Demo strip ─────────────────────────────────────────────────────────── */
.demo-bar { position: relative; z-index: 40; background: var(--saffron); color: var(--night); font-size: 13px; line-height: 1.4; padding: 8px 16px; text-align: center; }

/* ── Shell ──────────────────────────────────────────────────────────────── */
.app { min-height: 100vh; min-height: 100dvh; }
.sidebar { display: none; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--night); color: var(--bone); }
.top-brand { display: flex; align-items: center; min-height: 44px; min-width: 44px; }
.top-brand img { width: 34px; height: 34px; border-radius: 3px; }
.top-title { font: 400 21px/1 var(--serif); letter-spacing: -.01em; }
.top-spacer { flex: 1; }
.main { padding: 22px 16px calc(var(--tab-h) + 40px + env(safe-area-inset-bottom)); max-width: 1200px; outline: none; }
.tabbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--paper); border-top: 1px solid var(--rule); padding-bottom: env(safe-area-inset-bottom); }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: var(--tab-h); padding: 6px 2px; border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .01em; text-decoration: none; }
.tab .i { width: 23px; height: 23px; }
.tab.active { color: var(--night); }
.tab.active::before { content: ''; position: absolute; top: -1px; left: 28%; right: 28%; height: 2px; background: var(--saffron); }

@media (min-width: 980px) {
  .app { display: grid; grid-template-columns: 252px minmax(0, 1fr); }
  .topbar, .tabbar { display: none; }
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 30px 18px 22px; background: var(--night); color: var(--bone); }
  .demo-bar + .app .sidebar { height: calc(100vh - 35px); top: 0; }
  .side-brand { display: flex; align-items: center; min-height: 44px; padding: 0 10px; }
  .side-brand img { width: 160px; height: auto; }
  .side-label { margin: 18px 10px 26px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--dusk); }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 3px; color: #C9C5D6; font-size: 14px; font-weight: 500; text-decoration: none; transition: background .15s ease, color .15s ease; }
  .side-link:hover { background: rgba(241, 233, 221, .06); color: var(--bone); }
  .side-link.active { background: rgba(241, 233, 221, .09); color: var(--bone); }
  .side-link.active::before { content: ''; position: absolute; left: -18px; top: 10px; bottom: 10px; width: 3px; background: var(--saffron); border-radius: 0 2px 2px 0; }
  .side-link .i { width: 19px; height: 19px; opacity: .9; }
  .side-user { margin-top: auto; padding: 18px 10px 0; border-top: 1px solid var(--night-rule); }
  .side-email { font-size: 12.5px; color: var(--dusk); overflow-wrap: anywhere; }
  .side-signout { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 4px; padding: 0; border: 0; background: none; color: #C9C5D6; font-size: 13.5px; }
  .side-signout:hover { color: var(--bone); }
  .side-signout .i { width: 18px; height: 18px; }
  .main { padding: 46px 56px 90px; }
}

/* ── Page furniture ─────────────────────────────────────────────────────── */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.eyebrow { font: 500 11.5px/1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--umber); margin-bottom: 10px; }
.page-head h1, .org-head h1 { font-size: 36px; line-height: 1.06; }
.lead { margin-top: 10px; max-width: 640px; color: var(--muted); font-size: 15.5px; }
@media (min-width: 980px) { .page-head h1, .org-head h1 { font-size: 50px; } .lead { font-size: 16.5px; } .page-head { margin-bottom: 34px; } }
.block { margin-bottom: 26px; }
.block-title { font-size: 25px; line-height: 1.2; margin-bottom: 14px; }
.card { background: var(--paper); border: 1px solid var(--rule-soft); border-radius: var(--radius); padding: 20px; }
@media (min-width: 980px) { .card { padding: 24px 26px; } }
.card-title { font-size: 24px; line-height: 1.2; margin-bottom: 10px; }
.card-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 16px; margin-bottom: 10px; }
.card-head .card-title { margin-bottom: 0; }
.two { display: grid; gap: 0 22px; }
@media (min-width: 760px) { .two { grid-template-columns: 1fr 1fr; } }
/* Money: the ledger needs the full width, so the 12 month card sits above it until the screen is very wide. */
.two-wide { grid-template-columns: minmax(0, 1fr) !important; }
.two-wide > .card { order: -1; }
@media (min-width: 1700px) { .two-wide { grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr) !important; align-items: start; } .two-wide > .card { order: 0; } }
.big-money { font: 300 40px/1.05 var(--serif); letter-spacing: -.02em; margin: 6px 0 8px; }
.big-money .small { font-family: var(--sans); letter-spacing: 0; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; font: italic 400 19px/1.3 var(--serif); text-decoration: underline; text-decoration-color: var(--rule); }
.text-link:hover { text-decoration-color: currentColor; }
.note-line { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0; padding: 10px 12px; background: rgba(217, 165, 63, .12); border-radius: 3px; font-size: 13.5px; color: var(--night); }
.note-line .i { width: 18px; height: 18px; color: var(--umber); margin-top: 1px; }
.note-line.warn { background: var(--red-bg); color: var(--red-fg); }
.note-line.warn .i { color: var(--red-fg); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 999px; background: var(--night); color: var(--bone); font-size: 11px; font-weight: 500; letter-spacing: .04em; }
.count-badge { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--yellow-bg); color: var(--yellow-fg); font: 500 12px/1.4 var(--sans); }

/* ── Chips and the Verified checkmark ───────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 26px; padding: 3px 11px 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 500; line-height: 1.25; white-space: nowrap; background: var(--muted-bg, #ECE5D8); color: var(--muted); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dusk); flex: none; }
.chip-green { background: var(--green-bg); color: var(--green-fg); } .chip-green .dot { background: var(--green-dot); }
.chip-wait { background: var(--wait-bg); color: var(--wait-fg); } .chip-wait .dot { background: var(--wait-dot); }
.chip-yellow { background: var(--yellow-bg); color: var(--yellow-fg); } .chip-yellow .dot { background: var(--yellow-dot); }
.chip-red { background: var(--red-bg); color: var(--red-fg); } .chip-red .dot { background: var(--red-dot); }
.chip-cleared { background: var(--night); color: var(--bone); } .chip-cleared .dot { background: var(--saffron); }
.chip-muted { background: #ECE5D8; color: var(--muted); }

.verified { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--night); white-space: nowrap; vertical-align: middle; }
.verified svg { width: 19px; height: 19px; }
.v-ring { fill: var(--saffron); }
.v-tick { fill: none; stroke: var(--night); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.verified-sm { font-size: 12px; margin-left: 8px; }
.verified-sm svg { width: 16px; height: 16px; }

/* ── Stats ──────────────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; } }
.stat { background: var(--paper); border: 1px solid var(--rule-soft); border-radius: var(--radius); padding: 14px 14px 13px; min-width: 0; }
.stat-label { font-size: 12px; font-weight: 500; color: var(--muted); line-height: 1.3; }
.stat-value { font: 300 27px/1.15 var(--serif); letter-spacing: -.015em; margin-top: 6px; overflow-wrap: anywhere; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.35; }
.stat-quiet { background: transparent; }
@media (min-width: 980px) { .stat { padding: 18px 18px 16px; } .stat-value { font-size: 32px; } }
@media (min-width: 760px) { .stats-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .stats-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.stats-tight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-tight .stat { padding: 12px; background: var(--bone); }
.stats-tight .stat-value { font-size: 24px; }

/* ── Alerts and calm ────────────────────────────────────────────────────── */
.alerts { display: grid; gap: 8px; }
.alert-row { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 14px; background: var(--paper); border: 1px solid var(--rule-soft); border-left: 3px solid var(--dusk); border-radius: var(--radius); text-decoration: none; }
.alert-row > div { display: flex; flex-direction: column; min-width: 0; }
.alert-row strong { font-weight: 600; }
.alert-row span { color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }
.alert-row:hover { background: #fff; }
.alert-red { border-left-color: var(--red-dot); } .alert-red > .i { color: var(--red-fg); }
.alert-yellow { border-left-color: var(--saffron); } .alert-yellow > .i { color: var(--umber); }
.alert-green { border-left-color: var(--green-dot); } .alert-green > .i { color: var(--green-fg); }
.calm { display: flex; align-items: center; gap: 12px; padding: 18px; border: 1px dashed var(--rule); border-radius: var(--radius); font: 300 20px/1.3 var(--serif); }
.calm .i { color: var(--green-dot); }

/* ── Lists ──────────────────────────────────────────────────────────────── */
.rows { background: var(--paper); border: 1px solid var(--rule-soft); border-radius: var(--radius); overflow: hidden; }
.card .rows { background: var(--bone); margin-top: 14px; }
.row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 16px; border-bottom: 1px solid var(--rule-soft); text-decoration: none; }
.row:last-child { border-bottom: 0; }
a.row:hover { background: #fff; }
.row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.row-main strong { font-weight: 600; overflow-wrap: anywhere; }
.row-main > span { font-size: 13.5px; overflow-wrap: anywhere; }
.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; text-align: right; flex: none; }
.amount { font-variant-numeric: tabular-nums; font-weight: 600; }
.col-label { display: block; font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.org-row { flex-wrap: wrap; }
.org-name { display: inline-flex; flex-wrap: wrap; align-items: center; row-gap: 4px; }
.org-cols { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; width: 100%; font-size: 14px; }
.org-cols .col-label { display: inline; margin-right: 6px; }
.org-row .chev { position: absolute; right: 14px; }
.org-row { position: relative; padding-right: 40px; }
@media (min-width: 980px) {
  .org-row { flex-wrap: nowrap; }
  .org-cols { width: auto; display: grid; grid-template-columns: 210px 90px 120px; gap: 16px; }
  .org-cols .col-label { display: block; margin: 0 0 2px; }
}

.donor-row { flex-wrap: wrap; position: relative; padding-right: 40px; }
.donor-row .chev { position: absolute; right: 14px; top: 22px; }
.donor-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; width: 100%; font-size: 13.5px; }
.donor-cols > span { min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 980px) {
  .donor-row { flex-wrap: nowrap; }
  .donor-row .chev { top: auto; }
  .donor-row .row-main { flex: 0 0 230px; }
  .donor-cols { grid-template-columns: 1.6fr 1fr .9fr .6fr 1fr; align-items: center; }
}

/* ── Filters, search, toolbar ───────────────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.filter { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 15px; border: 1px solid var(--rule); border-radius: 999px; font-size: 13.5px; font-weight: 500; text-decoration: none; background: transparent; }
.filter:hover { border-color: var(--night); }
.filter.active { background: var(--night); border-color: var(--night); color: var(--bone); }
.filter-n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.filter.active .filter-n { color: var(--dusk); }
.search { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 4px 4px 4px 14px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); }
.search:focus-within { border-color: var(--night); }
.search .i { color: var(--muted); }
.search input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent; outline: none; font-size: 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.select-wrap select { min-height: 44px; padding: 0 38px 0 14px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C1F3B' stroke-width='1.6'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center / 18px; appearance: none; font-size: 15px; }

/* ── Buttons and fields ─────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border: 1px solid var(--night); border-radius: 3px; background: var(--night); color: var(--bone); font-size: 14px; font-weight: 500; line-height: 1.25; text-align: center; text-decoration: none; transition: opacity .15s ease, background .15s ease; }
.btn:hover { opacity: .88; }
.btn:disabled { opacity: .5; cursor: progress; }
.btn .i { width: 18px; height: 18px; }
.btn-quiet { background: transparent; color: var(--night); border-color: var(--rule); }
.btn-quiet:hover { border-color: var(--night); opacity: 1; }
.btn-sm { min-height: 44px; padding: 6px 14px; font-size: 13px; }
.btn-danger { background: var(--red-dot); border-color: var(--red-dot); color: #fff; }
.btn-danger-quiet { color: var(--red-fg); border-color: #E3C3BA; background: transparent; }
.btn-danger-quiet:hover { border-color: var(--red-fg); }
.btn-warn { color: var(--umber); border-color: #E5D2AE; }
.btn-light { background: var(--bone); color: var(--night); border-color: var(--bone); }
.btn-block { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.icon-btn:hover { background: rgba(28, 31, 59, .06); color: var(--night); }
.link-btn { display: block; min-height: 44px; margin: 6px auto 0; padding: 0 8px; border: 0; background: none; color: var(--dusk); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.field { display: block; }
.field-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.field input, .field textarea { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid var(--rule); border-radius: 3px; background: #fff; font-size: 16px; line-height: 1.45; }
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--night); box-shadow: 0 0 0 3px rgba(28, 31, 59, .08); }
.form-error { margin-top: 10px; padding: 9px 12px; border-radius: 3px; background: var(--red-bg); color: var(--red-fg); font-size: 13.5px; }
.inline-form { display: grid; gap: 12px; margin-top: 14px; }
@media (min-width: 640px) { .inline-form { grid-template-columns: 1fr auto; align-items: end; } }

/* ── Applications ───────────────────────────────────────────────────────── */
.cards { display: grid; gap: 12px; }
@media (min-width: 760px) { .cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; } }
.app-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 18px 16px; background: var(--paper); border: 1px solid var(--rule-soft); border-top: 3px solid var(--dusk); border-radius: var(--radius); text-decoration: none; transition: background .15s ease, transform .15s ease; }
.app-card:hover { background: #fff; }
.app-card.tone-green { border-top-color: var(--green-dot); }
.app-card.tone-yellow { border-top-color: var(--saffron); }
.app-card.tone-red { border-top-color: var(--red-dot); }
.app-card.tone-cleared { border-top-color: var(--night); }
.app-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.app-card h3 { font-size: 23px; line-height: 1.2; }
.app-headline { margin-top: 8px; font-weight: 600; font-size: 14px; }
.app-headline.ok { color: var(--green-fg); }
.tone-red .app-headline { color: var(--red-fg); }
.tone-yellow .app-headline { color: var(--yellow-fg); }
.app-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule-soft); font-size: 12.5px; color: var(--muted); }

/* ── Organization detail ────────────────────────────────────────────────── */
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: -8px 0 6px -6px; padding-right: 10px; color: var(--muted); font-size: 14px; text-decoration: none; }
.back:hover { color: var(--night); }
.org-head { margin-bottom: 24px; }
.org-head-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 12px; }
.org-head .lead { margin-top: 8px; }
.org-head .small { margin-top: 6px; }
.detail { display: flex; flex-direction: column; gap: 0; }
.detail-main, .detail-side { display: contents; }
.actions-card { order: -1; }
@media (min-width: 1100px) {
  .detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
  .detail-main, .detail-side { display: block; }
  .detail-side { position: sticky; top: 24px; }
}
.actions-card .kv { margin-bottom: 14px; }
.action-grid { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 6px; }
@media (min-width: 520px) and (max-width: 1099px) { .action-grid { grid-template-columns: 1fr 1fr; } }
.decision { margin: 4px 0 16px; padding: 12px 14px; background: var(--bone); border-left: 3px solid var(--night); border-radius: 0 3px 3px 0; }
.decision .eyebrow { margin-bottom: 4px; }
.decision p + p { margin-top: 4px; }

.checks { display: grid; gap: 0; }
.check { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--rule-soft); }
.check:last-child { border-bottom: 0; }
.check-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; }
.check-icon .i { width: 16px; height: 16px; stroke-width: 2.2; }
.check-pass .check-icon { background: var(--green-bg); color: var(--green-fg); }
.check-info .check-icon { background: var(--wait-bg); color: var(--wait-fg); }
.check-warn .check-icon { background: var(--yellow-bg); color: var(--yellow-fg); }
.check-fail .check-icon { background: var(--red-dot); color: #fff; }
.check-label { font-weight: 600; }
.check-fail .check-label { color: var(--red-fg); }
.check-detail { font-size: 14px; color: var(--night); margin-top: 2px; overflow-wrap: anywhere; }
.check-source { font-size: 12px; color: var(--muted); margin-top: 4px; }
.irs { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--rule); }

.kv { display: grid; gap: 10px; }
.kv > div { display: grid; gap: 2px; min-width: 0; }
.kv dt { font-size: 12.5px; color: var(--muted); }
.kv dd { overflow-wrap: anywhere; }
@media (min-width: 640px) {
  .kv > div { grid-template-columns: 200px minmax(0, 1fr); gap: 16px; }
  .kv > .kv-long { grid-template-columns: 1fr; gap: 4px; }
}
.kv-tight { gap: 8px; }
.kv-tight > div { grid-template-columns: 120px minmax(0, 1fr) !important; gap: 12px !important; align-items: center; }
.form-card { padding-top: 6px; padding-bottom: 6px; }
.form-group { padding: 18px 0; border-bottom: 1px solid var(--rule-soft); }
.form-group:last-child { border-bottom: 0; }
.form-group h3 { display: flex; align-items: baseline; gap: 10px; font-size: 20px; margin-bottom: 12px; }
.step-no { font: 500 11px/1 var(--sans); letter-spacing: .14em; color: var(--umber); }
.attest { display: grid; gap: 8px; }
.attest li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.attest .i { width: 18px; height: 18px; margin-top: 2px; }
.attest .yes .i { color: var(--green-dot); }
.attest .no { color: var(--red-fg); }
.docs, .notes, .mail-list, .timeline, .split, .team-list, .mini-list, .result-list { display: grid; }
.docs > li, .notes > li, .mail-list > li, .timeline > li, .split > li, .team-list > li, .mini-list > li, .result-list > li, .cards > *, .alerts > *, .runs > * { min-width: 0; }
.mail-row span { overflow-wrap: anywhere; }
.docs li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule-soft); }
.docs li:last-child { border-bottom: 0; }
.docs li > div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.docs .i { color: var(--umber); }
.notes li { padding: 10px 0; border-bottom: 1px solid var(--rule-soft); }
.notes li:last-child { border-bottom: 0; }
.notes p { margin-top: 2px; }
.mail-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--rule-soft); background: none; text-align: left; }
.mail-list li:last-child .mail-row { border-bottom: 0; }
.mail-row > div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.mail-row strong { font-weight: 600; overflow-wrap: anywhere; }
.mail-row:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.mail-page { background: var(--paper); border: 1px solid var(--rule-soft); border-radius: var(--radius); padding: 0 16px; }
.timeline li { position: relative; padding: 10px 0 10px 18px; border-left: 1px solid var(--rule); }
.timeline li::before { content: ''; position: absolute; left: -4px; top: 17px; width: 7px; height: 7px; border-radius: 50%; background: var(--saffron); }
.timeline-page { background: var(--paper); border: 1px solid var(--rule-soft); border-radius: var(--radius); padding: 10px 20px 10px 26px; }
.timeline-page li { padding: 14px 0 14px 20px; }
.timeline-page li::before { top: 21px; }
.quote { margin: 4px 0; padding-left: 10px; border-left: 2px solid var(--rule); font: italic 400 16px/1.45 var(--serif); overflow-wrap: anywhere; }
.split li { border-bottom: 1px solid var(--rule-soft); }
.split li:last-child { border-bottom: 0; }
.split li, .split a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; text-decoration: none; }
.split a { width: 100%; }
.split a:hover .org-name { text-decoration: underline; text-underline-offset: 3px; }
.mini-list { margin: 14px 0 4px; }
.mini-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--rule-soft); font-size: 14px; }
.result-list li a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--rule-soft); text-decoration: none; }
.bar, .m-bar { position: relative; height: 8px; border-radius: 999px; background: var(--rule-soft); overflow: hidden; }
.bar > span, .m-bar > span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--saffron); border-radius: 999px; }
.bar { margin: 8px 0; }

/* ── Collections and money ──────────────────────────────────────────────── */
.friday-card .card-head .big-money { margin: 0; }
.runs { display: grid; gap: 12px; }
@media (min-width: 760px) { .runs { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; } }
.run .card-head { flex-direction: column; align-items: flex-start; gap: 2px; }
.run .big-money { font-size: 30px; margin: 4px 0 6px; }
.run-counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.fail-list { margin-top: 10px; border-top: 1px solid var(--rule-soft); }
.fail-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--rule-soft); text-decoration: none; font-size: 13.5px; }
.fail-list a > span { overflow-wrap: anywhere; }
.fail-list strong { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.preview-rows .row-end { min-width: 0; }

.ledger { background: var(--paper); border: 1px solid var(--rule-soft); border-radius: var(--radius); }
.ledger-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 12px 16px; border-bottom: 1px solid var(--rule-soft); font-size: 13.5px; }
.ledger-row:last-child { border-bottom: 0; }
.ledger-head { display: none; }
.l-org { order: 1; flex: 1 1 0; min-width: 0; font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.l-gift { order: 2; font-weight: 600; font-size: 15px; }
.l-donor { order: 3; flex-basis: 100%; color: var(--muted); overflow-wrap: anywhere; }
.l-date { order: 5; color: var(--muted); }
.l-fee, .l-charged { order: 6; color: var(--muted); }
.l-status { order: 7; margin-left: auto; }
.ledger-row .col-label { display: inline; text-transform: none; letter-spacing: 0; font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
@media (min-width: 1180px) {
  .ledger-row { display: grid; grid-template-columns: 84px minmax(0, 1.3fr) minmax(0, 1.3fr) 86px 72px 86px 104px; gap: 12px; }
  .ledger-head { display: grid; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 10px; padding-bottom: 10px; }
  .l-org, .l-gift { font-size: 13.5px; }
  .l-date, .l-fee, .l-charged, .l-status { order: 0; margin: 0; }
  .l-donor { flex-basis: auto; }
  .ledger-row .num { text-align: right; }
  .ledger-row .col-label { display: none; }
  .l-org, .l-gift, .l-donor { order: 0; }
}
.months li a { display: grid; grid-template-columns: 76px minmax(0, 1fr) 96px; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--rule-soft); text-decoration: none; font-size: 13.5px; }
.months li:last-child a { border-bottom: 0; }
.months a.active .m-label { font-weight: 600; }
.months a.active .m-bar > span { background: var(--night); }
.m-val { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; font-weight: 600; }
.m-val .small { font-weight: 400; font-size: 11.5px; }

/* ── Notices, empty, loading ────────────────────────────────────────────── */
.notice { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 20px; padding: 14px 16px; border-radius: var(--radius); }
.notice p { margin-top: 2px; font-size: 14px; }
.notice > .i { margin-top: 2px; }
.notice-yellow { background: var(--yellow-bg); color: var(--yellow-fg); }
.notice-red { background: var(--red-bg); color: var(--red-fg); }
.empty { padding: 40px 20px; text-align: center; border: 1px dashed var(--rule); border-radius: var(--radius); color: var(--muted); }
.empty-title { font: 300 23px/1.3 var(--serif); color: var(--night); margin-bottom: 6px; }
.loading { display: flex; gap: 8px; justify-content: center; padding: 70px 0; }
.loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--saffron); animation: pulse 1s ease-in-out infinite; }
.loading span:nth-child(2) { animation-delay: .15s; } .loading span:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .loading span { animation: none; opacity: .7; } }

/* ── Team ───────────────────────────────────────────────────────────────── */
.team-list li { display: flex; align-items: center; gap: 14px; min-height: 64px; border-bottom: 1px solid var(--rule-soft); }
.team-list li:last-child { border-bottom: 0; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--night); color: var(--saffron); font: 400 19px/1 var(--serif); }

/* ── Sheets (dialogs) ───────────────────────────────────────────────────── */
.sheet { width: 100%; max-width: 100%; max-height: 90vh; max-height: 90dvh; margin: auto 0 0; padding: 0; border: 0; border-radius: 14px 14px 0 0; background: var(--paper); color: var(--night); box-shadow: 0 -10px 40px rgba(28, 31, 59, .22); overflow: auto; }
.sheet::backdrop { background: rgba(28, 31, 59, .5); }
.sheet-inner { padding: 8px 20px calc(22px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0 6px; position: sticky; top: 0; background: var(--paper); z-index: 1; }
.sheet-head h2 { font-size: 25px; line-height: 1.2; }
.sheet-body { color: var(--muted); margin-bottom: 16px; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.sheet-actions:has(> :only-child) { grid-template-columns: 1fr; }
@media (min-width: 700px) {
  .sheet { width: min(540px, calc(100% - 48px)); margin: auto; border-radius: 8px; }
  .sheet-wide { width: min(720px, calc(100% - 48px)); }
  .sheet-inner { padding: 14px 28px 26px; }
}
.more-list { display: grid; margin: 4px 0 10px; }
.more-link { display: flex; align-items: center; gap: 14px; min-height: 56px; border-bottom: 1px solid var(--rule-soft); text-decoration: none; font-size: 16px; font-weight: 500; }
.more-link.active { color: var(--umber); }
.more-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 8px; }
.more-foot p { overflow-wrap: anywhere; min-width: 0; }
.link-box { padding: 12px 14px; background: #fff; border: 1px solid var(--rule); border-radius: 3px; overflow-wrap: anywhere; font-size: 13px; }
.mail-meta { margin-bottom: 16px; }
.email-preview { padding: 22px 20px; background: #fff; border: 1px solid var(--rule-soft); border-radius: 3px; overflow-wrap: anywhere; }
.email-preview p { margin: 0 0 12px; }

/* ── Toasts ─────────────────────────────────────────────────────────────── */
.toasts { position: fixed; z-index: 100; left: 16px; right: 16px; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
@media (min-width: 980px) { .toasts { left: auto; right: 28px; bottom: 28px; justify-items: end; } }
.toast { max-width: 440px; padding: 12px 16px; border-radius: 4px; background: var(--night); color: var(--bone); font-size: 14px; box-shadow: 0 8px 30px rgba(28, 31, 59, .25); transition: opacity .3s ease, transform .3s ease; }
.toast-warn { background: var(--red-fg); color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ── Sign in ────────────────────────────────────────────────────────────── */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; background: radial-gradient(120% 80% at 50% 0%, #2A2F57 0%, var(--night) 60%); color: var(--bone); }
.auth-card { width: 100%; max-width: 400px; }
.auth-logo { width: 190px; height: auto; margin-bottom: 18px; }
.auth-eyebrow { font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--saffron); margin-bottom: 30px; }
.auth h1 { font-size: 42px; line-height: 1.05; margin-bottom: 12px; }
.auth-lead { color: var(--dusk); margin-bottom: 26px; }
.auth-lead strong { color: var(--bone); font-weight: 500; }
.auth-form { display: grid; gap: 14px; }
.auth .field-label { color: var(--dusk); }
.auth .field input { background: rgba(241, 233, 221, .06); border-color: var(--night-rule); color: var(--bone); }
.auth .field input:focus { border-color: var(--saffron); box-shadow: 0 0 0 3px rgba(217, 165, 63, .18); }
.code-input { letter-spacing: .5em; font-size: 24px !important; text-align: center; font-variant-numeric: tabular-nums; }
.auth .form-error { margin-top: 0; }
.auth-foot { margin-top: 40px; font-size: 12.5px; color: var(--dusk); }
.auth .notice { color: var(--red-fg); }

/* ── Holds, pauses, documents (part 2) ──────────────────────────────────── */
.hold-banner { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 22px; padding: 14px 16px; border-radius: var(--radius); background: var(--red-bg); color: var(--red-fg); border-left: 3px solid var(--red-dot); }
.hold-banner > .i { margin-top: 2px; }
.hold-banner p { margin-top: 2px; font-size: 14px; color: var(--night); overflow-wrap: anywhere; }
.hold-banner .text-link { margin-top: 0; font-size: 17px; color: var(--red-fg); }
.hold-card { display: grid; gap: 18px; padding: 20px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--rule-soft); }
.hold-card.is-held { background: var(--red-bg); border-color: #E7BFB5; }
.hold-state { display: flex; gap: 14px; align-items: flex-start; }
.hold-state > div { min-width: 0; }
.hold-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--green-bg); color: var(--green-fg); }
.is-held .hold-icon { background: var(--red-dot); color: #fff; }
.is-held .eyebrow { color: var(--red-fg); }
.hold-card .quote { border-left-color: var(--red-dot); }
.btn-hold { min-height: 56px; font-size: 15.5px; width: 100%; }
@media (min-width: 760px) {
  .hold-card { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 24px 26px; }
  .btn-hold { width: auto; padding: 0 28px; }
}
.tag-paused { background: var(--yellow-bg); color: var(--yellow-fg); vertical-align: middle; margin-left: 4px; }
.decision-warn { border-left-color: var(--saffron); }
.field-gap { margin-top: 14px; }

.doc-checklist { display: grid; gap: 6px; margin: 4px 0 14px; }
@media (min-width: 640px) { .doc-checklist { grid-template-columns: 1fr 1fr; } }
.doc-checklist li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); min-width: 0; }
.doc-checklist .i { width: 17px; height: 17px; color: var(--dusk); }
.doc-checklist li.have { color: var(--night); }
.doc-checklist li.have .i { color: var(--green-dot); stroke-width: 2.2; }
.doc-list { display: grid; border-top: 1px solid var(--rule-soft); }
.doc-row { display: grid; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--rule-soft); min-width: 0; }
.doc-main { min-width: 0; }
.doc-main p { overflow-wrap: anywhere; }
.doc-kind { font-weight: 600; }
.doc-note { margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--rule); font: italic 400 15px/1.45 var(--serif); }
.doc-side { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.doc-btns { display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 900px) {
  .doc-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .doc-side { flex-direction: column; align-items: flex-end; }
}
.doc-actions { display: grid; gap: 8px; margin-top: 16px; }
@media (min-width: 640px) { .doc-actions { display: flex; flex-wrap: wrap; } }
.kind-pick { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.kind-pick legend { padding: 0; margin-bottom: 8px; }
.kind-option { position: relative; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 14px; border: 1px solid var(--rule); border-radius: 3px; background: #fff; cursor: pointer; font-size: 14.5px; }
.kind-option input { width: 18px; height: 18px; margin: 0; accent-color: var(--night); flex: none; }
.kind-option:has(input:checked) { border-color: var(--night); box-shadow: inset 0 0 0 1px var(--night); }
.field input[type=file] { padding: 10px; background: #fff; }
.progress { position: relative; height: 8px; margin-top: 14px; border-radius: 999px; background: var(--rule-soft); overflow: hidden; }
.progress > span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--saffron); border-radius: 999px; transition: width .15s ease; }

/* Show more (long lists render 50 rows at a time) */
.show-more { padding: 12px 16px; list-style: none; }
.mail-list .show-more { padding: 12px 0; }
.timeline li.show-more { border-left: 0; padding: 14px 0 6px; }
.timeline li.show-more::before { display: none; }
