/* 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: 50%;
  bottom: max(18px, env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 20px;
  width: min(800px, calc(100% - 48px));
  height: 52px;
  padding: 0 10px 0 20px;
  padding-inline: 20px 10px;
  border: 1px solid var(--bn-hairline);
  border-radius: 999px;
  background: rgba(var(--bgrgb), .92);
  color: var(--ink);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 2px 5px rgba(0, 0, 0, .06), 0 16px 48px rgba(0, 0, 0, .12);
  transform: translate(-50%, 12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
}
.bn-chapter-bar.is-visible { transform: translate(-50%, 0); opacity: 1; visibility: visible; pointer-events: auto; }
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; }
.bn-current { display: flex; align-items: center; gap: 9px; flex: 1 1 250px; min-width: 0; }
.bn-chapter-number { color: var(--bn-text-accent); font-size: 12px; font-variant-numeric: tabular-nums; }
.bn-separator { color: var(--dim); }
.bn-caption { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.bn-chapter-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 500; line-height: 1.7; }
.bn-client-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; color: var(--dim); line-height: 1.6; }
.bn-client-name:empty { display: none; }
.bn-ticks { display: flex; flex: 0 1 216px; align-items: center; min-width: 120px; height: 44px; }
.bn-tick {
  appearance: none;
  position: relative;
  flex: 1;
  height: 44px;
  min-width: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.bn-tick::before { content: ''; position: absolute; top: 20px; inset-inline: 2px; height: 3px; border-radius: 2px; background: rgba(var(--inkrgb), .22); transition: background 160ms ease; }
.bn-tick[aria-current]::before { background: rgb(var(--acR, 0), var(--acG, 204), var(--acB, 180)); }
.bn-tick:hover::before { background: var(--bn-text-accent); }
.bn-tick-tip { display: none; position: absolute; bottom: calc(100% + 8px); inset-inline-start: 50%; translate: -50% 0; width: max-content; max-width: 220px; padding: 8px 12px; border: 1px solid var(--bn-hairline); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; font-size: 11px; line-height: 1.7; pointer-events: none; }
[dir="rtl"] .bn-tick-tip { translate: 50% 0; }
.bn-tick:hover .bn-tick-tip, .bn-tick:focus-visible .bn-tick-tip { display: block; }
.bn-step-controls { display: flex; flex: 0 0 auto; gap: 1px; padding-inline-start: 10px; border-inline-start: 1px solid var(--bn-hairline); }
.bn-step { appearance: none; min-height: 44px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; font: inherit; font-size: 12px; color: var(--ink); cursor: pointer; white-space: nowrap; }
.bn-step:hover:not(:disabled) { color: var(--bn-text-accent); background: var(--bn-softline); }
.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; }
html[data-theme="light"] .bn-chapter-bar { background: rgba(var(--bgrgb), .96); box-shadow: 0 1px 2px rgba(16, 40, 34, .05), 0 12px 40px rgba(16, 40, 34, .12); }
@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; }
  .bn-chapter-bar { gap: 12px; width: calc(100% - 32px); }
  .bn-ticks { flex-basis: 144px; }
  .bn-step { padding-inline: 9px; }
}
@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); }
  .bn-chapter-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 24px 24px; height: 48px; width: calc(100% - 24px); bottom: max(12px, env(safe-area-inset-bottom, 0px)); gap: 0; padding: 0 8px; border: 0; }
  .bn-chapter-bar::after { content: ''; position: absolute; inset: 0; border: 1px solid var(--bn-hairline); border-radius: inherit; pointer-events: none; }
  .bn-current { grid-area: 1 / 1; gap: 6px; padding-inline-start: 6px; }
  .bn-chapter-name { font-size: 11px; }
  .bn-chapter-number { font-size: 11px; }
  /* Two 24px rows: caption/controls, then full-width clickable chapter ticks. */
  .bn-caption { padding: 0; }
  .bn-client-name { display: none; }
  .bn-ticks { grid-area: 2 / 1 / 3 / 3; height: 24px; min-width: 0; margin-inline: -6px; }
  .bn-tick { height: 24px; min-width: 0; }
  .bn-tick::before { top: 10px; height: 2px; inset-inline: 3px; }
  .bn-step-controls { grid-area: 1 / 2; height: 24px; gap: 0; padding-inline-start: 6px; }
  .bn-step { min-height: 24px; font-size: 11px; padding-inline: 9px; }
  .bn-tick-tip { max-width: 160px; }
  .bn-tick:nth-child(-n+4) .bn-tick-tip { inset-inline-start: 0; translate: none; }
  .bn-tick:nth-last-child(-n+4) .bn-tick-tip { inset-inline-start: auto; inset-inline-end: 0; translate: none; }
}
@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; }}
