.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  border-bottom: 1px solid #e7e7e7;
  background: #fafafa;
}

.mobile-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #111111;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background .18s ease, transform .18s ease;
}

.mobile-sidebar-toggle svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.mobile-sidebar-toggle:hover {
  background: #efefef;
}

.mobile-sidebar-toggle:active {
  transform: translateY(1px);
}

.mobile-sidebar-toggle:focus-visible {
  outline: 2px solid rgba(17, 17, 17, 0.14);
  outline-offset: 2px;
}

.topbar-spacer {
  flex: 1;
  min-width: 0;
}

.topbar-intro {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.lang-menu {
  position: relative;
  flex-shrink: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lang-menu-trigger,
.topbar-social-link {
  list-style: none;
  user-select: none;
}

.topbar-social-link {
  text-decoration: none;
}

.lang-menu-trigger svg,
.topbar-social-link svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.lang-menu-trigger::-webkit-details-marker {
  display: none;
}

.lang-menu[open] .lang-menu-trigger {
  background: #efefef;
  transform: translateY(0);
}

.lang-menu-code {
  line-height: 1;
}

.lang-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 148px;
  padding: 5px;
  border: 2px solid #111111;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: none;
  display: grid;
  gap: 2px;
  z-index: 70;
}

.lang-menu-form {
  margin: 0;
}

.lang-menu-option {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #1b1b1b;
  text-align: left;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  padding: 0 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.lang-menu-option.is-current {
  background: #111111;
  color: #ffffff;
  font-weight: 900;
}

.lang-menu-option:disabled {
  cursor: default;
}

.lang-menu-option:hover {
  background: #f4f4f4;
}

.lang-menu-option.is-current:hover {
  background: #111111;
}

.lang-menu-option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.topbar-divider {
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: #d7d7d7;
}

.topbar-logout-form {
  margin: 0;
}

.top-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #1a1a1a;
  text-decoration: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.top-icon-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.top-icon-btn-badge {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fafafa;
  background: #e23b3b;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}

.top-icon-btn.has-unread .top-icon-btn-badge {
  opacity: 1;
  transform: scale(1);
}

.top-icon-btn:hover {
  background: #efefef;
  color: #111111;
  transform: translateY(-1px);
}

.top-icon-btn:active {
  background: #e7e7e7;
  transform: translateY(0);
}

.top-icon-btn--logout {
  background: #111111;
  color: #ffffff;
}

.top-icon-btn--login {
  background: #111111;
  color: #ffffff;
}

.top-icon-btn--logout:hover,
.top-icon-btn--logout:active,
.top-icon-btn--login:hover,
.top-icon-btn--login:active {
  background: #111111;
  color: #ffffff;
}

.top-icon-btn:focus-visible {
  outline: 2px solid rgba(17, 17, 17, 0.14);
  outline-offset: 2px;
}

.topbar.is-locked .top-icon-btn:not(.top-icon-btn--login):not(.lang-menu-trigger):not(.topbar-social-link) {
  pointer-events: none;
  cursor: not-allowed;
  color: #9f998f;
  background: transparent;
  transform: none;
  box-shadow: none;
}

.topbar.is-locked .top-icon-btn:not(.top-icon-btn--login):not(.lang-menu-trigger):not(.topbar-social-link):hover,
.topbar.is-locked .top-icon-btn:not(.top-icon-btn--login):not(.lang-menu-trigger):not(.topbar-social-link):active {
  background: transparent;
  transform: none;
  color: #9f998f;
}

.topbar.is-locked .topbar-divider {
  background: #dfd8ce;
}

@media (max-width: 760px) {
  .topbar {
    min-height: 60px;
    gap: 8px;
    padding: 0 12px;
  }

  .mobile-sidebar-toggle {
    display: inline-flex;
  }

  .topbar-intro {
    flex: 1 1 auto;
    gap: 8px;
  }

  .topbar-actions {
    gap: 2px;
  }
}

@media (max-width: 640px) {
  .topbar {
    min-height: 60px;
    padding: 0 12px;
  }

  .topbar-intro {
    gap: 8px;
  }

  .lang-menu-trigger {
    height: 34px;
  }

  .lang-menu-panel {
    width: 168px;
  }

  .topbar-actions {
    gap: 4px;
  }

}
