:root {
    --bg-dark: #07090F;
    --panel-bg: rgba(14, 18, 28, 0.6);
    --panel-border: rgba(43, 233, 172, 0.15);

    --neon-green: #00ffaa;
    --neon-blue: #f26222; /* Umniah Corporate Orange applied to primary accents */
    --neon-red: #ff3366;
    --neon-yellow: #ffcc00;

    --text-primary: #e0f2fe;
    --text-muted: #64748b;

    --glass-blur: blur(16px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    padding: 24px;
    position: relative;
    overflow-x: hidden;
}
body:not(.demo-unlocked) {
    overflow: hidden;
}
body.mode-executive .operator-surface,
body.umniah-embed .operator-surface {
    display: none !important;
}
body.mode-executive .dashboard-grid {
    grid-template-columns: 1fr;
    max-width: 1180px;
    margin: 0 auto;
}
body.mode-executive .live-feed-panel {
    grid-column: 1 / -1;
}
body.mode-executive #v2-workflow,
body.mode-executive #v2-replay-tour,
body.mode-executive #v2-adversarial-toggle,
body.mode-executive #v2-inspect-btn,
body.mode-executive .live-controls {
    display: none !important;
}
body.mode-executive .live-feed-panel .panel-header h2 {
    font-size: 0.95rem;
}
body.mode-executive .live-feed-panel .panel-header h2 .icon {
    display: none;
}
body.umniah-embed {
    padding: 12px;
    min-height: 100vh;
}
body.umniah-embed .glow-bg {
    display: none;
}
.embed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(0, 255, 170, 0.22);
    border-radius: 8px;
    background: rgba(14, 18, 28, 0.72);
}
.embed-brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.embed-kicker {
    color: var(--neon-green);
    font: 0.62rem 'JetBrains Mono', monospace;
    letter-spacing: 1px;
}
.embed-main .photo-interactive-v2 {
    margin-bottom: 0;
}
.embed-main .v2-scrub-stage {
    width: min(100%, 540px);
    max-height: 780px;
}
.view-mode-switch {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}
.v2-mode-btn {
    border: 1px solid rgba(0, 255, 170, 0.45);
    background: rgba(0, 255, 170, 0.12);
    color: var(--neon-green);
    border-radius: 6px;
    padding: 7px 12px;
    cursor: pointer;
    font: 0.72rem 'JetBrains Mono', monospace;
    font-weight: 700;
}
.v2-mode-link {
    color: var(--neon-blue);
    font: 0.68rem 'JetBrains Mono', monospace;
    text-decoration: none;
}
.v2-mode-link:hover {
    text-decoration: underline;
}
.demo-auth {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(7, 9, 15, 0.96);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}
.demo-auth[hidden] { display: none; }
.demo-auth-card {
    width: min(420px, 100%);
    border: 1px solid rgba(242, 98, 34, 0.28);
    border-radius: 8px;
    background: rgba(14, 18, 28, 0.92);
    padding: 28px;
    display: grid;
    gap: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.demo-auth-brand {
    color: var(--neon-blue);
    font: 0.78rem 'JetBrains Mono', monospace;
    letter-spacing: 2px;
}
.demo-auth-card h1 {
    color: var(--text-primary);
    letter-spacing: 0;
}
.demo-auth-card label {
    display: grid;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}
.demo-auth-card input {
    background: #0b0e14;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 12px;
}
.demo-auth-card button {
    border: 1px solid var(--neon-blue);
    background: var(--neon-blue);
    color: #111;
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    font-weight: 800;
}
.demo-auth-error {
    min-height: 20px;
    color: var(--neon-red);
    font-size: 0.86rem;
}

/* Background Glowing Orbs */
.glow-bg {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 136, 255, 0.08) 0%, transparent 60%);
    top: -200px;
    left: -200px;
    z-index: -1;
    pointer-events: none;
}
.glow-bg-secondary {
    background: radial-gradient(circle, rgba(255, 51, 102, 0.05) 0%, transparent 60%);
    bottom: -200px;
    right: -200px;
    top: auto;
    left: auto;
}

/* Typography & Headings */
h1 { font-family: 'JetBrains Mono', monospace; font-size: 1.5rem; letter-spacing: 2px; color: var(--neon-green); }
.subtitle { font-size: 0.8rem; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; }
h2 { font-size: 1.1rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 0.95rem; font-weight: 600; }
.icon { font-size: 1.2rem; }

