:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --border: #e6e4dd;
  --text: #1c1c1a;
  --text-muted: #6b6a64;
  --accent: #8b6f3f;
  --ok: #1f9d55;
  --ok-soft: #d8efe1;
  --warn: #d97706;
  --warn-soft: #fbe6c2;
  --bad: #c0392b;
  --bad-soft: #f5d0cb;
  --none: #d4d2cb;
  --shadow: 0 1px 2px rgba(20, 18, 12, 0.04), 0 4px 16px rgba(20, 18, 12, 0.04);
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141312;
    --surface: #1d1c1a;
    --border: #2a2826;
    --text: #f1efea;
    --text-muted: #a3a098;
    --accent: #c9a86a;
    --ok-soft: #1f3a2a;
    --warn-soft: #3a2a14;
    --bad-soft: #3a1c18;
    --none: #3a3835;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.3);
  }
}

* {
  box-sizing: border-box;
}

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

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

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.page__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 32px;
}

.brand h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}

.brand__sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.overall {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.overall__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--none);
}
.overall--ok .overall__dot { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.overall--warn .overall__dot { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.overall--bad .overall__dot { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
.overall--init .overall__dot {
  background: var(--text-muted);
  animation: overall-pulse 1.4s ease-in-out infinite;
}
@keyframes overall-pulse {
  0%, 100% { box-shadow: 0 0 0 0 transparent; opacity: 0.7; }
  50% { box-shadow: 0 0 0 4px rgba(139, 111, 63, 0.18); opacity: 1; }
}

.services {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.service {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.service__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.service__name {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 2px;
}

.service__url {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  word-break: break-all;
}

.service__stat {
  text-align: right;
  min-width: 96px;
}
.service__uptime {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.service__period {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.bars {
  display: flex;
  gap: 2px;
  height: 34px;
  margin-top: 16px;
  align-items: stretch;
}

.bar {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 2px;
  background: var(--none);
  transition: transform 120ms ease;
  cursor: default;
}
.bar:hover { transform: scaleY(1.08); }
.bar--ok   { background: var(--ok); }
.bar--warn { background: var(--warn); }
.bar--bad  { background: var(--bad); }

.service__axis {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.service__status {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  font-size: 0.7rem;
}
.service__status--ok   { color: var(--ok); }
.service__status--warn { color: var(--warn); }
.service__status--bad  { color: var(--bad); }
.service__status--none { color: var(--text-muted); }

.page__footer {
  margin-top: 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.legend {
  display: inline-flex;
  gap: 14px;
  flex-wrap: wrap;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend__swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}
.legend__swatch--ok   { background: var(--ok); }
.legend__swatch--warn { background: var(--warn); }
.legend__swatch--bad  { background: var(--bad); }
.legend__swatch--none { background: var(--none); }

@media (max-width: 540px) {
  .page { padding: 32px 16px 48px; }
  .page__header { flex-direction: column; }
  .service { padding: 16px; }
  .service__row { flex-direction: column; }
  .service__stat { text-align: left; }
  .bars { height: 28px; }
}
