* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --green: #22c55e;
  --green-bg: #f0fdf4;
  --green-border: #bbf7d0;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --red-border: #fecaca;
  --gray: #9ca3af;
  --gray-light: #f3f4f6;
  --gray-border: #e5e7eb;
  --text: #111827;
  --text-secondary: #6b7280;
  --bg: #ffffff;
  --surface: #ffffff;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--gray-light);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px;
}

header {
  text-align: center;
  margin-bottom: 32px;
}

header h1 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 4px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

.subtitle code {
  background: var(--gray-border);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.status-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid;
  transition: all 0.3s ease;
}

.status-banner.up {
  background: var(--green-bg);
  border-color: var(--green-border);
}

.status-banner.down {
  background: var(--red-bg);
  border-color: var(--red-border);
}

.status-banner.loading {
  background: var(--gray-light);
  border-color: var(--gray-border);
}

.status-icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-banner.up .status-icon {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.status-banner.down .status-icon {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
}

.status-banner.loading .status-icon {
  background: var(--gray);
}

.status-text {
  display: flex;
  flex-direction: column;
}

#status-label {
  font-size: 18px;
  font-weight: 600;
}

.status-detail {
  font-size: 13px;
  color: var(--text-secondary);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.metric-value {
  display: block;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.metric-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.history-section {
  background: var(--surface);
  border: 1px solid var(--gray-border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
}

.history-section h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.history-timeline {
  display: flex;
  gap: 3px;
  height: 32px;
  align-items: stretch;
  margin-bottom: 12px;
}

.history-bar {
  flex: 1;
  border-radius: 3px;
  min-width: 0;
  cursor: pointer;
  position: relative;
  transition: opacity 0.15s;
}

.history-bar:hover {
  opacity: 0.8;
}

.history-bar.up { background: var(--green); }
.history-bar.down { background: var(--red); }
.history-bar.partial { background: linear-gradient(to top, var(--red) 0%, var(--red) var(--down-pct), var(--green) var(--down-pct), var(--green) 100%); }
.history-bar.none { background: var(--gray-border); }

.history-bar .tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}

.history-bar:hover .tooltip {
  display: block;
}

.history-loading {
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
  padding: 8px;
}

.history-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.legend-dot.up { background: var(--green); }
.legend-dot.down { background: var(--red); }
.legend-dot.none { background: var(--gray-border); }

footer {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

@media (max-width: 480px) {
  .container { padding: 24px 16px; }
  .metrics { grid-template-columns: 1fr; }
  .history-legend { flex-direction: column; align-items: center; }
}
