.family-map-block {
  margin: 2rem 0;
}

.family-map-title {
  margin: 0 0 0.75rem;
  color: #3f3527;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.family-map-shell {
  position: relative;
  padding: 1rem;
  border: 1px solid #b8aa8f;
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 248, 232, 0.65), transparent 45%),
    radial-gradient(circle at 80% 85%, rgba(216, 198, 162, 0.35), transparent 42%),
    linear-gradient(145deg, #eee3cc 0%, #e2d3b5 42%, #d8c5a3 100%);
  box-shadow:
    inset 0 0 0 1px rgba(120, 100, 70, 0.18),
    inset 0 10px 28px rgba(255, 255, 255, 0.25),
    0 10px 24px rgba(54, 43, 28, 0.16);
}

.family-map-controls {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 700;
  padding: 0.5rem 0.65rem 0.55rem;
  background: rgba(247, 241, 229, 0.95);
  border: 1px solid #b9ab91;
  border-radius: 6px;
  box-shadow: 0 6px 14px rgba(72, 57, 37, 0.18);
}

.family-filter-label {
  display: block;
  margin: 0 0 0.3rem;
  color: #4e4130;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 0.79rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.family-filter-select {
  min-width: 210px;
  padding: 0.26rem 0.4rem;
  border: 1px solid #b8aa8f;
  border-radius: 4px;
  background: #fbf7ee;
  color: #3e3224;
  font-size: 0.86rem;
}

.family-filter-select:focus {
  outline: 2px solid #8b7550;
  outline-offset: 1px;
}

.family-map-canvas {
  width: 100%;
  height: 580px;
  border: 1px solid #c4b69a;
  border-radius: 6px;
  background: #e8deca;
}

.family-map-shell .leaflet-container {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #e8deca;
}

.family-map-shell .leaflet-tile {
  filter: grayscale(58%) saturate(70%) brightness(1.06) contrast(0.93);
}

.family-map-shell .leaflet-control-attribution {
  color: #5f5341;
  background: rgba(245, 237, 223, 0.88);
  border-top-left-radius: 4px;
  border: 1px solid rgba(122, 107, 83, 0.26);
}

.family-map-shell .leaflet-control-attribution a {
  color: #564933;
}

.family-map-legend {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 700;
  min-width: 180px;
  padding: 0.55rem 0.7rem 0.65rem;
  background: rgba(247, 241, 229, 0.94);
  border: 1px solid #b9ab91;
  border-radius: 6px;
  box-shadow: 0 6px 14px rgba(72, 57, 37, 0.18);
  pointer-events: none;
}

.family-legend-title {
  margin: 0 0 0.35rem;
  color: #4e4130;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.family-legend-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.family-legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #473a2a;
  font-size: 0.87rem;
  line-height: 1.35;
}

.family-legend-swatch {
  width: 11px;
  height: 11px;
  border: 1px solid rgba(63, 50, 33, 0.35);
  border-radius: 50%;
  flex: 0 0 auto;
}

.family-place-label {
  background: none;
  border: 0;
}

.family-place-name {
  display: inline-block;
  padding: 1px 5px;
  color: #3e3628;
  background: rgba(249, 244, 234, 0.88);
  border: 1px solid rgba(114, 98, 73, 0.34);
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(42, 35, 25, 0.12);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transform: translateY(-6px);
}

.family-route-label {
  background: none;
  border: 0;
}

.family-route-arrow-wrapper {
  background: transparent;
  border: 0;
  pointer-events: none;
}

.family-route-arrow-svg {
  display: block;
  width: 20px;
  height: 20px;
  overflow: visible;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 1px 2px rgba(28, 22, 16, 0.25));
}

.family-route-label-chip {
  display: inline-block;
  padding: 2px 7px;
  color: #362d22;
  background: rgba(251, 246, 237, 0.94);
  border: 1px solid #b6a98e;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(58, 46, 31, 0.15);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.15;
  text-transform: uppercase;
  font-variant: small-caps;
  white-space: nowrap;
}

.family-route-details {
  color: #352d22;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 0.8rem;
  line-height: 1.35;
  max-width: 320px;
}

.family-route-details strong {
  color: #2d261d;
  font-weight: 600;
}

.family-route-people-lines {
  margin-top: 0.12rem;
}

.leaflet-tooltip.family-route-tooltip {
  padding: 0.4rem 0.55rem;
  color: #352d22;
  background: rgba(250, 246, 238, 0.96);
  border: 1px solid #b9ab8e;
  border-radius: 4px;
  box-shadow: 0 3px 8px rgba(52, 40, 24, 0.18);
  max-width: 320px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.leaflet-popup.family-route-popup .leaflet-popup-content-wrapper {
  background: rgba(250, 246, 238, 0.98);
  border: 1px solid #b9ab8e;
  border-radius: 6px;
  box-shadow: 0 5px 14px rgba(52, 40, 24, 0.2);
}

.leaflet-popup.family-route-popup .leaflet-popup-content {
  margin: 0.55rem 0.65rem;
}

.leaflet-popup.family-route-popup .leaflet-popup-tip {
  background: rgba(250, 246, 238, 0.98);
}

@media (max-width: 900px) {
  .family-map-canvas {
    height: 500px;
  }

  .family-map-controls {
    top: 0.9rem;
    left: 0.9rem;
  }

  .family-filter-select {
    min-width: 190px;
  }

  .family-map-legend {
    top: 0.9rem;
    right: 0.9rem;
    min-width: 160px;
  }
}

@media (max-width: 640px) {
  .family-map-title {
    font-size: 1.35rem;
  }

  .family-map-canvas {
    height: 430px;
  }

  .family-map-controls {
    position: static;
    margin: 0 0 0.65rem;
    width: fit-content;
  }

  .family-filter-select {
    min-width: 180px;
  }

  .family-map-legend {
    position: static;
    margin: 0.65rem 0 0;
    width: fit-content;
  }
}
