:root {
  color-scheme: dark;
  --bg: #0f1115; --card: #181b22; --line: #262a33; --text: #e6e8ec; --muted: #8b919c;
  --good: #3ecf8e; --bad: #f2555a; --warn: #f0b429; --run: #5aa9f2; --accent: #7c8cff;
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); padding: env(safe-area-inset-top) 0 0; }
header { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 2; }
h1 { font-size: 18px; margin: 0; }
h2 { font-size: 15px; margin: 22px 0 8px; color: var(--muted); font-weight: 600; }
nav { display: flex; gap: 4px; background: var(--card); border-radius: 10px; padding: 3px; }
.tab { background: none; border: 0; color: var(--muted); padding: 6px 14px; border-radius: 8px; font: inherit; cursor: pointer; }
.tab.active { background: var(--line); color: var(--text); }
#updated { margin-left: auto; font-size: 12px; }
main { padding: 18px; max-width: 1100px; margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 12px; margin-top: 4px; }
.bad { color: var(--bad); } .good { color: var(--good); } .runt { color: var(--run); }
.error { color: var(--bad); min-height: 1em; }
.hint { text-align: center; font-size: 12px; padding-bottom: 24px; }

#banner { max-width: 1100px; margin: 0 auto; padding: 0 18px; }
.warn { background: #3a2e12; color: #ffd98a; border: 1px solid #5c4716; border-radius: 10px; padding: 8px 12px; margin-top: 12px; font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 22px 12px 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  color: inherit; text-decoration: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: border-color .15s, transform .1s;
}
.tile:hover { border-color: #3a4050; }
.tile:active { transform: scale(.98); }
.tile img, .tile .emoji { width: 56px; height: 56px; border-radius: 12px; object-fit: contain; font-size: 40px; line-height: 56px; }
.tile strong { font-size: 16px; }
.tile .muted { font-size: 12px; }
.tile .dot { position: absolute; top: 12px; right: 12px; }
.tag { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--warn); border: 1px solid #5c4716; border-radius: 6px; padding: 1px 6px; }

.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.dot.up { background: var(--good); } .dot.down { background: var(--bad); }
.dot.degraded, .dot.unmanaged { background: var(--warn); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.card.narrow { max-width: 420px; margin: 40px auto; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
.row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#rows { background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin-top: 14px; overflow: hidden; }
.row:last-child { border-bottom: 0; }
.row .dot { margin-top: 6px; }
.grow { flex: 1; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #20242d; color: #c3c8d1; white-space: nowrap; }
.chip.bad { background: #3b1c1f; color: #ff9da0; } .chip.warnc { background: #3a2e12; color: #ffd98a; } .chip.run { background: #172c40; color: #9fd0ff; }
.more { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; width: 36px; height: 32px; font-size: 18px; cursor: pointer; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }

dialog { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 18px; width: min(560px, 94vw); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog h2 { margin-top: 0; color: var(--text); font-size: 17px; }
.btn { display: block; width: 100%; text-align: center; margin-top: 8px; padding: 11px; border-radius: 10px; border: 1px solid var(--line); background: #20242d; color: var(--text); font: inherit; text-decoration: none; cursor: pointer; }
.btn.primary, button.primary { background: var(--accent); border-color: var(--accent); color: #0b0d12; font-weight: 600; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 600; }
label { display: block; margin: 12px 0 4px; }
input { display: block; width: 100%; margin-top: 6px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
form { display: flex; gap: 8px; } form input { margin: 0; } form button { border-radius: 10px; border: 0; padding: 0 16px; font: inherit; }
pre { background: #0b0d12; border-radius: 10px; padding: 10px; max-height: 55vh; overflow: auto; font-size: 12px; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 520px) { main { padding: 12px; } .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } header { gap: 10px; } }
