/* Reflection as a Method to reduce Reward Hacking: figure panels, charts (charts.js) and the value tooltip. */

/* series colours, as in the draft: red is the hacking model, green is corrected-reply SFT. --ct is a darker shade for text. */
.rh-s-base { --c: #2b9cb0; --ct: #1b7383; }
.rh-s-rl, .rh-s-full, .rh-s-atkbase { --c: #d35d3a; --ct: #b0452a; }
.rh-s-sft, .rh-s-partial, .rh-s-atksft { --c: #6b8f3a; --ct: #52722b; }
.rh-s-sft2 { --c: #a9bb8b; --ct: #66784a; }
.rh-s-refl { --c: #9c968e; --ct: #6b6660; }

/* figures sit straight on the page */
.po-body > .rh-fig { margin-top: 40px; }
.po-body .rh-fig > figcaption { margin-top: 12px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.po-body .rh-fig-title { margin: 0; font: 600 17px/1.3 var(--sans); letter-spacing: -.01em; color: var(--teal); }
.po-body .rh-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13px; line-height: 1.35; color: var(--muted); }
.po-body .rh-legend span { display: inline-flex; align-items: center; gap: 7px; cursor: default; }
.rh-sw { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.rh-sw.square { border-radius: 1px; }
/* matches the bars: stripes over a light tint, with an outline */
.rh-sw.bar {
  border-radius: 1px; box-shadow: inset 0 0 0 1.25px var(--c);
  background: repeating-linear-gradient(135deg, var(--c) 0 1.6px, color-mix(in srgb, var(--c) 22%, transparent) 1.6px 4.2px);
}
.po-body .rh-chart { margin-top: 14px; }
.po-body .rh-chart svg { display: block; max-width: none; overflow: visible; -webkit-tap-highlight-color: transparent; }

/* chart parts */
.rh-svg text { font-family: var(--sans); fill: var(--teal); }
.rh-svg .tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.rh-svg .axis-title { font-size: 12px; fill: var(--muted); }
.rh-svg .cat { font-size: 12px; font-weight: 600; }
.rh-svg .cat-sub { font-size: 11.5px; fill: var(--muted); }
.rh-svg .val { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rh-svg .pt-val { font-size: 12px; paint-order: stroke; stroke: var(--cream); stroke-width: 4px; stroke-linejoin: round; }
.rh-svg .val.c { fill: var(--ct); }
.rh-svg .grid { stroke: #e5e0d6; stroke-width: 1; }
.rh-svg .base { stroke: #bcb6ac; stroke-width: 1; }
.rh-svg .zero { stroke: var(--teal-mid); stroke-width: 1.5; }
.rh-svg .bar { stroke: var(--c); stroke-width: 1.5; } /* filled by charts.js with a hatch pattern */
.rh-svg .hatch-bg { fill: var(--c); fill-opacity: .22; }
.rh-svg .hatch-ln { stroke: var(--c); stroke-width: 2.2; }
.rh-svg .pt { fill: var(--c); stroke: var(--cream); stroke-width: 1.5; }
.rh-svg .line { fill: none; stroke: var(--c); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.rh-svg .ci line { stroke: var(--c); stroke-width: 1.4; }
.rh-svg .stem { stroke: var(--c); stroke-width: 2; stroke-opacity: .35; }
.rh-svg .hit { fill: transparent; transition: fill .15s ease; }
.rh-svg .guide { stroke: var(--teal-mid); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; transition: opacity .15s ease; }

/* hover, tap and keyboard focus: the chosen mark stays, the rest fade */
.rh-svg .mk { cursor: default; outline: none; }
.rh-svg .mk.on .hit { fill: rgba(17, 72, 78, .04); }
.rh-svg .mk.on .guide { opacity: .7; }
.rh-svg .mk.on .pt { stroke: var(--teal); stroke-width: 2; }
.rh-svg .mk:focus-visible .hit { stroke: var(--teal); stroke-width: 1.5; stroke-dasharray: 4 3; }
.rh-svg .dim { transition: opacity .25s ease; }
.rh-svg.is-hover .mk:not(.on) .dim, .rh-svg.is-hover .series:not(.on) .dim { opacity: .4; }

/* the value tooltip (charts.js adds it to the end of the page): a small two-line label */
.rh-tip {
  position: fixed; left: 0; top: 0; z-index: 60;
  box-sizing: border-box; width: max-content; max-width: min(220px, calc(100vw - 16px));
  padding: 6px 9px 7px;
  background: rgba(255, 255, 255, .96); border: 1px solid var(--stone); border-radius: 6px;
  box-shadow: 0 4px 14px rgba(17, 72, 78, .1);
  font: 12px/1.35 var(--sans); color: var(--teal);
  pointer-events: none;
  opacity: 0; visibility: hidden;
  transition: opacity .15s ease, visibility 0s linear .15s;
}
.rh-tip.show { opacity: 1; visibility: visible; transition: opacity .15s ease, visibility 0s; }
.rh-tip.show.glide { transition: opacity .15s ease, visibility 0s, transform .2s cubic-bezier(.25, .8, .3, 1); }
.rh-tip-h { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.rh-tip-h .rh-sw { width: 8px; height: 8px; }
.rh-tip-b { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 7px; margin-top: 1px; }
.rh-tip-b b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rh-tip-b span { color: var(--muted); font-variant-numeric: tabular-nums; }

/* tables */
.po-body .rh-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
