:root {
  --bg: #f3f6f6;
  --surface: #ffffff;
  --fg: #182628;
  --muted: #4c5f62;
  --line: #d3dddd;
  --accent: #0f5e6b;
  --accent-ink: #ffffff;
  --brass: #8a5a12;
  --tint: #e3eeee;
  --focus: #c27a00;
  --font-display: "Literata", Georgia, "Times New Roman", serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101a1c; --surface: #172427; --fg: #e4eded; --muted: #a3b6b8; --line: #2b3d40;
    --accent: #5fc0cc; --accent-ink: #0b1517; --brass: #e0b25f; --tint: #1d3034; --focus: #ffb84d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101a1c; --surface: #172427; --fg: #e4eded; --muted: #a3b6b8; --line: #2b3d40;
  --accent: #5fc0cc; --accent-ink: #0b1517; --brass: #e0b25f; --tint: #1d3034; --focus: #ffb84d;
  color-scheme: dark;
}
body { background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.6; }
.wrap { max-width: 68rem; margin: 0 auto; padding-inline: 1rem; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:visited { color: var(--brass); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0; max-width: 65ch; }

.notice { background: var(--tint); border-bottom: 1px solid var(--line); font-size: 0.9rem; color: var(--muted); }
.notice .wrap { padding-block: 0.5rem; }

header.site { background: var(--surface); border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1rem; }
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand img { width: 48px; height: 48px; }
.brand p { font-size: 0.9rem; color: var(--muted); }

nav.primary ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; padding: 0; }
nav.primary a { font-weight: 700; text-decoration: none; }
nav.primary a:hover { text-decoration: underline; }

.searchbar { background: var(--accent); color: var(--accent-ink); }
.searchbar .wrap { padding-block: 1rem; }
.searchbar form { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: end; }
.field { display: grid; gap: 0.25rem; }
.field label { font-weight: 700; font-size: 0.95rem; }
.searchbar input, .searchbar select { font: inherit; padding: 0.5rem 0.65rem; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); min-width: 0; }
.searchbar input[type="search"] { width: min(22rem, 100%); }
.searchbar .field:first-child { flex: 1 1 14rem; }
button { font: inherit; font-weight: 700; padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; border: 2px solid currentColor; background: var(--surface); color: var(--fg); }
.searchbar button { background: var(--surface); color: var(--accent); border-color: var(--surface); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: 2rem; padding-block: 2rem; }
@media (max-width: 52rem) { .layout { grid-template-columns: minmax(0, 1fr); } }
main { display: grid; gap: 2.25rem; min-width: 0; }
section { display: grid; gap: 0.9rem; }
.events { display: grid; gap: 1rem; }
.event { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.1rem; display: grid; gap: 0.4rem; }
.event .when { font-size: 0.9rem; font-weight: 700; color: var(--brass); letter-spacing: 0.02em; }
.event .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.25rem; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; background: var(--surface); }
caption { text-align: left; font-weight: 700; padding-bottom: 0.5rem; }
th, td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); }
thead th { background: var(--tint); }

ul.plain { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.35rem; }
figure { margin: 0; display: grid; gap: 0.5rem; }
figure img { width: 100%; max-width: 32rem; border-radius: 8px; border: 1px solid var(--line); }
figcaption { font-size: 0.9rem; color: var(--muted); }

form.signup { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.1rem; display: grid; gap: 0.85rem; max-width: 32rem; }
form.signup input[type="text"], form.signup input[type="email"], form.signup select { font: inherit; padding: 0.5rem 0.65rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); width: 100%; box-sizing: border-box; }
fieldset { border: 1px solid var(--line); border-radius: 6px; margin: 0; padding: 0.5rem 0.85rem 0.75rem; display: grid; gap: 0.35rem; }
legend { font-weight: 700; padding-inline: 0.25rem; }
.check { display: flex; gap: 0.5rem; align-items: center; }
.status { font-weight: 700; color: var(--accent); }

aside.side { display: grid; gap: 1.5rem; align-content: start; min-width: 0; }
aside.side section { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.1rem; }
dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.75rem; font-variant-numeric: tabular-nums; }
dt { font-weight: 700; }
dd { margin: 0; }

.results-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.results-list li { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 0.9rem 1.1rem; display: grid; gap: 0.25rem; }
.meta { font-size: 0.9rem; color: var(--muted); }

footer.site { background: var(--surface); border-top: 1px solid var(--line); }
footer.site .wrap { padding-block: 1.25rem; display: grid; gap: 0.75rem; font-size: 0.95rem; }
footer.site ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
details { border: 1px dashed var(--line); border-radius: 6px; padding: 0.6rem 0.85rem; }
summary { cursor: pointer; font-weight: 700; }
details ol { margin: 0.5rem 0 0; padding-left: 1.25rem; display: grid; gap: 0.3rem; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }