:root {
  --bg: #0f1420; --surface: #182031; --line: #26304a;
  --text: #e8ecf4; --muted: #8b95ab; --accent: #4f8cff; --bad: #ff6b6b; --good: #3ddc84;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
button, input { font: inherit; }

/* login */
.login { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login form { width: 100%; max-width: 340px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 24px; }
.login h1 { margin: 0 0 4px; font-size: 26px; }
.login label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: 14px; }
.login input { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); }
.login button { width: 100%; margin-top: 20px; padding: 12px; border: 0; border-radius: 10px;
  background: var(--accent); color: #fff; font-weight: 600; }
.error { color: var(--bad); margin: 12px 0 0; font-size: 14px; }

/* app shell */
.top { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
.top b { font-size: 20px; }
.top a { color: var(--muted); text-decoration: none; font-size: 14px; }
main { padding: 16px 16px calc(env(safe-area-inset-bottom) + 84px); }
.panel { display: none; }
.panel.active { display: block; }
.panel h2 { margin: 0; }
.muted { color: var(--muted); margin: 4px 0 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.live .card { margin-bottom: 14px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.row b { font-size: 18px; }
.small { font-size: 13px; margin: 4px 0; }
.warn { color: #ffb347; }
.pill { font-size: 11px; padding: 3px 8px; border-radius: 99px; background: var(--line); color: var(--muted); white-space: nowrap; }
.pill.good { background: rgba(61, 220, 132, .15); color: var(--good); }
.pill.bad { background: rgba(255, 107, 107, .15); color: var(--bad); }
.up { color: var(--good); }
.down { color: var(--bad); }
.btn { display: block; text-align: center; margin: 12px 0 4px; padding: 11px; border-radius: 10px;
  background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0 4px; }
.stats div { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.stats em, .list em { display: block; font-style: normal; color: var(--muted); font-size: 12px; }
.stats b { font-size: 18px; }
.stats small { color: var(--muted); font-weight: 400; font-size: 12px; }
h3 { font-size: 14px; color: var(--muted); margin: 16px 0 6px; font-weight: 600; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.list li em { display: inline; }
.list li span em { display: inline; }
.list b { white-space: nowrap; }
nav { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(6, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tab { background: none; border: 0; color: var(--muted); padding: 10px 0 12px; font-size: 11px;
  display: flex; flex-direction: column; align-items: center; gap: 5px; }
.tab .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.tab.active { color: var(--text); }
.tab.active .dot { background: var(--accent); }
