/* Native disclosures keep both tool links usable without JavaScript. */
#mainNav .nav-tools {
  position: relative;
  display: inline-flex;
  align-items: center;
}

#mainNav .nav-tools > summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  list-style: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 450;
  line-height: inherit;
  color: var(--muted, #5e5e67);
  padding: 10px 0;
  text-decoration: none;
  transition: color .2s ease;
}

.nav-tools > summary::-webkit-details-marker { display: none; }
.nav-tools > summary::marker { content: ''; }

.nav-tools > summary > svg {
  width: 12px;
  height: 12px;
  opacity: .7;
  transition: transform .2s ease, opacity .2s ease, color .2s ease;
}

.nav-tools[open] > summary > svg {
  transform: rotate(180deg);
  opacity: 1;
}

#mainNav .nav-tools > summary:hover,
#mainNav .nav-tools[open] > summary {
  color: var(--text, #222222);
}

#mainNav .nav-tools.is-current > summary {
  color: var(--text, #222222);
  font-weight: 600;
}

@media (max-width: 1100px) {
  #mainNav .nav-tools > summary { font-size: 15px; }
}

@media (min-width: 851px) and (max-width: 1080px) {
  body #mainNav .nav-links { gap: 17px; }
  body #mainNav { gap: 20px; }
}

/* Desktop dropdown */
.nav-tool-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

#mainNav .nav-tool-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: 344px;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid #e5e5ea;
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 12px 38px #23232b16;
  z-index: 100;
}

body #mainNav .nav-tool-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 0;
  border-radius: 9px;
  text-decoration: none;
  color: #26262c;
  transition: background .2s ease, color .2s ease;
}

body #mainNav .nav-tool-list a::after { display: none; }

body #mainNav .nav-tool-list a:hover,
body #mainNav .nav-tool-list a[aria-current="page"] {
  background: #edd0df;
}

body #mainNav .nav-tool-list a:hover .nav-tool-icon,
body #mainNav .nav-tool-list a[aria-current="page"] .nav-tool-icon {
  background: #933564;
  color: #ffffff;
}

body #mainNav .nav-tool-list a:hover strong,
body #mainNav .nav-tool-list a[aria-current="page"] strong {
  color: #77254f;
}

.nav-tool-icon {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #f3f2f5;
  color: #933564;
  transition: background .2s ease, color .2s ease;
}

.nav-tool-icon svg { width: 19px; height: 19px; }

.nav-tool-list strong {
  display: block;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 550;
}

.nav-tool-list small {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.5;
  color: #676770;
}

.nav-tools summary:focus-visible,
.nav-tool-list a:focus-visible {
  outline: 2px solid #933564;
  outline-offset: 4px;
}

/* Mobile drawer integration */
#mobileMenu .nav-tools {
  width: 100%;
  border-bottom: 1px solid #dddde0;
  display: block;
}

#mobileMenu .nav-tools > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 56px;
  padding: 12px 4px;
  font-family: inherit;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 400;
  color: #383838;
  cursor: pointer;
  list-style: none;
  transition: color .2s ease;
}

#mobileMenu .nav-tools > summary > svg {
  width: 16px;
  height: 16px;
  color: #88888e;
  flex-shrink: 0;
  transition: transform .2s ease;
}

#mobileMenu .nav-tools[open] > summary > svg {
  transform: rotate(180deg);
}

#mobileMenu .nav-tools > summary:hover,
#mobileMenu .nav-tools > summary:focus-visible {
  color: #212121;
}

#mobileMenu .nav-tools.is-current > summary {
  color: #7050c8;
  font-weight: 650;
}

#mobileMenu .nav-tool-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  margin: 6px 0 16px;
  padding: 0 0 0 6px;
}

#mobileMenu .nav-tool-list li {
  margin: 0;
  padding: 0;
}

body #mobileMenu .nav-tool-list a {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-height: auto !important;
  height: auto !important;
  padding: 10px 12px !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
  border: 0 !important;
  border-bottom: 0 !important;
  border-radius: 12px !important;
  background: #f5f4f7 !important;
  text-decoration: none !important;
  color: #26262c !important;
  transition: background .2s ease, color .2s ease !important;
}

body #mobileMenu .nav-tool-list a:hover,
body #mobileMenu .nav-tool-list a[aria-current="page"] {
  background: #edd0df !important;
}

body #mobileMenu .nav-tool-list a strong {
  display: block;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  color: #222222 !important;
}

body #mobileMenu .nav-tool-list a small {
  display: block;
  margin-top: 2px;
  font-size: 12px !important;
  line-height: 1.35 !important;
  color: #676770 !important;
}

body #mobileMenu .nav-tool-list a:hover strong,
body #mobileMenu .nav-tool-list a[aria-current="page"] strong {
  color: #77254f !important;
}

body #mobileMenu .nav-tool-list a:hover .nav-tool-icon,
body #mobileMenu .nav-tool-list a[aria-current="page"] .nav-tool-icon {
  background: #933564 !important;
  color: #ffffff !important;
}

@media (prefers-reduced-motion: reduce) {
  .nav-tools > summary > svg { transition: none; }
}
