:root {
  color-scheme: light;
  --background: 220 33% 98%;
  --card: 0 0% 100%;
  --foreground: 224 20% 13%;
  --muted: 220 20% 95%;
  --muted-foreground: 220 10% 44%;
  --faint-foreground: 220 9% 58%;
  --border: 220 17% 90%;
  --primary: 221 83% 53%;
  --tone-operational: 158 84% 28%;
  --tone-degraded: 32 95% 36%;
  --tone-partial_outage: 17 88% 40%;
  --tone-major_outage: 0 72% 44%;
  --tone-maintenance: 224 76% 48%;
  --tone-unknown: 220 9% 40%;
  --tone-investigating: 32 95% 36%;
  --tone-monitoring: 224 76% 48%;
  --tone-resolved: 158 84% 28%;
  --shadow-card: 0 1px 2px hsl(224 20% 13% / 0.05), 0 1px 1px hsl(224 20% 13% / 0.03);
  --radius: 14px;
  --max: 45rem;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: hsl(var(--background));
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 2px;
  border-radius: 6px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.site-header {
  border-bottom: 1px solid hsl(var(--border) / 0.8);
  background: hsl(var(--card));
}

.header-inner {
  display: flex;
  height: 60px;
  align-items: center;
  justify-content: space-between;
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
  font-weight: 700;
}

.brand-mark {
  position: relative;
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
}

.brand-mark span {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 4px;
  transform: rotate(45deg);
}

.brand-mark span:nth-child(1) {
  top: 0;
  background: hsl(16 100% 56%);
}

.brand-mark span:nth-child(2) {
  left: 1px;
  bottom: 2px;
  background: hsl(var(--primary));
}

.brand-mark span:nth-child(3) {
  right: 1px;
  bottom: 2px;
  background: hsl(250 100% 68%);
}

.brand-divider {
  color: hsl(var(--border));
  font-weight: 400;
}

.brand-context {
  color: hsl(var(--muted-foreground));
  font-weight: 600;
}

.header-link {
  font-size: 13.5px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  padding: 6px 10px;
  border-radius: 8px;
}

.header-link:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--muted));
}

.page {
  flex: 1;
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.overall-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  border-radius: var(--radius);
  color: hsl(0 0% 100%);
  background: hsl(var(--tone-unknown));
  box-shadow: var(--shadow-card);
}

.overall-banner.status-operational {
  background: hsl(var(--tone-operational));
}

.overall-banner.status-degraded {
  background: hsl(var(--tone-degraded));
}

.overall-banner.status-partial_outage {
  background: hsl(var(--tone-partial_outage));
}

.overall-banner.status-major_outage {
  background: hsl(var(--tone-major_outage));
}

.overall-banner.status-maintenance {
  background: hsl(var(--tone-maintenance));
}

.overall-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: hsl(0 0% 100% / 0.18);
}

.overall-icon svg {
  width: 22px;
  height: 22px;
}

.status-loading .overall-icon {
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.45;
  }
}

.overall-copy h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.overall-copy p {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: hsl(0 0% 100% / 0.85);
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  margin: 12px 4px 0;
  color: hsl(var(--faint-foreground));
  font-size: 12.5px;
}

.page-meta p {
  margin: 0;
}

.load-error {
  margin-top: 14px;
  padding: 12px 16px;
  border: 1px solid hsl(var(--tone-major_outage) / 0.3);
  border-radius: 10px;
  background: hsl(var(--tone-major_outage) / 0.06);
  color: hsl(var(--tone-major_outage));
  font-size: 13.5px;
  line-height: 1.5;
}

.load-error p {
  margin: 0;
}

