:root {
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --ink: #14161A;
  --ink-2: #2B2F36;
  --muted: #5A606B;
  --line: #C9CDD5;
  --track: #ECEEF2;
  --accent: #1F4FC4;
  --accent-ink: #163A92;
  --accent-soft: #EAF0FD;
  --warn: #C2510E;
  --warn-mid: #D9822B;
  --warn-ink: #8F3A08;
  --warn-soft: #FDEEE4;
  --danger: #B42318;
  --danger-ink: #8A1C12;
  --danger-soft: #FCE8E6;
  --shadow: 0 1px 2px rgba(20, 22, 26, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --card: #1B1E24;
    --ink: #F1F2F4;
    --ink-2: #D9DCE1;
    --muted: #A2A8B3;
    --line: #3A3F48;
    --track: #2A2E36;
    --accent: #6F94F2;
    --accent-ink: #A9C0F8;
    --accent-soft: #1E2A47;
    --warn: #F08A4B;
    --warn-mid: #E8A15C;
    --warn-ink: #F5B58C;
    --warn-soft: #3A2417;
    --danger: #F2776B;
    --danger-ink: #F8A99F;
    --danger-soft: #3D1C19;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
.wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}
[hidden] { display: none !important; }
h1, h2 { font-family: "Space Grotesk", Inter, sans-serif; margin: 0; }
h1 { font-size: 22px; line-height: 1.2; }
h2 { font-size: 17px; font-weight: 600; }
a { color: var(--accent); }

.top { display: flex; align-items: center; min-height: 44px; }
.brand { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 20px; color: var(--ink); text-decoration: none; }

.search { display: flex; flex-direction: column; gap: 6px; }
.search label { font-size: 13px; font-weight: 500; color: var(--muted); }
.row { display: flex; gap: 8px; }
input[type="url"] {
  flex: 1; min-width: 0; height: 48px;
  border: 1px solid var(--line); border-radius: 12px; padding: 0 12px;
  font: 400 16px Inter, sans-serif; color: var(--ink); background: var(--card);
}
input[type="url"]:focus-visible, .btn:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.btn { height: 48px; padding: 0 18px; border-radius: 12px; font: 600 15px Inter, sans-serif; cursor: pointer; }
.btn.primary { border: 0; background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #0B1530; } }
.btn.secondary { border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.btn:disabled { opacity: 0.6; cursor: default; }

.card { background: var(--card); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.intro p { margin: 0; color: var(--ink-2); }
.intro .tagline { font-weight: 600; color: var(--ink); margin-top: -6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.loading { align-items: center; text-align: center; }
.loading-title { margin: 0; font-weight: 600; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--track); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); text-align: left; }
.steps li.done { color: var(--ink-2); }
.steps li.done::before { content: "✓ "; color: var(--accent); font-weight: 700; }
.steps li.now::before { content: "… "; }

.error { color: var(--danger-ink); background: var(--danger-soft); }

.hero { align-items: center; text-align: center; gap: 12px; }
.ring { position: relative; width: 140px; height: 140px; }
.ring-track { stroke: var(--track); }
#ringArc { transition: stroke-dasharray 0.8s ease; }
@media (prefers-reduced-motion: reduce) { #ringArc { transition: none; } }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 44px; line-height: 1; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.badge svg { flex: none; }
.tone-buy { --tone: var(--accent); --tone-ink: var(--accent-ink); --tone-soft: var(--accent-soft); }
.tone-caution { --tone: var(--warn-mid); --tone-ink: var(--warn-ink); --tone-soft: var(--warn-soft); }
.tone-elsewhere { --tone: var(--warn); --tone-ink: var(--warn-ink); --tone-soft: var(--warn-soft); }
.tone-dont { --tone: var(--danger); --tone-ink: var(--danger-ink); --tone-soft: var(--danger-soft); }
.badge { background: var(--tone-soft); color: var(--tone-ink); }
#ringArc { stroke: var(--tone, var(--accent)); }
.verdict { margin: 0; color: var(--ink-2); }
.hero .muted { margin: 0; }

.dims { display: flex; flex-direction: column; gap: 16px; }
.dim-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dim-name { font-weight: 600; }
.dim-score { font-size: 13px; font-weight: 600; color: var(--tone-ink); }
.bar { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; margin: 6px 0; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--tone); }
.dim-note { font-size: 13px; color: var(--muted); }

.reasons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.reasons li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); }
.dot { flex: none; width: 22px; height: 22px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.dot.good { color: var(--accent-ink); background: var(--accent-soft); }
.dot.bad { color: var(--warn-ink); background: var(--warn-soft); }
.details summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--accent); min-height: 44px; display: flex; align-items: center; }
.details[open] summary { margin-bottom: 8px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 14px 0 0; font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; word-break: break-word; }

.elsewhere { background: var(--accent-soft); box-shadow: none; }
.elsewhere h2 { color: var(--accent-ink); }
.product { display: flex; gap: 12px; align-items: center; }
.product img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; background: var(--card); flex: none; }
.product-name { font-weight: 600; color: var(--ink-2); }
.matches { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.matches a { display: flex; flex-direction: column; gap: 2px; background: var(--card); border-radius: 12px; padding: 12px 14px; text-decoration: none; min-height: 44px; }
.match-site { font-weight: 600; color: var(--accent-ink); font-size: 14px; }
.match-title { color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.linkbtn { flex: 1 1 180px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; text-align: center; }

.actions { display: flex; gap: 10px; }
.actions .btn { flex: 1; }
.footnote { font-size: 12px; color: var(--muted); text-align: center; margin: 0; }
