.header-brand {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 28px);
  min-width: 0;
  margin-right: auto;
}

.header-brand .wordmark {
  flex-shrink: 0;
}

.header-city {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  max-width: 190px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.header-city span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-city img {
  flex-shrink: 0;
  transform: rotate(90deg);
}

.header-city:hover,
.header-city:focus-visible {
  color: var(--ink);
}

.menu-city {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 0 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.menu-city small {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.menu-city strong {
  font-size: 18px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.menu-city img {
  flex-shrink: 0;
}

.footer-city {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

body.city-open {
  overflow: hidden;
}

.city-dialog {
  width: min(600px, calc(100% - 32px));
  max-height: calc(100svh - 32px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: var(--paper);
}

.city-dialog::backdrop {
  background: rgb(0 0 0 / 45%);
}

.city-dialog-panel {
  padding: 32px;
}

.city-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.city-dialog h2 {
  margin: 6px 0 0;
  font-size: clamp(22px, 4vw, 30px);
  line-height: 1.25;
}

.city-close {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}

.city-intro {
  margin: 16px 0 24px;
  color: var(--muted);
}

.city-options {
  display: grid;
  gap: 4px;
}

.city-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid transparent;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.city-option.is-current {
  border-color: var(--line);
}

.city-option:hover,
.city-option:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.city-option small {
  flex-shrink: 0;
  font-size: 12px;
}

.city-search {
  margin-bottom: 20px;
}

.city-search label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.city-search input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

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

.city-page {
  max-width: 720px;
  padding-block: 64px 96px;
}

@media (max-width: 800px) {
  .has-city-switcher {
    --mobile-header-height: 76px;
  }

  .has-city-switcher .header-row {
    min-height: var(--mobile-header-height);
  }

  .header-row {
    gap: 8px;
  }

  .has-city-switcher .header-brand {
    display: grid;
    flex: 1 1 0;
    gap: 0;
    justify-items: start;
  }

  .has-city-switcher .header-brand .wordmark {
    min-height: 32px;
    max-width: 100%;
  }

  .has-city-switcher .brand-logo {
    max-width: 100%;
    max-height: 32px;
  }

  .header-city {
    display: flex;
    width: fit-content;
    min-height: 28px;
    max-width: 100%;
    font-size: 13px;
    line-height: 1.25;
  }

  .menu-label-mobile {
    display: none;
  }

  .site-menu > summary {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }
}

@media (max-width: 600px) {
  .has-city-switcher .menu-panel {
    top: var(--mobile-header-height);
    height: calc(100svh - var(--mobile-header-height));
  }

  .city-dialog-panel {
    padding: 20px;
  }

  .city-option {
    padding-inline: 8px;
  }
}

@media print {
  .city-dialog { display: none; }
}
