.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 247, 246, 0.9));
  border-bottom: 1px solid rgba(20, 33, 38, 0.09);
  box-shadow: 0 16px 38px rgba(20, 33, 38, 0.08);
  backdrop-filter: blur(18px);
}

.site-header::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(8, 123, 112, 0.5), rgba(56, 170, 184, 0.42), rgba(216, 166, 58, 0.42), transparent);
  opacity: 0.68;
  pointer-events: none;
}

body.ui-theme-dark .site-header {
  background: linear-gradient(180deg, rgba(12, 18, 20, 0.96), rgba(16, 31, 35, 0.9));
  border-bottom-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42);
}

.header-inner {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  min-height: 82px;
}

.brand {
  position: relative;
  z-index: 82;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 7px 12px 7px 7px;
  border-radius: 999px;
  border: 1px solid rgba(20, 33, 38, 0.12);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 24px rgba(20, 33, 38, 0.06);
  font-weight: 800;
}

body.ui-theme-dark .brand {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(19, 32, 40, 0.9);
}

.brand img {
  width: 58px;
  height: 58px;
  padding: 4px;
  border-radius: 18px;
  object-fit: contain;
  object-position: center;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(20, 33, 38, 0.12);
}

body.ui-theme-dark .brand img {
  background: rgba(255, 255, 255, 0.95);
}

.brand span {
  position: relative;
  white-space: nowrap;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.brand-title {
  display: inline-block;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.1;
}

.brand span::after {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: -4px;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, var(--teal), var(--cyan), var(--amber));
  opacity: 0.78;
}

.brand-no-logo {
  padding: 13px 18px;
}

.brand-no-logo .brand-title {
  max-width: none;
}

.nav-panel {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.mobile-nav-list {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.desktop-nav-list {
  display: inline-flex;
  align-items: center;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(20, 33, 38, 0.12);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 28px rgba(20, 33, 38, 0.07);
}

.nav-link {
  position: relative;
  z-index: 0;
  isolation: isolate;
  overflow: hidden;
  padding: 10px 14px;
  color: #31454b;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  transition: color 260ms ease, background 260ms ease, transform 260ms ease, box-shadow 260ms ease;
}

.nav-link::before {
  position: absolute;
  inset: 0;
  content: "";
  border-radius: inherit;
  z-index: -1;
  background: linear-gradient(135deg, rgba(10, 168, 150, 0.16), rgba(52, 95, 116, 0.13));
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 260ms ease, transform 260ms ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--teal-dark);
  transform: translateY(-2px);
}

.nav-link:hover::before,
.nav-link:focus-visible::before {
  opacity: 1;
  transform: scale(1);
}

.nav-link.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--panel-teal), var(--panel-steel));
  box-shadow: 0 10px 24px rgba(8, 123, 112, 0.22);
}

.nav-link.is-active::before {
  display: none;
}

.language-switcher {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  padding: 4px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(20, 33, 38, 0.14);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(20, 33, 38, 0.07);
}

.header-language-switcher {
  flex: 0 0 auto;
  order: 2;
  z-index: 82;
}

body.ui-theme-dark .language-switcher {
  background: rgba(19, 32, 40, 0.9);
  border-color: rgba(255, 255, 255, 0.16);
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 74px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  color: var(--ink-soft);
  background: transparent;
  transition: background 240ms ease, color 240ms ease, transform 240ms ease;
}

.language-toggle:hover,
.language-toggle:focus-visible {
  background: rgba(10, 168, 150, 0.1);
  color: var(--teal-dark);
}

.language-toggle-flag,
.language-flag {
  display: block;
  width: 22px;
  height: 16px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(20, 33, 38, 0.16);
}

.language-toggle-flag svg,
.language-flag svg {
  display: block;
  width: 100%;
  height: 100%;
}

.language-toggle-code,
.language-code {
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.language-toggle-caret {
  width: 9px;
  height: 9px;
  margin-left: 1px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 220ms ease;
}

.language-switcher.is-open .language-toggle-caret {
  transform: rotate(-135deg) translateY(1px);
}

.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 95;
  min-width: 170px;
  display: grid;
  gap: 4px;
  padding: 6px;
  border-radius: 18px;
  border: 1px solid rgba(20, 33, 38, 0.14);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 34px rgba(20, 33, 38, 0.14);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 220ms ease, transform 220ms ease, visibility 220ms ease;
}

body.ui-theme-dark .language-menu {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(19, 32, 40, 0.98);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.36);
}

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

.language-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 16px;
  color: var(--ink-soft);
  background: transparent;
  text-align: left;
  transition: background 220ms ease, color 220ms ease, transform 220ms ease;
}

.language-button:hover,
.language-button:focus-visible {
  background: rgba(10, 168, 150, 0.1);
  color: var(--teal-dark);
}

.language-button.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--panel-teal), var(--panel-steel));
}

body.ui-theme-dark .language-toggle,
body.ui-theme-dark .language-button {
  color: rgba(255, 255, 255, 0.84);
}

.nav-toggle,
.nav-backdrop,
.mobile-menu-head,
.mobile-menu-section {
  display: none;
}

.nav-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(20, 33, 38, 0.12);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--panel-dark), var(--panel-teal));
  box-shadow: 0 14px 28px rgba(20, 33, 38, 0.16);
  transition: transform 260ms ease, box-shadow 260ms ease;
}

body.ui-theme-dark .nav-toggle {
  border-color: rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, #163238, #2d6273);
}

