:root {
  --ink: #1a1a1a; --muted: #666; --rule: #e3e3e3; --bg: #fff; --soft: #f6f7f9;
  --cnn: #c0392b; --vo: #17806d; --vt: #6c4bb0;
  --good: 37, 99, 168;   /* blue  = better rank / positive */
  --bad: 214, 90, 49;    /* orange = negative correlation */
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: #1d5fa8; }
img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 20px; }
h1 { font-size: 44px; line-height: 1.1; margin: 0 0 6px; letter-spacing: -.02em; }
h2 { font-size: 24px; margin: 56px 0 6px; padding-top: 24px; border-top: 1px solid var(--rule); }
h3 { font-size: 17px; margin: 28px 0 4px; }
p { margin: 0 0 12px; }
.muted, .note { color: var(--muted); font-size: 14px; }
.note { margin: 6px 0 0; }

/* header */
header { padding: 48px 0 24px; }
.sub { font-size: 19px; color: #333; margin: 0 0 16px; }
.authors { margin: 0 0 4px; }
.affil { font-size: 13px; color: var(--muted); margin: 0 0 16px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a, .links span { padding: 6px 14px; border: 1px solid var(--rule); border-radius: 6px; text-decoration: none; font-size: 14px; color: var(--ink); }
.links a:hover { background: var(--soft); }
.links .pri { background: var(--ink); color: #fff; border-color: var(--ink); }
.links .off { color: var(--muted); border-style: dashed; }
figure { margin: 24px 0; }
figcaption { font-size: 13px; color: var(--muted); text-align: center; margin-top: 6px; }

.stats { display: flex; gap: 32px; flex-wrap: wrap; margin: 20px 0 0; }
.stats div b { display: block; font-size: 28px; line-height: 1.1; }
.stats div span { font-size: 13px; color: var(--muted); }

/* tables */
.tw { overflow-x: auto; margin: 12px 0 0; }
table.t { border-collapse: collapse; width: 100%; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.t th, .t td { padding: 5px 8px; text-align: center; border-bottom: 1px solid #fff; white-space: nowrap; }
.t th { font-weight: 600; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--rule); vertical-align: bottom; }
.t th.sortable { cursor: pointer; } .t th.sortable:hover { color: var(--ink); }
.t th.cur { color: var(--ink); } .t th.cur::after { content: " ↓"; }
.t th.l, .t td.l { text-align: left; }
.t td.l { font-weight: 500; background: none; }
.t tr.sup td.l { font-style: italic; color: var(--muted); font-weight: 400; }
.t tr.fam td { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding-top: 14px; color: var(--c); border-bottom: 1px solid var(--rule); background: none !important; }
.t tr:not(.fam):hover td.l { text-decoration: underline; }
.t td.na { color: #aaa; }
.t td.mean, .t th.mean { border-left: 1px solid var(--rule); font-weight: 700; }
.t td.win { font-weight: 700; }
.legend { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.legend i { display: inline-block; width: 120px; height: 10px; border-radius: 2px; background: linear-gradient(90deg, rgba(var(--good), .08), rgba(var(--good), .8)); }
.legend i.div { background: linear-gradient(90deg, rgba(var(--bad), .7), #fff, rgba(var(--good), .7)); }

.ctrl { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 13.5px; margin-bottom: 6px; }
select { font: inherit; padding: 4px 6px; border: 1px solid var(--rule); border-radius: 6px; background: #fff; max-width: 100%; }
.presets button { font: inherit; font-size: 12.5px; background: #fff; border: 1px solid var(--rule); border-radius: 6px; padding: 3px 10px; cursor: pointer; }
.presets button:hover { background: var(--soft); }
.readout { font-size: 13.5px; min-height: 2.6em; border-top: 1px solid var(--rule); padding-top: 6px; }
.takeaway { background: var(--soft); border-radius: 6px; padding: 10px 14px; margin: 14px 0 0; font-size: 15px; }
ol.obs { padding-left: 1.2em; } ol.obs li { margin-bottom: 8px; }
.cnn-c { color: var(--cnn); } .vo-c { color: var(--vo); } .vt-c { color: var(--vt); }

pre { background: var(--soft); border: 1px solid var(--rule); border-radius: 6px; padding: 12px 14px; overflow-x: auto; font: 13px/1.5 ui-monospace, Menlo, monospace; margin: 6px 0 16px; }
.bib-h { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; font-size: 14px; margin-top: 14px; }
.bib-h button { font: inherit; font-size: 12px; background: none; border: 1px solid var(--rule); border-radius: 6px; padding: 2px 10px; cursor: pointer; color: var(--muted); }
footer { border-top: 1px solid var(--rule); margin-top: 56px; padding: 20px 0 48px; font-size: 13px; color: var(--muted); }
@media (max-width: 560px) { h1 { font-size: 34px; } body { font-size: 15px; } }
