@font-face {
	font-family: "DejaVu Sans";
	src: url("../vendor/DejaVuSans-Bold.ttf") format("truetype");
	font-weight: 700;
	font-display: swap;
}

:root {
	color-scheme: dark;

	--ink: #eef0e9;
	--muted: #969d94;
	--accent: #c4f366;
	--surface: #191e1a;
	--border: #30372e;
	--bs-body-bg: #111510;
	--bs-body-color: #eef0e9;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: #111510;
	color: var(--ink);
	font-family: "Segoe UI", Arial, sans-serif;
	font-size: 14px;
}

a {
	color: inherit;
	text-decoration: none;
}

button,
input,
select,
textarea {
	font: inherit;
}

button,
a,
input,
select,
textarea {
	touch-action: manipulation;
}

input,
select,
textarea {
	background: #111610;
	border: 1px solid #3c4438;
	color: var(--ink);
	border-radius: 6px;
	padding: 9px 11px;
	min-width: 0;
}

input:disabled,
button:disabled,
select:disabled,
textarea:disabled {
	opacity: 0.45;
	cursor: default;
}

input[type="checkbox"] {
	accent-color: var(--accent);
	width: 15px;
	height: 15px;
}

.local-source {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin: -8px 0 24px;
	color: var(--muted);
	font-size: 11px;
}

.local-source input {
	max-width: 100%;
	padding: 6px;
	font-size: 11px;
}

a:hover {
	color: var(--accent);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
}

.site-header {
	height: 86px;
	padding: 0 5%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid var(--border);
}

.brand {
	display: flex;
	align-items: center;
	gap: 11px;
	font-size: 21px;
	font-weight: 700;
	letter-spacing: -0.8px;
}

.brand-light {
	color: var(--accent);
	font-weight: 400;
	margin-left: 4px;
}

.header-links {
	display: flex;
	align-items: center;
	gap: 23px;
	font-size: 13px;
}

.pill {
	padding: 6px 9px;
	border: 1px solid var(--border);
	border-radius: 4px;
	color: #a7b19f;
	font-size: 9px;
	font-weight: 600;
	letter-spacing: 1.3px;
}

main {
	max-width: 1500px;
	margin: auto;
	padding: 48px 5% 32px;
}

.intro {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 32px;
}

.eyebrow {
	color: var(--accent);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 2px;
	margin-bottom: 13px;
}

h1 {
	font-size: clamp(36px, 4vw, 55px);
	line-height: 1;
	letter-spacing: -2.3px;
	font-weight: 600;
	margin: 0 0 14px;
}

.intro p,
.intro-note {
	color: var(--muted);
	margin: 0;
	line-height: 1.8;
}

.intro-note {
	text-align: right;
	font-size: 13px;
	border-left: 1px solid var(--border);
	padding-left: 24px;
}

.source-bar {
	background: var(--surface);
	padding: 17px 20px;
	border: 1px solid var(--border);
	border-radius: 10px;
	margin-bottom: 24px;
}

.source-bar > label {
	display: block;
	font-size: 11px;
	font-weight: 600;
	margin-bottom: 8px;
}

.source-input {
	display: flex;
	align-items: center;
	gap: 12px;
}

.source-input > span {
	color: var(--muted);
	font-size: 23px;
}

.source-input input {
	flex: 1;
	background: transparent;
	border: 0;
	padding-left: 0;
}

.btn {
	border: 1px solid #424d3a;
	background: #252e21;
	color: var(--ink);
	border-radius: 6px;
	padding: 9px 14px;
	font-size: 12px;
	white-space: nowrap;
	font-weight: 600;
}

.btn:hover {
	background: #35422d;
	color: #fff;
}

.btn.primary {
	background: var(--accent);
	border-color: var(--accent);
	color: #15200c;
}

.btn.primary:hover {
	background: #d6ff8d;
}

.primary-arrow {
	margin-left: 18px;
}

.editor-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
	align-items: start;
	gap: 22px;
}

.panel {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 10px;
}