/* Header */
.noc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 20px;
    margin-bottom: 24px;
}
.logo { display: flex; align-items: center; gap: 16px; }
.umniah-logo { height: 48px; width: auto; filter: drop-shadow(0 0 15px rgba(242, 98, 34, 0.4)); }

.global-metrics { display: flex; gap: 32px; }
.metric { display: flex; flex-direction: column; align-items: center; }
.metric .label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.metric .value { font-family: 'JetBrains Mono', monospace; font-size: 1.8rem; font-weight: bold; }
.metric.drop .value { color: var(--neon-yellow); }
.metric.escalation .value { color: var(--neon-red); }

.status-indicator { display: flex; align-items: center; gap: 12px; font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 10px currentColor; }
.status-dot.healthy { background-color: var(--neon-green); color: var(--neon-green); animation: pulse 2s infinite; }
.status-dot.alert { background-color: var(--neon-red); color: var(--neon-red); animation: fastPulse 0.5s infinite; }

/* Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 350px 1fr 400px;
    gap: 24px;
    height: calc(100vh - 120px);
}

/* Glass Panels */
.glass-panel {
    background: var(--panel-bg);
    -webkit-backdrop-filter: var(--glass-blur); /* Safari Support */
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Swarm Panel */
.agents-container { display: flex; flex-direction: column; gap: 16px; }
.agent-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    border-left: 3px solid var(--text-muted);
    transition: all 0.3s ease;
    cursor: pointer;
}
.agent-card:focus-visible {
    outline: 2px solid var(--neon-blue);
    outline-offset: 3px;
}
.agent-card.active-filter {
    border-left-color: var(--neon-blue);
    background: rgba(242, 98, 34, 0.16);
    box-shadow: 0 0 0 1px rgba(242, 98, 34, 0.28) inset;
}
.agent-card.processing {
    border-left-color: var(--neon-blue);
    background: rgba(0, 136, 255, 0.1);
    transform: translateX(5px);
}
.agent-card.alert {
    border-left-color: var(--neon-red);
    background: rgba(255, 51, 102, 0.1);
}
.agent-icon { font-size: 1.8rem; }
.agent-info p { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.agent-status {
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
}
.agent-card.processing .agent-status { background: var(--neon-blue); color: #000; }
.agent-card.alert .agent-status { background: var(--neon-red); color: #fff; }

.swarm-panel {
    min-height: 0;
}
.swarm-panel .agents-container {
    flex-shrink: 0;
}

/* LLM Narrator */
.llm-narrator {
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
    flex: 1 1 240px;
    min-height: 240px;
    display: flex;
    flex-direction: column;
}
.narrator-header {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--neon-blue);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
    font-family: 'JetBrains Mono', monospace;
}
.llm-pulse {
    width: 8px; height: 8px; border-radius: 50%;
    background-color: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue);
    animation: flash 1s infinite alternate;
}
.narrator-body {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.55;
    flex: 1 1 auto;
    min-height: 180px;
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    word-break: break-word;
}
.narrator-body div { margin-bottom: 8px; opacity: 0; animation: typeIn 0.3s forwards; }
.narrator-body .timestamp { color: var(--text-muted); font-size: 0.75rem; margin-right: 8px; }
.narrator-body .healthy-text { color: var(--neon-green); }
.narrator-body .alert-text { color: var(--neon-red); font-weight: bold; }

@keyframes typeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.live-feed-panel.glass-panel {
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 0;
    scroll-behavior: smooth;
    scroll-padding-bottom: 28px;
}

.photo-stream {
    flex: 0 0 auto;
}

.photo-interactive-v2 {
    flex: 0 0 auto;
    scroll-margin-top: 12px;
}

.live-feed-panel .table-container {
    flex: 0 0 340px;
    min-height: 300px;
    max-height: 420px;
}

/* Live Feed Panel */
.live-pulse {
    font-family: 'JetBrains Mono', monospace; font-size: 0.8rem;
    color: var(--neon-green);
    background: rgba(0, 255, 170, 0.1);
    padding: 4px 8px; border-radius: 4px;
    animation: flash 1s infinite alternate;
}
.live-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.filter-reset {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.16);
    color: var(--text-primary);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font: 0.72rem 'JetBrains Mono', monospace;
}
.filter-reset:hover {
    border-color: var(--neon-blue);
    color: var(--neon-blue);
}
.photo-stream {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
    min-width: 0;
    width: 100%;
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid rgba(242, 98, 34, 0.22);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.28);
}
.photo-stream-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    min-height: 0;
    height: 100%;
}
.photo-frame {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    background: #0c1018;
    aspect-ratio: 9 / 16;
    width: min(100%, 420px);
    max-height: min(62vh, 630px);
    border: 1px solid rgba(255,255,255,0.08);
    flex: 0 0 auto;
}
.photo-frame img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    display: block;
    background: #0c1018;
}
.photo-scan-line {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,255,170,0.0) 42%, rgba(0,255,170,0.32) 50%, rgba(0,255,170,0.0) 58%, transparent 100%);
    transform: translateY(-100%);
    animation: scanPhoto 3.6s linear infinite;
}
.photo-stream-meta {
    flex: 0 0 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.photo-stream-kicker {
    color: var(--neon-blue);
    font: 0.68rem 'JetBrains Mono', monospace;
    letter-spacing: 1px;
}
.photo-stream-meta h3 {
    font-size: 1rem;
    color: var(--text-primary);
}
.photo-stream-meta p {
    color: var(--text-muted);
    line-height: 1.4;
    font-size: 0.86rem;
}
.photo-stream-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.photo-stream-tags span {
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    padding: 4px 7px;
    color: var(--text-primary);
    font: 0.68rem 'JetBrains Mono', monospace;
}
.photo-stream-tags span.broken-stage {
    border-color: rgba(255, 51, 102, 0.34);
    color: var(--neon-red);
}
.photo-stream-tags span.fixed-stage {
    border-color: rgba(0, 255, 170, 0.34);
    color: var(--neon-green);
}
.photo-stream-diagnostics {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    padding: 10px 12px;
    border: 1px solid rgba(0, 255, 170, 0.24);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.42);
    cursor: pointer;
    min-width: 0;
}
.photo-stream-diagnostics:hover {
    border-color: rgba(0, 255, 170, 0.42);
    background: rgba(0, 255, 170, 0.06);
}
.photo-stream-diagnostics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font: 0.62rem 'JetBrains Mono', monospace;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--neon-green);
}
.photo-stream-diagnostics-agent {
    color: var(--neon-blue);
    text-transform: none;
    letter-spacing: 0;
}
.photo-stream-synthesis {
    color: var(--text-primary);
    font-size: 0.8rem;
    line-height: 1.45;
    margin: 0;
    word-break: break-word;
}
.photo-stream-diagnostics-json {
    margin: 0;
    flex: 1 1 auto;
    min-height: 0;
    padding: 10px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--neon-green);
    font: 0.68rem 'JetBrains Mono', monospace;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-y: auto;
}
.photo-stream-dots {
    display: flex;
    gap: 6px;
}
.photo-stream-dot {
    width: 22px;
    height: 4px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    cursor: pointer;
}
.photo-stream-dot.active { background: var(--neon-blue); }

