/* Ways into Explore from the homepage boards (internal only, html.sii-v2; behaviour in
   assets/sii-v2-explore.mjs). 2026-11-26: section leaderboard beside the chart, model card,
   compare tray and the one-line suggestion. Kit tokens from sii-v2.css (--v2-*). */

/* ── the section leaderboard beside the chart ─────────────────────────────────────────── */
/* 2026-11-27 (Charlie): smaller, white, the Explore link on top, rank and name only. */
html.sii-v2 .v2-side { display: flex; flex-direction: column; gap: 12px; box-sizing: border-box; min-width: 0; padding: 16px 12px 12px;
  border: 0; border-radius: 12px; background: var(--v2-white); color: var(--v2-950); }
@media (min-width: 1180px) {
  html.sii-v2 #boards .benchmark-layout:has(> .v2-side) { display: grid !important; grid-template-columns: minmax(0, 1fr) 264px !important; align-items: start !important; }
  html.sii-v2 #boards .benchmark-layout > .v2-side { position: sticky; top: calc(var(--nav-h) + 16px); }
}
html.sii-v2 .v2-side-top { display: flex; flex-direction: column; gap: 10px; padding: 0 4px; }
html.sii-v2 .v2-side-head { display: flex; flex-direction: column; gap: 2px; }
html.sii-v2 .v2-side-title { margin: 0; font: 500 17px/1.3 var(--v2-sans); letter-spacing: 0; color: var(--v2-950); }
html.sii-v2 .v2-side-sub { margin: 0; font: 400 14px/1.4 var(--v2-sans); color: var(--v2-n700); }
/* 2026-12-02 (designer's note via Charlie): the link to the full ranking is a text link under the list. */
html.sii-v2 .v2-side-more { display: inline-flex; align-self: flex-start; align-items: center; gap: 6px; min-height: 32px; box-sizing: border-box; margin: 0 4px; padding: 0;
  border: 0; border-radius: 4px; background: none; color: var(--v2-500) !important; font: 500 15px/1.3 var(--v2-sans); text-decoration: none !important; white-space: normal; }
html.sii-v2 .v2-side-more:hover { text-decoration: underline !important; text-underline-offset: 3px; }
html.sii-v2 .v2-side-more:focus-visible { outline: 4px solid var(--v2-100); outline-offset: 2px; }
html.sii-v2 .v2-side-more svg { width: 16px; height: 16px; transition: transform .2s var(--v2-ease); }
html.sii-v2 .v2-side-more:hover svg { transform: translateX(3px); }
html.sii-v2 .v2-side-list { list-style: none; margin: 0; padding: 0; border-top: 0; display: flex; flex-direction: column; }
html.sii-v2 .v2-side-row { margin: 0; padding: 0; }
html.sii-v2 .v2-side-row.is-extra { display: none; }
html.sii-v2 .v2-side-btn { display: grid; grid-template-columns: 20px 18px minmax(0, 1fr); align-items: center; gap: 8px; width: 100%;
  box-sizing: border-box; min-height: 32px; padding: 6px 4px; border: 0; border-radius: 8px; background: transparent; color: var(--v2-950);
  font: 400 14px/1.3 var(--v2-sans); text-align: left; cursor: pointer; transition: background-color .2s var(--v2-ease); }
