/* /stats, WoW Forever by the numbers (scripts/lib/templates/tools/forever-stats.mjs,
   ops/design/templates/tool/forever-stats-contract.md). The strip of six figures is the answer;
   each chart section follows with its finding, its facts, the chart and two disclosures.

   Chart colors: the talent-state hues stepped into the dark band and validated with the
   dataviz palette check against --bg-2 (#1c1a17). The game's own --new and --reworked are too
   light for marks (OKLCH L .87 and .78). New and changed pass the CVD gate (deutan 9.5); the
   unchanged gray is the recessive remainder at 2:1, so every row also prints its value and the
   table view holds the numbers. Text never wears a series color. Brand v2.1 tokens otherwise. */

.st-page {
  --st-new: #2bb11f;
  --st-changed: #b35800;
  --st-unchanged: #4f4b45;
  --st-base: #75706a;
  --st-single: #b98c06;
  --st-surface: var(--bg-2);
  padding-bottom: var(--s-6);
}
.st-head .wfg-page-head { padding-bottom: var(--s-2); }
.st-head .wfg-page-meta span + span::before { content: "·"; margin: 0 .45rem; color: var(--ink-3); }

/* ---------- The strip: six figures ---------- */

.st-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 44rem) { .st-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 72rem) { .st-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.st-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: .55rem .7rem .6rem;
  border: 1px solid var(--edge);
  border-top: 2px solid color-mix(in srgb, var(--accent) var(--mix-line), transparent);
  box-shadow: var(--panel-frame);
  background: var(--bg-2);
  scroll-margin-top: var(--sticky-top);
}
.st-tile:target { box-shadow: var(--panel-frame), 0 0 0 2px var(--accent); }
.st-tile p { margin: 0; }
.st-value { font: 400 clamp(1.75rem, 1.4rem + 1.2vw, 2.35rem)/1 var(--font-display); letter-spacing: .01em; }
.st-value a { color: var(--accent-text); text-decoration: none; }
.st-value a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .15em; }
.st-label { margin-top: .2rem !important; color: var(--ink); font: 400 .88rem/1.25 var(--font-ui); }
.st-label .wfg-ev { vertical-align: -.2em; }
.st-context { margin-top: .2rem !important; color: var(--ink-3); font: 400 .78rem/1.35 var(--font-body); }
.st-cite {
  align-self: flex-start;
  min-height: 1.75rem;
  margin-top: auto;
  padding: .25rem 0 0;
  border: 0;
  background: none;
  color: var(--ink-2);
  font: 400 .76rem/1.2 var(--font-ui);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: .2em;
  cursor: pointer;
}
.st-cite:hover { color: var(--ink); text-decoration-color: currentColor; }
.st-cite[hidden] { display: none; }
.st-cite[data-state="done"] { color: var(--evidence-confirmed); text-decoration: none; }
.st-strip-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2) var(--s-4);
  margin-top: var(--s-3);
}
.st-strip-note { flex: 1 1 22rem; display: grid; gap: .35rem; }
.st-strip-note p, .st-strip-note .wfg-intro { max-width: var(--measure); margin: 0; color: var(--ink-3); font: 400 .86rem/1.45 var(--font-body); }
.st-strip-foot code { color: var(--ink-2); font: .82rem ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }

/* ---------- Sections ---------- */