.photo-interactive-v2 {
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid rgba(0, 255, 170, 0.22);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(0, 255, 170, 0.06) 0%, rgba(0, 0, 0, 0.34) 100%);
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow: visible;
}
.v2-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}
.v2-kicker {
    color: var(--neon-green);
    font: 0.68rem 'JetBrains Mono', monospace;
    letter-spacing: 1px;
}
.v2-subtitle {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}
.v2-workflow {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.v2-workflow-step {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 4px 10px;
    color: var(--text-muted);
    font: 0.65rem 'JetBrains Mono', monospace;
    transition: all 0.25s;
}
.v2-workflow-step.active {
    border-color: rgba(0, 255, 170, 0.45);
    background: rgba(0, 255, 170, 0.12);
    color: var(--neon-green);
}
.v2-workflow-step.done {
    border-color: rgba(242, 98, 34, 0.35);
    color: var(--neon-blue);
}
.v2-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}
.v2-toolbar-btn {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 7px 12px;
    cursor: pointer;
    font: 0.72rem 'JetBrains Mono', monospace;
    transition: all 0.2s;
}
.v2-toolbar-btn:hover {
    border-color: var(--neon-green);
    color: var(--neon-green);
}
.v2-toolbar-btn.primary {
    border-color: rgba(0, 255, 170, 0.45);
    background: rgba(0, 255, 170, 0.12);
    color: var(--neon-green);
}
.v2-toolbar-btn.is-playing {
    border-color: rgba(255, 51, 102, 0.45);
    background: rgba(255, 51, 102, 0.12);
    color: var(--neon-red);
}
.v2-toolbar-btn[aria-pressed="true"] {
    border-color: rgba(255, 51, 102, 0.45);
    background: rgba(255, 51, 102, 0.12);
    color: var(--neon-red);
}
.v2-site-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font: 0.62rem 'JetBrains Mono', monospace;
    color: var(--text-muted);
}
.v2-site-field select {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 7px 10px;
    font: 0.72rem 'JetBrains Mono', monospace;
}
.v2-use-case-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.v2-use-case-tab {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
    font: 0.72rem 'JetBrains Mono', monospace;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.v2-use-case-tab:hover {
    border-color: var(--neon-green);
    transform: translateY(-1px);
}
.v2-use-case-tab.active {
    border-color: var(--neon-green);
    background: rgba(0, 255, 170, 0.14);
    color: var(--neon-green);
}
.v2-compare-stage {
    display: grid;
    grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}
.v2-scrub-stage {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #0c1018;
    aspect-ratio: 9 / 16;
    width: 100%;
    max-width: 480px;
    max-height: min(62vh, 720px);
    min-height: 330px;
    touch-action: none;
    user-select: none;
}
.v2-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    background: #0c1018;
    display: block;
    pointer-events: none;
}
.v2-img-after {
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.08s linear;
}
.v2-scrub-stage.is-snapping .v2-img-after {
    transition: clip-path 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.v2-hotspots {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}
.v2-hotspot {
    position: absolute;
    border: 2px solid rgba(255, 51, 102, 0.85);
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 18px rgba(255, 51, 102, 0.35);
    transition: opacity 0.2s, border-color 0.25s, box-shadow 0.25s;
    animation: v2HotspotPulse 2s ease-in-out infinite;
}
.v2-hotspot.is-healing {
    border-color: rgba(0, 255, 170, 0.85);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 18px rgba(0, 255, 170, 0.35);
    animation: none;
}
.v2-hotspot-label {
    position: absolute;
    top: -20px;
    left: 0;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.78);
    color: var(--neon-red);
    font: 0.58rem 'JetBrains Mono', monospace;
    white-space: nowrap;
}
.v2-hotspot.is-healing .v2-hotspot-label {
    color: var(--neon-green);
}
.v2-scrub-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    margin-left: -1px;
    background: var(--neon-green);
    box-shadow: 0 0 12px rgba(0, 255, 170, 0.65);
    z-index: 6;
    cursor: ew-resize;
    touch-action: none;
    pointer-events: auto;
}
.v2-scrub-handle:focus-visible {
    outline: 2px solid var(--neon-green);
    outline-offset: 2px;
}
.v2-handle-grip {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--neon-green);
    background: rgba(7, 9, 15, 0.92);
    box-shadow: 0 0 16px rgba(0, 255, 170, 0.4);
}
.v2-handle-grip::before,
.v2-handle-grip::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 0;
    height: 0;
    border: 5px solid transparent;
    transform: translateY(-50%);
}
.v2-handle-grip::before {
    left: 4px;
    border-right-color: var(--neon-green);
}
.v2-handle-grip::after {
    right: 4px;
    border-left-color: var(--neon-green);
}
.v2-scrub-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: ew-resize;
    z-index: 5;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}