html.sii-v2 .v2-side-btn:hover, html.sii-v2 .v2-side-btn.is-lit { background: var(--v2-n100); }
html.sii-v2 .v2-side-btn:focus-visible { outline: 4px solid var(--v2-100); outline-offset: 0; }
html.sii-v2 .v2-side-rank { font: 400 14px/1 var(--v2-mono); color: var(--v2-n700); font-variant-numeric: tabular-nums; text-align: right; }
html.sii-v2 .v2-side-logo { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; }
html.sii-v2 .v2-side-logo img { width: 14px; height: 14px; object-fit: contain; }
html.sii-v2 .v2-side-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Not on the chart beside it: the row stays (it is the section's ranking) but reads quieter. */
html.sii-v2 .v2-side-btn.is-off .v2-side-name { color: var(--v2-n700); }
html.sii-v2 .v2-side-btn.is-picked .v2-side-logo { box-shadow: 0 0 0 2px var(--v2x-slot), 0 0 0 4px var(--v2-white); }
@media (max-width: 1179px) {
  html.sii-v2 .v2-side-top { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  html.sii-v2 .v2-side-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
}
@media (max-width: 640px) {
  html.sii-v2 .v2-side-top { flex-direction: column; align-items: stretch; }
  html.sii-v2 .v2-side-list { grid-template-columns: minmax(0, 1fr); }
}

/* A chart tooltip draws above the metric buttons (their row sits a layer up for its menus). */
html.sii-v2 #boards .board-chart-stage:has(.board-tip) { z-index: 16 !important; }

/* "Try on Fireworks" as a visible line under an open model's name in the data tables, not only
   the small symbol with a hover tooltip (Charlie, 2026-11-27); quieter (Charlie, 2026-11-27 eve): sentence case in
   the UI sans at caption size, soft text, the accent and underline only on hover. */
html.sii-v2 .model-link-group:has(> .fireworks-mark) { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
html.sii-v2 .model-link-group > .fireworks-mark { display: inline-flex !important; align-items: center; gap: 6px; width: auto !important; height: auto !important;
  padding: 0 !important; margin: 0 !important; background: none !important; border: 0 !important; color: var(--v2-n700) !important;
  font: 400 14px/1.3 var(--v2-sans); text-transform: none; letter-spacing: 0; text-decoration: none !important; white-space: nowrap; }
html.sii-v2 .model-link-group > .fireworks-mark::after { content: "Try on Fireworks"; }
html.sii-v2 .model-link-group > .fireworks-mark:hover { color: var(--v2-500) !important; text-decoration: underline !important; }
html.sii-v2 .model-link-group > .fireworks-mark img { width: 14px; height: 7px; flex: none; }
html.sii-v2 .model-link-group:has(> .fireworks-mark) > .model-link-tooltip { display: none !important; }

/* ── points you can click ─────────────────────────────────────────────────────────────── */
html.sii-v2 #boards .board-point:has(> .v2-pm) .hit { cursor: pointer; }
html.sii-v2 #boards .board-point.v2x-picked { z-index: 8 !important; }
html.sii-v2 #boards .board-point.v2x-picked .board-dot,
html.sii-v2 #boards .board-point.v2x-picked .board-dot-plain { opacity: 1 !important; transform: scale(1.18) !important;
  box-shadow: 0 0 0 2.5px var(--v2x-slot), 0 0 0 5px var(--v2-white) !important; }
html.sii-v2 .v2-btn-compare svg { order: -1; }
html.sii-v2 .v2-btn-dive.v2-btn-compare:hover svg { transform: none; }

/* While a model card is open, the chart's own hover tooltip stays out of its way. */
html.v2x-carded #boards .board-tip { display: none !important; }

/* ── the model card ───────────────────────────────────────────────────────────────────── */
.v2x-pop { position: absolute; z-index: 60; width: 360px; max-width: calc(100vw - 16px); box-sizing: border-box; padding: 16px 16px 12px;
  border: 1px solid var(--v2-n200); border-radius: 12px; background: var(--v2-white); color: var(--v2-950);
  box-shadow: 0 12px 32px rgba(40, 0, 22, .14); font: 400 14px/1.4 var(--v2-sans); }
.v2x-pop.is-sheet { position: fixed; left: 8px !important; right: 8px; top: auto !important; bottom: 8px; width: auto; max-width: none; }
.v2x-pop-load { min-height: 120px; font: 500 17px/1.3 var(--v2-sans); }
.v2x-pop-head { display: grid; grid-template-columns: 40px minmax(0, 1fr) 32px; align-items: start; gap: 12px; }
.v2x-pop-logo { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--v2-n50); border: 1px solid var(--v2-n200); box-sizing: border-box; }
.v2x-pop-logo svg { width: 22px; height: 22px; }
.v2x-pop-name { margin: 0; font: 500 17px/1.3 var(--v2-sans); color: var(--v2-950); }
.v2x-pop-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 2px 0 0; color: var(--v2-n700); }
.v2x-tag { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 96px; background: var(--v2-100); color: var(--v2-950);
  font: 400 12px/1 var(--v2-mono); text-transform: uppercase; letter-spacing: .02em; }
