:root {
  color-scheme: light;
  --bg: #f8fafc;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe3ee;
  --panel: #ffffff;
  --green: #059669;
  --green-soft: #dcfce7;
  --yellow: #ca8a04;
  --yellow-soft: #fef9c3;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --blue: #2563eb;
  --teal: #0f766e;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(219, 227, 238, 0.8);
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 1.08rem;
  font-weight: 800;
}

.brand span span {
  color: var(--blue);
}

.brand-mark {
  display: block;
  flex: 0 0 auto;
}

nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

nav a {
  border-radius: 8px;
  color: #334155;
  font-size: 0.92rem;
  font-weight: 650;
  padding: 8px 11px;
  text-decoration: none;
}

nav a:hover {
  background: #eef2f7;
  color: var(--ink);
}

main {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 44px 0 56px;
}

.summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: end;
  gap: 28px;
  margin-bottom: 24px;
}

.summary-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 4.4rem);
  line-height: 0.98;
  max-width: 760px;
}

h2 {
  font-size: 1.35rem;
  line-height: 1.2;
}

.summary p:not(.eyebrow) {
  max-width: 700px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.summary-state,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.summary-state {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 96px;
  padding: 20px;
}

.summary-state strong,
.summary-state span {
  display: block;
}

.summary-state strong {
  font-size: 1rem;
}

.summary-state span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.pulse,
.status-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--yellow);
}

.pulse {
  position: relative;
}

.pulse::after {
  position: absolute;
  inset: -7px;
  border: 2px solid currentColor;
  border-radius: 50%;
  color: var(--yellow);
  content: "";
  opacity: 0.18;
}

.summary-state.ok .pulse,
.status-dot.ok {
  background: var(--green);
}

.summary-state.ok .pulse::after {
  color: var(--green);
}

.summary-state.warning .pulse,
.status-dot.warning {
  background: var(--yellow);
}

.summary-state.maintenance .pulse,
.status-dot.maintenance {
  background: var(--blue);
}

.summary-state.maintenance .pulse::after {
  color: var(--blue);
}

.summary-state.error .pulse,
.status-dot.error {
  background: var(--red);
}

.summary-state.error .pulse::after {
  color: var(--red);
}

.status-dot.muted {
  background: #94a3b8;
}

.panel {
  padding: 22px;
}

.panel + .panel {
  margin-top: 18px;
}

.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

time {
  color: var(--muted);
  font-size: 0.9rem;
}

.services {
  display: grid;
  gap: 18px;
}

.service-group {
  display: grid;
  gap: 10px;
}

.service-group-title {
  margin: 2px 0 0;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

.service-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 14px 16px;
  border: 1px solid #e5ebf3;
  border-radius: 8px;
  background: #fbfdff;
}

.service-name {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.service-name strong,
.service-name span {
  display: block;
}

.service-name span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.badge {
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 6px 10px;
  white-space: nowrap;
}

.badge.ok {
  background: var(--green-soft);
  color: #047857;
}

.badge.warning {
  background: var(--yellow-soft);
  color: #854d0e;
}

.badge.maintenance {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge.error {
  background: var(--red-soft);
  color: #991b1b;
}

.service-meta {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.service-note {
  max-width: 210px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-align: right;
}

.loading {
  min-height: 68px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.empty-state,
.maintenance-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  min-height: 72px;
  padding: 14px;
  border-radius: 8px;
  background: #f8fafc;
}

.empty-state {
  display: block;
}

.empty-state strong,
.empty-state span,
.maintenance-item strong,
.maintenance-item span {
  display: block;
}

.empty-state span,
.maintenance-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.maintenance-list {
  display: grid;
  gap: 10px;
}

.slo-list {
  display: grid;
  gap: 10px;
}

.slo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid #e5ebf3;
  border-radius: 8px;
  background: #fbfdff;
}

.slo-copy strong,
.slo-copy span {
  display: block;
}

.slo-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.maintenance-item.active {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: #1e293b;
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 18px;
  }

  nav {
    flex-wrap: wrap;
  }

  main {
    width: min(100% - 28px, 1120px);
    padding-top: 30px;
  }

  .summary,
  .grid {
    grid-template-columns: 1fr;
  }

  .summary-state {
    min-height: 84px;
  }

  .compact {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 2.35rem;
  }

  .panel-head,
  .service-row,
  .slo-row {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .panel-head {
    flex-direction: column;
  }

  .badge {
    width: fit-content;
  }

  .service-meta {
    justify-items: start;
  }

  .service-note {
    max-width: 100%;
    text-align: left;
  }
}
