/* ═══════════════════════════════════════════════════════════════════════
   YUHA Run Score: the dashboard card and the Run Score page, rendered by
   static/run-score.js. Every rule is namespaced .rs- (or the page's own ids),
   so nothing here reaches another surface. Tokens come from views.css with a
   fallback each, so the page still reads if that sheet is late. The card's
   frame in the redesigned left column is the dashboard's own .y3-card.
   ═══════════════════════════════════════════════════════════════════════ */

#runScoreSlot:empty { display: none; }

/* ── The card ─────────────────────────────────────────────────────────── */
.rs-card {
  cursor: pointer;
  color: var(--ink, #0f1a16);
  -webkit-tap-highlight-color: transparent;
}
.rs-card:focus-visible { outline: 2px solid var(--teal, #0d9488); outline-offset: 2px; }
.rs-v2wrap { display: flex; flex-direction: column; gap: 12px; }
.rs-v2 {
  display: block;
  padding: 16px 18px;
  background: var(--paper, #fff);
  border: 1px solid var(--line, #e5eeea);
  border-radius: var(--r-lg, 16px);
  box-shadow: var(--shadow-1, 0 1px 2px rgba(15, 27, 23, 0.04));
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.rs-v2:hover { border-color: var(--line-2, #cfe6dd); }
.rs-span {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3, #8a9591);
  margin-left: 8px;
}
.rs-v3 .y3-side-hd { margin-bottom: 4px; }
.rs-num {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink, #0f1a16);
}
.rs-v3 .rs-num { font-size: 30px; }
.rs-num-building { font-size: 24px; }
.rs-change {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-2, #5c6b66);
  min-height: 18px;
}
.rs-foot {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-3, #8a9591);
}
.rs-bar {
  margin-top: 10px;
  height: 6px;
  border-radius: 999px;
  background: #e5eeea;
  overflow: hidden;
}
.rs-bar > span { display: block; height: 100%; background: var(--teal, #0d9488); border-radius: 999px; }
.rs-link {
  margin-top: 8px;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--teal, #0d9488);
  cursor: pointer;
}

/* ── The chart ────────────────────────────────────────────────────────── */
.rs-plot {
  position: relative;
  margin-top: 10px;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.rs-plot-card { height: 64px; }
.rs-plot-page { height: 220px; outline: none; border-radius: 8px; }
.rs-plot-page:focus-visible { box-shadow: 0 0 0 2px var(--teal, #0d9488); }
.rs-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; display: block; }
.rs-line { fill: none; stroke: var(--teal, #0d9488); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.rs-line.rs-soft { stroke-opacity: 0.4; stroke-dasharray: 4 3; }
.rs-dot { stroke: var(--teal, #0d9488); stroke-width: 5; stroke-linecap: round; }
.rs-dot.rs-soft { stroke-opacity: 0.4; }
.rs-fill { fill: var(--teal, #0d9488); fill-opacity: 0.08; stroke: none; }
.rs-grid { fill: none; stroke: #0f1b17; stroke-opacity: 0.07; stroke-width: 1; }
.rs-gl {
  position: absolute;
  left: -38px;
  width: 30px;
  text-align: right;
  transform: translateY(-50%);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3, #8a9591);
  pointer-events: none;
}
.rs-hover { position: absolute; inset: 0; pointer-events: none; }
.rs-hover[hidden] { display: none; }
.rs-vline {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--rs-x, 0);
  width: 1px;
  background: rgba(15, 27, 23, 0.25);
}
.rs-hdot {
  position: absolute;
  left: var(--rs-x, 0);
  top: var(--rs-y, 0);
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--teal, #0d9488);
  box-shadow: 0 0 0 2px #fff;
}
.rs-bubble {
  position: absolute;
  top: var(--rs-y, 0);
  transform: translate(-50%, calc(-100% - 10px));
  padding: 3px 7px;
  border-radius: 6px;
  background: #0f1b17;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rs-months { position: relative; height: 18px; margin-top: 4px; }
.rs-month {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--ink-3, #8a9591);
  white-space: nowrap;
}
.rs-month:first-child { transform: none; }

/* ── The page ─────────────────────────────────────────────────────────── */
#viewRunScore { background: var(--bg, #fafaf8); }
.rs-scroll { flex: 1; overflow-y: auto; padding: 24px 32px 48px; }
#rsContent { max-width: 1240px; margin: 0 auto; }
.rs-loading { padding: 60px 0; text-align: center; color: var(--ink-3, #8a9591); font-size: 14px; }
.rs-loading .rs-link { display: block; margin: 10px auto 0; }
.rs-top { margin-bottom: 14px; }
.rs-back {
  padding: 6px 10px 6px 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--teal, #0d9488);
  cursor: pointer;
}
.rs-panel {
  background: var(--paper, #fff);
  border: 1px solid var(--line, #e5eeea);
  border-radius: var(--r-lg, 16px);
  box-shadow: var(--shadow-1, 0 1px 2px rgba(15, 27, 23, 0.04));
  padding: 18px 20px;
  color: var(--ink, #0f1a16);
  min-width: 0;
}
.rs-eyebrow, .rs-h {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3, #5e6e68);
}
.rs-eyebrow .rs-span { text-transform: none; letter-spacing: 0; }
.rs-h-sub { margin-top: 18px; }
.rs-big {
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.rs-big.rs-num-building { font-size: 40px; }
.rs-hero .rs-change { font-size: 14px; margin-top: 8px; }
.rs-break {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #f1f6f4;
  font-size: 13px;
  color: var(--ink-2, #5c6b66);
}
.rs-chartwrap { margin-top: 18px; padding-left: 38px; }
.rs-started { margin-top: 6px; font-size: 12px; color: var(--ink-3, #8a9591); }
.rs-p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink-2, #5c6b66); }
.rs-counts { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; color: var(--ink-2, #5c6b66); }

.rs-scale {
  position: relative;
  height: 8px;
  margin: 26px 0 4px;
  border-radius: 999px;
  background: #e5eeea;
}
.rs-scale-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: rgba(13, 148, 136, 0.35); }
.rs-tick { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: #fff; }
.rs-marker {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--teal, #0d9488);
  box-shadow: 0 0 0 3px #fff;
}
.rs-marker b {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink, #0f1a16);
}
.rs-scale-ends { display: flex; justify-content: space-between; font-size: 10px; color: var(--ink-3, #8a9591); }
.rs-refs { list-style: none; margin: 10px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rs-refs li { display: flex; gap: 10px; font-size: 12px; color: var(--ink-2, #5c6b66); }
.rs-ref-v { width: 34px; font-variant-numeric: tabular-nums; color: var(--ink, #0f1a16); font-weight: 600; }

.rs-run-list { display: flex; flex-direction: column; }
.rs-run {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 10px;
  align-items: baseline;
  width: 100%;
  padding: 9px 0;
  border: none;
  border-top: 1px solid var(--line, #eef3f1);
  background: none;
  font: inherit;
  text-align: left;
  color: inherit;
}
.rs-run:first-child { border-top: none; }
button.rs-run { cursor: pointer; }
button.rs-run:hover .rs-run-main { color: var(--teal, #0d9488); }
.rs-run-date { font-size: 12px; color: var(--ink-3, #8a9591); }
.rs-run-main { font-size: 13px; color: var(--ink, #0f1a16); min-width: 0; }
.rs-run-hr { display: block; font-size: 12px; color: var(--ink-3, #8a9591); }
.rs-run-val { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rs-pull { margin-left: 3px; font-size: 11px; color: var(--ink-3, #8a9591); }

/* One stack in the app screen's order: number and chart, where you sit, runs
   that counted, runs left out, how it works. The column wrappers dissolve so
   their panels can be ordered one by one. */
.rs-cols { display: flex; flex-direction: column; gap: 14px; }
.rs-col { display: contents; }
.rs-hero { order: 1; }
.rs-where { order: 2; }
.rs-runs { order: 3; }
.rs-leftout { order: 4; }
.rs-how { order: 5; }

@media (min-width: 1024px) {
  .rs-cols { display: grid; grid-template-columns: 260px minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
  .rs-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
}
@media (max-width: 768px) {
  .rs-scroll { padding: 14px 14px 32px; }
  .rs-big { font-size: 46px; }
  .rs-plot-page { height: 180px; }
}