.v2-scrub-labels {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 3;
    font: 0.62rem 'JetBrains Mono', monospace;
    color: rgba(255, 255, 255, 0.75);
}
.v2-scrub-labels span:nth-child(2) {
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.65);
    color: var(--neon-green);
}
.v2-scan-line {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 255, 170, 0) 44%, rgba(0, 255, 170, 0.22) 50%, rgba(0, 255, 170, 0) 56%, transparent 100%);
    transform: translateY(-100%);
    opacity: 0;
}
.v2-scrub-stage.is-scanning .v2-scan-line {
    opacity: 1;
    animation: scanPhoto 0.55s ease-out 1;
}
.v2-scrub-stage.quality-blur .v2-img {
    filter: blur(3.5px) saturate(0.85);
}
.v2-scrub-stage.quality-skew .v2-img {
    transform: rotate(-7deg) scale(1.08);
    transform-origin: center;
}
.v2-scrub-stage.quality-mislabel::after {
    content: 'FOLDER MISMATCH';
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 4;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255, 51, 102, 0.85);
    color: #fff;
    font: 0.62rem 'JetBrains Mono', monospace;
    letter-spacing: 0.5px;
}
.v2-lens {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px solid var(--neon-green);
    box-shadow: 0 0 18px rgba(0, 255, 170, 0.45);
    overflow: hidden;
    pointer-events: none;
    z-index: 7;
    transform: translate(-50%, -50%);
}
.v2-lens-viewport {
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-size: 250% 250%;
}
.v2-lens-label {
    position: absolute;
    left: 50%;
    bottom: 6px;
    transform: translateX(-50%);
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.72);
    color: var(--neon-green);
    font: 0.55rem 'JetBrains Mono', monospace;
    white-space: nowrap;
}
.v2-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}
.v2-stage-toggle {
    display: flex;
    gap: 6px;
}
.v2-stage-btn {
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 8px 8px;
    cursor: pointer;
    font: 0.7rem 'JetBrains Mono', monospace;
    transition: all 0.2s;
}
.v2-stage-btn:hover {
    border-color: var(--neon-blue);
}
.v2-stage-btn.active[data-stage="before"] {
    border-color: rgba(255, 51, 102, 0.45);
    background: rgba(255, 51, 102, 0.14);
    color: var(--neon-red);
}
.v2-stage-btn.active[data-stage="mid"] {
    border-color: rgba(242, 98, 34, 0.45);
    background: rgba(242, 98, 34, 0.14);
    color: var(--neon-blue);
}
.v2-stage-btn.active[data-stage="after"] {
    border-color: rgba(0, 255, 170, 0.45);
    background: rgba(0, 255, 170, 0.14);
    color: var(--neon-green);
}
.v2-side h3 {
    font-size: 1.05rem;
    color: var(--text-primary);
}
.v2-side p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}
.v2-vision-packet {
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 1px solid rgba(0, 255, 170, 0.18);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.38);
}
.v2-packet-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.82rem;
}
.v2-packet-label {
    color: var(--text-muted);
    text-transform: uppercase;
    font: 0.68rem 'JetBrains Mono', monospace;
    letter-spacing: 0.4px;
}
.v2-packet-value {
    color: var(--text-primary);
    text-align: right;
    font-weight: 600;
}
.v2-packet-value.v2-mono {
    font: 0.68rem 'JetBrains Mono', monospace;
    font-weight: 400;
    color: var(--neon-green);
}
.v2-packet-value.is-high {
    color: var(--neon-green);
}
.v2-packet-value.is-low {
    color: var(--neon-red);
}
.v2-delta-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(242, 98, 34, 0.22);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.32);
}
.v2-delta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.v2-delta-k {
    color: var(--text-muted);
    font: 0.64rem 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.v2-delta-item strong {
    color: var(--text-primary);
    font: 1.05rem 'JetBrains Mono', monospace;
}
.v2-delta-track {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.v2-delta-track i {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: var(--neon-red);
    transition: width 0.12s linear;
}
.v2-delta-track.accept i {
    background: var(--neon-green);
}
.v2-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}
.v2-receipt-btn {
    flex: 1;
    min-width: 140px;
    border: 1px solid rgba(242, 98, 34, 0.45);
    background: rgba(242, 98, 34, 0.12);
    color: var(--neon-blue);
    border-radius: 6px;
    padding: 10px 12px;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.2s, color 0.2s;
}
.v2-receipt-btn:hover {
    background: var(--neon-blue);
    color: #111;
}
.v2-inspect-btn {
    flex: 1.4;
    min-width: 180px;
}
.v2-withhold-banner {
    width: 100%;
    min-height: 88px;
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid rgba(255, 51, 102, 0.45);
    background: rgba(255, 51, 102, 0.1);
    color: var(--neon-red);
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 0.82rem;
    line-height: 1.55;
    word-break: break-word;
    white-space: pre-wrap;
}
.v2-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.v2-tags span {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    padding: 4px 7px;
    font: 0.68rem 'JetBrains Mono', monospace;
}
.v2-tags span.broken-stage {
    border-color: rgba(255, 51, 102, 0.34);
    color: var(--neon-red);
}
.v2-tags span.fixed-stage {
    border-color: rgba(0, 255, 170, 0.34);
    color: var(--neon-green);
}
.v2-tags span.candidate-stage {
    border-color: rgba(242, 98, 34, 0.34);
    color: var(--neon-blue);
}
.v2-progress {
    color: var(--text-muted);
}
.v2-inspect-btn {
    border: 1px solid var(--neon-green);
    background: rgba(0, 255, 170, 0.12);
    color: var(--neon-green);
    border-radius: 6px;
    padding: 10px 12px;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.2s, color 0.2s;
}
.v2-inspect-btn:hover {
    background: var(--neon-green);
    color: #111;
}

@keyframes v2HotspotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.72; }
}

