/* Task-centric sidebar navigation. Explicit buttons keep pointer and keyboard
 * behavior identical; authorization and page reachability remain server-owned. */
#nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-content: start;
}

#nav .nav-section {
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  background: rgba(255,255,255,.018);
  overflow: clip;
}

#nav .nav-section > .nav-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 8px 10px;
  cursor: pointer;
  color: rgba(255,255,255,.72);
  font-size: .82rem;
  font-weight: 700;
  user-select: none;
  width: 100%;
  text-align: start;
  background: transparent;
  border: 0;
}

#nav .nav-section > .nav-section-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
#nav .nav-section[data-nav-open="true"] > .nav-section-toggle,
#nav .nav-section-current > .nav-section-toggle { color: #fff; }

#nav .nav-chevron {
  transition: transform .16s ease;
  font-size: .9rem;
  opacity: .7;
}
#nav .nav-section[data-nav-open="true"] .nav-chevron { transform: rotate(180deg); }

#nav .nav-section-pages {
  display: grid;
  gap: 3px;
  padding: 0 6px 7px;
}
#nav .nav-section-pages button {
  width: 100%;
  min-height: 36px;
  text-align: start;
  border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
  #nav .nav-chevron { transition: none; }
}


/* Inline journey navigation: no blocking popup for ordinary menu clicks. */
#nav .nav-journey {
  display: grid;
  grid-template-rows: auto auto;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
  border-radius: 0;
  background: transparent;
  /* The parent #nav is a scrollable grid. Clipping this grid item makes its
   * auto row ignore expanded children, leaving only the group title visible. */
  overflow: visible;
}
#nav .nav-journey.active {
  border-bottom-color: rgba(112,168,255,.40);
}
#nav .nav-journey-toggle {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 7px;
  text-align: start;
  color: #dce7f6;
  background: transparent;
  border: 0;
  border-radius: 0;
}
#nav .nav-journey-toggle:hover,
#nav .nav-journey-toggle:focus-visible {
  background: rgba(112,168,255,.09);
}
#nav .nav-journey-title,
#nav .nav-tool-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}
#nav .nav-journey-title b,
#nav .nav-tool-copy b {
  color: inherit;
  line-height: 1.45;
}
#nav .nav-journey-title small,
#nav .nav-tool-copy small {
  color: rgba(220,231,246,.64);
  font-size: .71rem;
  line-height: 1.45;
  white-space: normal;
}
#nav .nav-journey-title small { display: none; }
#nav .nav-journey.active .nav-journey-title small { display: block; }
#nav .nav-journey-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(220,231,246,.72);
  font-size: .74rem;
  white-space: nowrap;
}
#nav .nav-chevron {
  display: inline-block;
  transition: transform .16s ease;
  font-size: 1rem;
}
#nav .nav-journey[data-nav-open="true"] .nav-chevron { transform: rotate(180deg); }
#nav .nav-journey-pages {
  display: grid;
  gap: 3px;
  padding: 0 0 8px;
}
#nav .nav-journey-pages[hidden] { display: none; }
#nav .nav-tool {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0,1fr);
  align-items: center;
  gap: 8px;
  padding-block: 7px;
  padding-inline: 26px 10px;
  text-align: start;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #c5d2e3;
}
#nav .nav-tool:hover,
#nav .nav-tool:focus-visible {
  color: #fff;
  background: rgba(112,168,255,.10);
}
#nav .nav-tool.active,
#nav .nav-tool[aria-current="page"] {
  color: #fff;
  border-color: transparent;
  background: #1f6398;
  box-shadow: inset 3px 0 0 #8bc4ff;
}
html[dir="rtl"] #nav .nav-tool.active,
html[dir="rtl"] #nav .nav-tool[aria-current="page"] {
  box-shadow: inset -3px 0 0 #8bc4ff;
}
#nav .nav-tool-copy { position: relative; }
#nav .nav-tool-copy small { display: none; }
#nav .nav-tool[aria-current="page"] .nav-tool-copy small { display: block; }
#nav .nav-tool-copy::before {
  content: "";
  position: absolute;
  inset-inline-start: -15px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(220,231,246,.36);
  transform: translateY(-50%);
}
#nav .nav-tool.active .nav-tool-copy::before { background: #d9ecff; }
#nav .nav-journey-toggle:focus-visible,
#nav .nav-tool:focus-visible {
  outline: 2px solid #70a8ff;
  outline-offset: -2px;
}
@media (max-width: 850px) {
  #nav .nav-journey-title small,
  #nav .nav-tool-copy small { display: none; }
  #nav .nav-journey-toggle { min-height: 44px; }
  #nav .nav-tool { padding-inline-start: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  #nav .nav-chevron { transition: none; }
}
