:root {
  color-scheme: light dark;
  --bg: #f7f7f4;
  --surface: #ffffff;
  --text: #1d2422;
  --muted: #5c6663;
  --border: #d7dcd7;
  --accent: #1f5fa8;
  --accent-contrast: #ffffff;
  --badge: #e4efe6;
  --badge-text: #1d5c33;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181a;
    --surface: #1d2327;
    --text: #e6e9e7;
    --muted: #9aa4a0;
    --border: #333d41;
    --accent: #82b4e8;
    --accent-contrast: #10141a;
    --badge: #1e3a28;
    --badge-text: #a4d8b4;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.9375rem;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- layout: single column, map pane docks right on wide screens --------- */

.layout { display: flex; flex-direction: column; min-height: 100vh; }
.content { padding: 1rem 1.25rem 2rem; max-width: 44rem; width: 100%; margin: 0 auto; }
.map-pane { order: -1; }
#map { height: 40vh; min-height: 260px; }

@media (min-width: 60rem) {
  .layout { flex-direction: row; }
  .content { flex: 0 0 30rem; max-width: 30rem; margin: 0; overflow-y: auto; height: 100vh; }
  .map-pane { order: 0; flex: 1; position: sticky; top: 0; height: 100vh; }
  #map { height: 100%; }
}

/* --- header --------------------------------------------------------------- */

h1 { font-size: 1.375rem; margin: 0.25rem 0 0; letter-spacing: -0.01em; }
.tagline { margin: 0.25rem 0 0.75rem; color: var(--muted); }
.sample-banner {
  margin: 0 0 1rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  font-size: 0.8125rem;
  color: var(--muted);
}

/* --- filters ---------------------------------------------------------------- */

.filters { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.25rem; }

#f-search {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}
.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.filter-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; font-size: 0.875rem; }
.filter-row label { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--muted); }
.filter-row select {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.4rem;
}
.filter-row select:disabled { opacity: 0.5; }
.check { cursor: pointer; }

#btn-locate {
  font: inherit;
  font-size: 0.875rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
}
#btn-locate:hover { background: var(--accent); color: var(--accent-contrast); }
.hint { font-size: 0.8125rem; color: var(--muted); }

/* --- lists ------------------------------------------------------------------ */

h2 { font-size: 1.0625rem; margin: 1.5rem 0 0.5rem; }
h2 .count { color: var(--muted); font-weight: normal; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }

.card {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: 0 0.85rem;
  padding: 0.65rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.card.always { grid-template-columns: 1fr; }

.datebox {
  text-align: center;
  align-self: start;
  font-variant-numeric: tabular-nums;
  border-right: 1px solid var(--border);
  padding-right: 0.65rem;
  line-height: 1.2;
}
.datebox .day { font-size: 1.25rem; font-weight: 600; display: block; }
.datebox .month { font-size: 0.75rem; text-transform: uppercase; color: var(--muted); display: block; }
.datebox .until { font-size: 0.6875rem; color: var(--muted); display: block; margin-top: 0.15rem; }

.card h3 { margin: 0; font-size: 0.9375rem; }
.card .meta { margin: 0.1rem 0 0; font-size: 0.8125rem; color: var(--muted); }
.card .meta .time { color: var(--text); font-weight: 600; }
.card .desc { margin: 0.3rem 0 0; font-size: 0.875rem; }
.card .tags { margin-top: 0.4rem; display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.tag {
  font-size: 0.6875rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  color: var(--muted);
}
.tag.free { background: var(--badge); border-color: transparent; color: var(--badge-text); }
.tag.diet { border-style: dashed; }
.card .more { display: inline-block; margin-top: 0.4rem; font-size: 0.875rem; }
.km { font-variant-numeric: tabular-nums; }

.empty { color: var(--muted); border: 1px dashed var(--border); border-radius: 8px; padding: 1rem; text-align: center; }

footer { margin-top: 2.5rem; font-size: 0.75rem; color: var(--muted); }
footer p { margin: 0.2rem 0; }

@media (prefers-reduced-motion: no-preference) {
  .chip, #btn-locate { transition: background-color 120ms ease, color 120ms ease; }
}
