.site-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  min-height: 44px;
  padding: env(safe-area-inset-top, 0px) 12px 0;
  background: #fff;
  color: #222;
  border-bottom: 1px solid #eee;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
}

.site-bar-brand,
.site-bar-user a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
}

.site-bar-user a {
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 44px;
  justify-content: center;
}

.site-bar-user a[hidden] {
  display: none;
}

.site-bar-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: block;
}

.site-bar-user {
  display: flex;
  align-items: center;
}

.site-bar-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #eee;
  color: #222;
  flex-shrink: 0;
}

.site-bar-avatar--letter {
  font-size: 0.9rem;
  font-weight: 700;
}

.site-bar-avatar--photo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.site-bar-avatar--photo[hidden],
.site-bar-avatar--letter[hidden] {
  display: none;
}

.site-bar-dark .site-bar {
  background: #202020;
  color: #f5f5f5;
  border-bottom-color: #3a3a3c;
}

.site-bar-dark .site-bar-avatar {
  background: #3a3a3c;
  color: #f5f5f5;
}

#site-bar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1090;
  background: transparent;
}

#site-bar-backdrop[hidden] {
  display: none;
}

#site-bar-menu {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 48px);
  right: 8px;
  z-index: 1100;
  box-sizing: border-box;
  width: 280px;
  max-height: min(70vh, 480px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  background: #fff;
  color: #222;
  border: 1px solid #eee;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
}

#site-bar-menu[hidden] {
  display: none;
}

#site-bar-menu a,
#site-bar-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  width: 100%;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  text-decoration: none;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
}

#site-bar-menu a[hidden],
#site-bar-menu button[hidden] {
  display: none;
}

#site-bar-menu img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
}

.site-bar-menu-sep {
  height: 1px;
  margin: 6px 12px;
  background: #eee;
  border: 0;
}

#site-bar-menu-login,
#site-bar-menu-profile,
#site-bar-menu-logout {
  font-size: 0.9rem;
}

.site-bar-dark #site-bar-menu {
  background: #202020;
  color: #f5f5f5;
  border-color: #3a3a3c;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.site-bar-dark .site-bar-menu-sep {
  background: #3a3a3c;
}
