/* MSA Budget — VT maroon + burnt orange on neutral chrome */

:root {
  --maroon: #630031;        /* VT Chicago Maroon — official */
  --maroon-deep: #4a0026;
  --maroon-ink: #630031;
  --maroon-tint: #f0e6e6;
  --maroon-track: #e6d6d6;
  --orange: #cf4520;        /* VT Burnt Orange — official */
  --orange-tint: #fbe9df;

  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --border: rgba(11, 11, 11, 0.1);

  --good: #006300;
  --warn: #9a6a00;
  --critical: #d03b3b;
  --critical-tint: #fbe9e9;

  --shadow: 0 1px 2px rgba(11, 11, 11, 0.04), 0 8px 24px rgba(11, 11, 11, 0.05);
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --maroon: #7d1538;        /* deep maroon fill, readable on dark w/ white text */
    --maroon-deep: #630031;
    --maroon-ink: #e5713f;    /* burnt-orange accent text — no pink on dark */
    --maroon-tint: #2c1620;
    --maroon-track: #2c1620;
    --orange: #e5713f;
    --orange-tint: #2e211b;

    --page: #0d0d0d;
    --surface: #1a1a19;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --border: rgba(255, 255, 255, 0.1);

    --good: #0ca30c;
    --warn: #fab219;
    --critical: #e66767;
    --critical-tint: #3a2020;

    --shadow: none;
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}

h1, h2, h3 { margin: 0; font-weight: 700; }

a { color: var(--maroon-ink); font-weight: 600; }

/* ---- topbar ---- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--maroon);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
@media (prefers-color-scheme: dark) {
  .brand-mark { background: #7d1538; }
}
.brand-mark.big { width: 52px; height: 52px; font-size: 15px; margin: 0 auto 4px; }

.brand-text h1 { font-size: 17px; line-height: 1.1; }
.brand-sub { font-size: 12px; color: var(--muted); }

.tabs {
  display: flex;
  gap: 2px;
  margin-left: 8px;
  margin-right: auto;
  overflow-x: auto;
}

.tabs a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.tabs a:hover { background: var(--maroon-tint); color: var(--maroon-ink); }
.tabs a.active { background: var(--maroon); color: #fff; }

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  vertical-align: 1px;
}

/* ---- buttons, chips ---- */

.btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.btn.primary:hover { filter: brightness(1.15); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.danger { color: var(--critical); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--critical-tint); }

