:root {
  --brand: #1a1a1a;
  --operational: #00b093;
  --degraded: #ecc94b;
  --partial: #ff8c00;
  --major: #8f485d;
  --maintenance: #004968;

  --band: var(--brand);
  --page: #f4f5f7;
  --card: #ffffff;
  --border: #e3e5e8;
  --text: #1a1a1a;
  --muted: #5f6672;
  --day: var(--operational);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --band: #111111;
    --page: #020308;
    --card: #030509;
    --border: #14171d;
    --text: #ffffff;
    --muted: #a3a8b3;
    --major: #b8657f;
    --maintenance: #0f86b6;
    --day: color-mix(in srgb, var(--operational) 55%, var(--card));
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font:
    15px/1.5 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  -webkit-text-size-adjust: 100%;
}

a {
  color: inherit;
}

.column {
  width: min(100% - 24px, 804px);
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Status colors, for shapes only (icons, dots, day marks), not for text.
   The uptime label of an operational row is the one exception. */
.status-OPERATIONAL {
  color: var(--operational);
}
.status-DEGRADEDPERFORMANCE {
  color: var(--degraded);
}
.status-PARTIALOUTAGE {
  color: var(--partial);
}
.status-MAJOROUTAGE {
  color: var(--major);
}
.status-UNDERMAINTENANCE {
  color: var(--maintenance);
}

.icon,
.chevron {
  flex: none;
  width: 16px;
  height: 16px;
}

.icon .glyph,
.chevron {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon .glyph {
  stroke: var(--card);
}

.chevron {
  stroke: currentColor;
}

/* Header band, with the card overlapping it. */
.site-header {
  background: var(--band);
  padding: 64px 0 172px;
}

.site-header .column {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  margin-right: auto;
}

.logo,
.logo img {
  display: block;
  border-radius: 10px;
}

.logo img {
  border: 1px solid rgb(255 255 255 / 0.2);
}

.report {
  color: #ffffff;
  font-weight: 500;
  text-decoration: none;
}

.report:hover,
.page-links a:hover,
.section-head a:hover,
.card-footer a:hover,
.notice h3 a:hover {
  text-decoration: underline;
}

/* The "Get updates" menu: a white button in both color schemes, as the band
   is dark in both. */
.subscribe-menu {
  position: relative;
}

.subscribe-menu > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 14px;
  border-radius: 8px;
  background: #ffffff;
  color: #1a1a1a;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.subscribe-menu > summary::-webkit-details-marker {
  display: none;
}

.subscribe-menu .chevron {
  width: 14px;
  height: 14px;
  transform: rotate(90deg);
}

.subscribe-menu ul {
  position: absolute;
  z-index: 1;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  margin: 0;
  padding: 6px;
  /* Stronger than --border, which is faint on the dark band. */
  border: 1px solid color-mix(in srgb, var(--text) 22%, var(--card));
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
  list-style: none;
}

.subscribe-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
}

.subscribe-menu a:hover,
.subscribe-menu a:focus-visible {
  background: var(--border);
}

.card {
  margin-top: -106px;
  margin-bottom: 48px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
}

.card > section,
.banner,
.page-head {
  padding-inline: clamp(14px, 4vw, 32px);
}

.banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
  padding-block: 36px;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
}

.banner .icon {
  width: 22px;
  height: 22px;
}

/* Top of the history, a notice page and the 404 page. */
.page-head {
  padding-block: 28px 8px;
}

.page-head:last-child {
  padding-bottom: 28px;
}

.page-head h1 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 14px;
}

.page-links a {
  text-decoration: none;
}

.empty-month {
  margin: 12px 0 0;
  color: var(--muted);
}

h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Components and uptime bars. */
.components {
  padding-bottom: 24px;
}

.component {
  margin-bottom: 20px;
}

.group > summary {
  display: block;
  cursor: pointer;
}

.group > summary::-webkit-details-marker {
  display: none;
}

.group > summary .chevron {
  display: block;
  transition: transform 0.15s;
}

.group[open] > summary .chevron {
  transform: rotate(90deg);
}

.group > .component {
  margin: 16px 0 0 24px;
}

.row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.name {
  font-weight: 600;
}

.count {
  color: var(--muted);
  white-space: nowrap;
}

.uptime {
  margin-left: auto;
  white-space: nowrap;
}

.days {
  display: flex;
  gap: clamp(0px, 0.25vw, 2px);
  height: 32px;
  border-radius: 4px;
  overflow: hidden;
}

.day {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  background: var(--day);
}

a.day:hover,
a.day:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: -2px;
}

.mark {
  position: absolute;
  inset: auto 0 0;
  height: max(calc(var(--f) * 100%), 8px);
  background: currentColor;
  border-radius: 2px 2px 0 0;
}

.days-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Notices. */
.notices {
  padding-block: 20px 28px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.empty {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 40px;
}

.empty .icon {
  width: 20px;
  height: 20px;
}

.notice {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.notice h3 {
  margin: 0 0 6px;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.notice h3 a {
  text-decoration: none;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-weight: 600;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.updates {
  margin: 0;
  padding: 0;
  list-style: none;
}

.updates > li {
  margin-top: 12px;
  padding-left: 14px;
  border-left: 2px solid var(--border);
}

.update-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  margin: 0;
}

.update-head time {
  color: var(--muted);
  font-size: 13px;
}

.update-head .badge {
  font-size: 13px;
}

.message {
  overflow-wrap: anywhere;
}

.message > * {
  margin: 6px 0;
}

.message h1,
.message h2,
.message h3 {
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
}

.message ul {
  list-style-type: disc;
}

.message img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.message code,
.subscribe code,
.api-docs p code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--border);
  font-size: 0.92em;
}

.card-footer {
  padding: 26px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
}

.card-footer a {
  text-decoration: none;
}

/* The subscribe pages, the answers of the app server to their forms, and the
   public API page. */
.subscribe,
.api-docs {
  padding-block: 12px 28px;
}

.subscribe > :first-child {
  margin-top: 0;
}

.subscribe ol {
  padding-left: 20px;
}

.subscribe form {
  max-width: 440px;
}

.secret {
  overflow-wrap: anywhere;
}

.api-docs h2 {
  margin-top: 16px;
}

.api-docs pre {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--page);
  font-size: 13px;
  overflow-x: auto;
}

.field {
  display: block;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  font-weight: 600;
}

.field legend {
  padding: 0;
  margin-bottom: 4px;
}

.field input:not([type="checkbox"], [type="radio"]),
.field select,
.field textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--muted);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
}

.field textarea {
  resize: vertical;
}

.button {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid var(--text);
  border-radius: 8px;
  background: var(--text);
  color: var(--card);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
