.target-video-wrapper {
	width: 100%;
	max-width: none;
	overflow: visible;
}

.target-video-wrapper .target-video-player {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	border-radius: 0;
}

/* Full box size only while inline: a floating player keeps the size the SDK
 * gives it (inset: 0 still fills the box). */
.target-video-wrapper .fd-target-video-surface:not(.fd-target-video-floating) > .target-video-player {
	width: 100% !important;
	height: 100% !important;
}

.target-video-wrapper .fd-target-video-surface {
	position: relative;
	/* Own stacking layer above theme layers that overlap the header image
	 * (e.g. `.single .entry-header *` with z-index 1 and the figure's
	 * ::before), so the player controls receive clicks. */
	z-index: 2;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #000;
}

.target-video-wrapper .fd-target-video-placeholder {
	position: absolute;
	inset: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

/* Like the Kaltura container: the player renders underneath the preview at
 * its final size and the preview is removed once the player is ready. The
 * player is never display:none, so the SDK always measures a real size. */
.target-video-wrapper .fd-target-video-ready > .fd-target-video-placeholder,
.target-video-wrapper .fd-target-video-surface.fd-target-video-ready > .cmppreviewroot,
.target-video-wrapper .fd-target-video-surface.fd-target-video-ready > .cmplazypreviewiframe {
	/* .fd-target-video-surface in the selector: must win over the consent
	 * preview layout below (display: block !important). */
	display: none !important;
}

.target-video-wrapper .fd-target-video-placeholder img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* The CMP inserts its consent preview (`div.cmppreviewroot`, older versions
 * `.cmplazypreviewiframe`) right after its placeholder script, inside the
 * player surface. Lay it over the fallback image so the visitor sees and can
 * accept the consent preview instead of a static image. */
.target-video-wrapper .fd-target-video-surface > .cmppreviewroot,
.target-video-wrapper .fd-target-video-surface > .cmplazypreviewiframe {
	position: absolute !important;
	inset: 0 !important;
	z-index: 2;
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	min-height: 0 !important;
	max-width: none !important;
	margin: 0 !important;
	overflow: auto;
}

/* The CMP renders its consent preview immediately, before it knows the
 * visitor's choice; visitors who already consented would see it flash for a
 * moment. It stays invisible (but in the DOM, so the CMP can work with it)
 * until target-video-frontend.js has confirmed that consent is missing. */
.target-video-wrapper .fd-target-video-surface:not(.fd-target-video-needs-consent) > .cmppreviewroot,
.target-video-wrapper .fd-target-video-surface:not(.fd-target-video-needs-consent) > .cmplazypreviewiframe {
	visibility: hidden !important;
}

/* Ad label ("Anzeige"): always visible while an ad plays. The player shows it
 * in its control bar, which hides after a few seconds; keep it on the video
 * and above the controls while they are visible (same as WSE). */
.target-video-wrapper .bplr-ad-info {
	position: absolute;
	bottom: 20px;
	background: 0 0;
	font-size: 13px !important;
	color: #fff;
	padding: 0 0.7em;
	pointer-events: none;
	text-shadow: 1px 1px 6px #000;
	transition: all 0.2s;
	opacity: 1 !important;
}

.target-video-wrapper .bplr-visible-controls .bplr-ad-info {
	bottom: 49px;
}

.target-video-wrapper .bplr-adtime {
	margin-left: 15px !important;
	display: none !important;
}

.target-video-wrapper .bplr-onad .bplr-ad-info,
.target-video-wrapper .bplr-onad .bplr-adtime {
	display: block !important;
}

.target-video-wrapper .video-frame {
	width: 100%;
}

/*
 * Sticky/floating is the Target Video player's own feature (player
 * configuration in the Target Video CMS); its size and position come from
 * there. assets/js/target-video-frontend.js only flags the box with
 * `.fd-target-video-floating` and raises the player's fixed elements above the
 * sticky site header. No size is forced on the SDK's own elements.
 */

/* Once the player is ready it is the top layer of its box, so our preview
 * layers cannot catch the clicks meant for the player controls. */
.target-video-wrapper .fd-target-video-ready > .target-video-player {
	z-index: 3;
}

/* Only our own preview layers are made click-through. Elements the player
 * SDK adds next to its container (e.g. its sticky wrapper and close button)
 * must stay clickable. */
.target-video-wrapper .fd-target-video-ready > .fd-target-video-placeholder,
.target-video-wrapper .fd-target-video-ready > .cmppreviewroot,
.target-video-wrapper .fd-target-video-ready > .cmplazypreviewiframe {
	pointer-events: none !important;
}

/* A floating player must not be trapped in the surface's stacking layer. */
.target-video-wrapper .fd-target-video-surface.fd-target-video-floating,
.target-video-wrapper .fd-target-video-surface.fd-target-video-floating > .target-video-player {
	/* No stacking layer while floating, so the player's fixed element (and
	 * its close button) can sit above the sticky site header (z-index 999). */
	z-index: auto !important;
}

/* While the player floats, keep the header image in the original 16:9 box
 * instead of an empty black area. */
.target-video-wrapper .fd-target-video-surface.fd-target-video-ready.fd-target-video-floating > .fd-target-video-placeholder {
	display: block !important;
}

.singular figure.post-thumbnail:has(.target-video-wrapper) {
	max-height: none;
}

.fd-target-video-admin-preview {
	max-width: 760px;
	padding: 16px;
	background: #fff;
	border: 1px solid #dcdcde;
}

.fd-target-video-admin-preview .target-video-wrapper {
	max-width: 760px;
}

.fd-target-video-picker-modal {
	max-width: 1180px;
	width: calc(100vw - 80px);
}

.fd-target-video-picker-toolbar {
	display: flex;
	gap: 12px;
	align-items: flex-end;
	margin-bottom: 16px;
}

.fd-target-video-picker-toolbar .components-base-control {
	flex: 1;
	margin-bottom: 0;
}

.fd-target-video-picker-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	min-height: 480px;
}

