:root {
  color-scheme: light;
  --bg: #f4f3ef;
  --surface: #fcfcfb;
  --border: #e2e0d9;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #7d7b75;
  --accent: #2a78d6;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --band: rgba(235, 104, 52, 0.12);
  --good: #1a8a4a;
  --warn: #b26b00;
  --crit: #c62b2b;
  --good-bg: #e3f4ea;
  --warn-bg: #fdf1dc;
  --crit-bg: #fbe4e4;
  --grid: #ebeae5;
  --titlebar: #ededed;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121211;
    --surface: #1a1a19;
    --border: #2f2e2b;
    --text: #f0efec;
    --text-2: #c3c2b7;
    --muted: #8f8d85;
    --accent: #3987e5;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --band: rgba(217, 89, 38, 0.18);
    --good: #4cc27e;
    --warn: #e0a030;
    --crit: #ef6b6b;
    --good-bg: #16301f;
    --warn-bg: #33270f;
    --crit-bg: #3a1717;
    --grid: #262624;
    --titlebar: #1a1a19;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.titlebar { background: var(--titlebar); }
.titlebar .inner { max-width: 1100px; margin: 0 auto; padding: 10px 16px 6px; }
.titlebar img { height: 60px; width: auto; max-width: 100%; display: inline-block; vertical-align: top; }
header {
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
header .inner { max-width: 1100px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
header .brand { font-weight: 650; padding: 12px 0; color: var(--text); }
nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; }
nav a { padding: 14px 10px; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; }
nav a.active { color: var(--text); border-bottom-color: var(--accent); }
nav a:hover { text-decoration: none; color: var(--text); }
header .who { color: var(--muted); font-size: 13px; }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 48px; }
h1 { font-size: 22px; margin: 0 0 16px; font-weight: 650; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 650; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px;
}
.section { margin-top: 14px; }
a.card { color: inherit; display: block; }
a.card:hover { text-decoration: none; border-color: var(--accent); }
.room-head { display: flex; justify-content: space-between; align-items: baseline; }
.room-name { font-weight: 650; font-size: 16px; }
.big { font-size: 32px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.5px; }
.big small { font-size: 15px; color: var(--text-2); font-weight: 500; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13px; color: var(--text-2); margin-top: 8px; }
.kv b { color: var(--text); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; background: var(--grid); color: var(--text-2);
}
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.crit { background: var(--crit-bg); color: var(--crit); }
.banner { border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; border: 1px solid; }
.banner.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.banner.crit { background: var(--crit-bg); color: var(--crit); border-color: transparent; }
.banner.good { background: var(--good-bg); color: var(--good); border-color: transparent; }
.banner.info { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.top { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; }
.person { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); flex: none; }
.dot.on { background: var(--good); }
form.inline { display: inline; }
label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
input[type=text], input[type=number], input[type=password], input[type=datetime-local], select {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-bottom: 12px; }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 15px; }
button, .btn {
  font: inherit; font-weight: 550; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 8px 14px; cursor: pointer;
}
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { border-color: var(--crit); color: var(--crit); }
button:hover { filter: brightness(0.97); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-2); font-weight: 550; font-size: 13px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.chart-box { position: relative; height: 280px; }
.chart-box.small { height: 160px; }
.tabs { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.tabs button { border: 0; border-radius: 0; padding: 6px 12px; background: transparent; color: var(--text-2); }
.tabs button.active { background: var(--accent); color: #fff; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; background: var(--c); }
.legend span.band::before { height: 10px; background: var(--band); }
.login { max-width: 360px; margin: 10vh auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.stat .label { font-size: 13px; color: var(--text-2); }
.stat .value { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
details summary { cursor: pointer; color: var(--text-2); font-size: 14px; margin-top: 10px; }
@media (max-width: 600px) {
  .titlebar img { height: 44px; }
  header .who { display: none; }
  .big { font-size: 28px; }
}
