:root {
  --bg: #101113;
  --card: #17181b;
  --border: #26282d;
  --text: #e8eaed;
  --muted: #9aa0a8;
  --dim: #6b7178;
  --green: #4a7c59;
  --green-bright: #9fe3b3;
  --red: #ed4245;
  --yellow: #d7a83b;
  --orange: #e07b39;
  --cell-empty: #1d1f23;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 28px 20px 60px; }

header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.logo { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.logo span { color: var(--green-bright); font-weight: 500; margin-left: 7px; letter-spacing: 0; }
.updated { color: var(--dim); font-size: 12.5px; }

.banner {
  display: flex; align-items: center; gap: 12px;
  border-radius: 12px; padding: 16px 18px; margin-bottom: 22px;
  font-size: 17px; font-weight: 600;
}
.banner.ok { background: rgba(74, 124, 89, .14); border: 1px solid rgba(74, 124, 89, .5); color: var(--green-bright); }
.banner.bad { background: rgba(237, 66, 69, .1); border: 1px solid rgba(237, 66, 69, .5); color: #ffb3b4; }
.banner-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.banner.ok .banner-dot { background: var(--green-bright); box-shadow: 0 0 10px rgba(144, 238, 144, .6); }
.banner.bad .banner-dot { background: var(--red); box-shadow: 0 0 10px rgba(237, 66, 69, .8); animation: pulse 1.2s ease-in-out infinite; }

@keyframes pulse { 50% { opacity: .35; } }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px 20px 16px; margin: 14px 0;
}
.svc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.svc-head h2 { margin: 0; font-size: 16.5px; font-weight: 700; }
.svc-desc { color: var(--dim); font-size: 12.5px; margin-top: 2px; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 4px 12px; white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; }
.pill.ok { color: var(--green-bright); background: rgba(74, 124, 89, .15); border: 1px solid rgba(74, 124, 89, .45); }
.pill.ok .dot { background: var(--green-bright); }
.pill.down { color: #ffb3b4; background: rgba(237, 66, 69, .12); border: 1px solid rgba(237, 66, 69, .5); }
.pill.down .dot { background: var(--red); animation: pulse 1.2s ease-in-out infinite; }
.pill.na { color: var(--muted); background: rgba(154, 160, 168, .1); border: 1px solid rgba(154, 160, 168, .3); }
.pill.na .dot { background: var(--muted); }

.svc-body { display: flex; gap: 26px; align-items: flex-start; }
.gridcol { min-width: 0; max-width: 100%; }
.gridwrap { overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.gridwrap::-webkit-scrollbar { display: none; }

.grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 13px); gap: 3px; }
.cell { width: 13px; height: 13px; border-radius: 3px; background: var(--cell-empty); position: relative; }
.cell.void { background: transparent; }
.cell.nodata { background: var(--cell-empty); }
.cell.up { background: #41805a; }
.cell.up:hover { background: #55a273; }
.cell.minor { background: var(--yellow); }
.cell.low { background: var(--orange); }
.cell.out { background: var(--red); }
.cell[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: 19px; left: 50%; transform: translateX(-50%);
  background: #000; color: #fff; border: 1px solid #35383e;
  padding: 5px 9px; border-radius: 6px; white-space: nowrap;
  font-size: 12px; z-index: 20; pointer-events: none;
}

.months { position: relative; height: 17px; margin-top: 4px; }
.months span { position: absolute; top: 2px; color: var(--dim); font-size: 11px; }

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; color: var(--dim); font-size: 11.5px; }
.legend .cell { width: 10px; height: 10px; margin-left: 8px; }
.legend .cell:first-child { margin-left: 0; }

.stats { margin-left: auto; text-align: right; flex: none; }
.stats .big { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; }
.stats .small { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.stats .small.dim { color: var(--dim); }

.open-incident {
  border: 1px solid rgba(237, 66, 69, .45); background: rgba(237, 66, 69, .07);
  border-radius: 9px; padding: 10px 14px; margin: 0 0 14px; font-size: 13.5px;
}
.oi-title { font-weight: 700; color: #ffb3b4; margin-bottom: 6px; }
.oi-line { margin: 3px 0; color: var(--text); }
.oi-time { color: var(--dim); font-size: 12px; margin-right: 4px; }

.kind {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; border-radius: 5px; padding: 1px 7px; margin-right: 8px;
}
.kind.investigating { color: #ffb3b4; background: rgba(237, 66, 69, .14); }
.kind.update { color: #ffd98a; background: rgba(215, 168, 59, .14); }
.kind.resolved { color: var(--green-bright); background: rgba(74, 124, 89, .18); }

.events-h { margin: 34px 0 6px; font-size: 18px; }
.eventday { margin: 18px 0; }
.eventday-label { color: var(--muted); font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-bottom: 10px; }

.incident { border-left: 2px solid var(--border); padding: 2px 0 2px 16px; margin: 12px 0 12px 4px; }
.incident.open { border-left-color: var(--red); }
.inc-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.inc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.inc-dot.live { background: var(--red); animation: pulse 1.2s ease-in-out infinite; }
.inc-updates { margin-top: 6px; }
.inc-line { display: flex; align-items: baseline; gap: 8px; margin: 4px 0; font-size: 13.5px; color: var(--muted); }
.inc-line .inc-time { color: var(--dim); font-size: 12px; flex: none; }
.inc-line span:last-child { color: var(--text); }

.no-events { color: var(--dim); margin: 14px 0 0 2px; }

footer { margin-top: 44px; color: var(--dim); font-size: 12px; text-align: center; }

@media (max-width: 700px) {
  .svc-body { flex-direction: column; gap: 12px; }
  .gridcol { width: 100%; }
  .stats { margin-left: 0; text-align: left; display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; }
  .stats .big { font-size: 22px; }
  header { flex-direction: column; gap: 2px; }
}
