:root {
  color-scheme: light;
  --brand: #0007ac;
  --ink: #0b0d1a;
  --body: #4a4f66;
  --muted: #767c96;
  --faint: #9fa4ba;
  --line: #e6e8f2;
  --surface: #f6f7fb;
  --green: #11875d;
  --green-soft: #eef9f4;
  --amber: #a86608;
  --amber-soft: #fff8e8;
  --red: #bd332b;
  --red-soft: #fff3f2;
  --content-max: 980px;
  --edge-pad: clamp(20px, 4vw, 44px);
  --header-h: 50px;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: #fff; }

body {
  margin: 0;
  color: var(--body);
  background: #fff;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); letter-spacing: -0.02em; }

.wrap {
  width: 100%;
  max-width: calc(var(--content-max) + (var(--edge-pad) * 2));
  margin-inline: auto;
  padding-inline: var(--edge-pad);
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid rgba(11, 13, 26, 0.06);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  width: 86px;
  height: 24px;
  display: flex;
  overflow: hidden;
  line-height: 0;
}

.logo img {
  width: auto;
  height: 24px;
  object-fit: contain;
  transform: translateX(-7px);
}

.header-nav { display: flex; align-items: center; gap: 24px; }
.header-nav a { color: #34394d; font-size: 0.78rem; font-weight: 500; text-decoration: none; }
.header-nav a:hover, .header-nav .is-current { color: var(--ink); }
.header-nav .is-current { font-weight: 600; }
.header-nav .login-link { color: var(--brand); font-weight: 600; }

main { padding-top: calc(var(--header-h) + 78px); padding-bottom: 86px; }

.status-head { margin-bottom: 56px; }

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 4vw, 2.5rem);
  line-height: 1.15;
  font-weight: 500;
}

.intro { margin-bottom: 30px; color: var(--muted); font-size: 1rem; }

.status-summary {
  min-height: 64px;
  padding: 17px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid #cfe9de;
  border-radius: 8px;
  background: var(--green-soft);
}

.overall {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  font-weight: 600;
}

.status-summary:has(.overall-loading) { border-color: var(--line); background: var(--surface); }
.status-summary:has(.overall-degraded) { border-color: #ecd9ad; background: var(--amber-soft); }
.status-summary:has(.overall-outage) { border-color: #edcdca; background: var(--red-soft); }
.overall-loading { color: var(--muted); }
.overall-degraded { color: var(--amber); }
.overall-outage { color: var(--red); }

.status-orb, .component-dot, .legend-dot {
  display: inline-block;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.status-orb { width: 10px; height: 10px; }
.last-updated { margin: 0; color: var(--muted); font-size: 0.76rem; text-align: right; }

.systems, .incidents, .history { margin-top: 48px; }

.section-heading {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h2, .method-note h2 {
  margin-bottom: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 0.7rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 6px; height: 6px; }
.operational { color: var(--green); }
.degraded { color: var(--amber); }
.outage { color: var(--red); }

.group-list { display: grid; gap: 20px; }

.group-card, .history-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.group-title {
  margin: 0;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: #555b70;
  font-size: 0.72rem;
  font-weight: 600;
}

.component-row {
  min-height: 58px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid #eff0f5;
}

.group-title + .component-row { border-top: 0; }
.component-copy { min-width: 0; }
.component-name { margin: 0 0 1px; color: var(--ink); font-size: 0.86rem; font-weight: 500; }
.component-meta { margin: 0; color: var(--faint); font-size: 0.7rem; }

.component-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.component-status.status-degraded { color: var(--amber); }
.component-status.status-outage { color: var(--red); }
.component-dot { width: 7px; height: 7px; }

.incident-card {
  padding: 18px;
  border: 1px solid #edcdca;
  border-radius: 8px;
  background: var(--red-soft);
}
.incident-card h3 { margin: 0 0 5px; font-size: 0.9rem; font-weight: 600; }
.incident-card p { margin: 0; color: var(--body); font-size: 0.8rem; }

.history-item { padding: 15px 18px; border-top: 1px solid #eff0f5; }
.history-item:first-child { border-top: 0; }
.history-item-top { display: flex; justify-content: space-between; gap: 18px; }
.history-item h3 { margin: 0; font-size: 0.84rem; font-weight: 500; }
.history-item time { color: var(--faint); font-size: 0.7rem; white-space: nowrap; }
.history-item p { margin: 4px 0 0; color: var(--muted); font-size: 0.74rem; }
.empty-state { margin: 0; padding: 17px 18px; color: var(--muted); font-size: 0.78rem; }

.method-note { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.method-note h2 { margin-bottom: 7px; font-size: 0.92rem; }
.method-note p { max-width: 760px; margin-bottom: 0; color: var(--muted); font-size: 0.78rem; line-height: 1.65; }

.skeleton {
  height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(90deg, #f3f4f7 20%, #fafafa 50%, #f3f4f7 80%);
  background-size: 220% 100%;
  animation: shimmer 1.4s infinite linear;
}

.page-footer { border-top: 1px solid var(--line); }
.footer-inner {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 0.74rem;
}
.page-footer nav { display: flex; gap: 20px; }
.page-footer a { text-decoration: none; }
.page-footer a:hover { color: var(--ink); }

@keyframes shimmer { to { background-position: -220% 0; } }

@media (max-width: 680px) {
  .header-nav { gap: 16px; }
  .header-nav .is-current { display: none; }
  main { padding-top: calc(var(--header-h) + 52px); padding-bottom: 64px; }
  .status-head { margin-bottom: 42px; }
  .status-summary { align-items: flex-start; flex-direction: column; gap: 5px; }
  .last-updated { text-align: left; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .legend { display: none; }
  .component-row { padding-inline: 14px; }
  .component-status span:last-child { display: none; }
  .group-title { padding-inline: 14px; }
  .history-item-top { flex-direction: column; gap: 3px; }
  .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}
