/* LEVEL-ONE header layer */
.site-header-shell {
  gap: clamp(0.65rem, 1.6vw, 1.2rem);
}

/* Kontomenue (Profilbild + Name + Uhrzeit) als Button oben rechts, nur Desktop */
.site-header-account {
  position: relative;
  flex: 0 0 auto;
  margin-left: clamp(0.25rem, 0.9vw, 0.75rem);
}
.site-header-account > summary {
  list-style: none;
}
.site-header-account > summary::-webkit-details-marker {
  display: none;
}
.site-header-account-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.35rem;
  max-width: 15rem;
  padding: 0.28rem 0.7rem 0.28rem 0.32rem;
  border: 1px solid var(--theme-border);
  border-radius: 999px;
  background: var(--theme-surface);
  color: var(--theme-text);
  cursor: pointer;
  user-select: none;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}
.site-header-account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  overflow: hidden;
  background: var(--theme-primary-soft);
  border: 1px solid var(--theme-border);
}
.site-header-account-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.site-header-account-avatar-fallback {
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  color: var(--theme-primary);
}
.site-header-account-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  line-height: 1.15;
}
.site-header-account-name {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--theme-text);
}
.site-header-account-time {
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  color: var(--theme-text-muted);
}
.site-header-account[open] .site-header-account-toggle,
.site-header-account-toggle:hover,
.site-header-account-toggle:focus-visible {
  border-color: var(--theme-focus-ring);
  background: var(--theme-primary-soft);
  outline: none;
}
.site-header-account-menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 40;
  min-width: min(15rem, 82vw);
  display: grid;
  gap: 0.26rem;
  padding: 0.42rem;
  border: 1px solid var(--theme-border);
  border-radius: var(--radius-md);
  background: var(--theme-surface-strong);
  box-shadow: var(--shadow);
}
.site-header-account-logout {
  margin: 0;
}
.site-header-account-item {
  display: grid;
  gap: 0.12rem;
  width: 100%;
  padding: 0.5rem 0.66rem;
  border: 1px solid var(--theme-border);
  border-radius: 0.68rem;
  background: var(--theme-surface);
  color: var(--theme-text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}
.site-header-account-item:hover,
.site-header-account-item:focus-visible,
.site-header-account-item.is-active {
  border-color: var(--theme-focus-ring);
  background: var(--theme-primary-soft);
  color: var(--text-main);
  outline: none;
}
.site-header-account-item-label {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.site-header-account-item-hint {
  font-size: 0.68rem;
  color: var(--theme-text-muted);
}
.site-header-account-item-logout .site-header-account-item-label {
  color: var(--theme-danger, #ff6c62);
}
@media (max-width: 820px) {
  .site-header-account {
    display: none;
  }
}

.site-brand-level-one {
  object-fit: contain;
  object-position: left center;
}

.site-header-theme-toggle,
.site-header-notification,
.mobile-nav-toggle {
  border-radius: var(--lo-radius-pill);
}

@media (max-width: 820px) {
  body .site-header .desktop-main-nav {
    display: none !important;
  }

  body .site-header .mobile-nav {
    display: block !important;
  }

  body .site-header .site-header-shell {
    position: relative !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    column-gap: 0.75rem !important;
    row-gap: 0.72rem !important;
    padding: 0.88rem 0 0.92rem !important;
    min-height: auto !important;
  }

  body .site-header .site-brand,
  body .site-header .site-header-logo-slot {
    grid-column: 1 / 2 !important;
    grid-row: 1 !important;
    justify-self: start !important;
    align-self: center !important;
    width: auto !important;
    max-width: 18.2rem !important;
    min-width: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  body .site-header .site-brand-level-one-wrap {
    display: block !important;
    width: var(--lo-header-logo-mobile-w) !important;
    max-width: 18.2rem !important;
    min-width: 0 !important;
  }

  body .site-header img.site-brand-level-one,
  body .site-header [data-level-one-logo] {
    width: var(--lo-header-logo-mobile-w) !important;
    max-width: 18.2rem !important;
    height: var(--lo-header-logo-mobile-h) !important;
    max-height: var(--lo-header-logo-mobile-h) !important;
    object-fit: contain !important;
    object-position: left center !important;
  }

  body .site-header .mobile-nav,
  body .site-header .site-header-menu-slot {
    grid-column: 2 / 3 !important;
    grid-row: 1 !important;
    justify-self: end !important;
    align-self: center !important;
    width: auto !important;
    margin: 0 !important;
  }

  body .site-header .mobile-nav-toggle {
    min-height: 2.1rem !important;
    padding: 0.3rem 0.54rem !important;
    border-radius: 0.72rem !important;
    font-size: 0.78rem !important;
    line-height: 1 !important;
  }

  body .site-header .site-header-theme,
  body .site-header .site-header-theme-slot {
    grid-column: 1 / 2 !important;
    grid-row: 2 !important;
    justify-self: start !important;
    align-self: center !important;
    width: auto !important;
    margin: 0 !important;
  }

  body .site-header .site-header-theme-toggle {
    min-height: var(--lo-header-action-mobile) !important;
    padding: 0.38rem 0.72rem !important;
  }

  body .site-header .site-header-notification,
  body .site-header .site-header-notification-slot {
    grid-column: 2 / 3 !important;
    grid-row: 2 !important;
    justify-self: end !important;
    align-self: center !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: var(--lo-header-action-mobile) !important;
    height: var(--lo-header-action-mobile) !important;
    min-width: var(--lo-header-action-mobile) !important;
    min-height: var(--lo-header-action-mobile) !important;
    margin: 0 !important;
  }

  body .site-header .site-header-notification-badge {
    top: -0.34rem !important;
    right: -0.34rem !important;
  }
}
