/* The same floating surface is used above maps and in the site header. */
.region-popup:is(.region-panel, .auth-mini-region) {
  --popup-ink: #f6f6f7;
  --popup-muted: #b6b6be;
  --popup-accent: #ffdf47;
  position: fixed;
  inset: auto;
  z-index: 40;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: none;
  margin: 0;
  padding: 12px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #48484b;
  border-radius: 18px;
  background: #202022;
  color: var(--popup-ink);
  box-shadow: 0 12px 36px rgb(0 0 0 / 35%);
  text-align: left;
  color-scheme: dark;
}
.region-popup[hidden], .region-popup [hidden] { display: none !important; }
.region-popup *, .region-popup *::after { box-sizing: border-box; }
.region-popup :is(.region-panel-header, .region-popup-heading) {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  margin: -4px 0 8px;
  padding: 0 0 0 6px;
}
.region-popup :is(.region-title, .region-popup-heading label),
.auth-mini-region.region-popup > label {
  margin: 0;
  color: var(--popup-ink);
  font: 750 16px/1.3 Manrope, RadarManrope, system-ui, sans-serif;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.auth-mini-region.region-popup > label { padding: 4px 6px 12px; }
.region-popup :is(.region-close, .region-popup-close) {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--popup-muted);
  font: 400 24px/1 system-ui, sans-serif;
}
.region-popup .region-close .icon { width: 18px; height: 18px; }
.region-popup :is(.region-close, .region-popup-close):hover { background: #303032; color: white; }
.region-popup .region-modes { margin: 0 0 8px; }
.region-popup .region-territory { margin: 0 0 8px; }
.region-popup .region-back { align-self: start; margin: 0 0 8px; }
.region-popup .region-search { margin: 0; }
.region-popup .region-search .icon { left: 13px; color: var(--popup-muted); }
.region-popup :is(.region-search input, [data-mini-region-input]) {
  flex: none;
  width: 100%;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0 12px 0 39px;
  border: 1px solid #565659;
  border-radius: 11px;
  background-color: #151517;
  color: var(--popup-ink);
  font: 500 16px/1.25 Manrope, RadarManrope, system-ui, sans-serif;
}
.auth-mini-region.region-popup input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 24 24' fill='none' stroke='%23b6b6be' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
  background-position: 13px center;
  background-repeat: no-repeat;
}
.region-popup input::placeholder { color: #a9a9af; opacity: 1; }
.region-popup :is(input, button, a):focus-visible {
  outline: 2px solid var(--popup-accent);
  outline-offset: -2px;
}
.region-popup .region-picker { min-height: 0; }
.region-popup :is(.region-list, [data-mini-places]) {
  display: block;
  flex: 0 1 auto;
  min-height: 48px;
  max-height: 246px;
  margin: 8px 0 0;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #626268 transparent;
  scrollbar-width: thin;
  list-style: none;
}
.region-popup :is(.region-list, [data-mini-places]):empty { display: none; }
.region-popup :is(.region-list, [data-mini-places]) button[data-place] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  align-content: center;
  align-items: center;
  gap: 1px 8px;
  width: 100%;
  min-height: 48px;
  padding: 7px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--popup-ink);
  text-align: left;
}
.region-popup [data-place] span {
  font: 650 14px/1.35 Manrope, RadarManrope, system-ui, sans-serif;
  overflow-wrap: anywhere;
}
.region-popup [data-place] small {
  grid-column: 1;
  color: var(--popup-muted);
  font: 500 12px/1.35 Manrope, RadarManrope, system-ui, sans-serif;
  overflow-wrap: anywhere;
}
.region-popup [data-place] .region-check { width: 16px; height: 16px; }
.region-popup :is(.region-list, [data-mini-places]) button[data-place][aria-current="true"] {
  background: #333336;
}
.auth-mini-region.region-popup [aria-current="true"]::after {
  content: "";
  grid-area: 1 / 2 / 3;
  justify-self: center;
  align-self: center;
  width: 7px;
  height: 12px;
  border: solid var(--popup-accent);
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}
@media (hover: hover) {
  .region-popup :is(.region-list, [data-mini-places]) button[data-place]:hover { background: #39393b; }
}
.region-popup .auth-mini-locate {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  margin: 4px 0 0;
  padding: 6px 12px;
  border: 0;
  border-radius: 9px;
  color: var(--popup-accent);
  font: 700 13px/1.3 Manrope, RadarManrope, system-ui, sans-serif;
}
.region-popup .auth-mini-locate::before {
  content: "";
  width: 17px;
  height: 17px;
  background-color: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='7.5'/%3E%3Ccircle cx='12' cy='12' r='2.5'/%3E%3Cpath d='M12 2v2m0 16v2M2 12h2m16 0h2'/%3E%3C/svg%3E") center / contain no-repeat;
}
.region-popup .auth-mini-locate + ul { margin-top: 0; }
.region-popup :is(.region-footer, .region-confirm) { margin-inline: 0; padding-inline: 0; }
.region-popup .region-footer { margin-top: 8px; padding: 4px 6px 0 0; border-color: #404043; }
.region-popup :is(.region-empty, [data-mini-region-status]) {
  margin: 0;
  padding: 10px 8px;
  color: var(--popup-muted);
  font-size: 13px;
}
@media (prefers-reduced-motion: no-preference) {
  .region-popup:not([hidden]) { animation: show-region-popup 150ms cubic-bezier(.2,.8,.2,1); }
  .region-popup[data-opens-up] { --popup-offset: 4px; }
  @keyframes show-region-popup {
    from { opacity: 0; transform: translateY(var(--popup-offset, -4px)); }
    to { opacity: 1; transform: translateY(0); }
  }
}
