/* LapFund – base styles. No external resources (CSP: 'self' only).
   Club color comes from /theme.css as --accent, --accent-dark, --on-accent. */

@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/barlow-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }

:root {
  --accent: #0B5FA8;
  --accent-dark: #08467C;
  --on-accent: #FFFFFF;
  --ink: #14212E;
  --ink-2: #3B4A58;
  --muted: #586776;
  --line: #DCE3EA;
  --line-strong: #B9C5D1;
  --bg: #F3F6F9;
  --surface: #FFFFFF;
  --nav: #14212E;
  --ok-bg: #E1F4E7; --ok-ink: #1B6B3A;
  --warn-bg: #FFF1C7; --warn-ink: #6B4A00;
  --err-bg: #FDE8E6; --err-ink: #9E2418;
  --info-bg: #E6F0FA; --info-ink: #0B4A82;
  --radius: 12px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Barlow Condensed", "Barlow", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--bg); }
img { max-width: 100%; height: auto; }
a { color: var(--accent-dark); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
code, .input--mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }

.h1 { font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1.1; margin: 0 0 8px; }
.h2 { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.2; margin: 0; }
.lead { font-size: 17px; color: var(--ink-2); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.stack > * + * { margin-top: 16px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip-link:focus { left: 8px; }

/* Cards and layout helpers */
.card { background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: 0 1px 2px rgba(20, 33, 46, 0.08); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.cols { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.cols__main { flex: 999 1 480px; min-width: 0; }
.cols__side { flex: 1 1 300px; }
.cols__side .facts div { flex-direction: column; gap: 0; }
.cols__side .facts dd { text-align: left; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.back { display: inline-block; font-size: 14px; margin-bottom: 4px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .label, .fieldset legend { font-weight: 600; font-size: 15px; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="search"], input[type="date"], input[type="datetime-local"], select, textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--surface);
  min-height: 48px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 10px; width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input[readonly] { background: var(--bg); }
input[type="file"] { font: inherit; }
input[type="color"] { width: 64px; height: 48px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
.input--code { font-size: 26px; letter-spacing: 0.25em; text-align: center; font-variant-numeric: tabular-nums; }
.field__help { margin: 0; font-size: 14px; color: var(--muted); }
.field__error { margin: 0; font-size: 14px; color: var(--err-ink); font-weight: 600; }
.field--error input { border-color: var(--err-ink); }
.fieldset { border: 0; margin: 0; padding: 0; }
.fieldset legend { padding: 0; margin-bottom: 10px; }
.fieldset legend.h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.fieldset + .fieldset, .stack > .fieldset:first-of-type { margin-top: 28px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.choice input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.choice:has(input:checked) { border: 2px solid var(--accent); background: #F4F8FC; padding: 11px 13px; }
.copy-row { display: flex; gap: 8px; flex-wrap: wrap; }
.copy-row input { flex: 1 1 280px; font-size: 14px; }
.color-row { display: flex; align-items: center; gap: 12px; }
.swatch-sample { display: inline-flex; align-items: center; min-height: 48px; padding: 0 18px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-weight: 600; }
.logo-preview { display: inline-flex; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); width: max-content; }
.logo-preview img { max-height: 96px; width: auto; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-dark); color: #FFFFFF; }
.btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn--secondary:hover { border-color: var(--ink); color: var(--ink); }
.btn--danger { background: var(--surface); color: var(--err-ink); border-color: var(--err-ink); }
.btn--danger:hover { background: var(--err-bg); }
.btn--link { background: none; border: 0; color: var(--accent-dark); text-decoration: underline; padding: 0; min-height: 44px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.cols__side form + form { margin-top: 8px; }
.inline-form { margin-top: 8px; }
.row-actions { display: flex; gap: 14px; align-items: center; }
.row-actions .inline-form { margin-top: 0; }

/* Notices and badges */
.notice { border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; font-size: 15px; }
.notice--success { background: var(--ok-bg); color: var(--ok-ink); }
.notice--warning { background: var(--warn-bg); color: var(--warn-ink); }
.notice--error { background: var(--err-bg); color: var(--err-ink); }
.notice--info { background: var(--info-bg); color: var(--info-ink); }
.badge { display: inline-block; font-size: 13px; font-weight: 600; border-radius: 999px; padding: 3px 10px; white-space: nowrap; background: #E8ECF0; color: var(--ink-2); }
.badge--active { background: var(--ok-bg); color: var(--ok-ink); }
.badge--invited, .badge--totp_pending { background: var(--info-bg); color: var(--info-ink); }
.badge--locked { background: var(--warn-bg); color: var(--warn-ink); }
.badge--inactive { background: #E8ECF0; color: var(--muted); }

/* Lists */
.facts { margin: 0; display: grid; gap: 8px; }
.facts div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; }
.checks, .checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.checks__item, .checklist__item { display: flex; gap: 10px; align-items: baseline; }
.checks__icon, .checklist__icon { font-weight: 700; width: 18px; flex-shrink: 0; }
.checks__item.is-ok .checks__icon, .checklist__item.is-done .checklist__icon { color: var(--ok-ink); }
.checks__item.is-fail { color: var(--err-ink); font-weight: 600; }
.checklist__item.is-done { color: var(--muted); }
.steps { padding-left: 22px; }
.steps li + li { margin-top: 6px; }
.codes { list-style: none; padding: 16px; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; background: var(--bg); border-radius: 10px; font-size: 17px; }
.qr { margin: 16px 0; text-align: center; }
.qr img { border: 1px solid var(--line); border-radius: 10px; image-rendering: pixelated; }
.secret { display: inline-block; margin-top: 6px; font-size: 15px; letter-spacing: 0.05em; word-break: break-all; }
.debug { white-space: pre-wrap; font-size: 13px; background: var(--bg); padding: 12px; border-radius: 8px; overflow-x: auto; }

/* Tables */
.table-wrap { background: var(--surface); border-radius: var(--radius); overflow-x: auto; box-shadow: 0 1px 2px rgba(20, 33, 46, 0.08); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
.table th { text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; border-bottom: 1px solid #EEF2F5; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table a { color: var(--ink); }

/* Auth pages */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 32px 16px; gap: 20px; border-top: 6px solid var(--accent); }
.auth__brand { display: flex; align-items: center; gap: 12px; }
.auth__logo { width: 56px; height: 56px; object-fit: contain; }
.auth__club { font-family: var(--font-display); font-weight: 700; font-size: 24px; }
.auth__card { width: 100%; max-width: 440px; }
.page-auth--wide .auth__card { max-width: 680px; }
.auth__footer { font-size: 13px; color: var(--muted); }

/* Admin shell */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.nav { flex: 1 1 240px; max-width: 100%; background: var(--nav); color: #FFFFFF; padding: 20px 16px; display: flex; flex-direction: column; gap: 20px; }
/* Side bar stays in view on long pages, so the account box with «Abmelden» is always visible (issue #15) */
@media (min-width: 821px) {
  .nav { position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto; }
  .nav__account { position: sticky; bottom: 0; background: var(--nav); }
}
.nav__brand { display: flex; align-items: center; gap: 10px; }
.nav__logo { width: 40px; height: 40px; object-fit: contain; background: #FFFFFF; border-radius: 8px; padding: 2px; }
.nav__club { font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.1; }
.nav__group { display: flex; flex-direction: column; gap: 2px; }
.nav__heading { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: #9FB0C1; padding: 0 10px 6px; }
.nav__link { color: #DDE5EC; text-decoration: none; padding: 10px; border-radius: 8px; min-height: 44px; display: flex; align-items: center; }
.nav__link:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.08); }
.nav__link.is-active { color: #FFFFFF; background: rgba(255, 255, 255, 0.14); font-weight: 600; }
.nav__link:focus-visible, .nav__logout:focus-visible { outline-color: #FFFFFF; }
.nav__account { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, 0.15); padding-top: 16px; display: flex; flex-direction: column; gap: 2px; }
.nav__user { font-weight: 600; }
.nav__role { font-size: 13px; color: #9FB0C1; margin-bottom: 8px; }
.nav__logout { background: none; border: 1px solid rgba(255, 255, 255, 0.3); color: #FFFFFF; font: inherit; font-size: 14px; border-radius: 8px; min-height: 40px; padding: 0 12px; cursor: pointer; width: 100%; text-align: left; }
.nav__logout:hover { background: rgba(255, 255, 255, 0.08); }
.main { flex: 999 1 560px; min-width: 0; padding: 28px 32px 48px; }
.main > .card + .card, .main > section + section { margin-top: 16px; }

/* Events */
.main > * + * { margin-top: 16px; }
.main > .page-head + * { margin-top: 0; }
.page-head__badges { display: flex; gap: 8px; flex-wrap: wrap; }
.event-meta { margin: 0; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line-strong); margin-bottom: 20px; }
.tabs__link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; color: var(--ink-2); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs__link:hover { color: var(--ink); }
.tabs__link.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.event-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.event-card { display: flex; flex-direction: column; gap: 6px; color: var(--ink); text-decoration: none; border-top: 4px solid var(--accent); }
.event-card:hover { color: var(--ink); box-shadow: 0 2px 8px rgba(20, 33, 46, 0.16); }
.event-card.is-archived { opacity: 0.75; border-top-color: var(--line-strong); }
.event-card__top { display: flex; gap: 6px; flex-wrap: wrap; }
.event-card__name { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.2; }
.event-card__stats { display: flex; gap: 16px; color: var(--ink-2); margin-top: auto; }
.event-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 10px; }
.event-list__item .badge { margin-left: 6px; }
.badge--status-preparation { background: #E8ECF0; color: var(--ink-2); }
.badge--status-collecting { background: var(--info-bg); color: var(--info-ink); }
.badge--status-run_done { background: var(--warn-bg); color: var(--warn-ink); }
.badge--status-billing { background: #F1E6FA; color: #5B2A86; }
.badge--status-closed { background: var(--ok-bg); color: var(--ok-ink); }
.badge--assigned { background: var(--accent); color: var(--on-accent); }
.empty { text-align: center; padding: 40px 24px; }
.empty .h2 { margin-bottom: 8px; }
.form-narrow { max-width: 720px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cards--wide { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.inline-check { display: flex; gap: 10px; align-items: center; font-weight: 400; cursor: pointer; min-height: 32px; }
.inline-check input { width: 20px; height: 20px; accent-color: var(--accent); }
.checks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.choice--compact { margin-bottom: 0; padding: 10px 12px; }
.choice--compact:has(input:checked) { padding: 9px 11px; }
.logo-preview--qr img { max-height: 180px; }
textarea { min-height: 0; resize: vertical; line-height: 1.5; }
select { appearance: auto; }
.field--error textarea, .field--error select { border-color: var(--err-ink); }

/* Status stepper */
.stepper { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; counter-reset: step; }
.stepper__step { flex: 1 1 120px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 10px; border-top: 4px solid var(--line); color: var(--muted); font-size: 14px; }
.stepper__dot { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--line); color: var(--ink-2); font-weight: 700; font-size: 14px; }
.stepper__step.is-done { border-top-color: var(--ok-ink); color: var(--ink-2); }
.stepper__step.is-done .stepper__dot { background: var(--ok-bg); color: var(--ok-ink); }
.stepper__step.is-current { border-top-color: var(--accent); color: var(--ink); font-weight: 600; }
.stepper__step.is-current .stepper__dot { background: var(--accent); color: var(--on-accent); }

/* Teams and participant tables */
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions form { display: inline-flex; vertical-align: middle; margin-left: 8px; }
.table .check-col { width: 48px; }
.table .check-col input { width: 20px; height: 20px; accent-color: var(--accent); }
.table tr.is-muted td { color: var(--muted); }
.break { word-break: break-word; }
.rename-row { display: flex; gap: 8px; align-items: center; }
.rename-row input { min-height: 40px; max-width: 280px; }
.icon-actions { display: flex; gap: 4px; }
.btn--small { min-height: 40px; padding: 0 12px; font-size: 14px; }
.btn--icon { min-width: 40px; min-height: 40px; padding: 0; background: var(--surface); border-color: var(--line-strong); color: var(--ink); font-size: 18px; }
.btn--icon:hover:not([disabled]) { border-color: var(--ink); }
.btn--danger-link { color: var(--err-ink); }
.inline-add .field { margin-bottom: 0; }
.inline-add .copy-row input { font-size: 16px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: flex-end; }
.filter-bar .field { flex: 0 1 220px; }
.filter-bar__grow { flex: 1 1 260px !important; }
.filter-bar__actions { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.copy-row--labelled { align-items: flex-end; }
.copy-row--labelled .field { margin-bottom: 0; }
.copy-row .field input { flex: none; }
.pool-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.pool-list__item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.pool-list__form { display: flex; gap: 8px; align-items: center; }
.pool-list__form select { min-height: 40px; width: auto; padding: 6px 10px; }

/* CSV import */
.code-sample { background: var(--bg); border-radius: 10px; padding: 12px 14px; font-size: 13px; overflow-x: auto; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.summary-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border-radius: 999px; background: #E8ECF0; font-weight: 600; font-size: 14px; }
.chip--new { background: var(--ok-bg); color: var(--ok-ink); }
.chip--existing { background: var(--info-bg); color: var(--info-ink); }
.chip--error { background: var(--err-bg); color: var(--err-ink); }
.badge--import-new { background: var(--ok-bg); color: var(--ok-ink); }
.badge--import-existing { background: var(--info-bg); color: var(--info-ink); }
.badge--import-invalid { background: var(--err-bg); color: var(--err-ink); }
.import-row--in_event td, .import-row--duplicate td { color: var(--muted); }
.import-row--invalid td { background: #FFF8F7; }
.chip--warning, .badge--import-amount_diff { background: var(--warn-bg); color: var(--warn-ink); }
.badge--import-ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge--import-unmatched, .badge--import-other_event, .badge--import-cancelled, .badge--import-laps_missing { background: var(--err-bg); color: var(--err-ink); }
.import-row--already_paid td, .import-row--duplicate td { color: var(--muted); }

/* Stage 3: mails */
.h3 { font-size: 17px; font-weight: 700; margin: 8px 0 0; }
.grid-2--tight { gap: 0 12px; }
.page-head--inline { margin-bottom: 0; align-items: center; }
.mail-counts { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.mail-counts div { flex: 1 1 120px; background: var(--bg); border-radius: 10px; padding: 10px 14px; }
.mail-counts dt { font-size: 13px; color: var(--muted); }
.mail-counts dd { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.batch { display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.batch__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.batch progress { width: 100%; height: 10px; accent-color: var(--accent); }
.badge--mail-sent { background: var(--ok-bg); color: var(--ok-ink); }
.badge--mail-queued, .badge--mail-sending { background: var(--info-bg); color: var(--info-ink); }
.badge--mail-failed { background: var(--err-bg); color: var(--err-ink); }
.badge--mail-cancelled { background: #E8ECF0; color: var(--muted); }
a.chip { color: var(--ink); text-decoration: none; display: inline-block; }
a.chip:hover { background: var(--line); }
.chip--active { background: var(--ink) !important; color: #FFFFFF !important; }

/* Public and participant pages (mobile first) */
.page-public { background: var(--bg); }
.pub-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.pub-head__inner { max-width: 560px; margin: 0 auto; padding: 12px 16px; display: flex; gap: 12px; align-items: center; }
.pub-head__logo { width: 44px; height: 44px; object-fit: contain; }
.pub-head__club { font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.15; }
.pub-head__event { font-size: 14px; color: var(--muted); }
.pub-main { max-width: 560px; margin: 0 auto; padding: 24px 16px 8px; }
.pub-main > * + * { margin-top: 16px; }
.pub-title { font-family: var(--font-display); font-weight: 700; font-size: 38px; line-height: 1.05; margin: 0; }
.pub-foot { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; font-size: 14px; color: var(--muted); }
.pub-foot p { margin: 0 0 8px; }
.pub-foot__links { display: flex; gap: 16px; }
.pub-foot a { color: var(--ink-2); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.summary { background: var(--accent); color: var(--on-accent); border-radius: var(--radius); padding: 20px; }
.summary__label { margin: 0 0 8px; font-size: 14px; font-weight: 600; opacity: 0.85; font-family: var(--font); }
.summary__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.summary__value { display: block; font-family: var(--font-display); font-weight: 700; font-size: 32px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.summary__hint { font-size: 14px; opacity: 0.85; }
.summary__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid currentColor; border-top-color: rgba(127, 127, 127, 0.45); font-size: 14px; }
.share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.share-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 72px; padding: 8px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; text-align: center; }
.share-btn:hover { border-color: var(--ink); color: var(--ink); }
.share-btn__icon { width: 22px; height: 22px; }
.share-main { width: 100%; gap: 8px; min-height: 52px; }
.share-main[hidden] { display: none; }
.qr-box summary { cursor: pointer; font-weight: 600; color: var(--accent-dark); min-height: 44px; display: flex; align-items: center; }
.qr-box img { display: block; margin: 8px auto; border: 1px solid var(--line); border-radius: 10px; image-rendering: pixelated; }
.qr-box p { text-align: center; }
.card > p:only-child { margin: 0; }
.quote { font-size: 17px; color: var(--ink-2); margin: 0; white-space: pre-line; }
.pledge-list { list-style: none; margin: 0; padding: 0 24px; }
.pledge-list__item { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pledge-list__item:last-child { border-bottom: 0; }
.pledge-list__amount { font-weight: 700; text-align: right; }
.sibling-switch { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { font: inherit; font-weight: 600; font-size: 15px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; }
.chip-btn.is-current { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }

/* Stage 4: pledges */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented__option { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; background: var(--surface); }
.segmented__option input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.segmented__option:has(input:checked) { border: 2px solid var(--accent); padding: 11px; background: #F4F8FC; }
.amount-row { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
.amount-row:focus-within { outline: 3px solid var(--accent); border-color: var(--accent); }
.amount-row__currency { padding: 0 4px 0 14px; font-weight: 600; color: var(--muted); }
.amount-row input { border: 0 !important; outline: none !important; font-size: 22px; font-weight: 700; min-height: 52px; }
.field--error .amount-row { border-color: var(--err-ink); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-check--top { align-items: flex-start; }
.inline-check--top input { margin-top: 3px; flex-shrink: 0; }
.req { color: var(--err-ink); font-weight: 700; }

/* «Stay in touch» switch on the sponsor form: the whole card toggles a checkbox */
.optin { display: block; cursor: pointer; position: relative; }
.optin input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.optin__box { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); }
.optin__icon { flex: 0 0 auto; font-size: 1.6rem; line-height: 1; }
.optin__body { flex: 1; min-width: 0; }
.optin__title { display: block; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; line-height: 1.25; }
.optin__text { display: block; margin-top: 4px; font-size: .82rem; line-height: 1.4; }
.optin__switch { flex: 0 0 58px; height: 34px; border-radius: 17px; background: #C9D2DC; position: relative; }
.optin__switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: left .15s; }
.optin input:checked + .optin__box { border: 2px solid var(--accent); padding: 15px 17px; background: #F1F6FB; background: color-mix(in srgb, var(--accent) 7%, white); }
.optin input:checked + .optin__box .optin__switch { background: var(--accent); }
.optin input:checked + .optin__box .optin__switch::after { left: 27px; }
.optin input:focus-visible + .optin__box { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .optin__switch::after { transition: none; } }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pledge-list__status { text-align: right; }
.pledge-list__msg { grid-column: 1 / -1; color: var(--ink-2); font-style: italic; }
.pledge-list__cash { grid-column: 1 / -1; }
.cash-toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; }
.cash-toggle__box { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 2px solid var(--line-strong); border-radius: 6px; font-weight: 700; color: var(--on-accent); }
.cash-toggle.is-checked .cash-toggle__box { background: var(--accent); border-color: var(--accent); }
.pdf-link { font-weight: 600; }
.twint-qr { text-align: center; }
.twint-qr img { max-width: 260px; width: 100%; border: 1px solid var(--line); border-radius: 10px; }
.twint-pay { display: flex; justify-content: center; }
.badge--pledge-open { background: var(--info-bg); color: var(--info-ink); }
.badge--pledge-cash_received { background: var(--warn-bg); color: var(--warn-ink); }
.badge--pledge-paid { background: var(--ok-bg); color: var(--ok-ink); }
.badge--pledge-cancelled { background: #E8ECF0; color: var(--muted); }
.table-wrap--flat { box-shadow: none; border: 1px solid var(--line); }
.table--compact { min-width: 0; }

/* Stage 5: laps and billing */
.money-counts dd { font-size: 24px; }
.money-counts--small dd { font-size: 20px; }
.badge--state-open { background: var(--err-bg); color: var(--err-ink); }
.badge--state-partial { background: var(--warn-bg); color: var(--warn-ink); }
.badge--state-done { background: var(--ok-bg); color: var(--ok-ink); }
.badge--state-none { background: #E8ECF0; color: var(--muted); }
.lap-table td { padding-top: 6px; padding-bottom: 6px; }
.lap-table tr.is-error td { background: #FFF8F7; }
.lap-input { width: 80px !important; min-height: 40px !important; text-align: right; font-size: 18px !important; font-weight: 700; font-variant-numeric: tabular-nums; }
.mail-preview { background: var(--bg); border-radius: 10px; padding: 12px 14px; }
.mail-preview pre { white-space: pre-wrap; font-family: var(--font); font-size: 14px; margin: 8px 0 0; }
.actions-col { white-space: nowrap; text-align: right; }
.inline-details { display: inline-block; text-align: left; }
.inline-details summary { list-style: none; }
.inline-details summary::-webkit-details-marker { display: none; }
.inline-details[open] summary { margin-bottom: 8px; }
.paid-form { background: var(--bg); border-radius: 10px; padding: 10px; min-width: 220px; }
.paid-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.paid-form input, .paid-form select { min-height: 38px; padding: 6px 10px; font-size: 15px; }
.all-paid { display: grid; gap: 6px; padding: 14px; border: 1px dashed var(--line-strong); border-radius: 10px; }
.all-paid__fields { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.all-paid__fields label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.all-paid__fields input, .all-paid__fields select { min-height: 44px; width: auto; }
.summary--small { padding: 16px 20px; }
.summary--small .summary__label { margin: 0 0 4px; }
.filter-bar__check { margin-bottom: 14px; min-height: 48px; }

/* Stage 6: reports, change log, pool */
.paid-bar { display: grid; gap: 4px; }
.paid-bar progress { width: 100%; height: 12px; accent-color: var(--accent); }
.ranking { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.ranking li { display: grid; grid-template-columns: 2.5em 1fr auto; gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
.ranking li:last-child { border-bottom: 0; }
.ranking__no { color: var(--muted); font-variant-numeric: tabular-nums; }
.ranking__value { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr.is-current th, .table tr.is-current td { background: var(--bg); }
.table tbody th { font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--ink); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid #EEF2F5; }
.table tbody tr:last-child th { border-bottom: 0; }
.table--compact th, .table--compact td { padding-left: 10px; padding-right: 10px; }
.export-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.export-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.export-list .btn { min-width: 210px; justify-content: center; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.audit-table td { vertical-align: top; }
.history summary { cursor: pointer; }
.history__list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.history__list li { border-left: 3px solid var(--line); padding-left: 10px; }

@media (max-width: 820px) {
  .nav { gap: 12px; }
  .nav__group { flex-direction: row; flex-wrap: wrap; }
  .nav__heading { width: 100%; padding-top: 4px; }
  .nav__account { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
  .nav__role { margin: 0; }
  .nav__account form { margin-left: auto; }
  .nav__logout { width: auto; }
  .main { padding: 20px 16px 40px; }
  .card { padding: 20px 16px; }
  .codes { grid-template-columns: 1fr; }
}

@media print {
  .nav, .auth__footer, form, .btn { display: none !important; }
  body, .auth { background: #FFFFFF; border: 0; }
  .card { box-shadow: none; }
}
