/* ── Design tokens ─────────────────────────────────────────────── */
:root {
  --bg: #f4f6f8;
  --bg-subtle: #eef1f4;
  --surface: #ffffff;
  --text: #111827;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --accent: #0f766e;
  --accent-hover: #0d9488;
  --accent-soft: #ecfdf5;
  --accent-border: #99f6e4;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.04);
  --shadow-md: 0 4px 16px rgb(15 23 42 / 0.06), 0 1px 3px rgb(15 23 42 / 0.04);
  --shadow-lg: 0 12px 40px rgb(15 23 42 / 0.08);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --font: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --header-height: auto;
  --content-max: 1200px;
  --transition: 150ms ease;
}

/* ── Reset & base ──────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-hover);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ── Header ────────────────────────────────────────────────────── */
.header {
  background: linear-gradient(145deg, #134e4a 0%, #0f766e 55%, #115e59 100%);
  color: #fff;
  padding: 2rem 1.5rem 2.75rem;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgb(255 255 255 / 0.08), transparent),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgb(0 0 0 / 0.12), transparent);
  pointer-events: none;
}

.header-inner {
  position: relative;
  max-width: var(--content-max);
  margin: 0 auto;
}

.header-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

.header h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.plz {
  display: block;
  margin-top: 0.15rem;
  font-weight: 400;
  font-size: 0.85em;
  opacity: 0.88;
}

@media (min-width: 640px) {
  .plz {
    display: inline;
    margin-top: 0;
    margin-left: 0.35rem;
  }
}

.subtitle {
  margin: 0.6rem 0 0;
  font-size: 0.9375rem;
  opacity: 0.82;
  max-width: 42rem;
}

/* ── Layout ────────────────────────────────────────────────────── */
.main {
  max-width: var(--content-max);
  margin: -1.5rem auto 3rem;
  padding: 0 1rem;
}

/* Table view: use full viewport width on ultra-wide monitors */
body.view-table .main {
  max-width: none;
  width: 100%;
  padding-left: clamp(0.75rem, 1.5vw, 1.5rem);
  padding-right: clamp(0.75rem, 1.5vw, 1.5rem);
}

/* ── Toolbar ───────────────────────────────────────────────────── */
.toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.toolbar-search {
  padding: 1.25rem 1.25rem 0;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 0.85rem;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.search-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(15 118 110 / 0.12);
  background: var(--surface);
}

.search-icon {
  display: flex;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.search-wrap input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 0.9375rem;
  padding: 0.7rem 0;
  border: none;
  background: transparent;
  color: var(--text);
}

.search-wrap input::placeholder {
  color: var(--text-tertiary);
}

.search-wrap input:focus {
  outline: none;
}

/* Filter panel */
.filter-panel {
  display: grid;
  gap: 0;
  margin-top: 1rem;
  border-top: 1px solid var(--border);
}

@media (min-width: 900px) {
  .filter-panel {
    grid-template-columns: 1fr auto;
  }
}

.filter-group {
  margin: 0;
  padding: 1rem 1.25rem;
  border: none;
  min-width: 0;
}

.filter-group + .filter-group {
  border-top: 1px solid var(--border);
}

@media (min-width: 900px) {
  .filter-group + .filter-group {
    border-top: none;
    border-left: 1px solid var(--border);
  }

  .filter-group--view {
    flex-shrink: 0;
  }
}

.filter-group-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 0.65rem;
  padding: 0;
}

.filter-group-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-control {
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.filter-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding-left: 0.1rem;
}

.filter-control select {
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.4rem 1.75rem 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 0.45rem center;
  color: var(--text);
  cursor: pointer;
  appearance: none;
  transition:
    border-color var(--transition),
    background-color var(--transition);
}

.filter-control select:hover {
  border-color: var(--border-strong);
}

.filter-control select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgb(15 118 110 / 0.15);
}

.filter-control select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.filter-control--multi {
  position: relative;
}

.multi-filter {
  position: relative;
}

.multi-filter-trigger {
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.4rem 1.75rem 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 0.45rem center;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    border-color var(--transition),
    background-color var(--transition);
}

.multi-filter-trigger:hover {
  border-color: var(--border-strong);
}

.multi-filter-trigger:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgb(15 118 110 / 0.15);
}

.multi-filter.is-open .multi-filter-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgb(15 118 110 / 0.15);
}

.multi-filter.is-disabled .multi-filter-trigger {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.multi-filter-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.25rem);
  left: 0;
  min-width: max(100%, 10.5rem);
  max-width: 16rem;
  padding: 0.35rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.multi-filter-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.multi-filter-option:hover {
  background: var(--bg-subtle);
}

