.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px max(24px, calc((100vw - 1180px) / 2));
  background: var(--header-bg);
  box-shadow: none;
  backdrop-filter: blur(12px);
  font-family: Tahoma, "Segoe UI", sans-serif;
}

.site-header .brand {
  display: inline-flex;
  min-width: 0;
  flex: 0 1 auto;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.site-header .brand-mark {
  display: block;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.site-header .brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-header .brand-copy strong,
.site-header .brand-copy small {
  display: block;
}

.site-header .brand-copy strong {
  background: none;
  color: var(--ink);
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.site-header .brand-copy small {
  margin-top: 3px;
  color: var(--quiet);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.035em;
  line-height: 1.2;
  text-transform: none;
}

.site-header .top-nav {
  display: flex;
  min-width: 0;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.site-header .top-nav a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.site-header .top-nav a:hover,
.site-header .top-nav a:focus-visible,
.site-header .top-nav a[aria-current="page"] {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
  outline: none;
}

.site-header .top-nav .account-chip[aria-current="page"] {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.site-header .top-nav .account-chip[aria-current="page"]:hover,
.site-header .top-nav .account-chip[aria-current="page"]:focus-visible {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}

.site-header .account-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.site-header .site-theme-toggle {
  position: relative;
  display: inline-grid;
  width: 92px;
  min-height: 36px;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px;
  background: var(--paper);
  color: var(--muted);
  font: inherit;
  box-shadow: none;
  cursor: pointer;
}

.site-header .site-theme-toggle span,
.site-header .site-theme-toggle strong {
  position: relative;
  z-index: 1;
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.site-header .site-theme-toggle::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 5px;
  background: var(--brand-dark);
  box-shadow: none;
  transition: transform 0.16s ease;
}

[data-theme="dark"] .site-header .site-theme-toggle::before {
  transform: translateX(100%);
}

[data-theme="light"] .site-header .site-theme-toggle span,
[data-theme="dark"] .site-header .site-theme-toggle strong {
  color: #ffffff;
}

.site-header .site-theme-toggle:hover,
.site-header .site-theme-toggle:focus-visible {
  border-color: var(--brand);
  outline: none;
  box-shadow: var(--shadow-focus);
}

.site-header .top-nav .header-download {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  border: 1px solid var(--brand-dark);
  border-radius: 7px;
  padding: 0 14px;
  background: var(--brand-dark);
  color: #ffffff;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.site-header .top-nav .header-download:hover,
.site-header .top-nav .header-download:focus-visible {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
  outline: none;
  box-shadow: var(--shadow-focus);
}

@media (max-width: 1040px) {
  .site-header {
    padding-inline: 20px;
  }

  .site-header .nav-link {
    display: none;
  }
}

@media (max-width: 720px) {
  .site-header {
    min-height: 62px;
    flex-wrap: nowrap;
    gap: 12px;
    padding: 9px 14px;
  }

  .site-header .brand-copy small,
  .site-header .site-theme-toggle,
  .site-header .account-nav {
    display: none;
  }

  .site-header .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .site-header .brand-copy strong {
    font-size: 15px;
  }

  .site-header .top-nav {
    margin-left: auto;
  }

  .site-header .top-nav .header-download {
    margin-left: 0;
  }
}
