/* MIRROR — style.css
   Modern, precision-engineered developer interface.
   Zero external dependencies. System font stack only.
   Palette: Neutral dark charcoal / zinc (#09090b, #121215, #18181b).
   No rainbow metrics. No purple gradients. Evidence-first hierarchy.
*/

/* ═══════════════════════════════════════════════════════════
   1. DESIGN TOKENS
═══════════════════════════════════════════════════════════ */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Cascadia Code", Consolas, Menlo, monospace;

  /* Surfaces & Canvas */
  --bg-app:           #09090b;
  --bg-header:        #0d0d10;
  --bg-surface:       #121216;
  --bg-surface-raised:#18181d;
  --bg-surface-hover: #1f1f26;
  --bg-surface-active:#262630;
  
  /* Borders */
  --border-subtle:    #1c1c22;
  --border-base:      #262630;
  --border-strong:    #383846;
  --border-focus:     #38bdf8;

  /* Typography */
  --text-primary:     #f4f4f5;
  --text-secondary:   #a1a1aa;
  --text-muted:       #71717a;
  --text-dim:         #52525b;

  /* Accents & Brand */
  --accent:           #38bdf8;
  --accent-dim:       rgba(56, 189, 248, 0.08);
  --accent-border:    rgba(56, 189, 248, 0.25);

  /* Semantic Status */
  --status-match:        #22c55e;
  --status-match-bg:     rgba(34, 197, 94, 0.08);
  --status-match-border: rgba(34, 197, 94, 0.25);

  --status-div:          #ef4444;
  --status-div-bg:       rgba(239, 68, 68, 0.08);
  --status-div-border:   rgba(239, 68, 68, 0.25);

  --status-inconc:       #f59e0b;
  --status-inconc-bg:    rgba(245, 158, 11, 0.08);
  --status-inconc-border:rgba(245, 158, 11, 0.25);

  --status-neutral:      #71717a;
  --status-neutral-bg:   rgba(113, 113, 122, 0.08);
  --status-neutral-border:rgba(113, 113, 122, 0.2);

  /* Resource Class Badges */
  --badge-app-text:      #38bdf8;
  --badge-app-bg:        rgba(56, 189, 248, 0.1);
  --badge-proj-text:     #34d399;
  --badge-proj-bg:       rgba(52, 211, 153, 0.1);
  --badge-ext-text:      #fb923c;
  --badge-ext-bg:        rgba(251, 146, 60, 0.1);
  --badge-env-text:      #a78bfa;
  --badge-env-bg:        rgba(167, 139, 250, 0.1);
  --badge-proc-text:     #38bdf8;
  --badge-proc-bg:       rgba(56, 189, 248, 0.1);
  --badge-sys-text:      #71717a;
  --badge-sys-bg:        rgba(113, 113, 122, 0.1);

  /* Layout Dimensions */
  --header-height:    48px;
  --inspector-width:  38vw;
  --max-content-width:1360px;
  --radius-sm:        4px;
  --radius-md:        6px;
  --radius-lg:        8px;
}

/* Light Theme (Preserved cleanly) */
.theme-light {
  --bg-app:           #f8fafc;
  --bg-header:        #ffffff;
  --bg-surface:       #ffffff;
  --bg-surface-raised:#f1f5f9;
  --bg-surface-hover: #e2e8f0;
  --bg-surface-active:#cbd5e1;
  --border-subtle:    #f1f5f9;
  --border-base:      #e2e8f0;
  --border-strong:    #cbd5e1;
  --border-focus:     #0284c7;
  --text-primary:     #0f172a;
  --text-secondary:   #475569;
  --text-muted:       #64748b;
  --text-dim:         #94a3b8;
  --accent:           #0284c7;
  --accent-dim:       rgba(2, 132, 199, 0.08);
  --accent-border:    rgba(2, 132, 199, 0.2);
}

