.top-bar-shell {
  width: min(1180px, 94vw);
  margin: calc(var(--top-bar-offset) + env(safe-area-inset-top)) auto 0;
  z-index: 60;
}

.top-bar {
  width: 100%;
  height: var(--top-bar-height);
  margin: 0 auto;
  padding: 0 12px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.top-bar-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}

.top-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  height: 100%;
  padding: 0 6px 0 0;
  text-decoration: none;
  border-radius: 14px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.top-home-link:hover {
  opacity: 0.86;
  transform: translateY(-1px);
}

.top-home-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(18, 103, 214, 0.16);
}

.top-home-logo-picture {
  display: block;
  flex-shrink: 0;
}

.top-home-logo {
  display: block;
  width: auto;
  height: 26px;
  max-width: min(38vw, 168px);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.top-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 10px;
  color: var(--text-sub);
  text-decoration: none;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.top-nav-icon {
  display: none;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  object-fit: contain;
}

.top-nav-label {
  display: inline;
  line-height: 1.2;
}

.top-nav-link:hover {
  background: rgba(18, 103, 214, 0.08);
  color: var(--text-main);
}

.top-nav-link.is-active,
.top-nav-link[aria-current="page"] {
  color: var(--accent);
  background: rgba(69, 150, 255, 0.08);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  flex-shrink: 0;
}

.lang-cycle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: rgba(18, 103, 214, 0.08);
  color: var(--accent-strong);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.lang-cycle-btn:hover {
  background: rgba(18, 103, 214, 0.12);
  color: var(--accent);
}

.lang-cycle-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(18, 103, 214, 0.16);
}

.lang-cycle-icon {
  display: block;
  width: 15px;
  height: 15px;
  object-fit: contain;
  pointer-events: none;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-sub);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.lang-btn:hover {
  background: rgba(18, 103, 214, 0.08);
  color: var(--text-main);
}

.lang-btn.is-active {
  color: var(--accent-strong);
  background: rgba(18, 103, 214, 0.12);
}

@media (max-width: 760px) {
  .top-bar {
    padding: 0 8px 0 12px;
    gap: 10px;
  }

  .top-bar-main {
    gap: 10px;
  }

  .top-home-logo {
    height: 22px;
    max-width: min(34vw, 132px);
  }

  .top-nav-link {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .lang-switch {
    gap: 4px;
  }

  .lang-btn {
    font-size: 12px;
    padding: 7px 9px;
  }
}

@media (max-width: 640px) {
  .top-nav {
    gap: 4px;
  }

  .top-nav-link {
    min-width: 34px;
    padding: 6px 9px;
  }

  .top-nav-icon {
    display: block;
    width: 15px;
    height: 15px;
  }

  .top-nav-label {
    display: none;
  }

  .lang-switch {
    gap: 0;
  }

  .lang-btn {
    display: none;
  }

  .lang-cycle-btn {
    display: inline-flex;
  }
}

@media (max-width: 560px) {
  .top-bar {
    padding: 0 6px 0 10px;
  }

  .top-bar-main {
    gap: 8px;
  }

  .top-home-logo {
    height: 20px;
    max-width: min(32vw, 112px);
  }

  .top-nav-link {
    min-width: 32px;
    min-height: 32px;
    padding: 6px 8px;
  }

  .top-nav-icon {
    width: 14px;
    height: 14px;
  }
}
