.webbo-mobile-toc-bar {
	display: none;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	margin: 0;
	box-sizing: border-box;
	font: inherit;
	text-align: start;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	overflow: hidden;
}

.webbo-mobile-toc-current-label {
	min-width: 0;
	flex: 1 1 auto;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-family: var(--webbo-mobile-toc-header-font-family, inherit);
	font-size: var(--webbo-mobile-toc-header-font-size, inherit);
	font-weight: var(--webbo-mobile-toc-header-font-weight, inherit);
	font-style: var(--webbo-mobile-toc-header-font-style, inherit);
	line-height: var(--webbo-mobile-toc-header-line-height, inherit);
	letter-spacing: var(--webbo-mobile-toc-header-letter-spacing, inherit);
	text-transform: var(--webbo-mobile-toc-header-text-transform, inherit);
}


/* Fade the current reading title out, swap it while hidden, then fade it back in. */
.webbo-mobile-sticky-toc-enabled[data-webbo-mobile-title-animation="fade"].webbo-mobile-toc-title-animating .webbo-mobile-toc-current-label {
	animation: webbo-mobile-toc-title-fade var(--webbo-mobile-toc-title-duration, 180ms) ease both;
}

@keyframes webbo-mobile-toc-title-fade {
	0% { opacity: 1; }
	45% { opacity: 0; }
	55% { opacity: 0; }
	100% { opacity: 1; }
}

/* Slide the old title upward, swap it while hidden, then bring the new title up from below. */
.webbo-mobile-sticky-toc-enabled[data-webbo-mobile-title-animation="slide_up"].webbo-mobile-toc-title-animating .webbo-mobile-toc-current-label {
	animation: webbo-mobile-toc-title-slide-up var(--webbo-mobile-toc-title-duration, 180ms) cubic-bezier(.4, 0, .2, 1) both;
}

@keyframes webbo-mobile-toc-title-slide-up {
	0% { opacity: 1; transform: translateY(0); }
	44% { opacity: 0; transform: translateY(-115%); }
	50% { opacity: 0; transform: translateY(115%); }
	56% { opacity: 0; transform: translateY(115%); }
	100% { opacity: 1; transform: translateY(0); }
}

.webbo-mobile-toc-chevron {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	transition: transform var(--webbo-mobile-toc-dropdown-duration, 220ms) ease;
}