.retry-button {
  margin-left: 6px;
  padding: 3px 10px;
  border: 1px solid hsl(var(--tone-major_outage) / 0.4);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.retry-button:hover {
  background: hsl(var(--tone-major_outage) / 0.08);
}

.section {
  margin-top: 40px;
}

.section-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.components-card {
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  box-shadow: var(--shadow-card);
}

.component-row {
  border-bottom: 1px solid hsl(var(--border) / 0.8);
}

.component-row:last-child {
  border-bottom: 0;
}

.component-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  padding: 13px 18px;
  cursor: pointer;
  list-style: none;
}

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

.component-summary:hover {
  background: hsl(var(--muted) / 0.5);
}

.component-summary:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: -2px;
  border-radius: 6px;
}

.chevron {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: hsl(var(--faint-foreground));
  transition: transform 0.15s ease;
}

.component-row[open] > .component-summary .chevron,
.history-details[open] > .history-summary .chevron {
  transform: rotate(180deg);
}

.component-name {
  margin-right: auto;
  font-size: 14.5px;
  font-weight: 600;
}

.component-uptime {
  color: hsl(var(--faint-foreground));
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.component-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
}

.component-message {
  flex-basis: 100%;
  margin: 2px 0 0;
  color: hsl(var(--muted-foreground));
  font-size: 13px;
  line-height: 1.5;
}

.component-history {
  padding: 4px 18px 16px;
}

.history-bars {
  display: flex;
  gap: 2px;
  height: 28px;
}

.history-bar {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 2px;
  background: hsl(var(--border));
}

.history-bar:hover {
  opacity: 0.75;
}

.history-bar.day-operational {
  background: hsl(var(--tone-operational) / 0.85);
}

.history-bar.day-degraded {
  background: hsl(var(--tone-degraded) / 0.9);
}

.history-bar.day-down {
  background: hsl(var(--tone-major_outage) / 0.9);
}

.history-bar.day-unknown {
  background: hsl(var(--border));
}

.history-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: hsl(var(--faint-foreground));
  font-size: 11.5px;
}

.history-empty {
  margin: 0;
  color: hsl(var(--muted-foreground));
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: hsl(var(--tone-unknown));
}

.status-dot.status-operational {
  background: hsl(var(--tone-operational));
}

.status-dot.status-degraded {
  background: hsl(var(--tone-degraded));
}

.status-dot.status-partial_outage {
  background: hsl(var(--tone-partial_outage));
}

.status-dot.status-major_outage {
  background: hsl(var(--tone-major_outage));
}

.status-dot.status-maintenance {
  background: hsl(var(--tone-maintenance));
}

.status-text-operational {
  color: hsl(var(--tone-operational));
}

.status-text-degraded {
  color: hsl(var(--tone-degraded));
}

.status-text-partial_outage {
  color: hsl(var(--tone-partial_outage));
}

.status-text-major_outage {
  color: hsl(var(--tone-major_outage));
}

.status-text-maintenance {
  color: hsl(var(--tone-maintenance));
}

.status-text-unknown {
  color: hsl(var(--tone-unknown));
}

.incident-stack {
  display: grid;
  gap: 14px;
}

.incident-card {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}

.incident-head {
  display: flex;
  align-items: center;
  gap: 13px;
}

.incident-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: hsl(var(--tone-unknown) / 0.1);
  color: hsl(var(--tone-unknown));
}

.incident-icon svg {
  width: 18px;
  height: 18px;
}

.incident-icon.impact-degraded {
  background: hsl(var(--tone-degraded) / 0.12);
  color: hsl(var(--tone-degraded));
}

.incident-icon.impact-partial_outage {
  background: hsl(var(--tone-partial_outage) / 0.12);
  color: hsl(var(--tone-partial_outage));
}

.incident-icon.impact-major_outage {
  background: hsl(var(--tone-major_outage) / 0.12);
  color: hsl(var(--tone-major_outage));
}

.incident-icon.impact-maintenance {
  background: hsl(var(--tone-maintenance) / 0.12);
  color: hsl(var(--tone-maintenance));
}

.incident-heading {
  min-width: 0;
}

