/* SPDX-License-Identifier: GPL-2.0-or-later */
.jb-content .jb-toc {
  box-sizing: border-box;
  max-width: 100%;
  margin: 24px 0;
  border: 1px solid #dfe5ec;
  border-radius: 9px;
  background: #f8fafc;
  color: #334155;
  font-size: 14px;
  font-weight: 400;
  font-style: normal;
  line-height: 1.7;
}
.jb-toc summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 18px; border-radius: 8px; cursor: pointer; list-style: none; }
.jb-toc summary::-webkit-details-marker { display: none; }
.jb-toc summary:focus-visible { outline: 2px solid var(--jb-accent, #1976d2); outline-offset: 3px; }
.jb-toc-title { min-width: 0; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.jb-toc-toggle { display: flex; align-items: center; flex-shrink: 0; gap: 10px; color: #64748b; font-size: 12px; }
.jb-toc-toggle::after { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.jb-toc details[open] .jb-toc-toggle::after { transform: rotate(225deg) translate(-2px, -1px); }
.jb-toc-collapse, .jb-toc details[open] .jb-toc-expand { display: none; }
.jb-toc details[open] .jb-toc-collapse { display: inline; }
.jb-toc-body { padding: 12px 18px 16px; border-top: 1px solid #e5eaf0; }
.jb-content .jb-toc ol { margin: 0; padding-inline-start: 0; list-style: none; }
.jb-content .jb-toc ol ol { margin: 3px 0 5px; padding-inline-start: 23px; }
.jb-content .jb-toc li { margin: 2px 0; padding-inline-start: 2px; }
.jb-content .jb-toc a { display: inline-flex; align-items: baseline; gap: 8px; max-width: 100%; padding: 3px 4px; border-radius: 4px; color: #334155; overflow-wrap: anywhere; }
.jb-toc-number { flex-shrink: 0; color: #64748b; font-variant-numeric: tabular-nums; white-space: nowrap; }
.jb-toc-label { min-width: 0; }
.jb-content .jb-toc a:hover { background: var(--jb-accent-soft, #eaf3fc); color: var(--jb-accent-hover, #1565c0); }
.jb-content .jb-toc a:focus-visible { outline: 2px solid var(--jb-accent, #1976d2); outline-offset: 2px; }
/* jb-style.css already reserves 100px through html scroll-padding-top. */
.jb-content .jb-toc-target { scroll-margin-top: max(0px, calc(var(--jb-toc-offset, 116px) - var(--jb-toc-scroll-padding, 100px))); }
@media (max-width: 479px) {
  .jb-toc summary { padding: 14px; gap: 12px; }
  .jb-toc-body { padding: 10px 14px 14px; }
}
