.lang-menu {
  position: relative;
  min-width: 0;
}

.lang-menu[open] {
  z-index: 40;
}

.lang-menu summary {
  list-style: none;
}

.lang-menu summary::-webkit-details-marker {
  display: none;
}

.lang-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid var(--line, #d8e2ec);
  background: #fff;
  color: var(--text, #14202b);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.lang-menu-trigger:hover {
  border-color: #b8c9da;
  background: #fbfdff;
}

.lang-menu-current-flag,
.lang-menu-flag {
  font-size: 1rem;
  line-height: 1;
}

.lang-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 230px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--line, #d8e2ec);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 30px rgba(15, 35, 60, 0.12);
  display: grid;
  gap: 6px;
}

.lang-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--muted, #5f6d79);
  font-weight: 700;
}

.lang-menu-item:hover,
.lang-menu-item.is-active {
  background: var(--accent, #eaf2ff);
  color: var(--text, #14202b);
}

.locale-modal-open {
  overflow: hidden;
}

.locale-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 35, 60, 0.58);
  backdrop-filter: blur(6px);
}

.locale-modal {
  width: 100%;
  max-width: 520px;
  max-height: calc(100dvh - 48px);
  overflow: auto;
  padding: 28px;
  border-radius: 24px;
  border: 1px solid var(--line, #d8e2ec);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), #f8fbff);
  box-shadow: 0 24px 60px rgba(15, 35, 60, 0.2);
  text-align: center;
}

.locale-modal-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent, #eaf2ff);
  color: var(--primary, #0b5ed7);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.locale-modal h2 {
  margin: 16px 0 10px;
  color: var(--text, #14202b);
  font-size: clamp(28px, 4vw, 36px);
  line-height: 1.12;
}

.locale-modal p {
  margin: 0;
  color: var(--muted, #5f6d79);
  font-size: 16px;
  line-height: 1.6;
}

.locale-choice-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.locale-choice-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid var(--line, #d8e2ec);
  background: #fff;
  color: var(--text, #14202b);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.locale-choice-button:hover,
.locale-choice-button:focus-visible {
  transform: translateY(-1px);
  border-color: #b8c9da;
  box-shadow: 0 14px 28px rgba(15, 35, 60, 0.1);
}

@media (max-width: 700px) {
  .lang-menu {
    width: 100%;
  }

  .lang-menu-trigger {
    width: 100%;
    justify-content: space-between;
    padding: 0 16px;
  }

  .lang-menu-panel {
    left: 0;
    right: 0;
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .locale-modal-backdrop {
    padding: 12px;
    align-items: flex-end;
  }

  .locale-modal {
    width: 100%;
    max-height: calc(100dvh - 24px);
    padding: 22px 16px 18px;
    border-radius: 22px 22px 18px 18px;
    text-align: left;
  }

  .locale-modal h2 {
    font-size: 28px;
  }

  .locale-modal p {
    font-size: 15px;
  }

  .locale-choice-list {
    gap: 10px;
  }

  .locale-choice-button {
    min-height: 52px;
    padding: 14px 16px;
    font-size: 15px;
  }
}
