:root {
  --bg: #16181d;
  --panel: #22262e;
  --panel-2: #1c1f26;
  --line: #30343f;
  --text: #eef1f6;
  --muted: #8a909c;
  --dim: #5b6170;
  --green: #57f287;
  --blue: #58a6ff;
  --red: #ff5c5c;
  --orange: #ff7a2f;
  --yellow: #fee75c;
  --violet: #b48cff;
  --h0: #262a33;
  --h1: #1e4430;
  --h2: #266e44;
  --h3: #34a25a;
  --h4: #48d276;
  --h5: #dcff64;
  --radius: 12px;
  --gap: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  padding: 16px;
  max-width: 1600px;
  margin: 0 auto;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* faint centered watermark, like the Telegram dashboard */
.wm {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: url("/static/watermark.png") center / auto 92vh no-repeat;
  opacity: .05;
}
header, main, footer { position: relative; z-index: 1; }

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px 18px;
  min-width: 0;
}
.panel h2 {
  font-size: 13px; font-weight: 700; letter-spacing: .04em;
  margin: 0 0 12px; display: flex; align-items: center; gap: 8px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.panel-head h2 { margin: 0; }
.sub { font-size: 12px; font-weight: 600; color: var(--yellow); margin: 18px 0 8px; letter-spacing: .03em; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: var(--gap); padding: 12px 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; }
.brand-eye { width: 30px; height: 30px; color: var(--text); }
.brand-word { font-weight: 700; font-size: 18px; letter-spacing: .02em; }
.brand-word b { background: var(--orange); color: #fff; padding: 1px 5px; border-radius: 4px; margin-right: 2px; }
.top-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.clocks { font-family: "JetBrains Mono", ui-monospace, monospace; }
.pill { border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; }
.pill.ok { color: var(--green); border-color: #2a5a3a; }
.pill.stale { color: var(--yellow); border-color: #6a5d20; }

/* ---------- layout ---------- */
.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: 360px minmax(0, 1fr) 300px;
  grid-template-areas:
    "online hourly hourly"
    "online heat pizza"
    "versions versions versions"
    "feed feed discord"
    "updates updates updates";
}
.online { grid-area: online; }
.hourly { grid-area: hourly; }
.heat { grid-area: heat; }
.pizza { grid-area: pizza; }
.versions { grid-area: versions; }
.feed { grid-area: feed; }
.discord { grid-area: discord; }
.updates { grid-area: updates; }

@media (max-width: 1200px) {
  .grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "hourly hourly"
      "online heat"
      "online pizza"
      "versions versions"
      "feed discord"
      "updates updates";
  }
}
@media (max-width: 760px) {
  body { padding: 10px; }
  .grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "online" "hourly" "heat" "pizza" "versions" "feed" "discord" "updates"; }
  .top { padding: 10px 14px; }
}

/* ---------- online list ---------- */
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dim); display: inline-block; }
.dot.live { background: var(--green); box-shadow: 0 0 0 0 rgba(87,242,135,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(87,242,135,0); } 100% { box-shadow: 0 0 0 0 rgba(87,242,135,0); } }
@media (prefers-reduced-motion: reduce) { .dot.live { animation: none; } }

