:root {
  --bg: #f6f7f9; --card: #ffffff; --text: #1d2430; --muted: #5d6879; --line: #dde1e8;
  --ok: #2f9e5b; --partial: #e08a1e; --down: #d23b3b; --nodata: #b7bdc8;
  --ok-bg: #e4f5ea; --warn-bg: #fdf0dc; --down-bg: #fbe3e3; --grey-bg: #e9ecf1;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c; --card: #1b212a; --text: #e6e9ee; --muted: #9aa5b5; --line: #2c3541;
    --ok: #3cbf74; --partial: #eaa03c; --down: #ee5a5a; --nodata: #4b5565;
    --ok-bg: #173325; --warn-bg: #3a2a12; --down-bg: #3d1b1b; --grey-bg: #262d38;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 860px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { font-size: 1.6rem; margin: 0 0 4px; }
h2 { font-size: 1.05rem; margin: 28px 0 8px; }
.updated { margin: 0 0 16px; color: var(--muted); }
.updated.stale { color: var(--down); font-weight: 600; }
.banner {
  padding: 14px 18px; border-radius: 8px; font-weight: 600; font-size: 1.1rem;
  display: flex; align-items: center; gap: 10px;
}
.banner::before, .alerts::before, .dot {
  content: ""; width: 12px; height: 12px; border-radius: 50%; flex: none;
  background: var(--nodata); display: inline-block;
}
.alerts::before { margin-right: 8px; }
.dot { color: #fff; font-size: 9px; line-height: 14px; text-align: center; font-weight: 700; width: 14px; height: 14px; }
.alerts { margin: 10px 0 0; color: var(--muted); }
.level-ok { background: var(--ok-bg); }
.level-ok::before { background: var(--ok); }
.level-down, .level-stale, .level-critical { background: var(--down-bg); }
.level-down::before, .level-stale::before, .level-critical::before { background: var(--down); }
.level-warning { background: var(--warn-bg); }
.level-warning::before { background: var(--partial); }
.level-missing, .level-unknown { background: var(--grey-bg); }
.alerts.level-ok, .alerts.level-unknown { background: none; }
.alerts { padding: 6px 10px; border-radius: 6px; display: inline-block; }
.alerts.level-ok::before { background: var(--ok); }
.dot.ok { background: var(--ok); }
.dot.down { background: var(--down); }
.dot.behind { background: var(--partial); }
.dot.nodata { background: var(--nodata); }
section { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 4px 16px 12px; margin-top: 16px; }
section h2 { margin-top: 12px; }
.row { display: grid; grid-template-columns: 11rem 9rem 1fr; gap: 10px; align-items: center; padding: 6px 0; }
.status { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.bar { display: flex; gap: 2px; min-width: 0; }
.bar i { flex: 1 1 0; min-width: 3px; height: 22px; border-radius: 2px; background: var(--nodata); }
.bar i.ok { background: var(--ok); }
.bar i.partial { background: var(--partial); }
.bar i.down { background: var(--down); }
.rowdetail { grid-column: 2 / -1; color: var(--muted); font-size: .9rem; display: grid; gap: 4px; margin-top: -2px; }
.flowerror { display: flex; align-items: center; gap: 6px; color: var(--text, inherit); overflow-wrap: anywhere; }
.specs { overflow-x: auto; }
.spectable { border-collapse: collapse; width: 100%; font-size: .92rem; }
.spectable th, .spectable td { text-align: left; padding: 6px 10px 6px 0; border-top: 1px solid var(--line); vertical-align: top; }
.spectable thead th { border-top: 0; color: var(--muted); font-size: .85rem; font-weight: 600; }
.spectable tbody th { font-weight: 600; white-space: nowrap; }
.speccell { display: inline-flex; align-items: flex-start; gap: 6px; min-width: 10rem; }
.speccell .dot { margin-top: 3px; }
@media (max-width: 600px) {
  .updated .sep { display: none; }
  .updated .part { display: block; }
  .row { grid-template-columns: 1fr auto; }
  .row .bar { grid-column: 1 / -1; }
  .rowdetail { grid-column: 1 / -1; margin-top: 0; }
  .spectable thead { display: none; }
  .spectable, .spectable tbody, .spectable tr, .spectable th, .spectable td { display: block; }
  .spectable tr { border-top: 1px solid var(--line); padding: 6px 0; }
  .spectable th, .spectable td { border-top: 0; padding: 2px 0; }
  .spectable td { display: flex; gap: 8px; align-items: flex-start; }
  .spectable td::before { content: attr(data-label); flex: none; width: 6rem; color: var(--muted); font-size: .85rem; padding-top: 1px; }
  .speccell { min-width: 0; }
}
.updated .part { white-space: nowrap; }
