:root {
  color-scheme:light;
  --paper:#ffffff;
  --surface:#ffffff;
  --ink:#1d2521;
  --muted:#45514b;
  --line:#dce0d7;
  --green:#245844;
  --soft:#f5f6f5;
  --grid:#e9eae3;
  --shadow:none;
  --s1:#0072b2;
  --s2:#a86900;
  --s3:#009e73;
  --s4:#9b7a00;
  --s5:#a45186;
  --s6:#656b73;
  --s7:#d55e00;
  --s8:#268ab7;
  --s9:#864ead;
}
:root[data-theme=dark] {
  color-scheme:dark;
  --paper:#171e1b;
  --surface:#1e2722;
  --ink:#eceee6;
  --muted:#c3cdc5;
  --line:#38463c;
  --green:#a4c8a9;
  --soft:#2a382e;
  --grid:#303d34;
  --shadow:none;
  --s1:#56b4e9;
  --s2:#e69f00;
  --s3:#65cea7;
  --s4:#f0e442;
  --s5:#d995ce;
  --s6:#b6bdc4;
  --s7:#f08c56;
  --s8:#b7ddf4;
  --s9:#bb9af7;
}
* {
  box-sizing:border-box;
}
html {
  scroll-behavior:smooth;
  scroll-padding-top:24px;
}
body {
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font:18px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  -webkit-font-smoothing:antialiased;
}
a {
  color:inherit;
  text-underline-offset:4px;
}
button,input,select {
  font:inherit;
  color:inherit;
}
button,a,input,select {
  -webkit-tap-highlight-color:transparent;
}
button {
  cursor:pointer;
}
button:disabled {
  cursor:default;
}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,[tabindex]:focus-visible {
  outline:2px solid var(--green);
  outline-offset:4px;
}
button {
  border:0;
}
button,select {
  background:var(--surface);
}
[hidden] {
  display:none!important;
}
.wrap {
  max-width:1280px;
  margin:auto;
  padding-left:48px;
  padding-right:48px;
}
.masthead {
  height:91px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
}
.brand {
  display:flex;
  align-items:center;
  gap:7px;
  text-decoration:none;
  font-size:24px;
  font-weight:650;
  letter-spacing:-.7px;
}
.brand span {
  font-weight:400;
  color:var(--muted);
  margin-left:-5px;
}
.brand svg {
  margin-right:5px;
  stroke:var(--green);
  fill:var(--paper);
  stroke-width:1.7;
}
.masthead nav {
  display:flex;
  gap:26px;
  align-items:center;
  font-size:18px;
}
.masthead nav a {
  text-decoration:none;
}
.masthead nav a:hover {
  color:var(--green);
  text-decoration:underline;
}
.icon-button {
  background:transparent;
  border:1px solid var(--line);
  border-radius:50%;
  width:32px;
  height:32px;
  font-size:24px;
  line-height:1;
}
.explore {
  padding-top:28px;
  border-top:1px solid var(--line);
}
.dataset-row {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
}
.segmented {
  display:flex;
  gap:4px;
  border:1px solid var(--line);
  padding:4px;
  border-radius:9px;
  background:var(--soft);
}
.segmented button {
  padding:9px 18px;
  background:transparent;
  border-radius:6px;
  font-size:18px;
  color:var(--muted);
  transition:background .25s ease,color .25s ease,box-shadow .25s ease;
}
.segmented button[aria-pressed=true] {
  background:var(--surface);
  color:var(--ink);
  box-shadow:0 1px 5px #142a1610;
  font-weight:600;
}
.secondary {
  color:var(--muted);
}
.small {
  font-size:18px;
}
.explore>p {
  font-size:18px;
  margin:12px 0 0;
}
.split-details {
  margin-top:12px;
  font-size:18px;
}
.split-details summary {
  cursor:pointer;
}
.split-details summary span {
  color:var(--muted);
}
.split-membership {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:20px;
}
.split-membership h3 {
  font-size:18px;
  font-weight:500;
}
.split-membership ol {
  max-height:180px;
  overflow:auto;
  padding:0 0 0 32px;
  font:16px/1.8 ui-monospace,monospace;
  overflow-wrap:anywhere;
}
@media(max-width:760px) {
  .split-membership { grid-template-columns:1fr; gap:0; }
}
.results-grid {
  display:grid;
  grid-template-columns:minmax(0,1.9fr) minmax(270px,1fr);
  gap:18px;
  margin-bottom:20px;
}
.panel {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:12px;
  padding:24px;
  box-shadow:var(--shadow);
  min-width:0;
}
.panel-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
}
h2 {
  font-family:Georgia,"Times New Roman",serif;
  font-weight:400;
  font-size:30px;
  line-height:1.3;
  letter-spacing:-.4px;
  margin:0;
}
.direction {
  font-size:16px;
  white-space:nowrap;
  color:var(--muted);
}
.curve-panel>.secondary {
  margin:12px 0;
}
.legend {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin:18px 0 12px;
}
.legend button {
  border-radius:4px;
  border:1px solid var(--line);
  background:transparent;
  padding:7px 10px;
  font-size:16px;
  max-width:100%;
  flex-wrap:wrap;
  display:flex;
  align-items:center;
  gap:6px;
}
.legend button[aria-pressed=false] {
  border-style:dashed;
  border-color:var(--muted);
  color:var(--muted);
}
.legend button[aria-pressed=true] {
  border-color:var(--ink);
  background:var(--soft);
  font-weight:600;
}
.legend .swatch {
  width:20px;
  height:auto;
  font-size:22px;
  font-style:normal;
  line-height:1;
}
.model-parameters {
  color:var(--muted);
  border-left:1px solid var(--line);
  padding-left:6px;
  font-variant-numeric:tabular-nums;
}
.legend-note {
  margin:0 0 8px;
}
.swatch {
  width:10px;
  height:10px;
  border-radius:50%;
  display:inline-block;
  flex-shrink:0;
}
.chart {
  position:relative;
  min-height:282px;
}
.chart svg {
  display:block;
  width:100%;
  overflow:visible;
}
.chart svg text {
  font:16px ui-monospace,SFMono-Regular,Consolas,monospace;
  fill:var(--muted);
}
.chart svg .axis-title {
  font-size:16px;
  letter-spacing:.6px;
}
.chart-controls {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:15px;
  padding-top:12px;
  border-top:1px solid var(--line);
  font-size:16px;
  color:var(--muted);
}
.chart-controls label {
  display:flex;
  align-items:center;
  gap:5px;
  cursor:pointer;
}
input[type=checkbox] {
  accent-color:var(--green);
  width:16px;
  height:16px;
  margin:0;
}
.text-button {
  background:none;
  padding:0;
  color:var(--green);
  font-size:16px;
  text-decoration:underline;
  text-underline-offset:3px;
  margin-left:auto;
}
.footnote {
  font-size:16px;
  color:var(--muted);
  line-height:1.7;
  margin:14px 0 0;
}
.horizon-label {
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:16px;
  margin:24px 0 12px;
}
.horizon-label output {
  font:16px ui-monospace,SFMono-Regular,Consolas,monospace;
  color:var(--green);
  background:var(--soft);
  padding:4px 8px;
  border-radius:4px;
}
input[type=range] {
  width:100%;
  height:4px;
  accent-color:var(--green);
  margin:7px 0;
  cursor:pointer;
}
.range-labels {
  display:flex;
  justify-content:space-between;
  font:16px ui-monospace,SFMono-Regular,Consolas,monospace;
  color:var(--muted);
}
.ranking-caption {
  display:flex;
  justify-content:space-between;
  font:16px ui-monospace,SFMono-Regular,Consolas,monospace;
  letter-spacing:1px;
  color:var(--muted);
  border-bottom:1px solid var(--line);
  padding:24px 0 10px;
}
.ranking {
  padding:0;
  margin:0;
  list-style:none;
}
.ranking li {
  padding:12px 0 11px;
  border-bottom:1px solid var(--line);
}
.rank-line {
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  gap:8px;
  align-items:center;
  font-size:18px;
}
.rank-name {
  display:flex;
  align-items:center;
  gap:8px;
}
.rank-number {
  font:16px ui-monospace,SFMono-Regular,Consolas,monospace;
  color:var(--muted);
  width:18px;
}
.rank-score {
  margin-left:auto;
  font:18px ui-monospace,SFMono-Regular,Consolas,monospace;
  white-space:nowrap;
}
.rank-score small {
  font-size:16px;
  color:var(--muted);
}
.rank-meta {
  display:flex;
  flex-wrap:wrap;
  gap:4px 8px;
  justify-content:space-between;
  margin:6px 0 0 20px;
  font-size:16px;
  color:var(--muted);
}
.rank-bar {
  height:5px;
  background:var(--soft);
  margin:7px 0 0 20px;
  border-radius:2px;
  overflow:hidden;
}
.rank-bar span {
  display:block;
  height:100%;
  border-radius:2px;
}
.runs-panel {
  margin-top:0;
}
.outline-button {
  background:transparent;
  border:1px solid var(--line);
  border-radius:6px;
  padding:8px 12px;
  font-size:16px;
}
.outline-button:hover {
  background:var(--soft);
}
.table-controls {
  display:flex;
  gap:18px;
  align-items:center;
  margin:24px 0 16px;
  font-size:16px;
}
.table-controls>span {
  margin-left:auto;
}
.table-controls label:not(.search-label) {
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--muted);
}
input[type=search] {
  background:transparent;
  border:0;
  outline-offset:1px;
  width:170px;
  font-size:16px;
  padding:7px 4px;
}
.search-label {
  display:flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--line);
  border-radius:5px;
  padding:0 9px;
}
.search-label>span {
  font-size:26px;
  line-height:1;
  color:var(--muted);
}
select {
  font-size:16px;
  border:1px solid var(--line);
  padding:6px 8px;
  border-radius:5px;
}
.table-scroll {
  overflow-x:auto;
}
table {
  width:100%;
  border-collapse:collapse;
  font-size:16px;
  white-space:nowrap;
}
th {
  text-align:right;
  font-size:16px;
  font-weight:500;
  letter-spacing:.3px;
  color:var(--muted);
  background:var(--soft);
}
th button {
  font:inherit;
  letter-spacing:inherit;
  background:none;
  padding:12px 10px;
  width:100%;
  text-align:inherit;
}
th[aria-sort=ascending] button:after {
  content:" ↑";
}
th[aria-sort=descending] button:after {
  content:" ↓";
}
th:first-child {
  text-align:left;
}
td {
  border-bottom:1px solid var(--line);
  text-align:right;
  padding:12px 10px;
  font-variant-numeric:tabular-nums;
}
td:first-child {
  text-align:left;
  min-width:180px;
}
tbody tr:hover {
  background:var(--soft);
}
td details summary {
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:7px;
  font-weight:500;
}
td details summary:after {
  content:"+";
  font-weight:400;
  color:var(--muted);
  margin-left:5px;
}
td details[open] summary:after {
  content:"−";
}
td details dl {
  white-space:normal;
  max-width:230px;
  margin:10px 0 0;
  font:16px/1.8 ui-monospace,monospace;
  color:var(--muted);
}
td dt {
  display:inline;
}
td dd {
  display:inline;
  margin-left:5px;
}
td dd:after {
  content:"";
  display:block;
}
.seed-pill {
  display:inline-block;
  border:1px solid var(--line);
  border-radius:4px;
  padding:1px 7px;
  font:16px ui-monospace,monospace;
}
.score-cell {
  color:var(--green);
  font-weight:600;
}
.empty {
  padding:40px 10px;
  text-align:center;
  color:var(--muted);
  font-size:18px;
}
footer {
  display:flex;
  justify-content:space-between;
  gap:15px;
  align-items:center;
  border-top:1px solid var(--line);
  padding-top:22px!important;
  padding-bottom:28px!important;
  font:16px ui-monospace,SFMono-Regular,Consolas,monospace;
  color:var(--muted);
}
footer a {
  text-decoration:none;
}
.brand-small {
  font-weight:600;
  font-size:16px;
  color:var(--ink);
}
.notice {
  padding:22px 0;
  font-size:18px;
  color:var(--muted);
}
.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
.skip {
  position:absolute;
  top:-60px;
  left:20px;
  padding:10px;
  background:var(--surface);
  z-index:20;
}
.skip:focus {
  top:10px;
}
@media(min-width:1500px) {
  .wrap {
    max-width:1380px;
  }
  .chart {
    min-height:310px;
  }
}
@media(max-width:1000px) {
  .wrap {
    padding-left:28px;
    padding-right:28px;
  }
  .results-grid {
    grid-template-columns:minmax(0,1.5fr) minmax(260px,1fr);
  }
  .panel {
    padding:20px;
  }
  .direction {
    display:none;
  }
}
@media(max-width:760px) {
  .wrap {
    padding-left:22px;
    padding-right:22px;
  }
  .masthead {
    height:72px;
  }
  .masthead nav {
    gap:16px;
    font-size:16px;
  }
  .masthead nav a:first-child {
    display:none;
  }
  .brand {
    font-size:22px;
  }
  .results-grid {
    grid-template-columns:1fr;
  }
  .dataset-row {
    flex-wrap:wrap;
  }
  .segmented {
    width:100%;
  }
  .segmented button {
    flex:1;
    padding:9px 12px;
  }
  .panel {
    padding:20px;
  }
  .ranking-panel .ranking {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:0 22px;
  }
  .ranking-caption {
    padding-top:18px;
  }
  .chart {
    min-height:260px;
  }
  .ranking-panel .footnote {
    max-width:550px;
  }
  .table-controls {
    flex-wrap:wrap;
    gap:12px;
  }
  .table-controls>span {
    margin-left:0;
    font-size:16px;
  }
  .runs-panel .panel-heading {
    align-items:flex-start;
  }
  .runs-panel h2 {
    font-size:26px;
  }
  .outline-button {
    white-space:nowrap;
    padding:7px 9px;
    font-size:16px;
  }
  footer {
    flex-wrap:wrap;
    font-size:16px;
  }
  footer #generated {
    order:3;
    width:100%;
  }
}
@media(max-width:390px) {
  .wrap {
    padding-left:16px;
    padding-right:16px;
  }
  .masthead nav {
    gap:12px;
  }
  .ranking-panel .ranking {
    grid-template-columns:1fr;
  }
  .panel {
    padding:16px;
  }
  .chart-controls {
    gap:10px;
  }
  .runs-panel .panel-heading {
    flex-wrap:wrap;
  }
}
@media(prefers-reduced-motion:reduce) {
  html {
    scroll-behavior:auto;
  }
}
.plot-filters {
  display:flex;
  gap:18px;
  flex-wrap:wrap;
  align-items:center;
  margin-top:18px;
  font-size:16px;
  color:var(--muted);
}
.plot-filters label {
  display:flex;
  align-items:center;
  gap:7px;
}
.plot-filters select {
  font-size:16px;
}
.plot-filters .mode-toggle {
  width:auto;
  padding:2px;
  gap:2px;
  border-radius:6px;
}
.plot-filters .mode-toggle button {
  flex:none;
  padding:4px 9px;
  font-size:16px;
  border-radius:4px;
}
.plot {
  width:100%;
  min-height:290px;
}
.chart .plot svg {
  overflow:hidden;
}
.ranking-panel {
  align-self:start;
}
.js-plotly-plot .plotly .modebar {
  background:transparent!important;
}
.chart .plot svg text {
  font-family:inherit;
  fill:inherit;
}
.chart .plot .modebar-btn {
  opacity:.7;
}
.chart .plot .modebar-btn:hover {
  opacity:1;
}
@media(max-width:760px) {
  .segmented {
    flex-wrap:wrap;
  }
  .segmented button {
    font-size:16px;
    white-space:nowrap;
    padding:9px;
  }
  .plot-filters {
    gap:10px;
  }
  .plot-filters label {
    font-size:16px;
  }
}
.table-scroll {
  max-height:520px;
  overflow:auto;
}
thead {
  position:sticky;
  top:0;
  z-index:1;
}
.ranking-panel {
  position:sticky;
  top:22px;
}
@media(max-width:760px) {
  .ranking-panel {
    position:static;
  }
  .table-scroll {
    max-height:430px;
  }
}

