/*Takes in the editor and the alignment view. Phone first, widened with min-width queries*/

/*Takes: state dots, slice marks on the timeline and the Takes panel*/
.tk-dot {
	display: inline-block;
	flex: none;
	width: 12px;
	height: 12px;
	border: 2px solid var(--text-muted);
	border-radius: 50%;
}
.tk-new {
	border-color: var(--accent);
	background: var(--accent);
}
.tk-in {
	border-color: var(--ok);
	background: var(--ok);
}
.tk-out {
	opacity: 0.7;
}
.tk-failed {
	border-color: var(--danger);
	background: var(--danger);
}
.tk-processing {
	border-style: dashed;
	border-color: var(--blue);
	animation: spin 1.8s linear infinite;
}
.tl-takes {
	position: absolute;
	top: 6px;
	right: 6px;
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 4px 6px;
	background: rgba(10, 16, 29, 0.78);
	font-size: 0.8125rem;
	color: var(--text-muted);
}
.tk-list {
	display: flex;
	flex-direction: column;
	gap: var(--s4);
}
.tk-group {
	border: 1px solid var(--line);
	background: rgba(10, 16, 29, 0.45);
}
.tk-group-title {
	display: flex;
	align-items: baseline;
	gap: var(--s2);
	padding: var(--s2) var(--s3);
	border-bottom: 1px solid var(--line-soft);
	font-family: var(--font);
	font-size: 1rem;
	font-weight: 600;
}
.tk-num {
	font-family: var(--font-mono);
	color: var(--accent);
}
.tk-row {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: var(--s3);
	width: 100%;
	min-height: 60px;
	padding: var(--s2) var(--s3);
	border: none;
	border-bottom: 1px solid var(--line-soft);
	background: transparent;
	color: var(--text);
	text-align: left;
	font: inherit;
	cursor: pointer;
	touch-action: manipulation;
}
.tk-row:last-child {
	border-bottom: none;
}
.tk-row:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.05);
}
.tk-row:disabled {
	cursor: default;
	opacity: 0.75;
}
.tk-main {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.tk-email {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.tk-sub {
	font-size: 0.9rem;
	color: var(--text-muted);
}
.tk-row.is-low .tk-sub {
	color: var(--accent);
}
.tk-state {
	display: inline-block;
	padding: 2px 8px;
	border: 1px solid var(--line);
	border-radius: 2px;
	font-size: 0.875rem;
	font-weight: 600;
	white-space: nowrap;
	color: var(--text-muted);
}
.tk-state-new {
	color: var(--accent);
}
.tk-state-in {
	color: var(--ok);
}
.tk-state-failed {
	color: var(--danger);
}
.tk-state-processing {
	color: var(--blue);
}

/*Alignment view*/
.al-head {
	margin-bottom: var(--s3);
}
.al-title {
	font-size: 1.5rem;
}
.al-sub {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--s2);
	margin: var(--s1) 0 0;
	color: var(--text-muted);
}
.al-email {
	overflow-wrap: anywhere;
}
.al-body {
	display: grid;
	gap: var(--s4);
}
.al-body .panel {
	margin-bottom: 0;
}
.al-body .notice {
	margin: 0;
}
.al-warn {
	border-color: var(--accent);
}
.al-wavepanel {
	position: sticky;
	top: 0;
	z-index: 20;
	padding: var(--s3);
	background: var(--bg-raised);
	box-shadow: 0 6px 16px rgba(5, 8, 16, 0.5);
}
.al-readout {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: var(--s3);
	margin-bottom: var(--s2);
}
.al-readout-main {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.3;
}
.al-label,
.al-offset-sub,
.al-playhead-read {
	font-size: 0.85rem;
	color: var(--text-muted);
}
.al-offset-val {
	font: 600 1.6rem/1.2 var(--font-mono);
}
.al-time {
	font-family: var(--font-mono);
	color: var(--text);
}
.al-video {
	flex: none;
	width: 96px;
	height: 72px;
	object-fit: contain;
	background: #000;
	border: 1px solid var(--line);
}
.al-zoombar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s2);
	margin-bottom: var(--s2);
}
.al-hint {
	margin: 0;
	font-size: 0.85rem;
	color: var(--text-muted);
}
.al-zoombtns {
	display: flex;
	gap: var(--s2);
	flex: none;
}
.al-lanes {
	position: relative;
	border: 1px solid var(--line);
	user-select: none;
	-webkit-user-select: none;
}
.al-ruler {
	position: relative;
	height: 22px;
	overflow: hidden;
	background: var(--bg-sunk);
	border-bottom: 1px solid var(--line-soft);
	touch-action: pan-y;
	cursor: col-resize;
}
.al-tick {
	position: absolute;
	top: 0;
	bottom: 0;
	border-left: 1px solid var(--line);
}
.al-tick i {
	display: block;
	padding-left: 3px;
	font: normal 0.75rem/22px var(--font-mono);
	color: var(--text-muted);
}
.al-lane {
	position: relative;
	height: 84px;
	overflow: hidden;
	background: var(--bg-sunk);
	touch-action: pan-y;
}
.al-lane-backing {
	border-bottom: 1px solid var(--line);
	cursor: grab;
}
.al-lane-clip {
	cursor: ew-resize;
}
.al-canvas {
	position: absolute;
	left: 0;
	top: 0;
	display: block;
}
.al-region {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 0;
	background: rgba(235, 230, 218, 0.07);
	pointer-events: none;
}
.al-lane-label {
	position: absolute;
	top: 3px;
	left: 4px;
	padding: 0 6px;
	background: rgba(10, 16, 29, 0.75);
	font-size: 0.75rem;
	color: var(--text-muted);
	pointer-events: none;
}
.al-lane-msg {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.9rem;
	color: var(--text-muted);
	pointer-events: none;
}
.al-marks {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
}
.al-line {
	position: absolute;
	top: 22px;
	bottom: 0;
	left: 0;
	width: 0;
	border-left: 1px dashed rgba(235, 230, 218, 0.6);
	will-change: transform;
}
.al-chip {
	position: absolute;
	top: 64px;
	left: 4px;
	padding: 0 4px;
	background: rgba(10, 16, 29, 0.85);
	font-size: 0.7rem;
	white-space: nowrap;
	color: var(--text);
}
.al-chip-end {
	left: auto;
	right: 4px;
}
.al-playhead {
	position: absolute;
	top: 0;
	bottom: 0;
	left: -1px;
	width: 2px;
	background: var(--playhead);
	will-change: transform;
	z-index: 3;
}
.al-playhead-cap {
	position: absolute;
	top: 0;
	left: -6px;
	width: 14px;
	height: 12px;
	background: var(--playhead);
	clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.al-trim {
	position: absolute;
	top: 0;
	bottom: 0;
	left: -22px;
	width: 44px;
	z-index: 2;
	touch-action: none;
	cursor: ew-resize;
	will-change: transform;
}
.al-trim-grip {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 21px;
	width: 2px;
	background: var(--accent);
}
.al-trim-grip::after {
	content: "";
	position: absolute;
	top: 50%;
	left: -6px;
	width: 14px;
	height: 30px;
	transform: translateY(-50%);
	border-radius: 3px;
	background: var(--accent);
}
.al-trim.is-edge .al-trim-grip {
	opacity: 0.6;
}
.al-trim-tip {
	display: none;
	position: absolute;
	top: 3px;
	left: 28px;
	padding: 1px 5px;
	background: rgba(10, 16, 29, 0.9);
	font: 0.75rem var(--font-mono);
	white-space: nowrap;
}
.al-trim-end .al-trim-tip {
	left: auto;
	right: 28px;
}
.al-trim.is-dragging .al-trim-tip,
.al-trim:focus-visible .al-trim-tip {
	display: block;
}
.al-h {
	font-size: 1.15rem;
	margin-bottom: var(--s3);
}
.al-panel .panel-head .al-h {
	margin-bottom: 0;
}
.al-save {
	font-size: 0.9rem;
	color: var(--text-muted);
}
.al-toggles,
.al-decide-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--s2);
}
.al-toggle[aria-pressed="true"] {
	border-color: var(--blue);
	background: rgba(159, 180, 232, 0.2);
}
.al-decide {
	min-height: 56px;
	font-size: 1.05rem;
}
.btn.al-decide-in.is-on,
.btn.al-decide-in.is-on:hover:not(:disabled) {
	border-color: var(--ok);
	background: var(--ok);
	color: #06210f;
}
.btn.al-decide-out.is-on,
.btn.al-decide-out.is-on:hover:not(:disabled) {
	border-color: var(--danger);
	background: var(--danger);
	color: #2a0d09;
}
.al-state-note {
	margin: var(--s3) 0 0;
}
.al-slider {
	margin-top: var(--s3);
}
.al-h + .al-slider {
	margin-top: 0;
}
.al-slider label {
	font-weight: 600;
}
.al-muted {
	font-weight: 400;
	color: var(--text-muted);
}
.al-slider-row {
	display: flex;
	align-items: center;
	gap: var(--s3);
}
.al-range {
	flex: 1;
	min-width: 0;
	height: var(--tap);
	margin: 0;
	background: transparent;
	accent-color: var(--accent);
	touch-action: pan-y;
}
.al-range-read {
	min-width: 4.8em;
	text-align: right;
	font: 600 1rem var(--font-mono);
}
.al-trimrow {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s3);
	margin-top: var(--s3);
}
.al-trim-read {
	margin: 0;
	font-size: 0.95rem;
}
.al-reset {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--s3);
}
.al-auto {
	margin: 0;
}
.al-nudges {
	display: flex;
	gap: 6px;
}
.al-nudge {
	min-width: 46px;
	padding: 0 4px;
	font: 600 0.95rem var(--font-mono);
}
.al-loop.is-on {
	border-color: var(--blue);
	background: rgba(159, 180, 232, 0.2);
	color: var(--blue);
}
@media (min-width: 900px) {
	.al-body {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		align-items: start;
	}
	.al-wavepanel,
	.al-body > .notice {
		grid-column: 1 / -1;
	}
	.al-lane {
		height: 120px;
	}
	.al-chip {
		top: 100px;
	}
	.al-video {
		width: 160px;
		height: 120px;
	}
	.al-hint {
		font-size: 0.95rem;
	}
	.al-nudge {
		min-width: 60px;
	}
	.al-dock .transport {
		justify-content: flex-start;
	}
}
