/* P1 navigation repair. Loaded after the existing page styles. */
header.wrap { gap: 20px; }
header.wrap nav {
  display: flex !important; flex-wrap: wrap !important; align-items: center !important;
  justify-content: flex-end !important; overflow: visible !important;
  white-space: normal !important; min-width: 0 !important; gap: 10px 16px !important;
}
header.wrap nav > a, header.wrap nav .lang-switch a {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; color: #d4d4d8;
}
header.wrap nav .lang-switch {
  display: inline-flex !important; align-items: center; flex: 0 0 auto;
  gap: 6px !important; margin-left: 0 !important;
}
header.wrap nav .lang-switch a.active {
  color: #09090b !important; background: #bef264 !important; border-color: #bef264 !important;
}
header.wrap nav a:focus-visible { outline: 2px solid #bef264; outline-offset: 3px; }
header.wrap nav > a[aria-current="page"] { color: #bef264 !important; }
html[lang="ru"] h1 { overflow-wrap: anywhere; hyphens: auto; }
.content-grid > *, .content-main, .content-card { min-width: 0; }
.content-card { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  html[lang="ru"] h1 { font-size: clamp(28px, 7.8vw, 36px) !important; }
}
@media (min-width: 901px) and (max-width: 1100px) {
  html[lang="ru"] .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  header.wrap { flex-direction: column !important; align-items: flex-start !important; gap: 12px !important; }
  header.wrap nav { width: 100% !important; justify-content: flex-start !important; gap: 6px !important; }
  header.wrap nav > a, header.wrap nav .lang-switch a {
    flex: 0 0 auto !important; white-space: nowrap !important; font-size: 13px !important;
    line-height: 1.2 !important; min-height: 36px !important; padding: 8px 10px !important;
    border: 1px solid rgba(255,255,255,.18) !important; border-radius: 999px !important;
    background: rgba(255,255,255,.035) !important;
  }
  header.wrap nav .lang-switch a.active { background: #bef264 !important; border-color: #bef264 !important; }
}
