/* Keep the navigation's backdrop-filter stacking context above page cards. */
.site-nav-wrap { position: relative; z-index: 200; overflow: visible; }
.site-nav { overflow: visible; }
/* Compact disclosure on smaller screens; desktop account links get their own row. */
.site-nav.nav-compact { align-items: center; }
.nav-compact .site-menu-toggle { margin-inline-start: auto; }
.nav-compact .site-menu {
  display: grid; flex: 0 0 100%; width: 100%; gap: 12px;
  padding-top: 12px; border-top: 1px solid #e9e3f4;
}
.nav-compact .site-nav-right, .nav-compact .site-auth {
  display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; gap: 6px;
}
.nav-compact .site-auth a, .nav-compact .site-auth .acct-hi {
  padding: 10px 12px; min-height: 44px; max-width: none; white-space: normal;
  overflow-wrap: anywhere;
}
.nav-compact .lang-switch, .nav-compact .lang-switch select {
  width: 100%; max-width: none;
}
.nav-compact .section-menu > summary { width: 100%; justify-content: space-between; }
.nav-compact .section-menu-links {
  position: static; width: 100%; max-width: 100%; margin-top: 8px;
  background: #fcfaff; box-shadow: none;
}
@media (min-width: 1200px) {
  .site-nav:not(.nav-compact) .brand { order: 0; }
  .site-nav:not(.nav-compact) .site-menu,
  .site-nav:not(.nav-compact) .site-nav-right { display: contents; }
  .site-nav:not(.nav-compact) .section-menu { order: 1; margin-inline-end: auto; }
  .site-nav:not(.nav-compact) .lang-switch { order: 2; }
  .site-nav:not(.nav-compact) .site-auth {
    order: 3; display: flex; flex: 0 0 100%; width: 100%;
    justify-content: center; flex-wrap: wrap; gap: 8px;
    padding-top: 8px; border-top: 1px solid #e9e3f4;
  }
  .site-nav:not(.nav-compact) .acct-hi {
    max-width: 220px; overflow-wrap: anywhere; white-space: normal;
  }
}

.section-menu { position: relative; }
.section-menu > summary {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 11px 15px; border: 1px solid #e8dfff; border-radius: 14px;
  background: #f7f3ff; color: #493080; font-weight: 800;
  cursor: pointer; list-style: none; white-space: nowrap;
}
.section-menu > summary::-webkit-details-marker { display: none; }
.section-menu > summary::after {
  content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-top: -4px;
}
.section-menu[open] > summary { background: #eee5ff; border-color: #cdb8f7; }
.section-menu[open] > summary::after { transform: rotate(225deg); margin-top: 4px; }
.section-menu-links {
  position: absolute; top: calc(100% + 12px); inset-inline-start: 0; z-index: 1;
  width: 250px; max-width: calc(100vw - 40px); padding: 8px;
  background: #fff; border: 1px solid #e9e1f6; border-radius: 18px;
  box-shadow: 0 18px 45px rgba(49,28,87,.18), 0 3px 9px rgba(49,28,87,.06);
}
.section-menu-links a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 48px; padding: 12px 14px; border-radius: 11px;
  color: #35284e; font-size: 15px; font-weight: 700; line-height: 1.4;
  text-decoration: none; overflow-wrap: anywhere;
}
.section-menu-links a + a { margin-top: 3px; }
.section-menu-links a:hover { background: #f4eeff; color: #58309b; }
.section-menu > summary:hover { background: #eee5ff; }
.section-menu > summary:focus-visible, .section-menu-links a:focus-visible {
  outline: 3px solid #7650c6; outline-offset: 3px;
}
@media (max-width: 1199px) {
  .section-menu > summary { width: 100%; justify-content: space-between; }
  .section-menu-links {
    position: static; width: 100%; max-width: 100%; margin-top: 8px;
    background: #fcfaff; box-shadow: none;
  }
}
