:root {
  --green: #1b5e3f;
  --green-dark: #123f2b;
  --sand: #f6f4ec;
  --ink: #21261f;
  --muted: #5f6b5c;
  --line: #d9d9cb;
  --ok: #1a7f37;
  --warn: #9a6700;
  --card: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--sand);
  line-height: 1.45;
}

.site-header {
  background: var(--green);
  color: #fff;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.brand-logo {
  flex-shrink: 0;
  display: block;
  background: #fff;
  border-radius: 8px;
  padding: 2px 4px;
  line-height: 0;
}
.brand-logo img { display: block; width: 84px; height: auto; }
.site-header h1 { margin: 0 0 0.15rem; font-size: 1.3rem; }
.site-header p { margin: 0; opacity: 0.9; font-size: 0.9rem; }

main { padding: 1.25rem 1.5rem 2rem; max-width: 1200px; margin: 0 auto; }

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.1rem;
  align-items: flex-end;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem;
}
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field label, .field legend { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.field input[type="text"],
.field input[type="date"],
.field input[type="number"] {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 0.95rem;
  background: #fff;
}
.field input[type="text"] { min-width: 15rem; }
.field input[type="number"] { width: 8rem; }
.field input[type="range"] { width: 11rem; }

fieldset.equipment {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.4rem 0.7rem 0.55rem;
  margin: 0;
}
fieldset.equipment label {
  font-weight: 400;
  color: var(--ink);
  margin-right: 0.7rem;
  font-size: 0.9rem;
}

#submit-btn {
  padding: 0.6rem 1.4rem;
  background: var(--green);
  color: #fff;
  border: 0;
  border-radius: 7px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
#submit-btn:hover { background: var(--green-dark); }
#submit-btn:disabled { opacity: 0.6; cursor: progress; }

.results-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1rem;
  margin: 0.5rem 0 0.7rem;
  font-size: 0.9rem;
}
.results-toolbar[hidden] { display: none; }
.results-toolbar label { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.results-count { color: var(--muted); }

.status { min-height: 1.2rem; margin: 0.9rem 0 0.3rem; font-size: 0.9rem; }
.status.error { color: #b42318; font-weight: 600; }
.status.notice { color: var(--warn); }
.status.busy { color: #475467; }
.status.busy::before {
  content: "";
  display: inline-block;
  width: 0.75em;
  height: 0.75em;
  margin-right: 0.5em;
  vertical-align: -0.05em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .status.busy::before { animation-duration: 2.5s; }
}

.disclaimer {
  margin: 0.9rem 0 0;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #573b00;
  background: #fff8e6;
  border: 1px solid #f2d98a;
  border-radius: 6px;
}
.disclaimer a { color: inherit; }

.results-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 1.25rem;
  margin-top: 0.5rem;
  align-items: start;
}
.results-layout.no-map { grid-template-columns: 1fr; }
.results-layout.no-map .map-wrap { display: none; }
.map-wrap { position: sticky; top: 1rem; }
#map {
  height: 560px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.park {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.8rem;
}
.park summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.8rem;
}
.park summary::-webkit-details-marker { display: none; }
.park h3 { margin: 0; font-size: 1.05rem; }
.park .dist { color: var(--muted); font-size: 0.85rem; }
.badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
}
.badge.ok { background: #e6f4ea; color: var(--ok); }
.badge.none { background: #f2efe3; color: var(--muted); }
.badge.leads { background: #fdf1dd; color: var(--warn); }

.park a.book {
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
  white-space: nowrap;
}

table.sites {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.7rem;
  font-size: 0.86rem;
}
table.sites th, table.sites td {
  text-align: left;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--line);
}
table.sites th { color: var(--muted); font-weight: 600; }
tr.avail td:first-child { font-weight: 700; }
.tag {
  display: inline-block;
  font-size: 0.72rem;
  background: #eef0e8;
  border-radius: 4px;
  padding: 0 0.35rem;
  margin-right: 0.2rem;
}
.yes { color: var(--ok); font-weight: 700; }
.no { color: var(--muted); }

.park .park-meta {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.82rem;
}
.park-body {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.data-credit {
  margin: 0 0 0.6rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.data-credit a, .site-footer a { color: var(--green); font-weight: 600; }

.site-footer {
  padding: 1rem 1.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 900px) {
  .results-layout { grid-template-columns: 1fr; }
  .map-wrap { position: static; order: -1; }
  #map { height: 320px; }
}
