.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgb(255 255 255 / 82%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  transition: padding 180ms ease, box-shadow 180ms ease;
}

.site-header.is-compact {
  padding-top: 11px;
  padding-bottom: 11px;
  box-shadow: 0 5px 18px rgb(20 24 26 / 8%);
}

.site-header.is-compact .brand {
  font-size: 16px;
}

.site-header.is-compact .brand small {
  margin-top: 1px;
  font-size: 10px;
  letter-spacing: 2px;
}

.site-header.is-compact nav {
  gap: 20px;
}

.site-header.is-compact nav .pill {
  padding: 8px 16px;
}

.preview-note {
  background: var(--preview-note-bg, #eef0ed);
}

.preview-note[hidden] {
  display: none !important;
}

.account-menu,
.account-login {
  position: relative;
  z-index: 45;
  flex: 0 0 auto;
}

@media (min-width: 721px) {
  .site-header #navigation {
    margin-left: auto;
    justify-content: flex-end;
  }
}

.account-menu {
  margin: 0;
  padding: 0;
  border: 0;
}

.account-menu > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 4px 12px;
  border: 1px solid #d8ded9;
  border-radius: 999px;
  background: #fff;
  color: #29342e;
  font-size: 13px;
  line-height: 1;
  list-style: none;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary:hover,
.account-menu[open] > summary { border-color: #92ad9b; box-shadow: 0 4px 16px rgb(31 54 40 / 10%); }

.account-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: #e8f0ea;
  color: #356548;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .4px;
}

.account-display-name { max-width: 180px; overflow: hidden; color: #344139; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }

.account-menu-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 60;
  width: min(320px, calc(100vw - 24px));
  padding: 9px;
  border: 1px solid #e0e5e1;
  border-radius: 14px;
  background: rgb(255 255 255 / 98%);
  box-shadow: 0 18px 48px rgb(24 35 28 / 18%);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.account-menu-identity { display: grid; gap: 3px; padding: 12px 12px 14px; }
.account-menu-identity strong { overflow: hidden; color: #29342e; font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-identity span { overflow: hidden; color: #778079; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-group { padding: 7px 0 5px; border-top: 1px solid #edf0ed; }
.account-menu-group h2 { margin: 0; padding: 2px 12px 3px; color: #849087; font-size: 9px; font-weight: 700; letter-spacing: .11em; line-height: 1.4; text-transform: uppercase; }
.account-menu-links { display: grid; gap: 1px; padding: 1px 0 0; }
.account-menu-links a { display: flex; min-height: 38px; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 8px; color: #303a34; font-size: 13px; font-weight: 580; }
.account-menu-links a:hover { background: #f0f5f1; color: #28583a; }
.account-menu-links a span { color: #839188; }
.account-menu-logout { margin: 5px 0 0; padding: 7px 0 0; border-top: 1px solid #edf0ed; }
.account-menu-logout button { width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; color: #8a4141; font-size: 13px; font-weight: 650; text-align: left; }
.account-menu-logout button:hover { background: #fbf0f0; }
.account-login { white-space: nowrap; }

@media (max-width: 1000px) {
  .site-header.is-compact {
    padding: 11px 4%;
  }
}

@media (max-width: 720px) {
  .site-header .brand { order: 1; }
  .site-header .account-menu { order: 2; margin-left: auto; }
  .site-header .account-login-desktop { display: none !important; }
  .site-header #navigation .account-login-mobile { display: inline-flex; }
  .site-header .menu-toggle { order: 3; margin-left: 0; }
  .site-header #navigation { order: 4; }

  .site-header .account-avatar { width: 34px; height: 34px; font-size: 12px; }
  .site-header.is-compact .account-avatar { width: 32px; height: 32px; }
  .site-header .account-menu > summary { gap: 5px; padding: 3px; }
  .site-header .account-display-name { display: none; }
  .site-header .account-menu-panel { top: calc(100% + 9px); }

  .site-header {
    position: sticky;
  }

  .site-header.is-compact {
    gap: 10px;
    padding: 9px 5%;
  }

  .site-header.is-compact .brand {
    font-size: 14px;
  }

  .site-header.is-compact .brand small {
    font-size: 8px;
    letter-spacing: 1.4px;
  }

  .site-header.is-compact .menu-toggle {
    padding: 7px 11px;
    font-size: 13px;
  }

  .site-header.is-compact .language-switch {
    gap: 6px;
    font-size: 12px;
  }

  .site-header.is-compact .language-switch a {
    padding: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header {
    transition: none;
  }
}

.account-login-mobile { display: none; }