.v2x-x { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--v2-950); cursor: pointer; transition: background-color .2s var(--v2-ease); }
.v2x-x:hover { background: var(--v2-n100); }
.v2x-x:focus-visible, .v2x-btn:focus-visible, .v2x-link:focus-visible, .v2x-chip button:focus-visible { outline: 4px solid var(--v2-100); outline-offset: 0; }
.v2x-pop-stats { display: flex; flex-direction: column; gap: 6px; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--v2-n200); }
.v2x-pop-stats > div { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr); gap: 12px; }
.v2x-pop-stats dt { margin: 0; color: var(--v2-n700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2x-pop-stats dd { margin: 0; color: var(--v2-950); }
.v2x-pop-stats b { font: 400 14px/1.4 var(--v2-mono); font-variant-numeric: tabular-nums; }
.v2x-pop-line { margin: 10px 0 0; color: var(--v2-n700); }
.v2x-pop-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.v2x-pop-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--v2-n200); }
.v2x-pop-links:empty { display: none; }
.v2x-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; box-sizing: border-box; padding: 10px 18px;
  border: 0; border-radius: 96px; background: var(--v2-n200); color: var(--v2-950) !important; font: 500 15px/1 var(--v2-sans);
  text-decoration: none !important; white-space: nowrap; cursor: pointer; transition: background-color .2s var(--v2-ease), color .2s var(--v2-ease); }
.v2x-btn:hover { background: var(--v2-n400); }
.v2x-btn-primary { background: var(--v2-950); color: var(--v2-white) !important; }
.v2x-btn-primary:hover { background: var(--v2-800); }
.v2x-btn-primary[aria-pressed="true"] { background: var(--v2-100); color: var(--v2-950) !important; }
.v2x-btn-light { background: var(--v2-white); color: var(--v2-950) !important; }
.v2x-btn-light:hover { background: var(--v2-100); }
.v2x-btn-light.is-off { background: transparent; color: var(--v2-n400) !important; cursor: default; }
.v2x-btn-quiet { background: transparent; color: var(--v2-n700) !important; }
.v2x-btn-quiet:hover { background: var(--v2-n100); color: var(--v2-950) !important; }
.v2x-btn svg { flex: none; }
.v2x-link { display: inline-flex; align-items: center; gap: 4px; color: var(--v2-950) !important; font: 400 14px/1.4 var(--v2-sans);
  text-decoration: underline !important; text-underline-offset: 3px; }
.v2x-link:hover { color: var(--v2-500) !important; }
.v2x-fw { width: 22px; height: 10px; margin-right: 2px; color: var(--v2-950); }
/* Try on Fireworks: its own full-width button at the foot of an open model's card. */
.v2x-try { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 0 0; min-height: 40px; box-sizing: border-box; padding: 10px 16px;
  border-radius: 96px; background: var(--v2-100); color: var(--v2-950) !important; font: 500 15px/1.2 var(--v2-sans); text-align: center; text-decoration: none !important;
  transition: background-color .2s var(--v2-ease), color .2s var(--v2-ease); }
.v2x-try:hover { background: var(--v2-950); color: var(--v2-white) !important; }
.v2x-try:focus-visible { outline: 4px solid var(--v2-100); outline-offset: 2px; }
.v2x-try .v2x-fw { margin: 0; color: currentColor; flex: none; }
.v2x-try svg:last-child { flex: none; }

/* ── the dock: compare tray or a suggestion ───────────────────────────────────────────── */
.v2x-dock { position: fixed; left: 50%; bottom: 24px; z-index: 55; display: none; transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 32px); font: 400 14px/1.4 var(--v2-sans); }
.v2x-dock.is-on { display: block; }
html.v2x-docked body { padding-bottom: 96px; }
.v2x-tray { display: flex; align-items: center; gap: 12px 16px; padding: 10px 10px 10px 20px; border-radius: 24px; background: var(--v2-950); color: var(--v2-white);
  box-shadow: 0 12px 32px rgba(40, 0, 22, .28); }
.v2x-eyebrow { flex: none; font: 400 12px/1 var(--v2-mono); text-transform: uppercase; letter-spacing: .02em; color: var(--v2-n400); }
.v2x-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.v2x-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; box-sizing: border-box; padding: 4px 4px 4px 10px; border: 0; border-radius: 96px;
  background: var(--v2-800); color: var(--v2-white); font: 400 14px/1 var(--v2-sans); white-space: nowrap; }
