body {
  padding-bottom: 20px;
}

.navbar {
  margin-bottom: 20px;
}

.genealogy-sidebar {
  position: sticky;
  top: 1rem;
  margin: 0 0 1.5rem;
  padding: 1.25rem .8rem;
  overflow: hidden;
  color: #23324d;
  background: linear-gradient(155deg, #ffffff 0%, #f5f8ff 100%);
  border: 1px solid #e3eaf5;
  border-radius: 1rem;
  box-shadow: 0 12px 30px rgba(35, 58, 99, .09);
}

.genealogy-sidebar__heading {
  padding: .25rem .65rem 1rem;
  border-bottom: 1px solid #e8edf5;
}

.genealogy-sidebar__eyebrow,
.genealogy-sidebar__label {
  display: block;
  color: #73829b;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .11em;
  line-height: 1.4;
  text-transform: uppercase;
}

.genealogy-sidebar__heading h2 {
  margin: .25rem 0 .2rem;
  color: #203c70;
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: -.035em;
}

.genealogy-sidebar__heading p {
  margin: 0;
  color: #74829a;
  font-size: .78rem;
  line-height: 1.45;
}

.genealogy-sidebar__section {
  padding: .95rem .15rem .15rem;
}

.genealogy-sidebar__label {
  padding: 0 .55rem .45rem;
  font-size: .61rem;
}

.genealogy-sidebar__link {
  display: flex;
  min-height: 2.45rem;
  align-items: center;
  gap: .65rem;
  margin: .12rem 0;
  padding: .45rem .55rem;
  color: #42516a;
  border-radius: .65rem;
  font-size: .82rem;
  font-weight: 550;
  line-height: 1.25;
  text-decoration: none;
  transition: color .16s ease, background-color .16s ease, transform .16s ease;
}

.genealogy-sidebar__link:hover,
.genealogy-sidebar__link:focus {
  color: #174ea6;
  background-color: #eaf1ff;
  text-decoration: none;
  transform: translateX(2px);
}

.genealogy-sidebar__icon {
  display: inline-flex;
  width: 1.7rem;
  height: 1.7rem;
  flex: 0 0 1.7rem;
  align-items: center;
  justify-content: center;
  color: #5475b7;
  background-color: #edf2fb;
  border-radius: .55rem;
  font-size: 1rem;
  font-weight: 700;
}

.genealogy-sidebar__link:hover .genealogy-sidebar__icon,
.genealogy-sidebar__link:focus .genealogy-sidebar__icon {
  color: #fff;
  background-color: #4773c4;
}

.genealogy-sidebar__link.is-disabled {
  color: #9aa5b6;
  cursor: not-allowed;
}

.genealogy-sidebar__link.is-disabled:hover {
  background: transparent;
  transform: none;
}

.genealogy-sidebar__badge {
  margin-left: auto;
  padding: .16rem .38rem;
  color: #75839a;
  background: #edf0f5;
  border-radius: 999px;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* "Account" as a collapsible menu item (Change Password / 2FA as
   hidden-by-default sub items) — native <details>/<summary>, no JS
   needed. Logout/Login stay as a plain sibling link, not nested here. */
.genealogy-sidebar__submenu {
  margin: 0;
}

.genealogy-sidebar__submenu > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 .55rem .45rem;
  color: #73829b;
  font-size: .61rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.genealogy-sidebar__submenu > summary::-webkit-details-marker {
  display: none;
}

.genealogy-sidebar__submenu > summary::after {
  content: "▸";
  font-size: .7rem;
  color: #8fa0bd;
  transition: transform .16s ease;
}

.genealogy-sidebar__submenu[open] > summary::after {
  transform: rotate(90deg);
}

.genealogy-sidebar__submenu > summary:hover {
  color: #174ea6;
}

.genealogy-sidebar__submenu .genealogy-sidebar__link {
  margin-left: .35rem;
}

@media (max-width: 575.98px) {
  .genealogy-sidebar {
    position: static;
    padding: 1rem .8rem;
  }
}

/* Mobile nav drawer — hidden behind a hamburger button instead of
   rendering inline above the page content, which on a phone pushed
   every page's actual content a full screen's height down before you
   even got to it. Collapsing .genealogy-sidebar to position: fixed
   here removes it from the page's normal flow entirely, so its parent
   <aside> (see _sidebar.html's callers) naturally collapses to zero
   height — no per-template markup changes needed for that part. */
.genealogy-menu-toggle {
  display: none;
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 1050;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  background: #203c70;
  border: none;
  border-radius: .65rem;
  box-shadow: 0 6px 16px rgba(32, 60, 112, .3);
  cursor: pointer;
}

.genealogy-menu-toggle__bar {
  width: 1.3rem;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}

.genealogy-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(20, 30, 50, .45);
}

.genealogy-sidebar-backdrop--visible {
  display: block;
}

@media (max-width: 767.98px) {
  .genealogy-menu-toggle {
    display: flex;
  }

  /* Every page's content is wrapped in this one div by _base.html, so
     this clears the now-fixed toggle button regardless of which
     page-specific wrapper class/padding a given template also uses on
     top of it (several don't use .genealogy-page-shell at all). */
  .genealogy-mobile-content-offset {
    padding-top: 3.5rem;
  }

  .genealogy-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1045;
    width: 82vw;
    max-width: 320px;
    margin: 0;
    overflow-y: auto;
    border-radius: 0;
    transform: translateX(-100%);
    transition: transform .22s ease;
  }

  .genealogy-sidebar--open {
    transform: translateX(0);
  }
}
