:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  --bg: #0d1117; --bg-card: #161b22; --bg-input: #0d1117; --border: #30363d; --border-soft: #21262d;
  --text: #e6edf3; --text-dim: #8b949e; --accent: #3fb950; --link: #58a6ff;
  --ok: #3fb950; --ok-bg: rgba(63, 185, 80, 0.15);
  --warn: #d29922; --warn-bg: rgba(210, 153, 34, 0.15);
  --bad: #f85149; --bad-bg: rgba(248, 81, 73, 0.15);
  --hint: #8b949e; --hint-bg: rgba(139, 148, 158, 0.15);
  --radius: 10px;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f6f8fa; --bg-card: #ffffff; --bg-input: #ffffff; --border: #d0d7de; --border-soft: #eaeef2;
    --text: #1f2328; --text-dim: #59636e; --accent: #1a7f37; --link: #0969da;
    --ok: #1a7f37; --ok-bg: rgba(26, 127, 55, 0.12); --warn: #9a6700; --warn-bg: rgba(154, 103, 0, 0.12);
    --bad: #cf222e; --bad-bg: rgba(207, 34, 46, 0.1); --hint: #59636e; --hint-bg: rgba(89, 99, 110, 0.12);
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.45; }
main { max-width: 1000px; margin: 0 auto; padding: 28px 16px 60px; }
h1 { font-size: 26px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
a { color: var(--link); }
code { font-size: 0.92em; }
.subtitle { color: var(--text-dim); margin: 0 0 10px; }
.privacy { display: inline-block; font-size: 13px; color: var(--ok); background: var(--ok-bg); border-radius: 999px; padding: 3px 12px; }
.card { border: 1px solid var(--border); background: var(--bg-card); border-radius: var(--radius); padding: 18px; margin: 16px 0; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button[aria-selected="true"] { background: var(--accent); color: #0d1117; border-color: var(--accent); font-weight: 600; }
button { cursor: pointer; border-radius: 8px; border: 1px solid var(--border); background: var(--border-soft); color: var(--text); padding: 8px 14px; font-size: 14px; font-family: inherit; }
button:hover { filter: brightness(1.08); }
button.primary { background: var(--accent); color: #fff; border: none; font-weight: 600; padding: 10px 20px; }
@media (prefers-color-scheme: dark) { button.primary { color: #0d1117; } }
button.link { background: none; border: none; color: var(--link); padding: 0; text-decoration: underline; font-size: inherit; }
label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 5px; }
input[type="text"], select, textarea { width: 100%; background: var(--bg-input); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 8px 10px; font-size: 14px; font-family: inherit; }
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; min-height: 140px; resize: vertical; }
.drop { border: 2px dashed var(--border); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--text-dim); margin-bottom: 10px; }
.drop.over { border-color: var(--accent); color: var(--text); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 14px 0; }
.fields { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; }
.fields label { display: inline-flex; gap: 6px; align-items: center; color: var(--text); font-size: 14px; margin: 0; }
.muted { color: var(--text-dim); font-size: 13px; }
.error { color: var(--bad); font-size: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { border: 1px solid var(--border-soft); border-radius: 8px; padding: 12px; }
.tile .n { font-size: 24px; font-weight: 700; }
.tile .t { font-size: 13px; color: var(--text-dim); }
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; margin: 1px 4px 1px 0; white-space: nowrap; }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.hint { background: var(--hint-bg); color: var(--hint); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.labels-list { list-style: none; padding: 0; margin: 0; }
.labels-list li { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--border-soft); }
.labels-list li:last-child { border-bottom: none; }
.labels-list .count { min-width: 44px; text-align: right; font-weight: 700; }
.labels-list button.chip { border: none; cursor: pointer; }
.labels-list button.chip.active { outline: 2px solid currentColor; }
.issues { margin: 8px 0 0; padding-left: 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
th { color: var(--text-dim); font-weight: 600; font-size: 12.5px; }
td.time { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; white-space: nowrap; }
td ul { margin: 0; padding-left: 16px; }
.latest { font-size: 11px; color: var(--text-dim); display: block; }
pre { background: var(--bg-input); border: 1px solid var(--border-soft); border-radius: 8px; padding: 12px; overflow-x: auto; font-size: 12.5px; }
details summary { cursor: pointer; color: var(--text-dim); }
footer { color: var(--text-dim); font-size: 13px; margin-top: 28px; }
[hidden] { display: none !important; }
@media (max-width: 640px) {
  h1 { font-size: 21px; }
  .card { padding: 14px; }
  /* Stack each reading as a card instead of a squeezed table row. */
  table thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr { border-bottom: 1px solid var(--border); padding: 10px 0; }
  td { border: none; padding: 3px 0; }
  td[data-k]::before { content: attr(data-k) ": "; color: var(--text-dim); font-size: 12px; }
  td.time { font-size: 13px; }
}
