#domain-tlds {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.tld-group {
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
}

.tld-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f1f1f1;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.2s ease;
  position: relative;
}

.tld-group-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  flex: 1;
  pointer-events: none;
}

.tld-group-label input {
  margin-right: 4px;
  pointer-events: auto;
}

/* Стрелка */
.tld-toggle {
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.tld-toggle .arrow {
  width: 10px;
  height: 10px;
  border-right: 2px solid #333;
  border-bottom: 2px solid #333;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  pointer-events: none;
}

.tld-group.expanded .tld-toggle .arrow {
  transform: rotate(-135deg);
}

/* Скелетон-загрузка */
.skeleton {
  background-color: #f1f1f1;
  animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-line {
  background-color: #ddd;
  border-radius: 4px;
  width: 100%;
  margin-bottom: 8px;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}

/* Список подзон */
.tld-sublist {
  display: none;
  flex-wrap: wrap;
  padding: 8px;
  background: #fff;
  gap: 8px;
}

.tld-group.expanded .tld-sublist {
  display: flex;
}

.tld-group-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #111;
  border-radius: 3px;
  background-color: #fff;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  box-sizing: border-box;
}

/* Галочка — выровнена по центру */
.tld-group-label input[type="checkbox"]:checked::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 9px;
  border: solid #111;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -50%) rotate(45deg);
  box-sizing: content-box;
}

/* Минус — строго по центру */
.tld-group-label input[type="checkbox"]:indeterminate::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 2px;
  background-color: #111;
  border-radius: 1px;
  transform: translate(-50%, -50%);
}

/* Плитка подзоны */
.tld-subitem span {
  font-size: 18px;
}

.tld-subitem {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  background: #f9f9f9;
  border-radius: 6px;
  font-size: 18px;
  text-transform: lowercase;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  user-select: none;
  flex: 1 1 calc(25% - 8px); /* адаптивная плитка */
  box-sizing: border-box;
  max-width: 100%;
  min-width: 120px;
}

.tld-subitem input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid #111111;
  border-radius: 3px;
  background-color: #fff;
  cursor: pointer;
  position: relative;
  margin-right: 8px;
  flex-shrink: 0;
  box-sizing: border-box;
}

/* Центрированная галочка */
.tld-subitem input[type="checkbox"]:checked::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 8px;
  border: solid #111111;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -50%) rotate(45deg);
  box-sizing: content-box;
}

.tld-subitem input {
  margin-right: 6px;
}

/* Эффект при наведении */
.tld-subitem:hover {
  background-color: #e0e0e0;
}

/* Эффект при установке чекбокса */
.tld-subitem:has(input:checked) {
  background-color: #e0e0e0;
  box-shadow: inset 0 0 0 2px #111111;
}

/* Карточка результата */
.domain-card {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: #f9f9f9;
  width: 100%;
  box-sizing: border-box;
}

.domain-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.domain-name {
  font-weight: bold;
  font-size: 24px;
}

.domain-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.status-available,
.status-taken {
  font-size: 16px;
  padding: 8px 16px;
  border-radius: 6px;
  white-space: nowrap;
}

.status-available {
  background-color: #e6f4ea;
  color: #2e7d32;
}

.status-taken {
  background-color: #fbeaea;
  color: #c62828;
}

/* Цена и кнопка — в одном ряду */
.domain-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.domain-price {
  font-size: 18px;
  color: #333;
  font-weight: 500;
}

/* Кнопка купить — выровненная */
.domain-meta .wp-element-button {
  padding: 8px 22px;
  font-size: 16px;
  white-space: nowrap;
}

/* Мобильная адаптация */
@media (max-width: 600px) {
  .tld-sublist {
    flex-direction: column;
  }

  .tld-subitem {
    flex: 1 1 100%;
  }
    .domain-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .domain-meta {
    justify-content: center;
    text-align: center;
  }

  .domain-name {
    word-break: break-word;
    max-width: 100%;
  }
}

.tld-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tld-buttons .action-item,
.tld-buttons .settings-toggle {
  display: flex;
  align-items: center;
  background: #f9f9f9;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  user-select: none;
  white-space: nowrap;
  box-sizing: border-box;
  padding: 6px 10px;
  gap: 8px;
  width: calc((100% - 16px) / 3);
  justify-content: flex-start;
  border: none;
  outline: none;
}

/* Иконка шестерёнки */
.tld-buttons .settings-toggle .icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  padding: 3px 2px;
}

/* Состояние hover */
.tld-buttons .action-item:hover,
.tld-buttons .settings-toggle:hover {
  background-color: #e0e0e0;
}

/* Состояние активного чекбокса */
.tld-buttons .action-item:has(input:checked),
.tld-buttons .settings-toggle.active {
  background-color: #e0e0e0;
  box-shadow: inset 0 0 0 2px #111;
}

/* Чекбоксы внутри плиток */
.tld-buttons .action-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid #111;
  border-radius: 3px;
  background-color: #fff;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  box-sizing: border-box;
}

.tld-buttons .action-item input[type="checkbox"]:checked::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 4px; height: 8px;
  border: solid #111;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -50%) rotate(45deg);
  box-sizing: content-box;
}

.tld-buttons .settings-toggle .icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Ховер */
.tld-buttons .action-item:hover {
  background-color: #e0e0e0;
}

/* Активный */
.tld-buttons .action-item:has(input:checked) {
  background-color: #e0e0e0;
  box-shadow: inset 0 0 0 2px #111;
}

.tld-buttons .settings-toggle {
  all: unset;
  display: flex;
  align-items: center;
  background: #f9f9f9;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  user-select: none;
  white-space: nowrap;
  box-sizing: border-box;
  padding: 6px 10px;
  gap: 8px;
  width: calc((100% - 16px) / 3);
  justify-content: flex-start;
  font-weight: 400;
  color: inherit;
  text-align: left;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .tld-buttons .action-item {
    width: 100%;
  }
}