/*
 * فهرست مطالب مقاله (inc/article-toc.php) — نوار چیپ چسبان + دیالوگ فهرست کامل.
 *
 * هر قانون با :is(#nz-blog-content,body) و کلاس ریشهٔ دوبار تکرارشده شروع می‌شود تا
 * ویژگی شناسه داشته باشد و از قانون‌های .prose قالب ببرد. !important فقط جایی آمده که
 * خودِ قالب !important دارد (font-size/line-height روی p و div داخل .prose، و
 * font-family/font-size/font-weight روی nav و nav a و button از تنظیمات فونت پیشخوان —
 * inc/theme-settings.php «Menu Styles» و «Button Styles»).
 * رنگ متن لینک‌ها روی <span class="zm-toc__txt"> است، نه خودِ <a>، تا قانون‌های
 * «a {color … !important}» قالب/المنتور رنگ چیپ فعال را خراب نکنند.
 *
 * --zm-header-h را اسکریپت از ارتفاع واقعی #site-header می‌گذارد؛ اعداد زیر فقط پیش‌فرض‌اند.
 * --zm-gutter: فاصلهٔ کناری ستون مقاله روی موبایل (برای تمام‌عرض شدن نوار).
 *
 * Type scale (memory/persian-typography.md): every control and every list row is on the UI rung,
 * 16/1.75 weight 500, H3 rows included (the indent and the muted colour mark the level; 14px is
 * for meta, not for navigation people have to read). The dialog title is on the lead rung, 20/1.7.
 * Vazirmatn has real 400–700 faces (variant C, October 2026); the UI rung stays at 500.
 */

:root {
	--zm-header-h: 93px;
	--zm-toc-bar-h: 0px;
}

@media (max-width: 1023px) {
	:root {
		--zm-header-h: 80px;
	}
}

html:has(#zm-toc) {
	--zm-toc-bar-h: 57px;
}

@media (max-height: 500px) {
	html:has(#zm-toc) {
		--zm-toc-bar-h: 0px;
	}
}

/* Direct loads of #anchor (and old TOC+ links) land below the fixed header and the bar. */
html {
	scroll-padding-top: calc(var(--zm-header-h) + var(--zm-toc-bar-h) + 12px);
}

/* ---------- palette tokens (GROWTH-TEAL, October 2026) ----------
 * Names follow the palette judge's :root block. Re-toned for variant C «گرافیت» (October 2026):
 * bar rgba(18,19,22,.94) = the page #121316 at 94%, worst case #202124 over a white logo; sheet
 * #1c1d21. Re-verified there: chip label 10.86:1 (9.41 worst), chip border 4.89:1 (3.39 worst,
 * focused), active label 8.41:1, ring 14.73:1, ring vs gap band 14.73:1 (C40 needs 9).
 * State layers are translucent and composite over whatever is behind them; states
 * do not stack and are written :hover → :focus-visible → :active.
 */
:is(#nz-blog-content, body) :is(.zm-toc.zm-toc, .zm-toc-sheet.zm-toc-sheet) {
	--zm-btn-outline-fg: #e6e7e9;
	--zm-btn-outline-border: #80838a;
	--zm-btn-outline-layer-hover: rgb(230 231 233 / 0.08);
	--zm-btn-outline-layer-focus: rgb(230 231 233 / 0.1);
	--zm-btn-outline-layer-pressed: rgb(230 231 233 / 0.1);
	--zm-btn-pill-fg: #d6d7da;
	--zm-btn-pill-border: #80838a;
	--zm-btn-pill-layer-hover: rgb(214 215 218 / 0.08);
	--zm-btn-pill-layer-focus: rgb(214 215 218 / 0.1);
	--zm-btn-pill-layer-pressed: rgb(214 215 218 / 0.1);
	--zm-chip-fg: #c4c6ca;
	--zm-chip-border: #80838a;
	--zm-chip-layer-hover: rgb(196 198 202 / 0.08);
	--zm-chip-layer-focus: rgb(196 198 202 / 0.1);
	--zm-chip-layer-pressed: rgb(196 198 202 / 0.1);
	--zm-chip-active-bg: #134e4a;
	--zm-chip-active-fg: #ccfbf1;
	--zm-chip-active-border: #2dd4c6;
	--zm-chip-active-bg-hover: #225c57;
	--zm-chip-active-bg-focus: #265f5b;
	--zm-chip-active-bg-pressed: #265f5b;
	--zm-focus: #99f6e4;
	--zm-focus-gap: #121316;
}

/* ---------- the sticky bar ---------- */