.st-sections { display: grid; gap: var(--s-6); margin-top: var(--s-6); }
.st-section { min-width: 0; scroll-margin-top: var(--sticky-top); }
.st-section h2 {
  margin: 0;
  font: 400 clamp(1.5rem, 1.25rem + .9vw, 1.95rem)/1.1 var(--font-display);
}
.st-section h2::after { content: ""; display: block; width: 2.5rem; height: 2px; margin-top: .35rem; background: color-mix(in srgb, var(--accent) var(--mix-line), transparent); }
.st-takeaway { max-width: var(--measure); margin: var(--s-2) 0 0; color: var(--ink-2); font: 400 1rem/1.5 var(--font-body); }
.st-facts { max-width: var(--measure); margin: var(--s-2) 0 0; padding: 0; list-style: none; }
.st-facts li {
  position: relative;
  margin: 0;
  padding: .3rem 0 .3rem 1rem;
  color: var(--ink-2);
  font: 400 .92rem/1.45 var(--font-body);
  scroll-margin-top: var(--sticky-top);
}
.st-facts li::before { content: ""; position: absolute; left: .1rem; top: .85em; width: .4rem; height: 2px; background: var(--line-strong); }
.st-facts li:target { background: color-mix(in srgb, var(--accent) var(--mix-wash), transparent); }
.st-facts .wfg-ev { vertical-align: -.2em; }
.st-permalink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  min-height: 1.75rem;
  margin-left: .1rem;
  color: var(--ink-3);
  font: 400 .85rem/1 var(--font-ui);
  text-decoration: none;
  vertical-align: middle;
}
.st-permalink:hover { color: var(--accent-text); }

/* ---------- The figure ---------- */

.st-figure {
  margin: var(--s-3) 0 0;
  padding: var(--s-3) var(--s-3) var(--s-2);
  border: 1px solid var(--edge);
  box-shadow: var(--panel-frame);
  background: var(--st-surface);
}
.st-legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: 0 0 var(--s-3); padding: 0; list-style: none; color: var(--ink-2); font: 400 .82rem/1.3 var(--font-ui); }
.st-legend li { display: inline-flex; align-items: center; gap: .4rem; }
.st-key { display: inline-block; width: .75rem; height: .75rem; border-radius: 2px; }
.st-key[data-s="new"], .st-seg[data-s="new"] { background: var(--st-new); }
.st-key[data-s="changed"], .st-seg[data-s="changed"] { background: var(--st-changed); }
.st-key[data-s="unchanged"], .st-seg[data-s="unchanged"] { background: var(--st-unchanged); }
.st-key[data-s="base"], .st-seg[data-s="base"] { background: var(--st-base); }

/* The plot: rows of name, track and end label; a grid layer behind the tracks carries the
   hairline ticks and their labels under the last row. */