/* ═══════════════════════════════════════════════════════════
   2. RESET & GLOBAL BASE
═══════════════════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-app);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button {
  cursor: pointer;
  font-family: inherit;
  background: none;
  border: none;
  color: inherit;
}

input, select {
  font-family: inherit;
  font-size: 12px;
  color: var(--text-primary);
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

:focus-visible {
  outline: 1px solid var(--border-focus);
  outline-offset: 1px;
}

/* ═══════════════════════════════════════════════════════════
   3. APP SHELL LAYOUT
═══════════════════════════════════════════════════════════ */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Demo Mode Banner */
.demo-banner {
  background: var(--bg-surface-active);
  border-bottom: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════
   4. COMPACT TOP HEADER & NAVIGATION
═══════════════════════════════════════════════════════════ */
#header {
  height: var(--header-height);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-base);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 20px;
  flex-shrink: 0;
  z-index: 50;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.brand-mark {
  width: 16px;
  height: 16px;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.brand-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  border-left: 1px solid var(--border-base);
  padding-left: 8px;
  margin-left: 2px;
}

/* Top Navigation Tabs */
.top-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
}

.nav-tab {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.1s, background-color 0.1s;
}

.nav-tab:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-hover);
}

.nav-tab.active {
  color: var(--text-primary);
  background-color: var(--bg-surface-active);
  font-weight: 600;
}

.header-spacer {
  flex: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.run-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

/* Theme Toggle Button */
.btn-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}
.btn-icon:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
  border-color: var(--border-base);
}

.btn-action {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  border: 1px solid var(--border-base);
  transition: all 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-action:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

/* ═══════════════════════════════════════════════════════════
   5. STATUS BADGES & PILLS
═══════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1.4;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-match {
  color: var(--status-match);
  background: var(--status-match-bg);
  border: 1px solid var(--status-match-border);
}
.badge-match .badge-dot { background: var(--status-match); }

.badge-divergence {
  color: var(--status-div);
  background: var(--status-div-bg);
  border: 1px solid var(--status-div-border);
}
.badge-divergence .badge-dot { background: var(--status-div); }

.badge-inconc {
  color: var(--status-inconc);
  background: var(--status-inconc-bg);
  border: 1px solid var(--status-inconc-border);
}
.badge-inconc .badge-dot { background: var(--status-inconc); }

.badge-neutral {
  color: var(--status-neutral);
  background: var(--status-neutral-bg);
  border: 1px solid var(--status-neutral-border);
}
.badge-neutral .badge-dot { background: var(--status-neutral); }

/* Resource Class Badges */
.badge-res {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 6px;
  font-weight: 500;
  border-radius: 3px;
}
.badge-app  { color: var(--badge-app-text);  background: var(--badge-app-bg); }
.badge-proj { color: var(--badge-proj-text); background: var(--badge-proj-bg); }
.badge-ext  { color: var(--badge-ext-text);  background: var(--badge-ext-bg); }
.badge-env  { color: var(--badge-env-text);  background: var(--badge-env-bg); }
.badge-proc { color: var(--badge-proc-text); background: var(--badge-proc-bg); }
.badge-sys  { color: var(--badge-sys-text);  background: var(--badge-sys-bg); }

/* ═══════════════════════════════════════════════════════════
   6. MAIN VIEWPORT CONTAINER
═══════════════════════════════════════════════════════════ */
#main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

.view-stage {
  display: none;
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 24px;
}

.view-stage.active {
  display: block;
}

/* Full bleed for Graph view */
#view-graph.view-stage {
  max-width: none;
  padding: 0;
  height: calc(100vh - var(--header-height));
  overflow: hidden;
}
#view-graph.view-stage.active {
  display: flex;
  flex-direction: column;
}

/* Section Header & Dividers */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  margin-top: 24px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.section-head:first-child {
  margin-top: 0;
}

.section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   7. OVERVIEW VIEW (EVIDENCE-FIRST HERO)
═══════════════════════════════════════════════════════════ */
.hero-verdict-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.hero-verdict-card.divergence {
  border-color: var(--status-div-border);
  background: var(--bg-surface);
}

.hero-verdict-card.match {
  border-color: var(--status-match-border);
  background: var(--bg-surface);
}

.hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.hero-status-tag {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero-title.divergence { color: var(--status-div); }
.hero-title.match { color: var(--status-match); }
.hero-title.inconc { color: var(--status-inconc); }

.hero-divergence-body {
  background: var(--bg-app);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 12px;
}

.divergence-anchor-lead {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.divergence-ab-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}

.ab-pane {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.ab-pane.diverging {
  border-color: var(--status-div-border);
}

.ab-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.ab-resource {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}

.ab-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.ab-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 11px;
}

/* Downstream Effects List */
.effects-list {
  list-style: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.effect-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
}

.effect-item:last-child {
  border-bottom: none;
}

.effect-icon {
  color: var(--status-inconc);
  font-size: 12px;
  margin-top: 1px;
}

.effect-text {
  color: var(--text-primary);
}

/* Metadata Strip */
.meta-strip {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 16px;
  margin-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-item-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.meta-item-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════
   8. SPLIT-PANE COMPARISON VIEW
═══════════════════════════════════════════════════════════ */
.comparison-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.split-timeline-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.split-timeline-header {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  padding: 10px 16px;
  background: var(--bg-surface-raised);
  border-bottom: 1px solid var(--border-base);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.split-row {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.1s;
}

.split-row:hover {
  background: var(--bg-surface-hover);
}

.split-row.divergent {
  background: rgba(239, 68, 68, 0.12);
}

.split-cell {
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.split-cell.left {
  border-right: 1px solid var(--border-subtle);
}

.split-spine {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  border-right: 1px solid var(--border-subtle);
}

.split-row.divergent .split-spine {
  color: var(--status-div);
  font-weight: 700;
}

.split-event-type {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
}

.split-resource {
  font-family: var(--font-mono);
  color: var(--text-primary);
  word-break: break-all;
}

/* ═══════════════════════════════════════════════════════════
   9. DEPENDENCY GRAPH VIEW
═══════════════════════════════════════════════════════════ */
.graph-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: var(--bg-app);
}

.graph-controls {
  height: 40px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-base);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  flex-shrink: 0;
  z-index: 10;
}

.graph-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-pill {
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border-base);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: var(--bg-surface);
  cursor: pointer;
  user-select: none;
}

.filter-pill.active {
  background: var(--bg-surface-active);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.graph-canvas-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#graph-svg {
  width: 100%;
  height: 100%;
  cursor: grab;
}
#graph-svg:active {
  cursor: grabbing;
}

/* Graph SVG Elements */
.graph-node {
  cursor: pointer;
}
.graph-node rect, .graph-node circle {
  transition: stroke 0.15s, stroke-width 0.15s;
}
.graph-node:hover rect, .graph-node:hover circle {
  stroke: var(--accent);
  stroke-width: 2px;
}
.graph-node.selected rect, .graph-node.selected circle {
  stroke: var(--accent);
  stroke-width: 2.5px;
}

.graph-node-label {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--text-primary);
  pointer-events: none;
  user-select: none;
}

.graph-node-type {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  fill: var(--text-muted);
  pointer-events: none;
  user-select: none;
}

.graph-edge {
  cursor: pointer;
}
.graph-edge line {
  stroke: var(--border-strong);
  stroke-width: 1px;
  transition: stroke 0.15s, stroke-width 0.15s;
}
.graph-edge.related line {
  stroke: var(--accent);
  stroke-width: 1.2px;
}
.graph-edge:hover line, .graph-edge.selected line {
  stroke: var(--accent);
  stroke-width: 2px;
}
.graph-edge-label-group {
  display: none;
  pointer-events: none;
}
.graph-edge:hover .graph-edge-label-group,
.graph-edge.selected .graph-edge-label-group {
  display: block;
}

