/* ---------- Ablations (static/css/ablation.css) ---------- */
.abl { margin-top: 6px; }
.abl-block { margin: 0; }
.abl-block + .abl-block { margin-top: 48px; }
.abl-h {
  margin: 0 0 8px;
  font: 700 20px/1.25 var(--display);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.abl-text {
  max-width: 760px;
  margin: 0 0 18px;
  color: var(--body);
  line-height: 1.65;
}

/* visual-token table */
.abl-tbox {
  overflow-x: auto;
  padding: 8px 14px 12px;
  background: #fff;
  border: 1px solid var(--panel-line);
  border-radius: 10px;
}
.abl-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 3px;
  font-variant-numeric: tabular-nums;
}
.abl-groups th { padding: 8px 4px 0; }
.abl-groups .grp span {
  display: block;
  padding-bottom: 6px;
  border-bottom: 2px solid #9aa8b4;
  font: 700 13.5px/1.2 var(--display);
  color: var(--ink);
}
.abl-groups .grp-A span { border-color: var(--ink); }
.abl-heads th {
  padding: 8px 2px 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--author);
  white-space: nowrap;
}
.abl-heads .grp-A { color: var(--ink); font-weight: 700; }
.abl-name {
  padding: 0 14px 0 4px;
  text-align: left;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--author);
}
.abl .ours .abl-name { color: var(--ink); font-weight: 700; }
.abl .ours .abl-name span { box-shadow: inset 0 -0.42em 0 rgba(232, 177, 12, 0.35); }
.abl .cell {
  height: 34px;
  min-width: 44px;
  padding: 0 4px;
  text-align: center;
  font-size: 13px;
  color: var(--body);
  border-radius: 4px;
}
.abl .cell.best { font-weight: 700; color: var(--ink); }

/* hover: dim the rest, keep row and column, enlarge the cell (as in Results, without the card) */
.abl .cell {
  position: relative;
  cursor: default;
  transition: transform 0.15s cubic-bezier(.2, .8, .2, 1), box-shadow 0.15s, opacity 0.15s;
}
.abl-table.hovering .cell { opacity: 0.5; }
.abl-table.hovering .hl-row .cell,
.abl-table.hovering .cell.hl-col { opacity: 1; }
.abl-table .abl-name, .abl-table .abl-heads th { transition: color 0.12s; }
.abl-table.hovering .hl-row .abl-name,
.abl-table.hovering .abl-heads th.hl-col { color: var(--ink); }
.abl .cell.hl-cell,
.abl-table tbody tr.abl-diff > .cell.hl-cell {
  z-index: 2;
  opacity: 1;
  transform: scale(1.22);
  background-color: #fff;
  box-shadow: 0 0 0 1.5px var(--ink), 0 6px 16px rgba(24, 35, 47, 0.16);
  color: var(--ink);
}
.abl .cell:focus { outline: none; }
.abl-diff .abl-name { font-weight: 600; color: var(--ink); font-style: italic; }
.abl-diff .cell { font-weight: 600; color: var(--ink); }
.abl-diff td { border-top: 0; }
.abl-diff th, .abl-diff td { padding-top: 0; }
.abl-table tbody tr.abl-diff > * { box-shadow: 0 -1px 0 var(--panel-line); }
.abl-table tbody tr.abl-diff > .cell { box-shadow: none; }
.abl-grprow td {
  padding: 12px 4px 2px;
  font: 700 12.5px/1.2 var(--display);
  color: var(--ink);
  border-bottom: 1.5px solid #9aa8b4;
}
.abl .is-avg .abl-name { color: var(--ink); }

