:root {
  color-scheme: light;
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-2: #f7f9f8;
  --text: #111a15;
  --text-2: #4d5a53;
  --muted: #74817a;
  --border: #e1e7e3;
  --brand: #0f8a4a;
  --brand-ink: #ffffff;
  --brand-soft: #e3f4ea;
  --danger: #c0392b;
  --danger-soft: #fbe9e7;
  --warn: #a96a00;
  --warn-soft: #fff4dc;
  --ok: #0f7a40;
  --ok-soft: #e1f3e8;
  --code: #eef2f0;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --grid: #e8ecea;
  --shadow: 0 1px 2px rgba(16, 24, 20, .05), 0 4px 16px rgba(16, 24, 20, .04);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1210;
    --surface: #151c19;
    --surface-2: #1a2320;
    --text: #e8eeea;
    --text-2: #b4c0b9;
    --muted: #8a978f;
    --border: #26302b;
    --brand: #25d366;
    --brand-ink: #04220f;
    --brand-soft: #143222;
    --danger: #ef6b5b;
    --danger-soft: #3a1c18;
    --warn: #e6b04b;
    --warn-soft: #3a2c10;
    --ok: #4cd98a;
    --ok-soft: #143222;
    --code: #1e2925;
    --series-1: #3987e5;
    --series-2: #d95926;
    --grid: #232d29;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1210; --surface: #151c19; --surface-2: #1a2320; --text: #e8eeea; --text-2: #b4c0b9;
  --muted: #8a978f; --border: #26302b; --brand: #25d366; --brand-ink: #04220f; --brand-soft: #143222;
  --danger: #ef6b5b; --danger-soft: #3a1c18; --warn: #e6b04b; --warn-soft: #3a2c10; --ok: #4cd98a;
  --ok-soft: #143222; --code: #1e2925; --series-1: #3987e5; --series-2: #d95926; --grid: #232d29; --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
.muted { color: var(--muted); font-size: 13px; }
.hidden { display: none !important; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

button, .btn {
  font: inherit; font-size: 14px; font-weight: 500;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 7px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
button:hover { background: var(--surface-2); }
button.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
button.primary:hover { filter: brightness(1.06); }
button.danger { color: var(--danger); }
button.small { padding: 4px 10px; font-size: 13px; }
button:disabled { opacity: .55; cursor: default; }

label { display: block; font-size: 13px; color: var(--text-2); margin: 12px 0 5px; font-weight: 500; }
input, select, textarea {
  font: inherit; width: 100%; padding: 9px 11px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }

code, pre { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; background: var(--code); border-radius: 6px; }
code { padding: 1px 6px; }
pre { padding: 12px 14px; overflow-x: auto; margin: 8px 0 0; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--code); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }

.alert { padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.success { background: var(--ok-soft); color: var(--ok); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 50; max-width: calc(100% - 32px); }