/* One label column and one value column for every chart, so the plots line up down the page. */
.st-plot {
  --name-w: 11.5rem;
  --end-w: 8rem;
  --gap: .75rem;
  --axis-h: 1.5rem;
  position: relative;
  padding-bottom: var(--axis-h);
}
.st-grid {
  position: absolute;
  top: 0;
  bottom: var(--axis-h);
  left: calc(var(--name-w) + var(--gap));
  right: calc(var(--end-w) + var(--gap));
  pointer-events: none;
}
.st-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--hairline); }
.st-tick span {
  position: absolute;
  top: calc(100% + .3rem);
  left: 0;
  transform: translateX(-50%);
  color: var(--ink-3);
  font: 400 .72rem/1 var(--font-ui);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.st-tick.is-start span { transform: none; }
.st-tick.is-end span { transform: translateX(-100%); }
.st-axis-label { margin: .35rem 0 0; color: var(--ink-3); font: 400 .72rem/1.2 var(--font-ui); text-align: center; }
.st-plot .st-axis-label { position: absolute; left: calc(var(--name-w) + var(--gap)); right: calc(var(--end-w) + var(--gap)); bottom: -1.2rem; }
.st-plot:has(.st-axis-label) { margin-bottom: 1.2rem; }
.st-chart { position: relative; z-index: 1; margin: 0; padding: 0; list-style: none; }
.st-row {
  display: grid;
  grid-template-columns: var(--name-w) minmax(0, 1fr) var(--end-w);
  align-items: center;
  gap: var(--gap);
  min-height: 1.9rem;
  border-radius: var(--r-ctl);
  cursor: default;
}
.st-row:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.st-name { overflow: hidden; color: var(--ink); font: 400 .9rem/1.2 var(--font-ui); text-overflow: ellipsis; white-space: nowrap; }
.st-end { color: var(--ink); font: 400 .86rem/1.2 var(--font-ui); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.st-track { position: relative; display: block; height: .95rem; }
.st-bar { display: flex; gap: 2px; height: 100%; }
.st-seg { flex-basis: 0; min-width: 3px; }
.st-seg:last-child { border-radius: 0 4px 4px 0; }
.st-span { position: absolute; top: 0; height: 100%; border-radius: 3px; background: var(--st-single); }
.st-span.is-point { background: none; }
.st-span.is-point::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: .75rem;
  height: .75rem;
  border-radius: 50%;
  background: var(--st-single);
  box-shadow: 0 0 0 2px var(--st-surface);
  transform: translate(-50%, -50%);
}
@media (hover: hover) {
  .st-row:hover .st-bar, .st-row:hover .st-span, .st-row.is-active .st-bar, .st-row.is-active .st-span { filter: brightness(1.18); }
  .st-row:hover .st-name, .st-row.is-active .st-name { color: var(--accent-text); }
}
.st-row.is-active .st-name { color: var(--accent-text); }

/* Phones: the name and the end label share a line, the track runs the full width under them. */
@media (max-width: 40rem) {
  .st-plot { --gap: .5rem; }
  .st-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name end" "track track"; row-gap: .2rem; padding: .2rem 0; }
  .st-name { grid-area: name; }
  .st-end { grid-area: end; }
  .st-track { grid-area: track; }
  .st-grid, .st-plot .st-axis-label { left: 0; right: 0; }
}

.st-caption-text { display: block; max-width: 80ch; }
.st-nowrap { white-space: nowrap; }
.st-caption { margin-top: var(--s-3); padding-top: var(--s-2); border-top: 1px solid var(--hairline); color: var(--ink-3); font: 400 .82rem/1.45 var(--font-body); }
.st-caption .wfg-ev { vertical-align: -.2em; }

/* The chart tooltip (public/stats.js): one node, the site's tooltip ground; values lead. */
.st-tip {
  position: fixed;
  z-index: 60;
  top: 0;
  left: 0;
  max-width: min(18rem, calc(100vw - 1rem));
  padding: .45rem .6rem .5rem;
  border: 1px solid var(--edge);
  background: var(--tip-ground);
  box-shadow: var(--shadow-inner);
  color: var(--ink);
  font: 400 .84rem/1.35 var(--font-ui);
  pointer-events: none;
}
.st-tip[hidden] { display: none; }
.st-tip p { margin: 0; }
.st-tip-title { margin-bottom: .2rem !important; color: var(--accent-text); font-size: .95rem; }
.st-tip-line { display: flex; align-items: baseline; gap: .45rem; }
.st-tip-line b { font-weight: 400; color: var(--ink); font-variant-numeric: tabular-nums; }
.st-tip-line span { color: var(--tip-muted); }
.st-tip-key { display: inline-block; flex: none; width: .8rem; height: 2px; transform: translateY(-.2em); }
.st-tip-key[data-s="new"] { background: var(--st-new); }
.st-tip-key[data-s="changed"] { background: var(--st-changed); }
.st-tip-key[data-s="unchanged"] { background: var(--st-unchanged); box-shadow: 0 0 0 1px var(--line-strong); }
.st-tip-key[data-s="base"] { background: var(--st-base); }

/* ---------- Use this chart, table view ---------- */

/* The chart's footer: its two disclosures sit on the figure's frame, not loose under it. */
.st-use {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--edge);
  border-top: 1px solid var(--hairline);
  box-shadow: inset 1px 0 0 var(--edge-inner), inset -1px 0 0 var(--edge-inner), inset 0 -1px 0 var(--edge-inner);
  background: var(--st-surface);
}
.st-figure:has(+ .st-use) { border-bottom: 0; box-shadow: inset 1px 0 0 var(--edge-inner), inset -1px 0 0 var(--edge-inner), inset 0 1px 0 var(--edge-lit); }
.st-details { flex: 0 1 auto; min-width: 0; }
.st-details[open] { flex: 1 1 100%; }
.st-details > summary {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 2.75rem;
  padding: .5rem .9rem;
  border-radius: var(--r-ctl);
  box-shadow: inset 0 0 0 1px var(--line-control);
  color: var(--ink);
  font: 400 .95rem/1.2 var(--font-ui);
  list-style: none;
  cursor: pointer;
}
.st-details > summary::-webkit-details-marker { display: none; }
.st-details > summary::after { content: ""; width: .45rem; height: .45rem; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-.15rem) rotate(45deg); }
.st-details[open] > summary::after { transform: translateY(.1rem) rotate(-135deg); }
.st-details > summary:hover { box-shadow: inset 0 0 0 1px var(--ink-3); }
@media (max-width: 40rem) {
  .st-use { padding: var(--s-2); gap: var(--s-1) var(--s-2); }
  .st-details > summary { padding: .5rem .7rem; font-size: .9rem; }
}
.st-details-body { display: grid; gap: var(--s-3); margin-top: var(--s-2); padding: var(--s-3); border: 1px solid var(--edge); box-shadow: var(--panel-frame); background: var(--bg-2); }
.st-copy-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem .5rem; align-items: start; }
.st-copy-field label { grid-column: 1 / -1; color: var(--ink-3); font: 400 .78rem/1.2 var(--font-ui); letter-spacing: .04em; text-transform: uppercase; }
.st-copy-field textarea {
  width: 100%;
  min-height: 3.5rem;
  padding: .45rem .55rem;
  border: 1px solid var(--line-control);
  border-radius: var(--r-ctl);
  background: var(--bg-3);
  color: var(--ink);
  font: .8rem/1.45 ui-monospace, Consolas, monospace;
  resize: vertical;
}
.st-copy-field .st-copy[hidden] { display: none; }
@media (max-width: 40rem) {
  .st-copy-field { grid-template-columns: minmax(0, 1fr); }
  .st-copy-field .st-copy { justify-self: start; }
}
.st-copy-field:has(.st-copy[hidden]) textarea { grid-column: 1 / -1; }
.st-copy[data-state="done"] { box-shadow: inset 0 0 0 1px var(--evidence-confirmed); }
.st-downloads { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 0; }
.st-download, .st-more {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 1.75rem;
  color: var(--ink);
  font: 400 .9rem/1.2 var(--font-ui);
}
.st-download small { padding: .05rem .3rem; border: 1px solid var(--line-strong); border-radius: 2px; color: var(--ink-3); font-size: .68rem; letter-spacing: .05em; }
.st-section > .st-downloads { margin-top: var(--s-2); }

