:root {
  --primary: #1e6cff;
  --primary-dark: #0f4fcf;
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --text: #313131;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --green: #2ea86e;
  --green-bg: #eaf5ef;
  --yellow: #f59e0b;
  --yellow-bg: #fef3c7;
  --red: #ef4444;
  --red-bg: #fee2e2;
  --gray: #9ca3af;
  --gray-bg: #f3f4f6;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --radius: 16px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

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

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

.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--bg);
  padding: 16px 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-flex; }
.brand-name { font-weight: 700; font-size: 22px; letter-spacing: -0.01em; }
.top-nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.btn-contact {
  background: var(--gray-bg);
  color: var(--text) !important;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.2s;
}
.btn-contact:hover { background: #e5e7eb; text-decoration: none; }

/* Overall banner (Ziwo Style) */
.overall-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  background: var(--card-bg);
  border-radius: 24px;
  padding: 48px 24px;
  margin: 20px 0 32px;
}
.overall-banner.operational { background: var(--green-bg); color: var(--green); }
.overall-banner.partial-outage { background: var(--yellow-bg); color: var(--yellow); }
.overall-banner.major-outage { background: var(--red-bg); color: var(--red); }

.overall-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  font-size: 32px;
}
.overall-banner.partial-outage .overall-icon { background: var(--yellow); }
.overall-banner.major-outage .overall-icon { background: var(--red); }
.overall-banner.loading .overall-icon { background: var(--gray); }

.overall-text h1 { margin: 0 0 8px; font-size: 32px; font-weight: 600; letter-spacing: -0.02em; }
.overall-text p { margin: 0; font-size: 16px; opacity: 0.8; max-width: 600px; }
.overall-text a { color: inherit; font-weight: 500; text-decoration: underline; opacity: 0.9; display: inline-block; margin-top: 16px; }

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Sections */
.section-title { font-size: 18px; font-weight: 600; margin: 0; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 32px 0 16px;
  padding-bottom: 12px;
}
.history-range { font-size: 14px; color: var(--text-muted); }

/* Legend */
.legend {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.operational { background: var(--green); }
.dot.degraded { background: var(--yellow); }
.dot.outage { background: var(--red); }
.dot.unknown { background: var(--gray); }

/* Service Box (Ziwo Style) */
.services-list {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.service-row {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.service-row:last-child { border-bottom: none; }
.service-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.service-meta { display: flex; align-items: center; gap: 12px; }
.service-label { font-weight: 600; font-size: 15px; color: var(--text); }
.service-right { display: flex; align-items: center; gap: 16px; }

.status-badge {
  font-size: 14px;
  font-weight: 500;
}
.status-badge.operational { color: var(--green); }
.status-badge.degraded { color: var(--yellow); }
.status-badge.outage { color: var(--red); }
.status-badge.unknown { color: var(--text-muted); }

.latency-chip { font-size: 13px; color: var(--text-muted); }

/* Uptime bars */
.uptime-bars-wrapper { margin-top: 12px; }
.uptime-bars {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 32px;
}
.uptime-bar {
  flex: 1;
  min-width: 2px;
  height: 100%;
  border-radius: 2px;
  background: var(--green);
  position: relative;
  cursor: pointer;
}
.uptime-bar:hover { opacity: 0.8; }
.uptime-bar.degraded { background: var(--yellow); }
.uptime-bar.outage { background: var(--red); }
.uptime-bar.unknown { background: var(--border); }

/* Accordions (Ziwo Style) */
.category-accordion {
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
}
.category-accordion:last-child {
  border-bottom: none;
}
.category-accordion summary {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  transition: background 0.2s;
}
.category-accordion summary::-webkit-details-marker {
  display: none;
}
.category-accordion summary:hover {
  background: var(--gray-bg);
}
.category-title {
  font-size: 16px;
  color: var(--text);
  flex: 1;
}
.category-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-right: 16px;
  font-weight: 500;
}
.chevron {
  transition: transform 0.2s ease;
  color: var(--gray);
}
.category-accordion[open] .chevron {
  transform: rotate(180deg);
}
.category-content {
  border-top: 1px solid var(--border);
  background: #fdfdfd;
}
.category-content .service-row {
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
}
.category-content .service-row:last-child {
  border-bottom: none;
}

/* Cloud providers */
.cloud-providers-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.cloud-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cloud-card .provider-name { font-weight: 600; font-size: 14px; }

/* Latency chart */
.chart-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  height: 280px;
  box-shadow: var(--shadow);
}
.service-select {
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}

/* Incidents */
.incidents-list { display: flex; flex-direction: column; gap: 10px; }
.incident-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.incident-item.outage { border-left-color: var(--red); }
.incident-date { font-weight: 600; font-size: 14px; }
.incident-service { font-size: 12px; color: var(--text-muted); }
.muted { color: var(--text-muted); font-size: 14px; }

/* Backend warning */
.backend-warning {
  background: var(--red-bg);
  color: #c0392b;
  border: 1px solid var(--red);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* Footer */
.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Skeletons */
.skeleton .skeleton-line,
.skeleton .skeleton-bars {
  background: linear-gradient(90deg, var(--gray-bg) 25%, var(--border) 37%, var(--gray-bg) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px;
}
.skeleton-line { height: 14px; margin: 8px 0; }
.skeleton-bars { height: 36px; margin-top: 14px; }
.w-40 { width: 40%; }
.w-60 { width: 60%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.hidden { display: none !important; }

/* Responsive */
@media (max-width: 640px) {
  .service-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .service-right { width: 100%; justify-content: space-between; }
  .footer-inner { flex-direction: column; gap: 6px; justify-content: center; height: auto; padding: 12px 0; }
  .uptime-bars { gap: 2px; }
}