/*Live preview in the Final video tab*/
.pv {
	margin-bottom: var(--s4);
}
/*Picture on the left, the owner's side panel (takes) on the right; the controls run the full width below*/
.pv-top {
	display: grid;
	grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
	gap: var(--s4);
	align-items: start;
}
/*The takes panel is exactly as tall as the picture beside it and scrolls inside*/
.pv-top {
	align-items: stretch;
	row-gap: 0;
}
.pv-side {
	position: relative;
	min-width: 0;
}
.pv-side > .panel {
	position: absolute;
	inset: 0;
	margin: 0;
	overflow-y: auto;
}
.pv-empty .pv-side > .panel {
	position: static;
}
.pv-empty .pv-only {
	display: none;
}
.pv-empty .pv-top {
	grid-template-columns: minmax(0, 1fr);
}
/*Headings take the first row of the grid, so the side's heading lines up with Preview*/
.pv-side-head:empty {
	display: none;
}
/*Narrow screens: picture, then its controls, then the takes*/
@media (max-width: 900px) {
	.pv {
		display: flex;
		flex-direction: column;
	}
	.pv-top {
		display: contents;
	}
	.pv-side-head {
		order: 9;
	}
	.pv-side {
		order: 10;
	}
	.pv-side > .panel {
		position: static;
	}
}
.pv-stage {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: 4px;
	background: #0d1424;
}
.pv-backing {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
}
.pv-card {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--s2);
	padding: var(--s3);
	text-align: center;
	pointer-events: none;
}
.pv-title {
	font: 600 clamp(1.1rem, 4.5vw, 2.4rem)/1.2 var(--font-display);
	color: #fff;
}
.pv-sub {
	font-size: clamp(0.85rem, 2.4vw, 1.2rem);
	color: var(--text-muted);
}
.pv-tiles {
	position: absolute;
	inset: 0;
}
.pv-tile {
	position: absolute;
	overflow: hidden;
}
.pv-tile[hidden] {
	display: none;
}
.pv-video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #0d1424;
}
.pv-who {
	position: absolute;
	left: 4px;
	bottom: 4px;
	max-width: 60%;
	padding: 1px 6px;
	border-radius: 3px;
	background: rgba(13, 20, 36, 0.7);
	color: #fff;
	font-size: 0.75rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	pointer-events: none;
}
.pv-bar {
	display: flex;
	align-items: center;
	gap: var(--s2);
	margin-top: var(--s2);
}
.pv-play {
	min-width: 84px;
	min-height: 44px;
}
.pv-time {
	font-variant-numeric: tabular-nums;
}
.pv-total {
	color: var(--text-muted);
}
.pv-range {
	width: 100%;
	margin: var(--s2) 0 0;
}
.pv-note {
	margin: var(--s2) 0 0;
}

/*Parts bar: placed by time over the slider below; inset by half the slider's thumb so the two line up*/
/*Above the parts bar: take count, screens and orientation for each sung part*/
.pv-seg-info {
	position: relative;
	height: 44px;
	margin: var(--s2) 8px 0;
}
.pv-info {
	position: absolute;
	top: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	gap: 3px;
	min-width: 4px;
	overflow: hidden;
	color: var(--text);
	font: 600 0.8rem/1 var(--font-display);
}
.pv-info.is-none .pv-info-n {
	color: var(--text-muted);
	font-weight: 400;
}
.pv-info-lo {
	display: grid;
	gap: 1px;
	width: 14px;
	height: 9px;
}
.pv-info-lo > span {
	border: 1px solid var(--text-muted);
	border-radius: 1px;
}
.pv-info-lo > span.is-on {
	border-color: var(--text);
	background: var(--text);
}
.pv-info-way {
	display: block;
	height: 12px;
	color: var(--text-muted);
}
.pv-info-way svg {
	display: block;
}
.pv-empty .pv-seg-info {
	order: -1;
}
.pv-segs {
	position: relative;
	height: 30px;
	margin: var(--s2) 8px 0;
}
.pv-seg {
	position: absolute;
	top: 0;
	bottom: 0;
	min-width: 4px;
	padding: 0;
	border: 1px solid #0d1424;
	border-radius: 3px;
	background: var(--bg-raised);
	color: #0d1424;
	font: 600 0.8rem/1 var(--font-display);
	overflow: hidden;
	cursor: pointer;
	touch-action: manipulation;
	opacity: 0.55;
}
.pv-seg.is-off {
	opacity: 0.35;
}
.pv-seg.is-now {
	opacity: 1;
}
/*Selected: full strength with a bar beneath. Final: a tick and a white inset border.*/
.pv-seg.is-selected {
	opacity: 1;
	z-index: 1;
	box-shadow: 0 4px 0 -1px #fff;
}
.pv-seg.is-final {
	opacity: 1;
	outline: 2px solid #fff;
	outline-offset: -3px;
}
.pv-seg.is-final.is-selected {
	z-index: 1;
}
.pv-seg:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: -2px;
	z-index: 2;
}
.pt-takes-prompt[hidden] {
	display: none;
}
/*Nothing to play yet: the bar sits above the takes on its own*/
.pv-empty {
	display: flex;
	flex-direction: column;
}
.pv-empty .pv-segs {
	order: -1;
	margin-bottom: var(--s4);
}
.pv-foot {
	margin-top: var(--s4);
}
/*Narrow screens: the Finalise bar comes last, after the takes*/
@media (max-width: 900px) {
	.pv-foot {
		order: 11;
	}
}
/*Finalise all takes: centred under the controls*/
.pv-foot .final-bar {
	justify-content: center;
	text-align: center;
}
.pv-seg-info + .pv-segs {
	margin-top: 3px;
}
.pv-fill {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--s2);
	margin: var(--s3) 8px 0;
}
.pv-stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 2px;
	min-width: 104px;
	padding: 6px 10px;
	border: 1px solid var(--line);
	border-radius: 4px;
	background: var(--bg-sunk);
}
.pv-stat-label {
	font-size: 0.75rem;
	color: var(--text-muted);
}
.pv-stat-value {
	font: 600 1.05rem/1.2 var(--font-mono);
	font-variant-numeric: tabular-nums;
}
.pv-stat.is-done .pv-stat-value {
	color: var(--ok);
}
.pv-empty .pv-fill {
	order: -1;
}

