.yk-language-selector {
  position: relative;
  z-index: 30;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.yk-language-selector.is-floating {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 80;
}

html[dir="rtl"] .yk-language-selector.is-floating {
  right: auto;
  left: 14px;
}

.yk-language-trigger {
  display: inline-grid;
  grid-template-columns: 18px minmax(0, auto) 12px;
  align-items: center;
  gap: 7px;
  min-width: 116px;
  min-height: 44px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 13px;
  background: #171515;
  color: #f7f7f7;
  font: 600 .84rem/1 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  cursor: pointer;
  direction: ltr;
  transition: background-color .15s ease, border-color .15s ease;
}

.yk-language-trigger:hover,
.yk-language-selector.is-open .yk-language-trigger {
  border-color: rgba(255, 255, 255, .2);
  background: #211e1e;
}

.yk-language-trigger:focus-visible {
  outline: 2px solid #a78bfa;
  outline-offset: 3px;
}

.yk-language-label,
.yk-language-option-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: start;
}

.yk-language-flag {
  display: block;
  width: 18px;
  height: 12px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .16);
}

.yk-language-flag-fallback {
  display: grid;
  width: 24px;
  height: 18px;
  place-items: center;
  border-radius: 3px;
  background: #2b2727;
  color: #f7f7f7;
  font-size: .55rem;
  font-weight: 800;
  line-height: 1;
}

.yk-language-chevron {
  width: 12px;
  height: 12px;
  margin-left: auto;
  color: #aaa4a4;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform .15s ease;
}

.yk-language-selector.is-open .yk-language-chevron {
  transform: rotate(180deg);
}

.yk-language-menu {
  position: fixed;
  z-index: 2147483000;
  top: 0;
  left: -9999px;
  display: grid;
  width: min(240px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  gap: 2px;
  padding: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid #292626;
  border-radius: 15px;
  background: #0e0d0d;
  color: #f7f7f7;
  box-shadow: 0 6px 8px rgba(0, 0, 0, .3);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  direction: ltr;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #4a4545 transparent;
  transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
}

.yk-language-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.yk-language-menu button {
  display: grid;
  grid-template-columns: 18px 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #f7f7f7;
  font: 500 .86rem/1.2 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  text-align: start;
  cursor: pointer;
}

.yk-language-menu button:hover {
  background: #201e1e;
}

.yk-language-menu button[aria-checked="true"] {
  background: #2b2727;
}

.yk-language-menu button:focus-visible {
  outline: 2px solid #a78bfa;
  outline-offset: -2px;
}

.yk-language-check {
  width: 16px;
  height: 16px;
  color: #f7f7f7;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  opacity: 0;
}

.yk-language-menu button[aria-checked="true"] .yk-language-check {
  opacity: 1;
}

@media (max-width: 760px) {
  .yk-language-trigger {
    min-width: 108px;
    max-width: 136px;
    padding-inline: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .yk-language-menu,
  .yk-language-trigger,
  .yk-language-chevron {
    transition: none;
  }
}
