/* Independent navigation: the existing content layout stays unchanged. */
.section-nav {
  bottom: 20px;
  color: var(--muted, #626a7b);
  font: 400 13px/1.5 "Noto Sans", sans-serif;
  left: 16px;
  position: fixed;
  z-index: 25;
}

.section-nav__toggle {
  align-items: center;
  background: var(--paper, #fff);
  border: 1px solid var(--line, #dfe4ef);
  border-radius: 24px;
  box-shadow: 0 4px 20px #20243114;
  color: var(--blue-deep, #40577f);
  cursor: pointer;
  display: flex;
  gap: 10px;
  list-style: none;
  min-height: 44px;
  padding: 10px 18px;
  user-select: none;
}

.section-nav__toggle::-webkit-details-marker { display: none; }
.section-nav__disclosure[open] .section-nav__toggle { background: var(--blue-soft, #e9eef8); }

.section-nav__panel {
  background: var(--paper, #fff);
  border: 1px solid var(--line, #dfe4ef);
  border-radius: 12px;
  box-sizing: border-box;
  bottom: 56px;
  box-shadow: 0 12px 40px #2024311a;
  max-height: calc(100dvh - 120px);
  max-width: calc(100vw - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 12px 12px;
  position: absolute;
  width: 268px;
}

.section-nav__caption {
  color: var(--muted, #626a7b);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.6px;
  margin: 0 0 12px 12px;
}

.section-nav__list { list-style: none; margin: 0; padding: 0; }
.section-nav__list a {
  align-items: baseline;
  border-left: 2px solid transparent;
  color: var(--muted, #626a7b);
  display: flex;
  gap: 12px;
  min-height: 44px;
  padding: 10px 10px;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease;
}

.section-nav__list a > span:first-child {
  color: #929aaa;
  flex: 0 0 20px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.section-nav__list a:hover { background: var(--wash, #f5f7fb); color: var(--blue-deep, #40577f); }
.section-nav__list a[aria-current="location"] {
  background: var(--blue-soft, #e9eef8);
  border-left-color: var(--blue, #586f9c);
  color: var(--blue-deep, #40577f);
  font-weight: 600;
}
.section-nav__list a[aria-current="location"] > span:first-child { color: var(--blue, #586f9c); }
.section-nav a:focus-visible, .section-nav__toggle:focus-visible { outline: 2px solid var(--blue, #586f9c); outline-offset: 2px; }
.section-nav__top {
  border-top: 1px solid var(--line, #dfe4ef);
  color: var(--muted, #626a7b);
  display: block;
  margin: 12px 12px 0;
  padding: 14px 0 4px;
  text-decoration: none;
}

/* Reserve space for the widest content (the 1280px interactive demo),
   the 184px rail, a 32px gap, outer margins and the browser scrollbar. */
@media (min-width: 1760px) {
  .section-nav {
    bottom: auto;
    left: max(16px, calc((100% - 1280px) / 2 - 216px));
    top: 120px;
    width: 184px;
  }
  .section-nav__toggle { display: none; }
  .section-nav__panel {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    max-height: calc(100dvh - 152px);
    padding: 0 4px 4px 0;
    position: static;
    width: 100%;
  }
  .section-nav__list a { min-height: 0; padding: 9px 8px; }
  .section-nav.is-before-content { opacity: 0; pointer-events: none; visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .section-nav__list a { transition: none; }
}
@media print { .section-nav { display: none; } }
