.city-dialog {
  width: min(920px, calc(100vw - 32px));
  max-width: 920px;
  max-height: min(780px, calc(100vh - 32px));
  overflow: hidden;
  background: var(--paper);
}

.city-dialog [hidden] {
  display: none !important;
}

.city-dialog-head {
  padding: 30px 34px 20px;
  background: linear-gradient(135deg, #061f36, #0c4054);
  color: white;
}

.city-dialog-head h2 {
  margin: 0;
  font-family: 'Noto Serif SC', serif;
  font-size: 32px;
}

.city-dialog-head > p:last-of-type {
  margin: 7px 0 18px;
  color: #c8d5dc;
  font-size: 13px;
}

.city-dialog .dialog-close {
  z-index: 2;
  color: #d7e0e5;
}

.city-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 15px;
  border-radius: 13px;
  background: white;
  color: var(--ink);
}

.city-search span {
  color: var(--green);
  font-size: 24px;
}

.city-search input {
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  font-size: 14px;
}

.city-quick-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 34px;
  margin-top: 13px;
}

.location-button,
.recent-cities button {
  padding: 7px 11px;
  border: 1px solid rgb(255 255 255 / 25%);
  border-radius: 999px;
  background: rgb(255 255 255 / 10%);
  color: white;
  cursor: pointer;
}

.city-quick-tools > span,
.recent-cities > span {
  color: #b9c8d0;
  font-size: 11px;
}

.recent-cities {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.city-dialog-body {
  display: grid;
  grid-template-columns: 142px 1fr;
  height: 390px;
  border-top: 1px solid rgb(255 255 255 / 5%);
}

.region-nav {
  overflow-y: auto;
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  background: #f3eee4;
}

.region-nav button {
  display: block;
  width: 100%;
  margin: 2px 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #506059;
  text-align: left;
  cursor: pointer;
}

.region-nav button.active {
  background: white;
  box-shadow: 0 4px 12px rgb(7 31 53 / 6%);
  color: var(--ink);
  font-weight: 700;
}

.city-results-wrap {
  min-width: 0;
  overflow: hidden;
  padding: 17px 20px 20px;
}

.city-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px;
}

.city-results-head span {
  color: var(--muted);
  font-size: 12px;
}

.city-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
  height: 325px;
  overflow-y: auto;
  padding: 2px 5px 8px 0;
}

.city-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  text-align: left;
  cursor: pointer;
}

.city-result:hover,
.city-result.selected {
  border-color: #b99654;
  background: #fffaf0;
}

.city-result span {
  min-width: 0;
}

.city-result strong {
  display: block;
  font-size: 15px;
}

.city-result small {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-result em {
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.city-result em.available {
  color: var(--green);
}

.city-result em.request {
  color: #9b7130;
}

.city-empty {
  grid-column: 1 / -1;
  margin: 50px auto;
  color: var(--muted);
  font-size: 13px;
}

.city-dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: #fffdf8;
}

.city-dialog-foot > div {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 1px 9px;
}

.city-dialog-foot small {
  grid-row: 1 / 3;
  color: var(--muted);
}

.city-dialog-foot strong {
  font-family: 'Noto Serif SC', serif;
  font-size: 18px;
}

.city-dialog-foot span {
  color: var(--green);
  font-size: 11px;
}

.city-picker-action {
  width: auto;
  min-width: 210px;
}

.city-tabs {
  max-width: 520px;
}

.city-tabs button {
  font-size: 12px;
}

.city-demand-panel {
  min-height: 454px;
  padding: 34px clamp(24px, 8vw, 86px);
  background: #fffdf8;
}

.city-demand-panel h3 {
  margin: 4px 0 10px;
  font-family: 'Noto Serif SC', serif;
  font-size: 28px;
}

.city-demand-panel > p:not(.eyebrow, .demand-privacy) {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.8;
}

.demand-back {
  margin-bottom: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  cursor: pointer;
}

.city-demand-panel form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.city-demand-panel form label {
  margin: 0;
}

.city-demand-panel form .primary-button {
  grid-column: 1 / -1;
  margin-top: 5px;
}

.demand-privacy {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

@media (max-width: 620px) {
  .city-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .city-dialog-head {
    padding: 20px 18px 12px;
  }

  .city-dialog-head h2 {
    font-size: 25px;
  }

  .city-dialog-head > p:last-of-type {
    margin: 4px 0 12px;
  }

  .city-search {
    height: 46px;
  }

  .city-quick-tools {
    margin-top: 8px;
  }

  .city-quick-tools > span {
    display: none;
  }

  .recent-cities {
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
  }

  .city-dialog-body {
    display: block;
    height: 330px;
  }

  .region-nav {
    display: flex;
    gap: 5px;
    height: 54px;
    overflow-x: auto;
    padding: 9px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .region-nav button {
    display: inline-block;
    width: auto;
    min-width: max-content;
    margin: 0;
    padding: 7px 11px;
  }

  .city-results-wrap {
    height: 276px;
    padding: 13px;
  }

  .city-results {
    grid-template-columns: 1fr;
    height: 222px;
  }

  .city-dialog-foot {
    gap: 10px;
    padding: 11px 14px;
  }

  .city-picker-action {
    width: auto;
    min-width: 0;
    padding: 12px 14px;
  }

  .city-dialog-foot > div {
    grid-template-columns: auto;
  }

  .city-dialog-foot small {
    display: none;
  }

  .city-dialog-foot strong {
    font-size: 16px;
  }

  .city-dialog-foot span {
    font-size: 10px;
  }

  .city-demand-panel {
    min-height: 0;
    padding: 20px;
  }

  .city-demand-panel h3 {
    font-size: 25px;
  }

  .demand-back {
    margin-bottom: 14px;
  }

  .city-demand-panel form {
    grid-template-columns: 1fr;
  }

  .city-demand-panel form .primary-button {
    grid-column: auto;
  }
}
