/* Chapter Reimbursements — ink navy, parchment, one warm accent. Amounts in mono. */
:root {
  --bg: #f4f1ea;
  --sheet: #ffffff;
  --ink: #1b2435;
  --muted: #5d6677;
  --line: #d9d3c6;
  --accent: #b4532a;
  --navy: #1f3a5f;
  --ok: #1b7447;
  --warn: #8f5b00;
  --bad: #b5362a;
  --display: 'Inter', system-ui, sans-serif;
  --mono: 'Spline Sans Mono', ui-monospace, Menlo, monospace;
  --s-1: 0.85rem;
  --s0: 1rem;
  --s1: 1.3rem;
  --s2: 1.85rem;
  --s3: 2.6rem;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--display); font-size: var(--s0); line-height: 1.5; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; letter-spacing: -0.015em; }
h1 { font-size: var(--s3); font-weight: 700; }
h2 { font-size: var(--s1); font-weight: 700; }
p { margin: 0; }
a { color: var(--navy); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 3rem);
  background: linear-gradient(180deg, #223f66 0%, var(--navy) 100%);
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 1px 10px rgba(16, 26, 43, 0.18);
}
.masthead .wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: var(--s1);
  letter-spacing: -0.01em;
  text-decoration: none;
  color: #fff;
}
/* small monogram bug */
.masthead .wordmark::before {
  content: 'ΣΧ';
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.35);
}
.masthead a { color: #e9eef6; text-decoration: none; font-weight: 500; font-size: var(--s-1); }
.masthead a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.masthead .button.quiet { color: #fff; background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.4); }
.masthead .button.quiet:hover { background: rgba(255, 255, 255, 0.18); }
.page { max-width: 40rem; padding: clamp(1.5rem, 5vw, 3.5rem) clamp(1rem, 4vw, 3rem) 4rem; }
.lede { margin-top: 0.75rem; color: var(--muted); max-width: 36rem; }

/* ---------- form ---------- */
.claim { margin-top: 2rem; display: grid; gap: 1.4rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
@media (max-width: 30rem) { .row2 { grid-template-columns: 1fr; } }
.field label, .field .label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
.field .hint { display: block; font-size: var(--s-1); color: var(--muted); font-weight: 400; }
.field input, .field textarea, .field select { width: 100%; font: inherit; color: var(--ink); background: var(--sheet); border: 1.5px solid var(--ink); border-radius: 6px; padding: 0.65rem 0.75rem; }
.field input[type='file'] { padding: 0.5rem; background: var(--sheet); }
#receipt-preview { margin-top: 0.75rem; max-width: 100%; max-height: 240px; border: 1px solid var(--line); border-radius: 6px; }
.prefixed { display: flex; align-items: stretch; background: var(--sheet); border: 1.5px solid var(--ink); border-radius: 6px; }
.prefixed:focus-within { outline: 3px solid var(--navy); outline-offset: 2px; }
.prefixed span { display: grid; place-items: center; padding: 0 0.1rem 0 0.75rem; color: var(--muted); }
.prefixed input { border: 0; background: transparent; padding-left: 0.25rem; }
.prefixed input:focus-visible { outline: none; }
.field.amount .prefixed { border-width: 0 0 3px; border-radius: 0; background: transparent; }
.field.amount .prefixed span, .field.amount input { font-family: var(--mono); font-weight: 700; font-size: clamp(2.5rem, 12vw, 4rem); line-height: 1; }
.field.amount .prefixed span { padding-left: 0; color: var(--ink); }
.field.amount input { padding: 0.1rem 0 0.15rem 0.4rem; min-width: 0; }
.field.amount input::placeholder { color: var(--line); }
.field .error { display: block; margin-top: 0.35rem; color: var(--bad); font-size: var(--s-1); font-weight: 700; }
.field.invalid input, .field.invalid textarea, .field.invalid select, .field.invalid .prefixed { border-color: var(--bad); }

.button { font: inherit; font-weight: 700; color: var(--sheet); background: var(--navy); border: 1.5px solid var(--navy); border-radius: 6px; padding: 0.7rem 1.2rem; cursor: pointer; justify-self: start; }
.button:hover { background: #294c79; }
.button[disabled] { opacity: 0.55; cursor: progress; }
.button.quiet { color: var(--ink); background: transparent; border-color: var(--line); }
.button.quiet:hover { background: rgba(0, 0, 0, 0.05); }
.button.small { padding: 0.4rem 0.7rem; font-size: var(--s-1); }
.notice { border-left: 4px solid var(--bad); background: var(--sheet); padding: 0.7rem 0.9rem; font-weight: 700; border-radius: 0 6px 6px 0; }
.fineprint { font-size: var(--s-1); color: var(--muted); }

/* ---------- status slip ---------- */
.slip { position: relative; margin-top: 1.5rem; background: var(--sheet); border: 1.5px solid var(--ink); border-radius: 8px; padding: 1.75rem clamp(1.25rem, 4vw, 2.25rem); }
.slip .sum { font-family: var(--mono); font-weight: 700; font-size: clamp(2.5rem, 12vw, 4rem); line-height: 1; }
.slip .to { margin-top: 0.3rem; font-size: var(--s1); }
.slip dl { margin: 1.5rem 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.25rem; }
.slip dt { color: var(--muted); }
.slip dd { margin: 0; overflow-wrap: anywhere; }
.stamp { position: absolute; top: 1.25rem; right: 1.25rem; transform: rotate(-6deg); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--navy); border: 3px double currentColor; border-radius: 6px; padding: 0.2rem 0.7rem; background: var(--sheet); }
.stamp[data-status='paid'] { color: var(--ok); }
.stamp[data-status='needs_approval'] { color: var(--warn); }
.stamp[data-status='declined'], .stamp[data-status='failed'] { color: var(--bad); }
@media (prefers-reduced-motion: no-preference) { .stamp.fresh { animation: press 260ms cubic-bezier(0.2, 1.4, 0.4, 1); } @keyframes press { from { transform: rotate(-6deg) scale(1.6); opacity: 0; } } }
@media (max-width: 30rem) { .stamp { position: static; display: inline-block; margin-bottom: 1rem; } }
.explain { margin-top: 1.25rem; max-width: 34rem; }
.keep { margin-top: 2rem; display: grid; gap: 0.5rem; }
.keep .row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.keep input { flex: 1 1 14rem; min-width: 0; font: inherit; font-size: var(--s-1); border: 1.5px solid var(--line); border-radius: 6px; padding: 0.5rem 0.6rem; }

/* ---------- treasurer desk ---------- */
.desk { padding: 1.5rem clamp(1rem, 4vw, 3rem) 4rem; max-width: 92rem; }
.desk h1 { font-size: var(--s2); }
.mode { font-size: var(--s-1); font-weight: 700; border: 1.5px solid currentColor; border-radius: 6px; padding: 0.1rem 0.5rem; vertical-align: middle; }
.mode[data-mode='live'] { color: var(--bad); }
.mode[data-mode='sandbox'], .mode[data-mode='dry-run'] { color: var(--warn); }
.totals { display: flex; flex-wrap: wrap; gap: 1rem 3rem; margin: 1.5rem 0 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.totals .figure { font-family: var(--mono); font-weight: 700; font-size: var(--s2); line-height: 1.1; }
.totals .caption { color: var(--muted); font-size: var(--s-1); max-width: 20rem; }

.venmo { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); max-width: 36rem; }
.venmo h2 { margin-bottom: 0.4rem; }
.venmo .notice { margin-top: 0.6rem; }
.venmo-form { display: grid; gap: 0.9rem; margin-top: 0.9rem; }
.venmo > .button { margin-top: 0.9rem; }

.lane { min-width: 0; }
.lane > h2 { display: flex; align-items: baseline; gap: 0.5rem; padding-bottom: 0.4rem; border-bottom: 3px solid var(--ink); }
.lane > h2 .count { font-size: var(--s-1); font-weight: 400; color: var(--muted); }
.lane .empty { color: var(--muted); padding: 0.9rem 0; font-size: var(--s-1); }
.lanes { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 2rem; margin-top: 2.5rem; }
.entry { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.entry .top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.entry .who { font-weight: 700; overflow-wrap: anywhere; }
.entry .money { font-family: var(--mono); font-weight: 700; white-space: nowrap; }
.entry .what { overflow-wrap: anywhere; }
.entry .meta { color: var(--muted); font-size: var(--s-1); overflow-wrap: anywhere; }
.entry .why { color: var(--warn); font-size: var(--s-1); font-weight: 700; margin-top: 0.3rem; }
.entry .problem { color: var(--bad); font-size: var(--s-1); overflow-wrap: anywhere; }

.lane.pending .entry { padding: 1.1rem 0; }
.lane.pending .entry .money { font-size: var(--s1); }
.lane.pending .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }

/* receipt review */
.receipt-review { display: flex; gap: 0.9rem; margin: 0.75rem 0; align-items: flex-start; }
.thumb { width: 96px; height: 96px; object-fit: cover; border: 1.5px solid var(--line); border-radius: 6px; cursor: zoom-in; background: #efeadf; flex: none; }
.thumb.none { display: grid; place-items: center; color: var(--muted); font-size: var(--s-1); cursor: default; }
.receipt-detail { min-width: 0; }
.match-badge { display: inline-block; font-size: var(--s-1); font-weight: 700; border-radius: 999px; padding: 0.1rem 0.6rem; color: #fff; }
.match-badge.ok { background: var(--ok); }
.match-badge.warn { background: var(--warn); }
.match-badge.bad { background: var(--bad); }
.ocr-line { font-family: var(--mono); font-size: var(--s-1); margin-top: 0.35rem; }
.ocr-reason { font-size: var(--s-1); margin-top: 0.2rem; }
.ocr-notes { font-size: var(--s-1); color: var(--muted); margin-top: 0.15rem; }

.more { margin-top: 2.5rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.more summary { cursor: pointer; font-weight: 700; }
.more table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: var(--s-1); }
.more th, .more td { text-align: left; padding: 0.4rem 0.75rem 0.4rem 0; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.scroll { overflow-x: auto; }
.signin { max-width: 26rem; display: grid; gap: 1.25rem; margin-top: 2rem; }

/* lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(20, 24, 34, 0.9); display: grid; place-items: center; padding: 2rem; z-index: 50; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); }
