:root {
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --bg-deep: #f8fafc;
  --bg-gradient: radial-gradient(ellipse 100% 100% at 50% 0%, #ffffff 0%, #f1f5f9 55%, #e2e8f0 100%);
  --bg-card: rgba(255, 255, 255, 0.85);
  --border-card: rgba(226, 232, 240, 0.85);
  --accent: #2563eb;

  --bg-page: var(--bg-deep);
  --bg-surface: var(--bg-card);
  --bg-surface-muted: rgba(241, 245, 249, 0.7);
  --bg-header: rgba(255, 255, 255, 0.72);
  --bg-tooltip: #0f172a;
  --text-tooltip: #f8fafc;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --border-subtle: rgba(148, 163, 184, 0.25);
  --border-strong: #cbd5e1;

  --brand-accent: var(--accent);
  --brand-soft: rgba(37, 99, 235, 0.08);

  --status-up-bg: #dcfce7;
  --status-up-text: #15803d;
  --status-up-border: #bbf7d0;
  --status-up-solid: #10b981;

  --status-deg-bg: #fef3c7;
  --status-deg-text: #b45309;
  --status-deg-border: #fde68a;
  --status-deg-solid: #f59e0b;

  --status-partial-bg: #ffedd5;
  --status-partial-text: #c2410c;
  --status-partial-border: #fed7aa;
  --status-partial-solid: #f97316;

  --status-down-bg: #ffe4e6;
  --status-down-text: #be123c;
  --status-down-border: #fecdd3;
  --status-down-solid: #f43f5e;

  --status-maint-bg: #e0f2fe;
  --status-maint-text: #0369a1;
  --status-maint-border: #bae6fd;
  --status-maint-solid: #0ea5e9;

  --status-unknown-solid: #cbd5e1;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 10px 30px -5px rgba(15, 23, 42, 0.06), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
  --radius-card: 20px;
  --radius-sm: 12px;
}

html[data-theme="dark"] {
  --bg-deep: #0a0815;
  --bg-gradient: radial-gradient(ellipse 100% 100% at 50% 20%, #120e28 0%, #0a0815 65%, #05040a 100%);
  --bg-card: rgba(18, 15, 30, 0.88);
  --border-card: rgba(255, 255, 255, 0.12);
  --accent: #3b82f6;

  --bg-page: var(--bg-deep);
  --bg-surface: var(--bg-card);
  --bg-surface-muted: rgba(255, 255, 255, 0.04);
  --bg-header: rgba(10, 8, 21, 0.72);
  --bg-tooltip: #120e28;
  --text-tooltip: #f8fafc;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --brand-accent: var(--accent);
  --brand-soft: rgba(59, 130, 246, 0.14);

  --status-up-bg: rgba(16, 185, 129, 0.14);
  --status-up-text: #34d399;
  --status-up-border: rgba(16, 185, 129, 0.3);
  --status-up-solid: #10b981;

  --status-deg-bg: rgba(245, 158, 11, 0.14);
  --status-deg-text: #fbbf24;
  --status-deg-border: rgba(245, 158, 11, 0.3);
  --status-deg-solid: #f59e0b;

  --status-partial-bg: rgba(249, 115, 22, 0.14);
  --status-partial-text: #fb923c;
  --status-partial-border: rgba(249, 115, 22, 0.3);
  --status-partial-solid: #f97316;

  --status-down-bg: rgba(244, 63, 94, 0.15);
  --status-down-text: #fb7185;
  --status-down-border: rgba(244, 63, 94, 0.32);
  --status-down-solid: #f43f5e;

  --status-maint-bg: rgba(14, 165, 233, 0.15);
  --status-maint-text: #38bdf8;
  --status-maint-border: rgba(14, 165, 233, 0.32);
  --status-maint-solid: #0ea5e9;

  --status-unknown-solid: #334155;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 20px 50px rgba(0, 0, 0, 0.6), 0 4px 16px rgba(0, 0, 0, 0.4);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

/* Adaptive Topographic Waves Background */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--bg-gradient);
}

.topography-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.25;
  transition: opacity 0.3s ease;
}

