:root {
  --red: #b0142f;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --border: #e2e2e2;
  --bg: #fafafa;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

body {
  display: flex;
  flex-direction: column;
}

.topbar {
  padding: 0.75rem 1rem 0.5rem;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.topbar h1 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.topbar .subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.6rem 1rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.controls input,
.controls select {
  font-size: 0.9rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

#search {
  flex: 1 1 220px;
  min-width: 160px;
}

.locate-btn {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.locate-btn:hover {
  border-color: #c9c9c9;
}

.locate-btn.active {
  border-color: var(--red);
  color: var(--red);
}

.locate-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.locate-status {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 1000;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  font-size: 0.78rem;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  display: none;
}

.locate-status.show {
  display: block;
}

.locate-status.error {
  color: var(--red);
}

.result-count {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Multi-select dropdown */
.multiselect {
  position: relative;
}

.multiselect-toggle {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.4rem 1.6rem 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff url('data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 20 20%22 fill=%22%236b6b6b%22><path d=%22M5.5 7.5l4.5 5 4.5-5z%22/></svg>') no-repeat right 0.4rem center;
  background-size: 14px;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.multiselect-toggle:hover {
  border-color: #c9c9c9;
}

.multiselect.open .multiselect-toggle {
  border-color: var(--red);
}

.multiselect.has-selection .multiselect-toggle {
  border-color: var(--red);
  color: var(--red);
  font-weight: 600;
}

.multiselect-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 1000;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  padding: 0.4rem;
  min-width: 230px;
  max-height: 70vh;
  overflow-y: auto;
}

.ms-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.3rem 0.5rem 0.15rem;
}

.ms-group-label-spaced {
  margin-top: 0.3rem;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}

.multiselect.open .multiselect-panel {
  display: block;
}

.ms-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}

.ms-option:hover {
  background: var(--bg);
}

.ms-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ms-check {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 1.5px solid #c9c9c9;
  border-radius: 4px;
  background: #fff;
  position: relative;
  transition: background-color 0.12s, border-color 0.12s;
}

.ms-check::after {
  content: "";
  position: absolute;
  display: none;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.ms-option input[type="checkbox"]:checked + .ms-check {
  background: var(--red);
  border-color: var(--red);
}

.ms-option input[type="checkbox"]:checked + .ms-check::after {
  display: block;
}

.ms-option input[type="checkbox"]:focus-visible + .ms-check {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.ms-swatch {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 20px;
  border-radius: 5px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.ms-text {
  color: var(--ink);
}

.ms-clear {
  display: block;
  width: 100%;
  margin-top: 0.15rem;
  padding-top: 0.5rem;
  border: none;
  border-top: 1px solid var(--border);
  background: none;
  font: inherit;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}

.ms-clear:hover {
  color: var(--red);
}

#map {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.footer {
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
  color: var(--muted);
  background: #fff;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer a { color: var(--muted); }

/* Marker badges */
.award-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.award-3-star { background: var(--red); }
.award-2-star { background: #c8442f; }
.award-1-star { background: #d67a3a; }
.award-bib-gourmand { background: #6b3fa0; }
.award-selected { background: #4a4a4a; }

/* Popup content */
.popup-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 2px;
}

.popup-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 4px;
}

.popup-award {
  font-size: 0.78rem;
  font-weight: 600;
}

.popup-address {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}
