/* Brian — jobView */

.app { max-width: 1400px; }
.topbar h1 { font-size: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 700px; }
.topbar { margin-bottom: 24px; }

/* Type badge (top-right) */
.type-badge {
	display: inline-flex; flex-direction: column; align-items: center;
	padding: 8px 16px;
	background: linear-gradient(135deg, var(--brand-lt) 0%, var(--brand) 100%);
	color: #fff;
	border-radius: var(--radius-sm);
	box-shadow: 0 6px 20px -6px rgba(237,23,76,0.6), inset 0 1px 0 rgba(255,255,255,0.18);
	line-height: 1;
	user-select: none;
}
.type-badge .code {
	font-family: 'JetBrains Mono', monospace;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.type-badge .name {
	font-size: 9px;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	opacity: 0.9;
	margin-top: 4px;
}

.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 1000px) { .info-grid { grid-template-columns: 1fr; } }

.card-header { padding: 12px 16px; }
.card-body { padding: 16px; }

.kv { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; row-gap: 8px; font-size: 13px; }
.kv dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; align-self: center; }
.kv dd { margin: 0; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text); }
.kv dd.muted { color: var(--muted); }

/* jobView uses a tighter pill */
.pill {
	padding: 3px 9px;
	font-size: 10px;
	font-family: 'JetBrains Mono', monospace;
}
.pill::before { width: 5px; height: 5px; }

/* ----- Nuclear-launch processing banner ----- */
.nuke {
	position: relative;
	margin-bottom: 22px;
	padding: 18px 22px;
	border: 2px solid #ff2d55;
	border-radius: var(--radius);
	background: repeating-linear-gradient(45deg, rgba(255,45,85,0.18) 0 12px, rgba(0,0,0,0.4) 12px 24px);
	color: #fff;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	font-weight: 700;
	font-family: 'JetBrains Mono', monospace;
	font-size: 13px;
	display: flex; align-items: center; gap: 16px;
	animation: nukeBlink 0.85s steps(2) infinite;
	overflow: hidden;
}
.nuke::before {
	content: ''; position: absolute; inset: 0;
	background: radial-gradient(ellipse at center, rgba(255,45,85,0.35), transparent 60%);
	pointer-events: none;
	animation: nukePulse 1.2s ease-in-out infinite;
}
.nuke .siren {
	width: 32px; height: 32px; flex-shrink: 0;
	border-radius: 50%;
	background: radial-gradient(circle at 50% 50%, #fff 0 4px, #ff2d55 5px 50%);
	box-shadow: 0 0 18px #ff2d55, 0 0 36px rgba(255,45,85,0.5);
	animation: nukeRotate 1.2s linear infinite;
}
.nuke .stripe { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; z-index: 1; }
.nuke .stripe .big { font-size: 18px; letter-spacing: 0.3em; }
.nuke .stripe .sub { font-size: 11px; letter-spacing: 0.2em; color: #ffb8c4; opacity: 0.85; text-transform: uppercase; }
.nuke .timer {
	font-size: 22px; letter-spacing: 0.1em; color: #ff2d55;
	text-shadow: 0 0 10px rgba(255,45,85,0.8);
	z-index: 1;
	font-variant-numeric: tabular-nums;
}
@keyframes nukeBlink {
	0%, 49.99% { border-color: #ff2d55; }
	50%, 100%  { border-color: rgba(255,45,85,0.35); }
}
@keyframes nukePulse {
	0%, 100% { opacity: 0.35; }
	50%      { opacity: 0.85; }
}
@keyframes nukeRotate {
	0%   { transform: rotate(0deg); box-shadow: 0 0 18px #ff2d55; }
	50%  { box-shadow: 0 0 32px #ff2d55, 0 0 64px rgba(255,45,85,0.7); }
	100% { transform: rotate(360deg); box-shadow: 0 0 18px #ff2d55; }
}

.section-header { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 0 14px; }
.section-header h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.section-header .meta { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); }
.section-header .meta strong { color: var(--text); font-weight: 500; }

/* Pair grid */
.pair-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.pair {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	cursor: pointer;
	transition: border-color 0.15s, transform 0.05s, box-shadow 0.2s;
	contain: layout paint style;
	content-visibility: auto;
	contain-intrinsic-size: 320px 165px;
}
.pair:hover { border-color: var(--brand); box-shadow: 0 8px 32px -12px rgba(237,23,76,0.4); }
.pair:active { transform: translateY(1px); }
.pair.no-after { cursor: default; }
.pair.no-after:hover { border-color: var(--border); box-shadow: none; }

/* Next-up: highlights the first awaiting pair while processing */
.pair.next-up {
	position: relative;
	border-color: #ff2d55 !important;
	animation: nextUpPulse 1.2s ease-in-out infinite;
}
.pair.next-up::after {
	content: 'NEXT';
	position: absolute; top: 8px; right: 8px;
	padding: 2px 8px;
	background: #ff2d55; color: #fff;
	font-family: 'JetBrains Mono', monospace;
	font-size: 9px; font-weight: 700;
	letter-spacing: 0.18em;
	border-radius: 4px;
	box-shadow: 0 0 10px rgba(255,45,85,0.8);
	pointer-events: none;
	z-index: 2;
}
@keyframes nextUpPulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(255,45,85,0); }
	50%      { box-shadow: 0 0 26px 4px rgba(255,45,85,0.55), inset 0 0 14px rgba(255,45,85,0.2); }
}

.pair-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); aspect-ratio: 32 / 12; }
.pair-half { position: relative; overflow: hidden; background: #0a0a0a; }
.pair-half img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity 0.2s; }
.pair-half img.loaded { opacity: 1; }
.pair-half .label {
	position: absolute; top: 6px; left: 6px;
	padding: 2px 7px;
	background: rgba(0,0,0,0.7);
	border-radius: 999px;
	font-family: 'JetBrains Mono', monospace;
	font-size: 9px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--text);
	pointer-events: none;
}
.pair-half.before .label { color: var(--muted); }
.pair-half.after .label { color: var(--brand); }