:is(#nz-blog-content, body) .zm-toc.zm-toc {
	position: sticky;
	top: var(--zm-header-h);
	z-index: 20; /* below the header (30) and the LBank bar (49) */
	box-sizing: border-box;
	margin: 20px 0 8px;
	padding: 0;
	direction: rtl;
	background: rgba(18, 19, 22, 0.94);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border: 0;
	border-bottom: 1px solid #2c2e33;
	transition: transform 0.22s ease, visibility 0.22s;
	/* the root is a <nav>: beat the theme's `nav {font-* … !important}` (admin menu font) */
	font-family: inherit !important;
	font-size: 16px !important;
	font-weight: 400 !important;
}

/*
 * The theme's admin button rule is `button:not(#…):not(#…):not(#…):not(#…) {font-* … !important}`,
 * specificity (4,0,1); four repeated IDs + a class (4,1,0) is the least that outranks it.
 * «فهرست» and «بستن» are buttons: UI rung, 16px weight 500.
 */
#zm-toc#zm-toc#zm-toc#zm-toc .zm-toc__open,
#zm-toc#zm-toc#zm-toc#zm-toc .zm-toc__arrow {
	font-family: inherit !important;
	font-size: 16px !important;
	font-weight: 500 !important;
}

#zm-toc-sheet#zm-toc-sheet#zm-toc-sheet#zm-toc-sheet .zm-toc-sheet__close {
	font-family: inherit !important;
	font-size: 16px !important;
	font-weight: 500 !important;
}

