:root {
  color-scheme: light;
  --bg: #f8f7f4;
  --panel: #ffffff;
  --text: #20201d;
  --muted: #747067;
  --border: #e7e2d9;
  --soft: #f1eee8;
  --green: #1f8f5f;
  --green-soft: #e7f4ed;
  --yellow: #a56a12;
  --yellow-soft: #fbf1dd;
  --red: #b43b33;
  --red-soft: #fae8e5;
  --link: #4b5f9f;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  color: var(--text);
  font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.page {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 42px;
}

.header, .footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 650;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(135deg, #26231d, #8a7b62);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
}

.json-link {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(255,255,255,.55);
  color: var(--muted);
}

.hero {
  margin: 28px 0 18px;
  padding: 34px 26px 30px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(32, 32, 29, .04);
}

.status-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 18px;
  border-radius: 999px;
  position: relative;
  background: var(--muted);
}

.status-icon::after {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 999px;
  background: #fff;
  opacity: .92;
}

.status-healthy, .status-success { background: var(--green); }
.status-degraded, .status-stale, .status-paused, .status-warning, .status-pending_first_run { background: var(--yellow); }
.status-error, .status-critical, .status-failed { background: var(--red); }
.status-unknown { background: var(--muted); }

h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.15;
  font-weight: 680;
  letter-spacing: -.03em;
}

.hero p {
  max-width: 520px;
  margin: 10px auto 0;
  color: var(--muted);
}

.timestamp { font-size: 13px; }

.panel, .meta-grid article {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(32, 32, 29, .035);
}

.panel { margin-top: 14px; overflow: hidden; }

.component-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-top: 1px solid var(--border);
}

.component-row:first-child { border-top: 0; }

.component-row h2, .compact h2 {
  margin: 0 0 2px;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -.01em;
}

.component-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.state {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 650;
  border: 1px solid transparent;
}

.state-healthy { color: var(--green); background: var(--green-soft); border-color: #cfe8dc; }
.state-warning { color: var(--yellow); background: var(--yellow-soft); border-color: #f0d9ad; }
.state-error { color: var(--red); background: var(--red-soft); border-color: #efcbc7; }
.state-unknown, .state-muted { color: var(--muted); background: var(--soft); border-color: var(--border); }

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.meta-grid article { padding: 14px 15px; }
.meta-grid span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.meta-grid strong { display: block; font-size: 13px; font-weight: 650; }

.compact { padding: 16px 18px; }

.events {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
}

.events li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.events li:first-child { border-top: 0; padding-top: 0; }
.events time { color: var(--text); white-space: nowrap; }

.footer {
  margin-top: 18px;
  align-items: flex-start;
}

@media (max-width: 640px) {
  .page { width: min(100% - 24px, 760px); padding-top: 22px; }
  .header, .footer, .component-row, .events li { align-items: flex-start; }
  .component-row, .footer { flex-direction: column; }
  .hero { padding: 28px 18px 24px; }
  .meta-grid { grid-template-columns: 1fr; }
}