.pair-pending {
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	height: 100%;
	color: var(--muted);
	background: repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(245,181,36,0.04) 8px, rgba(245,181,36,0.04) 16px);
}
.pair-pending svg { width: 28px; height: 28px; color: var(--wait); margin-bottom: 6px; opacity: 0.7; }
.pair-pending .ptxt { font-size: 11px; font-family: 'JetBrains Mono', monospace; letter-spacing: 0.06em; text-transform: uppercase; }

.pair-foot { padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pair-foot .name { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.pair-foot .stat { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--muted); white-space: nowrap; }

.stats-btn {
	background: transparent;
	border: 1px solid var(--border-strong);
	color: var(--muted);
	border-radius: var(--radius-sm);
	width: 26px; height: 26px;
	display: inline-flex; align-items: center; justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
	transition: all 0.12s;
}
.stats-btn:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.stats-btn svg { display: block; }
.stats-btn.is-disabled, .stats-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}
.stats-btn.is-disabled:hover, .stats-btn:disabled:hover {
	color: var(--muted);
	border-color: var(--border-strong);
	background: transparent;
}

/* ---- Stats modal ---- */
.stats-modal {
	position: fixed; inset: 0;
	background: rgba(0,0,0,0.85);
	backdrop-filter: blur(8px);
	display: none; align-items: center; justify-content: center;
	z-index: 110;
}
.stats-modal.active { display: flex; }
.stats-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	width: 520px; max-width: 92vw;
	max-height: 80vh;
	overflow: hidden;
	display: flex; flex-direction: column;
	box-shadow: 0 30px 80px -20px rgba(0,0,0,0.9);
}
.stats-head {
	padding: 14px 18px;
	border-bottom: 1px solid var(--border);
	display: flex; justify-content: space-between; align-items: center;
}
.stats-head .title { font-size: 15px; font-weight: 600; }
.stats-close {
	background: transparent; border: 0; color: var(--muted);
	cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm);
	transition: color 0.15s, background 0.15s;
}
.stats-close:hover { color: var(--brand); background: var(--brand-soft); }
.stats-body { padding: 8px 0; overflow-y: auto; }
.stats-body::-webkit-scrollbar { width: 8px; }
.stats-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.stats-body::-webkit-scrollbar-thumb:hover { background: var(--brand); }
.stats-loading, .stats-empty { padding: 32px 18px; text-align: center; color: var(--muted); font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }

.stats-group { border-bottom: 1px solid var(--border); padding: 14px 18px; }
.stats-group:last-child { border-bottom: none; }
.stats-group-key {
	font-family: 'JetBrains Mono', monospace;
	font-size: 13px;
	color: var(--brand);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	margin-bottom: 12px;
}
.stats-rows { display: grid; grid-template-columns: auto 1fr; column-gap: 18px; row-gap: 8px; }
.stats-rows .k {
	font-size: 16px;
	color: var(--muted);
	font-family: 'JetBrains Mono', monospace;
}
.stats-rows .v {
	font-size: 16px;
	color: var(--text);
	font-family: 'JetBrains Mono', monospace;
	text-align: right;
	font-variant-numeric: tabular-nums;
}
.stats-rows .v.num { color: var(--brand); }
.stats-rows .v .unit { color: var(--muted); margin-left: 4px; font-size: 13px; }

.empty-state {
	padding: 80px 20px;
	text-align: center;
	color: var(--muted);
	background: var(--surface);
	border: 1px dashed var(--border-strong);
	border-radius: var(--radius);
}
.empty-state .glyph { font-size: 36px; margin-bottom: 12px; opacity: 0.5; }
.empty-state h3 { margin: 0 0 6px; color: var(--text); font-weight: 500; }
.empty-state p { margin: 0; font-size: 13px; }

/* ----- Modal / before-after slider ----- */
.viewer {
	position: fixed; inset: 0;
	background: rgba(0,0,0,0.94);
	backdrop-filter: blur(10px);
	display: none; align-items: center; justify-content: center;
	z-index: 100;
	flex-direction: column;
}
.viewer.active { display: flex; }
.viewer .viewer-close {
	position: absolute; top: 18px; right: 18px;
	width: 40px; height: 40px;
	border-radius: 50%;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	color: var(--text);
	display: flex; align-items: center; justify-content: center;
	cursor: pointer;
	transition: all 0.15s;
}
.viewer .viewer-close:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.viewer .viewer-close svg { width: 18px; height: 18px; }

.viewer-stage {
	position: relative;
	max-width: 92vw;
	max-height: 80vh;
	width: auto;
	user-select: none;
	-webkit-user-select: none;
	touch-action: none;
}
.viewer-img { position: absolute; inset: 0; overflow: hidden; }
.viewer-img img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.viewer-img.before { position: relative; }
.viewer-img.after { clip-path: inset(0 0 0 50%); }

.viewer-handle {
	position: absolute;
	top: 0; bottom: 0;
	left: 50%;
	width: 2px;
	background: var(--brand);
	box-shadow: 0 0 16px rgba(237,23,76,0.7);
	transform: translateX(-50%);
	cursor: ew-resize;
	z-index: 5;
}
.viewer-handle::before {
	content: '';
	position: absolute;
	top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	width: 44px; height: 44px;
	background: var(--brand);
	border-radius: 50%;
	box-shadow: 0 0 24px rgba(237,23,76,0.6), 0 4px 12px rgba(0,0,0,0.4);
}
.viewer-handle-glyph {
	position: absolute;
	top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	width: 30px; height: 18px;
	color: #fff;
	z-index: 1;
	pointer-events: none;
	filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
}
.viewer-label-before, .viewer-label-after {
	position: absolute;
	top: 14px;
	padding: 4px 12px;
	background: rgba(0,0,0,0.7);
	border-radius: 999px;
	font-family: 'JetBrains Mono', monospace;
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	z-index: 4;
	pointer-events: none;
}
.viewer-label-before { left: 14px; color: var(--muted); }
.viewer-label-after  { right: 14px; color: var(--brand); }

.viewer-info { margin-top: 18px; display: flex; gap: 24px; align-items: center; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); }
.viewer-info .file { color: var(--text); }
.viewer-info a.dl {
	color: var(--brand); text-decoration: none;
	padding: 6px 12px;
	border: 1px solid rgba(237,23,76,0.3);
	border-radius: var(--radius-sm);
	transition: all 0.15s;
}
.viewer-info a.dl:hover { background: var(--brand-soft); border-color: var(--brand); }

.viewer-note { margin-top: 12px; max-width: 600px; width: 100%; }
.viewer-note textarea {
	width: 100%;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	color: var(--text);
	font-family: inherit;
	font-size: 13px;
	padding: 10px 12px;
	resize: vertical;
	min-height: 60px;
}
.viewer-note textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.viewer-note .note-status { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--muted); margin-top: 4px; text-align: right; }