:is(#nz-blog-content, body) .zm-toc.zm-toc div,
:is(#nz-blog-content, body) .zm-toc.zm-toc p {
	font-size: 16px !important;
	line-height: 1.75 !important;
	margin: 0;
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__bar {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 56px;
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__open {
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 6px;
	height: 40px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--zm-btn-pill-border);
	border-radius: 999px;
	background: transparent;
	color: var(--zm-btn-pill-fg);
	font: inherit; /* family/size/weight: the #zm-toc×4 rule above */
	line-height: 1.75;
	white-space: nowrap;
	cursor: pointer;
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__open[hidden] {
	display: none;
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__open:hover {
	background-color: var(--zm-btn-pill-layer-hover);
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__open:focus-visible {
	background-color: var(--zm-btn-pill-layer-focus);
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__open:active {
	background-color: var(--zm-btn-pill-layer-pressed);
}

:is(#nz-blog-content, body) .zm-toc.zm-toc svg,
:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet svg {
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__open svg {
	width: 18px;
	height: 18px;
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__track {
	position: relative;
	flex: 1;
	min-width: 0;
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__chips {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	overflow-y: hidden;
	/* room for the 2px ring + 2px offset (4px past the chip) so the scroller does not clip it */
	padding-block: 5px;
	padding-inline: 5px;
	/* the same 5px when the browser scrolls a focused chip to an edge, so that side of the ring stays in view */
	scroll-padding-inline: 5px;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__chips::-webkit-scrollbar {
	display: none;
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__chip,
:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__chip:hover,
:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__chip:focus {
	text-decoration: none;
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__chip {
	display: inline-flex;
	flex: none;
	align-items: center;
	box-sizing: border-box;
	height: 36px;
	max-width: 240px;
	/* never wider than the track (≈225px on a 375px phone), or its focus ring would be clipped */
	max-width: min(240px, 100%);
	padding: 0 14px;
	border: 1px solid var(--zm-chip-border);
	border-radius: 999px;
	background: transparent;
	color: var(--zm-chip-fg);
	/* the chip is a `nav a`: the theme sets font-* on it with !important */
	font-family: inherit !important;
	font-size: 16px !important;
	font-weight: 500 !important;
	line-height: 1.75;
	white-space: nowrap;
	transition: background-color 0.15s, border-color 0.15s;
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__chip .zm-toc__txt {
	display: block;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--zm-chip-fg);
	font-size: inherit;
	line-height: inherit;
	transition: color 0.15s;
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__chip:hover {
	background-color: var(--zm-chip-layer-hover);
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__chip:focus-visible {
	background-color: var(--zm-chip-layer-focus);
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__chip:active {
	background-color: var(--zm-chip-layer-pressed);
}

/*
 * Active chip: teal fill + a 2px teal edge (the 1px border plus a 1px inset ring, so the box does
 * not move). The heavier edge is the non-colour cue (WCAG 1.4.1, palette rule 3). It replaces
 * a weight step: with Dana's single face 600 was synthesized bold. Real Vazirmatn weights exist now,
 * but a bolder active label would widen the chip and shift the row on every scroll-spy change.
 */
:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__chip.is-active {
	background-color: var(--zm-chip-active-bg);
	border-color: var(--zm-chip-active-border);
	box-shadow: inset 0 0 0 1px var(--zm-chip-active-border);
	color: var(--zm-chip-active-fg);
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__chip.is-active:hover {
	background-color: var(--zm-chip-active-bg-hover);
}

/* keeps the inset edge next to the focus ring's gap band (the shared :focus-visible rule sets box-shadow) */
:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__chip.is-active:focus-visible {
	background-color: var(--zm-chip-active-bg-focus);
	box-shadow: inset 0 0 0 1px var(--zm-chip-active-border), 0 0 0 2px var(--zm-focus-gap);
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__chip.is-active:active {
	background-color: var(--zm-chip-active-bg-pressed);
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__chip.is-active .zm-toc__txt {
	color: var(--zm-chip-active-fg);
}

/* edge fades + arrows (arrows only for a mouse/trackpad) */
:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__track::before,
:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__track::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: 44px;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.15s;
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__track::before {
	inset-inline-start: 0;
	background: linear-gradient(to left, rgba(18, 19, 22, 1), rgba(18, 19, 22, 0));
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__track::after {
	inset-inline-end: 0;
	background: linear-gradient(to right, rgba(18, 19, 22, 1), rgba(18, 19, 22, 0));
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__track.has-start::before,
:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__track.has-end::after {
	opacity: 1;
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__arrow {
	position: absolute;
	top: 50%;
	z-index: 1;
	display: none;
	place-items: center;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--zm-btn-outline-border);
	border-radius: 999px;
	background: #1c1d21;
	color: var(--zm-btn-outline-fg);
	cursor: pointer;
	transform: translateY(-50%);
}

/* the arrow sits over the chips, so its fill stays opaque: the state layer is painted on top of it */
:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__arrow:hover {
	background-image: linear-gradient(var(--zm-btn-outline-layer-hover), var(--zm-btn-outline-layer-hover));
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__arrow:focus-visible {
	background-image: linear-gradient(var(--zm-btn-outline-layer-focus), var(--zm-btn-outline-layer-focus));
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__arrow:active {
	background-image: linear-gradient(var(--zm-btn-outline-layer-pressed), var(--zm-btn-outline-layer-pressed));
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__arrow svg {
	width: 16px;
	height: 16px;
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__arrow--prev {
	inset-inline-start: 0;
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__arrow--next {
	inset-inline-end: 0;
}

@media (pointer: fine) {
	:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__track.has-start .zm-toc__arrow--prev,
	:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__track.has-end .zm-toc__arrow--next {
		display: grid;
	}
}

/* A keyboard-focused chip is never painted over. The fades are positioned, so they sit above
   the in-flow chips, and the arrows are opaque: on a 375px phone a 225px chip fills the 235px
   track and both 44px fades covered its ring and the ends of its label (down to 1.14:1). While
   a chip has :focus-visible the fades and the arrows (tabindex=-1, mouse only) step aside, and
   the chip shows its normal colours (label 8.96:1, ring 14.73:1 on the bar). Mouse clicks on a
   link do not match :focus-visible, so pointer users keep both. */
:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__track:has(.zm-toc__chip:focus-visible)::before,
:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__track:has(.zm-toc__chip:focus-visible)::after {
	opacity: 0;
}

:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__track:has(.zm-toc__chip:focus-visible) .zm-toc__arrow {
	display: none;
}

/* title + full list stay hidden in the bar; the script moves the list into the dialog */
:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__title,
:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__list {
	display: none;
}

/* Mobile: full-bleed bar that slides away on scroll-down while stuck. */
@media (max-width: 767px) {
	:is(#nz-blog-content, body) .zm-toc.zm-toc {
		margin-inline: calc(-1 * var(--zm-gutter, 16px));
		padding-inline: var(--zm-gutter, 16px);
	}

	:is(#nz-blog-content, body) .zm-toc.zm-toc.is-hidden {
		transform: translateY(calc(-100% - var(--zm-header-h)));
		visibility: hidden;
	}
}

/* Landscape phones: header + bar + promo bar would cover half the screen. */
@media (max-height: 500px) {
	:is(#nz-blog-content, body) .zm-toc.zm-toc {
		display: none;
	}
}

/* ---------- dialog: centred modal ≥768px, bottom sheet below ---------- */

:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet {
	box-sizing: border-box;
	width: min(560px, calc(100vw - 32px));
	max-width: calc(100vw - 32px);
	max-height: 80vh;
	max-height: 80dvh;
	margin: auto;
	padding: 0;
	overflow: hidden;
	direction: rtl;
	border: 1px solid #3a3c42;
	border-radius: 16px;
	background: #1c1d21;
	color: #d6d7da;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
}

:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet[open] {
	display: flex;
	flex-direction: column;
}

:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet::backdrop {
	background: rgba(0, 0, 0, 0.6);
}

:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet div,
:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet p {
	font-size: 16px !important;
	line-height: 1.75 !important;
	margin: 0;
}

:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc-sheet__head {
	position: relative;
	display: flex;
	flex: none;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	border-bottom: 1px solid #2c2e33;
}

:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc-sheet__grab {
	position: absolute;
	top: 7px;
	left: 50%;
	display: none;
	width: 40px;
	height: 4px;
	border-radius: 4px;
	background: #3a3c42;
	transform: translateX(-50%);
}

/* lead rung: with no bold available, size is what sets the title above the 16px rows */
:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc-sheet__title {
	font-size: 20px !important;
	line-height: 1.7 !important;
	font-weight: 500;
	color: #e6e7e9;
}

:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc-sheet__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 48px;
	min-height: 44px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--zm-btn-outline-border);
	border-radius: 999px;
	background: transparent;
	color: var(--zm-btn-outline-fg);
	font: inherit; /* family/size/weight: the #zm-toc-sheet×4 rule */
	line-height: 1.75;
	cursor: pointer;
}

:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc-sheet__close:hover {
	background-color: var(--zm-btn-outline-layer-hover);
}

:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc-sheet__close:focus-visible {
	background-color: var(--zm-btn-outline-layer-focus);
}

:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc-sheet__close:active {
	background-color: var(--zm-btn-outline-layer-pressed);
}

:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc-sheet__body {
	position: relative; /* offsetParent for keeping the active row in view */
	flex: 1 1 auto;
	min-height: 0;
	padding: 8px;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: #3a3c42 transparent;
}

:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc__list {
	display: block;
}

:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc__list,
:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc__list ol,
:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc__list li {
	margin: 0;
	padding: 0;
	list-style: none;
}

:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc__list li::marker {
	content: none;
}

:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc__link,
:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc__link:hover,
:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc__link:focus {
	text-decoration: none;
}

:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc__link {
	display: block;
	padding: 8px 12px;
	border-radius: 8px;
	color: #c4c6ca;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.75;
}

:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc__link .zm-toc__txt {
	color: #c4c6ca;
	font-size: inherit;
	line-height: inherit;
}

/* H3 rows keep the 16px of the H2 rows: the indent and the muted label mark the level */
:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc__item--h3 > .zm-toc__link {
	padding-inline-start: 26px;
}

:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc__item--h3 > .zm-toc__link .zm-toc__txt {
	color: #b2b5bb;
}

:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc__link:hover {
	background: #2c2e33;
}

/* active row: neutral fill; the teal bar (the active-chip border colour) sits on the inline-start edge */
:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc__link.is-active {
	background: #2c2e33;
	box-shadow: inset -3px 0 0 var(--zm-chip-active-border);
}

:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc__link.is-active .zm-toc__txt {
	color: #e6e7e9;
}

/* hovering the active row: the chip state layer over its fill (#2c2e33 → #383a3f; label 9.20:1, teal bar 6.15:1) */
:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc__link.is-active:hover {
	background-image: linear-gradient(var(--zm-chip-layer-hover), var(--zm-chip-layer-hover));
}

@media (max-width: 767px) {
	:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet {
		width: 100vw;
		max-width: 100vw;
		max-height: 75vh;
		max-height: 75dvh;
		margin: auto 0 0;
		padding-bottom: env(safe-area-inset-bottom, 0px);
		border-bottom: 0;
		border-radius: 16px 16px 0 0;
	}

	:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc-sheet__head {
		padding-top: 20px;
	}

	:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc-sheet__grab {
		display: block;
	}
}

/* ---------- focus + motion ---------- */

/* two-colour ring (WCAG C40): light ring + dark gap band, outside the element (never a negative offset) */
:is(#nz-blog-content, body) .zm-toc.zm-toc :focus-visible,
:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet :focus-visible {
	outline: 2px solid var(--zm-focus);
	outline-offset: 2px;
	box-shadow: 0 0 0 2px var(--zm-focus-gap);
}

/* the focused active row keeps its teal bar next to the gap band */
:is(#nz-blog-content, body) .zm-toc-sheet.zm-toc-sheet .zm-toc__link.is-active:focus-visible {
	box-shadow: inset -3px 0 0 var(--zm-chip-active-border), 0 0 0 2px var(--zm-focus-gap);
}

@media (prefers-reduced-motion: reduce) {
	:is(#nz-blog-content, body) .zm-toc.zm-toc,
	:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__chip,
	:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__chip .zm-toc__txt,
	:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__track::before,
	:is(#nz-blog-content, body) .zm-toc.zm-toc .zm-toc__track::after {
		transition: none;
	}
}
