/* Rand Tracker (/rand-tracker): a panel inside the public dashboard shell, themed with the shared --id-* tokens
   (assets/css/dashboard-theme.css) in light and dark. Stronger rand = --id-good, weaker = --id-bad; chart line = --id-series-1.
   Page-scoped tokens below only cover what the shared set lacks: the filled navy chips (KPI cards and active button). Fonts are the site's own. */
main.rt {
  --rt-navy: var(--id-heading); --rt-ink: var(--id-text); --rt-mute: var(--id-text-2); --rt-line: var(--id-line); --rt-line2: var(--id-line-strong);
  --rt-bg: var(--id-surface-2); --rt-card: var(--id-surface);
  --rt-fill: #043450; --rt-kpi-bg: var(--id-primary); --rt-kpi-ink: #ffffff; --rt-kpi-cap: #dce5eb; --rt-kpi-line: #043450; --rt-on-fill: #ffffff; --rt-fill-line: #043450;
  --rt-num: var(--id-font);
  min-height: calc(100vh - var(--dashboard-header-height, 76px));
  background: var(--id-bg); color: var(--rt-ink);
  font-family: var(--id-font);
}
/* dark: raised surfaces instead of the navy fills, so the KPI cards sit on the dark page and keep a distinct block look */
:root[data-theme="dark"] main.rt { --rt-fill: var(--id-primary-ui); --rt-on-fill: #ffffff; --rt-kpi-bg: var(--id-surface-3); --rt-kpi-ink: var(--id-heading); --rt-kpi-cap: var(--id-text-2); --rt-kpi-line: var(--id-line-strong); --rt-fill-line: var(--id-line-strong); }
.rt *, .rt *::before, .rt *::after { box-sizing: border-box; }
.rt button, .rt input { font-family: inherit; }
.rt :focus-visible { outline: 2px solid var(--id-focus); outline-offset: 2px; }
.rt a { color: var(--id-link); }
.rt-wrap { display: flex; flex-direction: column; gap: var(--id-gap); } /* width, padding: .id-content */
:where(.rt) section { padding: 0; margin: 0; align-items: stretch; text-align: left; } /* the site styles every section; :where keeps this below .rt-card so cards keep their padding */
.rt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rt-muted { color: var(--rt-mute); font-weight: 400; }

.rt-banner { margin: 0; padding: 10px 14px; border-radius: var(--id-radius-control); background: var(--id-notice-bg); border: 1px solid var(--id-notice-line); font-size: var(--id-fs-small); color: var(--id-notice-text); }

.rt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: var(--id-gap); }
.rt-kpi { display: flex; flex-direction: column; gap: 6px; padding: var(--id-card-pad); border-radius: var(--id-radius-card); box-shadow: var(--id-shadow-card); background: var(--rt-kpi-bg); color: var(--rt-kpi-ink); border: 1px solid var(--rt-kpi-line); min-width: 0; }
.rt-kpi-label { font-size: var(--id-fs-label); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--id-accent); }
.rt-kpi-value { font-family: var(--rt-num); font-size: var(--id-fs-number); line-height: 1.1; font-weight: 700; }
.rt-kpi-cap { font-size: var(--id-fs-label); line-height: 1.45; color: var(--rt-kpi-cap); }

.rt-card { display: flex; flex-direction: column; gap: 14px; }
.rt-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; }
.rt-cap { margin: 0; font-size: var(--id-fs-body); line-height: 1.55; color: var(--rt-ink); }
.rt-note { margin: 0; font-size: var(--id-fs-small); line-height: 1.5; color: var(--rt-mute); }

.rt-seg-wrap { align-self: flex-start; }
.rt-btn { min-height: 40px; padding: 0 16px; border-radius: var(--id-radius-control); background: var(--id-surface); border: 1px solid var(--rt-line2); color: var(--rt-navy); font-size: var(--id-fs-small); font-weight: 600; cursor: pointer; }
.rt-btn:hover { background: var(--id-surface-3); }

/* scoreboard */
.rt-board { display: flex; flex-direction: column; gap: 6px; }
.rt-axis, .rt-row { display: grid; grid-template-columns: 52px 1fr 76px; align-items: center; gap: 10px; }
.rt-axis > div { display: flex; justify-content: space-between; font-size: 11px; color: var(--rt-mute); }
.rt-code { font-size: 13px; font-weight: 700; color: var(--rt-navy); }
.rt-track { position: relative; height: 22px; border-radius: 6px; background: var(--rt-bg); }
.rt-zero { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--id-chart-neutral); }
.rt-bar { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; }
.rt-bar.up { left: 50%; background: var(--id-good); }
.rt-bar.down { right: 50%; background: var(--id-bad); }
.rt-val.up { color: var(--id-good); }
.rt-val.down { color: var(--id-bad); }
.rt-val.none { color: var(--rt-mute); }
.rt-val { font-size: 13px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.rt-tabledet summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--id-link); min-height: 32px; }
.rt-tabledet[open] summary { margin-bottom: 8px; }

