body {
  display: flex;
}

#sidebar {
  width: 300px;
  flex-shrink: 0;
  border-right: 1px solid var(--rule);
  padding: 24px 22px 28px;
  overflow-y: auto;
  height: 100vh;
  background: var(--paper);
}

#sidebar::-webkit-scrollbar { width: 8px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 4px; }

.page-header {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 18px;
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.dataset-date {
  margin: 6px 0 0 0;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.dataset-date:empty { display: none; }

.group {
  margin-bottom: 28px;
}

.group-title {
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 600;
}

.section {
  margin-bottom: 14px;
}

.section:last-child {
  margin-bottom: 0;
}

.section-title {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.section-title::-webkit-details-marker { display: none; }

details > .section-title::before {
  content: "›";
  font-size: 14px;
  color: var(--ink-muted);
  transition: transform 0.15s ease;
  display: inline-block;
}

details[open] > .section-title::before {
  transform: rotate(90deg);
}

.section-title .label { flex: 1; }

.reset {
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.reset:hover { color: var(--accent); }

.cselect {
  position: relative;
  width: 100%;
}

.cselect-trigger {
  width: 100%;
  padding: 8px 12px;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.cselect-trigger:hover { border-color: var(--ink-soft); }
.cselect.open .cselect-trigger { border-color: var(--ink); background: var(--paper); }

.cselect-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(26, 22, 18, 0.12);
  z-index: 100;
}

.cselect-option {
  padding: 7px 12px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}

.cselect-option:hover { background: var(--paper-warm); color: var(--ink); }
.cselect-option.selected { color: var(--ink); font-weight: 500; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 12px;
  font-family: inherit;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  line-height: 1.2;
}

.chip:hover { border-color: var(--ink-soft); color: var(--ink); }

.chip.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.2;
}

/* Swatch mirrors the marker treatment: white inner stroke + rule
 * outline so the legend reads as a true key for what's on the map. */
.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 0 1px var(--rule);
  flex-shrink: 0;
}

.legend-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ring-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.ring-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 4px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--rule);
  font-family: inherit;
  font-size: 12px;
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
  transition: color 0.15s ease;
}

.ring-row:last-child { border-bottom: none; }
.ring-row:hover { color: var(--ink); }
.ring-row:hover .ring-swatch { border-color: var(--ink-soft); }

.ring-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-muted);
  background: transparent;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.ring-row.active { color: var(--ink); font-weight: 500; }
.ring-row.active .ring-swatch {
  background: #2d5f8f;
  border-color: #2d5f8f;
}

.tool-btn {
  width: 100%;
  margin-top: 14px;
  padding: 9px 12px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 4px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.tool-btn:hover { opacity: 0.85; }

/* Ring label rides the circle's SVG path. The paint-order + paper
 * stroke creates a halo so the text stays readable when it crosses
 * the ring stroke or hotel markers underneath. */
.ring-label {
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  fill: #2d5f8f;
  letter-spacing: 0.06em;
  pointer-events: none;
  paint-order: stroke fill;
  stroke: var(--paper);
  stroke-width: 3px;
  stroke-linejoin: round;
}

#map {
  flex: 1;
  height: 100vh;
  position: relative;
  background: #e8dfcc;
}

.leaflet-container { background: #e8dfcc; font-family: inherit; }
.leaflet-tile-pane { filter: sepia(0.15) saturate(0.7) brightness(0.98); }
.leaflet-control-zoom a {
  background: var(--paper) !important;
  color: var(--ink) !important;
  border-color: var(--rule) !important;
}

.leaflet-popup-content-wrapper {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(26, 22, 18, 0.18);
  padding: 0;
}
.leaflet-popup-tip { background: var(--paper); border: 1px solid var(--rule); }
.leaflet-popup-content { margin: 0; padding: 0; line-height: 1.5; }

.popup {
  padding: 14px 16px;
  min-width: 240px;
  max-width: 300px;
}

.popup .name {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.popup .meta-line {
  margin: 0 0 10px 0;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.popup dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 12px;
  margin: 0;
  font-size: 12px;
}

.popup dt {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding-top: 1px;
}

.popup dd {
  margin: 0;
  color: var(--ink);
}

.popup .stars { color: var(--accent); letter-spacing: 1px; }
.popup .price .amount { font-weight: 600; }
.popup .price .code {
  margin-left: 6px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.leaflet-tooltip.pin-tip {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(26, 22, 18, 0.10);
  padding: 6px 10px;
  font-family: inherit;
  white-space: normal;
}

.leaflet-tooltip.pin-tip .name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
}

.leaflet-tooltip.pin-tip .operator {
  margin-top: 2px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Match Leaflet's directional arrow color to the paper background so the
 * tooltip reads as one piece rather than a white triangle on cream. */
.leaflet-tooltip-top.pin-tip::before { border-top-color: var(--paper); }
.leaflet-tooltip-bottom.pin-tip::before { border-bottom-color: var(--paper); }
.leaflet-tooltip-left.pin-tip::before { border-left-color: var(--paper); }
.leaflet-tooltip-right.pin-tip::before { border-right-color: var(--paper); }

#map .error {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: #fee;
  border: 1px solid #fbb;
  color: #900;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  z-index: 1000;
}
