:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --border: #dde3ea;
  --text: #0f172a;
  --muted: #607087;
  --ok: #14b88f;
  --warn: #f6b93b;
  --down: #ff7d61;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, sans-serif;
}

.status-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.status-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.brand img {
  width: 34px;
  height: 34px;
}

#refresh-button {
  border: 1px solid #bcc8d6;
  background: #fff;
  color: #223046;
  border-radius: 0.6rem;
  padding: 0.5rem 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.global-banner {
  border: 1px solid var(--border);
  background: #ecf8f5;
  border-radius: 0.85rem;
  padding: 1.15rem 1rem;
  margin-bottom: 1.25rem;
}

.global-banner h1 {
  margin: 0;
  font-size: 1.55rem;
}

.global-banner p {
  margin: 0.4rem 0 0;
  color: #39556c;
}

.global-banner.partial {
  background: #fff8ec;
}

.global-banner.outage {
  background: #fff0ed;
}

.status-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.panel-head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.service-row {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.service-row:last-child { border-bottom: 0; }

.service-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.service-name { margin: 0; font-size: 1.1rem; }
.service-endpoint {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.service-health {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}

.service-state {
  font-weight: 700;
  text-transform: capitalize;
}

.service-state.operational { color: var(--ok); }
.service-state.degraded { color: #c58600; }
.service-state.outage { color: #d8482c; }

.service-uptime {
  color: var(--muted);
  font-size: 0.9rem;
}

.uptime-bars {
  display: grid;
  grid-template-columns: repeat(90, minmax(0, 1fr));
  gap: 0.18rem;
}

.uptime-bar {
  display: block;
  height: 0.95rem;
  border-radius: 0.15rem;
  border: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
  background: var(--ok);
  position: relative;
}

.uptime-bar.degraded { background: var(--warn); }
.uptime-bar.outage { background: var(--down); }

.uptime-bar:hover,
.uptime-bar:focus-visible {
  outline: 2px solid #223046;
  outline-offset: 1px;
  z-index: 2;
}

.uptime-bar:hover::after,
.uptime-bar:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.35rem);
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  font-size: 0.72rem;
  line-height: 1.3;
  border-radius: 0.35rem;
  padding: 0.3rem 0.45rem;
  white-space: nowrap;
  pointer-events: none;
}

.uptime-caption {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 740px) {
  .panel-head,
  .service-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .service-health {
    align-items: flex-start;
  }
}
