.territory-search {
  position: relative;
  z-index: 2;
  margin: 1rem 0 0.2rem;
  padding: 0.9rem;
  border-radius: 1rem;
  background:
    linear-gradient(135deg, rgba(9, 74, 64, 0.98), rgba(15, 102, 83, 0.94));
  color: #fffdf5;
}

.territory-search__label {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.05em;
}

.territory-search__controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
}

.territory-search__input,
.territory-search__clear {
  min-height: 2.85rem;
  border: 0;
  border-radius: 0.75rem;
  font: inherit;
}

.territory-search__input {
  min-width: 0;
  padding: 0.7rem 0.85rem;
  background: #fffdf5;
  color: #123f37;
  font-size: 0.82rem;
}

.territory-search__input:focus-visible,
.territory-search__clear:focus-visible,
.territory-search__result button:focus-visible {
  outline: 3px solid #f6b93b;
  outline-offset: 2px;
}

.territory-search__clear {
  padding: 0.65rem 0.8rem;
  background: #f6b93b;
  color: #3e2c08;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 850;
}

.territory-search__clear[hidden] {
  display: none;
}

.territory-search__feedback {
  margin: 0.55rem 0 0;
  color: rgba(255, 253, 245, 0.8);
  font-size: 0.67rem;
  line-height: 1.45;
}

.territory-search__results {
  display: grid;
  max-height: 16rem;
  gap: 0.35rem;
  margin: 0.65rem 0 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.territory-search__results[hidden] {
  display: none;
}

.territory-search__result button {
  display: grid;
  width: 100%;
  min-height: 3.1rem;
  gap: 0.08rem;
  padding: 0.58rem 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.1);
  color: #fffdf5;
  cursor: pointer;
  text-align: left;
}

.territory-search__result button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.territory-search__result strong {
  font-size: 0.78rem;
}

.territory-search__result span {
  color: rgba(255, 253, 245, 0.72);
  font-size: 0.63rem;
}

.territory-explorer__item.is-selected {
  border-color: #e1a326;
  background: #fff7d9;
  box-shadow: 0 0 0 0.2rem rgba(225, 163, 38, 0.14);
}

@media (max-width: 640px) {
  .territory-search {
    padding: 0.8rem;
  }

  .territory-search__controls {
    grid-template-columns: 1fr;
  }

  .territory-search__input,
  .territory-search__clear,
  .territory-search__result button {
    min-height: 3rem;
  }
}
