.semi-app-header {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 40;
}

.semi-app-brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.semi-app-brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(42, 109, 181, 0.1));
}

.semi-app-brand-text {
  color: #2f455f;
  font-size: clamp(16px, 2.2vw, 24px);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.semi-app-header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.semi-app-user,
.semi-app-language {
  min-height: 46px;
  padding: 6px 10px;
  border-radius: 16px;
  background: rgba(255, 250, 244, 0.92);
  border: 1px solid rgba(221, 228, 236, 0.95);
  box-shadow: 0 10px 22px rgba(32, 53, 79, 0.08);
}

.semi-app-user-menu {
  position: relative;
}

.semi-app-user {
  max-width: 230px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.semi-app-user-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  overflow: hidden;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(42, 109, 181, 0.12);
}

.semi-app-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.semi-app-user-initial {
  color: #355cdd;
  font-size: 13px;
  font-weight: 900;
}

.semi-app-user-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #2f455f;
  font-size: 14px;
  font-weight: 800;
}

.semi-app-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(255, 250, 244, 0.98);
  border: 1px solid rgba(221, 228, 236, 0.95);
  box-shadow: 0 16px 30px rgba(32, 53, 79, 0.12);
  display: grid;
  gap: 6px;
}

.semi-app-user-dropdown[hidden] {
  display: none !important;
}

.semi-app-user-dropdown-link {
  width: 100%;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #2f455f;
  text-decoration: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.semi-app-user-dropdown-link:hover {
  background: rgba(53, 92, 221, 0.08);
}

.semi-app-user-dropdown-link.is-danger {
  color: #2a6db5;
}

.semi-app-user-dropdown-link.is-danger:hover {
  background: rgba(42, 109, 181, 0.08);
}

.semi-app-language {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.semi-app-language-btn {
  min-width: 42px;
  min-height: 32px;
  padding: 0 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #8d9aab;
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

.semi-app-language-btn.is-active {
  background: #fff;
  color: #2f455f;
  box-shadow: 0 6px 14px rgba(32, 53, 79, 0.1);
}

.semi-app-language-btn:active {
  transform: scale(0.98);
}

@media (max-width: 768px) {
  .semi-app-header {
    padding-inline: 12px;
    gap: 8px;
  }

  .semi-app-brand-logo {
    width: 44px;
    height: 44px;
  }

  .semi-app-user {
    max-width: 168px;
  }

  .semi-app-user-name {
    font-size: 13px;
  }

  .semi-app-user-dropdown {
    min-width: 164px;
  }

  .semi-app-language-btn {
    min-width: 38px;
    min-height: 30px;
    font-size: 12px;
  }
}

@media (max-width: 560px) {
  .semi-app-header {
    align-items: center;
  }

  .semi-app-user {
    max-width: 156px;
  }
}
