:root {
  --bg: #090c14;
  --card: #121725;
  --card-soft: #161d2d;
  --border: #24304a;
  --text: #eaf0ff;
  --muted: #9fb1d2;
  --blue: #3d75ff;
  --green: #2dd881;
  --yellow: #f3c969;
  --red: #ff5f6d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(1200px 800px at 50% -20%, #1b2850 0%, var(--bg) 55%);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh;
}

.page {
  width: min(1200px, 95vw);
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  align-items: flex-start;
}

.kicker {
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 700;
}

h1 {
  margin: 0.2rem 0 0;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.subtext {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.header-meta {
  text-align: right;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: var(--card);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

#last-updated {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.summary-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  padding: 0.85rem 0.9rem;
}

.summary-card .label {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.summary-card .value {
  margin: 0.25rem 0 0;
  font-size: 1.45rem;
  font-weight: 700;
}

.summary-green {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 35%, transparent);
}

.summary-yellow {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--yellow) 35%, transparent);
}

.summary-red {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 35%, transparent);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  padding: 0.7rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

.api-endpoint {
  font-size: 0.82rem;
  color: var(--muted);
}

.api-endpoint code {
  color: var(--text);
  background: #1c2438;
  border: 1px solid #2b3857;
  border-radius: 6px;
  padding: 0.2rem 0.4rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

button {
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.45rem 0.6rem;
  font: inherit;
  cursor: pointer;
  background: var(--blue);
  border-color: color-mix(in srgb, var(--blue) 70%, black);
  font-weight: 600;
}

button.secondary {
  background: #253047;
}

#refresh-timer {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
}

.service-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 218px;
}

.service-card header {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
}

.service-name {
  margin: 0;
  font-size: 1rem;
}

.service-description {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.3;
}

.service-status {
  font-size: 0.77rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  background: var(--yellow);
}

.dot-green {
  background: var(--green);
  box-shadow: 0 0 12px color-mix(in srgb, var(--green) 80%, transparent);
}

.dot-yellow {
  background: var(--yellow);
  box-shadow: 0 0 12px color-mix(in srgb, var(--yellow) 70%, transparent);
}

.dot-red {
  background: var(--red);
  box-shadow: 0 0 12px color-mix(in srgb, var(--red) 70%, transparent);
}

dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin: 0;
}

dt {
  color: var(--muted);
  font-size: 0.73rem;
  margin-bottom: 0.2rem;
}

dd {
  margin: 0;
  font-size: 0.86rem;
}

.uptime-bar {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #1e273d;
  overflow: hidden;
}

.uptime-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f975b, #2dd881);
  transition: width 0.3s ease;
}

.details {
  margin: 0;
  color: #9bb0d4;
  font-size: 0.74rem;
  line-height: 1.35;
  opacity: 0.9;
  max-height: 72px;
  overflow: hidden;
}

.skeleton {
  justify-content: center;
  align-items: center;
  color: var(--muted);
}

.service-card.status-green {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 35%, transparent);
}

.service-card.status-yellow {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--yellow) 35%, transparent);
}

.service-card.status-red {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 35%, transparent);
}

@media (max-width: 900px) {
  .summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header {
    flex-direction: column;
  }

  .header-meta {
    text-align: left;
  }

  #refresh-timer {
    margin-left: 0;
    width: 100%;
  }
}
