:root {
  --bg: #0f1226;
  --bg2: #171b3a;
  --card: #1e2350;
  --ink: #f4f6ff;
  --muted: #a9b0e0;
  --accent: #ffd23f;
  --accent2: #ff6f91;
  --good: #3ddc97;
  --bad: #ff8b8b;
  --line: rgba(255, 255, 255, 0.1);
  --radius: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 90% -10%, #2a2f73 0%, transparent 55%),
    radial-gradient(700px 380px at 0% 0%, #3a1f5c 0%, transparent 50%),
    linear-gradient(165deg, var(--bg), var(--bg2));
  -webkit-font-smoothing: antialiased;
}
button, label { font: inherit; }
button { cursor: pointer; }
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top)) 18px calc(12px + env(safe-area-inset-bottom));
}
#capture, #review {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.preview-slot {
  flex: 1 1 auto;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.brand strong { display: block; font-size: 18px; }
.brand small { color: var(--muted); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-size: 12px; }
.logo {
  width: 42px; height: 42px; border-radius: 12px;
  background:
    linear-gradient(#ffd23f, #ffd23f) 8px 8px / 14px 3px no-repeat,
    linear-gradient(#ffd23f, #ffd23f) 8px 8px / 3px 14px no-repeat,
    linear-gradient(160deg, #262c66, #1e2350);
  box-shadow: inset 0 0 0 2px rgba(255, 210, 63, 0.7);
}
h1 { font-size: 32px; line-height: 1.1; margin: 0 0 10px; }
h2 { font-size: 18px; margin: 0 0 8px; }
.lead, p { color: var(--muted); line-height: 1.45; }
.eyebrow { color: var(--accent); font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; font-size: 13px; margin: 0 0 6px; }
.steps { margin: 0 0 18px; padding-left: 18px; color: var(--ink); }
.steps li { margin: 6px 0; }
.tip { color: var(--accent); font-size: 15px; }
.disclaimer {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.btn, .shutter {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 14px;
  min-height: 54px;
  padding: 14px 16px;
  font-weight: 800;
  color: #1a1030;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  touch-action: manipulation;
}
.btn.ghost, label.btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  text-align: center;
}
.btn:disabled, .shutter:disabled { opacity: 0.45; }
.actions { display: grid; gap: 10px; margin-top: 14px; }
.text-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  background: transparent;
  color: var(--muted);
  border: 0;
  min-height: 44px;
}
.finder {
  position: relative;
  aspect-ratio: 3 / 4;
  height: 100%;
  width: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: #090b18;
  border: 1px solid var(--line);
}
video, #still {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #090b18;
  display: block;
  border-radius: 16px;
}
#still {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 10px;
  padding-top: 8px;
  background: #12162f;
}
.guide { position: absolute; inset: 0; pointer-events: none; }
.guide[data-kind="full"]::before {
  content: "";
  position: absolute;
  inset: 8% 12%;
  border: 3px dashed var(--accent);
  border-radius: 14px;
  box-shadow: 0 0 0 999px rgba(8, 10, 24, 0.38);
}
.guide[data-kind="corner"]::before {
  content: "";
  position: absolute;
  width: 42%;
  height: 42%;
  border: 4px solid var(--accent);
}
.guide[data-corner="tl"]::before { left: 14%; top: 14%; border-right: 0; border-bottom: 0; border-radius: 16px 0 0 0; }
.guide[data-corner="tr"]::before { right: 14%; top: 14%; border-left: 0; border-bottom: 0; border-radius: 0 16px 0 0; }
.guide[data-corner="bl"]::before { left: 14%; bottom: 14%; border-right: 0; border-top: 0; border-radius: 0 0 0 16px; }
.guide[data-corner="br"]::before { right: 14%; bottom: 14%; border-left: 0; border-top: 0; border-radius: 0 0 16px 0; }
.camera-note {
  position: absolute;
  left: 16px; right: 16px; bottom: 16px;
  margin: 0;
  color: var(--ink);
  background: rgba(15, 18, 38, 0.88);
  border-radius: 12px;
  padding: 10px 12px;
}
#issues { list-style: none; padding: 0; margin: 12px 0; }
#issues li, .issues-text {
  background: rgba(255, 139, 139, 0.12);
  color: #ffd0d0;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 8px 0;
}
.centering {
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 8px 0 4px;
}
.centering strong { color: var(--ink); }
.pair { display: flex; justify-content: space-between; gap: 12px; margin: 4px 0; color: var(--ink); }
.scores { display: grid; gap: 10px; margin: 16px 0 20px; }
.score {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 10px 12px;
}
.score header { display: flex; justify-content: space-between; font-weight: 800; color: var(--ink); }
.bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); margin-top: 8px; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.verdict { font-size: 28px; font-weight: 850; margin: 0 0 6px; }
.verdict.yes { color: var(--good); }
.verdict.no { color: var(--accent); }
.shot-block { margin: 0 0 16px; }
.shot-block img, .shot-block canvas { width: 100%; border-radius: 14px; display: block; }
.shot-block .callout {
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 3px solid var(--accent2);
  color: var(--ink);
}
.ebay {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px;
}
.spinner {
  width: 46px; height: 46px; margin: 24px auto;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
