/* dashboard/runner-panel.css — the runner panel (runner-panel.js).
   Brand tokens only (theme.css). Colour is meaning: green = Support
   (shortening), slate (--drift) = Drift, grey = no reading.
   Desktop: a sheet from the right. Phone (<= 640px): a bottom sheet. */
.rp-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; justify-content: flex-end;
  background: rgba(10, 18, 30, 0.45);
}
html.rp-lock { overflow: hidden; }
.rp-sheet {
  width: min(440px, 100%); height: 100%;
  display: flex; flex-direction: column;
  background: var(--surface); color: var(--text);
  border-left: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.rp-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--border-subtle);
}
.rp-title { margin: 0; font: 700 1.35rem/1.2 var(--font-headline); overflow-wrap: anywhere; }
.rp-head .rp-sub { margin: 4px 0 0; font: 600 0.85rem/1.2 var(--font-mono); color: var(--text-muted); }
.rp-close {
  flex-shrink: 0; width: 44px; height: 44px; margin: -8px -8px 0 0;
  border: 0; background: transparent; color: var(--text-dim); cursor: pointer;
  font-size: 1.6rem; line-height: 1; border-radius: var(--radius-sm);
}
.rp-close:hover { background: var(--surface-hover); }
.rp-close:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rp-body { overflow-y: auto; padding: 12px 16px 24px; overscroll-behavior: contain; }
.rp-h {
  margin: 0 0 10px; font: 700 0.95rem/1.2 var(--font-mono);
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent);
}
.rp-live { margin-bottom: 18px; }
.rp-lumps { margin: 0 0 10px; font-size: 0.82rem; color: var(--text-dim); }
.rp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 8px; }
.rp-cell {
  display: flex; flex-direction: column; gap: 3px; padding: 8px 10px;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
}
.rp-k { font: 600 0.72rem/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.rp-v { font: 700 0.9rem/1.2 var(--font-mono); color: var(--gold); overflow-wrap: break-word; }
.rp-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.rp-line { margin: 0 0 10px; font-size: 0.9rem; line-height: 1.4; }
.rp-start { margin: 0 0 10px; font-size: 0.82rem; color: var(--text-dim); }
.rp-nr { margin: 0 0 12px; padding: 8px 10px; font-size: 0.8rem; border-left: 3px solid var(--gold); background: var(--surface-hover); }
.rp-points { list-style: none; margin: 0; padding: 0; }
.rp-point {
  display: grid; grid-template-columns: 1fr auto; column-gap: 12px; row-gap: 2px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
}
.rp-label { font-size: 0.84rem; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.rp-src { display: block; margin-top: 1px; font-size: 0.7rem; font-weight: 500; color: var(--text-muted); }
.rp-price { text-align: right; font-size: 0.95rem; font-weight: 700; }
.rp-none { font-weight: 500; font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-body); }
.rp-step { grid-column: 1 / -1; font: 600 0.76rem/1.3 var(--font-mono); }
.rp-support { color: var(--green); }
.rp-drift { color: var(--drift); }
.rp-flat { color: var(--text-muted); }
.rp-since { font-style: normal; font-weight: 500; color: var(--text-muted); }
.rp-missing .rp-label, .rp-pending .rp-label { color: var(--text-muted); font-weight: 500; }
.rp-foot, .rp-state { margin: 12px 0 0; font-size: 0.72rem; color: var(--text-muted); }
.rp-state { font-size: 0.85rem; }
@media (max-width: 640px) {
  .rp-backdrop { align-items: flex-end; }
  .rp-sheet {
    width: 100%; height: auto; max-height: 88vh; max-height: 88dvh;
    border-left: 0; border-top: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .rp-body { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
}
.rp-open {
  display: inline-flex; align-items: center; margin-left: 8px; padding: 3px 9px;
  border: 1px solid var(--accent); border-radius: var(--radius-sm);
  background: var(--accent); color: #fff;
  font: 700 0.66rem/1.3 var(--font-body); letter-spacing: 0.02em; white-space: nowrap;
  cursor: pointer; min-height: 26px; vertical-align: middle;
}
.rp-open:hover, .rp-open:focus-visible { filter: brightness(1.1); outline: none; box-shadow: 0 0 0 2px var(--accent-dim, rgba(0,0,0,.15)); }
.rp-open--alert { margin: 4px 0 2px; }
@media (hover: none) { .rp-open { min-height: 32px; padding: 4px 10px; } }
.rp-history { margin-top: 18px; }
.rp-signin {
  margin-top: 8px; padding: 8px 14px; border: 1px solid var(--accent); border-radius: var(--radius-sm);
  background: transparent; color: var(--accent); font: 700 0.8rem/1.3 var(--font-body); cursor: pointer; min-height: 40px;
}
.rp-signin:hover, .rp-signin:focus-visible { background: var(--surface-hover); }

/* History records (#135) */
.rp-hist-move { margin: 0 0 8px; font-size: 0.85rem; }
.rp-history .rp-sub { margin: 14px 0 6px; font-size: 0.95rem; }
/* From 10:00: a small group under a subject's morning records */
.rp-from { margin: 10px 0 0; padding-left: 10px; border-left: 2px solid var(--border, rgba(127,127,127,.3)); }
.rp-from .rp-sub2 { margin: 0 0 6px; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.rp-records { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rp-record { border: 1px solid var(--border, rgba(127,127,127,.3)); border-radius: 8px; padding: 8px 10px;
  display: grid; gap: 4px; }
.rp-record.rp-highlight { border-color: var(--accent, currentColor); border-width: 2px; }
.rp-record.rp-small:not(.rp-highlight) { opacity: .9; }
.rp-rec-label { font-weight: 600; font-size: 0.85rem; }
.rp-rec-main { font-size: 0.95rem; }
.rp-rec-range, .rp-rec-none { font-size: 0.72rem; color: var(--text-muted); }
.rp-tag { display: inline-block; font-size: 0.68rem; padding: 1px 6px; border-radius: 999px;
  border: 1px solid var(--border, rgba(127,127,127,.4)); color: var(--text-muted); }
.rp-tag-noise { font-style: italic; }
.rp-tag-hi { color: inherit; border-color: var(--accent, currentColor); }
.rp-pnl, .rp-runs-d { font-size: 0.78rem; }
.rp-pnl summary, .rp-runs-d summary { cursor: pointer; color: var(--text-muted); }
.rp-runs { width: 100%; border-collapse: collapse; font-size: 0.72rem; margin-top: 4px; }
.rp-runs th, .rp-runs td { text-align: left; padding: 2px 6px 2px 0; white-space: nowrap; }
.rp-runs-d { overflow-x: auto; }

/* Trader: the runner's name opens the panel (the rest of the row toggles the basket). */
.trader__runner-name { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.trader__runner-name:hover, .trader__runner-name:focus-visible { color: var(--accent); outline: none; }

/* Live Feed table: the opener sits on its own line under the horse's name, so it never squeezes the name out. */
.rp-open--row { display: flex; width: fit-content; margin: 4px 0 2px; }
