.nav {
  display: flex;
  width: min(1120px, calc(100vw - 32px));
  min-height: 64px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 20px 50%;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.5;
  transform: translateX(-50%);
}

.nav-scroll {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 4px;
  padding-right: 0;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
  -webkit-mask-image: none;
  mask-image: none;
}

.nav-scroll::-webkit-scrollbar {
  display: none;
}

.nav a {
  display: inline-block;
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  -webkit-text-stroke: 0;
  white-space: nowrap;
}

.nav a:hover,
.nav a:focus-visible,
.nav a.active,
.nav a[aria-current='page'] {
  border: 0;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  font-weight: 600;
  -webkit-text-stroke: 0;
}

.nav a:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--color-primary) 35%, transparent);
  outline-offset: 1px;
}

.nav .full {
  display: inline;
}

.nav .short {
  display: none;
}

.ts-wrap {
  position: relative;
  top: auto;
  z-index: 100;
  display: flex;
  flex: 0 0 auto;
  align-self: center;
  align-items: center;
  gap: 6px;
  margin-top: 0;
  margin-left: auto;
}

.ts-wrap .ts-btn,
.ts-wrap .nvt-theme-btn,
.ts-wrap .nvt-privacy-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.ts-wrap .ts-btn svg,
.ts-wrap .nvt-theme-btn svg,
.ts-wrap .nvt-privacy-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ts-wrap .ts-btn:hover,
.ts-wrap .nvt-theme-btn:hover,
.ts-wrap .nvt-privacy-btn:hover {
  background: var(--bg-hover);
}

.ts-wrap .ts-btn:active,
.ts-wrap .nvt-theme-btn:active,
.ts-wrap .nvt-privacy-btn:active {
  transform: scale(0.96);
}

.ts-wrap .ts-btn:focus-visible,
.ts-wrap .nvt-theme-btn:focus-visible,
.ts-wrap .nvt-privacy-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--color-primary) 35%, transparent);
  outline-offset: 2px;
}

@media (max-width: 580px) {
  .nav {
    width: calc(100vw - 24px);
    gap: 12px;
  }

  .nav-scroll {
    gap: 4px;
    padding-right: 0;
  }

  .nav .full {
    display: inline;
  }

  .nav .short {
    display: none;
  }

  .ts-wrap .ts-btn,
  .ts-wrap .nvt-theme-btn,
  .ts-wrap .nvt-privacy-btn {
    width: 26px;
    height: 26px;
  }

  .ts-wrap .ts-btn svg,
  .ts-wrap .nvt-theme-btn svg,
  .ts-wrap .nvt-privacy-btn svg {
    width: 13px;
    height: 13px;
  }
}