.nav-toggle span {
  display: block;
  width: 19px;
  height: 2px;
  margin: 4px auto;
  background: #ffffff;
  border-radius: 999px;
  transition: transform 260ms ease, opacity 260ms ease;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  background: linear-gradient(135deg, #0a8f80, #245970);
}

@media (min-width: 0px) {
  body.is-menu-open {
    overflow: hidden;
  }

  body.is-menu-open .site-header {
    z-index: 100;
  }

  .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    min-height: 74px;
  }

  .brand {
    min-width: 0;
    max-width: 100%;
  }

  .brand img {
    width: 50px;
    height: 50px;
    padding: 4px;
    border-radius: 16px;
  }

  .nav-toggle {
    position: relative;
    z-index: 80;
    display: block;
    flex: 0 0 auto;
    order: 3;
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: block;
    border: 0;
    background: rgba(8, 12, 14, 0.36);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    backdrop-filter: blur(8px);
    transition: opacity 320ms ease, visibility 320ms ease;
  }

  body.is-menu-open .nav-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: auto;
    right: clamp(12px, 3vw, 24px);
    bottom: auto;
    z-index: 95;
    width: min(326px, calc(100vw - 48px));
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    color: #ffffff;
    background:
      linear-gradient(155deg, rgba(17, 30, 34, 0.99), rgba(8, 88, 82, 0.96)),
      var(--panel-dark);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    box-shadow: 0 30px 95px rgba(0, 0, 0, 0.34);
    opacity: 0;
    pointer-events: none;
    transform: translate3d(calc(100% + 24px), 0, 0) scale(0.99);
    transform-origin: center right;
    transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), opacity 320ms ease;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    scrollbar-width: thin;
  }

  .nav-panel::-webkit-scrollbar {
    width: 7px;
  }

  .nav-panel::-webkit-scrollbar-track {
    background: transparent;
  }

  .nav-panel::-webkit-scrollbar-thumb {
    min-height: 42px;
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.34);
    background-clip: padding-box;
  }

  .nav-panel::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
  }

  .nav-panel::before {
    position: absolute;
    inset: 0;
    content: "";
    background:
      linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
      linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 30px 30px;
    border-radius: inherit;
    opacity: 0.32;
    pointer-events: none;
  }

  .nav-panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate3d(0, 0, 0) scale(1);
  }

  .mobile-menu-head,
  .mobile-menu-section,
  .mobile-nav-list {
    position: relative;
    z-index: 1;
  }

  .desktop-nav-list {
    display: none;
  }

  .mobile-menu-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 2px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    font-weight: 900;
  }

  .mobile-menu-head-no-logo {
    padding-top: 2px;
  }

  .mobile-menu-head img {
    width: 46px;
    height: 46px;
    padding: 4px;
    object-fit: contain;
    object-position: center;
    border-radius: 16px;
    background: #ffffff;
  }

  .mobile-brand-title {
    display: inline-block;
    white-space: nowrap;
    font-size: 1.06rem;
    font-weight: 900;
    line-height: 1.1;
    color: #ffffff;
    letter-spacing: 0.01em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  .mobile-menu-section {
    display: grid;
    gap: 9px;
  }

  .mobile-section-title {
    margin: 0;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.76);
  }

  .mobile-nav-list.mobile-nav-grid {
    display: grid;
    gap: 7px;
    width: 100%;
  }

  .nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    padding: 11px 13px;
    color: rgba(255, 255, 255, 0.84);
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    font-size: 0.94rem;
    white-space: normal;
    line-height: 1.24;
  }

  .nav-link::after {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-left: 12px;
    content: "";
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    opacity: 0.58;
    transform: rotate(-45deg);
  }

  .nav-link:hover,
  .nav-link:focus-visible,
  .nav-link.is-active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transform: translateX(4px);
  }

  .nav-link::before {
    display: none;
  }

  .nav-link.is-active {
    background: linear-gradient(135deg, var(--panel-teal), var(--panel-steel));
  }

  .mobile-action-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mobile-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 12px;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.88rem;
    font-weight: 800;
    transition: background 260ms ease, border-color 260ms ease, transform 260ms ease;
  }

  .mobile-action-btn:hover,
  .mobile-action-btn:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.14);
  }

  .header-language-switcher {
    display: inline-flex;
    order: 2;
  }
}

@media (max-width: 620px) {
  .header-inner {
    gap: 6px;
  }

  .brand {
    min-width: 0;
    max-width: min(54vw, 196px);
    gap: 8px;
    padding-right: 9px;
  }

  .brand-no-logo {
    padding: 12px 15px;
  }

  .brand-title {
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-language-switcher .language-toggle {
    min-width: 48px;
    padding: 0 8px;
  }

  .header-language-switcher .language-toggle-code {
    display: none;
  }

  .nav-toggle {
    flex: 0 0 44px;
  }
}

@media (max-width: 420px) {
  .header-inner {
    min-height: 68px;
  }

  .brand {
    gap: 8px;
    padding-right: 9px;
  }

  .brand img {
    width: 44px;
    height: 44px;
    padding: 4px;
    border-radius: 16px;
  }

  .brand-title {
    max-width: 128px;
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-language-switcher .language-toggle {
    min-width: 48px;
    padding: 0 8px;
  }

  .header-language-switcher .language-toggle-code {
    display: none;
  }

  .mobile-brand-title {
    font-size: 0.94rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-panel {
    top: calc(100% + 8px);
    left: auto;
    right: 14px;
    bottom: auto;
    width: min(312px, calc(100vw - 44px));
    max-height: calc(100vh - 88px);
    padding: 16px;
  }

  .mobile-action-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  .brand-title {
    max-width: 118px;
  }

}