.st-table-scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--edge); background: var(--bg); }
.st-table-scroll + .st-table-scroll { margin-top: var(--s-3); }
.st-section > .st-table-scroll { margin-top: var(--s-3); max-width: 40rem; }
.st-table { width: 100%; border-collapse: collapse; color: var(--ink); font: 400 .88rem/1.3 var(--font-ui); font-variant-numeric: tabular-nums; }
.st-table caption { padding: .55rem .65rem; color: var(--ink-2); font: 400 .88rem/1.4 var(--font-body); text-align: left; }
.st-table th, .st-table td { padding: .45rem .65rem; border-bottom: 1px solid var(--hairline); text-align: left; white-space: nowrap; }
.st-table thead th { border-bottom: 2px solid color-mix(in srgb, var(--accent) var(--mix-line), transparent); color: var(--ink-2); font-size: .8rem; letter-spacing: .03em; }
.st-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--accent) var(--mix-faint), transparent); }
.st-table tbody tr:hover { background: color-mix(in srgb, var(--accent) var(--mix-wash), transparent); }
.st-table tbody th { font-weight: 400; }
.st-table .is-num { text-align: right; }
.st-table .wfg-evidence-word { margin-left: .3rem; }

/* ---------- Lower ---------- */

.st-lower { margin-top: var(--s-7); }
.st-lower #data-sources { max-width: 48rem; }
.st-revisions { padding-left: 1.2em; }
.st-revisions time { color: var(--ink-3); margin-right: .35rem; }

@media (prefers-reduced-motion: reduce) {
  .st-row .st-bar, .st-row .st-span, .st-details > summary::after { transition: none; }
}
@media (forced-colors: active) {
  .st-seg, .st-span, .st-key, .st-span.is-point::after { forced-color-adjust: none; border: 1px solid CanvasText; }
}
.st-article { margin-top: var(--s-6); }
