/* Presentation-only additions. The finalized report remains unchanged. */
html { --packet-toc-offset: 156px; }
nav.toc {
  background: #f4f6fa;
  border-block: 1px solid #cbd5e1;
  box-shadow: 0 3px 8px #1118270a;
}
nav.toc div {
  display: flex;
  flex-wrap: wrap;
  overflow: visible;
  gap: 4px 6px;
  padding: 10px 0;
}
nav.toc a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  max-width: 100%;
  padding: 7px 10px;
  border-radius: 4px;
  border-color: transparent;
  background: transparent;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: 0;
}
nav.toc a:hover, nav.toc a[aria-current="location"] {
  background: #e5edf9;
  border-color: #b3c8ea;
  color: #154c9a;
}
nav.toc a:focus-visible, nav.toc summary:focus-visible {
  outline: 3px solid #1f6fe0;
  outline-offset: -3px;
}
.packet-section-target, .wrap > section[id] { scroll-margin-top: var(--packet-toc-offset); }
.packet-section-target:focus { outline: none; }
.packet-section-target:focus-visible { outline: 2px solid #1f6fe0; outline-offset: 3px; }
nav.toc summary {
  display: flex;
  align-items: center;
  min-height: 58px;
  gap: 12px;
  padding: 10px 6px;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}
nav.toc summary::-webkit-details-marker { display: none; }
nav.toc summary::after {
  content: "";
  flex: 0 0 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin: 0 8px 4px 0;
}
nav.toc details[open] summary::after { transform: rotate(225deg); margin-top: 8px; }
.packet-toc-current {
  margin-left: auto;
  max-width: 52%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  color: #4b5563;
}
@media (max-width: 959px) {
  /* Without JavaScript all links remain visible in normal document flow. */
  nav.toc:not([data-reader-ready]) { position: static; }
  nav.toc details > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 50vh;
    max-height: 50dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 4px 6px 12px;
    scrollbar-width: auto;
  }
  nav.toc details > div::-webkit-scrollbar { display: block; width: 8px; }
  nav.toc details > div::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 4px; }
  nav.toc a { min-height: 44px; }
}
@media (max-width: 599px) {
  nav.toc details > div { grid-template-columns: minmax(0, 1fr); }
}
@media print { nav.toc { display: none; } }
