:root {
  --bg: #f4f5f7; --card: #fff; --ink: #14213d; --muted: #6b7280; --line: #e5e7eb;
  --accent: #e76f51; --accent-ink: #fff; --ok: #2a9d8f; --warn: #e9c46a; --bad: #c0392b;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1420; --card: #1a2131; --ink: #eef1f6; --muted: #9aa3b2; --line: #2a3346; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink);
  padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: #14213d; color: #fff; }
header h1 { font-size: 18px; margin: 0; }
header button { background: none; border: 0; color: #fff; font-size: 22px; }
main { padding: 16px; max-width: 720px; margin: 0 auto; }
nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
nav a { flex: 1; text-align: center; padding: 8px 2px; text-decoration: none; color: var(--muted); font-size: 20px; position: relative; }
nav a span { display: block; font-size: 11px; }
nav a.on { color: var(--accent); }
nav a .badge { position: absolute; top: 4px; right: calc(50% - 22px); background: var(--accent); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 6px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.muted { color: var(--muted); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 22px; }
.stat span { font-size: 12px; color: var(--muted); }
.btn { display: inline-block; border: 0; border-radius: 10px; padding: 11px 14px; font-size: 15px; font-weight: 600; cursor: pointer;
  background: var(--line); color: var(--ink); text-decoration: none; margin: 4px 4px 4px 0; }
.btn.main { background: var(--accent); color: var(--accent-ink); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.bad { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
.btn.full { display: block; width: 100%; text-align: center; margin: 8px 0; }
.banner { background: var(--accent); color: #fff; border-radius: 14px; padding: 14px; margin-bottom: 12px; display: block; text-decoration: none; }
.banner.err { background: var(--bad); }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--line); margin: 2px 4px 2px 0; }
.score { float: right; font-weight: 700; color: var(--accent); }
ul.find { margin: 6px 0; padding-left: 18px; font-size: 14px; }
textarea, input, select { width: 100%; font: inherit; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
textarea { min-height: 160px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
details summary { cursor: pointer; color: var(--accent); font-size: 14px; margin-top: 6px; }
pre { white-space: pre-wrap; font: inherit; font-size: 14px; margin: 6px 0; }
.sticky { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); }
.ev { font-size: 13px; border-bottom: 1px solid var(--line); padding: 6px 0; }
.chips { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; }
.chips a { white-space: nowrap; }
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #14213d; color: #fff; padding: 10px 16px;
  border-radius: 10px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 10; max-width: 90vw; }
#toast.show { opacity: 1; }
a { color: var(--accent); }
