:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1d1d1b;
  --muted: #65635d;
  --border: #e3e0d8;
  --accent: #b4441f;
  --accent-text: #ffffff;
  --error: #a3261b;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171716;
    --surface: #222220;
    --text: #edebe6;
    --muted: #a6a39b;
    --border: #3a3935;
    --accent: #f08a5d;
    --accent-text: #1a1a18;
    --error: #ff8a7a;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); }
main, header.site { max-width: 46rem; margin: 0 auto; padding: 0 16px; }
header.site h1 { font-size: 1.5rem; margin: 1.5rem 0 1rem; }
header.site h1 a { color: inherit; text-decoration: none; }

.search {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: end;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 1rem;
}
.search label { display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); gap: .25rem; }
input, select, button {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px; padding: .45rem .6rem;
}
button { background: var(--accent); color: var(--accent-text); border-color: var(--accent); cursor: pointer; }
button.secondary { background: transparent; color: var(--accent); }
button.link { background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; }
button:disabled { opacity: .6; cursor: progress; }

.categories { border: 0; margin: 0; padding: 0; flex-basis: 100%; display: flex; flex-wrap: wrap; gap: .4rem; }
.categories legend { font-size: .85rem; color: var(--muted); margin-bottom: .35rem; padding: 0; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: .3rem .75rem; border-radius: 999px; font-size: .9rem;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer; user-select: none;
}
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.tags { margin: .2rem 0 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.tag { font-size: .75rem; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 .5rem; }

.error { color: var(--error); font-weight: 600; }
.hint, .empty { color: var(--muted); }
.subscribe { margin: 1rem 0; }
.subscribe p { margin: .25rem 0; }
.feed { color: var(--muted); font-size: .95rem; }

.day h2 {
  font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  margin: 2rem 0 .5rem; padding-bottom: .25rem; border-bottom: 1px solid var(--border);
}
.events { list-style: none; margin: 0; padding: 0; }
.event { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: .75rem 0; }
.event + .event { border-top: 1px solid var(--border); }
.when { font-variant-numeric: tabular-nums; color: var(--muted); }
.what h3 { font-size: 1.05rem; margin: 0; }
.what h3 a { color: inherit; }
.where { margin: .1rem 0; color: var(--muted); font-size: .95rem; }
.summary { margin: .35rem 0 0; font-size: .95rem; }

@media (max-width: 520px) {
  .event { grid-template-columns: 1fr; gap: .1rem; }
}
