:root {
  --bg: #0a1622;
  --bg-2: #0f2236;
  --surface: #13283d;
  --surface-2: #1b3a55;
  --line: rgba(120, 170, 210, 0.16);
  --text: #eaf2fa;
  --muted: #8fa9c2;
  --accent: #36c2c9;
  --accent-2: #1e88a8;
  --gold: #d9b46a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 75% -10%, rgba(54, 194, 201, 0.16), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(30, 136, 168, 0.14), transparent 55%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
  min-height: 100vh;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: clamp(20px, 4vw, 48px); }

/* Header */
header { margin-bottom: 28px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); font-weight: 700;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(54, 194, 201, 0.06);
}
h1 {
  font-size: clamp(1.9rem, 1rem + 3.4vw, 3.4rem);
  line-height: 1.05; margin: 16px 0 10px; font-weight: 800; letter-spacing: -0.02em;
}
h1 .thin { color: var(--muted); font-weight: 500; }
.sub { color: var(--muted); font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.1rem); max-width: 60ch; }

.meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.chip {
  font-size: 0.8rem; color: var(--text);
  padding: 7px 13px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line);
}
.chip b { color: var(--gold); font-weight: 700; }

.updated {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 14px; font-size: 0.82rem; color: var(--muted);
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
}
.updated b { color: var(--text); font-weight: 600; }
.updated .tz { opacity: 0.7; }
.updated .dot {
  width: 8px; height: 8px; border-radius: 50%; background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); animation: lu-pulse 2.2s infinite;
}
@keyframes lu-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* Viewer */
.viewer {
  margin-top: 30px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.stage {
  position: relative; aspect-ratio: 1 / 1; max-height: 70vh;
  /* Real detail is ~160 px (10 m/px over a ~1.6 km box). Cap the display small
     so frames are shown downscaled (crisp) rather than stretched past their
     real detail (blocky/blurry). Smaller = sharper. */
  max-width: 360px; width: 100%; margin: 0 auto;
  background: #061019; display: grid; place-items: center;
}
.stage img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Before/after compare overlay */
.compare-top {
  position: absolute; inset: 0; overflow: hidden; width: 50%;
  border-right: 2px solid var(--accent);
}
.compare-top img { position: absolute; top: 0; left: 0; object-fit: cover; max-width: none; }
.compare-handle {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 36px;
  transform: translateX(-50%); cursor: ew-resize; display: none;
  align-items: center; justify-content: center; z-index: 4;
}
.compare-handle::before {
  content: ""; position: absolute; top: 0; bottom: 0; width: 2px;
  background: var(--accent); left: 50%; transform: translateX(-50%);
}
.compare-handle span {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent);
  color: #04212a; display: grid; place-items: center; font-size: 0.9rem; font-weight: 900;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.viewer.compare .compare-top,
.viewer.compare .compare-handle { display: flex; }

.stage-tag {
  position: absolute; top: 14px; left: 14px; z-index: 5;
  font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  background: rgba(6, 16, 25, 0.7); backdrop-filter: blur(6px);
  border: 1px solid var(--line); padding: 6px 11px; border-radius: 8px; color: var(--muted);
}
.stage-tag.r { left: auto; right: 14px; }

.crosshair {
  position: absolute; top: 50%; left: 50%; width: 30%; height: 30%;
  transform: translate(-50%, -50%); border: 1.5px dashed rgba(217, 180, 106, 0.55);
  border-radius: 6px; pointer-events: none; z-index: 3;
}

.empty {
  padding: 40px; text-align: center; color: var(--muted); max-width: 46ch;
}
.empty code { color: var(--accent); background: rgba(54,194,201,0.1); padding: 2px 7px; border-radius: 6px; }

/* Controls */
.bar { padding: 18px 20px; border-top: 1px solid var(--line); background: var(--bg-2); }
.bar-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.now {
  font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em;
}
.now small { display: block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.btns { display: flex; gap: 10px; }
button.ctl {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 10px; padding: 9px 16px; font-size: 0.86rem; font-weight: 600;
  cursor: pointer; transition: transform var(--ease) .25s, background .25s, border-color .25s;
}
button.ctl:hover { background: var(--surface-2); border-color: var(--accent); transform: translateY(-1px); }
button.ctl:active { transform: translateY(0); }
button.ctl.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #042; border: none; font-weight: 700; }
button.ctl.on { border-color: var(--gold); color: var(--gold); }

input[type="range"] {
  width: 100%; -webkit-appearance: none; appearance: none; height: 6px;
  border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 4px solid var(--accent); cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  border: 4px solid var(--accent); cursor: pointer;
}
.ticks { display: flex; justify-content: space-between; margin-top: 8px; font-size: 0.7rem; color: var(--muted); }

/* Filmstrip */
.strip { display: flex; gap: 8px; overflow-x: auto; padding: 18px 4px 6px; scrollbar-width: thin; }
.strip figure { margin: 0; flex: 0 0 auto; width: 92px; cursor: pointer; text-align: center; }
.strip img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px;
  border: 2px solid transparent; transition: border-color .2s, transform .2s; }
.strip figure:hover img { transform: translateY(-2px); }
.strip figure.active img { border-color: var(--accent); }
.strip figcaption { font-size: 0.68rem; color: var(--muted); margin-top: 5px; }

footer { margin-top: 34px; text-align: center; color: var(--muted); font-size: 0.8rem; line-height: 1.7; }
footer a { color: var(--accent); text-decoration: none; }
footer .dev { color: var(--gold); font-weight: 600; }

/* Report button accent */
button.ctl.report { border-color: var(--gold); color: var(--gold); }
button.ctl.report:hover { border-color: var(--gold); background: rgba(217, 180, 106, 0.1); }

/* ── EVIDENCE REPORT ───────────────────────────────────────────── */
.report-root {
  position: fixed; inset: 0; z-index: 1000; overflow-y: auto;
  background: #0a1622; padding: 24px 16px 60px;
}
.rp-toolbar { display: flex; gap: 10px; justify-content: flex-end; max-width: 900px; margin: 0 auto 16px; }
.rp-doc {
  max-width: 900px; margin: 0 auto; background: #ffffff; color: #10202e;
  border-radius: 12px; padding: 44px; box-shadow: var(--shadow); line-height: 1.55;
}
.rp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  border-bottom: 3px solid var(--accent); padding-bottom: 16px; }
.rp-brand { font-size: 30px; font-weight: 900; letter-spacing: .06em; color: #0e7c84; line-height: 1; }
.rp-brandsub { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #5a7184; margin-top: 5px; }
.rp-issued { text-align: right; font-size: 11px; color: #5a7184; }
.rp-issued b { display: block; color: #10202e; font-size: 13px; margin-top: 2px; }
.rp-title { font-size: 26px; font-weight: 800; margin-top: 20px; color: #10202e; }
.rp-tag { font-size: 13px; color: #5a7184; margin-top: 4px; }
.rp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 30px; margin: 22px 0 6px; }
.rp-grid div { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px solid #e6edf3; padding: 8px 0; font-size: 12.5px; }
.rp-grid span { color: #5a7184; }
.rp-grid b { color: #10202e; text-align: right; }
.rp-h2 { font-size: 14px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #0e7c84; margin: 28px 0 12px; }
.rp-ba { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rp-ba img { width: 100%; border-radius: 8px; border: 1px solid #d6e0e8; display: block; }
.rp-ba figcaption { font-size: 12px; margin-top: 7px; color: #33485a; }
.rp-ba figcaption b { color: #0e7c84; }
.rp-msrow { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.rp-ms img { width: 100%; border-radius: 6px; border: 1px solid #d6e0e8; display: block; }
.rp-ms figcaption { font-size: 9.5px; text-align: center; margin-top: 4px; color: #5a7184; }
.rp-note { font-size: 12.5px; line-height: 1.65; color: #33485a; }
.rp-disclaimer { font-size: 11px; line-height: 1.6; color: #6a7f8e; font-style: italic; margin-top: 14px; }
.rp-foot { margin-top: 26px; border-top: 1px solid #e6edf3; padding-top: 14px; font-size: 11px; color: #5a7184; text-align: center; }
.rp-foot b { color: #10202e; }

@media (max-width: 640px) {
  .rp-doc { padding: 24px; }
  .rp-grid, .rp-ba { grid-template-columns: 1fr; }
  .rp-msrow { grid-template-columns: repeat(3, 1fr); }
}

/* Print: show only the report document */
@media print {
  body.report-open .wrap { display: none !important; }
  .report-root { position: static !important; background: #fff !important; padding: 0 !important; overflow: visible !important; }
  .no-print { display: none !important; }
  .rp-doc { box-shadow: none !important; max-width: none !important; border-radius: 0 !important; padding: 0 !important; }
  .rp-ba { page-break-inside: avoid; }
  @page { margin: 14mm; }
}
