:root {
  --bg: #f4f5f7; --card: #ffffff; --text: #111827; --muted: #6b7280; --line: #e5e7eb;
  --accent: #2563eb; --accent-text: #ffffff;
  --good: #15803d; --good-bg: #dcfce7; --warn: #a16207; --warn-bg: #fef9c3; --bad: #b91c1c; --bad-bg: #fee2e2;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a; --card: #1e293b; --text: #f1f5f9; --muted: #94a3b8; --line: #334155;
    --accent: #3b82f6; --accent-text: #ffffff;
    --good: #4ade80; --good-bg: #14532d; --warn: #facc15; --warn-bg: #422006; --bad: #f87171; --bad-bg: #450a0a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
.bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--card); border-bottom: 1px solid var(--line);
}
.bar h1 { font-size: 18px; margin: 0; flex: 1; }
.status { color: var(--muted); font-size: 14px; }
.status.ok { color: var(--good); } .status.bad { color: var(--bad); }
main { max-width: 560px; margin: 0 auto; padding: 12px 16px 40px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.center { text-align: center; }
h2 { font-size: 17px; margin: 0 0 8px; }
h3 { font-size: 14px; margin: 14px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
label { display: block; margin: 12px 0 0; font-weight: 600; font-size: 14px; }
input {
  display: block; width: 100%; margin-top: 4px; padding: 12px; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
button { font: inherit; border: 0; border-radius: 10px; padding: 12px 16px; cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-text); font-weight: 700; }
button.big { width: 100%; margin-top: 16px; padding: 16px; font-size: 18px; }
button.ghost { background: transparent; color: var(--muted); width: 100%; margin-top: 6px; }
button.icon { background: transparent; color: var(--text); font-size: 20px; padding: 6px 10px; }
button.chip { background: var(--bg); color: var(--text); border: 1px solid var(--line); padding: 8px 12px; margin: 0 6px 6px 0; font-size: 14px; }
button:disabled { opacity: .5; }
.row { display: flex; gap: 8px; margin-top: 14px; }
.row > * { flex: 1; }
.camera {
  display: flex; align-items: center; justify-content: center; margin: 0; padding: 22px;
  border: 2px dashed var(--line); border-radius: 12px; font-size: 18px; cursor: pointer;
}
.thumbs { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 88px; height: 88px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.thumb button {
  position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; padding: 0; border-radius: 50%;
  background: var(--text); color: var(--bg); font-size: 14px; line-height: 26px;
}
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: 13px; margin: 6px 0 0; }
.error { background: var(--bad-bg); color: var(--bad); padding: 12px 14px; border-radius: 10px; }
.spinner {
  width: 36px; height: 36px; margin: 8px auto; border-radius: 50%;
  border: 4px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.verdict { border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; font-weight: 700; font-size: 20px; }
.verdict small { display: block; font-weight: 400; font-size: 14px; }
.verdict.buy { background: var(--good-bg); color: var(--good); }
.verdict.maybe { background: var(--warn-bg); color: var(--warn); }
.verdict.skip { background: var(--bad-bg); color: var(--bad); }
.name { font-size: 20px; font-weight: 700; margin: 0; }
.big-number { font-size: 34px; font-weight: 800; line-height: 1.1; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-top: 1px solid var(--line); padding: 10px 0; display: flex; gap: 10px; align-items: center; }
.list li:first-child { border-top: 0; }
.list img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; flex: none; }
.list a { color: var(--text); text-decoration: none; flex: 1; min-width: 0; }
.list .t { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .p { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); margin: 4px 4px 0 0; }
.tag.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
ul.plain { margin: 4px 0 0; padding-left: 20px; }
.inline-form { display: flex; gap: 8px; margin-top: 8px; }
.inline-form input { margin: 0; }
.inline-form button { flex: none; }