.devs { list-style: none; margin: 0; padding: 0; }
.devs li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.devs li:first-child { border-top: 0; }
.devs .who { min-width: 0; flex: 1; }
.devs .name { font-weight: 600; }
.devs .act { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.devs .since { color: var(--green); font-size: 12px; white-space: nowrap; font-family: "JetBrains Mono", ui-monospace, monospace; }
.devs-left .name { color: #c8bebe; }
.devs-left .since { color: var(--muted); }
.empty { color: var(--muted); font-size: 13px; padding: 18px 0; text-align: center; }

.av {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: #3a3f4c; color: var(--text); font-weight: 700;
  display: grid; place-items: center; position: relative; overflow: hidden;
}
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.av-lg { width: 48px; height: 48px; font-size: 18px; }
.av.on::after { content: ""; position: absolute; right: 1px; bottom: 1px; width: 10px; height: 10px; border-radius: 50%; background: var(--green); border: 2px solid var(--panel); }
.devs-left .av { background: #463838; color: #c8bebe; }

/* ---------- stats + charts ---------- */
.legend { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 18px; height: 2px; margin-left: 8px; }
.lg-today { background: var(--blue); }
.lg-avg { background: var(--muted); }
.stats { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.stat { background: var(--panel-2); border-radius: 10px; padding: 8px 18px; text-align: center; min-width: 140px; }
.stat-k, .stat-s { color: var(--muted); font-size: 12px; }
.stat-v { font-size: 36px; font-weight: 700; line-height: 1.15; }
.stat-v.accent { color: var(--blue); }
.vs { color: var(--muted); font-size: 12px; }
.chart { width: 100%; height: 240px; position: relative; }
.chart-tall { height: 260px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 11px; font-family: Inter, sans-serif; }
.chart .val { fill: var(--text); font-size: 10.5px; font-family: Inter, sans-serif; }
.chart .gap-mark { fill: rgba(254,231,92,.08); }

/* ---------- heatmap ---------- */
.heatmap { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.hm-month { flex: none; }
.hm-title { font-size: 12px; margin-bottom: 6px; }
.hm-grid { display: grid; grid-template-rows: repeat(7, 18px); grid-auto-flow: column; grid-auto-columns: 18px; gap: 3px; }
.hm-cell { border-radius: 4px; background: var(--h0); font-size: 9.5px; display: grid; place-items: center; color: #6f7686; cursor: default; }
.hm-cell.blank { background: transparent; }
.hm-cell.future { background: transparent; outline: 1px dashed #2c3039; outline-offset: -1px; color: transparent; }
.hm-cell.l1 { background: var(--h1); color: #b9eec8; }
.hm-cell.l2 { background: var(--h2); color: #cff5da; }
.hm-cell.l3 { background: var(--h3); color: #fff; }
.hm-cell.l4 { background: var(--h4); color: #0c2616; }
.hm-cell.l5 { background: var(--h5); color: #283c0a; }
.hm-cell.today { box-shadow: 0 0 0 2px var(--blue); }
.heat-legend { color: var(--muted); font-size: 11.5px; display: flex; align-items: center; gap: 4px; justify-content: center; margin-top: 10px; }
.hl { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.hl.l1 { background: var(--h1); } .hl.l2 { background: var(--h2); } .hl.l3 { background: var(--h3); } .hl.l4 { background: var(--h4); } .hl.l5 { background: var(--h5); }
.top5 { color: var(--h5); margin-left: 4px; }

/* ---------- pizza ---------- */
.tiles { display: grid; gap: 10px; margin-top: 10px; }
.tile { background: var(--panel-2); border-radius: 10px; min-height: 64px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tile.soon { color: var(--dim); justify-content: center; border: 1px dashed var(--line); background: transparent; }

/* ---------- chips / select ---------- */
.vctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font: inherit; font-size: 12px; color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip[aria-pressed="true"] { color: var(--text); border-color: #4a5060; background: #2b303a; }
.chip .sw { width: 8px; height: 8px; border-radius: 50%; }
select {
  font: inherit; font-size: 12px; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px;
}
.chip:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- cards (feed, updates) ---------- */
.cards { display: flex; flex-direction: column; gap: 10px; max-height: 620px; overflow-y: auto; padding-right: 4px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); max-height: 560px; }
.card { background: var(--panel-2); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; }
.card .line { overflow-wrap: anywhere; }
.card .when { color: var(--muted); font-size: 12px; margin-top: 8px; font-family: "JetBrains Mono", ui-monospace, monospace; }
.card .kind { color: var(--muted); }
.card.pinned { border: 1px solid #4a3e14; background: #26231a; }
.card-row { display: flex; gap: 12px; align-items: center; }
.upd-title { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.upd-ver { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 15px; margin-top: 6px; }
.upd-ver .arrow { color: var(--muted); margin: 0 4px; }
.badge { font-size: 11px; border-radius: 6px; padding: 1px 6px; background: #2f3441; color: var(--muted); font-weight: 500; }
.b-main { border-left: 3px solid var(--green); }
.b-exp { border-left: 3px solid var(--blue); }
.b-exp3 { border-left: 3px solid var(--red); }
.b-exp2 { border-left: 3px solid var(--violet); }

.foot { text-align: center; margin: 22px 0 8px; }

/* ---------- tooltip ---------- */
.tip {
  position: fixed; z-index: 10; pointer-events: none;
  background: #0f1115; border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 9px; font-size: 12px; color: var(--text); white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}

/* ---------- chart series (classes, not inline styles: CSP forbids those) ---------- */
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; }
.chart .ln-avg { stroke: var(--muted); }
.chart .ln-today { stroke: var(--blue); stroke-width: 1.8; }
.chart .pt-today { fill: var(--blue); }
.chart .guide { stroke: var(--dim); stroke-dasharray: 3 3; }
.ln-exp { stroke: var(--blue); }   .pt-exp { fill: var(--blue); }   .sw-exp { background: var(--blue); }   .c-exp { color: var(--blue); }
.ln-exp3 { stroke: var(--red); }   .pt-exp3 { fill: var(--red); }   .sw-exp3 { background: var(--red); }   .c-exp3 { color: var(--red); }
.ln-main { stroke: var(--green); } .pt-main { fill: var(--green); } .sw-main { background: var(--green); } .c-main { color: var(--green); }
.ln-exp2 { stroke: var(--violet); } .pt-exp2 { fill: var(--violet); } .sw-exp2 { background: var(--violet); } .c-exp2 { color: var(--violet); }
.up { color: var(--green); }

/* ---------- 30-day top ---------- */
.sub-top { color: var(--muted); }
.top-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.top-list li { display: grid; grid-template-columns: 96px 1fr 44px; align-items: center; gap: 10px; font-size: 12.5px; }
.t-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-bar { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.t-fill { display: block; height: 100%; background: var(--green-dim, #2f7a4a); border-radius: 3px; }
.t-h { color: var(--muted); text-align: right; font-family: "JetBrains Mono", ui-monospace, monospace; }
