@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap");

.zl-polyglot {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: -0.01em;
}

.zl-polyglot__trigger {
  box-sizing: border-box;
  height: 44px;
  min-width: 120px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  border: 1px solid #27272a;
  background: #18181b;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, opacity 120ms ease;
  box-shadow: none;
}

.zl-polyglot__trigger:hover {
  background: #27272a;
  border-color: #3f3f46;
}

.zl-polyglot__trigger:focus {
  outline: none;
}

.zl-polyglot__trigger:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.zl-polyglot__flag {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.zl-polyglot__flag svg {
  width: 20px;
  height: 20px;
  display: block;
}

.zl-polyglot__code {
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  font-size: 14px;
}

.zl-polyglot__chev {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #a1a1aa;
  transition: transform 200ms ease;
}

.zl-polyglot.is-open .zl-polyglot__chev {
  transform: rotate(180deg);
}

.zl-polyglot__trigger-inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: opacity 150ms ease;
}

.zl-polyglot__trigger.is-fading .zl-polyglot__trigger-inner {
  opacity: 0.35;
}

.zl-polyglot--compact .zl-polyglot__trigger {
  height: 40px;
  min-width: 0;
  padding: 8px 10px;
  gap: 6px;
}

.zl-polyglot--compact .zl-polyglot__code {
  display: none;
}

.zl-polyglot--compact .zl-polyglot__flag,
.zl-polyglot--compact .zl-polyglot__flag svg {
  width: 18px;
  height: 18px;
}

.zl-polyglot--compact .zl-polyglot__chev {
  width: 14px;
  height: 14px;
}

.zl-polyglot--discreet .zl-polyglot__trigger {
  height: 28px;
  min-width: 0;
  padding: 0 4px;
  gap: 0;
  border: none;
  background: transparent;
  border-radius: 8px;
  opacity: 0.55;
}

.zl-polyglot--discreet .zl-polyglot__trigger:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: transparent;
  opacity: 0.9;
}

.zl-polyglot--discreet .zl-polyglot__trigger-inner {
  gap: 0;
}

.zl-polyglot--discreet .zl-polyglot__code,
.zl-polyglot--discreet .zl-polyglot__chev {
  display: none !important;
}

.zl-polyglot--discreet .zl-polyglot__flag,
.zl-polyglot--discreet .zl-polyglot__flag svg {
  width: 14px;
  height: 14px;
}

.zl-polyglot--ghost .zl-polyglot__trigger {
  height: 24px;
  padding: 0;
  opacity: 0.42;
}

.zl-polyglot--ghost .zl-polyglot__trigger:hover,
.zl-polyglot--ghost.is-open .zl-polyglot__trigger {
  opacity: 0.85;
  background: transparent;
}

.zl-polyglot--ghost .zl-polyglot__flag,
.zl-polyglot--ghost .zl-polyglot__flag svg {
  width: 13px;
  height: 13px;
}

.footer-bottom .zl-polyglot {
  margin-left: auto;
}

.nav-mobile__lang {
  padding: 0 1.25rem 0.5rem;
}

.side__foot .zl-polyglot {
  margin-top: 8px;
  display: flex;
  justify-content: flex-start;
}

.zl-polyglot-portal {
  position: fixed;
  inset: 0;
  z-index: 100001;
  pointer-events: none;
}

.zl-polyglot-portal.is-open {
  pointer-events: auto;
}

.zl-polyglot-portal__backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
}

.zl-polyglot-portal__menu {
  position: fixed;
  width: 220px;
  box-sizing: border-box;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 16px;
  padding: 6px;
  box-shadow: none;
  opacity: 0;
  transform: translateY(6px) scale(0.95);
  transition: opacity 200ms ease, transform 200ms cubic-bezier(0.34, 1.45, 0.64, 1);
  max-height: min(70vh, 360px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #3f3f46 transparent;
}

.zl-polyglot-portal.is-open .zl-polyglot-portal__menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.4);
}

.zl-polyglot-portal.is-closing .zl-polyglot-portal__menu {
  opacity: 0;
  transform: translateY(4px) scale(0.97);
  transition-duration: 160ms;
  transition-timing-function: ease;
}

.zl-polyglot-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #a1a1aa;
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.zl-polyglot-item:focus {
  outline: none;
}

.zl-polyglot-item:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.zl-polyglot-item:hover {
  background: #27272a;
  color: #fff;
}

.zl-polyglot-item__left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.zl-polyglot-item__flag {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.zl-polyglot-item__flag svg {
  width: 24px;
  height: 24px;
  display: block;
}

.zl-polyglot-item:hover .zl-polyglot-item__flag {
  transform: scale(1.15);
}

.zl-polyglot-item.is-active .zl-polyglot-item__flag {
  box-shadow: 0 0 0 2px #fff;
}

.zl-polyglot-item__name {
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zl-polyglot-item:hover .zl-polyglot-item__name {
  color: #fff;
}

.zl-polyglot-item__tag {
  font-size: 10px;
  font-weight: 600;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: #71717a;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

.zl-polyglot-item__check {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #fff;
}

.nav-cta .zl-polyglot {
  margin-right: 2px;
}

.composer__toolbar .zl-polyglot {
  flex-shrink: 0;
}