.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.chip.bucket { background: var(--maroon-tint); color: var(--maroon-ink); }
.chip.fund { border: 1px solid var(--grid); color: var(--ink-2); }
.chip.fund.generated { background: var(--orange-tint); border-color: transparent; color: var(--orange); }
.chip.fund.foundation { background: #e9f0fa; border-color: transparent; color: #1c5cab; }
@media (prefers-color-scheme: dark) {
  .chip.fund.foundation { background: #1c2733; color: #86b6ef; }
}
.chip.event { background: var(--page); border: 1px dashed var(--grid); color: var(--ink-2); font-weight: 600; }

.chip.status { font-weight: 700; }
.chip.status.pending { background: var(--orange-tint); color: var(--orange); }
.chip.status.paid { background: #e6f2e6; color: var(--good); }
@media (prefers-color-scheme: dark) {
  .chip.status.paid { background: #1d2b1d; }
}
.chip.status.none { color: var(--muted); }
.chip.status.submitted { background: #e9f0fa; color: #1c5cab; }
@media (prefers-color-scheme: dark) {
  .chip.status.submitted { background: #1c2733; color: #86b6ef; }
}

/* Confirm-before-save dialog */
.save-summary { margin: 10px 0 4px; }
.save-row {
  display: flex;
  gap: 10px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--grid);
  font-size: 14px;
  border-radius: 6px;
}
.save-row .save-label { flex: 0 0 140px; font-weight: 650; color: var(--ink-2); font-size: 13px; }
.save-row .save-value { flex: 1; word-break: break-word; }
.save-row.flag { background: var(--maroon-tint); }
.save-row.flag .save-value { font-weight: 700; color: var(--maroon-ink); }

/* Current main event + per-event attendance */
.event-now {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--page);
  border: 1px solid var(--grid);
  font-size: 14px;
}
.event-att { margin-bottom: 12px; padding: 12px 14px; }
.event-att-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.event-att-head .spacer { flex: 1; }
.att-count { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }
.att-toggle {
  cursor: pointer;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 650;
  color: var(--maroon-ink);
  list-style: none;
}
.att-toggle::-webkit-details-marker { display: none; }
.att-toggle::before { content: "▸ "; }
details[open] > .att-toggle::before { content: "▾ "; }

/* GobblerConnect filing sheet */
#gcDialog { width: min(660px, calc(100vw - 32px)); }
.gc-intro { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; }
.gc-section {
  margin: 14px 0 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.gc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--grid);
}
.gc-label { flex: 0 0 180px; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.gc-value { flex: 1; font-size: 14px; word-break: break-word; }
.gc-mark { border-bottom: none; margin-top: 10px; }
.gc-mark input { flex: 1; }
@media (max-width: 560px) {
  .gc-row { flex-wrap: wrap; }
  .gc-label { flex-basis: 100%; }
}

.chip.wallet-apple { background: #111; color: #fff; }
.chip.wallet-google { background: #e8f0fe; color: #1a73e8; }
.chip.wallet-none { background: transparent; border: 1px dashed var(--grid); color: var(--muted); font-weight: 600; }
@media (prefers-color-scheme: dark) {
  .chip.wallet-apple { background: #ededed; color: #111; }
  .chip.wallet-google { background: #24324a; color: #8ab4f8; }
}

/* ---- layout ---- */

.view {
  max-width: 1150px;
  margin: 0 auto;
  padding: 22px 22px 80px;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 26px 0 10px;
}
.section-head:first-child { margin-top: 0; }
.section-head h2 { font-size: 16px; }
.section-head .sub { color: var(--muted); font-size: 13px; }
.section-head .spacer { flex: 1; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---- stat tiles ---- */

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.kpi { padding: 14px 16px; }
.kpi .label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.kpi .value { font-size: 28px; font-weight: 750; margin-top: 2px; }
.kpi .sub { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.kpi .value.good { color: var(--good); }
.kpi .value.critical { color: var(--critical); }

/* ---- fund cards ---- */

.funds-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.fund-card { padding: 14px 16px; }
.fund-card .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.fund-card .name { font-weight: 750; }
.fund-card .name .note { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 6px; }
.fund-card .nums { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; }
.fund-card .remaining { font-size: 22px; font-weight: 750; }
.fund-card .of { font-size: 13px; color: var(--muted); }

/* ---- meters ---- */

.meter {
  height: 8px;
  margin-top: 10px;
  border-radius: 4px;
  background: var(--maroon-track);
  overflow: hidden;
}
.meter > i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--maroon);
  min-width: 0;
}
.meter.over > i { background: var(--critical); }
.meter-caption { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12.5px; color: var(--ink-2); }
.meter-caption .flag { font-weight: 700; }
.meter-caption .flag.over { color: var(--critical); }
.meter-caption .flag.close { color: var(--warn); }

/* ---- tables ---- */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 10px 12px 6px;
  border-bottom: 1px solid var(--grid);
  white-space: nowrap;
}

td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--grid);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.strong { font-weight: 650; }
td .sub, .sub-line { display: block; font-size: 12.5px; color: var(--muted); }

tbody tr.rowlink { cursor: pointer; }
tbody tr.rowlink:hover td { background: color-mix(in srgb, var(--maroon-tint) 45%, transparent); }

tfoot td { font-weight: 700; border-top: 1px solid var(--grid); border-bottom: none; }

.bucket-meter { min-width: 140px; }
.bucket-meter .meter { margin-top: 0; }
.bucket-meter .pct { font-size: 12px; color: var(--muted); margin-top: 3px; display: block; }

td.rank { font-size: 16px; width: 40px; }

.empty code {
  background: var(--page);
  border: 1px solid var(--grid);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 12.5px;
}

/* ---- filter bar ---- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.filters input[type="search"] { flex: 1 1 180px; }
.filters select { max-width: 180px; }
.filters .count { color: var(--muted); font-size: 13px; margin-left: auto; }

input, select {
  padding: 8px 10px;
  border: 1px solid var(--grid);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}
input:focus, select:focus { outline: 2px solid var(--maroon); outline-offset: 0; border-color: transparent; }
@media (prefers-color-scheme: dark) {
  input:focus, select:focus { outline-color: #e5713f; }
}

/* ---- empty states ---- */

.empty {
  padding: 42px 20px;
  text-align: center;
  color: var(--muted);
}
.empty .big { font-size: 34px; margin-bottom: 6px; }
.empty p { margin: 4px 0 14px; }

/* ---- event cards ---- */

.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.event-card { padding: 14px 16px; }
.event-card .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.event-card h3 { font-size: 15px; }
.event-card .date { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.event-card .total { font-size: 22px; font-weight: 750; margin-top: 6px; }
.event-card .meta { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.event-card .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.event-att-line { display: flex; align-items: baseline; gap: 6px; margin-top: 8px; font-size: 13.5px; }
.event-att-line .strong { font-size: 17px; font-weight: 750; }

/* ---- reimburse ---- */

.person-card { margin-bottom: 14px; }
.person-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--grid);
}
.person-head .who { font-weight: 750; }
.person-head .owed { margin-left: auto; font-weight: 750; font-size: 17px; color: var(--orange); font-variant-numeric: tabular-nums; }

/* ---- dialogs ---- */

dialog {
  width: min(560px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  /* scroll inside the dialog, never chain out to the page behind it */
  max-height: min(88dvh, 88vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* while a modal is up, the page underneath is frozen */
body.modal-open { overflow: hidden; }
dialog::backdrop { background: rgba(11, 11, 11, 0.45); }

dialog h2 { font-size: 17px; margin-bottom: 14px; }

dialog form { display: flex; flex-direction: column; gap: 12px; }
dialog label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 650; color: var(--ink-2); }
dialog label .hint { font-weight: 500; color: var(--muted); }
dialog input, dialog select { width: 100%; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.money-input { position: relative; }
.money-input span {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
}
.money-input input { padding-left: 24px; }

.dialog-actions { display: flex; gap: 8px; margin-top: 6px; align-items: center; }
.dialog-actions .spacer { flex: 1; }

.form-error { color: var(--critical); font-size: 13.5px; margin: 0; font-weight: 600; }

/* ---- login ---- */

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: var(--page);
}
.login-card {
  width: min(340px, calc(100vw - 40px));
  padding: 28px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.login-card h2 { font-size: 18px; }
.login-card p { margin: 0; color: var(--ink-2); font-size: 14px; }

/* ---- toast ---- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 60;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--page);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.toast.error { background: var(--critical); color: #fff; }

/* ---- event pass admin ---- */

.pass-editor label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 650; color: var(--ink-2); margin-bottom: 12px; }
.pass-editor .dialog-actions { display: flex; align-items: center; margin-top: 4px; }
.pass-editor .dialog-actions .spacer { flex: 1; }
.pass-warn { border-left: 3px solid #d08700; }
.pass-warn .sub { margin-top: 4px; }
.share-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.share-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.urlbox { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: rgba(0, 0, 0, 0.05); padding: 6px 10px; border-radius: 6px; overflow: auto; max-width: 100%; }
@media (prefers-color-scheme: dark) { .urlbox { background: rgba(255, 255, 255, 0.08); } }

/* ---- brand logo ---- */

.brand-logo { height: 44px; width: 44px; object-fit: contain; background: #fff; border-radius: 10px; padding: 4px; box-sizing: border-box; flex: none; }
.brand-logo.big { height: 84px; width: 84px; border-radius: 18px; padding: 8px; margin: 0 auto 6px; }
.admin-tab { margin-left: auto; opacity: 0.7; }
.admin-tab:hover { opacity: 1; }

/* ---- check-in scanner ---- */

.checkin-card { padding: 14px; }
.checkin-card .scanner { display: flex; justify-content: center; }
.checkin-card video { width: 100%; max-width: 420px; aspect-ratio: 4 / 3; object-fit: cover; background: #000; border-radius: 12px; }
.scan-state { text-align: center; margin: 12px 0 4px; font-weight: 600; min-height: 1.4em; }
.scan-state.ok { color: #1f9d55; }
.scan-state.warn { color: #c58a00; }
.scan-state.bad { color: var(--critical, #c0392b); }

.btn.block { display: block; width: 100%; padding: 13px 14px; font-size: 16px; }

.manual-entry { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.manual-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.manual-row { display: flex; gap: 8px; }
.manual-row input { flex: 1; min-width: 0; text-transform: uppercase; font-size: 16px; }
.manual-row .btn { flex: none; }

/* ---- scan result: full-screen flash (like a ticket gate) ---- */
.scan-overlay {
  position: fixed; inset: 0; z-index: 3000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px calc(24px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(24px + env(safe-area-inset-left));
  background: #12b76a; color: #fff; text-align: center;
  animation: scanIn 0.16s ease-out;
}
.scan-overlay.warn { background: #d9920b; }
.scan-overlay.bad { background: #d0342b; }
.scan-overlay[hidden] { display: none; }
.scan-overlay-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 460px; }
.scan-mark {
  width: 128px; height: 128px; border-radius: 999px; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.2); font-size: 74px; line-height: 1; font-weight: 700;
  animation: scanPop 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}
.scan-name { font-size: 30px; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; }
.scan-detail { font-size: 18px; font-weight: 600; opacity: 0.95; }
.scan-reward { margin-top: 4px; font-size: 17px; font-weight: 800; background: rgba(255, 255, 255, 0.22); padding: 7px 18px; border-radius: 999px; }
.scan-hint { margin-top: 12px; font-size: 13px; opacity: 0.8; }
@keyframes scanIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scanPop { 0% { transform: scale(0.3); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }

/* ---- responsive ---- */

@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap; gap: 10px;
    padding: calc(10px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
  }
  .tabs { order: 3; width: 100%; margin: 0; -webkit-overflow-scrolling: touch; }
  .topbar .btn.primary { margin-left: auto; }
  .view {
    padding-top: 16px;
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
  .grid2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px; }
  .kpi .value { font-size: 22px; }
  .kpi .sub { font-size: 12px; }
  .section-head { margin: 20px 0 8px; flex-wrap: wrap; row-gap: 6px; }
  /* 16px inputs stop iOS from zooming the page when a field is focused */
  input, select, textarea { font-size: 16px; }
}

/* Upcoming event schedule */
.sched-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; margin-bottom: 8px; }
.sched-when {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--maroon-ink);
  font-variant-numeric: tabular-nums;
  min-width: 150px;
}
.sched-main { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sched-row .spacer { flex: 1; }
@media (max-width: 640px) {
  .sched-row { flex-wrap: wrap; }
  .sched-when { flex-basis: 100%; min-width: 0; }
}
.sched-notice { flex-basis: 100%; }
.sched-drop { color: var(--muted); }

/* "What is this?" request-type picker */
#kindDialog { width: min(560px, calc(100vw - 32px)); }
.kind-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kind-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 14px;
  border: 1px solid var(--grid);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.kind-card:hover { border-color: var(--maroon); background: var(--maroon-tint); }
.kind-emoji { font-size: 26px; line-height: 1; }
.kind-title { font-weight: 750; font-size: 15px; }
.kind-sub { font-size: 13px; color: var(--ink-2); }
@media (max-width: 520px) { .kind-picker { grid-template-columns: 1fr; } }

/* Receipt scan feedback */
.scan-status { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.scan-status.working { color: var(--maroon-ink); }
.scan-status.ok { color: var(--good); }

/* file input that a styled card stands in for — must stay focusable, not display:none */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
label.kind-card { cursor: pointer; }

/* OCR amount candidates — tap the right one */
.scan-picks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.picks-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.pick {
  padding: 3px 9px;
  border: 1px solid var(--grid);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.pick:hover { border-color: var(--maroon); }
.pick.on { background: var(--maroon); border-color: var(--maroon); color: #fff; }
#pReceiptCurrent { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* WHERE-field line-break preview */
.venue-preview { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.5; }
.venue-preview b { color: var(--ink); }

/* "add someone we missed" picker */
#attendDialog { width: min(560px, calc(100vw - 32px)); }
#attendSearch { width: 100%; }
.attend-list { max-height: 46vh; overflow-y: auto; margin-top: 10px; overscroll-behavior: contain; }
.attend-row {
  display: flex; align-items: baseline; gap: 8px; width: 100%;
  padding: 9px 10px; margin-bottom: 4px;
  border: 1px solid var(--grid); border-radius: 9px;
  background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.attend-row:hover { border-color: var(--maroon); background: var(--maroon-tint); }
.attend-row:disabled { opacity: .5; }
.attend-row .spacer { flex: 1; }

/* ---- nav: a visible gap between "running events" and "the money" ---------- */
.tab-group { display: flex; align-items: center; gap: 2px; }

/* the money side gets its own tinted well, so you always know which half of
   the app you're standing in */
.tab-group.money {
  position: relative;
  margin-left: 18px;
  padding: 3px 8px 3px 6px;
  border-radius: 11px;
  background: var(--maroon-tint);
  border: 1px solid var(--grid);
}
.tab-group.money::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--grid);
}
.tab-group-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--maroon-ink);
  padding: 0 6px 0 2px;
  white-space: nowrap;
  opacity: .85;
}
.tab-group.money a.active { background: var(--maroon); color: #fff; }

@media (max-width: 900px) {
  .tab-group.money { margin-left: 12px; }
  .tab-group.money::before { left: -7px; }
}

/* the header shouldn't wrap onto three lines and starve the tabs */
.brand-text h1, .brand-sub { white-space: nowrap; }
@media (max-width: 1000px) {
  .brand-text { display: none; }   /* logo alone identifies it */
  .topbar { gap: 12px; }
}
/* the primary action shrinks to its icon when the tabs need the room */
.btn-short { display: none; }
@media (max-width: 1100px) {
  .btn-full { display: none; }
  .btn-short { display: inline; font-size: 17px; }
  #addPurchaseBtn { padding: 8px 13px; }
}
.tab-group.tail { margin-left: 10px; }

/* ---- find-a-member lookup (Event Pass) ---- */
.lookup { padding: 14px 16px; }
.lookup input[type="search"] { width: 100%; }
.lookup-results { margin-top: 10px; }
.lookup-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--grid);
}
.lookup-row:last-child { border-bottom: none; }
.lookup-status { display: flex; align-items: center; gap: 8px; justify-self: end; }
.lookup-hist { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.hist {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--page);
  border: 1px solid var(--grid);
  color: var(--ink-2);
}
@media (max-width: 620px) {
  .lookup-row { grid-template-columns: 1fr; }
  .lookup-status { justify-self: start; }
}
