:root {
  color-scheme: light;
  --bg: #f6f3ec;
  --panel: #ffffff;
  --text: #1c1917;
  --muted: #6b6258;
  --line: #ded8cf;
  --green: #18864b;
  --green-soft: #e6f5ec;
  --amber: #a15c00;
  --amber-soft: #fff5df;
  --red: #b91c1c;
  --blue: #2563eb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.app-header {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 0 0 0.15rem;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  line-height: 1.05;
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 0.65rem;
}

button {
  background: #1c1917;
  border: 1px solid #1c1917;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  padding: 0.7rem 1rem;
}

button:hover {
  background: #3c352e;
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.text-button {
  background: transparent;
  border: 0;
  color: var(--blue);
  padding: 0;
}

.text-button:hover {
  background: transparent;
  text-decoration: underline;
}

.layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(340px, 440px) minmax(0, 1fr);
  height: calc(100vh - 88px);
  padding: 0 1rem 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.status-card {
  background: #fff9ec;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.85rem 1rem;
}

.status-card.error {
  background: #fff1f1;
  color: var(--red);
}

.filters {
  display: grid;
  gap: 0.95rem;
  max-height: 48vh;
  overflow: auto;
  padding: 1rem;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

legend,
.field {
  color: var(--muted);
  display: grid;
  font-size: 0.78rem;
  font-weight: 800;
  gap: 0.45rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

input[type="date"],
input[type="search"],
select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  min-width: 0;
  padding: 0.7rem 0.75rem;
  text-transform: none;
}

.check-list,
.radio-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.check-list label,
.radio-list label,
.switch-row {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 0.95rem;
  font-weight: 650;
  gap: 0.5rem;
  letter-spacing: 0;
  text-transform: none;
}

.check-list span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  margin-left: auto;
}

.compact label {
  align-items: baseline;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: #1c1917;
  height: 1rem;
  width: 1rem;
}

.switch-row {
  color: var(--text);
}

.results-header {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.85rem 1rem;
}

.results-header span {
  color: var(--muted);
  display: block;
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.results-list {
  border-top: 1px solid var(--line);
  list-style: none;
  margin: 0;
  min-height: 0;
  overflow: auto;
  padding: 0;
}

.result-item {
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  padding: 0.9rem 1rem;
}

.result-item:hover,
.result-item.active {
  background: #faf7f1;
}

.result-title-row {
  align-items: center;
  display: flex;
  gap: 0.6rem;
  justify-content: space-between;
}

.result-title-row h2 {
  font-size: 1rem;
  line-height: 1.2;
  margin: 0;
}

.badge {
  border-radius: 999px;
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.5rem;
}

.badge.available {
  background: var(--green-soft);
  color: var(--green);
}

.badge.none {
  background: var(--amber-soft);
  color: var(--amber);
}

.result-meta {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  margin: 0.35rem 0 0;
}

.sport-row,
.slot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.pill {
  background: #f0ece4;
  border-radius: 999px;
  color: #51483f;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
}

.slot-pill {
  background: #eef8f2;
  color: #17613b;
}

.link-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.7rem;
}

.link-row a {
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
}

.link-row a:hover {
  text-decoration: underline;
}

.map-shell {
  border: 1px solid var(--line);
  border-radius: 22px;
  min-height: 420px;
  overflow: hidden;
}

#map {
  height: 100%;
  min-height: 420px;
  width: 100%;
}

.marker-dot {
  align-items: center;
  background: #8a8074;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 8px 18px rgb(0 0 0 / 26%);
  color: #fff;
  display: flex;
  font-size: 0.78rem;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.marker-dot.available {
  background: var(--green);
}

.marker-dot.none {
  background: var(--amber);
}

.marker-dot.hidden {
  background: #8a8074;
}

.leaflet-popup-content {
  margin: 0.85rem 1rem;
  min-width: 230px;
}

.popup h3 {
  font-size: 1rem;
  margin: 0 0 0.35rem;
}

.popup p {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0.25rem 0;
}

.popup a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.popup a:hover {
  text-decoration: underline;
}

@media (max-width: 920px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .panel {
    min-height: 580px;
  }

  .map-shell,
  #map {
    height: 70vh;
  }
}
