/* "On this page" for the long pages: the list near the top and the bar that
   follows the reader (public/js/kz-toc.js). */
.kz-toc {
  margin: 28px 0 8px; padding: 18px 22px 16px;
  border: 1px solid rgba(216, 163, 94, 0.2); border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
}
.kz-toc-title {
  margin: 0 0 10px;
  font: 600 0.72rem/1 Inter, system-ui, sans-serif; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--candle, #d8a35e);
}
.kz-toc ol { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 28px; }
.kz-toc li { break-inside: avoid; margin: 0 0 4px; }
.kz-toc a {
  display: block; padding: 5px 0;
  font: 400 0.92rem/1.35 Inter, system-ui, sans-serif; color: var(--silk, #f4e9e4);
  text-decoration: none; border-bottom: 1px solid transparent;
}
.kz-toc a:hover { color: var(--candle, #d8a35e); }
@media (max-width: 640px) { .kz-toc ol { columns: 1; } }

.kz-tocbar {
  position: fixed; z-index: 45; top: 76px; left: 50%;
  width: min(560px, calc(100% - 32px));
  transform: translate(-50%, -12px); opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
  font-family: Inter, system-ui, sans-serif;
}
.kz-tocbar.is-on { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity 0.25s ease, transform 0.25s ease; }
.kz-tocbar-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 16px; border-radius: 999px; cursor: pointer;
  background: rgba(20, 10, 14, 0.9); border: 1px solid rgba(216, 163, 94, 0.3);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  color: var(--silk, #f4e9e4); text-align: left;
}
.kz-tocbar-k { flex: none; font: 600 0.66rem/1 Inter, system-ui, sans-serif; letter-spacing: 0.18em; text-transform: uppercase; color: var(--candle, #d8a35e); }
.kz-tocbar-now { flex: 1; min-width: 0; font: 500 0.88rem/1.2 Inter, system-ui, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kz-tocbar-btn svg { flex: none; color: var(--rose-ash, #b89aa4); transition: transform 0.2s ease; }
.kz-tocbar-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.kz-tocbar-btn:focus-visible { outline: 2px solid var(--candle, #d8a35e); outline-offset: 3px; }
.kz-tocbar-list {
  list-style: none; margin: 8px 0 0; padding: 8px;
  max-height: min(60vh, 460px); overflow-y: auto;
  background: rgba(20, 10, 14, 0.96); border: 1px solid rgba(216, 163, 94, 0.25); border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.kz-tocbar-list a {
  display: block; padding: 9px 12px; border-radius: 10px;
  font: 400 0.9rem/1.35 Inter, system-ui, sans-serif; color: var(--silk, #f4e9e4); text-decoration: none;
}
.kz-tocbar-list a:hover { background: rgba(216, 163, 94, 0.08); }
.kz-tocbar-list a[aria-current] { color: var(--candle, #d8a35e); background: rgba(216, 163, 94, 0.1); }
@media (max-width: 860px) { .kz-tocbar { top: 70px; } }
@media (prefers-reduced-motion: reduce) { .kz-tocbar { transition: none; } }

/* headings land below the site bar and this bar */
[data-toc] h2, [data-toc] [id] { scroll-margin-top: 136px; }
