.shell {
	max-width: 1560px;
	margin: 0 auto;
	padding: var(--s-5) var(--s-7) var(--s-8);
	display: flex;
	flex-direction: column;
	gap: var(--s-5);
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-4);
	flex-wrap: wrap;
	min-height: var(--ctl-h-lg);
	padding: 0 0 var(--s-4);
	border-bottom: 1px solid var(--line);
}

.topbar-actions {
	display: flex;
	align-items: center;
	gap: var(--s-3);
	flex-wrap: wrap;
}

.upload-layout {
	display: flex;
	flex-direction: column;
	gap: var(--s-7);
}

.upload-tablet {
	padding: var(--s-9) var(--s-8);
	border: 1px solid var(--line-hi);
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--s-5);
	min-height: 300px;
	transition: background-color var(--t-color) var(--ease), border-color var(--t-color) var(--ease);
}
.upload-tablet.drag-over {
	background: var(--raised);
	border-color: var(--marble);
}
.upload-lead {
	color: var(--mute);
	font-size: var(--fs-body);
	max-width: 52ch;
}
.upload-meta {
	color: var(--mute);
	font-size: var(--fs-small);
	font-variant-numeric: tabular-nums;
}
.upload-option {
	display: inline-flex;
	align-items: center;
	gap: var(--s-3);
	min-height: var(--ctl-h);
}
.upload-option-label {
	color: var(--marble);
	font-size: var(--fs-ui);
}

.progress-card {
	display: flex;
	flex-direction: column;
	gap: var(--s-4);
	padding: var(--s-6);
	border: 1px solid var(--line-hi);
}
.progress-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--s-4);
	flex-wrap: wrap;
}
.progress-track {
	width: 100%;
	height: var(--mark);
	background: var(--line-hi);
	overflow: hidden;
}
.progress-fill {
	height: 100%;
	width: 0%;
	background: var(--marble);
	transition: width var(--t-fast) var(--ease);
}
.progress-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-3);
	flex-wrap: wrap;
	color: var(--mute);
	font-size: var(--fs-ui);
	font-variant-numeric: tabular-nums;
}

.recent-section {
	display: flex;
	flex-direction: column;
	gap: var(--s-4);
}
.recent-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: var(--s-3);
}
.vod-card {
	display: flex;
	flex-direction: column;
	gap: var(--s-3);
	padding: var(--s-5) var(--s-6);
	background: var(--stone);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	transition: background-color var(--t-color) var(--ease), border-color var(--t-color) var(--ease);
}
.vod-card:hover {
	background: var(--raised);
	border-color: var(--line-hi);
}
.vod-card-title {
	font: 400 var(--fs-h3)/1.2 var(--display);
	color: var(--marble);
	word-break: break-word;
	transition: color var(--t-lit) var(--ease), text-shadow var(--t-lit) var(--ease);
}
.vod-card:hover .vod-card-title {
	color: var(--lit);
	text-shadow: var(--lit-glow);
}
.vod-card-stats {
	display: flex;
	align-items: center;
	gap: var(--s-4);
	flex-wrap: wrap;
	font-size: var(--fs-ui);
	font-variant-numeric: tabular-nums;
}
.stat-kill { color: var(--marble); font-weight: 500; }
.stat-death { color: var(--porphyry-ink); font-weight: 500; }
.stat-muted { color: var(--mute); }
.vod-card-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-2);
	margin-top: auto;
	padding-top: var(--s-2);
}

.review-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: var(--s-5);
	align-items: start;
}

.player-column {
	display: flex;
	flex-direction: column;
	gap: var(--s-4);
	min-width: 0;
}

.stage-slab {
	padding: var(--s-4);
	border: 1px solid var(--line-hi);
	display: flex;
	flex-direction: column;
	gap: var(--s-4);
}

.video-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-3);
	flex-wrap: wrap;
}
.video-title-wrap {
	display: flex;
	align-items: baseline;
	gap: var(--s-4);
	min-width: 0;
}
.video-title {
	font: 400 var(--fs-h3)/1.2 var(--display);
	color: var(--marble);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.video-specs {
	font-size: var(--fs-small);
	color: var(--mute);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.video-viewport {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: var(--cut);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	user-select: none;
}
.video-viewport video {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: contain;
	background: var(--cut);
}

.hud-flash {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	padding: var(--s-2) var(--s-5);
	border-radius: var(--radius);
	background: rgba(11, 10, 9, .88);
	box-shadow: inset 0 0 0 1px var(--line-hi);
	font: 400 var(--fs-h1-app)/1.1 var(--display);
	color: var(--lit);
	text-shadow: var(--lit-glow);
	pointer-events: none;
	opacity: 0;
	transition: opacity var(--t-fast) var(--ease);
}
.hud-flash.show { opacity: 1; }

.timeline-shell {
	display: flex;
	flex-direction: column;
	gap: var(--s-3);
	padding: var(--s-3) var(--s-4);
	background: var(--cut);
	border: 1px solid var(--line-hi);
	border-radius: var(--radius);
}

.timeline-top-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-3);
	flex-wrap: wrap;
}
.timeline-legend {
	display: flex;
	align-items: center;
	gap: var(--s-4);
	font-size: var(--fs-small);
	color: var(--mute);
}
.legend-kill { color: var(--marble); }
.legend-death { color: var(--porphyry-ink); }
.legend-assist { color: var(--mute); }
.legend-revive { color: var(--mute); }

