:root {
  --bg: #f7f7f5;
  --panel: #ffffff;
  --text: #1c1c1a;
  --muted: #62625c;
  --line: #d9d9d2;
  --accent: #0b6bcb;
  --accent-text: #ffffff;
  --bad: #b3261e;
  --good: #1b7a3c;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151514;
    --panel: #1e1e1c;
    --text: #ecece6;
    --muted: #a4a49b;
    --line: #38382f;
    --accent: #5aa7ff;
    --accent-text: #08213f;
    --bad: #ff8a80;
    --good: #7bd88f;
  }
}
:root[data-theme="dark"] {
  --bg: #151514;
  --panel: #1e1e1c;
  --text: #ecece6;
  --muted: #a4a49b;
  --line: #38382f;
  --accent: #5aa7ff;
  --accent-text: #08213f;
  --bad: #ff8a80;
  --good: #7bd88f;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
header, nav, main { max-width: 56rem; margin: 0 auto; padding: 0 16px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; flex-wrap: wrap; }
h1 { font-size: 1.4rem; margin: 0; }
h2 { font-size: 1.15rem; margin: 0 0 8px; }
h3 { font-size: 1rem; margin: 20px 0 4px; }
.badge { margin: 0; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.85rem; color: var(--muted); }
nav { display: flex; gap: 4px; margin-top: 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
[role="tab"] {
  background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted);
  padding: 10px 14px; font: inherit; cursor: pointer; white-space: nowrap;
}
[role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
main { padding-top: 16px; padding-bottom: 40px; }
section { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 12px 0; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: var(--muted); }
label.block { margin-bottom: 8px; }
input, select, textarea, button, .button {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px;
}
textarea, input[type="text"] { width: 100%; }
textarea { font-family: ui-monospace, Consolas, monospace; resize: vertical; }
input[type="number"] { width: 8.5rem; }
button, .button { background: var(--accent); color: var(--accent-text); border-color: var(--accent); cursor: pointer; text-decoration: none; display: inline-block; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.button.file { position: relative; flex-direction: row; font-size: inherit; color: var(--accent-text); }
.button.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
caption { text-align: left; padding-bottom: 4px; }
.muted { color: var(--muted); }
.bad { color: var(--bad); }
.good { color: var(--good); }
progress { flex: 1 1 8rem; min-width: 6rem; height: 1rem; accent-color: var(--accent); }
canvas { width: 100%; height: auto; max-height: 260px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
pre { white-space: pre-wrap; word-break: break-word; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px; min-height: 3rem; font-family: ui-monospace, Consolas, monospace; }
@media (max-width: 520px) {
  input[type="number"] { width: 6.5rem; }
  .row { gap: 8px; }
}
