

.rg-run { display: grid; grid-template-columns: minmax(0, 1fr); gap: .6rem; }
.rg-run p { margin: 0; }


.rg-chart { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); grid-template-rows: auto auto; column-gap: .35rem; }
.rg-ylab { position: relative; grid-row: 1; font-size: 11px; color: var(--text-secondary); }
.rg-ylab span { position: absolute; right: 0; transform: translateY(-50%); line-height: 1; }
.rg-plot { position: relative; grid-column: 2; height: 300px; margin-right: 6.2rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-1); }
.rg-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rg-svg path, .rg-svg rect { vector-effect: non-scaling-stroke; }
.rg-ahead { fill: var(--surface-sunken); }
.rg-grid { fill: none; stroke: var(--border); stroke-width: 1; }
.rg-now { fill: none; stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 2 3; }
.rg-line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; }
.rg-after { fill: none; stroke: var(--text-primary); stroke-width: 2; stroke-linejoin: round; }
.rg-outline { fill: none; stroke: var(--text-primary); stroke-width: 1; stroke-dasharray: 3 4; }
.rg-mine { fill: color-mix(in oklab, var(--series-3) 24%, transparent); stroke: var(--series-3); stroke-width: 1.5; }
.rg-site { fill: color-mix(in oklab, var(--series-2) 18%, transparent); stroke: var(--series-2); stroke-width: 1.5; stroke-dasharray: 5 3; }
.rg-dot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
  background: var(--series-1); border: 2px solid var(--surface-1); pointer-events: none; }
.rg-dot-out { background: var(--text-primary); width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; }
.rg-xlab { position: relative; grid-column: 2; height: 1.4rem; margin-right: 6.2rem; color: var(--text-secondary); }
.rg-xlab span { position: absolute; top: .3rem; transform: translateX(-50%); white-space: nowrap; font-size: 11px; }
.rg-xlab span:first-child { transform: none; }
.rg-xlab span:last-child { transform: translateX(-100%); }


.rg-h { position: absolute; right: -6.2rem; height: 44px; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: flex-end; cursor: ns-resize; touch-action: none; outline: none; }
.rg-h::before { content: ""; position: absolute; left: 0; right: 6.2rem; top: 50%; height: 0; border-top: 2px solid var(--series-3); }
.rg-grip { position: absolute; right: calc(6.2rem - 7px); top: 50%; width: 14px; height: 14px; margin-top: -7px;
  border-radius: 3px; background: var(--series-3); border: 2px solid var(--surface-1); }

.rg-h b { position: absolute; right: 0; display: grid; justify-items: start; width: 5.6rem; padding: 2px 6px; font-size: 13px; font-weight: 600;
  line-height: 1.15; color: var(--text-primary); background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.rg-h-hi b { bottom: calc(50% + 3px); }
.rg-h-lo b { top: calc(50% + 3px); }
.rg-h b small { font-size: 11px; font-weight: 500; color: var(--text-secondary); }
.rg-h:focus-visible b { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.rg-h:focus-visible .rg-grip { border-color: var(--brand); }

.rg-under { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.rg-pips { display: inline-flex; gap: 4px; }
.rg-pips i { width: 12px; height: 12px; border-radius: 2px; border: 1px solid var(--border-strong); }
.rg-pips i.in { background: var(--good); border-color: var(--good); }
.rg-pips i.out { background: var(--critical); border-color: var(--critical); }
.rg-act { gap: .5rem; flex-wrap: wrap; }

.rg-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; color: var(--text-secondary); }
.rg-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.rg-sw { display: inline-block; width: 18px; height: 10px; border-radius: 2px; }
.rg-sw-mine { background: color-mix(in oklab, var(--series-3) 24%, transparent); border: 1.5px solid var(--series-3); }
.rg-sw-site { background: color-mix(in oklab, var(--series-2) 18%, transparent); border: 1.5px dashed var(--series-2); }
.rg-sw-after { height: 0; border-top: 2px solid var(--text-primary); }


.rg-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: .7rem; margin: .3rem 0 .6rem; padding: 0; list-style: none; }
.rg-thumb { display: grid; gap: .25rem; min-width: 0; }
.rg-chart.rg-small { grid-template-columns: minmax(0, 1fr); }

.rg-done .rg-plot, .rg-done .rg-xlab { margin-right: .9rem; }
.rg-stack { display: grid; gap: .6rem; }
.rg-run .rg-five { margin-top: 1.1rem; }
.rg-small .rg-plot { grid-column: 1; height: 96px; margin-right: 0; }
.rg-in[data-v="in"] { color: var(--good-on-panel, var(--good)); }
.rg-in[data-v="out"] { color: var(--critical-on-panel, var(--critical)); }


.rg-figrow { display: none; }
.rg-lh { display: contents; }

@media (max-width: 560px) {
  .rg-chart { grid-template-columns: 1.55rem minmax(0, 1fr); column-gap: .25rem; }
  .rg-plot, .rg-xlab { margin-right: .75rem; }
  .rg-plot { height: 240px; }
  .rg-h { right: -.75rem; }
  .rg-h::before { right: .75rem; }
  .rg-grip { right: calc(.75rem - 7px); }
  
  .rg-h-hi { transform: translateY(-100%); }
  .rg-h-lo { transform: none; }
  .rg-h-hi::before { top: 100%; }
  .rg-h-lo::before { top: 0; }
  .rg-h-hi .rg-grip { top: 100%; }
  .rg-h-lo .rg-grip { top: 0; }
  .rg-h b { display: none; }
  .rg-figrow { display: flex; justify-content: space-between; gap: .5rem; font-size: 13px; color: var(--text-secondary); }
  .rg-figrow b { font-weight: 600; color: var(--text-primary); }
  .rg-figrow small { font-size: 11px; }
  .rg-lh { display: none; }
  .rg-lh + .tv-tally-c { border-left: 0; padding-left: 0; }
  .rg-xlab span:nth-child(2), .rg-xlab span:nth-child(3) { display: none; }
  .rg-small .rg-plot { height: 80px; margin-right: 0; }
}
