:root {
    color-scheme: light;
    --bg: #edf6ff;
    --surface: #fff;
    --ink: #122c49;
    --muted: #365472;
    --accent: #15569f;
    --border: #cbddec;
    --focus: #1b6ec2;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { color: #0d3d75; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.shell { width: min(100% - 2rem, 1050px); margin-inline: auto; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner, .section-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.header-inner { min-height: 4rem; }
.brand { color: var(--ink); font-size: 1rem; font-weight: 800; display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand-mark { display: inline-flex; flex-shrink: 0; align-items: end; gap: 3px; background: #123d6a; border-radius: .5rem; padding: .45rem; width: 2rem; height: 2rem; }
.brand-mark i { display: block; width: 4px; border-radius: 3px; background: #c4e2ff; height: 45%; }
.brand-mark i:nth-child(2) { height: 72%; }
.brand-mark i:nth-child(3) { height: 100%; background: #fff; }
.skip { position: absolute; transform: translateY(-150%); padding: .5rem; background: #fff; z-index: 1; }
.skip:focus { transform: translateY(0); }
.meet-nav { display: flex; flex-wrap: wrap; gap: .35rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.meet-nav a { color: var(--ink); text-decoration: none; font-size: .925rem; font-weight: 650; padding: .55rem .8rem; border-radius: .5rem; }
.meet-nav a:hover { background: #dceeff; }
.meet-nav [aria-current] { background: #173f69; color: #fff; }
main { min-height: 63vh; }
.hero { display: flex; gap: 1.2rem; align-items: end; justify-content: space-between; margin: 1.6rem 0 2rem; padding: clamp(1.25rem, 5vw, 2.8rem); color: #fff; background: #163e67; border-radius: .9rem; }
.hero h1 { color: #fff; }
.hero .eyebrow, .hero .intro { color: #d6eaff; }
.hero .button { flex: none; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 6vw, 3rem); letter-spacing: -.035em; line-height: 1.1; overflow-wrap: anywhere; }
h2 { font-size: 1.1rem; line-height: 1.3; }
.eyebrow { font-weight: 720; font-size: .875rem; margin-bottom: .42rem; color: var(--accent); }
.intro { color: var(--muted); margin-top: .65rem; }
.section-title { margin-bottom: .8rem; }
.overview-program { margin-top: 1.8rem; }
.section-bar { margin-bottom: .85rem; }
.section-bar a { font-size: .9rem; font-weight: 650; }
.category-grid, .choice-grid { display: grid; gap: .75rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.category-grid { margin-bottom: 1.8rem; }
.card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: .75rem; padding: .95rem 1rem; color: var(--ink); text-decoration: none; }
a.card:hover { border-color: var(--accent); }
.category { position: relative; padding: 1rem 2rem 1rem 1rem; min-height: 5.4rem; border-top: 3px solid #3f80c8; }
.short-track { border-top-color: #5775aa; }
.field { border-top-color: #428478; }
.card-title { display: block; font-size: 1.125rem; font-weight: 750; }
.card-arrow { position: absolute; top: .95rem; right: .8rem; color: var(--accent); }
.row-arrow { display: none; }
.meta, footer { color: var(--muted); font-size: .875rem; }
footer { margin-top: 2rem; padding: 1rem 0 2rem; border-top: 1px solid var(--border); }
.sample { margin-left: .55rem; }
.empty, .notice { padding: 1rem; background: #e3effa; border: 1px solid var(--border); border-radius: .7rem; color: var(--muted); }
.notice { color: #7b262e; background: #fff0f0; border-color: #e9c3c6; margin-bottom: .75rem; }
.button { display: inline-flex; min-height: 2.7rem; justify-content: center; align-items: center; gap: .5rem; padding: .5rem .85rem;
    border: 1px solid #a5c0da; border-radius: .5rem; background: #f4faff; color: #163f68; font: inherit; font-size: .9rem;
    font-weight: 700; text-decoration: none; cursor: pointer; }
.button:hover { background: #dcecff; }
.button.start { color: #fff; background: #207344; border-color: #207344; }
.button.start:hover { background: #185b36; }
.button.stop { color: #fff; background: #af2435; border-color: #af2435; }
.button.stop:hover { background: #8e1d2b; }
.page-heading { margin-top: 1.5rem; margin-bottom: 1.15rem; }
.back { display: inline-block; margin-bottom: .45rem; font-weight: 650; }
.stack { display: grid; gap: .65rem; }
.activity, .group-row, .group-actions { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.activity > div { min-width: 0; overflow-wrap: anywhere; }
.group-row, .group-actions { flex-wrap: wrap; }
.group-row.in-progress { border-left: 4px solid #af2435; }
.group-info { min-width: 8rem; }
.group-title { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.group-info .group-title { margin-bottom: .22rem; }
.program-event-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .4rem; }
.program-groups { display: flex; flex-wrap: wrap; gap: .35rem 1rem; padding: 0; margin: .4rem 0 0; list-style: none; }
.program-groups li { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .875rem; }
.group-actions { justify-content: flex-start; }
.arrival { flex-basis: 100%; }
.timer { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 730; }
.status { display: inline-flex; width: max-content; min-height: 1.65rem; align-items: center; padding: .14rem .52rem;
    border-radius: .35rem; background: #e5effa; color: #26496c; font-size: .8rem; font-weight: 720; white-space: nowrap; }
.status.running, .status.overdue { color: #882837; background: #fce8eb; }
.status.current { color: #154d85; background: #d9ecff; }
.status.future { color: #405a71; background: #eef2f6; }
.status.completed { color: #175332; background: #e1f3e7; }
.combined { margin-bottom: .9rem; }
summary { font-weight: 750; color: var(--accent); cursor: pointer; }
fieldset { padding: 0; border: 0; margin: .8rem 0; min-width: 0; }
legend { padding: 0; font-size: .9rem; margin-bottom: .45rem; }
.choice { display: flex; gap: .45rem; align-items: center; min-height: 2.75rem; background: #f4faff; border: 1px solid var(--border); border-radius: .5rem; padding: .4rem; cursor: pointer; }
.choice input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.choice small { color: var(--muted); }
.combined-count { display: none; }
.combined-group:has(input[type="checkbox"]:checked) .combined-count { display: grid; gap: .25rem; margin-top: .35rem; }
.athlete-count summary { min-height: 2.5rem; padding: .45rem .6rem; }
.athlete-count[open] { width: 100%; }
.athlete-count-live { flex-basis: 100%; min-width: 0; }
.athlete-count-live > p { padding: .25rem .6rem .45rem; color: var(--accent); font-weight: 750; }
.count-form { padding: 0 .6rem .45rem; }
.count-options, .custom-count { display: flex; flex-wrap: wrap; align-items: end; gap: .4rem; }
.count-options .button { min-width: 2.75rem; padding-inline: .5rem; }
.count-options [aria-pressed="true"] { background: #d9ecff; }
.custom-count label { display: grid; gap: .25rem; }
.count-form input[type="number"], .combined-count input {
    min-height: 2.75rem; width: 8rem; max-width: 100%; padding: .35rem .45rem;
    border: 1px solid #a5c0da; border-radius: .5rem; color: var(--ink); background: #fff; font: inherit;
}
.history-group + .history-group { margin-top: .45rem; }
.history-group .athlete-count summary { padding-inline: 0; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem; margin-bottom: 1rem; }
.filters label { display: grid; gap: .2rem; color: var(--muted); font-size: .9rem; font-weight: 650; }
.filters select { min-height: 2.7rem; padding: .3rem .5rem; border: 1px solid #a5c0da; border-radius: .5rem; color: var(--ink); background: #fff; font: inherit; }
.time-block { margin-top: 1.25rem; }
.time-block h2 { margin-bottom: .45rem; font-variant-numeric: tabular-nums; }
.time-block.current-slot { scroll-margin-top: .75rem; }
.current-slot { outline: 2px solid #207344; outline-offset: 2px; border-radius: .6rem; }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: .65rem; background: #fff; }
table { border-collapse: collapse; text-align: left; width: 100%; min-width: 35rem; }
td, th { padding: .7rem .85rem; border-bottom: 1px solid var(--border); }
thead { background: #dfeeff; }
tr:last-child > td, tbody tr:last-child > th { border-bottom: 0; }
th small { display: block; font-weight: 500; }
.htmx-request button { opacity: .65; }
@media (max-width: 640px) {
    .category-grid { grid-template-columns: 1fr; }
    .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero { align-items: start; flex-direction: column; }
    .meet-nav { display: none; }
    .activity, .group-row { padding-inline: .75rem; }
}

.account { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; flex-wrap: wrap; }
.account a, .text-button { font-size: .875rem; font-weight: 700; }
.text-button { color: var(--accent); background: transparent; border: none; padding: .35rem 0; cursor: pointer; text-decoration: underline; }
.role-label { color: var(--muted); font-size: .82rem; font-weight: 650; }
.login-shell { max-width: 30rem; padding-block: 2rem; }
.login-card { padding: 1.5rem; }
.login-card form, .enrol-card { margin-top: 1rem; }
.login-card form label { display: block; margin-bottom: .75rem; }
.login-card form label[hidden] { display: none; }
.login-card .notice { margin-top: .85rem; }
.text-input { display: block; width: 100%; min-height: 2.7rem; padding: .4rem .55rem; border: 1px solid #a5c0da; border-radius: .5rem; color: var(--ink); font: inherit; }
.enrol-card { margin-bottom: 1rem; }
.enrol-card h2 { margin-bottom: .55rem; }
.export-link { margin-top: .65rem; }
.invite-qr { max-width: 19rem; margin-block: .6rem; }
.invite-qr svg { display: block; width: 100%; height: auto; }
.group-qr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin-bottom: .6rem; }
.group-qr-selector { margin-top: .9rem; }
@media (max-width: 640px) {
    .header-inner { flex-wrap: wrap; gap: .2rem .6rem; padding-block: .55rem; }
    .account { justify-content: flex-start; }
    .brand { gap: .45rem; }
}

.filters .reset-confirm { display: flex; align-items: center; gap: .4rem; min-height: 2.7rem; }
.leader-event h3 { margin: 0; font-size: 1.05rem; }
.leader-event-group { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .45rem .75rem; margin-top: .55rem; }
.leader-event-group + .leader-event-group { padding-top: .55rem; border-top: 1px solid var(--border); }
.start-controls, .concurrent-heats { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.concurrent-heats { font-size: .85rem; color: var(--muted); }
.concurrent-heats input { accent-color: var(--accent); }
.concurrent-heats[hidden] { display: none; }
.long-track-controls, .active-heats { margin-bottom: .9rem; }
