/* In-article navigation: sticky side panel (>=1081px) + floating button/sheet (<=1080px). fj tokens only. */
.fj-toc { max-height: calc(100vh - var(--header-h) - 56px); overflow-y: auto; overscroll-behavior: contain; align-content: start; }
.fj-toc ol, .fj-toc-sheet ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.fj-toc a { display: block; padding: 6px 10px; margin-inline-start: -10px; border-inline-start: 3px solid transparent; font-size: var(--text-sm); line-height: 1.45; color: var(--ink-soft); text-decoration: none; }
.fj-toc a:hover { color: var(--live); }
.fj-toc a.active, .fj-toc a[aria-current="location"] { color: var(--live); font-weight: 800; border-inline-start-color: var(--live); background: color-mix(in srgb, var(--live) 7%, transparent); }
.fj-toc a:focus-visible, .fj-toc-sheet a:focus-visible, .fj-toc-btn:focus-visible, .fj-toc-close:focus-visible { outline: 3px solid var(--live); outline-offset: 2px; }

.fj-toc-float { display: none; }
@media (max-width: 1080px) {
  .fj-toc { display: none; }
  .fj-toc-float:not([hidden]) { display: block; position: fixed; z-index: 1100; inset-inline-start: 12px; bottom: 12px; direction: rtl; }
  .fj-toc-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 16px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink); font: inherit; font-weight: 800; font-size: .95rem; box-shadow: 0 2px 12px #0002; cursor: pointer; }
  .fj-toc-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
  .fj-toc-btn[aria-expanded="true"] { background: var(--ink); color: var(--paper); }
  .fj-toc-sheet { position: absolute; inset-inline-start: 0; bottom: calc(100% + 10px); width: min(340px, calc(100vw - 24px)); max-height: min(62vh, 480px); overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 16px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 0 8px 30px #0003; }
  .fj-toc-sheet[hidden] { display: none; }
  .fj-toc-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 1rem; }
  .fj-toc-close { min-width: 44px; min-height: 44px; border: 1px solid var(--ink); border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: 1.4rem; line-height: 1; cursor: pointer; }
  .fj-toc-sheet a { display: flex; align-items: center; justify-content: flex-start; text-align: start; min-height: 44px; padding: 8px 10px; border-inline-start: 3px solid transparent; color: var(--ink); text-decoration: none; font-size: .95rem; line-height: 1.4; }
  .fj-toc-sheet a[aria-current="location"] { font-weight: 800; color: var(--live); border-inline-start-color: var(--live); background: color-mix(in srgb, var(--live) 8%, transparent); }
}
@media (min-width: 1081px) { .fj-toc-float { display: none !important; } }
@media print { .fj-toc, .fj-toc-float { display: none !important; } }