@media (max-width: 1400px) {
    .dashboard-grid {
        grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(220px, 320px);
    }
    .photo-stream {
        grid-template-columns: 1fr;
    }
    .photo-frame {
        width: min(100%, 420px);
        margin: 0 auto;
    }
    .photo-stream-side {
        height: auto;
    }
    .photo-stream-diagnostics {
        min-height: 320px;
    }
    .v2-delta-strip {
        grid-template-columns: 1fr;
    }
}

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

.v2-tour {
    position: fixed;
    inset: 0;
    z-index: 3000;
}
.v2-tour[hidden] {
    display: none;
}
.v2-tour-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 6, 10, 0.72);
    backdrop-filter: blur(2px);
}
.v2-tour-spotlight {
    position: fixed;
    border: 2px solid var(--neon-green);
    border-radius: 10px;
    box-shadow: 0 0 0 9999px rgba(4, 6, 10, 0.72), 0 0 24px rgba(0, 255, 170, 0.35);
    pointer-events: none;
    transition: top 0.25s ease, left 0.25s ease, width 0.25s ease, height 0.25s ease;
}
.v2-tour-card {
    position: fixed;
    width: min(320px, calc(100vw - 32px));
    padding: 14px;
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 170, 0.35);
    background: rgba(10, 14, 22, 0.96);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
