:root {
  color-scheme: light;
  --ink: #172d2b;
  --muted: #52615b;
  --canvas: #f7f7ef;
  --green: #153d36;
  --marigold: #edbb65;
  --line: #dbdfd4;
  background: var(--canvas);
  color: var(--ink);
  font-family: system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; }
button, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #ac603d; outline-offset: 4px; }
.shell { width: min(1100px, calc(100% - 3rem)); margin-inline: auto; }
header { background: var(--canvas); border-bottom: 1px solid var(--line); }
.masthead { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--green); font: 700 clamp(1.35rem, 3vw, 1.9rem)/1 Georgia, serif; letter-spacing: -.035em; text-decoration: none; }
.brand-mark { width: 2.375rem; height: 2.375rem; flex: none; }
.region, footer, .organizer, #count { color: var(--muted); }
.region { font-size: .9rem; }
.hero { margin-top: 1.5rem; padding: clamp(1.5rem, 5.5vw, 4.2rem); border-radius: 22px; background: var(--green); color: #fffef8; }
.hero h1, h2, h3 { font-family: Georgia, serif; font-weight: 500; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 5.35rem); line-height: .99; letter-spacing: -.052em; margin: 0; }
.hero h1 em { color: #f3ca82; }
.hero p { max-width: 34rem; line-height: 1.55; color: #e2e9df; margin: 1rem 0 1.8rem; }
form { display: flex; gap: .8rem; align-items: end; padding: 1.1rem; border-radius: 14px; background: #fffef8; color: var(--ink); max-width: 920px; }
.fields { flex: 1; display: grid; grid-template-columns: .85fr 1.1fr 1.1fr 1fr; gap: .8rem; }
label { display: grid; gap: .45rem; font-size: .9rem; font-weight: 700; min-width: 0; }
select { appearance: none; width: 100%; min-height: 44px; padding: .62rem 1.6rem .62rem .7rem; color: var(--ink); background: linear-gradient(45deg, transparent 50%, #35574e 50%) right 13px center / 5px 5px no-repeat, linear-gradient(135deg, #35574e 50%, transparent 50%) right 8px center / 5px 5px no-repeat, #fff; border: 1px solid #bdc9bf; border-radius: 7px; font-weight: 500; }
.primary { background: var(--marigold); color: #23312a; padding: .68rem .95rem; min-height: 44px; border: 1px solid transparent; border-radius: 7px; font-weight: 750; white-space: nowrap; }
.primary:hover { background: #f8cc81; }
.results { padding-block: 2.2rem 2.7rem; }
.results-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1rem; }
h2 { font-size: clamp(2rem, 5vw, 2.65rem); margin: 0 0 .3rem; }
#count { margin: 0; }
#clear { padding: .45rem .75rem; min-height: 42px; border: 1px solid #a6b5a7; border-radius: 7px; background: #fffef8; color: var(--green); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding: 0; margin: 0; list-style: none; }
.card { min-width: 0; background: #fffef8; border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem; display: flex; flex-direction: column; }
.meta { display: flex; align-items: center; justify-content: space-between; gap: .4rem; flex-wrap: wrap; font-size: .875rem; }
.format { background: #e4eedf; color: #24463a; border-radius: 999px; padding: .26rem .57rem; font-weight: 700; }
.format.registration { background: #f6e8cf; color: #5d3d23; }
.town { color: var(--muted); }
h3 { font-size: 1.62rem; line-height: 1.1; margin: .92rem 0 .35rem; }
.organizer { margin: 0; font-size: .9rem; }
dl { margin: 1rem 0; border-top: 1px solid var(--line); padding-top: .8rem; font-size: .9rem; }
dl div { display: grid; grid-template-columns: 3.3rem 1fr; gap: .35rem; margin-bottom: .4rem; }
dt { font-weight: 700; }
dd { margin: 0; }
.source { font-size: .95rem; font-weight: 700; margin-top: auto; padding-block: .35rem; align-self: start; text-underline-offset: .24em; }
.source:hover { color: #984a2e; }
.empty { background: #fffef8; border: 1px solid var(--line); padding: 1.2rem; border-radius: 12px; }
footer { border-top: 1px solid var(--line); padding-block: 1rem 2rem; font-size: .9rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 900px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 840px) { form { display: grid; } .primary { justify-self: start; } }
@media (max-width: 540px) {
  .shell { width: calc(100% - 1.5rem); }
  .masthead { min-height: 60px; gap: .55rem; }
  .brand-mark { width: 1.9rem; height: 1.9rem; }
  .region { text-align: right; }
  .hero { margin-top: .8rem; border-radius: 15px; }
  .fields, .cards { grid-template-columns: 1fr; }
  .primary { width: 100%; }
}

.markets { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .85rem; }
.markets button { color: #fffef8; background: transparent; border: 1px solid #90a89c; border-radius: 6px; padding: .5rem .65rem; font-size: .9rem; min-height: 42px; }
.markets button[aria-pressed="true"] { background: #e4eedf; border-color: #e4eedf; color: var(--green); font-weight: 700; }
#market-note { color: var(--muted); margin: .35rem 0 0; }
@media (min-width: 541px) and (max-width: 840px) { .fields { grid-template-columns: 1fr 1fr; } }
