.local-popover {
  position: fixed;
  z-index: 10000;
  max-height: calc(100vh - 88px);
  overflow: auto;
  padding: 8px;
  color: #f0f3fa;
  background: #1e222d;
  border: 1px solid #434651;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 32%);
}

.local-language-menu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(380px, calc(100vw - 24px));
  gap: 2px;
}

.local-installer-menu {
  width: 220px;
}

.local-popover-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.local-popover-item:hover,
.local-popover-item:focus-visible {
  background: #2a2e39;
  outline: 0;
}

.local-popover-item[aria-current="true"] {
  color: #2962ff;
  background: #2a2e39;
}

input[type="range"] {
  pointer-events: none;
}

/* ===== Cloudflare Turnstile download verification modal ===== */
.local-verify-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgb(0 0 0 / 60%);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.local-verify-overlay.local-verify-open {
  display: flex;
  opacity: 1;
}

.local-verify-card {
  position: relative;
  width: min(380px, 100%);
  padding: 28px 24px 24px;
  color: #f0f3fa;
  background: #1e222d;
  border: 1px solid #434651;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgb(0 0 0 / 45%);
  text-align: center;
  transform: translateY(8px);
  transition: transform 0.18s ease;
}

.local-verify-overlay.local-verify-open .local-verify-card {
  transform: translateY(0);
}

.local-verify-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9598a1;
  font-size: 22px;
  line-height: 1;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.local-verify-close:hover,
.local-verify-close:focus-visible {
  color: #f0f3fa;
  background: #2a2e39;
  outline: 0;
}

.local-verify-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  color: #2962ff;
  background: rgb(41 98 255 / 12%);
  border-radius: 50%;
}

.local-verify-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
}

.local-verify-desc {
  margin: 0 0 20px;
  color: #9598a1;
  font-size: 14px;
  line-height: 1.5;
}

.local-verify-widget {
  display: flex;
  justify-content: center;
  min-height: 65px;
  align-items: center;
}

.local-verify-status {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.5;
}

.local-verify-status[data-state="success"] {
  color: #26a69a;
}

.local-verify-status[data-state="error"],
.local-verify-status[data-state="expired"] {
  color: #ef5350;
}

.local-verify-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid #2a2e39;
  border-top-color: #2962ff;
  border-radius: 50%;
  animation: local-verify-spin 0.7s linear infinite;
}

@keyframes local-verify-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-color-scheme: light) {
  html:not(.theme-dark) .local-verify-card {
    color: #131722;
    background: #fff;
    border-color: #e0e3eb;
    box-shadow: 0 12px 40px rgb(0 0 0 / 18%);
  }

  html:not(.theme-dark) .local-verify-close {
    color: #787b86;
  }

  html:not(.theme-dark) .local-verify-close:hover,
  html:not(.theme-dark) .local-verify-close:focus-visible {
    color: #131722;
    background: #f0f3fa;
  }

  html:not(.theme-dark) .local-verify-desc {
    color: #787b86;
  }

  html:not(.theme-dark) .local-verify-spinner {
    border-color: #f0f3fa;
    border-top-color: #2962ff;
  }
}

@media (max-width: 480px) {
  .local-verify-card {
    padding: 24px 18px 20px;
  }
}

@media (prefers-color-scheme: light) {
  html:not(.theme-dark) .local-popover {
    color: #131722;
    background: #fff;
    border-color: #e0e3eb;
    box-shadow: 0 8px 24px rgb(0 0 0 / 14%);
  }

  html:not(.theme-dark) .local-popover-item:hover,
  html:not(.theme-dark) .local-popover-item:focus-visible,
  html:not(.theme-dark) .local-popover-item[aria-current="true"] {
    background: #f0f3fa;
  }
}

@media (max-width: 767px) {
  .local-language-menu {
    grid-template-columns: 1fr;
    width: auto;
  }

  .local-installer-menu {
    width: auto;
  }
}
