:root {
  --bg: #f6f7f6;
  --fg: #1c1f1e;
  --muted: #6b716f;
  --card: #ffffff;
  --border: #dfe3e1;
  --accent: #1f6f5c;
  --ok: #1f7a3d;
  --warn: #9a6200;
  --bad: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121514;
    --fg: #e7ebe9;
    --muted: #9aa29f;
    --card: #1b1f1e;
    --border: #2c3230;
    --accent: #5cc4a6;
    --ok: #6fd08f;
    --warn: #e6b04a;
    --bad: #f2867d;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 480px; margin: 0 auto; padding: 16px; }
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
h1 { font-size: 1.25rem; margin: 0; }
button {
  font: inherit;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}
button.link { background: none; border: none; color: var(--accent); padding: 4px; }
button:disabled { opacity: .5; }
input {
  font: inherit;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
}
.pin { display: flex; flex-direction: column; gap: 12px; margin-top: 20vh; }
.pin input { font-size: 1.5rem; letter-spacing: .4em; text-align: center; }
.error { color: var(--bad); margin: 0; }
.muted { color: var(--muted); font-size: .9rem; }
.scanner { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner .error { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; background: var(--card); }
.manual { margin: 12px 0; }
.tabs { display: flex; gap: 4px; }
.tabs button { background: none; color: var(--fg); border-color: var(--border); padding: 6px 12px; }
.tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tabs.small { margin-bottom: 12px; }
.tabs.small button { font-size: .9rem; }
.scans { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.scan { background: var(--card); border: 1px solid var(--border); border-left-width: 6px; border-radius: 8px; padding: 10px 12px; }
.scan.ok, .scan.duplicate { border-left-color: var(--ok); }
.scan.unreadable { border-left-color: var(--bad); }
.scan .verdict { font-weight: 600; }
.scan.ok .verdict, .scan.duplicate .verdict { color: var(--ok); }
.scan.unreadable .verdict { color: var(--bad); }
.scans .scan:first-child { padding: 16px; }
.scans .scan:first-child .verdict { font-size: 1.3rem; }
.scan .row { display: flex; justify-content: space-between; gap: 8px; }
.url { word-break: break-all; }
.amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
h2 { font-size: 1.05rem; margin: 0 0 4px; }
hr { border: none; border-top: 1px solid var(--border); margin: 24px 0 16px; }
.copy-list { list-style: none; padding: 0; margin: 12px 0; }
.copy-row { display: grid; grid-template-columns: 1.2em 6.5em 1fr auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .95rem; }
.copy-row .vendor { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copied { color: var(--ok); }
.confirm { display: flex; gap: 4px; }
button.link.danger { color: var(--bad); }
button.wide, a.button { display: block; width: 100%; text-align: center; }
a.button { padding: 10px 16px; border-radius: 8px; background: var(--accent); color: #fff; text-decoration: none; }
.total { text-align: right; margin: 0 0 12px; }
.month { display: flex; gap: 8px; }
.month a.button { width: auto; white-space: nowrap; }