.timeline-viewport {
	position: relative;
	width: 100%;
	overflow-x: auto;
	padding: var(--s-1) var(--s-2);
}

.timeline-track {
	position: relative;
	height: 52px;
	min-width: 100%;
	background: var(--basalt);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	cursor: pointer;
	touch-action: none;
	user-select: none;
}

.track-centerline {
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 1px;
	background: var(--line);
	pointer-events: none;
}
.track-buffered {
	position: absolute;
	left: 0;
	top: 50%;
	height: var(--mark);
	transform: translateY(-50%);
	background: var(--line-hi);
	pointer-events: none;
}
.track-played {
	position: absolute;
	left: 0;
	top: 50%;
	height: var(--mark);
	transform: translateY(-50%);
	background: var(--marble);
	pointer-events: none;
}

.track-playhead {
	position: absolute;
	top: 10px;
	bottom: 10px;
	width: 2px;
	background: var(--lit);
	transform: translateX(-1px);
	pointer-events: none;
	z-index: 4;
}
.track-playhead::before {
	content: "";
	position: absolute;
	top: -4px;
	left: -2px;
	width: 6px;
	height: 4px;
	border-radius: var(--radius-sm);
	background: var(--lit);
}

.track-marker {
	position: absolute;
	width: 10px;
	height: 20px;
	padding: 0;
	border: 0;
	background: transparent;
	transform: translateX(-50%);
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}
.track-marker::after {
	content: "";
	width: 3px;
	height: 14px;
	border-radius: var(--radius-sm);
	transition: transform var(--t-fast) var(--ease), width var(--t-fast) var(--ease);
}
.track-marker:hover::after,
.track-marker.active::after {
	width: 5px;
	transform: scaleY(1.2);
}
.track-marker.kill { top: 3px; }
.track-marker.kill::after { background: var(--marble); }
.track-marker.kill:hover::after,
.track-marker.kill.active::after { background: var(--lit); }
.track-marker.death { bottom: 3px; }
.track-marker.death::after { background: var(--porphyry-hi); }
.track-marker.assist { top: 6px; }
.track-marker.assist::after { height: 10px; background: var(--mute); }
.track-marker.revive { top: 6px; }
.track-marker.revive::after { height: 10px; background: rgba(235, 229, 218, .55); }

.track-hover-tip {
	position: absolute;
	bottom: calc(100% + 8px);
	transform: translateX(-50%);
	height: var(--h-sm);
	padding: 0 var(--pad-sm);
	display: inline-flex;
	align-items: center;
	border-radius: var(--radius);
	background: var(--raised);
	box-shadow: inset 0 0 0 1px var(--line-hi), var(--shadow-pop);
	font: 400 var(--fs-small)/1 var(--text);
	color: var(--marble);
	white-space: nowrap;
	pointer-events: none;
	z-index: var(--z-pop);
	font-variant-numeric: tabular-nums;
}

.controls-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-3);
	flex-wrap: wrap;
}
.controls-group {
	display: flex;
	align-items: center;
	gap: var(--s-2);
	flex-wrap: wrap;
}
.btn.compact {
	padding: 0 var(--ctl-pad);
}

.time-readout {
	padding: 0 var(--s-2);
	font: 400 var(--fs-label-display)/1 var(--display);
	color: var(--marble);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.time-readout span { color: var(--mute); }

.volume-wrap {
	display: inline-flex;
	align-items: center;
	gap: var(--s-2);
	height: var(--ctl-h);
	padding: 0 var(--s-3) 0 var(--s-1);
	background: var(--cut);
	border: 1px solid var(--line-ctl);
	border-radius: var(--radius);
}
.volume-bar {
	position: relative;
	width: 72px;
	height: 20px;
	display: flex;
	align-items: center;
	cursor: pointer;
	touch-action: none;
}
.volume-bar-bg {
	width: 100%;
	height: var(--mark);
	background: var(--line-hi);
	overflow: hidden;
}
.volume-bar-fill {
	height: 100%;
	width: 100%;
	background: var(--marble);
}

.secondary-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-4);
	flex-wrap: wrap;
	padding-top: var(--s-3);
	border-top: 1px solid var(--line);
}
.control-labeled {
	display: inline-flex;
	align-items: center;
	gap: var(--s-3);
}
.seg.compact button {
	padding: 0 var(--s-3);
	font-size: var(--fs-small);
	font-variant-numeric: tabular-nums;
}

