:root {
  --bg: #f4f5f2;
  --card: #ffffff;
  --text: #1c211d;
  --muted: #65706a;
  --line: #dfe3dd;
  --accent: #12775a;
  --accent-text: #ffffff;
  --ok: #12775a;
  --warn: #a8690a;
  --bad: #b3302a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131714;
    --card: #1c221e;
    --text: #e8ece8;
    --muted: #98a39c;
    --line: #2f3832;
    --accent: #3fb48e;
    --accent-text: #0c1410;
    --ok: #3fb48e;
    --warn: #e0a544;
    --bad: #ef7a72;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
}
main { max-width: 640px; margin: 0 auto; padding: 16px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 16px; }
h1 { font-size: 1.25rem; margin: 0; }
h2 { font-size: 1rem; margin: 0 0 8px; }
p { margin: 6px 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.muted { color: var(--muted); font-size: 0.875rem; }
.error { color: var(--bad); min-height: 1.4em; margin: 6px 0 0; font-size: 0.875rem; }
label { display: block; font-size: 0.875rem; }
input[type="password"], input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
button {
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  cursor: pointer;
}
button.ghost { color: var(--text); background: transparent; border-color: var(--line); font-weight: 400; }
:is(button, input):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#login { display: grid; gap: 10px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.875rem; font-weight: 600; border: 1px solid currentColor; }
.badge.ok { color: var(--ok); }
.badge.warn { color: var(--warn); }
.badge.bad { color: var(--bad); }
#qr { display: block; margin: 12px auto 0; background: #fff; border-radius: 8px; max-width: 100%; height: auto; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stats > div { display: grid; }
.stats .label { font-size: 0.875rem; color: var(--muted); }
.stats strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.meter { height: 8px; margin: 12px 0 4px; background: var(--line); border-radius: 999px; overflow: hidden; }
.meter > div { height: 100%; }
.meter .ok { background: var(--ok); }
.meter .warn { background: var(--warn); }
.meter .bad { background: var(--bad); }
.row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: end; margin-top: 12px; }
.row label { grid-column: 1 / -1; }
ul { list-style: none; margin: 8px 0 0; padding: 0; }
li { border-top: 1px solid var(--line); }
li label { display: flex; align-items: center; gap: 12px; padding: 12px 0; font-size: 1rem; cursor: pointer; overflow-wrap: anywhere; }
li input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr; }
}
