:root {
  --bg-deep: #0a0e1a;
  --bg-surface: #111728;
  --bg-elevated: #161d33;
  --bg-elevated-2: #1a2342;

  --accent: #4f7df5;
  --accent-2: #22d3a7;
  --accent-glow: rgba(79, 125, 245, 0.35);

  --text-primary: #e8ecf4;
  --text-secondary: #8a93ad;
  --text-dim: #5b6480;

  --border: rgba(140, 160, 220, 0.10);
  --border-strong: rgba(140, 160, 220, 0.18);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-lg: 0 24px 60px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 0 1px rgba(79,125,245,0.35), 0 8px 28px rgba(79,125,245,0.25);

  /* Status colors */
  --state-operational: #22d3a7;
  --state-degraded: #f5b54f;
  --state-outage: #f5556c;
  --state-maintenance: #4f7df5;
}

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

html, body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body {
  background:
    radial-gradient(900px 500px at 90% -5%, rgba(79,125,245,0.08), transparent 60%),
    radial-gradient(700px 500px at -5% 30%, rgba(34,211,167,0.05), transparent 60%),
    var(--bg-deep);
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 80px 32px 120px;
}

/* ---------- Header ---------- */
.header { margin-bottom: 56px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.4px;
  margin-bottom: 24px;
}

.eyebrow-icon {
  color: var(--accent);
  font-weight: 700;
}

.header h1 {
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #ffffff 0%, #b8c2d9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}

.header p {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 560px;
}

/* ---------- Legend table ---------- */
.legend {
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: 40px;
}

.legend-row {
  display: grid;
  grid-template-columns: 88px 1fr 140px;
  gap: 24px;
  align-items: center;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border);
  position: relative;
  transition: background 0.2s ease;
}

.legend-row:last-child { border-bottom: none; }

.legend-row:hover {
  background: rgba(79,125,245,0.03);
}

/* Marker (number + vertical bar instead of dot) */
.legend-marker {
  display: flex;
  align-items: center;
  gap: 14px;
}

.marker-bar {
  width: 4px;
  height: 36px;
  border-radius: 2px;
  background: var(--text-dim);
}

.marker-code {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
}

.legend-row[data-state="operational"] .marker-bar {
  background: var(--state-operational);
  box-shadow: 0 0 14px rgba(34,211,167,0.45);
}
.legend-row[data-state="degraded"] .marker-bar {
  background: var(--state-degraded);
  box-shadow: 0 0 14px rgba(245,181,79,0.40);
}
.legend-row[data-state="outage"] .marker-bar {
  background: var(--state-outage);
  box-shadow: 0 0 14px rgba(245,85,108,0.45);
}
.legend-row[data-state="maintenance"] .marker-bar {
  background: var(--state-maintenance);
  box-shadow: 0 0 14px rgba(79,125,245,0.45);
}

/* Main content */
.legend-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.legend-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.legend-head h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.legend-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* State chip */
.state-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.state-operational {
  color: var(--state-operational);
  background: rgba(34,211,167,0.10);
  border: 1px solid rgba(34,211,167,0.28);
}
.state-degraded {
  color: var(--state-degraded);
  background: rgba(245,181,79,0.10);
  border: 1px solid rgba(245,181,79,0.28);
}
.state-outage {
  color: var(--state-outage);
  background: rgba(245,85,108,0.10);
  border: 1px solid rgba(245,85,108,0.28);
}
.state-maintenance {
  color: var(--state-maintenance);
  background: rgba(79,125,245,0.10);
  border: 1px solid rgba(79,125,245,0.28);
}

/* Meta */
.legend-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding: 10px 14px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 110px;
}

.meta-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.meta-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* ---------- Footnotes ---------- */
.footnotes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.note {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  border-left-width: 3px;
}

.note-info { border-left-color: var(--accent); }
.note-warn { border-left-color: var(--state-degraded); }

.note-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  font-family: Georgia, serif;
  font-style: italic;
  border-radius: var(--radius-sm);
}

.note-info .note-icon {
  color: var(--accent);
  background: rgba(79,125,245,0.10);
  border: 1px solid rgba(79,125,245,0.28);
}

.note-warn .note-icon {
  color: var(--state-degraded);
  background: rgba(245,181,79,0.10);
  border: 1px solid rgba(245,181,79,0.28);
  font-style: normal;
  font-family: inherit;
}

.note-body { display: flex; flex-direction: column; gap: 4px; }

.note-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-primary);
}

.note-body p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .container { padding: 56px 20px 80px; }
  .header h1 { font-size: 34px; }

  .legend-row {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 20px;
  }

  .legend-marker { gap: 12px; }
  .marker-bar { height: 28px; }

  .legend-meta {
    align-items: flex-start;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }

  .footnotes { grid-template-columns: 1fr; }
}
