/* ---------- Results heat table (static/css/results.css) ---------- */
.res {
  position: relative;
  margin-top: 6px;
}

.res-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--aff);
}
.res-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}
.res-scale {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.res-scale i {
  display: block;
  width: 132px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg,
    rgba(91, 108, 123, 0.50) 0%,
    rgba(91, 108, 123, 0.08) 46%,
    #fff 50%,
    rgba(232, 177, 12, 0.10) 54%,
    rgba(232, 177, 12, 0.65) 100%);
  box-shadow: inset 0 0 0 1px var(--panel-line);
}
.res-scale small {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.res .k-hint { color: var(--note); }
.res .k-hint-touch { display: none; }
.res .k-best b { color: var(--ink); }
.res .k-best u { color: var(--ink); text-underline-offset: 2px; }

.res-mode {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  background: var(--panel);
}
.res-mode button {
  padding: 5px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--aff);
  font: 600 13px/1.2 var(--sans);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.res-mode button[aria-pressed="true"] {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(24, 35, 47, 0.12);
}

.res-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 44px 14px 14px;
  background: #fff;
  border: 1px solid var(--panel-line);
  border-radius: 10px;
}
.res table {
  width: 100%;
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 2px;
  font-variant-numeric: tabular-nums;
}

/* group headers with a coloured rule, as on the OmniTaskonomy page */
.res-groups th { padding: 12px 4px 0; }
.res-groups .grp span {
  display: block;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--ink);
  font: 700 13.5px/1.2 var(--display);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.res-groups .grp-P span { border-color: #9aa8b4; }
.res-groups .grp-R span { border-color: #9aa8b4; }
.res-groups .grp-A span { border-color: var(--ink); }

/* angled column labels */
.res-heads th { vertical-align: bottom; }
.res-heads .col {
  height: 74px;
  padding: 0;
  position: relative;
  white-space: nowrap;
}
.res-heads .col span {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform-origin: 0 100%;
  transform: rotate(-50deg);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--author);
  transition: color 0.12s;
}
.res-heads .col.hl-col span { color: var(--ink); }
.res-heads .grp-A span { font-weight: 700; color: var(--ink); }
.res-corner {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  text-align: left;
  vertical-align: bottom;
  padding: 0 10px 8px 4px;
  font: 700 12.5px/1 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--note);
}

/* body */
.res-family td {
  padding: 14px 4px 4px;
  font-size: 12.5px;
  font-style: italic;
  color: var(--note);
}
.res-name {
  position: sticky;
  left: 0;
  z-index: 1;
  padding: 0 12px 0 4px;
  background: #fff;
  text-align: left;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--author);
}
.res-name.indent { padding-left: 16px; }
.res-name .tag {
  margin-left: 7px;
  padding: 1px 6px;
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--note);
  vertical-align: 1px;
}
.res-row.ours .res-name {
  color: var(--ink);
  font-weight: 700;
}
.res-row.ours .res-name span {
  box-shadow: inset 0 -0.42em 0 rgba(232, 177, 12, 0.35);
}
.res-row.hl-row .res-name { color: var(--ink); }
.res-row.is-ref .res-name { font-weight: 500; }

/* rule between the reference model and the base-model group */
.res-divider td {
  height: 13px;
  padding: 0;
  background: linear-gradient(var(--panel-line), var(--panel-line)) center / 100% 1px no-repeat;
}

