.state-service {
  --ss-accent: #01693F;
  --ss-tab-bg: #006940;
  --ss-tab-fg: #ffffff;
  --ss-band: #F3F8F5;
  --ss-line: #E3E8E4;
  padding: 35px 63px;
  background-color: #ffffff;
  border-radius: 16px;
  font-family: 'Roboto', sans-serif;
  color: #1E3226;
  transition: background-color .2s;
}

/* Porta potty mode: the site's yellow, so the switch is easy to notice. */
.state-service.state-service--porta {
  --ss-tab-bg: #FDC400;
  --ss-tab-fg: #1E3226;
  --ss-band: #FFF3C2;
  --ss-line: #F2E2A0;
}

.state-service [hidden] {
  display: none !important;
}

.state-service__heading {
  margin: 0 0 24px;
}

.state-service__switch {
  display: flex;
  width: fit-content;
  max-width: 100%;
  gap: 4px;
  padding: 5px;
  margin: 0 auto 20px;
  background: #F3F3F3;
  border-radius: 999px;
}

.state-service .state-service__tab {
  border: 0;
  border-radius: 999px;
  padding: 14px 32px;
  background: none;
  color: #757E77;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.state-service .state-service__tab[aria-pressed="true"] {
  background: var(--ss-tab-bg);
  color: var(--ss-tab-fg);
}

.state-service .state-service__tab:focus-visible,
.state-service .state-service__link:focus-visible,
.state-service .state-service__count:focus-visible,
.state-service .state-service__modal a:focus-visible,
.state-service .state-service__modal-close:focus-visible {
  outline: 2px solid #01693F;
  outline-offset: 2px;
}

.state-service__search {
  display: flex;
  gap: 8px;
  max-width: 460px;
  margin: 0 auto 20px;
}

.state-service .state-service__search input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #C1C1C1;
  border-radius: 8px;
  background: #ffffff;
  font-size: 16px;
}

.state-service .state-service__search input:focus {
  border-color: #01693F;
  outline: none;
}

.state-service .state-service__search button {
  border: 0;
  border-radius: 8px;
  padding: 12px 20px;
  background: #FDC400;
  color: #1E3226;
  font-weight: 700;
  cursor: pointer;
}

.state-service__banner {
  max-width: 640px;
  margin: 0 auto 18px;
  text-align: center;
  padding: 11px 15px;
  background: var(--ss-band);
  border: 1px solid var(--ss-line);
  border-left: 5px solid var(--ss-tab-bg);
  border-radius: 8px;
  color: #1E3226;
  font-weight: 600;
}

.state-service__total {
  margin: 0 0 14px;
  text-align: center;
  color: #757E77;
  font-size: 14px;
}

.state-service__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.state-service__item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--ss-line);
  border-radius: 8px;
  background: #ffffff;
  list-style: none;
}

.state-service .state-service__link {
  color: #1E3226;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: underline;
}

.state-service .state-service__link:hover {
  text-decoration: none;
}

/* The number is the button that opens the city list. */
.state-service .state-service__count {
  padding: 2px 6px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #01693F;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.state-service .state-service__count:hover {
  background: #F3F8F5;
  text-decoration: underline;
}

.state-service .state-service__count:disabled {
  color: #757E77;
  font-weight: 400;
  cursor: default;
  text-decoration: none;
  background: none;
}

.state-service__empty {
  margin: 16px 0 0;
  color: #757E77;
}

/* Cities popup */
.state-service-lock {
  overflow: hidden;
}

.state-service .state-service__modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(30, 50, 38, .55);
}

.state-service .state-service__modal[hidden] {
  display: none !important;
}

.state-service__modal-box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 640px;
  max-height: min(80vh, 640px);
  padding: 24px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(5, 28, 4, .11);
}

.state-service .state-service__modal-title {
  margin: 0 40px 16px 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
}

.state-service .state-service__modal-title span {
  color: #01693F;
}

.state-service .state-service__modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: #1E3226;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.state-service .state-service__modal-search {
  width: 100%;
  margin-bottom: 16px;
  padding: 10px 14px;
  border: 1px solid #C1C1C1;
  border-radius: 8px;
  font-size: 16px;
}

.state-service .state-service__modal-search:focus {
  border-color: #01693F;
  outline: none;
}

.state-service__modal-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 20px;
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0 8px 0 0;
  overflow-y: auto;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: #C1C1C1 #F3F3F3;
}

.state-service__modal-list li {
  margin: 0;
  list-style: none;
}

.state-service .state-service__modal-list a,
.state-service .state-service__modal-all {
  color: #1E3226;
  font-weight: 600;
  text-decoration: underline;
}

.state-service .state-service__modal-list a:hover,
.state-service .state-service__modal-all:hover {
  text-decoration: none;
}

.state-service .state-service__modal-list a {
  font-size: 16px;
}

.state-service__modal-empty {
  grid-column: 1 / -1;
  color: #757E77;
}

.state-service .state-service__modal-all {
  align-self: flex-start;
  margin-top: 16px;
  font-size: 16px;
}

@media (max-width: 768px) {
  .state-service {
    padding: 24px 16px;
  }

  .state-service .state-service__link {
    font-size: 16px;
  }
}

@media (max-width: 640px) {
  .state-service__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 12px;
  }

  .state-service__switch {
    width: 100%;
  }

  .state-service .state-service__tab {
    flex: 1;
    padding: 13px 8px;
    font-size: 15px;
  }

  .state-service__modal-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 460px) {
  .state-service {
    padding: 24px 8px;
  }

  .state-service__item {
    padding: 9px 8px;
    gap: 2px;
  }

  .state-service .state-service__link {
    font-size: 14px;
  }

  .state-service .state-service__count {
    padding: 2px 4px;
    font-size: 13px;
  }
}

@media (max-width: 370px) {
  .state-service__modal-list {
    grid-template-columns: 1fr;
  }
}
