/* Direct language choices, with a shared compact preferences row on mobile. */
.language-setting {
  --language-muted: #aab8cd;
  --language-border: rgba(148, 163, 184, .24);
  --language-track: rgba(9, 20, 36, .38);
  --language-active: #ead3a1;
  --language-active-bg: rgba(201, 169, 97, .16);
  --language-active-border: rgba(201, 169, 97, .42);
  display: inline-flex;
  flex: 0 0 auto;
}
.language-setting__label,
.language-switch__name,
.language-switch__check,
.mobile-nav-preferences { display: none; }
.language-switch {
  display: inline-flex;
  align-items: stretch;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--language-border);
  border-radius: 12px;
  background: var(--language-track);
}
.language-switch .language-switch__option {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  gap: 8px;
  min-width: 38px;
  min-height: 36px;
  margin: 0;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--language-muted);
  line-height: 1.2;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow: none;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.language-switch .language-switch__option:hover { background: var(--language-active-bg); color: var(--language-active); }
.language-switch .language-switch__option[aria-pressed="true"] {
  color: var(--language-active);
  background: var(--language-active-bg);
  border-color: var(--language-active-border);
}
.language-switch .language-switch__option:focus-visible {
  outline: 2px solid var(--language-active);
  outline-offset: 2px;
}
html[data-theme="light"] .language-setting {
  --language-muted: #53657c;
  --language-border: #ccd5e1;
  --language-track: #edf1f6;
  --language-active: #223a57;
  --language-active-bg: #fff;
  --language-active-border: #b7c4d5;
}
/* Navigation keeps its dark surface in both themes. */
html[data-theme] .mobile-nav-preferences .language-setting {
  --language-muted: #aab8cd;
  --language-border: rgba(148, 163, 184, .24);
  --language-track: rgba(9, 20, 36, .38);
  --language-active: #ead3a1;
  --language-active-bg: rgba(201, 169, 97, .16);
  --language-active-border: rgba(201, 169, 97, .42);
}
@media (max-width: 768px) {
  .top-right-controls > .language-setting { display: none; }
  .mobile-nav-preferences {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
    margin: 8px 18px 14px; padding: 5px 6px 5px 12px;
    border: 1px solid rgba(148, 163, 184, .22); border-radius: 14px;
    background: rgba(9, 20, 36, .26); color: #aab8cd;
  }
  .mobile-nav-preferences__globe { flex: 0 0 18px; }
  .mobile-nav-preferences .language-setting { flex: 1; min-width: 0; }
  .mobile-nav-preferences .language-switch { width: 100%; border: 0; padding: 0; background: transparent; }
  .mobile-nav-preferences .language-switch__option {
    min-width: 44px; min-height: 44px; padding: 0 8px; font-size: 13px;
  }
  .mobile-nav-preferences__divider { flex: 0 0 1px; height: 24px; background: rgba(148, 163, 184, .24); }
  .mobile-nav-preferences .theme-toggle {
    width: 44px; min-width: 44px; height: 44px; min-height: 44px; flex-basis: 44px;
    border: 1px solid transparent; border-radius: 9px;
    background: transparent; color: #e2c787; box-shadow: none;
  }
  .mobile-nav-preferences .theme-toggle:hover {
    background: rgba(201, 169, 97, .16); border-color: rgba(201, 169, 97, .42); transform: none;
  }
  .mobile-nav-preferences .theme-toggle:focus-visible { outline: 2px solid #ead3a1; outline-offset: 2px; }
  .mobile-nav-preferences .theme-toggle::after { display: none; }
}
@media (max-width: 360px) {
  .mobile-nav-preferences { gap: 6px; padding-left: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .language-switch .language-switch__option { transition: none; }
}
