/* Bar replay (lot RP1: replay.js). Its key in the chart's own bar (an icon key among the others: no row added); its
   controls at the foot of the candles' pane, in the chart's bottom left corner (the candles keep clear of them,
   replay.js), never over the price axis, the legend nor the last candles; the « Replay » tag with its date and time
   over them, a label, never a line; the live lines leave the
   replayed chart (they stand at live prices). Tokens only; no blue (the ticket's key keeps it); hover only where a
   pointer hovers; never italic; no text under 11 px; 44 px keys on a phone. */

/* ---- the key ---- */
.rp-open .i { width: 16px; height: 16px; }
.rp-open[aria-pressed="true"] { background: var(--surface-4); color: var(--text); box-shadow: inset 0 0 0 1px var(--silver); }
html[data-embed] #rpBtn { display: none; }
/* the focus's column head: beside the type key at the end of the timeframes' row (the first row keeps the market's name) */
.term[data-fkeys]:not([data-fkeys="rail"]) .ctool #rpBtn { order: 12; }
.term[data-fkeys]:not([data-fkeys="rail"]) .ctool:has(#rpBtn) #tfs { flex-basis: calc(100% - 66px); }
.term[data-fkeys="rail"] .ctool #rpBtn { order: 4; }

/* ---- the controls ---- */
.rp-bar { position: absolute; left: 8px; z-index: 4; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; max-width: calc(100% - var(--axis, 64px) - 16px); padding: 3px;
  border-radius: var(--r-sm); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair-3), var(--shadow-pop); }
.rp-bar[hidden], .rp-tag[hidden], .rp-bar [hidden] { display: none; }
.rp-run, .rp-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; min-width: 0; }
.rp-k { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 30px; height: 28px; padding: 0 6px;
  border: 0; border-radius: var(--r-sm); background: none; color: var(--mute); font-size: 12px; font-weight: 600; cursor: pointer;
  -webkit-tap-highlight-color: transparent; }
.rp-k .i { width: 15px; height: 15px; }
.rp-k:active:not(:disabled), .rp-k[aria-pressed="true"] { background: var(--surface-4); color: var(--text); }
.rp-k:disabled { opacity: 0.45; cursor: not-allowed; }
.rp-k:focus-visible, .rp-date:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.rp-speed { min-width: 38px; font-family: var(--font-num); font-stretch: var(--num-stretch); }
.rp-pick { padding-inline-start: 6px; }
.rp-pick-t { flex: 1 1 200px; min-width: 0; color: var(--mute); font-size: 12px; line-height: 1.35; }
.rp-date { flex: none; width: 168px; height: 28px; padding: 0 6px; border: 1px solid var(--hair-2); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font-size: 12px; color-scheme: dark; }
.rp-go { flex: none; min-height: 28px; }
@media (hover: hover) {
  .rp-k:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
}

/* ---- the tag: the replay's date and time, over its controls ---- */
.rp-tag { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; max-width: 100%; margin: 0; }
.rp-tag-t { padding: 3px 8px; border-radius: var(--r-sm); background: var(--surface-4); box-shadow: inset 0 0 0 1px var(--silver);
  color: var(--text); font-family: var(--font-num); font-stretch: var(--num-stretch); font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.rp-note { padding: 3px 8px; border-radius: var(--r-sm); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--warn);
  color: var(--text); font-size: 11.5px; line-height: 1.35; }

/* ---- the replayed chart: the live lines leave it (entry, stops, orders stand at live prices) ---- */
.chartwrap[data-replay="run"] > .lines { display: none; }
.chartwrap[data-replay] .chart-flag { display: none; }

/* ---- a phone: 44 px keys, after the chart's focus key ---- */
.term[data-form="phone"] .rp-bar { left: 58px; max-width: calc(100% - var(--axis, 56px) - 62px); }
.term[data-form="phone"] .rp-k { min-width: 44px; height: 44px; }
.term[data-form="phone"] .rp-date, .term[data-form="phone"] .rp-go { height: 44px; min-height: 44px; }
.term[data-form="phone"] .rp-date { flex: 1 1 150px; width: auto; font-size: 16px; }   /* 16 px: no zoom on focus (iOS) */
.term[data-form="phone"] .rp-pick-t { flex-basis: 100%; }
.term[data-form="phone"] .rp-tag-t { font-size: 11px; white-space: nowrap; }