/* tables */
.rt-tablewrap { overflow-x: auto; }
.rt-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.rt-table th, .rt-table td { padding: 9px 10px; border-bottom: 1px solid var(--rt-line); text-align: right; white-space: nowrap; }
.rt-table th:first-child, .rt-table td:first-child { text-align: left; }
.rt-table thead th { font-size: 12px; font-weight: 600; color: var(--rt-mute); border-bottom-color: var(--rt-line2); }
.rt-table tbody th { font-weight: 600; color: var(--rt-navy); }
.rt-table tr.is-picked { background: var(--id-surface-3); }
.rt-table td.up { color: var(--id-good); }
.rt-table td.down { color: var(--id-bad); }

/* chart */
.rt-plotbox { display: flex; flex-direction: column; gap: 6px; }
.rt-plot { position: relative; height: 280px; margin-left: 50px; margin-right: 6px; }
.rt-plot > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rt-yl { position: absolute; left: -50px; top: 0; bottom: 0; width: 44px; }
.rt-yl span { position: absolute; right: 0; font-size: 11px; line-height: 14px; color: var(--rt-mute); white-space: nowrap; }
.rt-grid { stroke: var(--id-grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.rt-gap { stroke: var(--id-line-strong); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.rt-line { fill: none; stroke: var(--id-series-1); stroke-width: 2.25; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.rt-hov { stroke: var(--rt-navy); stroke-width: 1; vector-effect: non-scaling-stroke; }
.rt-dot { fill: var(--id-series-2); stroke: var(--id-series-2); stroke-width: 8; stroke-linecap: round; }
.rt-pointlabel { position: absolute; font-size: 11px; font-weight: 600; line-height: 14px; color: var(--rt-navy); white-space: nowrap; }
.rt-hdot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--rt-navy); box-shadow: 0 0 0 2px var(--id-surface); pointer-events: none; }
.rt-tip { position: absolute; top: 4px; padding: 6px 10px; border-radius: 8px; background: var(--id-tooltip-bg); color: var(--id-tooltip-text); border: 1px solid var(--id-tooltip-border); box-shadow: 0 4px 14px var(--id-shadow); font-size: 12px; line-height: 1.35; white-space: nowrap; pointer-events: none; }
.rt-tip b { display: block; font-weight: 700; }
.rt-tip span { color: var(--id-tooltip-muted); }
.rt-touch { position: absolute; inset: 0; cursor: crosshair; touch-action: pan-y; }
.rt-xl { position: relative; height: 16px; margin-left: 50px; margin-right: 6px; }
.rt-xl span { position: absolute; top: 0; font-size: 11px; color: var(--rt-mute); white-space: nowrap; transform: translateX(-50%); }

/* time machine */
.rt-tm-controls { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 16px 24px; align-items: end; }
.rt-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rt-field label { font-size: 13px; font-weight: 600; color: var(--rt-navy); }
.rt-field input[type="number"] { min-height: 44px; padding: 0 12px; border: 1px solid var(--rt-line2); border-radius: var(--id-radius-control); font-size: 16px; background: var(--id-surface); color: var(--rt-ink); width: 100%; }
.rt-field input[type="range"] { width: 100%; min-height: 44px; accent-color: var(--id-primary-ui); }
.rt-sentence { margin: 0; font-family: var(--rt-num); font-size: var(--id-fs-section); line-height: 1.4; font-weight: 600; color: var(--rt-navy); }
.rt-bars { display: flex; flex-direction: column; gap: 8px; }
.rt-brow { display: grid; grid-template-columns: 84px 1fr; grid-template-areas: "l t" ". x"; gap: 2px 10px; align-items: center; }
.rt-blabel { grid-area: l; font-size: 13px; font-weight: 600; color: var(--rt-navy); }
.rt-btrack { grid-area: t; height: 16px; border-radius: 5px; background: var(--rt-bg); }
.rt-bfill { display: block; height: 100%; border-radius: 5px; }
.rt-bfill.then { background: var(--id-chart-neutral); }
.rt-bfill.now { background: var(--id-series-1); }
.rt-btext { grid-area: x; font-size: 12px; color: var(--rt-mute); }
.rt-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rt-sharelink { min-width: 0; font-size: 12px; color: var(--rt-mute); overflow-wrap: anywhere; }

/* method */
.rt-method p { margin: 0; font-size: var(--id-fs-small); line-height: 1.6; color: var(--rt-ink); }
.rt-attrib { padding: 10px 14px; border-radius: var(--id-radius-control); background: var(--rt-bg); }

@media (max-width: 600px) {
    .rt-axis, .rt-row { grid-template-columns: 40px 1fr 62px; gap: 8px; }
  .rt-plot { height: 220px; margin-left: 44px; }
  .rt-yl { left: -44px; width: 40px; }
  .rt-xl { margin-left: 44px; }
  .rt-tm-controls { grid-template-columns: minmax(0, 1fr); }
  .rt-sentence { font-size: 17px; }
  .rt-brow { grid-template-columns: 70px 1fr; }
}
