.tclas-map-wrapper {
  margin: 2rem 0;
}

.tclas-ancestor-map {
  width: 100%;
  height: 520px;
  background: var(--c-or-pale, #EBF5FC);
  border: 1px solid var(--c-border, #ddd);
  border-radius: var(--radius, 8px);
}

.tclas-map-caption {
  color: #777;
  margin: 0.5rem 0 0;
  line-height: 1.5;
}

.tclas-ancestor-map.leaflet-container,
.tclas-ancestor-map .leaflet-container {
  font-family: inherit;
  background: var(--c-or-pale, #EBF5FC);
}

.tclas-map-popup-wrap .leaflet-popup-content-wrapper {
  border-radius: var(--radius, 8px);
  box-shadow: 0 2px 8px rgba(10, 37, 64, 0.18);
  border: 1px solid var(--c-border, #ddd);
  padding: 0;
}
.tclas-map-popup-wrap .leaflet-popup-content {
  margin: 0;
  min-width: 160px;
}

.tclas-map-popup {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 1rem;
}

.tclas-map-popup-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-ardoise, #2B6282);
  line-height: 1.3;
}

.tclas-map-popup-canton {
  font-size: 0.875rem;
  font-style: italic;
  color: var(--c-ardoise, #2B6282);
  opacity: 0.7;
}

.tclas-map-popup-count {
  font-size: 0.875rem;
  color: var(--c-body-text, #333);
  font-weight: 400;
  margin-top: 0.25rem;
}

.tclas-map-popup-surnames {
  font-size: 0.875rem;
  color: var(--c-muted, #777);
  margin-top: 0.15rem;
  line-height: 1.45;
}

.tclas-map-popup-link {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--c-aigue, #3ea9e0);
  text-decoration: none;
  margin-top: 0.4rem;
  font-weight: 700;
}
.tclas-map-popup-link:hover {
  text-decoration: underline;
}

a.tclas-map-popup-cta {
  display: inline-block;
  font-size: 0.875rem;
  color: #fff;
  background: var(--c-crimson, #8B3A3A);
  text-decoration: none;
  padding: 0.3rem 0.65rem;
  border-radius: 3px;
  margin-top: 0.4rem;
  font-weight: 700;
  transition: background 0.15s;
}
a.tclas-map-popup-cta:hover {
  background: var(--c-crimson-dk, #6b1f1f);
  color: #fff;
}

.tclas-map-empty {
  font-size: 0.9rem;
  color: #777;
  text-align: center;
  padding: 2rem;
  border: 1px dashed var(--c-border, #ddd);
  margin: 1rem 0;
}
.tclas-map-empty a {
  color: var(--c-crimson, #E31E26);
  text-decoration: underline;
}

.tclas-map-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.tclas-map-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1px solid var(--c-border, #ddd);
  border-radius: var(--radius, 8px);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-ardoise, #2B6282);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
}
.tclas-map-view-toggle:hover {
  background: var(--c-or-pale, #FAF9F6);
  border-color: var(--c-ardoise, #2B6282);
}
.tclas-map-view-toggle[aria-pressed=true] {
  background: var(--c-ardoise, #2B6282);
  color: #fff;
  border-color: var(--c-ardoise, #2B6282);
}

.tclas-map-list {
  border: 1px solid var(--c-border, #ddd);
  border-radius: var(--radius, 8px);
  overflow: hidden;
}

.tclas-map-list__table {
  width: 100%;
  border-collapse: collapse;
}
.tclas-map-list__table th {
  background: var(--c-or-pale, #FAF9F6);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-muted, #777);
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--c-border, #ddd);
}
.tclas-map-list__table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  vertical-align: middle;
}
.tclas-map-list__table th:last-child, .tclas-map-list__table td:last-child {
  text-align: right;
}
.tclas-map-list__table tr:last-child td {
  border-bottom: none;
}
.tclas-map-list__table a {
  color: var(--c-ardoise, #2B6282);
  text-decoration: none;
  font-weight: 600;
}
.tclas-map-list__table a:hover {
  text-decoration: underline;
}

.tclas-map-list__surnames {
  color: var(--c-muted, #777);
}

.tclas-map-list__more {
  color: var(--c-aigue, #3ea9e0);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.tclas-map-list__more:hover {
  text-decoration: underline;
}

.tclas-map-list__row--clickable {
  cursor: pointer;
}
.tclas-map-list__row--clickable:hover {
  background: rgba(43, 98, 130, 0.04);
}

.tclas-map-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .tclas-map-split {
    grid-template-columns: 1fr;
  }
}

.tclas-map-split__map .tclas-ancestor-map {
  height: 600px;
  border-radius: var(--radius, 8px);
}

.tclas-map-split__list {
  border: 1px solid var(--c-border, #ddd);
  border-radius: var(--radius, 8px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 600px;
}
@media (max-width: 900px) {
  .tclas-map-split__list {
    max-height: 400px;
  }
}

.tclas-map-split__list-header {
  padding: 0.5rem 0.75rem;
  background: var(--c-or-pale, #FAF9F6);
  border-bottom: 1px solid var(--c-border, #ddd);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tclas-map-split__search {
  flex: 1;
  border: 1px solid var(--c-border, #ddd);
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  font-family: inherit;
  color: var(--c-body-text, #333);
  background: #fff;
  outline: none;
}
.tclas-map-split__search::placeholder {
  color: var(--c-muted, #999);
}
.tclas-map-split__search:focus {
  border-color: var(--c-ardoise, #2B6282);
}

.tclas-map-split__count {
  font-weight: 600;
  color: var(--c-muted, #777);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tclas-map-split__list-scroll {
  overflow-y: auto;
  flex: 1;
}
.tclas-map-split__list-scroll::-webkit-scrollbar {
  width: 6px;
}
.tclas-map-split__list-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.tclas-map-split__list-scroll::-webkit-scrollbar-thumb {
  background: var(--c-border, #ddd);
  border-radius: 3px;
}

.tclas-map-wrapper--split .tclas-map-list__table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

@media (max-width: 640px) {
  .tclas-ancestor-map {
    height: 340px;
  }
  .tclas-map-split__map .tclas-ancestor-map {
    height: 340px;
  }
}
