:root {
  --bg: #f8fafc;
  --fg: #0f172a;
  --muted: #64748b;
  --card: #ffffff;
  --border: #e2e8f0;
  --accent: #0f766e;
  --accent-fg: #ffffff;
  --error: #b91c1c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --fg: #e2e8f0;
    --muted: #94a3b8;
    --card: #111827;
    --border: #1f2937;
    --accent: #14b8a6;
    --accent-fg: #042f2e;
    --error: #f87171;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
main {
  max-width: 560px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px 32px;
}
h1 { font-size: 1.5rem; margin: 8px 0 20px; }
h2 { font-size: 1.05rem; color: var(--muted); margin: 28px 0 8px; }
.big {
  display: block;
  text-align: center;
  padding: 22px;
  margin-bottom: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
}
.big.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); padding: 34px 22px; }
#status { min-height: 1.4em; color: var(--muted); }
#status.error { color: var(--error); }
form { display: flex; gap: 8px; }
input[type=password], input[type=search] {
  flex: 1; padding: 12px; font-size: 1rem;
  border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--fg);
}
button {
  padding: 12px 18px; font-size: 1rem; border: 0; border-radius: 10px;
  background: var(--accent); color: var(--accent-fg); font-weight: 600;
}
#list { list-style: none; padding: 0; margin: 0; }
#list li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; margin-bottom: 8px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
}
#list img, #list .pdf {
  width: 48px; height: 48px; object-fit: cover; border-radius: 8px; flex: none;
  background: var(--border); display: grid; place-items: center; font-size: .75rem; color: var(--muted);
}
#list .meta { min-width: 0; color: inherit; text-decoration: none; }
#list .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#list .sub { color: var(--muted); font-size: .85rem; }
input[type=search] { width: 100%; margin-top: 16px; }
#list .amount { margin-left: auto; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
#list .warn { color: var(--error); }
