/* review-analytics.css: only solution-review-analytics.html uses these rules. What we build: the NPS bridge, the owner's
   pick of 2026-10-22 (docs/superpowers/plans/2026-10-22-solutions-blocks.md). Colours take the roles of the site's
   approved charts: what lifts the score wears the case cards' growth gradient (--pos → --accent-2, .cc-num.m-up), what
   lowers it the anti-fraud case file's risk amber (--warn), the levels the KPI gradient (--text → --accent-soft,
   .sol-kpi), the path between steps the charts' grey base. Direction is never colour alone: every step carries its
   sign, and the bar falls or rises. Bars sit by --t (top) and --h (height) in % of the plot. */
.rax-panel {
  position: relative; isolation: isolate; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, transparent), transparent 38%), var(--surface-solid);
  transition: border-color .4s var(--ease);
}
.rax-panel::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-image: var(--grain); background-size: 140px 140px; opacity: .05; mix-blend-mode: overlay; }
.rax-snap, .rax-snap * { transition: none !important; }
.rax-panel:hover { border-color: color-mix(in srgb, var(--accent) 26%, var(--border)); }
.rax-mk {
  color: var(--text); border-radius: 4px; padding: 0 2px; margin: 0 -2px; -webkit-box-decoration-break: clone; box-decoration-break: clone;
  background: linear-gradient(var(--hl), var(--hl)) no-repeat 0 0 / 100% 100%; transition: background-size .7s var(--ease) var(--mk, 0s);
}
.rv-m { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; line-height: 1.4; color: var(--text-faint); }
.rv-m .rt { color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rv-b { min-width: 0; }
.rv-b p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: var(--text); text-wrap: pretty; }

.ra3 {
  --rest: 52%;
  --lv-c: var(--text); --lv-end: var(--text);
  --cn-c: color-mix(in srgb, var(--text) 38%, transparent);
}
/* v1: amber lowers, green lifts (as picked) */
/* A: losses in neutral grey, lifts in cyan; amber only on the result, March's level is the month's net loss */
/* B: amber stays on losses, cyan replaces green on lifts, the NPS itself (levels and the path) runs in the brand violet */
/* C: one brand violet; losses solid, lifts outlined */
.ra3 .dn { --c: var(--dn-c); --c-text: var(--dn-t); --hl: color-mix(in srgb, var(--dn-c) 22%, transparent); }
.ra3 .up { --c: var(--up-c); --c-text: var(--up-t); --hl: color-mix(in srgb, var(--up-c) 22%, transparent); }
.ra3 .dir { color: var(--c-text); transition: color .3s var(--ease); }

