/* kit.css: the look every motion visual shares (newsroom/visual-kit/kit.css). build.py puts it first in styles.css and the
   visual's own CSS after it.
   Palette: dark card, white text, indigo and cyan for marks, rose only for "not confirmed / not stated", amber only for a note.
   Two frames on one DOM: tall (the fixed 1060px frame below 900px wide) is the base; wide (the block's aspect ratio, 5:4 or
   16:10 on screens 900px and wider) overrides it in the media query near the end. The wide query must match WIDE_QUERY in kit.js.
   Wide sizes are in rem and the root font size scales with the frame, so the wide design is one fixed composition. */
:root {
  --bg: #0b1726; --panel: #102039; --panel2: #16294a; --line: #2f4668; --line2: #4a6590;
  --mute: #b9c7dc; --ink: #0b1726;
  --indigo: #635bff; --indigo-t: #b3afff; --cyan: #06b6d4; --cyan-t: #3fd9f0; --rose: #fb7185; --amber: #fbbf24;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; font-size: 16px; }
body { margin: 0; background: var(--bg); color: #fff; font-family: var(--font); line-height: 1.35; min-height: 100vh; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
.lw { display: none; }
.lt { display: inline; }

/* ---------- the frame ---------- */
.stage { position: relative; display: flex; flex-direction: column; height: 100vh; padding: 0.6rem 0.7rem 0.5rem; gap: 0.4rem; max-width: 46rem; margin: 0 auto; }
.top { display: flex; flex-direction: column; gap: 0.4rem; }
h1 { margin: 0; font-size: 1.1rem; line-height: 1.2; font-weight: 700; }
.ctl { display: flex; gap: 0.5rem; }
.btn { min-height: 2.5rem; min-width: 5.5rem; padding: 0 1rem; border: 1px solid #5b7399; background: var(--panel2); border-radius: 0.5rem; font-size: 0.875rem; font-weight: 600; }
.btn:hover:not(:disabled) { border-color: #fff; }
.btn:disabled { color: #a8b6cc; border-color: var(--line); background: transparent; cursor: default; }
.btn[hidden] { display: none; }

/* ---------- slider row: label, range input, readout ---------- */
.scrub { display: grid; grid-template-columns: auto 1fr; column-gap: 0.7rem; align-items: center; flex: none; }
.scrub-l { font-size: 0.875rem; color: var(--mute); white-space: nowrap; }
.scrub input[type="range"] { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 2.2rem; margin: 0; background: transparent; cursor: pointer; }
.scrub input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: #3a5278; }
.scrub input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: #3a5278; }
.scrub input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: #fff; border: 5px solid var(--indigo); }
.scrub input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 5px solid var(--indigo); }
.when { grid-column: 1 / span 2; margin: 0; font-size: 0.875rem; color: var(--mute); min-height: 1.35em; }

/* ---------- tooltip: a sheet over the free edge of the frame (tall), floating beside the target (wide) ---------- */
.dock { flex: none; }
.tip { position: absolute; left: 0.5rem; right: 0.5rem; bottom: 0.5rem; z-index: 30; max-height: 58%; overflow: auto; padding: 0.5rem 0.8rem 0.6rem; background: #09111f; border: 1px solid #5b7399; border-left-width: 5px; border-radius: 0.5rem; font-size: 0.875rem; box-shadow: 0 0.6rem 1.6rem rgba(0, 0, 0, 0.6); pointer-events: none; }
.tip.pinned { pointer-events: auto; }
.tip[hidden] { display: none; }
.tip p { margin: 0; }
.tip[data-tone="plain"], .tip[data-tone="stage"] { border-left-color: var(--indigo); }
.tip[data-tone="rose"] { border-left-color: var(--rose); }
.tip[data-tone="amber"] { border-left-color: var(--amber); }
.tip[data-tone="cyan"] { border-left-color: var(--cyan); }
.tk-kick { color: var(--mute); }
.tk-title { font-weight: 700; font-size: 1rem; margin-top: 0.1rem !important; }
.tk-plain { margin-top: 0.25rem !important; }
.vb { margin-top: 0.35rem; }
.vh { color: var(--cyan-t); font-weight: 700; }
.q { margin: 0.1rem 0 0; padding: 0 0 0 0.6rem; border-left: 2px solid #5b7399; font-style: italic; }
.vn { color: var(--mute); margin-top: 0.15rem !important; }
.tk-der { margin-top: 0.4rem !important; color: var(--cyan-t); font-weight: 600; }
.tk-mid { margin-top: 0.4rem !important; }
.tk-ns { margin-top: 0.4rem !important; color: var(--rose); font-weight: 600; }
.tk-close { display: none; position: sticky; bottom: 0; margin-top: 0.5rem; min-height: 2.6rem; padding: 0 1.2rem; background: var(--panel2); border: 1px solid #5b7399; border-radius: 0.4rem; font-weight: 600; font-size: 0.875rem; pointer-events: auto; }
.tip.pinned .tk-close { display: inline-block; }
.src { margin: 0; flex: none; font-size: 0.875rem; color: var(--mute); }
.tipping .src { display: none; }

/* ---------- wide frame ---------- */
@media (min-aspect-ratio: 21/20) {
  .lw { display: inline; }
  .lt { display: none; }
  html { font-size: min(calc(100vw / 53), calc(100vh / 42.4)); }
  body { overflow: hidden; }
  .stage { max-width: calc(100vh * 1.25); padding: 0.5rem 1rem 0.35rem; gap: 0.3rem; }
  .top { flex-direction: row; align-items: center; justify-content: space-between; gap: 1rem; }
  h1 { font-size: 1.2rem; }
  .btn { min-height: 1.9rem; min-width: 4.6rem; padding: 0 0.8rem; font-size: 0.85rem; }
  .scrub { grid-template-columns: auto minmax(0, 20rem) 1fr; column-gap: 0.7rem; }
  .scrub-l { font-size: 0.85rem; }
  .scrub input[type="range"] { height: 1.6rem; }
  .scrub input[type="range"]::-webkit-slider-thumb { width: 20px; height: 20px; margin-top: -7px; border-width: 4px; }
  .when { grid-column: auto; font-size: 0.85rem; }
  .dock { position: static; height: 0; }
  .tip { right: auto; bottom: auto; width: 28rem; max-width: calc(100% - 1rem); max-height: calc(100% - 1rem); font-size: 0.85rem; padding: 0.5rem 0.7rem; }
  .tk-title { font-size: 0.95rem; }
  .tk-close { margin-top: 0.4rem; min-height: 1.9rem; font-size: 0.85rem; }
  .src, .tipping .src { display: block; font-size: 0.8rem; }
}

/* ---------- without script ----------
   A module script runs a moment after first paint, so the plain list waits 1.4 seconds before it appears. A reader with script
   never sees it flash, a reader without script still gets it. */
html:not(.js) .plain { opacity: 0; animation: nojs 0.01s 1.4s forwards; }
@keyframes nojs { to { opacity: 1; } }
html:not(.js) body { overflow: auto; }
html:not(.js) .stage { height: auto; min-height: 100vh; }
html:not(.js) .scrub, html:not(.js) .dock, html:not(.js) .ctl, html:not(.js) .chart { display: none; }
html.js .plain { display: none; }

/* ---------- reduced motion, and the freeze while a tooltip is open ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.frozen *, .frozen *::before, .frozen *::after { transition: none !important; animation: none !important; }

/* Chart styles. Come after kit.css in styles.css. The tall frame is the base (the fixed 1060px frame below 900px wide); the wide
   frame (5:4) overrides it in the media query near the end. Five measures on one DOM, one shown at a time behind five tabs: the
   claim and ten ratios for one model on one scale, NVIDIA's technical report by hardware, Artificial Analysis's page data by
   workload, speed set against score, and the memory the weights need. Every bar is a real button. Bars start at zero and every axis
   is fixed. Colours: cyan for NVIDIA's own measurement and the model's weights, indigo for Artificial Analysis, grey for the rivals
   and for device memory, a white hatched outline for any value read by eye from a chart, amber for the 5x claim and the two weight
   guides, rose only for a Not stated line. */
:root { --c-nv: #22d3ee; --c-aa: #8b85ff; --c-gr: #94a3b8; --bh: 1.4rem; --ins: 0.9rem; --lab: 0rem; }
.tip { bottom: auto; }
@media not all and (min-aspect-ratio: 21/20) { .tip { max-height: 80%; } }
h1 { font-size: 1.05rem; }

/* ---------- tabs and controls ---------- */
.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.35rem; flex: none; }
.vbtn { min-width: 0; padding: 0 0.15rem; line-height: 1.15; }
.vbtn[aria-pressed="true"] { background: var(--indigo); border-color: #fff; color: #fff; }

/* ---------- panels ---------- */
.chart { flex: none; }
.panel { display: none; min-width: 0; }
.stage[data-view="claim"] .vclaim, .stage[data-view="report"] .vreport, .stage[data-view="aa"] .vaa, .stage[data-view="score"] .vscore, .stage[data-view="memory"] .vmemory { display: block; }
.phead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.6rem; }
.ph { margin: 0; font-size: 1rem; line-height: 1.2; font-weight: 700; }
.pu { margin: 0.05rem 0 0; font-size: 0.875rem; line-height: 1.3; color: var(--mute); }
.cap { margin: 0.35rem 0 0; font-size: 0.875rem; line-height: 1.3; color: #fff; }
.key { display: flex; flex-wrap: wrap; gap: 0.1rem 0.8rem; margin-top: 0.25rem; font-size: 0.875rem; line-height: 1.3; color: var(--mute); }
.key li { display: flex; align-items: center; gap: 0.3rem; }
.kg { display: inline-block; flex: none; width: 0.85rem; height: 0.85rem; box-sizing: border-box; }
.kg.blog { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0 3px, rgba(255, 255, 255, 0.12) 3px 6px); border: 2px dashed #fff; }
.kg.rep, .kg.nv { background: var(--c-nv); }
.kg.aa { background: var(--c-aa); }
.kg.gr { background: var(--c-gr); }

/* ---------- axis, rows and tracks ---------- */
.ticks { position: relative; height: 1.25rem; margin: 0.2rem var(--ins) 0; }
.tk { position: absolute; top: 0; left: calc(var(--k, 0) * 100%); transform: translateX(-50%); font-size: 0.875rem; line-height: 1.2; color: var(--mute); white-space: nowrap; }
.tk[hidden], .gl[hidden], .row[hidden] { display: none; }
.claimbtn { top: -0.05rem; padding: 0 0.35rem; border: 1px solid var(--amber); border-radius: 0.3rem; background: var(--bg); font-weight: 700; color: var(--amber); }
.claimbtn::after { content: ""; position: absolute; inset: -0.3rem -0.4rem -0.2rem; }
.claimbtn:hover, .claimbtn.pin { box-shadow: 0 0 0 2px #fff; }
.gtag { color: var(--amber); font-weight: 700; }
.grp { margin-top: 0.45rem; }
.gh { margin: 0; font-size: 0.875rem; line-height: 1.3; font-weight: 700; color: #fff; }
.row { display: block; margin-top: 0.3rem; }
.rl { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.5rem; min-width: 0; }
.rn { font-weight: 600; font-size: 0.875rem; line-height: 1.25; }
.rs { color: var(--mute); font-size: 0.875rem; line-height: 1.25; }
.track { position: relative; height: var(--bh); margin: 0.1rem var(--ins) 0; }
.gl { position: absolute; top: -0.15rem; bottom: -0.15rem; left: calc(var(--k, 0) * 100%); width: 0; border-left: 1px dashed var(--line2); pointer-events: none; }
.gl.zero { border-left: 2px solid var(--mute); }
.gl.claim { border-left: 2px dashed var(--amber); }
.gl.gw { border-left: 2px dashed var(--amber); z-index: 2; }
.vl { position: absolute; top: 50%; transform: translateY(-50%); left: calc(var(--e, 0) * 100% + 0.3rem); padding: 0.12rem 0.25rem; border-radius: 0.2rem; background: rgba(11, 23, 38, 0.9); font-size: 0.875rem; font-weight: 700; line-height: 1; white-space: nowrap; color: #fff; pointer-events: none; z-index: 5; }
.vl.in { left: calc(var(--e, 0) * 100% - 0.3rem); transform: translate(-100%, -50%); }
.bar { position: absolute; top: 8%; height: 84%; left: 0; width: calc(var(--w, 0) * 100%); min-width: 2px; margin: 0; padding: 0; border: 0; border-radius: 0; z-index: 1; }
.bar::after { content: ""; position: absolute; inset: -0.25rem -0.4rem; }
.bar.c-nv { background: var(--c-nv); }
.bar.c-aa { background: var(--c-aa); }
.bar.c-gr { background: var(--c-gr); }
.bar.est { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0 4px, rgba(255, 255, 255, 0.12) 4px 8px); border: 2px dashed #fff; }
.bar:hover, .bar.pin { box-shadow: 0 0 0 2px #fff; z-index: 3; }

/* ---------- the Artificial Analysis panel: twelve rows, so the label sits beside the bar even on the tall frame ---------- */
.vaa { --lab: 6.6rem; }
.vaa .row.brow { display: grid; grid-template-columns: var(--lab) minmax(0, 1fr); align-items: center; min-height: 1.65rem; margin-top: 0.1rem; }
.vaa .row .track { margin-top: 0; margin-left: 0.3rem; }
.vaa .rl { display: flex; flex-direction: column; gap: 0; padding-right: 0.2rem; }
.vaa .ticks { margin-left: calc(var(--lab) + 0.3rem); }

@media (max-width: 520px) { .vaa .tk:nth-child(even) { visibility: hidden; } }
@media (max-width: 340px) { .vclaim .tk:nth-child(5), .vclaim .tk:nth-child(7) { visibility: hidden; } }

/* ---------- the score panel: one label, two tracks ---------- */
.dgrp { --ins: 0.6rem; }
.duohead, .duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.8rem; }
.dct { margin: 0.2rem 0 0; font-size: 0.875rem; line-height: 1.2; color: var(--mute); }
.dcol .ticks { margin-top: 0.1rem; }
.drow .track { margin-top: 0.1rem; }

/* ---------- memory: the guides ---------- */
.guides { margin-top: 0.1rem; }

/* ---------- the plain tables, shown without script ---------- */
.plain { padding: 0.2rem 0; font-size: 0.95rem; }
.plain table { width: 100%; border-collapse: collapse; margin: 0.3rem 0 0.8rem; table-layout: fixed; }
.plain caption { padding: 0.3rem 0; text-align: left; font-weight: 700; }
.plain th, .plain td { padding: 0.3rem 0.3rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; font-size: 0.875rem; }
.plain th { color: var(--mute); font-weight: 600; }
.plain p { margin: 0.3rem 0; }
html:not(.js) .tabs { display: none; }

/* ---------- very narrow screens: the title leaves the frame (it stays for screen readers) so the panels fit ---------- */
@media (max-width: 329px) {
  h1 { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .stage { padding: 0.45rem 0.55rem 0.4rem; gap: 0.3rem; }
  .vbtn { padding: 0 0.1rem; }
}

/* ---------- wide frame: 53rem by 42.4rem composition (5:4) ---------- */
@media (min-aspect-ratio: 21/20) {
  :root { --bh: 1.05rem; }
  .src, .tipping .src, .btn, .tk-close, .tip { font-size: 0.875rem; }
  h1 { font-size: 1.2rem; }
  .tabs { grid-template-columns: repeat(5, 9.6rem); gap: 0.5rem; }
  .vbtn { white-space: nowrap; }
  .tip { width: 34rem; }
  .vclaim { --lab: 19rem; }
  .vreport { --lab: 12rem; }
  .vaa { --lab: 14.5rem; }
  .vscore { --lab: 12rem; }
  .vmemory { --lab: 14rem; }
  .row.brow { display: grid; grid-template-columns: var(--lab) minmax(0, 1fr); align-items: center; min-height: 1.5rem; margin-top: 0.08rem; }
  .rl, .vaa .rl { flex-direction: row; padding-right: 0.3rem; flex-wrap: nowrap; white-space: nowrap; gap: 0 0.5rem; }
  .row .track { margin-top: 0; margin-left: 0.3rem; }
  .ticks { margin-left: calc(var(--lab) + 0.3rem); }
  .duohead { margin-left: calc(var(--lab) + 0.3rem); }
  .duohead .ticks, .duohead .dcol .ticks { margin-left: var(--ins); }
  .drow .duo .track { margin-left: var(--ins); }
  .duo { align-items: center; }
  .dgrp { --ins: 0.7rem; }
  .grp { margin-top: 0.3rem; }
  .gh { font-size: 0.875rem; }
  .cap { margin-top: 0.25rem; }
}
