/* Two presentations of one <nav class="rtoc">, picked by the slot it sits in:
     - .rtoc-slot--rail: absolutely positioned in the article's left gutter,
       spanning the article's height, with a sticky card inside.
     - .rtoc-slot--bar: appended to <body>; a trigger fixed to the bottom of the
       viewport that opens the list as a full-screen menu.
     The JS picks the slot from the measured gutter, so there are no viewport
     media queries here. */
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot {
    --rtoc-ink: #0f1111;
    --rtoc-muted: #565959;
    --rtoc-line: #e3e6e6;
    --rtoc-accent: #ff6200;
    --rtoc-accent-soft: rgba(255, 98, 0, .1);
    --rtoc-hover: #f5f6f6;
    --rtoc-head: var(--color-bg-subtle, #f7f7f7);
    --rtoc-top: 104px;
    font-family: inherit;
    color: var(--rtoc-ink);
  }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot *, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot *::before, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot *::after { box-sizing: border-box; }

  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc {
    background: #ffffff;
    border: 1px solid var(--rtoc-line);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
  }

  /* ---- Rail ---- */
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--rail { position: absolute; z-index: 1; pointer-events: none; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--rail .rtoc {
    pointer-events: auto;
    position: sticky;
    top: var(--rtoc-top);
    display: flex;
    flex-direction: column;
    /* 96px keeps the card clear of the back-to-top button */
    max-height: calc(100vh - var(--rtoc-top) - 96px);
  }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--rail .rtoc__bar, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--rail .rtoc__close { display: none; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--rail .rtoc__panel { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--rail .rtoc[data-collapsed="true"] .rtoc__panel { display: none; }

  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__header {
    flex: 0 0 auto;
    display: flex; align-items: center; gap: 8px;
    padding: 10px 8px 10px 16px;
    background: var(--rtoc-head);
    border-bottom: 1px solid var(--rtoc-line);
    border-radius: 11px 11px 0 0;
  }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--rail .rtoc[data-collapsed="true"] .rtoc__header { border-bottom: 0; border-radius: 11px; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__title {
    margin: 0; font-size: .75rem; font-weight: 700; line-height: 1.2;
    letter-spacing: .06em; text-transform: uppercase; color: var(--rtoc-muted);
  }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__toggle, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__close {
    appearance: none; margin: 0 0 0 auto; padding: 0; border: 0; border-radius: 6px;
    width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
    background: transparent; color: var(--rtoc-muted); cursor: pointer;
  }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__toggle:hover, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__close:hover { color: var(--rtoc-ink); background: rgba(0, 0, 0, .06); }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__caret, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__tri, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__chevron {
    display: block; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg); transition: transform .18s ease;
  }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__caret { width: 9px; height: 9px; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc[data-collapsed="true"] .rtoc__caret { transform: translateY(2px) rotate(-135deg); }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__x { position: relative; display: block; width: 16px; height: 16px; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__x::before, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__x::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 2px; margin: -1px 0 0 -9px;
    border-radius: 1px; background: currentColor; transform: rotate(45deg);
  }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__x::after { transform: rotate(-45deg); }

  /* ---- Bar: bottom trigger + full-screen menu ---- */
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: 0; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--bar[data-open="true"] { top: 0; height: auto; z-index: 10000; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--bar .rtoc {
    position: fixed; left: 0; right: 0; bottom: 0;
    border-width: 1px 0 0; border-radius: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
    transition: transform .2s ease, opacity .2s ease, visibility 0s linear 0s;
  }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--bar .rtoc[data-hidden="true"] {
    transform: translateY(calc(100% + 16px)); opacity: 0; visibility: hidden;
    transition: transform .2s ease, opacity .2s ease, visibility 0s linear .2s;
  }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--bar .rtoc__header, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--bar .rtoc__toggle, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--bar .rtoc__panel { display: none; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--bar .rtoc[data-open="true"] {
    inset: 0; max-width: none; margin: 0; border: 0; border-radius: 0; box-shadow: none;
    display: flex; flex-direction: column; transform: none; opacity: 1; visibility: visible; transition: none;
  }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--bar .rtoc[data-open="true"] .rtoc__bar { display: none; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--bar .rtoc[data-open="true"] .rtoc__header {
    display: flex; min-height: 56px; border-radius: 0;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px 20px;
  }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--bar .rtoc[data-open="true"] .rtoc__title { font-size: .8rem; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--bar .rtoc__close { width: 44px; height: 44px; color: var(--rtoc-ink); }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--bar .rtoc__x { width: 20px; height: 20px; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--bar .rtoc__x::before, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--bar .rtoc__x::after { width: 22px; margin-left: -11px; }
  /* Whatever the viewport, the list fills the whole menu. */
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--bar .rtoc[data-open="true"] .rtoc__panel {
    display: block; flex: 1 1 auto; min-height: 0; width: 100%; max-width: none;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 12px 0 calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--bar .rtoc__bar { border-radius: 0; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--bar .rtoc__link { padding-top: 10px; padding-bottom: 10px; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--bar .rtoc__item--h3 .rtoc__link { padding-top: 8px; padding-bottom: 8px; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--bar .rtoc__dot { top: calc(11px + .675em - 5px); }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--bar .rtoc__item--h3 > .rtoc__row > .rtoc__dot { top: calc(9px + .675em - 3px); }

  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__bar {
    appearance: none; position: relative; overflow: hidden;
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; margin: 0;
    padding: 9px 16px; border: 0; border-radius: 11px;
    background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
  }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__bar-icon {
    flex: 0 0 auto; width: 16px; height: 2px; background: var(--rtoc-accent);
    box-shadow: 0 -5px 0 var(--rtoc-accent), 0 5px 0 var(--rtoc-accent);
  }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__bar-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__eyebrow {
    font-size: .7rem; font-weight: 700; line-height: 1.2;
    letter-spacing: .06em; text-transform: uppercase; color: var(--rtoc-muted);
  }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__current {
    font-size: .95rem; font-weight: 700; line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__chevron { flex: 0 0 auto; width: 9px; height: 9px; color: var(--rtoc-muted); transform: translateY(2px) rotate(-135deg); }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__progress {
    position: absolute; left: 0; bottom: 0; width: 100%; height: 3px;
    background: var(--rtoc-accent); transform-origin: 0 50%;
    transform: scaleX(var(--rtoc-progress, 0)); transition: transform .15s linear;
  }

  /* ---- List + progress track ---- */
  /* isolation keeps the z-index of the track local: the line and its nodes sit
     above the link hover/active backgrounds without escaping the card. */
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__panel { position: relative; isolation: isolate; padding: 8px 0 10px; overscroll-behavior: contain; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__track, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__fill { position: absolute; z-index: 1; pointer-events: none; left: 22px; top: 0; width: 2px; border-radius: 2px; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__track { background: var(--rtoc-line); }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__fill { background: var(--rtoc-accent); height: 0; transition: height .2s ease; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__list, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__sublist { list-style: none; margin: 0; padding: 0; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__row { position: relative; display: flex; font-size: .9rem; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__item--h3 > .rtoc__row { font-size: .84rem; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__link {
    flex: 1 1 auto; min-width: 0; display: block; margin: 1px 6px;
    padding: 7px 12px 7px 34px; border-radius: 6px;
    color: var(--rtoc-ink); font-weight: 600; line-height: 1.35; text-decoration: none;
  }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__item--h3 .rtoc__link { padding: 5px 12px 5px 44px; font-weight: 400; color: var(--rtoc-muted); }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__item--h2[data-has-children="true"] > .rtoc__row > .rtoc__link { padding-right: 40px; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__link:hover { background: var(--rtoc-hover); color: var(--rtoc-ink); }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__link[aria-current="location"] { background: var(--rtoc-accent-soft); color: var(--rtoc-ink); font-weight: 700; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__item--h3 .rtoc__link[aria-current="location"] { font-weight: 600; }

  /* One node per entry on the track: hollow ring for H2, small dot for H3. */
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__dot {
    position: absolute; z-index: 2; pointer-events: none;
    left: 18px; top: calc(8px + .675em - 5px); width: 10px; height: 10px;
    border-radius: 50%; background: #ffffff; border: 2px solid #c8cccc;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
  }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__item--h3 > .rtoc__row > .rtoc__dot { left: 20px; top: calc(6px + .675em - 3px); width: 6px; height: 6px; border: 0; background: #c8cccc; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__item.is-passed > .rtoc__row > .rtoc__dot { border-color: var(--rtoc-accent); background: var(--rtoc-accent); }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__item.is-active > .rtoc__row > .rtoc__dot { box-shadow: 0 0 0 4px rgba(255, 98, 0, .18); }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__item--h2.is-active > .rtoc__row > .rtoc__dot { background: #ffffff; }

  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__disclosure {
    appearance: none; position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px; margin: 0; padding: 0; border: 0; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; color: var(--rtoc-muted); cursor: pointer; z-index: 3;
  }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__disclosure:hover { color: var(--rtoc-ink); background: rgba(0, 0, 0, .05); }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__tri { width: 7px; height: 7px; }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__item[data-expanded="false"] > .rtoc__row .rtoc__tri { transform: rotate(-45deg); }
  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__item[data-expanded="false"] > .rtoc__sublist { display: none; }

  .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__bar:focus-visible, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__toggle:focus-visible, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__close:focus-visible, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__disclosure:focus-visible, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__link:focus-visible {
    outline: 2px solid var(--rtoc-accent); outline-offset: -2px;
  }

  @media (prefers-reduced-motion: reduce) {
    .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__caret, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__tri, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__chevron, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__progress, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__fill, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc__dot, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--bar .rtoc, .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot--bar .rtoc[data-hidden="true"] { transition: none; }
  }
  @media print {
    .inset-Gnnnjw5UVmfQRjsXKcLib .rtoc-slot { display: none; }
  }