.webbo-mobile-toc-chevron svg {
	display: block;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/*
 * Mobile reading mode keeps the original widget in normal flow. Only the
 * compact reading bar and its dropdown become fixed while the reading scope
 * is active. This prevents Elementor parent containers from limiting the
 * sticky distance.
 */
.webbo-mobile-sticky-toc-enabled.webbo-mobile-toc-is-active {
	position: relative !important;
	left: auto !important;
	right: auto !important;
	width: 100% !important;
	max-width: 100% !important;
	transform: none !important;
	z-index: auto !important;
	box-sizing: border-box;
}

.webbo-mobile-sticky-toc-enabled.webbo-mobile-toc-is-active > .elementor-widget-container {
	position: relative;
	overflow: visible !important;
}

.webbo-mobile-sticky-toc-enabled.webbo-mobile-toc-is-active .elementor-toc {
	position: relative;
	overflow: visible !important;
	max-height: none !important;
	min-height: var(--webbo-mobile-toc-bar-height, auto);
}

.webbo-mobile-sticky-toc-enabled.webbo-mobile-toc-is-active .elementor-toc__header {
	display: none !important;
}

.webbo-mobile-sticky-toc-enabled.webbo-mobile-toc-is-active .webbo-mobile-toc-bar {
	display: none;
	position: relative;
	z-index: var(--webbo-mobile-toc-z-index, 100);
}

.webbo-mobile-sticky-toc-enabled.webbo-mobile-toc-is-active.webbo-mobile-toc-in-scope .webbo-mobile-toc-bar,
.webbo-mobile-sticky-toc-enabled.webbo-mobile-toc-is-active.webbo-mobile-toc-leaving .webbo-mobile-toc-bar {
	display: flex;
}

.webbo-mobile-sticky-toc-enabled.webbo-mobile-toc-is-active.webbo-mobile-toc-fixed .webbo-mobile-toc-bar {
	position: fixed !important;
	top: var(--webbo-mobile-toc-top-offset, 0px) !important;
	left: var(--webbo-mobile-toc-fixed-left, 0px) !important;
	right: auto !important;
	width: var(--webbo-mobile-toc-fixed-width, 100%) !important;
	max-width: none !important;
	margin: 0 !important;
	z-index: var(--webbo-mobile-toc-z-index, 100) !important;
}

/* Dropdown remains mounted so opening and closing can animate smoothly. */
.webbo-mobile-sticky-toc-enabled.webbo-mobile-toc-is-active .webbo-mobile-toc-dropdown {
	display: block !important;
	position: absolute !important;
	top: 100%;
	left: 0;
	right: 0;
	width: 100%;
	box-sizing: border-box;
	max-height: 0 !important;
	padding-top: 0 !important;
	padding-right: var(--webbo-mobile-toc-dropdown-padding-right, 16px) !important;
	padding-bottom: 0 !important;
	padding-left: var(--webbo-mobile-toc-dropdown-padding-left, 16px) !important;
	overflow: hidden !important;
	overscroll-behavior: contain;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(-8px);
	transition:
		max-height var(--webbo-mobile-toc-dropdown-duration, 220ms) ease,
		padding-top var(--webbo-mobile-toc-dropdown-duration, 220ms) ease,
		padding-bottom var(--webbo-mobile-toc-dropdown-duration, 220ms) ease,
		opacity var(--webbo-mobile-toc-dropdown-duration, 220ms) ease,
		transform var(--webbo-mobile-toc-dropdown-duration, 220ms) ease,
		visibility 0s linear var(--webbo-mobile-toc-dropdown-duration, 220ms);
	z-index: calc(var(--webbo-mobile-toc-z-index, 100) + 1);
}

.webbo-mobile-sticky-toc-enabled.webbo-mobile-toc-is-active.webbo-mobile-toc-fixed .webbo-mobile-toc-dropdown {
	position: fixed !important;
	top: var(--webbo-mobile-toc-dropdown-top, 0px) !important;
	left: var(--webbo-mobile-toc-fixed-left, 0px) !important;
	right: auto !important;
	width: var(--webbo-mobile-toc-fixed-width, 100%) !important;
	max-width: none !important;
	z-index: calc(var(--webbo-mobile-toc-z-index, 100) + 1) !important;
}

.webbo-mobile-sticky-toc-enabled.webbo-mobile-toc-is-active.webbo-mobile-toc-open .webbo-mobile-toc-dropdown {
	max-height: var(--webbo-mobile-toc-dropdown-max-height, 60vh) !important;
	padding-top: var(--webbo-mobile-toc-dropdown-padding-top, 10px) !important;
	padding-bottom: var(--webbo-mobile-toc-dropdown-padding-bottom, 2px) !important;
	overflow-y: auto !important;
	overflow-x: hidden !important;
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
	transition-delay: 0s;
}

.webbo-mobile-sticky-toc-enabled[data-webbo-mobile-dropdown-smooth="no"] .webbo-mobile-toc-dropdown,
.webbo-mobile-sticky-toc-enabled[data-webbo-mobile-dropdown-smooth="no"] .webbo-mobile-toc-chevron {
	transition: none !important;
}

.webbo-mobile-sticky-toc-enabled.webbo-mobile-toc-is-active.webbo-mobile-toc-open .webbo-mobile-toc-chevron {
	transform: rotate(180deg);
}

.webbo-mobile-sticky-toc-enabled.webbo-mobile-toc-is-active .webbo-mobile-toc-bar:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

/* Entrance animations. */
.webbo-mobile-sticky-toc-enabled.webbo-mobile-toc-entering[data-webbo-mobile-entrance-animation="fade"] .webbo-mobile-toc-bar {
	animation: webbo-mobile-toc-fade-in var(--webbo-mobile-toc-visibility-duration, 220ms) ease both;
}

.webbo-mobile-sticky-toc-enabled.webbo-mobile-toc-entering[data-webbo-mobile-entrance-animation="slide_down"] .webbo-mobile-toc-bar {
	animation: webbo-mobile-toc-slide-down var(--webbo-mobile-toc-visibility-duration, 220ms) ease both;
}

/* Exit animations. The wrapper remains fixed until JavaScript completes them. */
.webbo-mobile-sticky-toc-enabled.webbo-mobile-toc-leaving[data-webbo-mobile-exit-animation="fade"] .webbo-mobile-toc-bar {
	animation: webbo-mobile-toc-fade-out var(--webbo-mobile-toc-visibility-duration, 220ms) ease both;
}

.webbo-mobile-sticky-toc-enabled.webbo-mobile-toc-leaving[data-webbo-mobile-exit-animation="slide_up"] .webbo-mobile-toc-bar {
	animation: webbo-mobile-toc-slide-up var(--webbo-mobile-toc-visibility-duration, 220ms) ease both;
}

@keyframes webbo-mobile-toc-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes webbo-mobile-toc-fade-out {
	from { opacity: 1; }
	to { opacity: 0; }
}

@keyframes webbo-mobile-toc-slide-down {
	from { opacity: 0; transform: translateY(-100%); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes webbo-mobile-toc-slide-up {
	from { opacity: 1; transform: translateY(0); }
	to { opacity: 0; transform: translateY(-100%); }
}

@media (prefers-reduced-motion: reduce) {
	.webbo-mobile-toc-chevron,
	.webbo-mobile-toc-dropdown,
	.webbo-mobile-toc-bar,
	.webbo-mobile-toc-current-label {
		transition: none !important;
		animation: none !important;
	}
}

/* Elementor editor preview uses the same fixed geometry as the frontend. */
.webbo-mobile-toc-editor-preview.webbo-mobile-toc-is-active .webbo-mobile-toc-bar {
	visibility: visible;
}
