/* ==========================================================================
   Sous-Barre Sticky des Moteurs (Engines Toolbar) : 44px
   ========================================================================== */

.engines-bar {
	position: sticky;
	top: var(--topbar-h);
	z-index: 90;
	height: 44px;
	background: var(--bg);
	border-bottom: 1px solid var(--border);
	pointer-events: none;
}

.engines-bar__inner {
	height: 100%;
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 28px;
	display: flex;
	align-items: center;
	gap: 12px;
	pointer-events: none;
}

.engines-bar__label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--text-muted);
	flex-shrink: 0;
	pointer-events: auto;
}

@property --fade-left {
	syntax: "<length>";
	inherits: false;
	initial-value: 0px;
}

@property --fade-right {
	syntax: "<length>";
	inherits: false;
	initial-value: 0px;
}

.engines-bar__scroller {
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	scroll-padding-inline: 16px;
	padding-block: 0;
	margin-block: 0;
	padding-inline: 4px;
	display: flex;
	align-items: center;
	position: relative;
	pointer-events: none;
	--fade-left: 0px;
	--fade-right: 0px;
	mask-image: linear-gradient(
		to right,
		transparent 0,
		#000 var(--fade-left),
		#000 calc(100% - var(--fade-right)),
		transparent 100%
	);
	-webkit-mask-image: linear-gradient(
		to right,
		transparent 0,
		#000 var(--fade-left),
		#000 calc(100% - var(--fade-right)),
		transparent 100%
	);
	transition:
		--fade-left 0.15s ease,
		--fade-right 0.15s ease;
}

.engines-bar__scroller::-webkit-scrollbar {
	display: none;
}

.engines-bar__chips {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	width: max-content;
	overflow: visible;
	position: relative;
	pointer-events: auto;
}

/* Pastille Moteur Actif (Chip) */
.engine-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 28px;
	padding: 0 10px;
	border-radius: 14px;
	background: var(--bg-menu);
	border: 1px solid var(--border);
	font-size: 12px;
	color: var(--text);
	white-space: nowrap;
	flex-shrink: 0;
	touch-action: pan-x;
	user-select: none;
	cursor: grab;
	position: relative;
	z-index: 1;
	transition:
		transform var(--chip-settle-duration) cubic-bezier(0.2, 0.8, 0.2, 1),
		border-color 0.24s cubic-bezier(0.2, 0, 0, 1),
		background-color 0.24s cubic-bezier(0.2, 0, 0, 1),
		opacity 0.26s cubic-bezier(0.2, 0, 0, 1),
		box-shadow 0.24s cubic-bezier(0.2, 0, 0, 1);
}

.engine-chip:active {
	cursor: grabbing;
}

.no-anim .engine-chip {
	transition: none;
}

.engine-chip--ghost {
	position: absolute;
	pointer-events: none;
	z-index: 50;
	margin: 0;
}


.engine-chip.is-dragging {
	cursor: grabbing;
	z-index: 1000;
	will-change: transform;
	box-shadow:
		0 4px 10px rgba(0, 0, 0, 0.16),
		0 1px 2px rgba(0, 0, 0, 0.08);
	border-color: var(--focus);
	background: var(--bg);
	transition: none;
}

.engine-chip.is-settling {
	z-index: 999;
	cursor: grabbing;
	will-change: transform;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	transition: transform var(--chip-settle-duration)
		cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
	.engine-chip,
	.engine-chip.is-settling {
		transition: none;
		animation: none;
	}
	.engine-chip--ghost {
		display: none;
	}
}

