:root {
  color-scheme: dark;
  --bg: #090b12;
  --panel: rgba(19, 22, 33, 0.78);
  --panel-strong: #141824;
  --text: #f2f0eb;
  --muted: #8d94a7;
  --line: rgba(255,255,255,.105);
  --orange: #ff6b35;
  --amber: #ffb547;
  --cyan: #57d4d4;
  --red: #ff4d5e;
  --green: #64d98b;
  --shadow: 0 30px 90px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 75% 0%, rgba(77, 56, 126, .24), transparent 34rem),
    radial-gradient(circle at 10% 40%, rgba(255, 107, 53, .08), transparent 26rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.grain { position: fixed; inset: 0; pointer-events: none; opacity: .13; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E"); z-index: 20; }
.topbar, main, footer { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.topbar { height: 90px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; background: var(--orange); color: #160a05; font-weight: 950; font-size: 22px; transform: rotate(-4deg); }
.brand strong { display: block; font-size: 17px; }
.brand small { display: block; margin-top: 1px; color: var(--muted); font-size: 9px; letter-spacing: .32em; }
.runtime { display: flex; align-items: center; gap: 9px; color: var(--muted); font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; letter-spacing: .12em; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(100,217,139,.1); }
main { padding: 76px 0 30px; }
.hero { max-width: 940px; }
.eyebrow { color: var(--orange); font: 750 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .2em; }
h1 { margin: 24px 0 24px; font-size: clamp(52px, 7vw, 94px); line-height: .94; letter-spacing: -.065em; font-weight: 820; }
h1 em { font-family: Georgia, serif; color: #b5b6c1; font-weight: 400; }
.hero > p { max-width: 690px; margin: 0; color: #a6abba; font-size: clamp(17px, 2vw, 21px); line-height: 1.55; }
.mission-panel { margin-top: 56px; padding: 12px; background: rgba(255,255,255,.035); border: 1px solid var(--line); box-shadow: var(--shadow); }
form { display: grid; grid-template-columns: 150px minmax(280px, 1fr) 190px; gap: 1px; background: var(--line); }
label { display: block; background: var(--panel-strong); padding: 16px 18px; }
label span { display: block; margin-bottom: 8px; color: var(--muted); font: 700 9px/1 ui-monospace, monospace; letter-spacing: .16em; }
input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: 720 16px/1.4 inherit; }
.objective input { font-weight: 520; color: #ccd0da; }
button { border: 0; cursor: pointer; background: var(--orange); color: #170b06; display: flex; justify-content: space-between; align-items: center; padding: 0 22px; font-weight: 850; font-size: 14px; }
button b { font-size: 22px; transition: transform .2s ease; }
button:hover b { transform: translateX(4px); }
button:disabled { filter: grayscale(.5); cursor: wait; }
.progress, .result, .error { margin-top: 26px; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(18px); box-shadow: var(--shadow); }
.progress { padding: 24px; }
.progress-head { display: flex; justify-content: space-between; align-items: center; }
.progress-head span, .section-title span, .director-note > span { color: var(--orange); font: 750 9px/1 ui-monospace, monospace; letter-spacing: .18em; }
.progress-head strong { font-size: 13px; }
.progress-track { height: 3px; background: rgba(255,255,255,.08); margin: 22px 0 15px; overflow: hidden; }
.progress-track i { display: block; height: 100%; width: 8%; background: linear-gradient(90deg, var(--orange), var(--amber)); transition: width .45s ease; }
.steps { display: flex; justify-content: space-between; color: #666e80; font: 650 10px/1 ui-monospace, monospace; }
.steps .active { color: var(--text); }
.result { padding: clamp(24px, 4vw, 54px); }
.result-heading { display: flex; justify-content: space-between; align-items: flex-start; }
.result-heading > div:first-child { display: flex; align-items: center; gap: 12px; color: var(--muted); font: 800 12px/1 ui-monospace, monospace; letter-spacing: .12em; }
.severity { padding: 8px 10px; background: rgba(255,77,94,.13); border: 1px solid rgba(255,77,94,.35); color: #ff7481; }
.confidence { text-align: right; }
.confidence small { display: block; color: var(--muted); font: 700 9px/1 ui-monospace, monospace; letter-spacing: .14em; }
.confidence strong { display: block; margin-top: 6px; font-size: 24px; }
.result h2 { max-width: 850px; margin: 30px 0 16px; font-size: clamp(32px, 4.6vw, 58px); line-height: 1.04; letter-spacing: -.045em; }
.diagnosis { max-width: 900px; color: #afb4c1; line-height: 1.65; font-size: 16px; }
.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin: 36px 0 48px; border-block: 1px solid var(--line); }
.metric-strip > div { padding: 22px 0; }
.metric-strip > div + div { border-left: 1px solid var(--line); padding-left: 24px; }
.metric-strip small { display: block; color: var(--muted); font: 700 9px/1 ui-monospace, monospace; letter-spacing: .14em; }
.metric-strip strong { display: block; margin-top: 9px; font-size: 19px; }
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 46px; }
.section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.section-title h3 { margin: 0; font-size: 18px; }
.evidence-item, .recovery-item { padding: 16px 0; border-top: 1px solid var(--line); }
.evidence-item { display: grid; grid-template-columns: 10px 1fr; gap: 13px; }
.signal { width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--muted); }
.signal.critical { background: var(--red); box-shadow: 0 0 12px rgba(255,77,94,.5); }
.signal.warning { background: var(--amber); }
.signal.healthy { background: var(--green); }
.evidence-item strong, .recovery-item strong { display: block; font-size: 13px; }
.evidence-item p, .recovery-item p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.recovery-item { display: grid; grid-template-columns: 34px 1fr; gap: 12px; }
.order { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line); color: var(--orange); font: 750 11px/1 ui-monospace, monospace; }
.meta { display: flex; gap: 12px; margin-top: 10px; color: #747c90; font: 650 9px/1 ui-monospace, monospace; text-transform: uppercase; }
.gate { color: var(--amber); }
.director-note { margin-top: 42px; padding: 25px; border-left: 3px solid var(--orange); background: rgba(255,107,53,.055); }
.director-note p { margin: 10px 0 0; line-height: 1.6; }
details { margin-top: 22px; color: var(--muted); font-size: 12px; }
summary { cursor: pointer; }
details li { margin: 6px 0; font-family: ui-monospace, monospace; }
.error { padding: 20px; color: #ff9ca5; }
.hidden { display: none !important; }
footer { display: flex; justify-content: space-between; padding: 40px 0 32px; border-top: 1px solid var(--line); color: #656c7c; font: 650 9px/1 ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase; }
@media (max-width: 780px) {
  .topbar, main, footer { width: min(100% - 24px, 1180px); }
  main { padding-top: 50px; }
  form { grid-template-columns: 1fr; }
  label, button { min-height: 72px; }
  .content-grid { grid-template-columns: 1fr; gap: 26px; }
  .metric-strip { grid-template-columns: 1fr; }
  .metric-strip > div + div { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  footer { gap: 20px; flex-direction: column; }
}

/* Tangible cinematic shot viewer */
.shot-preview { margin-top: 64px; padding: clamp(22px, 3vw, 38px); background: rgba(15,18,28,.84); border: 1px solid var(--line); box-shadow: var(--shadow); }
.preview-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.preview-heading h2 { margin: 12px 0 8px; font-size: clamp(28px, 3vw, 43px); letter-spacing: -.04em; }
.preview-heading p { max-width: 740px; margin: 0; color: var(--muted); line-height: 1.55; }
.synthetic-badge { flex: 0 0 auto; padding: 10px 13px; border: 1px solid rgba(87,212,212,.32); color: var(--cyan); background: rgba(87,212,212,.07); font: 700 9px/1 ui-monospace, monospace; letter-spacing: .13em; }
.preview-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); gap: 24px; }
.viewer-shell { position: relative; overflow: hidden; background: #030507; border: 1px solid rgba(255,255,255,.12); }
.viewer-shell video { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #020304; }
.viewer-status { position: absolute; z-index: 2; top: 14px; left: 14px; right: 14px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.viewer-status > span:last-child { padding: 8px 10px; color: #d3d8e2; background: rgba(5,8,13,.72); font: 650 10px/1 ui-monospace, monospace; letter-spacing: .08em; }
.viewer-status-pill { padding: 8px 10px; border: 1px solid; font: 800 10px/1 ui-monospace, monospace; letter-spacing: .11em; }
.viewer-status-pill.failed { color: #ff7a87; background: rgba(40,5,11,.8); border-color: rgba(255,77,94,.5); }
.viewer-status-pill.source { color: #84e3e3; background: rgba(3,25,28,.8); border-color: rgba(87,212,212,.45); }
.viewer-status-pill.canary { color: #7bea9f; background: rgba(4,29,17,.82); border-color: rgba(100,217,139,.5); }
.preview-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.preview-tab { min-height: 48px; justify-content: center; padding: 0 12px; color: var(--muted); background: #111622; font: 750 11px/1 ui-monospace, monospace; letter-spacing: .06em; text-transform: uppercase; }
.preview-tab:hover { color: var(--text); background: #181e2c; }
.preview-tab.active { color: #140904; background: var(--orange); }
.preview-caption { padding: 18px 20px 20px; }
.preview-caption strong { font-size: 14px; }
.preview-caption p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.shot-context { padding: 22px; background: #111622; border: 1px solid rgba(255,255,255,.1); }
.context-label { margin-bottom: 13px; color: var(--muted); font: 700 9px/1 ui-monospace, monospace; letter-spacing: .15em; }
.frame-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.frame { position: relative; display: grid; place-items: end start; min-height: 58px; padding: 8px; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(135deg,#23303b,#0d1219); }
.frame::before { content: ''; position: absolute; inset: 0; opacity: .42; background: repeating-linear-gradient(115deg,transparent 0 7px,rgba(255,255,255,.08) 8px 9px); }
.frame b { position: relative; z-index: 1; font: 750 10px/1 ui-monospace, monospace; }
.frame.ok { color: var(--green); border-color: rgba(100,217,139,.28); }
.frame.failed { color: #ff8a96; border-color: rgba(255,77,94,.5); background: linear-gradient(135deg,#4b121d,#10080c); }
.frame.failed::after { content: '×'; position: absolute; top: 3px; right: 7px; color: var(--red); font-size: 23px; font-weight: 900; }
.frame.queued { color: var(--amber); border-color: rgba(255,181,71,.35); }
.frame-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 13px 0 24px; color: var(--muted); font: 650 9px/1 ui-monospace, monospace; text-transform: uppercase; }
.frame-legend span { display: flex; align-items: center; gap: 6px; }
.frame-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.frame-legend i.ok { background: var(--green); }.frame-legend i.failed { background: var(--red); }.frame-legend i.queued { background: var(--amber); }
.problem-card { padding: 20px; border-left: 3px solid var(--red); background: rgba(255,77,94,.055); }
.problem-card > span { color: #ff7885; font: 750 9px/1 ui-monospace, monospace; letter-spacing: .15em; }
.problem-card h3 { margin: 11px 0 8px; font-size: 19px; line-height: 1.15; }
.problem-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.problem-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 18px; background: var(--line); }
.problem-facts > div { padding: 13px 9px; background: #171c29; }
.problem-facts small { display: block; color: var(--muted); font: 650 8px/1 ui-monospace, monospace; letter-spacing: .08em; }
.problem-facts strong { display: block; margin-top: 7px; font-size: 11px; }
.director-note { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.preview-fix-button { flex: 0 0 auto; min-height: 46px; padding: 0 18px; gap: 18px; background: var(--orange); }
.preview-fix-button b { font-size: 19px; }
@media (max-width: 900px) {
  .preview-heading { align-items: flex-start; flex-direction: column; }
  .preview-layout { grid-template-columns: 1fr; }
  .director-note { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 540px) {
  .shot-preview { padding: 13px; }
  .preview-tab { min-height: 54px; font-size: 9px; }
  .problem-facts { grid-template-columns: 1fr; }
  .frame-strip { grid-template-columns: repeat(4, 1fr); }
}

/* Approval-gated closed-loop recovery */
.preview-tab:disabled { cursor: not-allowed; color: #555d6d; background: #0c1018; filter: none; }
.preview-tab.locked::after { content: ' · locked'; color: #6b7280; }
.recovery-workflow { margin-top: 30px; padding: clamp(22px,3vw,34px); border: 1px solid rgba(139,92,246,.35); background: linear-gradient(145deg,rgba(24,20,39,.94),rgba(13,17,27,.94)); }
.workflow-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.workflow-heading span { color: #a78bfa; font: 750 9px/1 ui-monospace,monospace; letter-spacing: .17em; }
.workflow-heading h3 { margin: 10px 0 7px; font-size: 25px; letter-spacing: -.03em; }
.workflow-heading p { max-width: 680px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.workflow-heading > strong { flex: 0 0 auto; padding: 9px 12px; color: #ff9c68; border: 1px solid rgba(255,107,53,.38); background: rgba(255,107,53,.08); font: 750 9px/1 ui-monospace,monospace; letter-spacing: .12em; }
.workflow-steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 20px; }
.workflow-step { position: relative; display: flex; flex-direction: column; min-height: 210px; padding: 18px; border: 1px solid var(--line); background: #131824; }
.workflow-step > i { display: grid; place-items: center; width: 29px; height: 29px; margin-bottom: 20px; border-radius: 50%; background: #252c3c; color: #aab1c0; font: 800 11px/1 ui-monospace,monospace; font-style: normal; }
.workflow-step small { display: block; color: var(--muted); font: 700 8px/1 ui-monospace,monospace; letter-spacing: .14em; }
.workflow-step strong { display: block; margin-top: 7px; font-size: 15px; }
.workflow-step p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.workflow-step > b { position: absolute; top: 18px; right: 18px; color: var(--green); }
.workflow-step.complete { border-color: rgba(100,217,139,.3); }.workflow-step.complete > i { color: #07150c; background: var(--green); }
.workflow-step.ready { border-color: rgba(255,181,71,.38); }.workflow-step.ready > i { color: #211303; background: var(--amber); }
.workflow-step.validated { border-color: rgba(100,217,139,.48); }.workflow-step.validated > i { color: #07150c; background: var(--green); }
.workflow-step.locked { opacity: .58; }.workflow-step.running { border-color: rgba(87,212,212,.55); box-shadow: inset 0 0 25px rgba(87,212,212,.05); }
.workflow-step > div { padding-bottom: 16px; }
.workflow-step button { position: static; width: 100%; min-height: 36px; margin-top: auto; justify-content: center; padding: 0 12px; font-size: 11px; }
.workflow-step button:disabled { background: #2a303d; color: #6d7585; }
.workflow-step.validated button { color: #7ee8a2; background: rgba(100,217,139,.1); border: 1px solid rgba(100,217,139,.35); }
.phase-verification { margin-top: 14px; padding: 22px; border: 1px solid rgba(100,217,139,.32); background: rgba(5,20,13,.44); }
.phase-verification.failed { border-color: rgba(255,77,94,.4); background: rgba(35,7,12,.38); }
.phase-result-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.phase-result-head span { padding: 7px 9px; color: var(--green); border: 1px solid rgba(100,217,139,.4); font: 800 9px/1 ui-monospace,monospace; letter-spacing: .12em; }
.phase-result-head strong { font-size: 18px; }
.verification-kpis { display: grid; grid-template-columns: repeat(4,1fr); margin-top: 20px; border-block: 1px solid var(--line); }
.verification-kpis > div { padding: 17px 0; }.verification-kpis > div+div { padding-left: 20px; border-left: 1px solid var(--line); }
.verification-kpis small,.phase-next small { display: block; color: var(--muted); font: 700 8px/1 ui-monospace,monospace; letter-spacing: .12em; }
.verification-kpis strong { display: block; margin-top: 7px; font-size: 18px; }
.grafana-checks { display: grid; grid-template-columns: repeat(4,1fr); gap: 9px; margin-top: 18px; }
.grafana-checks > div { position: relative; padding: 16px 14px 14px 36px; border: 1px solid var(--line); background: rgba(14,19,29,.8); }
.grafana-checks strong { font-size: 12px; }.grafana-checks p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.grafana-dot { position: absolute; top: 19px; left: 16px; width: 8px; height: 8px; border-radius: 50%; }.grafana-dot.prometheus { background: #f15b2a; }.grafana-dot.loki { background: #eab308; }.grafana-dot.tempo { background: #8b5cf6; }
.phase-summary { color: #c8cdd7; line-height: 1.55; font-size: 13px; }
.phase-next { padding: 15px 17px; border-left: 3px solid var(--orange); background: rgba(255,107,53,.06); }.phase-next strong { display: block; margin-top: 7px; font-size: 13px; }
@media(max-width:800px){.workflow-steps,.grafana-checks{grid-template-columns:1fr}.verification-kpis{grid-template-columns:1fr}.verification-kpis>div+div{padding-left:0;border-left:0;border-top:1px solid var(--line)}.workflow-heading{flex-direction:column}}

/* Silent custom video transport and explicit failure windows */
.viewer-shell video { cursor: pointer; }
.artifact-indicator { position: absolute; z-index: 3; top: 94px; left: 14px; padding: 9px 11px; color: #fff; background: rgba(128,8,24,.88); border: 1px solid rgba(255,77,94,.7); font: 800 9px/1 ui-monospace,monospace; letter-spacing: .12em; pointer-events: none; }
.artifact-indicator i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); }
.video-transport { display: grid; grid-template-columns: 70px minmax(100px,1fr) 88px; align-items: center; gap: 13px; min-height: 48px; padding: 0 16px; background: #090d14; border-top: 1px solid var(--line); }
.video-toggle { min-height: 29px; justify-content: center; padding: 0 9px; border: 1px solid var(--line); background: #1b2230; color: #d9dde5; font: 750 9px/1 ui-monospace,monospace; text-transform: uppercase; letter-spacing: .08em; }
.video-track { position: relative; height: 5px; cursor: pointer; background: #313848; overflow: visible; }
.video-track > i { position: absolute; z-index: 2; inset: 0 auto 0 0; width: 0; background: var(--orange); pointer-events: none; }
.failure-window { position: absolute; z-index: 1; top: -5px; height: 15px; background: rgba(255,77,94,.7); border-inline: 1px solid #ff8290; pointer-events: none; }
.video-track.no-failures .failure-window { display: none; }
#videoClock { color: #8d94a7; font: 650 9px/1 ui-monospace,monospace; text-align: right; }
@media(max-width:540px){.video-transport{grid-template-columns:60px 1fr 72px;padding:0 9px;gap:8px}.video-toggle{font-size:8px}}
.grafana-dot.ffmpeg { background: #57d4d4; }
.comparison-labels { position: absolute; z-index: 3; top: 94px; left: 14px; right: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; pointer-events: none; }
.comparison-labels span { justify-self: start; padding: 8px 10px; color: #ff8a96; background: rgba(53,16,24,.88); border: 1px solid rgba(255,77,94,.55); font: 800 9px/1 ui-monospace,monospace; letter-spacing: .1em; }
.comparison-labels span:last-child { justify-self: end; color: #7ee8a2; background: rgba(8,32,23,.88); border-color: rgba(100,217,139,.55); }
.preview-caption { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.preview-caption > div { min-width: 0; }
.preview-continue { flex: 0 0 auto; min-height: 39px; padding: 0 14px; gap: 14px; font-size: 10px; }
@media(max-width:700px){.preview-caption{align-items:flex-start;flex-direction:column}.preview-continue{width:100%;justify-content:center}}