.multi-filter-option input {
  width: 0.9rem;
  height: 0.9rem;
  accent-color: var(--accent);
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.multi-filter-option--all {
  display: block;
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.15rem;
  padding: 0.35rem 0.65rem 0.45rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
}

.multi-filter-option--all:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.filter-control--plz {
  flex: 1 1 100%;
  min-width: 0;
  width: 100%;
}

.plz-filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  max-height: 5.25rem;
  overflow-y: auto;
  padding: 0.1rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.plz-filter-all {
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    border-color var(--transition),
    background-color var(--transition),
    color var(--transition);
}

.plz-filter-all:hover {
  border-color: var(--border-strong);
}

.plz-filter-all.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.plz-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  user-select: none;
}

.plz-filter-chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.plz-filter-chip span {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-secondary);
  transition:
    border-color var(--transition),
    background-color var(--transition),
    color var(--transition);
}

.plz-filter-chip:hover span {
  border-color: var(--border-strong);
}

.plz-filter-chip input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.plz-filter-chip input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  user-select: none;
  align-self: flex-end;
  transition:
    border-color var(--transition),
    background-color var(--transition),
    color var(--transition);
}

.filter-toggle:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.filter-toggle:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.filter-toggle input {
  width: 0.9rem;
  height: 0.9rem;
  accent-color: var(--accent);
  margin: 0;
  cursor: pointer;
}

/* Toolbar footer */
.toolbar-footer {
  padding: 0.85rem 1.25rem 1.15rem;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}

.result-count {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.selection-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.selection-bar-actions,
.selection-bar-export {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.selection-count {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  padding-left: 0.25rem;
}

/* Buttons */
.btn {
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition);
  white-space: nowrap;
}

.btn-primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: wait;
}