html[data-theme="dark"] .topography-canvas {
  opacity: 0.85;
}

.num-tabular {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.mono {
  font-family: var(--font-mono);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand-accent);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-logo-light {
  display: block;
  height: 28px;
  width: auto;
}

.brand-logo-dark {
  display: none;
  height: 28px;
  width: auto;
}

html[data-theme="dark"] .brand-logo-light {
  display: none;
}

html[data-theme="dark"] .brand-logo-dark {
  display: block;
}

.brand-divider {
  width: 1px;
  height: 20px;
  background: var(--border-strong);
}

.brand-pill {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-accent);
  border: 1px solid var(--border-subtle);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: var(--bg-surface-muted);
  color: var(--text-primary);
}

.control-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 32px;
  padding: 0 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.control-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--bg-surface-muted);
}

.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.mode-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--status-up-solid);
}

.mode-dot-failover {
  background: var(--status-deg-solid);
}

/* Main Content */
.main-content {
  position: relative;
  z-index: 1;
  padding: 1.75rem 0 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Catastrophe Banner */
.catastrophe-banner {
  border-radius: var(--radius-card);
  padding: 1rem 1.25rem;
  border: 1px solid var(--status-down-border);
  background: var(--status-down-bg);
  color: var(--status-down-text);
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.catastrophe-banner.severity-warning {
  border-color: var(--status-deg-border);
  background: var(--status-deg-bg);
  color: var(--status-deg-text);
}

.catastrophe-banner h2 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
}

.catastrophe-banner p {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  opacity: 0.95;
}

/* Glass Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.hero-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-status-row {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 0.48rem;
  flex-shrink: 0;
}

.dot-operational { background: var(--status-up-solid); }
.dot-degraded { background: var(--status-deg-solid); }
.dot-partial_outage { background: var(--status-partial-solid); }
.dot-major_outage { background: var(--status-down-solid); }
.dot-maintenance { background: var(--status-maint-solid); }

.hero-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero-subtitle {
  margin: 0.3rem 0 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.kpi-box {
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.55rem;
  min-height: 112px;
}

.kpi-head {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.kpi-value {
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: 1.24rem;
  font-weight: 700;
  color: var(--text-primary);
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.35rem;
  font-weight: 500;
}

/* Status Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}

.status-operational {
  background: var(--status-up-bg);
  color: var(--status-up-text);
  border-color: var(--status-up-border);
}

.status-degraded {
  background: var(--status-deg-bg);
  color: var(--status-deg-text);
  border-color: var(--status-deg-border);
}

.status-partial_outage {
  background: var(--status-partial-bg);
  color: var(--status-partial-text);
  border-color: var(--status-partial-border);
}

.status-major_outage {
  background: var(--status-down-bg);
  color: var(--status-down-text);
  border-color: var(--status-down-border);
}

.status-maintenance {
  background: var(--status-maint-bg);
  color: var(--status-maint-text);
  border-color: var(--status-maint-border);
}

/* Section Headers */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.section-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* Window Tabs */
.window-tabs {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  gap: 2px;
}

.window-tab {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.window-tab.active,
.window-tab[aria-selected="true"] {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Service Matrix */
.groups-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.group-card {
  overflow: hidden;
}

.group-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-surface-muted);
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.group-title {
  font-size: 0.96rem;
  font-weight: 700;
  margin: 0;
}

.group-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0.15rem 0 0;
}

.service-list {
  display: flex;
  flex-direction: column;
}

.service-row {
  padding: 0.95rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.service-row:first-child {
  border-top: 0;
}

.service-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.service-identity {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 220px;
  flex: 1;
}

.service-name-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.service-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.service-desc {
  font-size: 0.79rem;
  color: var(--text-muted);
}

.service-metrics {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.metric-chip {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.uptime-bars-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.uptime-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  height: 24px;
  align-items: stretch;
}

.uptime-bar {
  border-radius: 3px;
  background: var(--status-unknown-solid);
  transition: transform 0.12s ease, opacity 0.12s ease;
  cursor: pointer;
  min-width: 4px;
}

.uptime-bar:hover,
.uptime-bar:focus-visible {
  transform: scaleY(1.16);
  outline: 2px solid var(--brand-accent);
  outline-offset: 1px;
}

.uptime-bar.bar-up { background: var(--status-up-solid); }
.uptime-bar.bar-degraded { background: var(--status-deg-solid); }
.uptime-bar.bar-down { background: var(--status-down-solid); }
.uptime-bar.bar-maintenance { background: var(--status-maint-solid); }
.uptime-bar.bar-unknown { background: var(--status-unknown-solid); opacity: 0.55; }

.uptime-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.71rem;
  color: var(--text-muted);
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 0.65rem 1rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.65rem;
  padding-inline: 0.25rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

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

/* Telemetry & Infra Grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.panel-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.panel-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.mini-stat {
  background: var(--bg-surface-muted);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-subtle);
}

.mini-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.mini-stat-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0.15rem;
}

.chart-box {
  width: 100%;
  overflow: hidden;
}

.chart-box svg text.num-tabular {
  font-family: var(--font-mono);
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.list-rows {
  display: flex;
  flex-direction: column;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.84rem;
}

.list-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.list-row:last-child {
  padding-bottom: 0;
}

.pop-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.pop-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 8px;
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

/* Incidents & History */
.incident-card {
  padding: 1.15rem 1.25rem;
  border-left: 4px solid var(--status-deg-solid);
}

.incident-card.impact-critical,
.incident-card.impact-major {
  border-left-color: var(--status-down-solid);
}

.incident-card.phase-resolved {
  border-left-color: var(--status-up-solid);
}

.incident-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.incident-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
}

.incident-updates {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.update-item {
  font-size: 0.85rem;
}

.update-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

/* API / Feed Bar */
.endpoints-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.endpoint-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.8rem;
}

.endpoint-card:hover {
  border-color: var(--border-strong);
}

.endpoint-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.endpoint-name {
  font-weight: 600;
}

.endpoint-path {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Floating Tooltip */
.floating-tooltip {
  position: fixed;
  z-index: 90;
  pointer-events: none;
  background: var(--bg-tooltip);
  color: var(--text-tooltip);
  font-size: 0.74rem;
  line-height: 1.35;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  max-width: 260px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.1s ease, transform 0.1s ease;
}

.floating-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Notice banner for delayed polling */
.poll-notice {
  display: none;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  background: var(--status-deg-bg);
  color: var(--status-deg-text);
  border: 1px solid var(--status-deg-border);
  font-size: 0.82rem;
  font-weight: 500;
}

.poll-notice.visible {
  display: block;
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-subtle);
  padding: 2rem 0 2.5rem;
  margin-top: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.is-hidden {
  display: none !important;
}

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

@media (max-width: 600px) {
  .kpi-strip {
    grid-template-columns: 1fr;
  }
  .mini-stats {
    grid-template-columns: 1fr;
  }
  .endpoints-grid {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 1.3rem;
  }
}

@media print {
  .page-bg,
  .site-header .header-actions,
  .window-tabs,
  .control-btn,
  .floating-tooltip {
    display: none !important;
  }
  .card {
    box-shadow: none;
    break-inside: avoid;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   Charts & Restrained Motion
   ========================================================================== */

.hero-main {
  flex: 1 1 340px;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-width: 0;
}

.hero-viz {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.refresh-countdown {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
}

.refresh-ring-progress {
  transition: stroke-dashoffset 0.35s linear;
}

/* Radial Uptime Gauge */
.gauge-wrap {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.gauge-svg-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.gauge-center-value {
  font-family: var(--font-mono);
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.gauge-center-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.12rem;
}

.gauge-legend {
  display: flex;
  flex-direction: column;
  gap: 0.36rem;
  font-size: 0.75rem;
}

.gauge-legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.gauge-legend-name {
  min-width: 1.85rem;
  color: var(--text-muted);
}

.gauge-meter-track {
  display: block;
  width: 54px;
  height: 4px;
  border-radius: 999px;
  background: var(--border-subtle);
  overflow: hidden;
  flex-shrink: 0;
}

.gauge-meter-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.gauge-legend-item strong {
  font-family: var(--font-mono);
  min-width: 3.7rem;
  text-align: right;
}

/* Hero KPI Micro-Visualizations */
.kpi-viz-slot {
  height: 36px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
}

.kpi-spark {
  display: block;
  width: 100%;
  margin-top: 0;
}

.spark-hit {
  fill: transparent;
  cursor: pointer;
}

.spark-hit:hover,
.spark-hit:focus-visible {
  fill: var(--brand-accent);
  fill-opacity: 0.09;
  outline: none;
}

.kpi-micro-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.67rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1;
}

.kpi-seg-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  height: 12px;
  align-items: stretch;
  width: 100%;
}

.kpi-seg {
  border-radius: 3px;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.kpi-seg:hover,
.kpi-seg:focus-visible {
  transform: scaleY(1.22);
  outline: 1px solid var(--brand-accent);
  outline-offset: 1px;
}

.seg-operational { background: var(--status-up-solid); opacity: 0.88; }
.seg-degraded { background: var(--status-deg-solid); }
.seg-partial_outage { background: var(--status-partial-solid); }
.seg-major_outage { background: var(--status-down-solid); }
.seg-maintenance { background: var(--status-maint-solid); }

.kpi-uptime-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  height: 20px;
  align-items: end;
  width: 100%;
}

.kpi-day-bar {
  border-radius: 2px 2px 1px 1px;
  cursor: pointer;
  min-height: 4px;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.kpi-day-bar:hover,
.kpi-day-bar:focus-visible {
  filter: brightness(1.18);
  outline: 1px solid var(--brand-accent);
  outline-offset: 1px;
}

.kpi-day-bar.bar-up { background: var(--status-up-solid); opacity: 0.9; }
.kpi-day-bar.bar-degraded { background: var(--status-deg-solid); }
.kpi-day-bar.bar-down { background: var(--status-down-solid); }
.kpi-day-bar.bar-unknown { background: var(--status-unknown-solid); opacity: 0.45; }

.kpi-inc-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  height: 18px;
  align-items: end;
  width: 100%;
}

.kpi-inc-tick {
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.kpi-inc-tick:hover,
.kpi-inc-tick:focus-visible {
  transform: scaleY(1.25);
  outline: 1px solid var(--brand-accent);
  outline-offset: 1px;
}

.kpi-inc-tick.tick-clear {
  height: 5px;
  background: var(--status-up-solid);
  opacity: 0.42;
}

.kpi-inc-tick.tick-minor {
  height: 12px;
  background: var(--status-deg-solid);
}

.kpi-inc-tick.tick-major {
  height: 15px;
  background: var(--status-partial-solid);
}

.kpi-inc-tick.tick-critical {
  height: 18px;
  background: var(--status-down-solid);
}

.mini-stats-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-stats-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Service Latency Horizontal Bars */
.lat-bars {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lat-row {
  display: grid;
  grid-template-columns: minmax(115px, 165px) 1fr auto;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.77rem;
  cursor: pointer;
  padding: 0.16rem 0.3rem;
  margin: 0 -0.3rem;
  border-radius: 6px;
  transition: background-color 0.12s ease;
}

.lat-row:hover {
  background: var(--bg-surface-muted);
}

.lat-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.71rem;
  color: var(--text-muted);
}

.lat-legend-items {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}

.lat-legend-scale {
  font-family: var(--font-mono);
}

/* Telemetry Chart Hover States */
.chart-col {
  cursor: pointer;
}

.chart-col-hover {
  fill: var(--brand-accent);
  fill-opacity: 0;
  transition: fill-opacity 0.12s ease;
}

.chart-col:hover .chart-col-hover,
.chart-col:focus .chart-col-hover {
  fill-opacity: 0.08;
}

.chart-col:hover .chart-bar,
.chart-col:focus .chart-bar {
  filter: brightness(1.14);
}

.chart-col:focus,
.chart-pt:focus {
  outline: none;
}

.chart-pt {
  cursor: pointer;
}

.chart-hover-guide {
  stroke: var(--border-strong);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.chart-hover-dot {
  opacity: 0;
  transition: opacity 0.12s ease;
}

.chart-pt:hover .chart-hover-guide,
.chart-pt:focus .chart-hover-guide,
.chart-pt:hover .chart-hover-dot,
.chart-pt:focus .chart-hover-dot {
  opacity: 1;
}

.lat-row:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.lat-name {
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lat-bar-track {
  position: relative;
  height: 9px;
  border-radius: 999px;
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.lat-bar-p95,
.lat-bar-p50 {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 999px;
}

.lat-bar-p95 {
  background: var(--status-deg-solid);
  opacity: 0.28;
}

.lat-bar-p50 {
  opacity: 0.9;
}

.lat-val {
  min-width: 52px;
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
}

/* 30-Day Cross-Service Availability Heatmap */
.heatmap-wrap {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.heatmap-grid {
  display: grid;
  gap: 4px 3px;
  align-items: center;
  min-width: 560px;
}

.heatmap-head-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.heatmap-head-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.71rem;
  color: var(--text-muted);
  padding-bottom: 0.15rem;
}

.heatmap-row-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 0.4rem;
}

.heat-cell {
  height: 16px;
  border-radius: 3px;
  background: var(--status-unknown-solid);
  cursor: pointer;
  transition: opacity 0.12s ease;
}

.heat-cell:hover,
.heat-cell:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 1px;
  z-index: 2;
}

.heat-up { background: var(--status-up-solid); }
.heat-degraded { background: var(--status-deg-solid); }
.heat-down { background: var(--status-down-solid); }
.heat-maintenance { background: var(--status-maint-solid); }
.heat-unknown { background: var(--status-unknown-solid); opacity: 0.45; }

/* Edge Security Mitigation Breakdown */
.mitigation-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.mitigation-bar {
  display: flex;
  height: 10px;
  width: 100%;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  gap: 1px;
}

.mitigation-seg {
  display: block;
  height: 100%;
  cursor: pointer;
}

.seg-blocked { background: var(--status-down-solid); }
.seg-challenged { background: var(--status-deg-solid); }
.seg-allowed { background: var(--status-up-solid); opacity: 0.42; }

/* Region Inline Latency Bar */
.region-lat-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.region-lat-track {
  display: inline-block;
  width: 52px;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.region-lat-bar {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--status-up-solid);
}

/* Animations (Restrained & Motion-Safe Only) */
@media (prefers-reduced-motion: no-preference) {
  .chart-bar {
    transform-box: fill-box;
    transform-origin: bottom;
    animation: barGrow 500ms cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
    animation-delay: calc(var(--i, 0) * 10ms);
  }

  @keyframes barGrow {
    from { transform: scaleY(0.06); opacity: 0.35; }
  }

  .chart-line-draw {
    stroke-dasharray: 1;
    animation: lineDraw 900ms ease-out both;
  }

  .chart-line-slow {
    animation-duration: 1100ms;
  }

  @keyframes lineDraw {
    from { stroke-dashoffset: 1; }
    to { stroke-dashoffset: 0; }
  }

  .chart-area-fade {
    animation: areaFade 600ms ease-out backwards;
  }

  @keyframes areaFade {
    from { opacity: 0; }
  }

  .gauge-ring-value {
    animation: ringFill 600ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  @keyframes ringFill {
    from { stroke-dasharray: 0 100; }
  }

  .lat-bar-p50,
  .lat-bar-p95,
  .mitigation-seg,
  .region-lat-bar {
    transform-origin: left;
    animation: barGrowX 500ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: calc(var(--i, 0) * 10ms);
  }

  @keyframes barGrowX {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
  }

  html.js-anim .reveal {
    transition: opacity 0.3s ease;
  }

  html.js-anim .reveal:not(.is-visible) {
    opacity: 0;
  }

  html.js-anim .reveal:not(.is-visible) * {
    animation-play-state: paused !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal {
    opacity: 1 !important;
  }
}

@media (max-width: 900px) {
  .mini-stats-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero-viz {
    width: 100%;
    padding-top: 0.25rem;
  }
}

@media (max-width: 600px) {
  .lat-row {
    grid-template-columns: minmax(95px, 125px) 1fr auto;
    gap: 0.45rem;
  }
  .gauge-wrap {
    gap: 0.7rem;
  }
}