.incident-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 650;
  line-height: 1.35;
}

.incident-submeta {
  margin: 3px 0 0;
  color: hsl(var(--muted-foreground));
  font-size: 13px;
}

.incident-affected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.affected-chip {
  padding: 2px 9px;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background: hsl(var(--muted) / 0.6);
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  font-weight: 500;
}

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

.incident-update {
  position: relative;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
}

.incident-update::before {
  content: "";
  position: absolute;
  top: 24px;
  bottom: -4px;
  left: 7px;
  width: 2px;
  border-radius: 999px;
  background: hsl(var(--border));
}

.incident-update:last-child::before {
  display: none;
}

.update-rail {
  display: flex;
  justify-content: center;
}

.update-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: hsl(var(--tone-unknown));
}

.update-dot.status-investigating {
  background: hsl(var(--tone-investigating));
  box-shadow: 0 0 0 3px hsl(var(--tone-investigating) / 0.15);
}

.update-dot.status-monitoring {
  background: hsl(var(--tone-monitoring));
  box-shadow: 0 0 0 3px hsl(var(--tone-monitoring) / 0.15);
}

.update-dot.status-resolved {
  background: hsl(var(--tone-resolved));
  box-shadow: 0 0 0 3px hsl(var(--tone-resolved) / 0.15);
}

.update-message {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
}

.update-status {
  font-weight: 700;
}

.update-status.status-investigating {
  color: hsl(var(--tone-investigating));
}

.update-status.status-monitoring {
  color: hsl(var(--tone-monitoring));
}

.update-status.status-resolved {
  color: hsl(var(--tone-resolved));
}

.update-time {
  display: block;
  margin-top: 3px;
  color: hsl(var(--faint-foreground));
  font-size: 12px;
}

.history-details {
  border: 0;
}

.history-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  border-radius: 8px;
}

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

.history-summary:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 4px;
}

.history-summary .section-title {
  margin: 0;
}

.history-summary:hover .section-title {
  color: hsl(var(--muted-foreground));
}

.history-count {
  margin-left: auto;
  color: hsl(var(--faint-foreground));
  font-size: 12.5px;
}

.history {
  display: grid;
  gap: 24px;
  margin-top: 14px;
}

.history-day {
  display: grid;
  gap: 10px;
}

.history-day-title {
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  font-size: 13px;
  font-weight: 600;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 76px;
  padding: 24px 18px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  box-shadow: var(--shadow-card);
  color: hsl(var(--muted-foreground));
  font-size: 14px;
  text-align: center;
}

.empty-state svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: hsl(var(--tone-operational));
}

.site-footer {
  border-top: 1px solid hsl(var(--border) / 0.8);
  background: hsl(var(--card));
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 28px;
  color: hsl(var(--faint-foreground));
  font-size: 12.5px;
}

.footer-inner p {
  margin: 0;
}

.footer-inner a {
  font-weight: 600;
  color: hsl(var(--muted-foreground));
}

.footer-inner a:hover {
  color: hsl(var(--foreground));
}

@media (max-width: 560px) {
  .header-inner,
  .page,
  .footer-inner {
    width: min(var(--max), calc(100% - 32px));
  }

  .page {
    padding-top: 24px;
  }

  .overall-banner {
    align-items: flex-start;
    gap: 13px;
    padding: 18px;
  }

  .overall-icon {
    width: 34px;
    height: 34px;
  }

  .overall-icon svg {
    width: 19px;
    height: 19px;
  }

  .overall-copy h1 {
    font-size: 18px;
  }

  .component-summary {
    padding: 12px 14px;
  }

  .component-history {
    padding: 4px 14px 14px;
  }

  .history-bars {
    gap: 1px;
    height: 24px;
  }

  .history-bar {
    min-width: 1px;
    border-radius: 1px;
  }

  .incident-card {
    padding: 15px 16px;
  }
}