.graph-legend {
  position: absolute;
  bottom: 52px;
  left: 16px;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-base);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 5;
  pointer-events: none;
  font-family: var(--font-mono);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.graph-legend-title {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
  letter-spacing: 0.05em;
}
.graph-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  color: var(--text-secondary);
}
.graph-legend-color {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.graph-bottom-bar {
  position: absolute;
  bottom: 12px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.graph-stats-tag {
  background: rgba(18, 18, 22, 0.85);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  backdrop-filter: blur(4px);
  pointer-events: auto;
}

.graph-zoom-group {
  display: flex;
  gap: 4px;
  pointer-events: auto;
}

.graph-btn {
  width: 28px;
  height: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.graph-btn:hover {
  background: var(--bg-surface-hover);
}

/* ═══════════════════════════════════════════════════════════
   10. EVENT EXPLORER (TRACE DEBUGGER TABLE)
═══════════════════════════════════════════════════════════ */
.table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table-toolbar {
  padding: 10px 14px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-base);
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-field {
  flex: 1;
  max-width: 380px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-field input {
  width: 100%;
  background: var(--bg-app);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: var(--text-primary);
}

.search-field input:focus {
  border-color: var(--border-focus);
  outline: none;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th {
  text-align: left;
  padding: 8px 14px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-surface-raised);
  border-bottom: 1px solid var(--border-base);
  white-space: nowrap;
}

.data-table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr {
  cursor: pointer;
  transition: background-color 0.1s;
}

.data-table tbody tr:hover {
  background-color: var(--bg-surface-hover);
}

.data-table tbody tr.selected-row {
  background-color: var(--bg-surface-raised) !important;
  font-weight: 500;
}

.data-table td.col-seq {
  font-family: var(--font-mono);
  color: var(--text-muted);
  width: 70px;
}

.data-table td.col-type {
  font-family: var(--font-mono);
  color: var(--accent);
  width: 170px;
}

.data-table td.col-res {
  font-family: var(--font-mono);
  word-break: break-all;
}

.data-table td.col-proc {
  color: var(--text-secondary);
  width: 140px;
}

.data-table td.col-prov {
  color: var(--text-muted);
  font-size: 11px;
  width: 120px;
}

.table-pagination {
  padding: 8px 14px;
  background: var(--bg-surface-raised);
  border-top: 1px solid var(--border-base);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.btn-paginate {
  padding: 3px 10px;
  font-size: 11px;
  border: 1px solid var(--border-base);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
}
.btn-paginate:hover:not(:disabled) {
  background: var(--bg-surface-hover);
}
.btn-paginate:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════
   11. TRUST & OBSERVATION PANEL
═══════════════════════════════════════════════════════════ */
.trust-disclaimer-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.trust-matrix-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 24px;
}

/* ═══════════════════════════════════════════════════════════
   12. EVIDENCE INSPECTOR (SLIDE DRAWER)
═══════════════════════════════════════════════════════════ */
.inspector-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 100;
}
.inspector-backdrop.open {
  display: block;
}

#inspector {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--inspector-width);
  background: var(--bg-surface);
  border-left: 1px solid var(--border-base);
  z-index: 101;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.4);
}

#inspector.open {
  transform: translateX(0);
}

.inspector-top {
  height: var(--header-height);
  padding: 0 16px;
  border-bottom: 1px solid var(--border-base);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--bg-header);
}

.inspector-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.inspector-close-btn {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1;
  padding: 4px;
}
.inspector-close-btn:hover {
  color: var(--text-primary);
}

.inspector-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.inspector-block {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.inspector-block-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.inspector-block-val {
  font-size: 13px;
  color: var(--text-primary);
  word-break: break-all;
}

/* Formal Proof Boundaries */
.proof-box {
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 12px;
  line-height: 1.5;
}

.proof-box.proves {
  background: var(--status-match-bg);
  border: 1px solid var(--status-match-border);
  color: var(--text-primary);
}
.proof-box.proves .proof-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--status-match);
  margin-bottom: 4px;
}

.proof-box.does-not-prove {
  background: var(--status-div-bg);
  border: 1px solid var(--status-div-border);
  color: var(--text-primary);
}
.proof-box.does-not-prove .proof-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--status-div);
  margin-bottom: 4px;
}

/* ═══════════════════════════════════════════════════════════
   13. RAW JSON MODAL
═══════════════════════════════════════════════════════════ */
.json-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.json-modal-backdrop.open {
  display: flex;
}

.json-modal-card {
  width: 90%;
  max-width: 640px;
  max-height: 80vh;
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5);
}

.json-modal-card pre {
  padding: 16px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════
   14. LOADING SPINNER
═══════════════════════════════════════════════════════════ */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-base);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ═══════════════════════════════════════════════════════════
   15. RESPONSIVE BREAKPOINTS
═══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  :root {
    --inspector-width: 100vw;
  }
  .divergence-ab-grid {
    grid-template-columns: 1fr;
  }
  .ab-divider {
    padding: 4px 0;
  }
  .split-timeline-header, .split-row {
    grid-template-columns: 1fr;
  }
  .split-spine {
    display: none;
  }
}