.btn-secondary {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-secondary:disabled,
.btn-ghost:disabled {
  opacity: 0.45;
  cursor: default;
}

.btn-ghost {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

/* Disclaimer */
.era-disclaimer {
  margin: 0;
  padding: 0.85rem 1.25rem 1.15rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-secondary);
  background: var(--accent-soft);
  border-top: 1px solid var(--accent-border);
}

.era-hint {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.era-hint .era-label {
  font-weight: 600;
  color: var(--text);
}

/* Status */
.status {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.875rem;
}

/* ── Results: cards ────────────────────────────────────────────── */
.results-panel {
  margin-top: 1.25rem;
}

.results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-sm);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.card.row-selected {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.card h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  letter-spacing: -0.01em;
}

/* Badges */
.entity-badge,
.gender-badge {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.entity-company {
  background: #eff6ff;
  color: #1d4ed8;
}

.entity-person {
  background: #fff7ed;
  color: #c2410c;
}

.gender-male {
  background: #eff6ff;
  color: #1e40af;
}

.gender-female {
  background: #fdf2f8;
  color: #9d174d;
}

.gender-unknown {
  background: var(--bg);
  color: var(--text-tertiary);
}

.card .desc {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  white-space: pre-line;
}

.card .address {
  margin: 0;
  font-size: 0.875rem;
}

.card .contacts {
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
}

.card .contacts li {
  margin: 0.2rem 0;
}

.card .contacts a {
  text-decoration: none;
}

.card .contacts a:hover {
  text-decoration: underline;
}

.zefix-meta {
  margin: 0.65rem 0 0;
  padding: 0.55rem 0.65rem;
  font-size: 0.75rem;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.65rem;
}

.zefix-meta dt {
  margin: 0;
  font-weight: 600;
  color: #5b21b6;
}

.zefix-meta dd {
  margin: 0;
  color: var(--text-secondary);
}

.card .tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-left: 0.35rem;
  vertical-align: middle;
}

.phone-type {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  margin-left: 0.3rem;
  vertical-align: middle;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.phone-type-mobile {
  background: #eff6ff;
  color: #1d4ed8;
}

.phone-type-landline {
  background: var(--bg);
  color: var(--text-secondary);
}

.phone-list-compact {
  list-style: none;
  margin: 0;
  padding: 0;
}

.phone-list-compact li {
  margin: 0.1rem 0;
  white-space: nowrap;
}

.phone-list-compact a {
  text-decoration: none;
  font-size: 0.8125rem;
}

.phone-list-compact a:hover {
  text-decoration: underline;
}

/* ── Table ───────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.contacts-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  line-height: 1.35;
  table-layout: auto;
}

body.view-table .contacts-table {
  width: 100%;
}

.contacts-table th,
.contacts-table td {
  padding: 0.4rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}

.contacts-table th {
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
  box-shadow: 0 1px 0 var(--border);
}

.contacts-table tbody tr {
  transition: background-color var(--transition);
}

.contacts-table tbody tr:nth-child(even) {
  background: rgb(244 246 248 / 0.5);
}

.contacts-table tbody tr:last-child td {
  border-bottom: none;
}

.contacts-table tbody tr:hover {
  background: var(--accent-soft);
}

.contacts-table tr.row-selected {
  background: var(--accent-soft) !important;
}

.contacts-table .col-name {
  font-weight: 500;
  min-width: 18rem;
}

.contacts-table .col-name strong {
  color: var(--text);
}

.contacts-table .name-desc {
  display: inline;
  margin-left: 0.35rem;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.contacts-table .name-desc::before {
  content: '— ';
  color: var(--text-tertiary);
}

.contacts-table .col-title {
  min-width: 3rem;
}

.contacts-table .col-first,
.contacts-table .col-middle {
  min-width: 5rem;
}

.contacts-table .col-last {
  min-width: 8rem;
}

.contacts-table .col-maiden {
  min-width: 5rem;
}

.contacts-table .col-occupation {
  min-width: 10rem;
  color: var(--text-secondary);
}

.contacts-table .col-street {
  min-width: 12rem;
}

.contacts-table .col-zefix-company {
  min-width: 14rem;
}

.contacts-table .col-zefix-uid {
  min-width: 9rem;
}

.contacts-table .col-zefix-industry {
  min-width: 10rem;
}

.contacts-table .col-zefix-legal,
.contacts-table .col-zefix-status {
  min-width: 6rem;
}

.contacts-table .col-type,
.contacts-table .col-gender {
  width: 1%;
}

.contacts-table .col-street a {
  text-decoration: none;
  font-weight: 500;
}

.contacts-table .col-street a:hover {
  text-decoration: underline;
}

.contacts-table .postfach {
  display: inline;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-left: 0.35rem;
}

.contacts-table .postfach::before {
  content: '· ';
}

.contacts-table .col-phone {
  min-width: 9rem;
}

.contacts-table .col-email {
  min-width: 11rem;
}

.contacts-table .col-web {
  min-width: 10rem;
}

.contacts-table .cell-empty {
  color: var(--text-tertiary);
}

.contacts-table .email-list,
.contacts-table .web-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.contacts-table .email-list li,
.contacts-table .web-list li {
  margin: 0.15rem 0;
}

.contacts-table .email-list a,
.contacts-table .web-list a {
  text-decoration: none;
}

.contacts-table .email-list a:hover,
.contacts-table .web-list a:hover {
  text-decoration: underline;
}

/* Row selection */
.row-select,
.select-all-page {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.row-select input,
.select-all-page input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.contacts-table .col-select,
.contacts-table td.col-select {
  width: 2.75rem;
  text-align: center;
  padding-left: 0.75rem;
  padding-right: 0.35rem;
}

/* ── Pagination ──────────────────────────────────────────────────── */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  margin-top: 1.75rem;
  padding: 0.5rem 0;
}

.pagination button {
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    border-color var(--transition),
    color var(--transition),
    background-color var(--transition);
}

.pagination button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination button[aria-current='page'] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ── Map ─────────────────────────────────────────────────────────── */
.map-section {
  margin-top: 1.25rem;
}

.map-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1rem 1.15rem 1.15rem;
}

.map-hint {
  margin: 0 0 0.65rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0 0 0.85rem;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.map-legend li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

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

.map-legend-dot--person {
  border-color: #0f766e;
  background: #5eead4;
}

.map-legend-dot--company {
  border-color: #b45309;
  background: #fcd34d;
}

.map-legend-dot--zefix {
  width: 11px;
  height: 11px;
  border-color: #6d28d9;
  background: #c4b5fd;
}

.map-legend-dot--azdirect {
  width: 11px;
  height: 11px;
  border-color: #8b5a2b;
  background: #d4a574;
}

.dup-banner {
  margin: 0.35rem 0 0;
  padding: 0.35rem 0.5rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
  line-height: 1.4;
}

.dup-banner--warning {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.dup-banner--info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.dup-banner--merged {
  background: var(--accent-soft);
  color: #065f46;
  border: 1px solid var(--accent-border);
}

.btn-inline {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

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

.map-canvas {
  height: min(70vh, 560px);
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  z-index: 0;
}

.map-popup-company {
  margin: 0.2rem 0 0 !important;
  font-size: 0.85rem;
  color: #6d28d9;
}

.map-popup {
  font-size: 0.875rem;
  line-height: 1.45;
}

.map-popup-type {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.map-popup p {
  margin: 0.35rem 0 0;
}

/* Leaflet overrides */
.leaflet-container {
  font-family: var(--font);
}

.leaflet-control-layers {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.leaflet-control-layers-expanded {
  padding: 0.4rem 0.55rem;
  font-size: 0.8125rem;
}

/* ── Footer ──────────────────────────────────────────────────────── */
.footer {
  max-width: var(--content-max);
  margin: 0 auto 2.5rem;
  padding: 0 1rem;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  text-align: center;
}

.link-btn {
  font: inherit;
  font-size: inherit;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0 0.15rem;
  cursor: pointer;
  text-decoration: underline;
}

.link-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .header {
    padding: 1.5rem 1rem 2.25rem;
  }

  .toolbar-search {
    padding: 1rem 1rem 0;
  }

  .filter-group {
    padding: 0.85rem 1rem;
  }

  .toolbar-footer {
    padding: 0.75rem 1rem 1rem;
  }

  .selection-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .selection-bar-actions,
  .selection-bar-export {
    justify-content: flex-start;
  }

  .selection-bar-export {
    padding-top: 0.25rem;
    border-top: 1px solid var(--border);
  }
}
