:root {
  --hunt: #1E4632;     /* hunt-club green */
  --silk: #D9A520;     /* racing-silk gold */
  --paper: #FAFBF9;
  --ink: #17201B;
  --muted: #56625B;
  --line: #D5DDD7;
  --field: #FFFFFF;
  --ok: #1E6B45;
  --err: #A3311F;
  --accent-text: var(--hunt);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111814;
    --ink: #E6ECE8;
    --muted: #9AA8A0;
    --line: #2B3731;
    --field: #18221D;
    --ok: #6FC496;
    --err: #F08B76;
    --accent-text: #8CCBA6;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
}
.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1.25rem; }

/* Masthead: a band of racing silks, then the family name */
.masthead { background: var(--hunt); color: #F4F7F5; padding-bottom: 0.25rem; }
.silks {
  height: 14px;
  background: repeating-linear-gradient(-45deg, var(--silk) 0 14px, var(--hunt) 14px 28px);
  border-bottom: 3px solid var(--silk);
}
.masthead h1 {
  font: 700 clamp(1.9rem, 6vw, 2.75rem)/1.05 "Fraunces", Georgia, serif;
  letter-spacing: -0.01em;
  margin: 1.4rem 0 0.35rem;
}
.masthead .sub { margin: 0 0 1.1rem; color: #CFE0D6; }
nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }
nav a {
  color: #F4F7F5; text-decoration: none; font-weight: 600;
  padding: 0.55rem 0.9rem; border-radius: 6px 6px 0 0;
}
nav a:hover { background: rgba(255,255,255,0.08); }
nav a[aria-current="page"] { background: var(--paper); color: var(--accent-text); }

main.wrap { padding-top: 1.75rem; padding-bottom: 2rem; }
h2 { font: 700 1.35rem/1.2 "Fraunces", Georgia, serif; margin: 0 0 0.6rem; }
a { color: var(--accent-text); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--silk); outline-offset: 2px;
}

/* Info page */
.hero { margin-bottom: 1.75rem; }
.hero .where { margin: 0; color: var(--muted); font-weight: 600; }
.spaces { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.35rem 0 0.75rem; }
.spaces span {
  font: 700 clamp(2rem, 9vw, 3.25rem)/1 "Fraunces", Georgia, serif;
  color: var(--accent-text);
  border: 3px solid var(--silk); border-radius: 10px;
  padding: 0.35rem 0.75rem 0.45rem;
}
.count { margin: 0; }
.facts { margin: 0 0 2rem; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 600; color: var(--muted); }
.facts dd { margin: 0; }
.bring ul { margin: 0; padding-left: 1.2rem; }

section.agenda, section.rules { margin-top: 2.25rem; }
.agenda ol { list-style: none; margin: 0 0 0.75rem; padding: 0; border-top: 1px solid var(--line); }
.agenda li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.agenda .time { font-weight: 600; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.rules ul { margin: 0; padding-left: 1.2rem; }
.rules li { margin-bottom: 0.4rem; }

.notice { border: 2px solid var(--silk); border-radius: 8px; padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.notice h2 { margin-bottom: 0.35rem; }
.notice p { margin: 0 0 0.5rem; }
.notice p:last-child { margin-bottom: 0; }

/* Forms */
.card { border: 1px solid var(--line); border-left: 6px solid var(--silk); border-radius: 8px; padding: 1.25rem; margin-bottom: 2rem; background: var(--field); }
.card.narrow { max-width: 26rem; }
.hint { color: var(--muted); margin-top: -0.25rem; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem 1rem; align-items: end; }
.grid .wide { grid-column: 1 / -1; }
label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.opt { font-weight: 400; color: var(--muted); }
input, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 6px; padding: 0.6rem 0.7rem; min-height: 2.75rem;
}
.card.narrow input { margin-bottom: 1rem; }
button {
  font-family: inherit; font-size: 1rem; font-weight: 600; line-height: 1;
  background: var(--hunt); color: #fff; border: 0; border-radius: 6px;
  padding: 0.8rem 1.2rem; min-height: 2.75rem; cursor: pointer; justify-self: start;
}
button:hover { filter: brightness(1.15); }
button.link { background: none; color: var(--muted); padding: 0.3rem; min-height: 0; font-weight: 400; text-decoration: underline; }
button.link:hover { color: var(--err); }
form.del { display: inline; margin: 0; }

.flash { padding: 0.7rem 1rem; border-radius: 6px; border: 1px solid; margin: 0 0 1.5rem; font-weight: 600; }
.flash.ok { color: var(--ok); }
.flash.err { color: var(--err); }

/* Lists */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); }
.n { text-align: right; width: 4.5rem; }
tfoot td { font-weight: 600; border-bottom: 0; }
.empty { color: var(--muted); font-style: italic; }
.export { margin-top: 1rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.cat { margin-bottom: 1.75rem; }
.cat h2 { display: flex; align-items: baseline; gap: 0.6rem; }
.tally { font: 600 0.95rem/1 "Source Sans 3", sans-serif; color: var(--muted); }
.items { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.items li { display: grid; grid-template-columns: 1fr auto auto; gap: 0.75rem; align-items: baseline; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.note { display: block; color: var(--muted); font-size: 0.95rem; }
.who { color: var(--muted); }

footer.foot { display: flex; justify-content: space-between; color: var(--muted); padding-top: 1rem; padding-bottom: 2rem; border-top: 1px solid var(--line); }

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .facts div { grid-template-columns: 1fr; gap: 0.1rem; }
  .items li { grid-template-columns: 1fr auto; }
  .items .who { grid-column: 1; grid-row: 2; }
  .agenda li { grid-template-columns: 5.5rem 1fr; gap: 0.75rem; }
}