.v2x-chip > i { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--v2-white); flex: none; }
.v2x-chip > svg { width: 20px; height: 20px; box-sizing: border-box; padding: 3px; border-radius: 50%; background: var(--v2-white); flex: none; }
.v2x-chip button { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--v2-n400); cursor: pointer; }
.v2x-chip button:hover { background: var(--v2-700); color: var(--v2-white); }
.v2x-chip-add { padding: 4px 12px 4px 8px; background: transparent; box-shadow: inset 0 0 0 1px var(--v2-n700); color: var(--v2-white); cursor: pointer; }
.v2x-chip-add:hover { background: var(--v2-800); }
.v2x-chip-add > svg { width: 16px; height: 16px; padding: 0; background: none; }
.v2x-hint { color: var(--v2-n400); }
.v2x-tray-end { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: none; }
.v2x-x-dark { color: var(--v2-n400); }
.v2x-x-dark:hover { background: var(--v2-800); color: var(--v2-white); }

.v2x-nudge { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px 16px; width: min(760px, calc(100vw - 32px)); box-sizing: border-box;
  padding: 14px 14px 14px 18px; border: 1px solid var(--v2-n200); border-radius: 12px; background: var(--v2-white); color: var(--v2-950);
  box-shadow: 0 12px 32px rgba(40, 0, 22, .16); }
.v2x-nudge-logos { display: inline-flex; }
.v2x-nudge-logos svg { width: 36px; height: 36px; box-sizing: border-box; padding: 8px; border-radius: 50%; background: var(--v2-n50); box-shadow: 0 0 0 2px var(--v2-white), 0 0 0 3px var(--v2-n200); }
.v2x-nudge-logos svg + svg { margin-left: -8px; }
.v2x-nudge-t { margin: 0; font: 500 15px/1.35 var(--v2-sans); }
.v2x-nudge-s { margin: 2px 0 0; color: var(--v2-n700); font: 400 14px/1.4 var(--v2-sans); }
.v2x-nudge-acts { display: flex; align-items: center; gap: 4px; }

@media (max-width: 760px) {
  .v2x-dock { left: 8px; right: 8px; bottom: 8px; transform: none; width: auto; max-width: none; }
  .v2x-tray { flex-wrap: wrap; padding: 12px 12px 12px 16px; border-radius: 12px; }
  .v2x-tray-end { width: 100%; }
  .v2x-tray-end .v2x-btn { flex: 1; }
  .v2x-nudge { grid-template-columns: minmax(0, 1fr); width: auto; }
  .v2x-nudge-logos { display: none; }
  .v2x-nudge-acts { justify-content: space-between; }
  html.v2x-docked body { padding-bottom: 160px; }
}
@media (prefers-reduced-motion: reduce) {
  html.sii-v2 .v2-side-btn, html.sii-v2 .v2-side-more, html.sii-v2 .v2-side-more svg, .v2x-btn, .v2x-x { transition: none; }
}

/* 2026-11-30 late: "Add to compare" is the second button now; it still shows when the model is in the tray. */
.v2x-btn[data-act="pick"][aria-pressed="true"] { background: var(--v2-100); color: var(--v2-950) !important; }

/* small-screens-1202: phones and small windows.
   benchmark-skin.css widens the Fireworks mark's tap target on phones with an absolute ::after,
   and here that ::after is the "Try on Fireworks" label, so on phones it sat on top of the name. */
html.sii-v2 .model-link-group > .fireworks-mark::after { position: static; inset: auto; }
/* Board tables keep a 220-240px model column and each metric's own width, which on a phone left
   room for the name and half a score. Under 900px the model column narrows and every metric
   column after it takes one width (the template is inline, so this replaces it); the model cell
   adds nothing to its column's intrinsic width, so every row is the same width and the columns
   still line up when the table scrolls sideways. */
@media (max-width: 900px) {
  html.sii-v2 .detail-page .board-head, html.sii-v2 .detail-page .board-row {
    grid-template-columns: 10px minmax(180px, 1fr) !important; grid-auto-flow: column !important;
    grid-auto-columns: 116px !important; min-width: max-content !important; }
  html.sii-v2 .detail-page .board-head > :nth-child(2), html.sii-v2 .detail-page .board-row > :nth-child(2) { contain: inline-size; }
}
@media (max-width: 640px) {
  html.sii-v2 .detail-page .board-head, html.sii-v2 .detail-page .board-row {
    grid-template-columns: 10px minmax(148px, 1fr) !important; grid-auto-columns: 104px !important; padding: 0 12px; }
  html.sii-v2 .detail-page .board-row .mx-model-name, html.sii-v2 .detail-page .board-row .mx-model-link { white-space: normal; }
  html.sii-v2 .detail-page .board-row { padding-top: 6px; padding-bottom: 6px; }
}
