:root {
  --bg: #0b1220;
  --surface: #121c2f;
  --surface-2: #19253c;
  --text: #e7edf7;
  --muted: #aeb8c8;
  --accent: #5ea0ff;
  --border: #2d3b56;
  --success: #1f9d66;
  --warning: #c68a1d;
  --danger: #d14d72;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background: linear-gradient(180deg, #0a1120 0%, #0f1728 100%);
  color: var(--text);
}
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(8, 14, 24, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav-shell { display: flex; justify-content: space-between; align-items: center; padding: 18px 0; gap: 24px; }
.brand { color: white; font-size: 1.4rem; text-decoration: none; font-weight: 700; }
.subtitle { color: var(--muted); font-size: 0.92rem; margin-top: 4px; }
nav a { color: var(--muted); text-decoration: none; margin-left: 16px; }
nav a:hover { color: white; }
.main-content { padding: 28px 0 40px; }
.footer { padding: 18px 0 36px; color: var(--muted); font-size: 0.95rem; }
.card {
  background: rgba(18, 28, 47, 0.92);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.22);
}
.hero { display: grid; grid-template-columns: 1.35fr 0.65fr; gap: 22px; align-items: stretch; }
.hero h1 { margin-top: 0; font-size: 2rem; }
.warning-text { color: #ffd58a; }
.lead { color: var(--muted); }
.grid.two-columns { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 22px; }
.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.video-shell, .image-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #07101f;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.video-shell video,
.video-shell canvas,
.image-shell img,
.image-shell canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hidden { display: none !important; }
.button-row, .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.actions.compact { margin-top: 0; }
button, .btn {
  background: var(--surface-2);
  color: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button.primary, .btn-primary { background: var(--accent); color: #08111f; border-color: transparent; font-weight: 700; }
button.danger, .btn-danger { background: var(--danger); border-color: transparent; }
button:hover, .btn:hover { filter: brightness(1.05); }
.field-row { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
label { color: var(--muted); }
input, select {
  background: #0e1728;
  color: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  width: 100%;
}
input[type="file"] {
  border: none;
  padding: 0;
  background: transparent;
}
.filelabel {
  display: block;
  width: 100%;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 14px;
  background: #0d1627;
  margin-top: 16px;
}
.status-panel, .resultbox {
  padding: 14px;
  border-radius: 12px;
  background: #0d1627;
  border: 1px solid var(--border);
  color: var(--muted);
}
.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  margin-top: 18px;
}
.result-grid dt { color: var(--muted); }
.result-grid dd { margin: 0; font-weight: 700; }
.resultlist { display: grid; gap: 12px; margin-top: 16px; }
.resultitem {
  background: #0d1627;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.resultitem strong { color: #fff; }
.badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: #102340;
  color: #c9ddff;
  margin-right: .35rem;
  font-size: .85rem;
}
.note-box {
  background: rgba(10, 18, 32, .8);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px; border-bottom: 1px solid var(--border); text-align: left; }
.data-table th { color: var(--muted); font-weight: 600; }
.hint { color: var(--muted); font-size: .92rem; margin-top: .5rem; }
code { background: #0b1423; padding: 2px 7px; border-radius: 8px; }
.inline-stack { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mt-16 { margin-top: 16px; }
.mt-8 { margin-top: 8px; }
.mb-0 { margin-bottom: 0; }
@media (max-width: 900px) {
  .hero, .grid.two, .grid.two-columns { grid-template-columns: 1fr; }
  .nav-shell { flex-direction: column; align-items: flex-start; }
}


.overlay-host { position: relative; }
.overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}
.video-shell video, .image-shell img { z-index: 1; }
.video-shell .overlay-canvas, .image-shell .overlay-canvas { background: transparent; }


.telemetry-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0d1627;
  padding: 12px;
  height: 100%;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.45;
}
.telemetry-panel h3 { margin-top: 0; }
.telemetry-line { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.stack-grid { display: grid; gap: 22px; }
.canvas-shell { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: #07101f; }
.canvas-shell canvas { display: block; width: 100%; height: auto; }


.telemetry-panel-wide {
  max-height: 340px;
}
.telemetry-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 16px;
  padding: 10px 0;
}
.telemetry-card strong {
  color: #fff;
}
.telemetry-meta {
  color: var(--muted);
}
.telemetry-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(94,160,255,.14);
  border: 1px solid rgba(94,160,255,.25);
  margin: 0 6px 6px 0;
}

.compare-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.compare-metrics { display:grid; gap: 8px; margin-top: 10px; }
.compare-metric { display:flex; justify-content:space-between; gap: 12px; padding: 8px 10px; border:1px solid rgba(255,255,255,.07); border-radius: 10px; background: rgba(255,255,255,.02); }
.accessory-grid input[type="color"] { min-height: 44px; padding: 4px; }
@media (max-width: 900px) { .compare-grid { grid-template-columns: 1fr; } }

.forensic-hero {
  background: linear-gradient(180deg, rgba(18,28,47,.96), rgba(11,18,32,.96));
}
.forensic-callout {
  border-style: dashed;
}
.lab-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.lab-tabs button {
  background: rgba(255,255,255,.04);
}
.lab-tabs button.active {
  background: var(--accent);
  color: #08111f;
  border-color: transparent;
  font-weight: 700;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.preview-slot {
  min-height: 180px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #0d1627;
  padding: 12px;
}
.preview-empty {
  color: var(--muted);
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.forensic-preview-card {
  display: grid;
  gap: 10px;
}
.preview-title {
  font-weight: 700;
  color: #fff;
}
.preview-canvas {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
}
.card-subtle {
  background: rgba(13,22,39,.7);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 18px;
}


.forensic-stage { display:grid; grid-template-columns:minmax(0,1fr) 360px; gap:18px; align-items:start; }
.forensic-right { display:flex; flex-direction:column; gap:18px; }
.forensic-control-panel { background:rgba(7,16,28,.92); border:1px solid #244a7a; border-radius:14px; padding:16px; box-shadow:0 10px 30px rgba(0,0,0,.24); }
.forensic-control-panel h2 { margin:0 0 14px; font-size:1.08rem; letter-spacing:.12em; text-transform:uppercase; }
.forensic-control-group { border:1px solid rgba(94,160,255,.22); border-radius:12px; padding:12px; margin-bottom:12px; }
.forensic-control-group h3 { margin:0 0 10px; font-size:.98rem; letter-spacing:.08em; text-transform:uppercase; color:#e9f3ff; }
.forensic-check-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px 12px; }
.forensic-check { display:flex; align-items:center; gap:8px; color:#e8eef8; min-height:28px; }
.forensic-check input { width:18px; height:18px; accent-color:#1f8bff; }
.forensic-telemetry-stack { display:flex; flex-direction:column; gap:16px; }
.overlay-host.forensic-live { position:relative; border-radius:18px; overflow:hidden; border:1px solid #234369; background:#040b15; min-height:420px; }
.overlay-host.forensic-live video, .overlay-host.forensic-live img, .overlay-host.forensic-live canvas { border-radius:18px; }
.overlay-mini-hud { position:absolute; top:14px; left:14px; z-index:4; width:240px; padding:14px; border-radius:12px; background:rgba(58,64,74,.78); backdrop-filter:blur(8px); color:#f7fbff; border:1px solid rgba(255,255,255,.08); box-shadow:0 10px 30px rgba(0,0,0,.22); }
.overlay-mini-hud.hidden { display:none; }
.overlay-mini-hud .hud-topline { display:flex; gap:18px; font-weight:700; font-size:1.1rem; margin-bottom:10px; color:#e8fff3; }
.overlay-mini-hud .hud-topline span { display:flex; align-items:center; gap:8px; }
.overlay-mini-hud .hud-bars { display:flex; flex-direction:column; gap:6px; }
.overlay-mini-hud .hud-bar-row { display:grid; grid-template-columns:92px 1fr; gap:10px; align-items:center; font-size:.97rem; }
.overlay-mini-hud .hud-bar { height:7px; border-radius:999px; background:rgba(103,126,145,.35); overflow:hidden; }
.overlay-mini-hud .hud-bar > span { display:block; height:100%; border-radius:999px; background:linear-gradient(90deg,#49ff9b,#a5ffb3); }
.overlay-mini-hud .hud-topline .icon { color:#49ff9b; }
.forensic-status-note { color:#bdd6f3; font-size:.92rem; line-height:1.45; }
@media (max-width: 1100px) { .forensic-stage { grid-template-columns:1fr; } }
