:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #6b7280;
  --border: #e5e7eb;
  --ok: #2fb170;
  --minor: #e3a008;
  --partial: #f2711c;
  --major: #e5484d;
  --maint: #3b82f6;
  --nodata: #d6dae1;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --card: #171a21;
    --text: #e8eaf0;
    --muted: #9aa1ad;
    --border: #262b35;
    --nodata: #2c323d;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent, #3b5bdb); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h2 { font-size: 1.25rem; margin-top: 2.5rem; }
.muted { color: var(--muted); }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px 48px; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; padding: 32px 0 28px; gap: 16px; flex-wrap: wrap; }
.brand { color: var(--text); }
.brand:hover { text-decoration: none; }
.logo { max-height: 40px; display: block; }
.wordmark { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; }
.top nav { display: flex; gap: 16px; align-items: center; font-size: .9rem; }
.top nav a { color: var(--muted); }
.btn-sub {
  background: var(--accent, #3b5bdb); color: #fff !important; padding: 7px 14px; border-radius: 6px; font-weight: 600;
}
.btn-sub:hover { text-decoration: none; filter: brightness(1.08); }
.announcement { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--accent, #3b5bdb); padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; }

/* hero */
.hero {
  display: flex; align-items: center; gap: 12px; color: #fff; padding: 18px 22px; border-radius: var(--radius); margin-bottom: 28px;
}
.hero svg { width: 26px; height: 26px; flex: none; }
.hero h1 { font-size: 1.3rem; margin: 0; font-weight: 600; }
.st-bg-operational { background: var(--ok); }
.st-bg-degraded_performance { background: var(--minor); }
.st-bg-partial_outage { background: var(--partial); }
.st-bg-major_outage { background: var(--major); }
.st-bg-under_maintenance { background: var(--maint); }

/* incident cards */
.incident {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; box-shadow: var(--shadow);
}
.incident h3 { margin: 0; padding: 14px 20px; font-size: 1.05rem; color: #fff; background: var(--minor); }
.incident h3 a { color: inherit; }
.incident.impact-major h3 { background: var(--partial); }
.incident.impact-critical h3 { background: var(--major); }
.incident.impact-maintenance h3 { background: var(--maint); }
.incident.impact-none h3 { background: var(--muted); }
.incident .updates, .incident .affected, .incident .window { padding: 0 20px; }
.window { color: var(--muted); font-size: .9rem; margin: 12px 0 0; }
.affected { color: var(--muted); font-size: .85rem; padding-bottom: 14px !important; margin: 0; }

.updates { list-style: none; margin: 0; padding: 0; }
.updates li { padding: 14px 0; border-bottom: 1px solid var(--border); }
.updates li:last-child { border-bottom: 0; }
.u-status { font-weight: 700; margin-right: 6px; }
.u-body { display: inline; }
.u-time { color: var(--muted); font-size: .82rem; margin-top: 4px; }

/* components */
.components { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 20px; font-size: .85rem; color: var(--muted); border-bottom: 1px solid var(--border); }
.legend { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.legend .bar { display: inline-block; width: 8px; height: 12px; margin-right: -6px; vertical-align: -2px; border-radius: 2px; }
.component, .group { border-bottom: 1px solid var(--border); }
.component:last-child, .group:last-child { border-bottom: 0; }
.component { padding: 16px 20px; }
.component.nested { padding-left: 36px; border-bottom: 0; border-top: 1px solid var(--border); }
.c-head, .group > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.c-name { font-weight: 600; }
.c-status { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 500; white-space: nowrap; }
.c-status svg { width: 16px; height: 16px; }
.st-operational { color: var(--ok); }
.st-degraded_performance { color: var(--minor); }
.st-partial_outage { color: var(--partial); }
.st-major_outage { color: var(--major); }
.st-under_maintenance { color: var(--maint); }
.help { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border); color: var(--muted); font-size: 11px; cursor: help; font-weight: 500; }
.group > summary { padding: 16px 20px; cursor: pointer; list-style: none; }
.group > summary::-webkit-details-marker { display: none; }
.chev { display: inline-block; width: 16px; transition: transform .15s; color: var(--muted); }
.group[open] .chev { transform: rotate(90deg); }
.count { color: var(--muted); font-weight: 400; font-size: .85rem; margin-left: 4px; }

.bars { display: flex; gap: 2px; height: 34px; margin: 10px 0 6px; }
.bar { flex: 1; border-radius: 2px; background: var(--nodata); min-width: 2px; cursor: pointer; transition: opacity .1s; }
.bar:hover { opacity: .7; }
.bar.ok { background: var(--ok); }
.bar.minor { background: var(--minor); }
.bar.partial { background: var(--partial); }
.bar.major { background: var(--major); }
.c-foot { display: flex; align-items: center; gap: 10px; font-size: .78rem; color: var(--muted); }
.c-foot .line { flex: 1; height: 1px; background: var(--border); }
/* On small screens show the last 30 days only */
@media (max-width: 640px) {
  .bars .bar:nth-child(-n + 60) { display: none; }
  .ago-90 { font-size: 0; }
  .ago-90::after { content: "30 days ago"; font-size: .78rem; }
  .component.nested { padding-left: 20px; }
}

.tip {
  position: fixed; z-index: 10; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 10px 12px; font-size: .82rem; max-width: 260px; pointer-events: none;
}
.tip strong { display: block; margin-bottom: 2px; }
.tip ul { margin: 6px 0 0; padding-left: 16px; }

/* past incidents */
.day { border-bottom: 1px solid var(--border); padding: 14px 0; }
.day h4 { font-size: 1rem; margin-bottom: 8px; }
.day p, .past p { margin: 4px 0; }
.past { margin-bottom: 14px; }
.past > a { font-weight: 600; font-size: 1.02rem; }
.impact-text-minor { color: var(--minor) !important; }
.impact-text-major { color: var(--partial) !important; }
.impact-text-critical { color: var(--major) !important; }
.impact-text-maintenance { color: var(--maint) !important; }
.past small, .day small { color: var(--muted); }

.incident-page h1 { font-size: 1.7rem; margin-top: 8px; }
.incident-page .updates li { display: grid; grid-template-columns: 140px 1fr; gap: 4px 16px; }
.incident-page .u-time { grid-column: 2; margin: 0; }
@media (max-width: 640px) { .incident-page .updates li { grid-template-columns: 1fr; } .incident-page .u-time { grid-column: 1; } }
.month { margin-bottom: 24px; }
.month h2 { border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.empty { background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius); padding: 32px; text-align: center; color: var(--muted); }

.foot { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: .82rem; text-align: center; }
.foot a { color: var(--muted); }