/* Results-first layout. */
.explore { padding: 24px 0; border-top: 0; }
.study-toggle { width: fit-content; margin-top: 18px; }
#split-seed-label { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.results-grid { grid-template-columns: 1fr; }
.ranking-panel { position: static; }
.ranking-panel .ranking { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.horizon-control { max-width: 400px; }
.ranking-caption { display: none; }
footer { margin-top: 24px !important; }
@media (max-width: 1000px) { .ranking-panel .ranking { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .ranking-panel .ranking { grid-template-columns: 1fr; } }
@media (max-width: 390px) { .ranking-panel .ranking { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { .segmented button { transition: none; } }

/* Easter egg: three quick clicks on the logo toggle a monogram leather canvas. */
body.monogram { background:url("monogram.svg") 0 0/120px 120px, #6c442a url("leather.svg") 0 0/300px 300px; }
/* A warm light follows the pointer across the leather, with a vignette at the edges. */
body.monogram::after {
  content:""; position:fixed; inset:0; z-index:-1; pointer-events:none;
  background:
    radial-gradient(520px circle at var(--light-x,50%) var(--light-y,30%), rgba(255,226,170,.22), transparent 65%),
    radial-gradient(ellipse at center, transparent 50%, rgba(18,8,2,.6));
}
/* One gold shimmer sweeps across the page when the canvas appears. */
body.monogram::before {
  content:""; position:fixed; inset:0; z-index:1000; pointer-events:none; opacity:0;
  background:linear-gradient(115deg, transparent 35%, rgba(255,236,190,.45) 50%, transparent 65%) 0 0/300% 100%;
  mix-blend-mode:overlay; animation:monogram-sheen 1.4s ease-out;
}
@keyframes monogram-sheen { from { opacity:1; background-position:100% 0; } to { opacity:1; background-position:0 0; } }
body.monogram .design-header {
  background:linear-gradient(rgba(22,10,3,.62), rgba(22,10,3,.72)), url("leather.svg") 0 0/300px 300px;
  border-bottom:2px dashed #c9a46a; box-shadow:0 3px 0 #2a160b, 0 8px 22px rgba(10,4,0,.55);
}
body.monogram .identity-name, body.monogram .identity-name span {
  color:transparent; background:linear-gradient(180deg, #f8e6b4, #c99e57 55%, #a57a38); -webkit-background-clip:text; background-clip:text;
  filter:drop-shadow(0 1px 0 rgba(0,0,0,.7));
}
body.monogram .identity svg { stroke:#e6c88c; fill:#2a160b; filter:drop-shadow(0 1px 0 rgba(0,0,0,.7)); }
body.monogram .downloads, body.monogram .downloads a, body.monogram .downloads button { color:#e6c88c; }
/* Panels get a painted leather edge with gold saddle stitching along it. */
body.monogram .instrument, body.monogram .metric-panel {
  outline:1.5px dashed #d4b06e; outline-offset:3px;
  box-shadow:0 0 0 7px #3a2113, 0 0 0 8px rgba(255,225,170,.18), 0 14px 30px rgba(10,4,0,.6);
}
body.monogram .selection-summary {
  color:#f3e3c3; background:rgba(40,22,11,.88); border-color:#c9a46a; padding:6px 12px; border-radius:6px;
  box-shadow:inset 0 1px 0 rgba(255,225,170,.15), 0 4px 12px rgba(10,4,0,.5);
}
@media (prefers-reduced-motion: reduce) { body.monogram::before { animation:none; } }