/* RL curves */
.abl-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 8px;
  margin: 0 0 12px;
}
.abl-key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  background: #fff;
  color: var(--aff);
  font: 600 13px/1.2 var(--sans);
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s, border-color 0.15s, color 0.15s;
}
.abl-key svg { width: 26px; height: 12px; }
.abl-key.ours { color: #a07800; font-weight: 700; }
.abl-key[data-s="noadv"] { color: #4a5a68; }
.abl-key[data-s="noopd"] { color: #a0604f; }
.abl-key[data-s="none"], .abl-key[data-s="ans"] { color: var(--note); font-weight: 500; }
.abl-key:hover { border-color: #b8c4cf; }
.abl-key[aria-pressed="false"] { opacity: 0.4; }
.abl-key[aria-pressed="false"] span { text-decoration: line-through; }

.abl-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.abl-panel {
  position: relative;
  margin: 0;
  padding: 12px 10px 6px;
  background: #fff;
  border: 1px solid var(--panel-line);
  border-radius: 10px;
}
.abl-panel figcaption {
  padding: 0 0 2px 8px;
  font: 700 14px/1.2 var(--display);
  color: var(--ink);
}
.abl-panel svg { display: block; width: 100%; height: auto; overflow: visible; }
.abl-panel .grid { stroke: #edf1f5; stroke-width: 1; }
.abl-panel .tick { font: 500 11.5px var(--sans); fill: var(--note); }
.abl-panel .axis { font: 600 12px var(--sans); fill: var(--aff); }
.abl-panel .guide { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0; }
.abl-panel .guide.on { opacity: 0.35; }
.abl-panel .hit { fill: transparent; cursor: crosshair; }
.abl-panel .endlab { font: 700 12.5px var(--sans); fill: #9a7300; }
.abl .series { transition: opacity 0.15s; }
.abl .series.off { display: none; }
.abl.focusing .series { opacity: 0.18; }
.abl.focusing .series.hl { opacity: 1; }

/* lines rise in once, when the charts come into view */
.abl.pre .series { opacity: 0; transform: translateY(6px); }
.abl.drawn .series { transition: opacity 0.5s ease, transform 0.5s ease; }
.abl.drawn .series:nth-child(n) { transition-delay: calc(var(--i, 0) * 80ms); }
.abl.settled .series { transition: opacity 0.15s ease; }

.abl-block { position: relative; }
.abl-pop {
  position: absolute;
  z-index: 4;
  display: grid;
  gap: 4px;
  width: 280px;
  padding: 10px 13px;
  background: #fff;
  border: 1px solid var(--panel-line);
  border-radius: 9px;
  box-shadow: 0 10px 26px rgba(24, 35, 47, 0.14);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--body);
  text-align: left;
  pointer-events: none;
}
.abl-pop[hidden] { display: none; }
.abl-pop strong { font: 700 14px/1.3 var(--display); color: var(--ink); }

.abl-tip {
  position: absolute;
  top: 34px;
  z-index: 3;
  display: grid;
  gap: 3px;
  min-width: 190px;
  padding: 9px 12px;
  margin-left: 12px;
  background: rgba(30, 42, 54, 0.94);
  border-radius: 8px;
  color: #e7edf2;
  font-size: 12.5px;
  pointer-events: none;
  box-shadow: 0 8px 22px rgba(24, 35, 47, 0.2);
}
.abl-tip[hidden] { display: none; }
.abl-tip.left { transform: translateX(-100%); margin-left: -12px; }
.abl-tip b { color: #fff; font-weight: 700; margin-bottom: 2px; }
.abl-tip span { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.abl-tip span.ours { color: #fff; font-weight: 700; }
.abl-tip i { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.abl-tip em { margin-left: auto; padding-left: 12px; font-style: normal; font-variant-numeric: tabular-nums; }

.abl-cap {
  max-width: 760px;
  margin: 16px auto 0;
  text-align: center;
  font-size: 15px;
  line-height: 1.65;
  color: var(--aff);
}
.abl-cap strong { color: var(--ink); font-weight: 600; }
/* key phrases in the colour of their line or cell */
.abl-cap .c-comt { color: #a07800; font-weight: 600; }
.abl-cap .c-slate { color: #4a5a68; font-weight: 600; }
.abl-cap .c-opd { color: #a0604f; font-weight: 600; }
.abl-hint { display: block; margin-top: 4px; font-size: 13.5px; color: var(--note); }

@media (max-width: 760px) {
  .abl-charts { grid-template-columns: 1fr; }
  .abl-tip { top: 30px; min-width: 0; width: max-content; padding: 7px 9px; font-size: 11.5px; gap: 1px; }
  .abl-tip em { padding-left: 8px; }
  .abl-panel .tick { font-size: 14px; }
  .abl-panel .axis { font-size: 14px; }
  .abl-panel .endlab { font-size: 15px; }
  .abl-h { font-size: 18px; }
}
@media (max-width: 700px) {
  .abl-tbox { padding: 4px 8px 8px; }
  .abl .cell { min-width: 0; font-size: 13px; }
  .abl-heads th { white-space: normal; text-align: center; font-size: 12px; }
  .abl-heads .ours { color: var(--ink); }
  .abl-name { font-size: 13px; white-space: normal; padding-right: 8px; }
}
