:root {
  --bg: #080a0f;
  --panel: rgba(17, 21, 31, 0.78);
  --panel-strong: rgba(21, 26, 38, 0.94);
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #f6f7fb;
  --muted: #8f98aa;
  --accent: #8ba8ff;
  --accent-2: #a997ff;
  --shadow: 0 22px 65px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 10%, rgba(80, 105, 255, 0.14), transparent 31rem),
    radial-gradient(circle at 82% 18%, rgba(155, 102, 255, 0.10), transparent 29rem),
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: auto, auto, 42px 42px, 42px 42px;
  mask-image: linear-gradient(to bottom, black 0%, rgba(0, 0, 0, 0.65) 70%, transparent 100%);
}

.shell {
  position: relative;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 42px 0 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
  letter-spacing: -0.045em;
  font-weight: 760;
}

.refresh-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #79e59a;
  box-shadow: 0 0 0 6px rgba(121, 229, 154, 0.08), 0 0 24px rgba(121, 229, 154, 0.35);
  transition: transform 180ms ease, opacity 180ms ease;
}

.refresh-dot.loading {
  transform: scale(0.72);
  opacity: 0.48;
}

.hidden {
  display: none !important;
}

.status-panel {
  display: grid;
  place-items: center;
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 16px;
  text-align: center;
  padding: 28px;
  backdrop-filter: blur(18px);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.metric-card,
.chart-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(24, 29, 42, 0.93), rgba(13, 17, 25, 0.88));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.metric-card::before,
.chart-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(155, 174, 255, 0.6), transparent);
  opacity: 0.55;
}

.metric-card {
  min-height: 116px;
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-label,
.chart-heading {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.metric-value {
  display: block;
  margin-top: 16px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  font-weight: 710;
  white-space: nowrap;
}

.metric-value.compact {
  font-size: clamp(19px, 2.3vw, 28px);
}

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

.chart-card {
  border-radius: 20px;
  min-height: 300px;
  padding: 18px 18px 12px;
}

.chart-heading {
  margin: 2px 0 12px 2px;
}

canvas {
  display: block;
  width: 100%;
  height: 245px;
}

@media (max-width: 930px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .step-card {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 24px, 1180px);
    padding-top: 28px;
  }

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

  .chart-card {
    min-height: 280px;
  }

  canvas {
    height: 225px;
  }
}

@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .step-card {
    grid-column: auto;
  }

  .metric-card {
    min-height: 104px;
  }
}