.v2-tour-step {
    color: var(--neon-green);
    font: 0.65rem 'JetBrains Mono', monospace;
    margin-bottom: 6px;
}
.v2-tour-card h4 {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 6px;
}
.v2-tour-card p {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.45;
    margin-bottom: 12px;
}
.v2-tour-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.v2-tour-skip,
.v2-tour-next {
    border-radius: 6px;
    padding: 7px 12px;
    cursor: pointer;
    font: 0.72rem 'JetBrains Mono', monospace;
}
.v2-tour-skip {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: transparent;
    color: var(--text-muted);
}
.v2-tour-next {
    border: 1px solid var(--neon-green);
    background: rgba(0, 255, 170, 0.14);
    color: var(--neon-green);
    font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
    .v2-img-after,
    .v2-scrub-stage.is-snapping .v2-img-after {
        transition: none;
    }
    .v2-hotspot {
        animation: none;
    }
    .v2-tour-spotlight {
        transition: none;
    }
}

.table-container { overflow-y: auto; flex-grow: 1; }
table { width: 100%; border-collapse: collapse; text-align: left; font-family: 'JetBrains Mono', monospace; font-size: 0.88rem; }
th { color: var(--text-muted); padding: 10px 12px; position: sticky; top: 0; background: #0b0e14; z-index: 10; font-weight: normal; }
td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); }
tr[hidden] { display: none; }
tr { transition: background 0.2s; }
tbody tr { cursor: pointer; }
tbody tr:focus-visible {
    outline: 2px solid var(--neon-blue);
    outline-offset: -2px;
}
tr:hover { background: rgba(255,255,255,0.05); }
tr.vision-trace-row {
    background: rgba(0, 255, 170, 0.06);
}
tr.vision-trace-row:hover {
    background: rgba(0, 255, 170, 0.12);
}
.log-status { padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; }
.log-healthy { background: rgba(0, 255, 170, 0.1); color: var(--neon-green); }
.log-warning { background: rgba(255, 204, 0, 0.1); color: var(--neon-yellow); }
.log-critical { background: rgba(255, 51, 102, 0.1); color: var(--neon-red); }
.agent-pill {
    display: inline-block;
    white-space: nowrap;
    padding: 4px 7px;
    border-radius: 4px;
    background: rgba(242, 98, 34, 0.12);
    color: var(--neon-blue);
    font-size: 0.72rem;
}
.trace-log-btn {
    border: 1px solid rgba(242, 98, 34, 0.42);
    background: rgba(242, 98, 34, 0.12);
    color: var(--neon-blue);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font: 0.72rem 'JetBrains Mono', monospace;
}
.trace-log-btn:hover {
    background: var(--neon-blue);
    color: #111;
}

