:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1d2330;
  --muted: #5f6776;
  --border: #e3e6eb;
  --ok: #1f8b4c;
  --ok-bar: #3bb36f;
  --minor: #e0b225;
  --partial: #e8823a;
  --major: #d93a3f;
  --none: #c9ced6;
  --banner-text: #ffffff;
  --tooltip-bg: #1d2330;
  --tooltip-text: #ffffff;
  --primary: hsl(232 38% 51%);
  --ok-text: #1a7f45;
  --major-text: #c62f35;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --surface: #161b22;
    --text: #e6e9ee;
    --muted: #9aa3b0;
    --border: #2a313b;
    --ok: #238a4f;
    --ok-bar: #3fb873;
    --minor: #d9ab22;
    --partial: #e07f3a;
    --major: #d6474c;
    --none: #3a424e;
    --tooltip-bg: #f0f2f5;
    --tooltip-text: #10141a;
    --primary: hsl(230 62% 71%);
    --ok-text: #3fb873;
    --major-text: #f06a6e;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.masthead {
  padding: 40px 0 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--primary);
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--primary);
}

a {
  color: var(--primary);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.banner {
  margin: 0 0 40px;
  padding: 18px 22px;
  border-radius: 6px;
  background: var(--none);
  color: var(--banner-text);
  font-size: 1.3rem;
  font-weight: 600;
}

.banner p {
  margin: 0;
}

.banner[data-level="ok"] {
  background: var(--ok);
}
.banner[data-level="partial"] {
  background: #b85a12;
}
.banner[data-level="major"] {
  background: var(--major);
}
.banner[data-level="none"] {
  color: var(--text);
}

.section-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.small-heading {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.component {
  padding: 20px 22px 16px;
}

.component + .component {
  border-top: 1px solid var(--border);
}

.component-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.component-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.component-status {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ok-text);
}

.component-status[data-status="down"] {
  color: var(--major-text);
}

.component-status::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
}

.bars {
  display: flex;
  gap: 2px;
  height: 34px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bar {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 2px;
  background: var(--none);
  cursor: pointer;
  transition: opacity 0.1s;
}

.bar:hover {
  opacity: 0.7;
}

.bar[data-level="ok"] {
  background: var(--ok-bar);
}
.bar[data-level="minor"] {
  background: var(--minor);
}
.bar[data-level="partial"] {
  background: var(--partial);
}
.bar[data-level="major"] {
  background: var(--major);
}

.component-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

.component-foot .rule {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.incidents {
  margin-top: 56px;
}

.incidents h2 {
  margin: 0 0 8px;
  font-size: 1.6rem;
  font-weight: 600;
}

.incident-day {
  padding: 22px 0 6px;
}

.incident-day h3 {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 1.1rem;
  font-weight: 600;
}

.incident-day .empty {
  margin: 0;
  color: var(--muted);
}

.incident {
  margin-bottom: 22px;
}

.incident h4 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary);
}

.update {
  margin: 0 0 12px;
}

.update p {
  margin: 0;
  overflow-wrap: anywhere;
}

.update .when {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer {
  padding-top: 40px;
  padding-bottom: 48px;
  font-size: 0.85rem;
  color: var(--muted);
}

.notice {
  color: var(--muted);
}

.tooltip {
  position: absolute;
  z-index: 10;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--tooltip-bg);
  color: var(--tooltip-text);
  font-size: 0.85rem;
  line-height: 1.4;
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.25);
  pointer-events: none;
}

.tooltip strong {
  display: block;
}

.tooltip ul {
  margin: 6px 0 0;
  padding-left: 16px;
}

/* The bar strip shows 90 days on a wide screen, 60 on a tablet and 30 on a phone. */
.range-60,
.range-30 {
  display: none;
}

@media (max-width: 760px) {
  .bar:nth-child(-n + 30) {
    display: none;
  }
  .range-90,
  .range-30 {
    display: none;
  }
  .range-60 {
    display: inline;
  }
}

@media (max-width: 520px) {
  .masthead {
    padding: 28px 0 20px;
  }
  .banner {
    font-size: 1.1rem;
    padding: 16px 18px;
  }
  .component {
    padding: 16px 16px 12px;
  }
  .bar:nth-child(-n + 60) {
    display: none;
  }
  .bars {
    gap: 3px;
  }
  .range-90,
  .range-60 {
    display: none;
  }
  .range-30 {
    display: inline;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bar {
    transition: none;
  }
}