.panel-heading {
	min-height: 65px;
	padding: 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

h2 {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: -0.2px;
}

.step {
	font-size: 10px;
	color: var(--accent);
	padding-right: 10px;
	font-variant-numeric: tabular-nums;
}

.muted,
.help {
	color: var(--muted);
}

.panel-heading > .muted {
	font-size: 11px;
}

.preview-stage {
	position: relative;
	background: #0a0e09;
	margin: 0 16px;
	overflow: hidden;
	container-type: inline-size;
	border: 1px solid #2a3026;
	border-radius: 6px;
}

.youtube-player,
.youtube-player iframe,
.caption-overlay {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.caption-overlay {
	pointer-events: none;
}

.preview-caption {
	position: absolute;
	left: 3.33%;
	width: 93.34%;
	text-align: center;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	font-family: "DejaVu Sans", sans-serif;
	font-weight: 700;
	line-height: 1.2;
	color: #fff;
	paint-order: stroke fill;
}

.preview-caption.top {
	top: 3.33%;
}

.preview-caption.center {
	top: 50%;
	transform: translateY(-50%);
}

.empty-preview {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	background: radial-gradient(ellipse at center, #26301c 0%, #10160e 70%);
	text-align: center;
	padding: 20px;
}

.play-symbol {
	display: grid;
	place-items: center;
	width: 64px;
	height: 64px;
	border: 1px solid #50603b;
	color: var(--accent);
	border-radius: 50%;
	font-size: 32px;
	margin-bottom: 20px;
}

h3 {
	font-size: 15px;
	font-weight: 500;
	margin: 0 0 8px;
}

.empty-preview p,
.empty-captions p {
	font-size: 12px;
	color: var(--muted);
	line-height: 1.8;
}

.empty-preview .pill {
	margin-top: 12px;
	font-size: 8px;
}

.playback {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 18px;
	font-size: 11px;
	font-variant-numeric: tabular-nums;
}

.outline-toggle {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--muted);
}

.timeline {
	border-top: 1px solid var(--border);
	padding: 20px;
}

.timeline-heading {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 10px;
	letter-spacing: 1px;
}

.duration-badge {
	color: var(--accent);
	font-variant-numeric: tabular-nums;
	letter-spacing: 0;
}

.range-wrap {
	overflow-x: auto;
	padding: 10px 0;
}

.range-wrap .pd-range {
	width: max-content;
}

.pd-range .track.outer {
	fill: #384132;
}

.pd-range .track.inner {
	fill: #6e9242;
}

.pd-range .handle {
	fill: var(--accent);
	cursor: ew-resize;
}

.range-fields {
	display: flex;
	align-items: center;
	gap: 16px;
}

.range-fields label {
	display: flex;
	align-items: center;
	gap: 9px;
	color: var(--muted);
	font-size: 11px;
}

.range-fields input {
	width: 86px;
	color: var(--ink);
	font-variant-numeric: tabular-nums;
}

.help {
	margin: 12px 0 0;
	font-size: 11px;
	line-height: 1.7;
}

.video-title {
	border-top: 1px solid var(--border);
	padding: 15px 20px;
	font-size: 12px;
	color: var(--muted);
}

.count,
.position-badge {
	background: #283222;
	color: #b2c89f;
	border-radius: 4px;
	padding: 4px 7px;
	font-size: 10px;
	white-space: nowrap;
}

.caption-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 20px 18px;
	font-size: 11px;
}

.caption-table-wrap {
	min-height: 210px;
	max-height: 340px;
	overflow: auto;
	border-top: 1px solid var(--border);
}

.caption-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}

.caption-table th {
	color: var(--muted);
	font-size: 10px;
	font-weight: 400;
	text-align: left;
	background: #1e251c;
	padding: 11px 12px;
}

.caption-table th:first-child {
	width: 52%;
	padding-left: 20px;
}

.caption-table th:nth-child(2) {
	width: 19%;
}

.caption-table th:nth-child(3) {
	width: 21%;
}

.caption-table td {
	padding: 10px 12px;
	border-top: 1px solid #2b3327;
	vertical-align: middle;
}

.caption-table td:first-child {
	padding-left: 20px;
}

.caption-table tr.active td {
	background: #26331f;
}

.caption-select {
	display: block;
	border: 0;
	background: transparent;
	padding: 0;
	color: var(--ink);
	text-align: left;
	cursor: pointer;
	width: 100%;
}

.caption-select span {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 12px;
}

.caption-select small {
	display: block;
	margin-top: 5px;
	color: var(--muted);
	font-size: 9px;
}

.time-cell {
	font-size: 10px;
	line-height: 1.7;
	font-variant-numeric: tabular-nums;
}

.icon-button {
	color: #a4ad9b;
	border: 0;
	background: transparent;
	cursor: pointer;
	font-size: 20px;
	padding: 0;
}

.empty-captions {
	text-align: center;
	padding: 30px 10px;
}

.empty-captions > span {
	font-family: Georgia, serif;
	color: #71895a;
	font-size: 40px;
	letter-spacing: -4px;
}

.empty-captions h3 {
	font-size: 13px;
}