.sidebar-panel {
	display: flex;
	flex-direction: column;
	gap: var(--s-4);
	padding: var(--s-5);
	border: 1px solid var(--line-hi);
	max-height: calc(100vh - 116px);
}

.summary-stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
}
.summary-stats > div {
	padding: var(--s-4) var(--s-3) var(--s-4) 0;
}
.summary-stats > div + div {
	padding-left: var(--s-4);
	border-left: 1px solid var(--line);
}
.summary-stats b {
	display: block;
	font: 400 var(--fs-stat)/1 var(--display);
	font-variant-numeric: tabular-nums;
	color: var(--marble);
}
.summary-stats .death b { color: var(--porphyry-ink); }
.summary-stats span {
	display: block;
	margin-top: var(--s-2);
	font-size: var(--fs-small);
	color: var(--mute);
}

.filter-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--s-2);
}
.filter-toggle {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-2);
	height: var(--ctl-h);
	padding: 0 var(--ctl-pad);
	background: var(--cut);
	border: 1px solid var(--line-hi);
	border-radius: var(--radius);
	color: var(--mute);
	font: 400 var(--fs-ui)/1 var(--text);
	cursor: pointer;
	transition: border-color var(--t-color) var(--ease), color var(--t-color) var(--ease), background-color var(--t-color) var(--ease);
}
.filter-toggle::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: var(--porphyry-hi);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform var(--t-move) var(--ease);
}
.filter-toggle:hover {
	border-color: var(--marble);
	color: var(--marble);
}
.filter-toggle[aria-pressed="true"] {
	background: var(--raised);
	border-color: var(--line-ctl);
	color: var(--lit);
}
.filter-toggle[aria-pressed="true"]::after {
	transform: scaleX(1);
}
.filter-toggle.kill[aria-pressed="true"]::after {
	background: var(--marble);
}
.filter-count {
	font-variant-numeric: tabular-nums;
	color: var(--mute);
}
.filter-toggle[aria-pressed="true"] .filter-count {
	color: var(--marble);
}
.filter-toggle.death[aria-pressed="true"] .filter-count {
	color: var(--porphyry-ink);
}

.events-scroll {
	flex: 1 1 auto;
	min-height: 220px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	border-top: 1px solid var(--line);
}

.event-row {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr) auto;
	align-items: center;
	gap: var(--s-3);
	width: 100%;
	min-height: var(--ctl-h);
	padding: var(--s-2) var(--s-3);
	border: 0;
	border-bottom: 1px solid var(--line);
	border-radius: 0;
	background: transparent;
	text-align: left;
	color: var(--marble);
	cursor: pointer;
	transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.event-row:hover { background: var(--raised); }
.event-row.active {
	background: var(--raised);
	color: var(--lit);
	text-shadow: var(--lit-glow);
}
.event-time {
	font: 400 var(--fs-ui)/1 var(--text);
	font-variant-numeric: tabular-nums;
	color: var(--mute);
}
.event-row.active .event-time { color: var(--marble); text-shadow: none; }
.event-name {
	font: 400 var(--fs-ui)/1.2 var(--text);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.event-tag {
	font: 500 var(--fs-caps-sm)/1 var(--text);
	letter-spacing: var(--track-caps-sm);
	text-transform: uppercase;
	color: var(--mute);
	text-shadow: none;
}
.event-tag.kill { color: var(--marble); }
.event-tag.death { color: var(--porphyry-ink); }

.events-empty {
	padding: var(--s-7) var(--s-4);
	text-align: center;
	color: var(--mute);
	font-size: var(--fs-ui);
}

.shortcuts-list {
	display: flex;
	flex-direction: column;
	margin-top: var(--s-4);
	border-top: 1px solid var(--line);
}
.shortcut-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-3);
	padding: var(--s-2) 0;
	border-bottom: 1px solid var(--line);
	font-size: var(--fs-ui);
	color: var(--mute);
}

.toast-fixed {
	position: fixed;
	left: 50%;
	bottom: var(--s-6);
	transform: translateX(-50%);
	pointer-events: none;
}

@media (max-width: 1120px) {
	.review-layout { grid-template-columns: minmax(0, 1fr); }
	.sidebar-panel { max-height: none; }
	.events-scroll { max-height: 420px; }
}

@media (max-width: 680px) {
	.shell { padding: var(--s-4); }
	.upload-tablet { padding: var(--s-7) var(--s-4); }
	.seg.compact button { padding: 0 var(--s-2); }
}
