:root {
  --bg: #0b1020;
  --panel: #131a2e;
  --line: #24304d;
  --text: #e6ebf5;
  --muted: #93a0bd;
  --accent: #4f8cff;
  --pothole: #f2994a;
  --crack: #2dd4bf;
  --ok: #34d399;
  --deny: #f87171;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }

.hero, main, footer { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.hero { padding-top: 48px; padding-bottom: 24px; }
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: .02em; margin: 0 0 8px; }
h1 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); line-height: 1.15; margin: 0 0 12px; }
.lede { color: var(--muted); max-width: 62ch; margin: 0; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin: 24px 0;
}
.panel-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
h2 { margin: 0; font-size: 1.25rem; }

.model-switch { display: flex; flex-wrap: wrap; gap: 6px; }
.model-switch label {
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; color: var(--muted); font-size: .9rem;
}
.model-switch input { accent-color: var(--accent); }
.model-switch label:has(input:checked) { color: var(--text); border-color: var(--accent); }

.detect-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 20px; }
@media (max-width: 800px) { .detect-grid { grid-template-columns: 1fr; } }

.samples { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.samples button {
  padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: none; aspect-ratio: 4 / 3;
}
.samples button[aria-pressed="true"] { border-color: var(--accent); }
.samples img { width: 100%; height: 100%; object-fit: cover; display: block; }

.file-btn {
  display: block; text-align: center; margin-top: 10px; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; cursor: pointer; color: var(--muted);
}
.file-btn input { display: none; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 8px; }
.stats div { background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.stats dt { color: var(--muted); font-size: .75rem; }
.stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.det-list { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.det-list li { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--line); }

.stage { margin: 0; }
.stage canvas { width: 100%; height: auto; border-radius: 12px; background: #000; display: block; }
.stage figcaption { color: var(--muted); font-size: .85rem; margin-top: 6px; }

.note { color: var(--muted); font-size: .92rem; margin: 0 0 16px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions button {
  background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; font: inherit; font-size: .9rem;
}
.actions button:hover { border-color: var(--accent); }

.log { min-height: 3.2em; margin: 12px 0 16px; font: .85rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.log .allow { color: var(--ok); }
.log .deny { color: var(--deny); }

.reports { width: 100%; border-collapse: collapse; font-size: .92rem; }
.reports th, .reports td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
.reports th { color: var(--muted); font-weight: 500; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; background: var(--bg); border: 1px solid var(--line); }
.chip.new { color: var(--accent); }
.chip.in-progress { color: var(--pothole); }
.chip.fixed { color: var(--ok); }
@media (max-width: 640px) { .reports th:nth-child(4), .reports td:nth-child(4) { display: none; } }

footer { color: var(--muted); font-size: .85rem; padding-bottom: 40px; }
