/* Complementary navigation. All styles are scoped to injected markup. */
html.bn-navs {
  --bn-text-accent: #00f5e0;
  --bn-hairline: rgba(var(--inkrgb), .13);
  --bn-softline: rgba(var(--inkrgb), .06);
}
html.menu-open { overflow: hidden; }
html.bn-navs body { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
.bn-flow-anchor { display: block; height: 0; margin: 0; padding: 0; scroll-margin-top: 72px; pointer-events: none; }
.bn-navs section[id] { scroll-margin-top: 72px; }
.bn-menu-toggle, .bn-sheet, .bn-chapter-bar { box-sizing: border-box; }
.bn-sheet *, .bn-chapter-bar * { box-sizing: border-box; }
.bn-menu-toggle {
  appearance: none;
  flex: 0 0 44px;
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bn-menu-toggle span {
  position: absolute;
  inset-inline-start: 10px;
  top: 21px;
  width: 24px;
  height: 1px;
  background: currentColor;
  transition: transform 240ms ease, opacity 160ms ease, width 240ms ease;
}
.bn-menu-toggle span:nth-child(1) { transform: translateY(-7px); }
.bn-menu-toggle span:nth-child(3) { transform: translateY(7px); width: 17px; }
.bn-menu-toggle:hover { color: var(--bn-text-accent); }
.bn-menu-toggle:hover span:nth-child(3) { width: 24px; }
.bn-menu-toggle[aria-expanded="true"] span:nth-child(1), .bn-menu-close span:nth-child(1) { transform: rotate(45deg); }
.bn-menu-toggle[aria-expanded="true"] span:nth-child(2), .bn-menu-close span:nth-child(2) { opacity: 0; }
.bn-menu-toggle[aria-expanded="true"] span:nth-child(3), .bn-menu-close span:nth-child(3) { transform: rotate(-45deg); width: 24px; }
.bn-sheet [hidden], .bn-sheet[hidden] { display: none !important; }
.bn-sheet {
  position: fixed;
  inset: 0;
  z-index: 590;
  height: 100%;
  height: 100dvh;
  overflow: auto;
  overscroll-behavior: contain;
  background: rgb(var(--bgrgb));
  color: var(--ink);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  clip-path: inset(0 0 100% 0);
  transition: clip-path 300ms cubic-bezier(.22, 1, .36, 1);
  scrollbar-width: thin;
  scrollbar-color: var(--bn-hairline) transparent;
}
.bn-sheet.is-open { clip-path: inset(0); }
.bn-sheet-inner {
  max-width: 1520px;
  margin-inline: auto;
  padding: max(22px, env(safe-area-inset-top, 0px)) max(5vw, env(safe-area-inset-right, 0px)) max(48px, env(safe-area-inset-bottom, 0px)) max(5vw, env(safe-area-inset-left, 0px));
}
.bn-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block-end: 20px;
  border-bottom: 1px solid var(--bn-hairline);
}
.bn-sheet-title { margin: 0; font: inherit; font-size: 16px; font-weight: 500; }
.bn-directory { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, .36fr); gap: clamp(32px, 6vw, 100px); padding-block-start: 34px; }
.bn-group-title { margin: 0 0 20px; color: var(--dim); font-size: 12px; line-height: 1.7; font-weight: 500; }
.bn-section-list { list-style: none; padding: 0; margin: 0; }
.bn-entry { border-top: 1px solid var(--bn-softline); opacity: 0; transform: translateY(10px); }
.bn-entry:last-child { border-bottom: 1px solid var(--bn-softline); }
.bn-sheet.is-open .bn-entry { opacity: 1; transform: none; transition: opacity 280ms ease, transform 280ms cubic-bezier(.22, 1, .36, 1); transition-delay: calc(40ms + var(--bn-order, 0) * 22ms); }
.bn-section-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  column-gap: 20px;
  min-height: 82px;
  padding: 15px 8px;
  color: var(--ink);
  text-decoration: none;
  border-inline-start: 2px solid transparent;
  transition: background 180ms ease, border-color 180ms ease;
}
.bn-row-number { align-self: start; padding-block-start: 3px; color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.bn-row-copy { min-width: 0; display: grid; gap: 3px; }
.bn-row-eye, .bn-row-heading { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn-row-eye { font-size: clamp(16px, 1.65vw, 23px); font-weight: 500; line-height: 1.6; }
.bn-row-heading { font-size: 12px; line-height: 1.8; color: var(--dim); }
.bn-section-row:hover { background: var(--bn-softline); }
.bn-section-row[aria-current] { border-inline-start-color: var(--bn-text-accent); background: var(--bn-softline); }
.bn-section-row[aria-current] .bn-row-eye, .bn-section-row[aria-current] .bn-row-number { color: var(--bn-text-accent); }
.bn-quick { align-self: start; position: sticky; top: 30px; }
.bn-quick-list { display: flex; flex-direction: column; align-items: stretch; }
.bn-quick-link {
  appearance: none;
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid var(--bn-softline);
  border-radius: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  line-height: 1.7;
  text-align: start;
  text-decoration: none;
  overflow-wrap: anywhere;
  color: var(--ink);
  cursor: pointer;
}
.bn-quick-link:hover { color: var(--bn-text-accent); }
.bn-languages { display: flex; flex-wrap: wrap; gap: 22px; padding-block: 24px; font-size: 13px; }
.bn-languages a { min-height: 44px; display: inline-flex; align-items: center; color: var(--dim); text-decoration: none; }
.bn-languages a.on, .bn-languages a:hover { color: var(--bn-text-accent); }
.bn-chapter-bar {
  position: fixed; z-index: 119;
  left: max(0px, env(safe-area-inset-left, 0px));
  top: 50%; bottom: auto;
  height: max(0px, min(76svh, calc(100svh - 184px)));
  transform: translateY(-50%);
  width: 44px; display: flex; flex-direction: column;
  padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms;
}
.bn-chapter-bar.is-visible { opacity: 1; visibility: visible; pointer-events: none; transition: opacity 180ms ease; }
html.menu-open .bn-chapter-bar, html.svc-open .bn-chapter-bar, html.st-full .bn-chapter-bar { opacity: 0; visibility: hidden; pointer-events: none; transition: none; }
/* The browser-style rail replaces the native visual scrollbar, never page scrolling. */
html.bn-navs:not(.bn-scroll-ready) { scrollbar-width: auto; }
html.bn-navs:not(.bn-scroll-ready)::-webkit-scrollbar { display: block; width: 6px; height: 6px; }
html.bn-scroll-ready { scrollbar-width: none; }
html.bn-scroll-ready::-webkit-scrollbar, html.bn-scroll-ready body::-webkit-scrollbar { width: 0; height: 0; }
.bn-current { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.bn-scroll-rail { position: relative; flex: 1 1 auto; min-height: 44px; width: 44px; touch-action: pan-y; pointer-events: none; user-select: none; }
.bn-scroll-rail::before { content: ''; position: absolute; left: 7px; top: 0; bottom: 0; width: 10px; pointer-events: auto; }
.bn-progress-track, .bn-progress-fill { position: absolute; left: 12px; top: 22px; bottom: 22px; width: 1px; background: var(--bn-hairline); pointer-events: none; }
.bn-progress-fill { background: var(--bn-text-accent); transform: scaleY(0); transform-origin: center top; }
.bn-progress-menu { appearance: none; position: absolute; left: 0; top: 0; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--bn-text-accent); cursor: grab; touch-action: none; pointer-events: auto; user-select: none; -webkit-tap-highlight-color: transparent; }
.bn-progress-menu:active { cursor: grabbing; }
.bn-progress-marker { position: absolute; inset: 0; pointer-events: none; }
.bn-progress-marker::before { content: ''; position: absolute; left: 3px; top: 10px; width: 20px; height: 24px; background: rgb(var(--bgrgb)); }
.bn-progress-marker i { position: absolute; left: 5px; top: 21px; width: 16px; height: 1px; background: currentColor; animation: bn-line-drift 2800ms ease-in-out infinite; animation-play-state: paused; }
.bn-progress-marker i:nth-child(1) { top: 15px; animation-delay: -280ms; }
.bn-progress-marker i:nth-child(2) { left: 8px; width: 10px; animation-delay: -760ms; }
.bn-progress-marker i:nth-child(3) { top: 27px; animation-delay: -1240ms; }
.bn-chapter-bar.is-visible .bn-progress-marker i { animation-play-state: running; }
.bn-progress-menu:is(:hover,:focus-visible) .bn-progress-marker { transform: scale(1.08); transform-origin: 12px 22px; }
@keyframes bn-line-drift { 0%,100% { transform: translateX(-1px); } 50% { transform: translateX(1px); } }
html:not(#ui) body .bn-chapter-bar .bn-step-controls { display: flex; flex: 0 0 88px; flex-direction: column; align-items: center; gap: 0; height: 88px; width: 44px; padding: 0; border: 0; }
html:not(#ui) body .bn-chapter-bar .bn-step { position: relative; appearance: none; min-height: 44px; min-width: 44px; width: 44px; padding: 0; border: 0; border-radius: 0; background: transparent; font: inherit; font-size: 11px; color: var(--ink); cursor: pointer; pointer-events: auto; white-space: nowrap; }
.bn-step-label { position: absolute; left: 0; top: 50%; width: 24px; transform: translateY(-50%); text-align: center; pointer-events: none; }
.bn-step:hover:not(:disabled) { color: var(--bn-text-accent); }
.bn-step:disabled { opacity: .38; cursor: default; }
.bn-menu-toggle:focus-visible, .bn-sheet :is(a, button):focus-visible, .bn-chapter-bar button:focus-visible { outline: 2px solid var(--bn-text-accent); outline-offset: 3px; }
html[data-theme="light"].bn-navs { --bn-text-accent: #00705f; }

@media (max-width: 760px) {
  .bn-directory { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .bn-quick { position: static; }
  .bn-quick-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }

}
@media (max-width: 520px) {
  #nav .nright:has(.bn-menu-toggle) { gap: 6px; }
  #nav .bn-menu-toggle { margin-inline: -5px; }
  /* Keep the existing controls usable alongside the new 44px target. */
  #nav:has(.bn-menu-toggle) .brand { font-size: 0; gap: 0; flex: 0 0 30px; }
  #nav .nright:has(.bn-menu-toggle) > .langs { font-size: 10px; gap: 5px; }
  #nav .nright:has(.bn-menu-toggle) > .langs a { padding-inline: 1px; }
  .bn-sheet-inner { padding-inline: max(20px, env(safe-area-inset-left, 0px)) max(20px, env(safe-area-inset-right, 0px)); }
  .bn-directory { padding-block-start: 24px; }
  .bn-section-row { min-height: 84px; column-gap: 14px; padding-block: 16px; }
  .bn-row-eye { font-size: 18px; }
  .bn-row-heading { font-size: 12px; }
  .bn-quick-list { grid-template-columns: minmax(0, 1fr); }

}
@media (prefers-reduced-motion: reduce) {
  :root:not(.full-motion) .bn-sheet, :root:not(.full-motion) .bn-sheet *, :root:not(.full-motion) .bn-menu-toggle, :root:not(.full-motion) .bn-menu-toggle *, :root:not(.full-motion) .bn-chapter-bar, :root:not(.full-motion) .bn-chapter-bar *{ animation: none !important; transition: none !important; }}
