.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem;
  border-radius: var(--radius-sm, 8px);
  background: var(--surface, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  flex-shrink: 0;
}

.lang-switch-top {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 30;
}

.lang-btn {
  min-width: 2.25rem;
  min-height: 2rem;
  padding: 0.3rem 0.55rem;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition:
    color var(--duration, 180ms) var(--ease, ease),
    background var(--duration, 180ms) var(--ease, ease);
}

.lang-btn:hover {
  color: var(--text);
  background: var(--surface-hover, rgba(255, 255, 255, 0.06));
}

.lang-btn.active {
  color: var(--accent-soft);
  background: var(--accent-dim, rgba(61, 159, 255, 0.14));
}

.lang-btn:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 1px;
}

.dash-header-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  justify-self: end;
  grid-column: 3;
}

.legal-lang {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
}

.legal-main {
  position: relative;
}

@media (max-width: 768px) {
  .dash-header.has-lang {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }

  .dash-header-right {
    grid-column: 2;
    grid-row: 1;
  }

  .dash-header .category-nav {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .lang-switch {
    min-height: 40px;
  }

  .lang-btn {
    min-height: 36px;
    min-width: 2.15rem;
  }

  .lang-switch-top {
    top: 0.65rem;
    right: 0.65rem;
  }
}

@media (max-width: 380px) {
  .lang-switch-top {
    top: 0.5rem;
    right: 0.5rem;
  }
}
