/* The replay toolbar.
 *
 * Its own stylesheet for the same reason picker.css is: the chrome is being restyled in style.css
 * and windows.css by a parallel session, and a component landing in either would collide. Scoped
 * entirely to .rb, and reading the shared tokens so a theme change carries it.
 */

.rb {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 8px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  color: var(--ink-dim);
  font: var(--t-sm) var(--ui);
  user-select: none;
}
.rb[hidden] { display: none; }

/* Transport verbs: the system's quiet role, at the dense height, in this bar's smaller type. */
.rb-btn {
  height: var(--c-sm);
  min-width: 28px;
  padding: 0 7px;
  font: var(--t-xs) var(--ui);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.rb-btn svg { fill: none; }

/* Play is the one control that reports as well as acts - and the GLYPH is the report: it is a
   pause bar while it plays. It also carried a filled chip behind it, which is a latch drawn twice
   and made the one lit rectangle in a bar of bare marks. */
.rb-play { color: var(--ink); }
.rb-play svg { fill: currentColor; }

.rb-stop { color: var(--ink-dim); }
.rb-stop:hover { color: var(--sell-hi); border-color: var(--sell); }

.rb-sep {
  width: 1px;
  height: 15px;
  margin: 0 4px;
  background: var(--line-2);
}

/* The shared pick control at the replay bar's own density - the dense rung, which the transport
   verbs beside it already stand on. */
.fld-pick.rb-speed {
  height: var(--c-sm);
  min-width: 64px;
  padding: 0 6px;
  font: var(--t-xs) var(--mono);
  background: var(--panel-2);
}

/* The speed sits in the row as a verb, not as a field: the multiple, a caret, no box. Mono for
   the number so 5000x and 60x do not shift the scrubber beside them as the speed changes. */
.rb-speed { gap: 3px; padding-right: 4px; }
.rb-speed-val { font: var(--t-xs) var(--mono); color: var(--ink); }
.rb-speed .ic { color: var(--ink-faint); }

/* And its menu says what each multiple costs on the timeframe in hand - the caption that used to
   stand in the bar, moved to where it is read at the moment it is chosen. */
.ctxmenu .rb-menu-rate {
  float: right;
  margin-left: 18px;
  color: var(--ink-faint);
  font: var(--t-xs) var(--mono);
}

/* The scrubber takes the slack, because it is the control that wants room: a wider track is
   literally more precision. */
.rb-scrub {
  position: relative;
  flex: 1 1 auto;
  min-width: 80px;
  height: 14px;
  margin: 0 6px;
  cursor: pointer;
  touch-action: none;
}
.rb-scrub::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 5px;
  height: 4px;
  border-radius: 2px;
  background: var(--line-2);
}
.rb-fill {
  position: absolute;
  left: 0; top: 5px;
  height: 4px;
  border-radius: 2px;
  background: var(--ink-dim);
  pointer-events: none;
}
.rb-thumb {
  position: absolute;
  top: 2px;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--bg);
  pointer-events: none;
}
.rb-scrub:hover .rb-thumb, .rb-scrub:focus-visible .rb-thumb { transform: scale(1.15); }
.rb-scrub:focus { outline: none; }
.rb-scrub:focus::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--focus); }

/* WHERE THE CURSOR IS. Monospaced, because it counts many times a second and a proportional font
   makes it jitter sideways while it does. The time is the fact and takes the ink; the window size
   is context and stands behind it. One grey run of both was a debug print, not a readout. */
.rb-pos {
  flex: 0 0 auto;
  min-width: 156px;
  text-align: right;
  white-space: nowrap;
  font: var(--t-xs) var(--mono);
}
.rb-at { color: var(--ink); font-weight: var(--w-medium); }
.rb-of { margin-left: 10px; color: var(--ink-faint); }

/* While replay's transport is up, the corner cluster steps above it instead of sitting on its
   readout and Exit. */
body.replay-on .tabstrip-nav { bottom: 30px; }

/* THE STRIP IS RESERVED. #replayBar keeps its thirty pixels for as long as replay is on, whether
   the transport is docked in it or lifted out as a floating card - so lifting costs no layout,
   the chart does not jump under the pointer mid-drag, and docking back is seamless. It is also
   the floating card's positioning context: the drag math reads offsets off this box, so it has
   to be the box the card is absolute against. Desktop only: the phone's transport wraps to its
   own thumb-bar height (mobile.css) and keeps its own arithmetic. */
:root:not([data-mobile]) body.replay-on #replayBar { position: relative; height: 30px; }

/* The grip: the one part of the bar that says "I move". Quiet at rest, present on hover. */
.rb-grip {
  flex: 0 0 auto;
  width: 18px;
  height: 22px;
  margin-right: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  cursor: grab;
  touch-action: none;
}
.rb-grip:hover { color: var(--ink); }
.rb-grip:active { cursor: grabbing; }

/* LIFTED. The card detaches from the strip: compact, rounded, carrying a shadow so it reads as
   above the chart it floats over - the favourite-toolset shape, not a strip that escaped. */
.rb.is-float {
  position: absolute;
  width: max-content;
  min-width: 460px;
  max-width: min(760px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
  z-index: 40;
}
/* The scrubber is the part that takes the slack in a strip; in a compact card the readout and
   the speed must not be crushed by it, so the card keeps the scrubber honest instead. */
.rb.is-float .rb-scrub { flex: 1 1 160px; }

/* A finger never sees the grip: on the phone the transport is the thumb bar and does not lift. */
:root[data-mobile] .rb-grip { display: none; }
:root[data-mobile] .rb.is-float { position: static; width: auto; min-width: 0; max-width: none; border: 0; border-radius: 0; box-shadow: none; }