.res .cell {
  position: relative;
  height: 34px;
  min-width: 37px;
  padding: 0 2px;
  text-align: center;
  font-size: 13px;
  color: var(--body);
  background: var(--bg, transparent);
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(.2, .8, .2, 1), box-shadow 0.15s, opacity 0.15s;
}
.res .cell.best { font-weight: 700; color: var(--ink); }
.res .cell.second span { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.res-row.is-base .cell { color: var(--note); box-shadow: inset 0 0 0 1px var(--panel-line); }
.res-row.is-base .cell.best { color: var(--ink); }

/* narrow spacer column between groups */
.res .sp {
  width: 8px;
  min-width: 8px;
  padding: 0;
}

.res .v-delta { display: none; }
.res[data-mode="delta"] .v-score { display: none; }
.res[data-mode="delta"] .v-delta { display: inline; }
.res[data-mode="delta"] .cell.best { font-weight: 400; color: var(--body); }
.res[data-mode="delta"] .cell.second span { text-decoration: none; }
.res[data-mode="delta"] .res-row[data-row="q3t"] .cell,
.res[data-mode="delta"] .res-row.is-base .cell { color: var(--note); }
.res[data-mode="delta"] .k-best { visibility: hidden; }

/* hover: dim the rest, highlight row + column, magnify the cell */
.res.hovering .cell { opacity: 0.55; }
.res.hovering .cell.hl-row,
.res.hovering .hl-row .cell,
.res.hovering .cell.hl-col { opacity: 1; }
.res .cell.hl-cell {
  z-index: 2;
  opacity: 1;
  transform: scale(1.22);
  box-shadow: 0 0 0 1.5px var(--ink), 0 6px 16px rgba(24, 35, 47, 0.16);
  color: var(--ink);
}
.res .cell:focus { outline: none; }
.res .cell:focus-visible { box-shadow: 0 0 0 2px var(--ink); }
.res .cell.pinned { box-shadow: 0 0 0 2px var(--ink), 0 6px 16px rgba(24, 35, 47, 0.2); }

/* detail card */
.res-card {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  min-width: 180px;
  max-width: 280px;
  padding: 10px 14px 11px;
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 28px rgba(24, 35, 47, 0.14);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.res-card.on { opacity: 1; }
.res-card .c-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--note);
}
.res-card .c-score {
  margin-top: 2px;
  font: 700 26px/1.1 var(--display);
  letter-spacing: -0.03em;
  color: var(--ink);
}
.res-card .c-sub {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--aff);
}
.res-card .c-sub.up { color: #9a7300; }
.res-card .c-sub.down { color: #3e5265; }

.res-caption {
  max-width: 960px;
  margin: 16px auto 0;
  text-align: center;
  font-size: 15px;
  line-height: 1.65;
  color: var(--aff);
}
.res-caption strong { color: var(--ink); font-weight: 600; }

@media (max-width: 760px) {
  .res-bar { flex-direction: column; align-items: flex-start; }
  .res-scroll { padding: 4px 8px 10px; }
  .res-name { font-size: 12.5px; padding-right: 8px; }
  .res-name .tag { display: none; }
  .res .k-hint-mouse { display: none; }
  .res .k-hint-touch { display: inline; }
  .res-row.is-base .res-name span::after { content: " (base)"; font-weight: 500; color: var(--note); }
  .res-name.indent { padding-left: 10px; }
  .res .cell { height: 30px; font-size: 12px; }
  .res-caption { font-size: 14px; }
}
/* ---------- transposed table on narrow screens ---------- */
.res table.t { min-width: 0; max-width: 560px; margin: 0 auto; }
.res table.t .res-heads th { vertical-align: bottom; }
.res table.t .mcol {
  height: auto;
  padding: 4px 0 8px;
  text-align: center;
  font: 600 12.5px/1.2 var(--sans);
  color: var(--author);
  white-space: nowrap;
}
.res table.t .mcol.ours span {
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 0 -0.42em 0 rgba(232, 177, 12, 0.35);
}
.res table.t .mcol.is-ref { font-weight: 500; color: var(--note); }
.res table.t .mcol.hl-row span { color: var(--ink); }
.res table.t .res-corner { padding: 0 6px 8px 2px; font-size: 11px; }
.res table.t .res-name {
  padding: 0 8px 0 2px;
  font-size: 12.5px;
  font-weight: 600;
}
.res table.t .res-brow.hl-col .res-name { color: var(--ink); }
.res table.t .res-family td { padding: 12px 2px 4px; }
.res table.t .cell {
  min-width: 43px;
  height: 32px;
  font-size: 12.5px;
}
.res table.t .cell.ours { box-shadow: inset 0 0 0 1.5px rgba(232, 177, 12, 0.7); }
.res table.t .cell.ours.hl-cell { box-shadow: 0 0 0 1.5px var(--ink), 0 6px 16px rgba(24, 35, 47, 0.16); }

/* mid widths: compact cells so the wide table fits without scrolling */
@media (min-width: 1001px) and (max-width: 1100px) {
  .res-scroll { padding-right: 34px; }
  .res table { min-width: 0; }
  .res .cell { min-width: 33px; font-size: 12px; }
  .res-name { font-size: 12.5px; padding-right: 8px; }
  .res-name.indent { padding-left: 12px; }
  .res-heads .col span { font-size: 11.5px; }
}

@media (max-width: 380px) {
  .res-scroll { padding-left: 4px; padding-right: 4px; }
  .res table.t { border-spacing: 1px; }
  .res table.t .cell { min-width: 39px; font-size: 11.5px; padding: 0 1px; }
  .res table.t .res-name { font-size: 11.5px; padding-right: 4px; }
  .res table.t .mcol { font-size: 11.5px; }
  .res table.t .sp { width: 4px; min-width: 4px; }
}

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