
/* —— Language switcher (premium, dark-header) —— */
.nav-actions .lang-switcher {
  order: 99;
  margin-left: 0.35rem;
  margin-right: 0;
}
.lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 0.15rem;
  font-family: var(--font-latin, Inter, ui-sans-serif, system-ui, sans-serif);
  z-index: 70;
}
.lang-switcher__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 10px 0 8px;
  border: 1px solid color-mix(in srgb, #fff 28%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, #fff 6%, transparent);
  color: #f5f7f6;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 1px 2px color-mix(in srgb, #000 28%, transparent);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.lang-switcher__trigger:hover {
  background: color-mix(in srgb, #fff 12%, transparent);
  border-color: color-mix(in srgb, #fff 48%, transparent);
  color: #fff;
}
.lang-switcher__trigger:focus-visible {
  outline: 2px solid var(--brand, #1ED760);
  outline-offset: 2px;
}
.lang-switcher.is-open .lang-switcher__trigger {
  border-color: color-mix(in srgb, var(--brand, #1ED760) 55%, #fff);
  color: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #1ED760) 28%, transparent);
}
.lang-switcher__globe { flex-shrink: 0; opacity: 0.9; }
.lang-switcher__current { line-height: 1; }
.lang-switcher__chevron { flex-shrink: 0; opacity: 0.75; transition: transform 0.15s ease; }
.lang-switcher.is-open .lang-switcher__chevron { transform: rotate(180deg); }

.lang-switcher__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 228px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #121816;
  border: 1px solid color-mix(in srgb, #fff 14%, transparent);
  border-radius: 12px;
  box-shadow:
    0 4px 12px color-mix(in srgb, #000 35%, transparent),
    0 18px 40px color-mix(in srgb, #000 40%, transparent);
  z-index: 80;
}
.lang-switcher__menu[hidden] { display: none !important; }

.lang-switcher__option {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  color: color-mix(in srgb, #fff 88%, transparent);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 550;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.lang-switcher__option:hover,
.lang-switcher__option:focus-visible {
  background: color-mix(in srgb, #fff 10%, transparent);
  color: #fff;
  outline: none;
}
.lang-switcher__option.is-active {
  background: color-mix(in srgb, var(--brand, #1ED760) 18%, transparent);
  color: #fff;
  font-weight: 650;
}
.lang-switcher__native { justify-self: start; }
.lang-switcher__code {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: color-mix(in srgb, #fff 55%, transparent);
}
.lang-switcher__option.is-active .lang-switcher__code { color: var(--brand, #1ED760); }
.lang-switcher__check {
  width: 1rem;
  text-align: center;
  color: var(--brand, #1ED760);
  font-weight: 700;
}
@media (max-width: 900px) {
  .lang-switcher { width: 100%; margin-left: 0; }
  .lang-switcher__trigger { width: 100%; justify-content: center; min-height: 40px; }
  .lang-switcher__menu {
    left: 0;
    right: 0;
    min-width: 0;
  }
}
.lang-switcher a:link,
.lang-switcher a:visited { color: inherit; }

/* —— Premium custom dropdowns (CreateTool domain + link language) —— */
.premium-dd {
  position: relative;
  width: 100%;
  z-index: 40;
  font-family: var(--font-latin, Inter, ui-sans-serif, system-ui, sans-serif);
}
.premium-dd__trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  text-align: left;
  cursor: pointer;
  appearance: none;
}
.premium-dd__trigger.field-input {
  padding-right: 36px;
}
.premium-dd__value {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 650;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.premium-dd__badge,
.premium-dd__code {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand, #1ED760) 16%, transparent);
  color: color-mix(in srgb, var(--brand, #1ED760) 70%, #0b0f0d);
  line-height: 1;
}
.premium-dd__code {
  background: color-mix(in srgb, #0b0f0d 8%, transparent);
  color: var(--text-secondary, #3d4650);
}
.premium-dd__chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.7;
  transition: transform 0.15s ease;
  pointer-events: none;
}
.premium-dd.is-open .premium-dd__chevron { transform: translateY(-50%) rotate(180deg); }
.premium-dd__menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: #FFFEFB;
  border: 1px solid color-mix(in srgb, var(--border, #d7ddd8) 90%, #0b0f0d);
  border-radius: 16px;
  box-shadow:
    0 1px 0 color-mix(in srgb, #fff 90%, transparent) inset,
    0 4px 14px color-mix(in srgb, #0b0f0d 7%, transparent),
    0 28px 56px color-mix(in srgb, #0b0f0d 14%, transparent);
  z-index: 90;
  max-height: min(360px, 60vh);
  overflow: auto;
  color: var(--text-primary, #121816);
}
.premium-dd__menu[hidden] { display: none !important; }
.premium-dd--domain .premium-dd__menu {
  left: 0;
  right: auto;
  width: min(460px, calc(100vw - 28px));
  min-width: min(460px, calc(100vw - 28px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  align-items: stretch;
  gap: 0;
  padding: 10px;
  max-height: min(300px, 52vh);
  overflow: hidden;
}
.premium-dd--domain .premium-dd__options {
  grid-column: 1;
  grid-row: 1;
  list-style: none;
  margin: 0;
  padding: 2px 6px 2px 2px;
  overflow-y: auto;
  max-height: min(280px, 48vh);
  scrollbar-width: thin;
}
.premium-dd--domain .premium-dd__langbar {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 4px;
  margin: 0 0 0 8px;
  padding: 2px 2px 2px 10px;
  border-bottom: 0;
  border-left: 1px solid color-mix(in srgb, var(--border, #d7ddd8) 85%, transparent);
  overflow: visible;
}
.premium-dd__langbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 4px 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid color-mix(in srgb, var(--border, #d7ddd8) 85%, transparent);
}
.premium-dd__langchip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border, #d7ddd8) 90%, transparent);
  background: #fff;
  color: var(--text-secondary, #3d4650);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.premium-dd--domain .premium-dd__langchip {
  width: 100%;
  justify-content: space-between;
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  font-size: 0.7rem;
}
.premium-dd__langchip:hover,
.premium-dd__langchip:focus-visible {
  border-color: color-mix(in srgb, var(--brand, #1ED760) 45%, var(--border, #d7ddd8));
  color: var(--text-primary, #121816);
  outline: none;
}
.premium-dd__langchip.is-active {
  background: color-mix(in srgb, var(--brand, #1ED760) 16%, #fff);
  border-color: color-mix(in srgb, var(--brand, #1ED760) 50%, transparent);
  color: color-mix(in srgb, var(--brand, #1ED760) 35%, #0b0f0d);
}
.premium-dd__langchip-code {
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  opacity: 0.75;
}
.premium-dd__options {
  list-style: none;
  margin: 0;
  padding: 0;
}
.premium-dd__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-primary, #121816);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.premium-dd__option:hover,
.premium-dd__option:focus-visible {
  background: color-mix(in srgb, var(--bg-muted, #f3f5f3) 92%, var(--brand, #1ED760));
  color: var(--text-primary, #121816);
  outline: none;
}
.premium-dd__option.is-active {
  background: color-mix(in srgb, var(--brand, #1ED760) 14%, #fff);
  color: var(--text-primary, #121816);
  font-weight: 650;
}
.premium-dd__option-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.premium-dd__option-badge,
.premium-dd__option-code {
  flex: 0 0 auto;
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--brand, #1ED760) 55%, #0b0f0d);
}
.premium-dd__option.is-active .premium-dd__option-badge,
.premium-dd__option.is-active .premium-dd__option-code {
  color: var(--brand, #1ED760);
}

.field-row--tool-meta {
  display: none; /* language folded into domain dropdown */
}
.field--tool-lang { display: none; }
.premium-dd--on-light .premium-dd__trigger:focus-visible {
  outline: 2px solid var(--brand, #1ED760);
  outline-offset: 2px;
}
.tool-card:has(.premium-dd.is-open),
.create-split:has(.premium-dd.is-open),
.tool-stage:has(.premium-dd.is-open) {
  overflow: visible;
}