.empty-captions p {
	font-size: 11px;
}

.caption-edit {
	padding: 18px 20px;
	border-top: 1px solid var(--border);
}

.caption-edit label,
.output-options label {
	display: block;
	font-size: 11px;
}

.caption-edit textarea {
	width: 100%;
	margin-top: 8px;
	resize: vertical;
}

.edit-fields {
	display: flex;
	gap: 12px;
	margin-top: 12px;
}

.edit-fields label {
	flex: 1;
}

.edit-fields input,
.edit-fields select {
	display: block;
	width: 100%;
	margin-top: 6px;
}

.check-row {
	display: flex;
	gap: 20px;
	margin-top: 8px;
}

.check-row label {
	display: flex;
	align-items: center;
	gap: 7px;
	color: var(--muted);
}

.import-bar {
	margin: 0 20px 18px;
	padding: 12px;
	background: #20291b;
	border: 1px solid #394b2a;
	border-radius: 6px;
	font-size: 11px;
}

.import-bar > div {
	display: flex;
	gap: 8px;
	margin: 8px 0;
}

.import-bar select {
	width: 100%;
	font-size: 11px;
}

.import-bar small {
	font-size: 10px;
	color: var(--muted);
}

.inset {
	margin: 0 20px 16px;
}

.export-panel {
	display: flex;
	align-items: center;
	gap: 28px;
	margin-top: 24px;
	padding: 24px;
}

.export-heading {
	flex: 1;
}

.export-heading p {
	color: var(--muted);
	font-size: 11px;
	margin: 10px 0 0 25px;
}

.output-options {
	display: flex;
	gap: 12px;
}

.output-options input {
	display: block;
	width: 90px;
	margin-top: 6px;
}

.output-options small {
	display: block;
	color: var(--muted);
	font-size: 9px;
	margin-top: 6px;
}

.generate {
	display: flex;
	flex-direction: column;
	gap: 9px;
	align-items: center;
}

.generate-button {
	padding: 14px 22px;
}

.generate > span {
	color: var(--muted);
	font-size: 9px;
}

.notice {
	background: #24301c;
	border: 1px solid #465b32;
	padding: 12px 16px;
	margin-bottom: 18px;
	border-radius: 6px;
	color: #c4d8b1;
}

.notice.error {
	color: #ffc2ba;
	border-color: #72463e;
	background: #35221f;
}

.processing {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 20px 0;
	color: var(--accent);
}

.spinner {
	width: 16px;
	height: 16px;
	border: 2px solid #465b32;
	border-top-color: var(--accent);
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.text-button {
	color: var(--muted);
	background: transparent;
	border: 0;
	text-decoration: underline;
}

.result {
	margin-top: 24px;
	padding: 24px;
	display: flex;
	gap: 24px;
	justify-content: space-between;
	align-items: center;
}

.result img {
	max-width: 50%;
	max-height: 500px;
	object-fit: contain;
}

.download-link {
	display: inline-block;
	color: var(--accent);
	margin-top: 20px;
}

footer {
	max-width: 1500px;
	margin: auto;
	padding: 0 5% 28px;
	display: flex;
	justify-content: space-between;
	color: #7c8775;
	font-size: 10px;
	gap: 20px;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
}

.boot {
	padding: 100px;
	text-align: center;
	color: var(--accent);
}

#blazor-error-ui {
	display: none;
	background: #722c20;
	padding: 20px;
	position: fixed;
	bottom: 0;
	width: 100%;
	z-index: 1000;
}

@media (max-width: 1100px) {
	.export-panel {
		flex-wrap: wrap;
	}

	.export-heading {
		flex-basis: 100%;
	}

	.output-options {
		flex: 1;
	}

	.editor-grid {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}

	.panel-heading {
		flex-wrap: wrap;
	}
}

@media (max-width: 780px) {
	.editor-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	main {
		padding-top: 32px;
	}

	.intro-note,
	.header-links .pill {
		display: none;
	}

	.site-header {
		height: 70px;
	}

	.brand {
		font-size: 17px;
	}

	.header-links {
		font-size: 10px;
	}

	.source-input {
		flex-wrap: wrap;
	}

	.source-input input {
		min-width: 60%;
	}

	.source-input .btn {
		width: 100%;
	}

	.export-panel {
		gap: 20px;
	}

	.generate {
		width: 100%;
	}

	.generate .btn {
		width: 100%;
	}

	footer {
		flex-direction: column;
		gap: 10px;
	}

	.result {
		flex-direction: column;
	}

	.result img {
		max-width: 100%;
	}
}