/* ===================== W3 · the NPS bridge ===================== */
.ra3 { --ph: 250px; }
.ra3-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 20px 26px 18px; border-bottom: 1px solid var(--border); }
.ra3-t { font-size: 13px; color: var(--text-muted); }
.ra3-verdict { margin-top: 6px; max-width: 36ch; font: 500 26px/1.18 var(--font-display); letter-spacing: -.03em; color: var(--text); text-wrap: balance; font-variant-numeric: tabular-nums; }
.ra3-leg { display: flex; gap: 18px; padding-top: 2px; font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.ra3-leg span { display: inline-flex; align-items: center; gap: 8px; }
.ra3-leg .sw { width: 14px; height: 8px; border-radius: 4px; background: var(--c); transition: background-color .3s var(--ease), box-shadow .3s var(--ease); }
.ra3-fig { padding: 32px 26px 0 22px; }
.ra3-plot { position: relative; padding-left: 40px; }
.ra3-grid { position: absolute; left: 40px; right: 0; top: 0; height: var(--ph); pointer-events: none; }
.ra3-grid .gl { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--border); }
.ra3-grid .yl { position: absolute; left: -40px; width: 30px; text-align: right; transform: translateY(-50%); font: 400 11.5px/1 var(--font-mono); color: var(--text-faint); font-variant-numeric: tabular-nums; }
.ra3-cols { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ra3-col { display: flex; flex-direction: column; min-width: 0; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: center; }
button.ra3-col { cursor: pointer; border-radius: 10px; transition: background-color .3s var(--ease); }
button.ra3-col:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.ra3-col .pa { position: relative; display: block; height: var(--ph); }
.ra3-col .bar {
  position: absolute; left: 20%; right: 20%; border-radius: 4px; background: color-mix(in srgb, var(--c) var(--rest), var(--surface-solid));
  transition: transform .5s var(--ease) var(--k, 0s), background-color .3s var(--ease), box-shadow .3s var(--ease);
}
.ra3-col .bar.fall { transform-origin: center top; }
.ra3-col .bar.rise { transform-origin: center bottom; }
button.ra3-col:hover .bar { background: color-mix(in srgb, var(--c) 78%, var(--surface-solid)); }
.ra3-col[aria-pressed="true"] .bar { background: var(--c); }
/* C: a lift is an outlined bar, so up and down differ by shape as well as by sign */
.ra3-col .cn { position: absolute; left: 80%; width: 40%; height: 0; border-top: 1px dashed var(--cn-c); transition: opacity .3s var(--ease) calc(var(--k, 0s) + .35s), border-color .3s var(--ease); }
.ra3-col.lvl .lv { position: absolute; left: 14%; right: 14%; height: 3px; margin-top: -1.5px; background: var(--lv-c); border-radius: 4px; transform-origin: left center; transition: transform .5s var(--ease) var(--k, 0s), background-color .3s var(--ease); }
.ra3-col.lvl.end .lv { background: var(--lv-end); }
.ra3-col.lvl .cn { left: 86%; width: 34%; }
.ra3-col .lvv { position: absolute; left: 0; right: 0; transform: translateY(calc(-100% - 9px)); font: 500 16px/1 var(--font-display); letter-spacing: -.01em; color: var(--text); font-variant-numeric: tabular-nums; transition: opacity .4s var(--ease) calc(var(--k, 0s) + .2s), color .3s var(--ease); }
.ra3-col .xl { display: flex; flex-direction: column; gap: 3px; padding: 14px 6px 12px; border-top: 1px solid var(--border-strong); }
.ra3-col .nm { min-height: 2.6em; font-size: 13px; line-height: 1.3; color: var(--text); text-wrap: balance; }
.ra3-col .d { font: 500 14px/1.3 var(--font-mono); color: var(--c-text, var(--text-muted)); font-variant-numeric: tabular-nums; transition: opacity .4s var(--ease) calc(var(--k, 0s) + .25s), color .3s var(--ease); }
.ra3-col .sh { font-size: 12px; line-height: 1.35; color: var(--text-faint); transition: opacity .4s var(--ease) calc(var(--k, 0s) + .25s); }
.ra3-ev { display: grid; margin: 8px 26px 0; padding-top: 18px; border-top: 1px solid var(--border); }
.ra3-evp { grid-area: 1 / 1; min-width: 0; visibility: hidden; opacity: 0; transition: opacity .25s var(--ease), visibility 0s linear .25s; }
.ra3-evp.on { visibility: visible; opacity: 1; transition: opacity .3s var(--ease); }
.ra3-evh { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
.ra3-evh b { font: 500 16px/1.25 var(--font-display); letter-spacing: -.01em; color: var(--text); }
.ra3-evh .dir { font-size: 13.5px; }
.ra3-evh .mn { margin-left: auto; font-size: 13px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.ra3-revs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; }
.ra3-rv { padding: 2px 20px 0; border-left: 1px solid var(--border); transition: opacity .45s var(--ease) var(--d, 0s), transform .45s var(--ease) var(--d, 0s); }
.ra3-rv:first-child { padding-left: 0; border-left: 0; }
.ra3-foot { margin: 20px 26px 22px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; line-height: 1.5; color: var(--text-faint); }
/* motion (js only): February's level, then each driver moves the score from where the last one left it, then March */
.ra3.pre .bar { transform: scaleY(0); }
.ra3.pre .lv { transform: scaleX(0); }
.ra3.pre .lvv, .ra3.pre .cn, .ra3.pre .xl .d, .ra3.pre .xl .sh { opacity: 0; }
.ra3-evp.enter .ra3-rv { opacity: 0; transform: translateY(6px); }

/* the site's colours */
.ra3 { --dn-c: var(--warn); --dn-t: var(--warn-text); --up-c: var(--pos); --up-t: var(--pos-text); }
.ra3-col .bar, .ra3-col .lv, .ra3-col .lvv, .ra3-col .cn, .ra3-grid .gl, .ra3-grid .yl { top: calc(var(--t) * 1%); }
.ra3-col .bar { height: calc(var(--h) * 1%); }
.ra3 .up .bar, .ra3-leg .up .sw { background: linear-gradient(180deg, color-mix(in srgb, var(--pos) var(--rest), var(--surface-solid)), color-mix(in srgb, var(--accent-2) var(--rest), var(--surface-solid))); }
.ra3 button.up:hover .bar { background: linear-gradient(180deg, color-mix(in srgb, var(--pos) 78%, var(--surface-solid)), color-mix(in srgb, var(--accent-2) 78%, var(--surface-solid))); }
.ra3 .up[aria-pressed="true"] .bar { background: linear-gradient(180deg, var(--pos), var(--accent-2)); }
.ra3-col .lvv { background: linear-gradient(135deg, var(--text), var(--accent-text)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ra3-col[aria-pressed="true"] .nm { font-weight: 500; }

@media (max-width: 1080px) { .ra3 { --ph: 230px; } }
@media (max-width: 760px) {
  .ra3-head { flex-direction: column; gap: 12px; }
  .ra3-leg { flex-wrap: wrap; gap: 8px 18px; }
  .ra3-revs { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .ra3-rv, .ra3-rv:first-child { padding: 0; border-left: 0; }
}
/* a phone lays the bridge on its side: one row per step, the score running left to right (34 → 42) */
@media (max-width: 640px) {
  .ra3 { --lw: 46%; }
  .ra3-head, .ra3-fig { padding-left: 16px; padding-right: 16px; }
  .ra3-ev, .ra3-foot { margin-left: 16px; margin-right: 16px; }
  .ra3-verdict { font-size: 22px; line-height: 1.3; }
  .ra3-fig { padding-top: 18px; padding-bottom: 26px; }
  .ra3-plot { padding-left: 0; }
  .ra3-cols { grid-template-columns: minmax(0, 1fr); }
  .ra3-col { display: grid; grid-template-columns: var(--lw) minmax(0, 1fr); align-items: center; text-align: left; min-height: 48px; border-top: 1px solid var(--border); }
  .ra3-col:first-child { border-top: 0; }
  .ra3-col .xl { order: -1; padding: 8px 10px 8px 0; border-top: 0; gap: 1px; }
  .ra3-col .nm { min-height: 0; font-size: 13.5px; }
  .ra3-col .d { font-size: 13px; }
  .ra3-col .sh { display: none; }
  .ra3-col .pa { height: 100%; min-height: 48px; }
  .ra3-col .bar { top: 50%; height: 14px; margin-top: -7px; left: calc((100 - var(--t) - var(--h)) * 1%); right: auto; width: max(3px, calc(var(--h) * 1%)); }
  .ra3-col .bar.fall { transform-origin: right center; }
  .ra3-col .bar.rise { transform-origin: left center; }
  .ra3-col .cn { display: none; }
  .ra3-col.lvl .lv { top: 50%; left: calc((100 - var(--t)) * 1%); right: auto; width: 3px; height: 22px; margin: -11px 0 0 -1.5px; transform-origin: center; }
  .ra3-col .lvv { top: 50%; left: calc((100 - var(--t)) * 1%); right: auto; transform: translate(-50%, calc(-100% - 12px)); font-size: 14px; }
  .ra3-col.lvl .lvv { transform: translate(8px, -50%); }
  .ra3-col.lvl.end .lvv { transform: translate(calc(-100% - 8px), -50%); }
  .ra3.pre .bar { transform: scaleX(0); }
  .ra3.pre .lv { transform: scaleY(0); }
  .ra3-grid { left: var(--lw); right: 0; top: 0; bottom: 0; height: auto; }
  .ra3-grid .gl { top: 0; bottom: 0; left: calc((100 - var(--t)) * 1%); right: auto; height: auto; border-top: 0; border-left: 1px solid var(--border); }
  .ra3-grid .yl { top: auto; bottom: -22px; left: calc((100 - var(--t)) * 1%); width: auto; transform: translateX(-50%); text-align: center; font-size: 12px; }
  .ra3-grid .yl:first-of-type { transform: translateX(-2px); }
  .ra3-grid .yl:last-of-type { transform: translateX(calc(-100% + 2px)); }
}
@media (prefers-reduced-motion: reduce) {
  .rax-panel *, .rax-panel { transition: none !important; }
}