/*Movable borders between a part's screens, over the stage*/
.bd-layer {
	position: absolute;
	inset: 0;
	z-index: 5;
	pointer-events: none;
}
.bd-handle {
	position: absolute;
	z-index: 2;
	pointer-events: auto;
	touch-action: none;
}
.bd-handle.bd-x {
	z-index: 3;
	width: 16px;
	margin-left: -8px;
	cursor: col-resize;
}
.bd-handle.bd-y {
	height: 16px;
	margin-top: -8px;
	cursor: row-resize;
}
.bd-handle::before {
	content: "";
	position: absolute;
	transition: background 0.12s;
}
.bd-x::before {
	left: 7px;
	width: 2px;
	top: 0;
	bottom: 0;
}
.bd-y::before {
	top: 7px;
	height: 2px;
	left: 0;
	right: 0;
}
.bd-grip {
	position: absolute;
	background: var(--text);
	border-radius: 3px;
	opacity: 0;
	transition: opacity 0.12s;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
}
.bd-x .bd-grip {
	left: 5px;
	width: 6px;
	height: 34px;
	top: calc(50% - 17px);
}
.bd-y .bd-grip {
	top: 5px;
	height: 6px;
	width: 34px;
	left: calc(50% - 17px);
}
.pv-stage:hover .bd-grip,
.bd-handle:focus-visible .bd-grip {
	opacity: 0.85;
}
.bd-handle:hover::before,
.bd-handle.is-drag::before,
.bd-handle:focus-visible::before {
	background: var(--accent);
}
.bd-handle:hover .bd-grip,
.bd-handle.is-drag .bd-grip {
	background: var(--accent);
	opacity: 1;
}
.bd-handle:focus-visible {
	outline: none;
}
.bd-guide {
	position: absolute;
	pointer-events: none;
	border: 0 dashed rgba(231, 183, 95, 0.8);
}
.bd-guide-x {
	border-left-width: 1px;
	top: 0;
	bottom: 0;
}
.bd-guide-y {
	border-top-width: 1px;
}
.bd-snap {
	position: absolute;
	z-index: 4;
	pointer-events: none;
	transform: translate(-50%, 0);
	background: var(--accent);
	color: var(--accent-ink);
	font-weight: 700;
	font-size: 12px;
	padding: 2px 8px;
	border-radius: 10px;
	white-space: nowrap;
}
.bd-dims {
	position: absolute;
	z-index: 1;
	pointer-events: none;
	transform: translate(-50%, -50%);
	background: rgba(6, 10, 18, 0.88);
	border: 1px solid rgba(255, 255, 255, 0.18);
	padding: 4px 10px;
	border-radius: 6px;
	font: 600 13px var(--font-mono, ui-monospace, monospace);
	white-space: nowrap;
	text-align: center;
	color: var(--text);
}
.bd-dims small {
	display: block;
	font: 600 11.5px var(--font);
	color: var(--accent);
}
.bd-dims.is-exact small {
	color: var(--ok);
}
.bd-dims .way {
	justify-content: center;
	margin-top: 2px;
}

/*Which way to hold the phone, from a screen's shape*/
.way {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-weight: 600;
	font-size: 12px;
	white-space: nowrap;
}
.way svg {
	flex: none;
}
.way-portrait {
	color: #9fd0f2;
}
.way-landscape {
	color: #c8e3a0;
}
.way-either {
	color: #d8cbe8;
}