.fd-target-video-picker-results {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 16px;
	align-content: start;
}

.fd-target-video-picker-card {
	position: relative;
	border: 1px solid #dcdcde;
	background: #fff;
	padding: 10px;
	min-width: 0;
}

.fd-target-video-picker-card img,
.fd-target-video-picker-card-placeholder {
	display: block;
	width: 100%;
	height: 108px;
	object-fit: cover;
	background: #1d2327;
	color: #fff;
	text-align: center;
}

.fd-target-video-picker-card-placeholder {
	display: grid;
	place-items: center;
}

.fd-target-video-picker-card h3 {
	font-size: 14px;
	line-height: 1.35;
	margin: 10px 0 5px;
}

.fd-target-video-picker-card p {
	font-size: 11px;
	color: #50575e;
	margin: 0 0 8px;
}

.fd-target-video-picker-card {
	display: flex;
	flex-direction: column;
}

.fd-target-video-picker-card .components-button {
	margin-top: auto;
	align-self: flex-start;
}

.fd-target-video-picker-card-media {
	position: relative;
}

.fd-target-video-picker-duration {
	position: absolute;
	right: 6px;
	bottom: 6px;
	padding: 1px 6px;
	border-radius: 2px;
	background: rgba(0, 0, 0, 0.75);
	color: #fff;
	font-size: 11px;
}

.fd-target-video-picker-meta,
.fd-target-video-picker-labels {
	font-size: 11px;
	color: #50575e;
	margin: 0 0 6px;
}

.fd-target-video-picker-labels {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.fd-target-video-picker-detail .fd-target-video-picker-labels {
	white-space: normal;
}

.fd-target-video-picker-actions {
	display: flex;
	gap: 8px;
	margin-top: 12px;
}

.fd-target-video-picker-indexing {
	display: flex;
	gap: 8px;
	align-items: center;
	margin: 0 0 12px;
	color: #50575e;
}

.fd-target-video-picker-loading {
	grid-column: 1 / -1;
	display: flex;
	gap: 8px;
	align-items: center;
}

.fd-target-video-picker-pagination {
	grid-column: 1 / -1;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 12px;
	padding-top: 16px;
}

.fd-target-video-picker-detail {
	max-width: 720px;
}

.fd-target-video-picker-detail-image {
	display: block;
	width: 100%;
	max-height: 320px;
	object-fit: contain;
	background: #1d2327;
	margin-bottom: 16px;
}

@media (max-width: 780px) {
	.fd-target-video-picker-modal {
		width: calc(100vw - 24px);
	}

}
.fd-target-video-sync-terminal {
	margin-top: 12px;
}

.fd-target-video-sync-terminal summary {
	cursor: pointer;
	font-weight: 600;
}

.fd-target-video-sync-terminal pre {
	background: #111827;
	border: 1px solid #374151;
	border-radius: 4px;
	box-sizing: border-box;
	color: #d1fae5;
	font-family: Consolas, Monaco, monospace;
	font-size: 12px;
	line-height: 1.5;
	margin: 8px 0 0;
	max-height: 320px;
	overflow: auto;
	padding: 12px;
	white-space: pre-wrap;
}

/* Admin guide pages (Getting started, Help). */
.fd-tv-guide { max-width: 960px; }
.fd-tv-guide__lead { font-size: 14px; max-width: 780px; }
.fd-tv-progress { margin: 16px 0 8px; padding: 12px 16px; background: #fff; border: 1px solid #dcdcde; }
.fd-tv-progress progress { display: block; width: 100%; max-width: 420px; margin-top: 8px; }
.fd-tv-checklist { margin-left: 0; list-style: none; }
.fd-tv-check { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 8px; padding: 12px 16px; background: #fff; border: 1px solid #dcdcde; border-left-width: 4px; }
.fd-tv-check--ok { border-left-color: #00a32a; }
.fd-tv-check--todo { border-left-color: #d63638; }
.fd-tv-check--warning { border-left-color: #dba617; }
.fd-tv-check--info { border-left-color: #72aee6; }
.fd-tv-check__badge { flex: 0 0 64px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.fd-tv-check__body p { margin: 4px 0 8px; }
.fd-tv-check__required { color: #d63638; font-size: 12px; }
.fd-tv-guide__toc { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0 4px; }
.fd-tv-code { padding: 12px 16px; background: #f6f7f7; border: 1px solid #dcdcde; overflow-x: auto; }
.fd-tv-table { max-width: 960px; }
.fd-tv-table td:first-child { white-space: nowrap; }
