#activity {
  --activity-request: light-dark(#d71019, #f0454d);
  --activity-response: light-dark(#ec9198, #f3a1a7);
  --activity-center: light-dark(#f3f3f5, #242427);
  --activity-panel-top: light-dark(#ffffffa1, #28282bec);
  --activity-panel-bottom: light-dark(#f3f3f66b, #1e1e20d9);
  --activity-panel-line: light-dark(#bfc0c796, #bcbbbf44);
  --activity-panel-shadow: 0 8px 22px light-dark(#32344313, #00000040),
    inset 0 1px light-dark(#ffffffac, #ffffff0c);
  --activity-meter: light-dark(#71727a, #95959e);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: clamp(670px, 72vw, 860px);
  border-top: 1px solid var(--line);
  background: radial-gradient(ellipse at 51% 47%, var(--activity-center), var(--canvas) 75%);
  text-align: left;
}

#activity .bb-map-backdrop {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

#activity .bb-map-backdrop::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    var(--canvas) 0%,
    color-mix(in srgb, var(--canvas) 70%, transparent) 16%,
    transparent 34% 86%,
    var(--canvas) 100%
  );
  content: "";
}

#activity .bb-map {
  position: absolute;
  top: 55%;
  left: 47.5%;
  display: block;
  width: min(100%, 1470px);
  aspect-ratio: 2.1;
  transform: translate(-50%, -50%);
}

#activity .bb-dash-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(245px, 30%);
  align-items: start;
  gap: 24px;
  width: min(100%, var(--wrap, 1280px));
  margin-inline: auto;
  padding: 66px clamp(16px, 4.7vw, 64px) 32px;
}

#activity .bb-dash-head h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(40px, 5.7vw, 66px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.062em;
}

#activity .bb-dash-head p {
  max-width: 390px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

#activity .bb-rail {
  display: grid;
  gap: 11px;
  min-width: 0;
  margin-top: 124px;
}

#activity .bb-legend-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 16px;
  min-width: 0;
  margin-top: auto;
  padding: 6px 16px 72px;
  color: var(--muted);
  font-size: 12px;
}

#activity .bb-legend {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

#activity .bb-legend::before {
  width: 12px;
  height: 2px;
  border-radius: 2px;
  background: var(--activity-request);
  content: "";
}

#activity .bb-response::before {
  background: var(--activity-response);
}

#activity .gg-panel {
  container-type: inline-size;
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--activity-panel-line);
  border-radius: 12px;
  background: var(--surface);
  background: linear-gradient(145deg, var(--activity-panel-top), var(--activity-panel-bottom));
  box-shadow: var(--activity-panel-shadow);
  backdrop-filter: blur(1px);
}

#activity .gg-panel h3,
#activity .gg-panel h4 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
}

#activity .gg-label,
#activity .gg-perf-block dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

#activity .gg-tokens {
  margin: 8px 0 0;
}

#activity .gg-token-metric {
  display: flex;
  flex-direction: column-reverse;
  gap: 3px;
}

#activity .gg-token-total,
#activity .gg-requests {
  margin: 0;
  color: var(--text);
  font-weight: 650;
  line-height: 1.06;
  letter-spacing: -.052em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#activity .gg-token-total {
  font-size: clamp(24px, 13cqw, 47px);
}

#activity .gg-requests {
  font-size: clamp(21px, 9cqw, 29px);
}

#activity .gg-request-metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

#activity .gg-perf-block {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 9px 0 11px;
}

#activity .gg-perf-block > div + div {
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

#activity .gg-perf-block dd {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#activity .gg-perf-block small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: normal;
}

#activity .gg-rank {
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

#activity .gg-rank ol {
  display: grid;
  gap: 7px;
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
}

#activity .gg-rank li {
  display: grid;
  grid-template-columns: minmax(7.4em, 1.3fr) minmax(26px, .7fr) 3.5ch;
  align-items: center;
  column-gap: 8px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

#activity .gg-percent {
  justify-self: end;
  font-variant-numeric: tabular-nums;
}

#activity .gg-meter {
  height: 4px;
  border-radius: 4px;
  background: var(--line);
}

#activity .gg-meter i {
  display: block;
  width: var(--share);
  height: 100%;
  border-radius: inherit;
  background: var(--activity-meter);
}
#activity .gg-rank li:first-child .gg-meter i { background: var(--activity-request); }

@media (max-width: 700px) {
  #activity {
    display: grid;
    grid-template-areas: "title" "map" "panels" "legend";
    min-height: 0;
  }

  #activity .bb-dash-layout {
    display: contents;
  }

  #activity .bb-dash-head {
    grid-area: title;
    padding: 35px 16px 0;
  }

  #activity .bb-dash-head h2 {
    font-size: clamp(35px, 9vw, 47px);
  }

  #activity .bb-dash-head p {
    margin-top: 6px;
  }

  #activity .bb-map-backdrop {
    position: relative;
    grid-area: map;
    width: min(100%, 550px);
    aspect-ratio: 2.1;
    margin: 6px auto 0;
  }

  #activity .bb-map-backdrop::after {
    opacity: .55;
  }

  #activity .bb-map {
    position: static;
    width: 100%;
    transform: none;
  }

  #activity .bb-rail {
    grid-area: panels;
    width: min(100%, 550px);
    margin: 0 auto;
    padding: 0 16px;
  }

  #activity .bb-legend-row {
    grid-area: legend;
    padding-bottom: 48px;
  }

  #activity .gg-panel {
    padding: 13px 14px;
  }
}