/* Escalation Queue */
.escalation-list { flex: 1 1 200px; min-height: 180px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.empty-state { height: 100%; display: flex; align-items: center; justify-content: center; }
.dot-matrix { font-family: 'JetBrains Mono', monospace; color: var(--text-muted); opacity: 0.5; }

.vision-console {
    background: rgba(0, 0, 0, 0.34);
    border: 1px solid rgba(242, 98, 34, 0.24);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 14px;
    display: grid;
    gap: 10px;
}
.vision-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--neon-blue);
}
.vision-badge {
    color: #111;
    background: var(--neon-blue);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: 700;
}
.vision-field {
    display: grid;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.vision-field select,
.vision-field input {
    width: 100%;
    background: #0b0e14;
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text-primary);
    border-radius: 4px;
    padding: 8px;
    font: 0.82rem 'JetBrains Mono', monospace;
    text-transform: none;
    letter-spacing: 0;
}
.vision-submit {
    border: 1px solid var(--neon-blue);
    background: rgba(242, 98, 34, 0.16);
    color: var(--neon-blue);
    border-radius: 4px;
    padding: 8px 10px;
    cursor: pointer;
    font-weight: 700;
}
.vision-submit:disabled { opacity: 0.45; cursor: wait; }
.vision-result {
    min-height: 160px;
    max-height: 300px;
    overflow-y: auto;
    padding: 12px 14px;
    border: 1px solid rgba(0, 255, 170, 0.22);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-primary);
    font-size: 0.88rem;
    line-height: 1.55;
    cursor: pointer;
    word-break: break-word;
    white-space: pre-wrap;
}
.vision-escalation {
    border-color: rgba(242, 98, 34, 0.42);
    background: linear-gradient(135deg, rgba(242,98,34,0.16) 0%, rgba(0,0,0,0.42) 100%);
}

.escalation-card {
    background: linear-gradient(135deg, rgba(255,51,102,0.15) 0%, rgba(0,0,0,0.4) 100%);
    border: 1px solid rgba(255, 51, 102, 0.3);
    border-radius: 8px;
    padding: 16px;
    animation: slideIn 0.4s cubic-bezier(0.1, 0.9, 0.2, 1);
}
.esc-header { display: flex; justify-content: space-between; margin-bottom: 12px; font-family: 'JetBrains Mono', monospace; }
.esc-node { color: var(--neon-red); font-weight: bold; }
.esc-time { color: var(--text-muted); font-size: 0.8rem; }
.esc-body { font-size: 0.9rem; line-height: 1.4; margin-bottom: 12px; }
.esc-tag { display: inline-block; padding: 2px 6px; background: rgba(255,51,102,0.2); border-radius: 4px; font-size: 0.75rem; color: var(--neon-red); margin-right: 8px;}
.esc-actions { display: flex; gap: 8px; }
.esc-btn {
    background: transparent; border: 1px solid var(--text-muted); color: var(--text-primary);
    padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 0.8rem; transition: all 0.2s;
}
.esc-btn:hover { background: rgba(255,255,255,0.1); }
.esc-btn.primary { border-color: var(--neon-red); background: rgba(255,51,102,0.1); color: var(--neon-red); }
.esc-btn.primary:hover { background: var(--neon-red); color: #fff; }

/* Animations */
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(0, 255, 170, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(0, 255, 170, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 255, 170, 0); } }
@keyframes fastPulse { 0% { box-shadow: 0 0 0 0 rgba(255, 51, 102, 0.6); } 70% { box-shadow: 0 0 0 15px rgba(255, 51, 102, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 51, 102, 0); } }
@keyframes flash { from { opacity: 0.5; } to { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scanPhoto { from { transform: translateY(-100%); } to { transform: translateY(100%); } }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 999;
    align-items: center;
    justify-content: center;
}
.modal-content {
    width: 60%;
    max-width: 800px;
    max-height: 80vh;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.close-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}
.close-btn:hover { color: var(--neon-red); }
.modal-body {
    overflow-y: auto;
    background: #0b0e14;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--neon-green);
}
.modal-body pre { white-space: pre-wrap; word-wrap: break-word; }
