:root {
	color-scheme: light;
	--bg: #f4f0e8;
	--surface: rgb(227 231 234 / 92%);
	--surface-strong: #f2f8ff;
	--border: rgb(33 48 73 / 12%);
	--text: #181d2f;
	--muted: #4e6582;
	--accent: #ff795e;
	--accent-dark: #1e3651;
	--danger: #a12c1f;
	--shadow: 0 18px 60px rgba(83, 59, 36, 0.12);
	--radius: 22px;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
	color: var(--text);
	background:
		radial-gradient(circle at top left, rgb(12 14 19), transparent 28%),
		radial-gradient(circle at top right, rgb(29 38 53), transparent 30%),
		linear-gradient(180deg, #303949 0%, #0f141d 100% 100%);
	min-height: 100vh;
	overflow-x: hidden;
}

.upload-overlay {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	background: rgba(37, 27, 17, 0.56);
	backdrop-filter: blur(8px);
	z-index: 1000;
	padding: 24px;
}

.upload-overlay.hidden {
	display: none;
}

.upload-overlay-card {
	width: min(540px, 100%);
	padding: 32px;
	background: rgba(255, 250, 242, 0.96);
	border: 1px solid var(--border);
	border-radius: 28px;
	box-shadow: var(--shadow);
	text-align: center;
}

.progress-track {
	width: 100%;
	height: 18px;
	border-radius: 999px;
	background: rgba(14, 124, 102, 0.12);
	overflow: hidden;
	margin-top: 20px;
}

.progress-fill {
	width: 0%;
	height: 100%;
	background: linear-gradient(90deg, #0e7c66 0%, #c97728 100%);
	transition: width 0.18s ease;
}

.upload-progress-text {
	margin-top: 14px;
	font-weight: 700;
	font-size: 1.05rem;
}

.audio-modal {
	position: fixed;
	inset: 0;
	z-index: 1100;
	display: grid;
	place-items: center;
	padding: 24px;
}

.audio-modal.hidden {
	display: none;
}

.audio-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 15, 23, 0.72);
	backdrop-filter: blur(10px);
}

.audio-modal-card {
	position: relative;
	width: min(680px, 100%);
	padding: 28px;
	background: #ffffff;
	border: 1px solid var(--border);
	border-radius: 24px;
	box-shadow: var(--shadow);
}

.audio-modal-header {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	align-items: flex-start;
	margin-bottom: 18px;
}

.audio-player {
	width: 100%;
}

.login-page,
.page-shell {
	min-height: 100vh;
}

.auth-shell,
.page-shell {
	width: min(1400px, calc(100vw - 32px));
	margin: 0 auto;
	padding: 32px 0 48px;
}

.auth-shell {
	display: grid;
	place-items: center;
}

.auth-card,
.panel,
.hero-card,
.job-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.hero-card {
	/* background: var(--accent);
	color: white; */
}

.logo {
	width: 100%;
	height: auto;
	max-width: 200px;
}

.auth-card {
	width: min(420px, 100%);
	padding: 32px;
}

.hero-card {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	align-items: center;
	margin-bottom: 24px;
	padding: 28px;
}

.layout-grid {
	display: grid;
	grid-template-columns: minmax(300px, 380px) 1fr;
	gap: 24px;
}

.panel {
	padding: 24px;
	min-width: 0;
}

.panel-header,
.job-topline,
.job-actions,
.job-meta {
	display: flex;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
}

.job-meta {
	margin-top: 1em;
}

.job-topline {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	justify-content: space-between;
	flex-wrap: wrap;
	flex-direction: column;
	align-content: flex-start;
	margin-bottom: 1em;
}

.job-topline H3 {
	margin-bottom: 0px;
}

P:last-of-type {
	margin-bottom: 0px;
}

.jobs-list {
	display: grid;
	gap: 16px;
	min-width: 0;
}

.job-card {
	padding: 18px;
	min-width: 0;
	border-radius: 14px;
}

.stack {
	display: grid;
	gap: 14px;
}

.turnstile-wrap {
	min-height: 65px;
}

.hidden {
	display: none !important;
}

.source-mode-shell {
	display: grid;
	gap: 10px;
}

.source-mode-label {
	font-size: 0.95rem;
}

.source-mode-picker {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.source-mode-option {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: var(--surface-strong);
}

.source-mode-option input {
	width: auto;
	margin: 0;
}

.checkbox-row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.checkbox-row input {
	width: auto;
	margin: 0;
}

label {
	display: grid;
	gap: 8px;
	font-size: 0.95rem;
}

input,
select,
button {
	font: inherit;
}

input,
select {
	width: 100%;
	padding: 12px 14px;
	border-radius: 14px;
	border: 1px solid var(--border);
	background: var(--surface-strong);
}

button,
.small-button,
.ghost-button {
	border: 0;
	border-radius: 999px;
	padding: 12px 18px;
	background: var(--accent);
	color: white;
	text-decoration: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.small-button {
	padding: 10px 14px;
}

.ghost-button {
	background: #ffffff4f;
	color: var(--text);
	border: 1px solid var(--border);
}

.secondary-button {
	background: #c97728;
}

.danger-button {
	background: var(--danger);
}

.danger-button:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

button:hover,
.small-button:hover,
.ghost-button:hover {
	opacity: 0.92;
}

button.is-busy,
.small-button.is-busy,
.ghost-button.is-busy {
	cursor: wait;
	opacity: 0.8;
	gap: 8px;
}

.button-spinner {
	width: 0.9em;
	height: 0.9em;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	display: inline-block;
	animation: button-spin 0.75s linear infinite;
}

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

.eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--accent-dark);
	font-size: 0.76rem;
	margin: 0;
}

