* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

header {
  padding: 0.6rem 1.25rem;
  background: #1a1a2e;
  color: #fff;
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
}

header h1 {
  font-size: 1.15rem;
  font-weight: 600;
  white-space: nowrap;
}

.subtitle {
  font-size: 0.8rem;
  color: #aab;
}

.last-updated {
  font-size: 0.75rem;
  color: #778;
  margin-left: auto;
}

.last-updated a,
.last-updated a:visited,
.last-updated a:hover,
.last-updated a:active {
  color: #fff;
  text-decoration: underline;
}

#map {
  flex: 1;
}

/* Tooltip */
.dc-tooltip {
  background: #fff;
  border: none;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
  line-height: 1.5;
  min-width: 160px;
}

.dc-tooltip .owner {
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 0.2rem;
  color: #1a1a2e;
}

.dc-tooltip .address {
  color: #777;
  font-size: 0.78rem;
}

.dc-tooltip .notes {
  color: #555;
  font-size: 0.78rem;
  margin-top: 0.2rem;
}

.dc-tooltip .notes a {
  color: #2a6ebb;
}

/* The popup wrapper already supplies background/shadow/padding, so the
   tooltip styles just need to provide text formatting inside it. */
.leaflet-popup-content .dc-tooltip {
  background: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  min-width: 0;
}

.dc-tooltip .dc-divider {
  border: none;
  border-top: 1px solid #eee;
  margin: 0.4rem 0;
}

/* Legend */
#legend {
  position: absolute;
  bottom: 2rem;
  right: 0.75rem;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  padding: 0.75rem 1rem;
  font-size: 0.78rem;
  line-height: 1.8;
  min-width: 170px;
}

#legend h4 {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: #1a1a2e;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#legend-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

#legend-header h4 {
  margin-bottom: 0;
}

#legend-toggle {
  background: none;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #1a1a2e;
  padding: 0 0.35rem;
  line-height: 1.4;
  margin-left: 0.5rem;
}

#legend.collapsed #legend-body {
  display: none;
}

/* Mobile */
@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 0.4rem 0.75rem;
  }

  header h1 {
    white-space: normal;
  }

  .last-updated {
    margin-left: 0;
  }

  #legend {
    bottom: 1rem;
    right: 0.5rem;
    min-width: 0;
  }
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid transparent;
}

.legend-line {
  width: 22px;
  height: 3px;
  flex-shrink: 0;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
  border: 1.5px solid transparent;
}

.legend-sep {
  margin: 0.35rem 0 0.2rem;
  border: none;
  border-top: 1px solid #eee;
}
