:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f2f1ed;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --ring: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --series-1: #2a78d6;
  --good: #006300;
  --good-fill: #0ca30c;
  --bad: #b42828;
  --bad-fill: #d03b3b;
  --warn: #8a5a00;
  --warn-fill: #fab219;
  --banner: #fff6df;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232321;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --ring: rgba(255, 255, 255, 0.10);
    --accent: #3987e5;
    --series-1: #3987e5;
    --good: #0ca30c;
    --good-fill: #0ca30c;
    --bad: #e66767;
    --bad-fill: #d03b3b;
    --warn: #fab219;
    --banner: #2a2414;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781;
  --grid: #2c2c2a; --axis: #383835; --ring: rgba(255, 255, 255, 0.10); --accent: #3987e5; --series-1: #3987e5;
  --good: #0ca30c; --good-fill: #0ca30c; --bad: #e66767; --bad-fill: #d03b3b; --warn: #fab219; --banner: #2a2414;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
h1, h2 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 18px; }
h2 { font-size: 15px; }
p { margin: 0; }
a { color: var(--accent); }
.muted { color: var(--ink-2); font-size: 12.5px; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--ring);
}
.brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.brand svg { width: 30px; height: 30px; flex: none; fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  background: var(--surface-2); border-radius: 8px; padding: 4px; }
.brand p { overflow-wrap: anywhere; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.pill { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.lang { display: inline-flex; border: 1px solid var(--ring); border-radius: 8px; overflow: hidden; }
.lang button { border: 0; background: transparent; color: var(--ink-2); padding: 5px 10px; font: inherit; font-size: 12.5px; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.intro { margin: 16px 24px 0; font-size: 14px; line-height: 1.5; color: var(--ink); max-width: 980px; }
.banner { margin: 16px 24px 0; padding: 10px 14px; border-radius: var(--radius); background: var(--banner); color: var(--ink); font-size: 13px;
  border: 1px solid var(--ring); }

main { padding: 16px 24px 8px; display: grid; gap: 16px; max-width: 1400px; margin: 0 auto; }
.card { background: var(--surface); border: 1px solid var(--ring); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.main-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.side { display: grid; gap: 16px; min-width: 0; }

.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--ring); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.tile .label { color: var(--ink-2); font-size: 12.5px; }
.tile .value { font-size: 24px; font-weight: 650; margin-top: 2px; letter-spacing: -0.02em; }
.tile .sub { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.filters label { display: grid; gap: 3px; font-size: 12px; color: var(--ink-2); }
.filters label.grow { flex: 1 1 180px; }
.filters label.num input { width: 84px; }
input, select {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--axis); border-radius: 7px; padding: 6px 8px; min-height: 34px;
}
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.filter-actions { display: flex; gap: 8px; margin-left: auto; }
.btn, button.ghost {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; min-height: 34px; padding: 6px 12px; border-radius: 7px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn { background: var(--accent); color: var(--accent-ink); border: 1px solid transparent; }
.btn.ghost, button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--axis); }
.btn.small { min-height: 28px; padding: 3px 10px; font-size: 12.5px; }
button:disabled { opacity: 0.4; cursor: default; }

.table-wrap { overflow-x: auto; }
.table-wrap.short { max-height: 330px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12px; padding: 7px 10px; border-bottom: 1px solid var(--axis); white-space: nowrap;
  position: sticky; top: 0; background: var(--surface); }
td { padding: 7px 10px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
th.r, td.r { text-align: right; }
table.items tbody tr { cursor: pointer; }
table.items tbody tr:hover { background: var(--surface-2); }
table.items tbody tr[aria-selected="true"] { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
td.t { max-width: 300px; }
td.t span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.t small.cat { display: block; color: var(--ink-2); font-size: 12px; }
td.when, td.cat { white-space: nowrap; color: var(--ink-2); }
.delta { white-space: nowrap; font-weight: 600; }
.delta.down { color: var(--good); }
.delta.up { color: var(--bad); }
.delta.flat { color: var(--muted); font-weight: 400; }
.stars { color: var(--ink-2); letter-spacing: 1px; white-space: nowrap; }
.stock { white-space: nowrap; font-size: 12.5px; }
.stock::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.stock.in::before { background: var(--good-fill); }
.stock.out::before { background: var(--bad-fill); }
.stock.out { color: var(--bad); }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.pager button { min-width: 40px; justify-content: center; margin-left: 6px; }
.empty { color: var(--ink-2); padding: 24px 10px; text-align: center; }

table.feed td { font-size: 13px; }
table.feed tbody tr:hover { background: var(--surface-2); }
table.feed td.k { width: 26px; text-align: center; }
table.runs td { font-size: 13px; white-space: nowrap; }
.status::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status.ok::before { background: var(--good-fill); }
.status.partial::before { background: var(--warn-fill); }
.status.error::before { background: var(--bad-fill); }
.status.running::before { background: var(--accent); }

.chart { position: relative; height: 250px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; }
.chart .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; }
.chart .area { fill: var(--series-1); opacity: 0.08; }
.chart .dot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart .dot.out { fill: var(--surface); stroke: var(--bad-fill); stroke-width: 2; }
.chart .bar { fill: var(--series-1); }
.chart .bar.hl { fill: var(--accent); opacity: 0.75; }
.chart .cross { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hit { fill: transparent; }
.chart .label { fill: var(--ink-2); font-size: 11.5px; }
.chart .placeholder { display: grid; place-items: center; height: 100%; color: var(--ink-2); border: 1px dashed var(--axis); border-radius: 8px; }

.tooltip { position: fixed; z-index: 10; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--ring);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; max-width: 260px; }
.tooltip strong { display: block; font-size: 14px; }
.tooltip .key { display: inline-block; width: 12px; height: 2px; background: var(--series-1); vertical-align: middle; margin-right: 6px; }

footer { padding: 8px 24px 24px; max-width: 1400px; margin: 0 auto; }

@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid2, .main-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .top { padding: 12px 16px; }
  main { padding: 12px 16px 8px; }
  .banner { margin: 12px 16px 0; }
  .intro { margin: 12px 16px 0; }
  footer { padding: 8px 16px 20px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-actions { margin-left: 0; }
  td.when, table.items th:nth-child(6), td.stars, table.items th:nth-child(4) { display: none; }
  td.t { max-width: 180px; }
}
