:root {
  --navy: #17134f;
  --navy-2: #071d59;
  --purple: #76258a;
  --purple-dark: #5d176f;
  --pink: #ef4c9b;
  --pink-soft: #fff0f7;
  --aqua: #32bdb6;
  --gold: #ffb64c;
  --ink: #25273a;
  --muted: #676b7c;
  --line: #e3e4ec;
  --paper: #ffffff;
  --background: #f5f6fa;
  --success: #167851;
  --danger: #b42338;
  --shadow: 0 18px 55px rgba(23, 19, 79, .13);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
}

* { box-sizing: border-box; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; background: var(--background); }
body, button, input, select { font: inherit; }
a { color: inherit; }
button, input, select { accent-color: var(--purple); }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.skip-link { position: fixed; z-index: 999; left: 1rem; top: -5rem; padding: .75rem 1rem; background: #fff; color: var(--navy); border-radius: .5rem; box-shadow: var(--shadow); }
.skip-link:focus { top: 1rem; }

.home-page { padding: 2.5vh 1rem 1rem; background: linear-gradient(135deg, #fbfcff 0%, #f2eff8 100%); }
.home-card { position: relative; width: min(920px, 100%); min-height: min(700px, 91vh); margin: 0 auto; overflow: hidden; background: #fff; border: 1px solid rgba(23, 19, 79, .09); border-radius: 18px; box-shadow: var(--shadow); }
.brand-header { position: relative; z-index: 3; display: flex; min-height: 122px; align-items: center; justify-content: center; padding: 1.1rem 2.25rem; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); }
.cedh-brand { display: block; width: 275px; height: 92px; }
.cedh-brand img { width: 100%; height: 100%; object-fit: contain; }
.brand-header--registration { display: grid; grid-template-columns: 1fr auto 1fr; gap: 2rem; }
.brand-header--registration .cedh-brand { justify-self: start; }
.event-header-title { display: flex; flex-direction: column; align-items: center; justify-self: center; color: var(--navy); text-align: center; }
.event-header-title small { margin-bottom: .28rem; color: var(--purple); font-size: .7rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.event-header-title strong { font-size: clamp(1.2rem, 2.4vw, 1.65rem); line-height: 1.05; }

.hero-content { position: relative; z-index: 2; width: min(610px, 90%); margin: 0 auto; padding: 2.1rem 1rem 13rem; text-align: center; }
.eyebrow { margin: 0 0 .65rem; color: var(--purple); font-size: .78rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.hero-content h1, .completion-card h1 { margin: 0; color: var(--navy); font-size: clamp(2rem, 4.3vw, 3rem); line-height: 1.08; }
.event-name { margin: .8rem 0 1rem; color: var(--muted); font-size: 1.32rem; }
.event-name strong { color: #44425f; }
.heart-divider { display: flex; align-items: center; gap: .9rem; width: 260px; margin: 1rem auto; color: var(--pink); }
.heart-divider::before, .heart-divider::after { content: ""; flex: 1; height: 1px; background: #f1a9ce; }
.event-date { display: flex; align-items: center; justify-content: center; gap: .8rem; margin: 1.1rem 0; color: var(--navy); font-size: 1.15rem; font-weight: 800; }
.event-date span { color: var(--pink); font-size: 1.5rem; }
.hero-copy { max-width: 470px; margin: 1.6rem auto; color: var(--muted); font-size: 1.02rem; line-height: 1.5; }
.duration { color: #626477; font-size: .82rem; }
.duration span { margin-right: .4rem; color: var(--purple); font-size: 1.05rem; }
.status-message { display: inline-block; margin: .6rem auto 1.2rem; padding: .85rem 1rem; color: #7a4c00; background: #fff7dc; border-radius: .7rem; font-weight: 700; }

.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: .65rem; padding: .75rem 1.35rem; border: 1px solid transparent; border-radius: 9px; cursor: pointer; text-decoration: none; font-weight: 760; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid rgba(239, 76, 155, .35); outline-offset: 3px; }
.button:disabled { cursor: wait; opacity: .65; transform: none; }
.button--primary { color: #fff; background: linear-gradient(135deg, var(--purple), var(--purple-dark)); box-shadow: 0 8px 22px rgba(118, 37, 138, .22); }
.button--primary:hover { box-shadow: 0 10px 28px rgba(118, 37, 138, .3); }
.button--secondary { color: var(--navy); background: #fff; border-color: #cfd0dc; }
.button--hero { min-width: 320px; margin: .25rem 0 .8rem; }
.button--wide { width: 100%; }
.scenery { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; height: 225px; background: linear-gradient(168deg, transparent 0 20%, #f8e9fa 20% 45%, #e2d6f5 45% 68%, #8a70be 68%); }
.scenery__aqueduct { position: absolute; left: 1rem; bottom: 52px; width: clamp(210px, 34vw, 370px); color: #c9aee1; opacity: .78; }
.scenery__aqueduct svg { display: block; width: 100%; height: auto; overflow: visible; }
.scenery__aqueduct rect { fill: currentColor; }
.scenery__aqueduct path { fill: none; stroke: currentColor; stroke-width: 10; stroke-linecap: square; stroke-linejoin: round; }
.scenery__runners { position: absolute; right: 1.8rem; bottom: 24px; display: flex; align-items: center; gap: clamp(.7rem, 2.2vw, 1.8rem); font-size: clamp(2.2rem, 6vw, 4rem); white-space: nowrap; filter: saturate(.8); }
.universal-access-symbol { width: 1.16em; height: 1.16em; overflow: visible; }
.universal-access-symbol rect { fill: #fff; stroke: var(--navy-2); stroke-width: 5; }
.universal-access-symbol path { fill: none; stroke: var(--navy-2); stroke-linecap: round; stroke-linejoin: round; }
.universal-access-symbol__arc { stroke-width: 6; }
.universal-access-symbol__body { stroke-width: 7; }
.universal-access-symbol circle { fill: var(--aqua); stroke: var(--navy-2); stroke-width: 5; }
.admin-entry { margin: .65rem auto 0; text-align: center; color: #7a7c8c; font-size: .78rem; }
.admin-entry a:hover { color: var(--purple); }

.form-page, .completion-page { background: linear-gradient(135deg, #f8f7fc, #eef3fa); padding: 1.25rem; }
.form-shell, .completion-shell { width: min(990px, 100%); margin: 0 auto; background: #fff; border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.form-shell .brand-header, .completion-shell .brand-header { min-height: 100px; }
.visual-progress { padding: .9rem 3rem; background: #fbfaff; border-bottom: 1px solid var(--line); }
.visual-progress progress { display: block; width: 100%; height: 12px; overflow: hidden; appearance: none; -webkit-appearance: none; accent-color: var(--purple); color: var(--purple); background: #e4e4eb; border: 0; border-radius: 999px; }
.visual-progress progress::-webkit-progress-bar { background: #e4e4eb; border-radius: 999px; }
.visual-progress progress::-webkit-progress-value { background: linear-gradient(90deg, var(--purple), var(--pink)); border-radius: 999px; transition: width .25s ease; }
.visual-progress progress::-moz-progress-bar { background: linear-gradient(90deg, var(--purple), var(--pink)); border-radius: 999px; }

.registration-form { min-height: 580px; padding: 2rem clamp(1.2rem, 5vw, 4rem) 3rem; }
.form-back-row { max-width: 948px; margin: 0 auto; padding: 1.5rem clamp(1.2rem, 5vw, 4rem) 0; }
.form-back-row .back-link { margin-bottom: 0; }
.form-back-row:not([hidden]) + .registration-main .registration-form { padding-top: 1rem; }
.form-card { max-width: 820px; margin: 0 auto; }
.form-card.centered { min-height: 440px; display: grid; place-content: center; justify-items: center; gap: 1rem; text-align: center; padding: 2rem; }
.form-card h1 { margin: 0 0 .5rem; color: var(--navy); font-size: clamp(1.85rem, 4vw, 2.4rem); }
.back-link { display: inline-flex; align-items: center; gap: .35rem; margin: 0 0 1.3rem; color: var(--navy); font-size: .88rem; font-weight: 700; text-decoration-color: var(--pink); text-underline-offset: 4px; }
.back-link:hover { color: var(--purple); text-decoration-thickness: 2px; }
.section-intro { margin: 0 0 1.6rem; color: var(--muted); }
.legal-copy { color: #3e4050; font-size: .98rem; line-height: 1.7; }
.legal-copy h2 { margin: 0 0 .65rem; color: var(--navy); font-size: 1.07rem; }
.legal-copy p { margin: .5rem 0 1rem; }
.legal-copy ol { padding-left: 1.4rem; }
.legal-copy li { margin-bottom: .65rem; padding-left: .25rem; }
.text-link { color: var(--navy); font-weight: 750; text-decoration-color: var(--pink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.pending-link { margin: .8rem 0; color: #755a23; font-size: .87rem; }
.acceptance-box { display: flex; align-items: center; gap: .9rem; margin: 1.5rem 0; padding: 1.1rem; background: var(--pink-soft); border: 1px solid #f4c7dd; border-radius: 10px; cursor: pointer; line-height: 1.45; }
.acceptance-box input { width: 20px; height: 20px; flex: 0 0 auto; margin: 0; }
.acceptance-box span { font-weight: 650; }
.authorization-card { position: relative; margin: 1.25rem 0; padding: 1.2rem; border: 1px solid var(--line); border-radius: 12px; }
.authorization-card h2 { margin: 0; color: var(--navy); font-size: 1.15rem; }
.authorization-details { margin-top: 1rem; }
.authorization-details summary { width: fit-content; color: var(--navy); cursor: pointer; font-weight: 750; text-decoration: underline; text-decoration-color: var(--pink); text-underline-offset: 3px; }
.authorization-details[open] summary { margin-bottom: .8rem; }
.authorization-details .legal-copy { padding: .3rem 1rem .2rem; background: #faf9fc; border-left: 4px solid var(--purple); border-radius: 0 8px 8px 0; }
.authorization-card .acceptance-box { margin: 1rem 0 0; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.15rem 1.3rem; }
.field-grid--single { grid-template-columns: 1fr; }
.contact-alternative-fields { display: contents; }
.contact-alternative-divider { width: 100%; margin: .65rem 0 .2rem; border: 0; border-top: 1px solid #d9dbea; }
.field-grid .field--full { grid-column: 1 / -1; }
.birth-date-fieldset { grid-column: 1 / -1; min-width: 0; margin: 0; padding: 0; border: 0; }
.birth-date-fieldset legend { margin-bottom: .42rem; color: #353649; font-size: .88rem; font-weight: 750; }
.birth-date-grid { display: grid; grid-template-columns: .8fr 1.4fr 1fr; gap: .7rem; }
.identity-fieldset { grid-column: 1 / -1; margin: 0; padding: 0; border: 0; }
.identity-fieldset legend { margin-bottom: .55rem; color: #353649; font-size: .88rem; font-weight: 750; }
.identity-options { display: flex; flex-wrap: wrap; gap: .65rem 1.5rem; }
.identity-options label { display: inline-flex; min-height: 44px; align-items: center; gap: .55rem; cursor: pointer; }
.identity-options input { width: 20px; height: 20px; min-height: 20px; margin: 0; }
.identity-options span { line-height: 1.35; }
.field, .filters label, .settings-form label { display: flex; flex-direction: column; gap: .42rem; }
.field > span, .filters label > span, .settings-form label > span { color: #353649; font-size: .88rem; font-weight: 750; }
input, select, textarea { width: 100%; min-height: 48px; padding: .7rem .85rem; color: var(--ink); background: #fff; border: 1px solid #cfd1dc; border-radius: 8px; }
input:hover, select:hover, textarea:hover { border-color: #a5a7b5; }
input:user-invalid, select:user-invalid, textarea:user-invalid { border-color: #dc7181; }
.distance-fieldset--first { margin-top: 0; }
.shirt-size-fieldset { margin: 1.5rem 0 0; padding: 0; border: 0; }
.shirt-size-fieldset legend { margin-bottom: .55rem; font-size: .9rem; font-weight: 760; }
.shirt-size-options { display: flex; flex-wrap: wrap; gap: .65rem 1.5rem; }
.shirt-size-options label { display: inline-flex; min-height: 44px; align-items: center; gap: .55rem; cursor: pointer; }
.shirt-size-options input { width: 20px; height: 20px; min-height: 20px; margin: 0; }
.shirt-size-options label.is-disabled { color: var(--muted); opacity: .62; cursor: not-allowed; }
.accessibility-fieldset { margin: 0; padding: 0; border: 0; }
.accessibility-fieldset legend { margin-bottom: .55rem; color: #353649; font-size: .9rem; font-weight: 760; }
.disability-types-fieldset { margin-top: 1.35rem; }
.accessibility-options { display: flex; flex-wrap: wrap; gap: .65rem 1.5rem; }
.accessibility-options label { display: inline-flex; min-height: 44px; align-items: center; gap: .55rem; cursor: pointer; }
.accessibility-options input { width: 20px; height: 20px; min-height: 20px; margin: 0; }
.accessibility-conditional { transition: opacity .16s ease; }
.accessibility-conditional.is-disabled { opacity: .55; }
.accessibility-followup { margin-top: 1.35rem; }
.health-fields { display: grid; gap: 1.35rem; }
.health-fieldset { margin: 0; padding: 0; border: 0; }
.health-fieldset legend { margin-bottom: .55rem; color: #353649; font-size: .9rem; font-weight: 760; }
.health-conditional { transition: opacity .16s ease; }
.health-conditional.is-disabled { opacity: .55; }
.accessibility-support { margin-top: 1.5rem; }
.accessibility-support textarea { min-height: 105px; resize: vertical; }
.field small { color: var(--muted); font-size: .76rem; }
.distance-fieldset { margin: 1.5rem 0 0; padding: 0; border: 0; }
.distance-fieldset legend { margin-bottom: .55rem; font-size: .9rem; font-weight: 760; }
.distance-options { display: flex; flex-wrap: wrap; gap: .75rem 2rem; }
.distance-options label { display: inline-flex; min-height: 44px; align-items: center; gap: .55rem; cursor: pointer; }
.distance-options .conditional-distance { transition: opacity .16s ease; }
.distance-options .conditional-distance.is-disabled { opacity: .5; cursor: not-allowed; }
.distance-options input { position: static; width: 20px; height: 20px; min-height: 20px; margin: 0; opacity: 1; }
.distance-options span { display: inline-flex; align-items: baseline; gap: .45rem; padding: 0; border: 0; }
.distance-options b { color: var(--navy); font-size: 1rem; }
.distance-options small { color: var(--muted); }
.section-divider { display: flex; align-items: center; gap: 1rem; margin: 2rem 0 1.2rem; color: var(--purple); font-size: .85rem; font-weight: 800; }
.section-divider::before, .section-divider::after { content: ""; height: 1px; flex: 1; background: #dedee7; }
.form-actions { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding-top: 1.3rem; border-top: 1px solid var(--line); }
.form-actions--end { justify-content: center; }
.form-actions--center { justify-content: center; flex-wrap: wrap; }
.alert { max-width: 820px; margin: 0 auto 1.5rem; padding: .9rem 1rem; border-radius: 8px; font-weight: 650; }
.alert--error { color: #8f1d2e; background: #fff0f2; border: 1px solid #fac2ca; }
.alert--info { color: var(--navy); background: #f0f4ff; border: 1px solid #aebfe8; }
.toast { position: fixed; z-index: 100; top: 1rem; left: 50%; width: min(520px, calc(100% - 2rem)); padding: .9rem 1rem; border-radius: 9px; box-shadow: var(--shadow); transform: translateX(-50%); text-align: center; font-weight: 750; }
.toast--success { color: #0c5b3c; background: #e7f7ef; }
.toast--info { color: #57420e; background: #fff7d8; }

.completion-shell { min-height: 0; }
.completion-card { max-width: 780px; margin: 0 auto; padding: 2.25rem 2rem 3rem; text-align: center; }
.success-mark { display: grid; width: 66px; height: 66px; place-items: center; margin: 0 auto 1rem; color: #fff; background: var(--success); border-radius: 50%; font-size: 2rem; box-shadow: 0 10px 26px rgba(22,120,81,.22); }
.completion-lead { color: var(--muted); font-size: 1.1rem; }
.runner-summary { display: grid; grid-template-columns: 1fr; margin: 2.25rem 0 1.75rem; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; text-align: left; }
.runner-summary div { display: grid; grid-template-columns: minmax(190px, .8fr) minmax(0, 1.2fr); align-items: center; gap: 1rem; padding: .8rem 1rem; }
.runner-summary div + div { border-top: 1px solid var(--line); }
.runner-summary dt { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.runner-summary dd { margin: 0; color: var(--navy); font-weight: 800; }
.qr-block { display: grid; grid-template-columns: 220px 1fr; align-items: center; gap: 1.5rem; padding: 1rem 1.5rem; background: #f8f5fb; border-radius: 14px; text-align: left; }
.qr-block img { width: 100%; height: auto; background: #fff; border-radius: 9px; }
.qr-block h2 { margin: 0 0 .55rem; color: var(--navy); font-size: 1.25rem; }
.qr-block p { margin: 0; color: var(--muted); line-height: 1.5; }
.qr-block p strong { color: var(--navy); }

.admin-login-page { display: grid; min-height: 100vh; place-items: center; padding: 1rem; background: linear-gradient(145deg, var(--navy-2), var(--purple)); }
.login-shell { width: min(470px, 100%); }
.login-card { padding: 2.2rem; background: #fff; border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.login-card > img { display: block; width: 210px; height: 120px; margin: 0 auto 1rem; object-fit: contain; }
.login-card h1 { margin: 0; color: var(--navy); font-size: 1.75rem; }
.login-card > p:not(.eyebrow) { color: var(--muted); }
.form-stack { display: grid; gap: 1rem; margin: 1.5rem 0; }

.admin-page, .verify-page, .scanner-page { background: #f3f4f8; }
.admin-header { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem max(1rem, calc((100vw - 1600px)/2)); background: #fff; border-bottom: 1px solid var(--line); }
.admin-logo { display: flex; align-items: center; gap: 1rem; color: var(--navy); text-decoration: none; font-weight: 800; }
.admin-logo img { width: 105px; height: 58px; object-fit: contain; }
.admin-header > div, .staff-nav { display: flex; align-items: center; gap: 1rem; font-size: .86rem; }
.admin-header a { color: var(--purple); font-weight: 750; }
.staff-nav { min-width: 0; margin-left: auto; }
.staff-nav a { padding: .5rem .65rem; border-radius: 7px; text-decoration: none; }
.staff-nav a[aria-current="page"] { color: var(--navy); background: #f4edf8; }
.admin-shell { width: min(1600px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 4rem; }
.admin-title { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; }
.admin-title h1 { margin: 0; color: var(--navy); font-size: 2rem; }
.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; margin-bottom: 1.3rem; }
.stats-grid article { display: flex; flex-direction: column; gap: .3rem; padding: 1.2rem; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.stats-grid span { color: var(--muted); font-size: .8rem; }
.stats-grid strong { color: var(--navy); font-size: 1.8rem; }
.admin-panel { margin-top: 1.2rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr auto; align-items: end; gap: .8rem; padding: 1rem; border-bottom: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .87rem; }
th, td { padding: .85rem 1rem; border-bottom: 1px solid #ededf2; text-align: left; white-space: nowrap; }
th { color: #696a78; background: #fafafd; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.table-number { color: var(--navy); font-size: 1rem; letter-spacing: .05em; }
.registration-time { display: flex; flex-direction: column; gap: .18rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.registration-time span:last-child { color: var(--muted); font-size: .78rem; }
.status-pill { display: inline-block; padding: .28rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.status-pill.is-pending { color: #7e5000; background: #fff2ca; }
.status-pill.is-delivered { color: #0e6645; background: #dff6eb; }
.table-link { color: var(--purple); font-weight: 750; }
.empty-table { padding: 2rem; color: var(--muted); text-align: center; }
.settings-panel { padding: 1rem; }
.settings-panel h2 { margin: 0; color: var(--navy); font-size: 1.2rem; }
.settings-form { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; align-items: end; gap: 1rem; margin-top: 1.2rem; }
.settings-toggles { display: flex; flex-direction: column; gap: .65rem; }
.toggle-field { flex-direction: row !important; align-items: center; }
.toggle-field input { width: 20px; height: 20px; min-height: 0; }
.draft-mode-status { width: fit-content; padding: .3rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 800; }
.draft-mode-status.is-active { color: #7e5000; background: #fff2ca; }
.draft-mode-status.is-final { color: #0e6645; background: #dff6eb; }
.button--danger { color: #fff; background: #a91d36; border-color: #a91d36; }
.button--danger:hover { background: #86162b; border-color: #86162b; }
.draft-reset-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr); align-items: end; gap: 1.5rem; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.draft-reset-panel strong { color: #86162b; }
.draft-reset-panel p, .draft-closed-message { margin: .35rem 0 0; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.draft-finalize-form { margin-top: .8rem; }
.draft-finalize-form .button { min-height: 40px; padding: .55rem .8rem; font-size: .82rem; }
.draft-reset-form { display: grid; grid-template-columns: minmax(210px, 1fr) auto; align-items: end; gap: .8rem; }
.draft-reset-form label { display: flex; flex-direction: column; gap: .42rem; }
.draft-reset-form label span { color: #353649; font-size: .82rem; font-weight: 750; }
.draft-closed-message { padding-top: 1rem; border-top: 1px solid var(--line); }
.panel-help { max-width: 850px; margin: .8rem 0 0; color: var(--muted); line-height: 1.5; }
.panel-subtitle { margin: 1.5rem 0 .6rem; color: var(--navy); font-size: 1.05rem; }
.shirts-shell { max-width: 1320px; }
.shirt-inventory-panel { padding: 1.25rem; }
.shirt-inventory-heading h2 { margin: 0; color: var(--navy); font-size: 1.25rem; }
.shirt-inventory-heading p { max-width: 780px; margin: .4rem 0 0; color: var(--muted); line-height: 1.5; }
.shirt-inventory-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.shirt-inventory-card { min-width: 0; padding: 1rem; background: #fafafd; border: 1px solid var(--line); border-radius: 10px; }
.shirt-inventory-card.is-exhausted { background: #fffaf0; }
.shirt-inventory-card__title { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; }
.shirt-inventory-card__title h3 { margin: 0; color: var(--navy); font-size: 1.05rem; }
.shirt-inventory-card__title .status-pill:not(.is-pending):not(.is-delivered) { color: #626477; background: #ececf2; }
.shirt-inventory-card dl { display: grid; grid-template-columns: 1fr 1fr; margin: 1rem 0; }
.shirt-inventory-card dl div { min-width: 0; padding-right: .6rem; }
.shirt-inventory-card dt { color: var(--muted); font-size: .75rem; }
.shirt-inventory-card dd { margin: .25rem 0 0; color: var(--navy); font-weight: 800; overflow-wrap: anywhere; }
.shirt-inventory-card label { display: flex; flex-direction: column; gap: .4rem; }
.shirt-inventory-card label span { color: #353649; font-size: .82rem; font-weight: 750; }
.shirt-inventory-card small { display: block; margin-top: .4rem; color: var(--muted); font-size: .73rem; line-height: 1.35; }
.shirt-inventory-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; padding-top: 1.15rem; border-top: 1px solid var(--line); }
.shirt-inventory-actions p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.user-management-panel { padding: 1.2rem; }
.user-management-panel h2 { margin: 0; color: var(--navy); font-size: 1.25rem; }
.user-form { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr auto; align-items: end; gap: 1rem; margin-top: 1.2rem; }
.user-form label { display: flex; flex-direction: column; gap: .42rem; }
.user-form label span { color: #353649; font-size: .82rem; font-weight: 750; }
.role-guide { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin: 1.2rem 0 0; }
.role-guide div { padding: .85rem; background: #fafafd; border: 1px solid var(--line); border-radius: 8px; }
.role-guide dt { color: var(--navy); font-weight: 800; }
.role-guide dd { margin: .3rem 0 0; color: var(--muted); font-size: .83rem; line-height: 1.45; }
.user-list { display: grid; gap: .75rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.user-card { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(420px, 1.4fr); align-items: center; gap: 1rem; padding: 1rem; background: #fafafd; border: 1px solid var(--line); border-radius: 10px; }
.user-card.is-inactive { opacity: .72; }
.user-card__identity { display: flex; flex-direction: column; gap: .25rem; }
.user-card__identity > strong { color: var(--navy); font-size: 1.05rem; }
.user-card__identity > span { color: var(--muted); font-size: .85rem; }
.user-card__badges { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; }
.role-pill, .current-user-pill { display: inline-block; width: fit-content; padding: .28rem .55rem; border-radius: 999px; color: var(--purple); background: #f3e8f7; font-size: .72rem; font-weight: 800; }
.current-user-pill { color: var(--navy); background: #e8edf8; }
.user-card__actions { grid-column: 1 / -1; padding-top: .75rem; border-top: 1px solid var(--line); }
.user-card__actions details { width: 100%; }
.user-card__actions summary { color: var(--purple); cursor: pointer; font-size: .85rem; font-weight: 800; }
.user-card__actions .button { min-height: 42px; padding: .55rem .8rem; font-size: .82rem; }
.user-admin-body { margin-top: 1rem; padding: 1rem; background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.user-edit-form { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1.2fr; align-items: start; gap: .8rem; }
.user-edit-form label { display: flex; flex-direction: column; gap: .42rem; }
.user-edit-form label span { color: #353649; font-size: .82rem; font-weight: 750; }
.user-edit-form label small { color: var(--muted); font-size: .75rem; line-height: 1.35; }
.user-edit-actions { display: flex; justify-content: flex-end; grid-column: 1 / -1; }
.user-admin-subsection { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.user-admin-subsection h3 { margin: 0; color: var(--navy); font-size: .95rem; }
.user-account-controls > div { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: .7rem; }
.current-account-note { margin: 1rem 0 0; padding-top: 1rem; color: var(--muted); border-top: 1px solid var(--line); font-size: .84rem; }

.medical-shell { max-width: 1000px; }
.medical-page .medical-shell { padding-top: 5rem; }
.medical-export-panel { margin-bottom: 1.4rem; padding: 1.8rem 2.4rem; border: 0; border-radius: 16px; box-shadow: var(--shadow); }
.medical-export-panel h1 { margin: 0; color: var(--navy); font-size: clamp(1.3rem, 2.6vw, 1.65rem); }
.medical-export-actions { display: flex; justify-content: center; margin-top: 1.25rem; }
.medical-export-button { min-width: min(100%, 270px); }
.medical-search-panel { padding: 2.4rem; border: 0; border-radius: 16px; box-shadow: var(--shadow); }
.medical-search-heading { display: flex; align-items: center; gap: 1.15rem; }
.medical-search-heading h1, .medical-search-heading h2 { margin: 0; color: var(--navy); font-size: clamp(1.35rem, 3vw, 1.85rem); }
.medical-search-icon { display: grid; flex: 0 0 auto; width: 62px; height: 62px; color: var(--purple); background: #f4eaf8; border-radius: 50%; place-items: center; }
.medical-search-icon svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.medical-search-form { display: grid; grid-template-columns: minmax(230px, 1fr) 170px; align-items: stretch; gap: 1rem; margin-top: 1.6rem; }
.medical-search-form label { display: block; }
.medical-search-form input, .medical-search-form .button { min-height: 58px; font-size: 1.05rem; }
.medical-search-form .button { width: 100%; }
.medical-lookup-alert { margin-top: 1.2rem; }
.medical-result { margin-top: 1.2rem; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.medical-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.medical-section { padding: 1.35rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.medical-section:nth-child(even) { border-right: 0; }
.medical-section h2 { margin: 0 0 .85rem; color: var(--navy); font-size: 1.15rem; }
.medical-section--priority { background: #fffaf0; }
.medical-data-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; }
.medical-data-list div { min-width: 0; padding: .75rem .75rem .75rem 0; border-top: 1px solid #ededf2; }
.medical-data-list dt { color: var(--muted); font-size: .76rem; line-height: 1.35; text-transform: uppercase; letter-spacing: .035em; }
.medical-data-list dd { margin: .28rem 0 0; color: var(--navy); font-weight: 800; line-height: 1.45; overflow-wrap: anywhere; }
.medical-data-list a { color: var(--purple); }

.scanner-page { background: #f5f5fa; }
.scanner-shell { display: grid; width: min(540px, calc(100% - 2rem)); min-height: 100vh; margin: 0 auto; padding: 1rem 0 2rem; gap: 1rem; align-content: start; }
.scanner-camera-card, .scanner-result-card { padding: 1rem; background: #fff; border-radius: 16px; box-shadow: var(--shadow); }
.camera-frame { position: relative; overflow: hidden; background: #17171b; border: 0; border-radius: 10px; aspect-ratio: 4 / 3; }
.camera-frame video { display: block; width: 100%; height: 100%; object-fit: cover; }
.camera-placeholder { position: absolute; inset: 0; display: grid; padding: 1.25rem; color: #fff; background: linear-gradient(145deg, #15151a, #292933); place-content: center; text-align: center; }
.camera-placeholder[hidden] { display: none; }
.camera-placeholder p { max-width: 280px; margin: 0 0 1rem; line-height: 1.5; }
.scanner-result-card { padding: 1.5rem; }
.scanner-result-card h2 { margin: 0 0 .8rem; color: var(--navy); font-size: 1.25rem; }
.scanner-result-card > p { margin: 0; color: var(--muted); line-height: 1.5; }
.scanner-result-details { display: grid; grid-template-columns: 1fr; margin: 0 0 1rem; }
.scanner-result-detail { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.scanner-result-detail:nth-child(even) { padding-left: 0; }
.scanner-result-detail--wide { grid-column: 1 / -1; padding-left: 0 !important; }
.scanner-result-detail dt { color: var(--muted); font-size: .78rem; }
.scanner-result-detail dd { margin: .25rem 0 0; color: var(--navy); font-size: 1.08rem; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.scanner-result-alert { display: flex; flex-direction: column; gap: .35rem; margin: 1rem 0; padding: 1rem; color: #7a4f00; background: #fff4d3; border-radius: 10px; }
.scanner-result-alert strong { font-size: 1.05rem; }
.scanner-result-alert span { font-size: .88rem; line-height: 1.45; }
.scanner-result-alert--done { color: #0e6645; background: #e2f7ed; }
.scanner-result-alert--error { color: #86162b; background: #fde8ed; }
.scanner-result-actions { display: grid; gap: .7rem; }
.scanner-result-actions .button { min-height: 50px; }

.verify-shell { display: grid; min-height: calc(100vh - 76px); place-items: center; padding: 2rem 1rem; }
.verify-card { width: min(520px, 100%); padding: 2rem; background: #fff; border-radius: 16px; box-shadow: var(--shadow); text-align: center; }
.verify-card h1 { margin: 0; color: var(--navy); font-size: 1.65rem; }
.verify-number { margin: 1rem 0; color: var(--purple); font-size: 3rem; font-weight: 900; letter-spacing: .1em; }
.verify-details { display: grid; grid-template-columns: repeat(2, 1fr); margin: 1.3rem 0; border: 1px solid var(--line); border-radius: 10px; text-align: left; }
.verify-details div { padding: .85rem; }
.verify-details dt { color: var(--muted); font-size: .73rem; text-transform: uppercase; }
.verify-details dd { margin: .25rem 0 0; color: var(--navy); font-weight: 800; }
.verify-details .verify-details__wide { grid-column: 1 / -1; }
.delivery-state { display: flex; flex-direction: column; gap: .3rem; margin: 1rem 0; padding: 1rem; color: #7a4f00; background: #fff4d3; border-radius: 9px; }
.delivery-state > div { display: flex; flex-direction: column; gap: .3rem; }
.delivery-state--done { color: #0e6645; background: #e2f7ed; }
.delivery-state span { font-size: .84rem; }
.verify-card form + .button, .verify-card .delivery-state + .button { margin-top: .8rem; }

.verify-page--scanner { background: #f5f5fa; }
.verify-page--scanner .verify-shell { min-height: 100vh; padding: 1.25rem 1rem; }
.verify-card--scanner { width: min(480px, 100%); padding: 1.75rem 1.4rem; text-align: left; }
.verify-card--scanner .eyebrow { margin-bottom: .75rem; text-align: center; }
.verify-card--scanner .verify-number { margin: 0 0 1.25rem; padding-bottom: 1.15rem; border-bottom: 1px solid var(--line); font-size: clamp(4rem, 20vw, 5.25rem); line-height: 1; text-align: center; }
.verify-card--scanner .verify-details { display: block; margin: 0; border: 0; border-radius: 0; }
.verify-card--scanner .verify-details div { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.verify-card--scanner .verify-details dt { font-size: .78rem; text-transform: none; }
.verify-card--scanner .verify-details dd { font-size: 1.08rem; }
.verify-card--scanner .delivery-state { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: .75rem; margin: 1rem 0 .75rem; padding: 1rem; }
.verify-card--scanner .delivery-state div { display: flex; flex-direction: column; gap: .25rem; }
.verify-card--scanner .delivery-state strong { font-size: 1.05rem; }
.verify-card--scanner .delivery-state span { line-height: 1.45; }
.delivery-state__icon { display: grid; width: 30px; height: 30px; border: 2px solid currentColor; border-radius: 50%; place-items: center; font-size: 1rem !important; font-weight: 900; line-height: 1; }
.verify-card--scanner form, .verify-card--scanner .button { width: 100%; }
.verify-card--scanner .button { min-height: 50px; }

@media (max-width: 760px) {
  .home-page { padding: 0; }
  .home-card, .form-shell, .completion-shell { min-height: 100vh; border-radius: 0; }
  .completion-shell { min-height: 0; }
  .brand-header { min-height: 96px; padding: .75rem 1rem; }
  .cedh-brand { width: 165px; height: 68px; }
  .brand-header--registration { display: flex; justify-content: space-between; gap: .7rem; }
  .event-header-title { align-items: flex-end; text-align: right; }
  .event-header-title small { font-size: .58rem; }
  .event-header-title strong { max-width: 180px; font-size: 1rem; }
  .hero-content { padding-top: 2rem; }
  .hero-content h1 { font-size: 2rem; }
  .event-name { font-size: 1.1rem; }
  .button--hero { min-width: min(300px, 100%); }
  .scenery { height: 180px; }
  .scenery__aqueduct { left: .4rem; bottom: 48px; width: 190px; }
  .scenery__runners { right: .5rem; font-size: 2.2rem; }
  .form-page, .completion-page { padding: 0; }
  .visual-progress { padding: .75rem 1rem; }
  .registration-form { padding: 1.5rem 1.15rem 2.5rem; }
  .field-grid, .birth-date-grid, .distance-options, .runner-summary, .qr-block, .stats-grid { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .runner-summary div { grid-template-columns: 1fr; gap: .35rem; }
  .qr-block { text-align: center; }
  .qr-block img { width: 210px; margin: 0 auto; }
  .completion-card { padding: 1.7rem 1rem 2.5rem; }
  .admin-header { padding: .5rem 1rem; }
  .admin-logo span, .staff-account span { display: none; }
  .admin-shell { width: calc(100% - 1rem); padding-top: 1rem; }
  .admin-title { align-items: stretch; flex-direction: column; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .filters, .settings-form, .draft-reset-panel, .draft-reset-form, .user-form, .role-guide, .user-card, .user-edit-form, .medical-search-form, .medical-sections, .medical-data-list, .shirt-inventory-grid { grid-template-columns: 1fr; }
  .shirt-inventory-actions { align-items: stretch; flex-direction: column; }
  .shirt-inventory-actions .button { width: 100%; }
  .user-edit-actions { grid-column: auto; }
  .medical-section { border-right: 0; }
  .medical-page .medical-shell { padding-top: 1rem; }
  .medical-search-panel { padding: 1.4rem; }
  .medical-search-icon { width: 48px; height: 48px; }
  .medical-search-icon svg { width: 28px; height: 28px; }
  .user-card__actions { align-items: stretch; flex-direction: column; }
  .user-card__actions details { min-width: 0; }
  .admin-header { flex-wrap: wrap; }
  .staff-nav { order: 3; width: 100%; padding-top: .45rem; overflow-x: auto; border-top: 1px solid var(--line); justify-content: flex-start; scrollbar-width: thin; }
  .staff-nav a { flex: 0 0 auto; }
  .verify-card { padding: 1.4rem; }
}

@media print {
  @page { size: Letter portrait; margin: 10mm; }
  html, body { min-height: 0; background: #fff; }
  .completion-page { padding: 0; background: #fff; }
  .completion-shell { display: flex; width: 100%; min-height: 259.4mm; flex-direction: column; justify-content: center; border-radius: 0; box-shadow: none; }
  .completion-shell .brand-header { min-height: 72px; padding: .35rem 1rem; }
  .completion-shell .cedh-brand { width: 210px; height: 62px; }
  .completion-card { max-width: none; padding: .8rem 1.25rem 0; }
  .completion-card h1 { font-size: 2rem; }
  .success-mark { width: 46px; height: 46px; margin-bottom: .45rem; font-size: 1.5rem; box-shadow: none; }
  .completion-card .eyebrow { margin-bottom: .35rem; }
  .completion-lead { margin: .45rem 0; font-size: 1rem; }
  .runner-summary { grid-template-columns: 1fr; margin: 1.75rem 0 1.25rem; break-inside: avoid; }
  .runner-summary div { display: grid; grid-template-columns: 190px 1fr; align-items: center; gap: .75rem; padding: .55rem .8rem; }
  .runner-summary div + div { border-top: 1px solid var(--line); border-left: 0; }
  .qr-block { grid-template-columns: 180px 1fr; gap: 1rem; padding: .75rem 1rem; break-inside: avoid; text-align: left; }
  .qr-block img { width: 180px; margin: 0; }
  .completion-actions, .skip-link { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