h1,
h2,
h3,
p {
	margin-top: 0;
}

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

.pill {
	border-radius: 999px;
	padding: 6px 10px;
	background: rgba(14, 124, 102, 0.1);
	color: var(--accent-dark);
	font-size: 0.82rem;
}

.status-pill {
	max-width: min(260px, 100%);
	white-space: normal;
	text-align: center;
}

.status-running {
	background: rgba(201, 119, 40, 0.16);
	color: #7a4310;
}

.status-completed {
	background: rgba(14, 124, 102, 0.14);
	color: var(--accent-dark);
}

.status-failed {
	background: rgba(161, 44, 31, 0.14);
	color: var(--danger);
}

.stage-line {
	font-weight: 600;
	margin: 14px 0 6px;
	display: none;
}

.dropbox-status {
	margin: 10px 0 0;
	max-width: 100%;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.dropbox-status a {
	overflow-wrap: anywhere;
	word-break: break-word;
}

.error-line,
.flash-error {
	color: var(--danger);
}

.file-list {
	list-style: none;
	padding: 0;
	margin: 10px 0 0;
	display: grid;
	gap: 8px;
}

.file-list li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	border-bottom: 1px solid var(--border);
	padding-bottom: 8px;
	min-width: 0;
}

.file-entry {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.file-list a {
	color: var(--accent-dark);
	text-decoration: none;
	overflow-wrap: anywhere;
}

.file-redo-button {
	width: 26px;
	min-width: 26px;
	height: 26px;
	padding: 0;
	border-radius: 999px;
	background: rgba(14, 124, 102, 0.12);
	color: var(--accent-dark);
	border: 1px solid rgba(14, 124, 102, 0.18);
	font-size: 1.5rem;
	line-height: 1;
	display: inline-flex;
	flex-direction: row;
	align-content: center;
	justify-content: center;
	align-items: center;
	line-height: 1;
	padding-bottom: 0.1em;
}

.file-play-button {
	width: 26px;
	min-width: 26px;
	height: 26px;
	padding: 0 0 0 1px;
	border-radius: 999px;
	background: rgba(201, 119, 40, 0.18);
	color: #7a4310;
	border: 1px solid rgba(201, 119, 40, 0.22);
	font-size: 0.95rem;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.file-dropbox-button {
	min-height: 26px;
	padding: 4px 8px;
	border-radius: 8px;
	background: #ffffff4f;
	color: var(--text);
	border: 1px solid var(--border);
	font-size: 0.8rem;
}

.file-dropbox-button:disabled {
	opacity: 0.65;
	cursor: default;
}

.legacy-new-version-button {
	display: none;
}

.log-tail {
	max-width: 100%;
	overflow-x: auto;
	overflow-y: auto;
	padding: 14px;
	border-radius: 6px;
	background: #201a16;
	color: #efe7de;
	font-size: 0.7rem;
	white-space: pre;
	overflow-wrap: normal;
}

.form-message {
	min-height: 1.2rem;
	color: var(--accent-dark);
}

details {
	margin-top: 14px;
	min-width: 0;
}

summary {
	cursor: pointer;
	font-weight: 600;
}

.source-context {
	display: flex;
	align-items: stretch;
	gap: 16px;
	padding: 14px 16px;
	border: 1px solid var(--border);
	border-radius: 16px;
	background: rgba(14, 124, 102, 0.08);
	flex-direction: column;
	align-content: flex-start;
}

.source-context.hidden {
	display: none;
}

.stats-footer {
	margin-top: 24px;
}

.stats-row {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 18px;
	align-items: start;
}

.stat-item {
	display: grid;
	gap: 10px;
	text-align: center;
	justify-items: center;
}

.stat-label {
	font-size: 0.76rem;
	letter-spacing: 0.12em;
	color: var(--muted);
	text-transform: uppercase;
}

.stat-value {
	font-weight: 700;
}

.youtube-cookies-item {
	align-content: start;
}

.cookies-form {
	display: grid;
	gap: 10px;
	width: 100%;
}

.cookies-form input[type="file"] {
	font-size: 0.9rem;
	padding: 10px 12px;
}

@media (max-width: 900px) {
	.layout-grid {
		grid-template-columns: 1fr;
	}

	.hero-card {
		flex-direction: column;
	}

	.stats-row {
		grid-template-columns: 1fr;
	}
}
