.rg-surface {
  --rg-mint: #70c7ba;
  position: absolute;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  touch-action: pan-y;
  cursor: grab;
  color: #b8d8d9;
  background:
    linear-gradient(180deg, #071018 0, transparent 22%, transparent 74%, #071118 100%),
    radial-gradient(ellipse at 82% 46%, #153739b3 0, transparent 61%),
    radial-gradient(ellipse at 28% 54%, #142647a3 0, transparent 66%),
    linear-gradient(#43687d24 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, #43687d24 1px, transparent 1px) 0 0 / 44px 44px,
    #09151f;
  -webkit-tap-highlight-color: transparent;
}
.rg-surface[hidden] { display: none !important; }
.rg-surface::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  box-shadow: inset 0 -60px 54px -52px #02080c, inset 20px 0 25px -27px #02080c;
}
.rg-surface.rg-dragging { cursor: grabbing; }
.rg-chart { display: block; width: 100%; height: 100%; overflow: hidden; user-select: none; }
.rg-axis, .rg-edge, .rg-rails, .rg-head-layer, .rg-link-pulses { pointer-events: none; }
.rg-rails line { stroke: #7495b7; stroke-opacity: .12; stroke-width: 1; stroke-dasharray: 2 6; }
.rg-rails line:nth-child(3) { stroke-opacity: .22; stroke-dasharray: none; }
.rg-head-guide { stroke: #8bded4; stroke-opacity: .48; stroke-width: 1; stroke-dasharray: 3 6; }
.rg-tick line { stroke: #6699ac; stroke-opacity: .24; stroke-width: .8; stroke-dasharray: 2 6; }
.rg-axis text, .rg-tooltip, .rg-head-time {
  font-family: var(--mono, "IBM Plex Mono", monospace);
  font-variant-numeric: tabular-nums;
}
.rg-tick-time { fill: #b1cad7; font-size: 11px; }
.rg-tick-height { fill: #8ea7b8; font-size: 9px; letter-spacing: .2px; }

.rg-edge { fill: none; stroke: #7898b6; stroke-width: .8; stroke-opacity: .22; }
.rg-edge[data-recency=recent] { stroke: #8eb5ce; stroke-width: .9; stroke-opacity: .40; }
.rg-edge[data-recency=head] { stroke: #9bc8d8; stroke-width: 1.04; stroke-opacity: .57; }
.rg-edge[data-role=primary] { stroke: #8aabd4; stroke-width: 1.25; stroke-opacity: .45; }
.rg-edge[data-role=primary][data-recency=head] { stroke: #b6d5ed; stroke-width: 1.6; stroke-opacity: .78; }
.rg-edge[data-role=chain] { stroke: var(--rg-mint); stroke-width: 2.15; stroke-opacity: .78; }
.rg-edge[data-role=chain][data-recency=recent] { stroke: #91e5d7; stroke-width: 2.5; stroke-opacity: .90; }
.rg-edge[data-role=chain][data-recency=head] { stroke: #bcfaed; stroke-width: 2.9; stroke-opacity: 1; }
.rg-edge[data-focused=true], .rg-hovering .rg-edge.rg-neighbor { stroke: #b5d9ed; stroke-width: 2; stroke-opacity: 1; }
.rg-edge[data-role=chain][data-focused=true], .rg-hovering .rg-edge[data-role=chain].rg-neighbor { stroke: #c5fcef; stroke-width: 3.4; }
.rg-hovering .rg-edge:not(.rg-neighbor) { stroke-opacity: .09; }
.rg-hovering .rg-edge[data-role=chain]:not(.rg-neighbor) { stroke-opacity: .31; }
.rg-link-pulse {
  fill: none;
  stroke: #c5fcef;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-dasharray: .13 1.12;
  animation: rg-link-arrive .51s ease-out both;
}
.rg-hovering .rg-link-pulses { opacity: .25; }
@keyframes rg-link-arrive {
  from { stroke-dashoffset: .13; opacity: .9; }
  75% { opacity: .85; }
  to { stroke-dashoffset: -1; opacity: 0; }
}

.rg-node { outline: none; cursor: pointer; }
.rg-hit { fill: transparent; }
.rg-art { pointer-events: none; }
.rg-node[data-recency=history] .rg-art { opacity: .72; }
.rg-node[data-recency=recent] .rg-art { opacity: .91; }
.rg-cube-aura { opacity: var(--rg-aura-opacity, .5); }
.rg-node[data-recency=history] { --rg-aura-opacity: .35; }
.rg-node[data-recency=recent] { --rg-aura-opacity: .74; }
.rg-node[data-recency=head] { --rg-aura-opacity: 1; }
.rg-ring { fill: none; stroke: #e3eef3; stroke-dasharray: 2.1 2.2; stroke-width: 1.25; opacity: 0; }
.rg-node:is(:focus-visible, :hover, [aria-pressed=true]) .rg-art { opacity: 1; }
.rg-node:is(:focus-visible, :hover, [aria-pressed=true]) .rg-ring { opacity: 1; }
.rg-node[aria-pressed=true] .rg-ring { stroke: #ffe1a0; stroke-dasharray: none; }
.rg-wave { fill: none; stroke-width: 1.2; opacity: 0; }
.rg-arrival .rg-wave { animation: rg-arrive .58s cubic-bezier(.15, .62, .36, 1) both; }
@keyframes rg-arrive {
  from { opacity: .82; transform: scale(.94); }
  to { opacity: 0; transform: scale(1.78); }
}

.rg-readout {
  position: absolute;
  z-index: 2;
  inset: 14px 17px auto;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}
.rg-readout[hidden] { display: none; }
.rg-recency-key, .rg-head-readout {
  display: flex;
  min-height: 43px;
  align-items: center;
  gap: 9px;
  padding: 6px 11px;
  border: 1px solid #365763;
  border-radius: 6px;
  background: #0a1925e8;
}
.rg-recency-key div, .rg-head-readout {
  flex-direction: column;
  justify-content: center;
  line-height: 1.25;
}
.rg-recency-key div { display: flex; }
.rg-recency-key span { color: #e3f1f2; font-size: 13px; font-weight: 560; }
.rg-recency-key small, .rg-head-readout > span { color: #9fb9c6; font-size: 11px; }
.rg-recency-key i {
  width: 21px;
  height: 16px;
  flex: none;
  background: linear-gradient(90deg, #517382, #67aaa8 54%, #b6f5e9);
  clip-path: polygon(0 100%, 0 66%, 22% 66%, 22% 100%, 39% 100%, 39% 34%, 61% 34%, 61% 100%, 78% 100%, 78% 0, 100% 0, 100% 100%);
}
.rg-head-readout {
  align-items: flex-start;
  gap: 1px;
  border-color: #42736f;
  box-shadow: inset 2px 0 #70c7bab8;
}
.rg-head-time { color: #e2fcf8; font-size: 13px; font-weight: 600; white-space: nowrap; }

.rg-legend {
  position: absolute;
  z-index: 2;
  left: 17px;
  bottom: 15px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 14px;
  width: max-content;
  max-width: calc(100% - 158px);
  padding: 8px 11px;
  border: 1px solid #365763;
  border-radius: 6px;
  background: #0a1925ed;
  color: #cbdcde;
  font: 12px var(--sans, system-ui, sans-serif);
  pointer-events: none;
}
.rg-legend span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.rg-legend [hidden] { display: none; }
.rg-legend i { display: inline-block; flex: none; }
.rg-legend [data-color=unreported] .ui-icon path { fill: none; }
.rg-legend [data-color=unreported] .cube-outline { stroke-dasharray: 3 2; }
.rg-swatch-link, .rg-swatch-chain { width: 15px; height: 1px; background: #8eb5ce; }
.rg-swatch-chain { height: 3px; background: var(--rg-mint); }
.rg-tooltip {
  position: absolute;
  z-index: 3;
  top: 15px;
  left: 50%;
  max-width: calc(100% - 20px);
  transform: translateX(-50%);
  padding: 7px 10px;
  border: 1px solid #5b7d7999;
  border-radius: 4px;
  background: #0b1b22f5;
  color: #e4f7ef;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 3px 12px #0003;
}
.rg-tooltip[hidden] { display: none; }

@media (max-width: 600px) {
  .rg-readout { inset: 9px 9px auto; }
  .rg-recency-key, .rg-head-readout { gap: 6px; padding-inline: 8px; }
  .rg-head-readout { gap: 1px; }
  .rg-head-time { font-size: 12px; }
  .rg-legend { left: 9px; bottom: 10px; max-width: calc(100% - 116px); padding: 6px 8px; gap: 3px 9px; font-size: 11px; line-height: 1.3; }
  .rg-legend span { gap: 4px; }
  .rg-swatch-link, .rg-swatch-chain { width: 10px; }
  .rg-legend .cube-marker { --cube-size: 10px; }
  .rg-tick-time { font-size: 10px; }
}
@media (max-width: 740px) {
  .rg-tooltip { top: 59px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .rg-arrival .rg-wave { animation: none; }
  .rg-link-pulse { display: none; animation: none; }
}
