:root {
  --bg: #11131a; --card: #1b1e29; --fg: #eef1f8; --muted: #9aa3b8;
  --accent: #c9a24b; --ok: #3ecf8e; --err: #ff6b6b; --line: #2a2e3c;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line); background: #15171f;
}
.brand { font-weight: 700; letter-spacing: .02em; color: var(--accent); }
.navlink { color: var(--fg); text-decoration: none; opacity: .85; }
.wrap { max-width: 720px; margin: 0 auto; padding: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; margin-top: 16px;
}
h1 { font-size: 1.3rem; margin: 0 0 .4rem; }
.muted { color: var(--muted); }
.fineprint { color: var(--muted); font-size: .82rem; margin-top: 14px; }
.error { color: var(--err); font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
input[type=text], input:not([type]) , input[name] {
  padding: 12px; border-radius: 10px; border: 1px solid var(--line);
  background: #0e1017; color: var(--fg); font-size: 1rem;
}
.row { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: #232739; color: var(--fg); font-size: 1rem; cursor: pointer;
  text-decoration: none;
}
.btn.primary { background: var(--accent); color: #1a1400; border-color: var(--accent); font-weight: 700; }
.filebtn { cursor: pointer; }
.camera-frame { background: #000; border-radius: 12px; overflow: hidden; }
#cam { width: 100%; max-height: 60vh; display: block; }
progress { width: 100%; height: 10px; }
.results { list-style: none; padding: 0; margin: 12px 0 0; }
.results li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.results .ok { color: var(--ok); }
.results .fail { color: var(--err); }
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px; margin-top: 14px;
}
.tile { margin: 0; }
.tile img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background:#0e1017; }
.tile figcaption { margin-top: 4px; text-align: center; }
.badge { font-size: .72rem; padding: 2px 8px; border-radius: 999px; }
.badge.ok { background: rgba(62,207,142,.18); color: var(--ok); }
.badge.pending { background: rgba(201,162,75,.18); color: var(--accent); }
