.dg-genealogie-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.dg-genealogie {
  --dg-primary: #0067ac;
  --dg-secondary: #00457e;
  --dg-light: #def2f8;
  --dg-dark: #1d2127;
  color: var(--dg-dark);
}

.dg-genealogie__header {
  margin-bottom: 28px;
}

.dg-genealogie__eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--dg-primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dg-genealogie__header h2 {
  margin: 0 0 8px;
  color: var(--dg-dark);
}

.dg-genealogie__header p {
  margin: 0;
}

.dg-genealogie-search {
  margin-bottom: 28px;
  padding: 24px;
  border-left: 4px solid var(--dg-primary);
  border-radius: 8px;
  background: var(--dg-light);
}

.dg-genealogie-search__fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.dg-genealogie-search label,
.dg-genealogie-search label span {
  display: block;
}

.dg-genealogie-search label span {
  margin-bottom: 6px;
  color: var(--dg-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.dg-genealogie-search input,
.dg-genealogie-search select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #b8d6e6;
  border-radius: 5px;
  background: #fff;
  color: var(--dg-dark);
}

.dg-genealogie-search input:focus,
.dg-genealogie-search select:focus {
  border-color: var(--dg-primary);
  box-shadow: 0 0 0 3px rgba(0, 103, 172, 0.14);
  outline: 0;
}

.dg-genealogie-search__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.dg-genealogie-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 20px;
  border: 2px solid var(--dg-primary);
  border-radius: 5px;
  font-weight: 700;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.dg-genealogie-button--primary {
  background: var(--dg-primary);
  color: #fff;
}

.dg-genealogie-button--primary:hover,
.dg-genealogie-button--primary:focus {
  border-color: var(--dg-secondary);
  background: var(--dg-secondary);
  color: #fff;
}

.dg-genealogie-button--secondary {
  background: transparent;
  color: var(--dg-secondary);
}

.dg-genealogie-button--secondary:hover,
.dg-genealogie-button--secondary:focus {
  background: #fff;
  color: var(--dg-primary);
}

.dg-genealogie-results__summary {
  margin-bottom: 12px;
  color: #5c6470;
}

.dg-genealogie-results__summary strong {
  color: var(--dg-secondary);
}

.dg-genealogie-table-wrap {
  overflow-x: auto;
  border: 1px solid #d9e3e9;
  border-radius: 8px;
  box-shadow: 0 5px 18px rgba(29, 33, 39, 0.06);
}

.dg-genealogie-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  background: #fff;
}

.dg-genealogie-table th,
.dg-genealogie-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #e4eaee;
  text-align: left;
  vertical-align: top;
}

.dg-genealogie-table th {
  background: var(--dg-secondary);
  color: #fff;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.dg-genealogie-table tbody tr:last-child td {
  border-bottom: 0;
}

.dg-genealogie-table td strong {
  color: var(--dg-secondary);
}

.dg-genealogie-table tbody tr:nth-child(even) {
  background: #f7fafc;
}

.dg-genealogie-table tbody tr:hover {
  background: var(--dg-light);
}

.dg-genealogie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dg-genealogie-order,
.dg-genealogie-copy {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--dg-primary);
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.dg-genealogie-order {
  background: var(--dg-primary);
  color: #fff;
}

.dg-genealogie-order:hover,
.dg-genealogie-order:focus {
  border-color: var(--dg-secondary);
  background: var(--dg-secondary);
  color: #fff;
}

.dg-genealogie-copy {
  background: transparent;
  color: var(--dg-primary);
}

.dg-genealogie-copy:hover,
.dg-genealogie-copy:focus,
.dg-genealogie-copy.is-copied {
  background: var(--dg-secondary);
  color: #fff;
}

.dg-genealogie-order::after,
.dg-genealogie-copy::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 50%;
  right: calc(100% + 8px);
  z-index: 10;
  padding: 5px 10px;
  border-radius: 4px;
  background: var(--dg-dark);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 400;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(3px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

.dg-genealogie-order:hover::after,
.dg-genealogie-order:focus-visible::after,
.dg-genealogie-copy:hover::after,
.dg-genealogie-copy:focus-visible::after,
.dg-genealogie-copy.is-copied::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.dg-genealogie-notice {
  padding: 16px 18px;
  border-left: 4px solid var(--dg-primary);
  border-radius: 5px;
  background: #f4f8fa;
}

.dg-genealogie-notice--error {
  border-left-color: #b42318;
  background: #fff1f0;
  color: #8a1c14;
}

.dg-genealogie-pagination {
  margin-top: 24px;
}

.dg-genealogie-pagination .page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  list-style: none;
}

.dg-genealogie-pagination a,
.dg-genealogie-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 38px;
  height: 38px;
  padding: 5px 10px;
  border-radius: 4px;
  background: #edf3f6;
  color: var(--dg-secondary);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}

.dg-genealogie-pagination .prev,
.dg-genealogie-pagination .next {
  padding: 5px 16px;
}

.dg-genealogie-pagination .current,
.dg-genealogie-pagination a:hover,
.dg-genealogie-pagination a:focus {
  background: var(--dg-primary);
  color: #fff;
}

@media (max-width: 991px) {
  .dg-genealogie-search__fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .dg-genealogie-search {
    padding: 18px;
  }

  .dg-genealogie-search__fields {
    grid-template-columns: 1fr;
  }

  .dg-genealogie-table,
  .dg-genealogie-table tbody,
  .dg-genealogie-table tr,
  .dg-genealogie-table td {
    display: block;
    width: 100%;
  }

  .dg-genealogie-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .dg-genealogie-table tr {
    padding: 14px 16px;
    border-bottom: 1px solid #d9e3e9;
  }

  .dg-genealogie-table tr:last-child {
    border-bottom: 0;
  }

  .dg-genealogie-table td {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px;
    padding: 5px 0;
    border: 0;
  }

  .dg-genealogie-table td::before {
    content: attr(data-label);
    color: var(--dg-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }
}
