:root {
  --page: #f9f9f7; --surface: #fcfcfb; --ink: #0b0b0b; --ink-2: #52514e; --muted: #898781; --line: #e4e3df;
  --grid: #ecebe7; --s1: #2a78d6; --s2: #eb6834; --accent: #2a78d6;
  --good: #0ca30c; --warn: #fab219; --serious: #ec835a; --crit: #d03b3b;
}
@media (prefers-color-scheme: dark) {
  :root { --page: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink-2: #c3c2b7; --line: #2e2e2c; --grid: #262624; --s1: #3987e5; --s2: #d95926; --accent: #3987e5; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--page); color: var(--ink); }
header { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
header h1 { font-size: 18px; margin: 0 8px 0 0; }
header #run { margin-left: auto; }
nav { display: flex; gap: 4px; padding: 8px 24px 0; border-bottom: 1px solid var(--line); background: var(--surface); }
nav button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--ink-2); padding: 8px 12px; }
nav button.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
main { padding: 16px 24px 48px; }
button { font: inherit; padding: 6px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
button[type=submit], header #run { background: var(--accent); border-color: var(--accent); color: #fff; }
button:disabled { opacity: .6; cursor: wait; }
input, select { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.muted { color: var(--muted); }
.badge { padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); }
.badge.demo { background: #fff3d6; color: #6b4a00; border-color: #f0d48a; }
.badge.live { background: #dff3df; color: #0b4d0b; border-color: #9fd59f; }
.badge.dry { background: #e9e8e4; color: #3a3936; }
.badge.armed { background: #fde3e3; color: #7a1717; border-color: #f0a9a9; }
.count { background: var(--crit); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; margin-left: 4px; }
.toolbar { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input[type=search] { width: 320px; }
.link { color: var(--accent); }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; color: var(--ink-2); font-weight: 600; background: var(--page); }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
#products tbody tr { cursor: pointer; }
#products tbody tr:hover { background: var(--page); }
.sub { font-size: 12px; color: var(--muted); }
.st { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 13px; }
.st i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.up { color: var(--crit); font-weight: 600; }
.feed { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.feed li { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; }
.feed li:last-child { border-bottom: 0; }
.feed li.unseen { background: color-mix(in srgb, var(--warn) 10%, transparent); }
.feed .ic { width: 22px; text-align: center; }
.feed .t { font-size: 12px; color: var(--muted); white-space: nowrap; }
.feed.small li { padding: 6px 10px; font-size: 13px; }
.form { display: flex; flex-direction: column; gap: 12px; max-width: 560px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.form label { display: flex; flex-direction: column; gap: 4px; color: var(--ink-2); }
.form label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }
.form small { color: var(--muted); }
.form.grid { display: grid; grid-template-columns: 1fr 1fr; max-width: none; }
.form.grid .wide { grid-column: 1 / -1; }
.note { max-width: 720px; margin-top: 20px; color: var(--ink-2); }
#drawer { position: fixed; inset: 0; z-index: 10; }
.drawer-bg { position: absolute; inset: 0; background: rgba(0,0,0,.3); }
#drawer aside { position: absolute; right: 0; top: 0; bottom: 0; width: min(880px, 100%); background: var(--page); overflow-y: auto; padding: 20px 24px 40px; box-shadow: -4px 0 20px rgba(0,0,0,.15); }
#drawer h2 { margin: 0 40px 2px 0; font-size: 18px; }
#drawer h3 { font-size: 14px; margin: 22px 0 8px; }
.close { position: absolute; right: 16px; top: 14px; font-size: 20px; line-height: 1; padding: 4px 10px; }
.periods { display: flex; gap: 4px; margin: 10px 0; }
.periods button.active { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.tile .v { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile .k { font-size: 12px; color: var(--ink-2); }
.chart-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 14px; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 2px; display: inline-block; }
.legend i.dash { background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 7px) !important; }
.chart svg { display: block; width: 100%; height: auto; }
.chart text { fill: var(--muted); font-size: 11px; }
details summary { cursor: pointer; color: var(--ink-2); font-size: 13px; margin-top: 6px; }
details table { margin-top: 6px; font-size: 12px; }
.tip { position: fixed; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.12); z-index: 20; white-space: nowrap; }
.tip b { font-variant-numeric: tabular-nums; }
.tip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
@media (max-width: 760px) { main, header, nav { padding-left: 12px; padding-right: 12px; } .form.grid { grid-template-columns: 1fr; } table { font-size: 13px; } }
#products td:nth-child(7), #products td:nth-child(2) { white-space: nowrap; }
.links { display: flex; gap: 16px; flex-wrap: wrap; margin: -4px 0 8px; font-size: 13px; }
