.wt-youtube-pip {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 999999;
	width: min(440px, calc(100vw - 40px));
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.wt-youtube-pip *,
.wt-youtube-pip *::before,
.wt-youtube-pip *::after {
	box-sizing: border-box;
}

.wt-youtube-pip__panel {
	overflow: hidden;
	width: 100%;
	border-radius: 10px;
	background: #111;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.32);
}

.wt-youtube-pip__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 42px;
	padding-left: 10px;
	background: #111;
	cursor: grab;
	touch-action: none;
	user-select: none;
}

.wt-youtube-pip__toolbar:active {
	cursor: grabbing;
}

.wt-youtube-pip__drag-icon {
	flex: none;
	width: 16px;
	height: 16px;
	fill: #929292;
}

.wt-youtube-pip__actions {
	display: flex;
	align-self: stretch;
	margin-left: auto;
}

.wt-youtube-pip__expand,
.wt-youtube-pip__close,
.wt-youtube-pip__open {
	appearance: none;
	border: 0;
	cursor: pointer;
}

.wt-youtube-pip__expand {
	padding: 0 12px;
	background: transparent;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
}

.wt-youtube-pip__close {
	flex: 0 0 42px;
	padding: 0;
	background: transparent;
	color: #fff;
	font-size: 28px;
	font-weight: 300;
	line-height: 1;
}

.wt-youtube-pip__expand:hover,
.wt-youtube-pip__expand:focus-visible,
.wt-youtube-pip__close:hover,
.wt-youtube-pip__close:focus-visible {
	background: rgba(255, 255, 255, 0.14);
}

.wt-youtube-pip__video {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
}

.wt-youtube-pip__video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.wt-youtube-pip__open {
	display: flex;
	align-items: center;
	gap: 7px;
	margin-left: auto;
	padding: 10px 15px;
	border-radius: 999px;
	background: #111;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
}

.wt-youtube-pip__open:hover,
.wt-youtube-pip__open:focus-visible {
	background: #282828;
}

.wt-youtube-pip__panel[hidden],
.wt-youtube-pip__open[hidden] {
	display: none;
}

.wt-youtube-pip.is-dragging iframe {
	pointer-events: none;
}

.wt-youtube-pip.is-expanded {
	top: 16px !important;
	right: 16px !important;
	bottom: 16px !important;
	left: 16px !important;
	display: flex;
	align-items: center;
	justify-content: center;
	width: auto;
	pointer-events: none;
}

.wt-youtube-pip.is-expanded .wt-youtube-pip__panel {
	width: min(calc(100vw - 32px), calc((100vh - 74px) * 16 / 9));
	pointer-events: auto;
}

.wt-youtube-pip.is-expanded .wt-youtube-pip__toolbar {
	cursor: default;
}

@media (max-width: 600px) {
	.wt-youtube-pip {
		right: 10px;
		bottom: 10px;
		width: calc(100vw - 20px);
	}

	.wt-youtube-pip__panel {
		border-radius: 8px;
	}

	.wt-youtube-pip__expand {
		padding-right: 9px;
		padding-left: 9px;
	}

	.wt-youtube-pip.is-expanded {
		top: 8px !important;
		right: 8px !important;
		bottom: 8px !important;
		left: 8px !important;
	}

	.wt-youtube-pip.is-expanded .wt-youtube-pip__panel {
		width: min(calc(100vw - 16px), calc((100vh - 58px) * 16 / 9));
	}
}

@media (prefers-reduced-motion: reduce) {
	.wt-youtube-pip *,
	.wt-youtube-pip *::before,
	.wt-youtube-pip *::after {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}
