:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --ok: #16a34a;
  --minor: #eab308;
  --major: #f97316;
  --bad: #dc2626;
  --none: #cbd5e1;
  --accent: #2563eb;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 1px rgba(15, 23, 42, 0.04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --card: #111827;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --line: #1f2937;
    --none: #334155;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.small { font-size: 13px; }
.muted { color: var(--muted); }

.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; }
.visit { font-size: 14px; }

.banner {
  display: flex; align-items: center; gap: 14px;
  margin: 28px 0 20px; padding: 18px 20px; border-radius: 12px; color: #fff;
}
.banner h1 { margin: 0; font-size: 20px; line-height: 1.3; }
.banner p { margin: 2px 0 0; opacity: 0.9; font-size: 14px; }
.banner-icon {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.25) center / 16px no-repeat;
}
.banner-operational { background: var(--ok); }
.banner-operational .banner-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='white' stroke-width='2.5' d='M3 8.5l3 3 7-7'/%3E%3C/svg%3E"); }
.banner-degraded { background: var(--minor); color: #1c1917; }
.banner-partial_outage { background: var(--major); }
.banner-major_outage { background: var(--bad); }
.banner-unknown { background: #64748b; }
.banner-degraded .banner-icon, .banner-partial_outage .banner-icon, .banner-major_outage .banner-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='white' d='M7 3h2v6H7zM7 11h2v2H7z'/%3E%3C/svg%3E");
}

.ongoing { margin-bottom: 20px; display: grid; gap: 10px; }
.ongoing-item {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--bad);
  border-radius: 10px; padding: 14px 16px; box-shadow: var(--shadow);
}
.ongoing-item.degraded { border-left-color: var(--minor); }
.ongoing-item h3 { margin: 0 0 4px; font-size: 16px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.card-head h2 { margin: 0; font-size: 17px; }

.components { list-style: none; margin: 0; padding: 0; }
.component { padding: 16px 0; border-top: 1px solid var(--line); }
.component:first-child { border-top: 0; }
.comp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.comp-head > div { min-width: 0; }
.comp-name { font-weight: 600; }
.comp-desc { margin: 2px 0 0; }
.pill { flex: none; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.pill::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.pill.operational { color: var(--ok); }
.pill.degraded { color: #ca8a04; }
.pill.down { color: var(--bad); }
.pill.unknown { color: var(--muted); }

.bars { display: flex; gap: 2px; height: 34px; margin: 12px 0 6px; }
.bar { flex: 1 1 0; min-width: 2px; border-radius: 2px; background: var(--none); cursor: default; outline: none; }
.bar.ok { background: var(--ok); }
.bar.minor { background: var(--minor); }
.bar.major { background: var(--major); }
.bar.bad { background: var(--bad); }
.bar:hover, .bar:focus-visible { opacity: 0.7; }
.bar-axis { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.uptimes { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.uptimes b { color: var(--text); font-weight: 600; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.sw.ok { background: var(--ok); } .sw.minor { background: var(--minor); } .sw.major { background: var(--major); }
.sw.bad { background: var(--bad); } .sw.none { background: var(--none); }

.latency { display: grid; gap: 16px; }
.lat-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 130px; gap: 12px; align-items: center; }
.lat-row svg { width: 100%; height: 44px; display: block; }
.lat-row .stat { text-align: right; }
.lat-row .stat b { display: block; font-size: 15px; color: var(--text); }
.lat-row .stat span { white-space: nowrap; }

.incidents { display: grid; }
.day { padding: 12px 0; border-top: 1px solid var(--line); }
.day:first-child { border-top: 0; }
.day h3 { margin: 0 0 4px; font-size: 14px; }
.inc { margin: 8px 0 0; }
.inc-title { font-weight: 600; }
.inc-title.outage { color: var(--bad); }
.inc-title.degraded { color: #ca8a04; }

.footnote { text-align: center; margin: 4px 0 40px; }

.tip {
  position: fixed; z-index: 10; pointer-events: none; max-width: 240px;
  background: #0f172a; color: #f8fafc; font-size: 13px; line-height: 1.4;
  padding: 8px 10px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.tip b { display: block; margin-bottom: 2px; }

@media (max-width: 640px) {
  .banner { margin-top: 20px; }
  .bars { height: 28px; gap: 1px; }
  .lat-row { grid-template-columns: minmax(0, 1fr) 120px; }
  .lat-row .lat-name { grid-column: 1 / -1; }
  .visit { display: none; }
}
