:root {
    --bg: #121212;
    --text: #ffffff;
    --text-dim: #cccccc;
    --pass: #4ade80;
    --fail: #f87171;
    --borderline: #facc15;
    --timeline-bg: #1e1e1e;
    --band-fill: rgba(248, 113, 113, 0.4);
    --band-hover: rgba(248, 113, 113, 0.8);
    --card-bg: #1e1e1e;
    --focus-ring: #60a5fa;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

a, button, input {
    color: inherit;
}

button:focus, a:focus, input:focus, .violation-band:focus {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid #333;
}

/* Verdict Header */
.verdict-header {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.verdict-large {
    font-size: 4rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.verdict-large[data-verdict="PASS"] { color: var(--pass); }
.verdict-large[data-verdict="FAIL"] { color: var(--fail); }
.verdict-large[data-verdict="BORDERLINE"] { color: var(--borderline); }

.verdict-meta {
    font-size: 1.1rem;
    color: var(--text-dim);
}

.btn {
    background: #333;
    border: 1px solid #555;
    color: var(--text);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 4px;
}
.btn.primary {
    background: #2563eb;
    border-color: #1d4ed8;
}
.btn:hover {
    background: #444;
}
.btn.primary:hover {
    background: #1d4ed8;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Timeline */
.timeline-container {
    background: var(--timeline-bg);
    border: 1px solid #333;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 3rem;
}

.timeline-figure {
    margin: 0;
    position: relative;
    width: 100%;
    height: 140px;
    overflow: hidden; /* For draw animation */
}

.timeline-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.timeline-curve {
    fill: rgba(255, 255, 255, 0.1);
    stroke: var(--text);
    stroke-width: 1.5px;
    transition: all 0.3s;
}

.timeline-curve.pass-curve {
    fill: rgba(74, 222, 128, 0.1);
    stroke: var(--pass);
}

.threshold-line {
    stroke: #ff9800;
    stroke-width: 1;
    stroke-dasharray: 4, 4;
}

.violation-band {
    fill: var(--band-fill);
    cursor: pointer;
}

.violation-band:hover, .violation-band:focus {
    fill: var(--band-hover);
}

.timeline-axes {
    display: flex;
    justify-content: space-between;
    font-family: monospace;
    font-size: 0.9rem;
    color: #888;
    margin-top: 0.5rem;
}

/* Draw animation */
.draw-mask {
    animation: draw-timeline 600ms ease-out forwards;
}

@keyframes draw-timeline {
    from { width: 0%; }
    to { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .draw-mask {
        animation: none;
        width: 100%;
    }
    
    .reduced-motion-disabled {
        opacity: 0.5;
        pointer-events: none;
    }
    .reduced-motion-warning {
        display: block !important;
        color: var(--fail);
        margin-top: 0.5rem;
        font-weight: bold;
    }
}
.reduced-motion-warning {
    display: none;
}

/* Violation Card */
.violation-card {
    background: var(--card-bg);
    border: 2px solid #333;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    transition: border-color 120ms ease;
}
.violation-card:target {
    border-color: var(--fail);
}
.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    border-bottom: 1px solid #444;
    padding-bottom: 0.5rem;
}

.filmstrip {
    height: 60px;
    background: #000;
    display: flex;
    gap: 4px;
    margin-bottom: 1rem;
    overflow: hidden;
}
.filmstrip-frame {
    width: 106px;
    height: 100%;
    background: #333;
    border: 1px solid #222;
}

.card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.adjudicated-block blockquote {
    background: #111;
    border-left: 4px solid #555;
    padding: 1rem;
    margin: 0;
    font-style: italic;
}

/* Safety Gate */
.safety-gate {
    position: relative;
    width: 640px;
    max-width: 100%;
    margin-bottom: 1rem;
    background: #000;
}
.safety-gate video {
    width: 100%;
    display: block;
}
.reduced-playback {
    filter: brightness(0.4) contrast(0.8);
}
.scrim {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    pointer-events: none;
    display: none;
}
.reduced-playback + .scrim {
    display: block;
}
.confirm-layer {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
}
.confirm-layer h3 {
    color: var(--fail);
    margin-top: 0;
}
.confirm-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Certificate */
.certificate-section {
    background: #1a1a1a;
    padding: 1.5rem;
    border: 1px solid #333;
    border-radius: 8px;
    margin-top: 4rem;
}
.cert-code {
    background: #000;
    padding: 1rem;
    overflow-x: auto;
    font-family: monospace;
    color: #4ade80;
}

.stage-list {
    list-style: none;
    padding: 0;
    font-size: 1.5rem;
}
.stage {
    padding: 0.5rem 0;
    color: var(--text-dim);
}
.stage.done {
    color: var(--pass);
}
.tick {
    color: var(--pass);
}

.upload-form, .seed-clips {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 8px;
}
.drop-zone {
    border: 2px dashed #555;
    padding: 3rem;
    text-align: center;
    margin-bottom: 1rem;
}
