:root {
  color-scheme: light;
  --bg: #f4f5f8; --panel: #ffffff; --panel-2: #fafbfc; --text: #171a1f; --muted: #6b7280; --line: #e4e7ec; --line-strong: #d0d5dd;
  --accent: #2f6fde; --accent-hover: #255bc0; --accent-text: #ffffff; --accent-soft: #eaf1fd;
  --ok: #16794c; --ok-bg: #e5f5ec; --bad: #b42318; --bad-bg: #fdecea;
  --code-bg: #f2f4f7; --hover: #f2f5fb;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-other: #898781;
  --grid: #e1e0d9; --axis: #c3c2b7;
  --shadow: 0 1px 2px rgb(16 24 40 / .05), 0 1px 3px rgb(16 24 40 / .06);
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f1216; --panel: #171b21; --panel-2: #1b2027; --text: #e6e8eb; --muted: #98a2b3; --line: #262c35; --line-strong: #353d48;
    --accent: #5b8ff0; --accent-hover: #7aa5f3; --accent-text: #0b0e12; --accent-soft: #1a2638;
    --ok: #4cc38a; --ok-bg: #12291e; --bad: #f97066; --bad-bg: #2d1514;
    --code-bg: #12161b; --hover: #1d242e;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-other: #898781;
    --grid: #2c2c2a; --axis: #383835;
    --shadow: 0 1px 2px rgb(0 0 0 / .3);
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
code, pre, .mono { font-family: ui-monospace, "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace; font-size: 12.5px; }
button, input, select { font: inherit; color: inherit; }
button { background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 12px; cursor: pointer; font-weight: 500; transition: background .12s, border-color .12s; }
button:hover:not(:disabled) { background: var(--hover); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
input, select { background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 10px; min-width: 0; transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=checkbox] { accent-color: var(--accent); }
a { color: var(--accent); }

header { display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; min-height: 60px; position: sticky; top: 0; z-index: 10; }
header h1 { font-size: 15px; margin: 0; font-weight: 600; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand .mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--series-1), var(--series-3)); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; }
.brand small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.2; }
.nav-link { color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 500; padding: 6px 10px; border-radius: 8px; }
.nav-link:hover { background: var(--hover); color: var(--text); }
.status { color: var(--muted); font-size: 13px; }
.spacer { flex: 1; }
.cta { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-text); text-decoration: none; font-weight: 600; font-size: 14.5px; padding: 9px 18px; border-radius: 10px; box-shadow: 0 1px 2px rgb(16 24 40 / .1), 0 4px 12px -2px color-mix(in srgb, var(--accent) 45%, transparent); transition: background .12s, transform .12s; }
.cta:hover { background: var(--accent-hover); transform: translateY(-1px); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.card > h2 { font-size: 15px; margin: 0 0 12px; font-weight: 600; }
.error { background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: 10px 12px; }
.empty { color: var(--muted); text-align: center; padding: 36px 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }
.dot.hollow { background: transparent; border: 1.5px solid var(--ok); }
.tabs, .segmented { display: inline-flex; gap: 2px; padding: 3px; background: var(--code-bg); border-radius: 10px; }
.tabs button, .segmented button { border: 0; background: transparent; padding: 4px 11px; border-radius: 7px; color: var(--muted); font-size: 13px; }
.tabs button:hover:not(:disabled), .segmented button:hover:not(:disabled) { background: transparent; color: var(--text); }
.tabs button.on, .segmented button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.segmented .n { color: var(--muted); font-size: 11.5px; margin-left: 4px; font-variant-numeric: tabular-nums; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); max-height: 60vh; }
table { border-collapse: collapse; width: max-content; min-width: 100%; }
th, td { padding: 7px 12px; border-bottom: 1px solid var(--line); text-align: left; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
th { position: sticky; top: 0; background: var(--panel-2); font-weight: 600; font-size: 12px; color: var(--muted); z-index: 1; }
tbody tr { cursor: pointer; }
tbody tr:nth-child(even) { background: var(--panel-2); }
tbody tr:hover { background: var(--hover); }
td.nested { color: var(--muted); font-style: italic; }
td.resolved { color: var(--accent); }
pre.json { margin: 0; background: var(--code-bg); padding: 14px; border-radius: 10px; overflow: auto; max-height: 60vh; }

dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); width: min(800px, 92vw); padding: 0; box-shadow: 0 20px 50px rgb(0 0 0 / .25); }
dialog::backdrop { background: rgb(15 18 22 / .5); backdrop-filter: blur(2px); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
dialog pre.json { border-radius: 0; max-height: 70vh; }
