/* Components for the agentic evals post, on top of article.css (copied from the ABC-Sim post).
   Maker colors are tokens so the charts follow light and dark themes without redrawing. */
:root{--mk-openai:var(--ink);--mk-google:#3b7dd8;--mk-anthropic:#d97757;--t0:var(--teal);--t1:#3b7dd8;--t2:var(--gold)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--mk-google:#6ea6ee;--mk-anthropic:#e8916f;--t1:#6ea6ee}}
:root[data-theme="dark"]{--mk-google:#6ea6ee;--mk-anthropic:#e8916f;--t1:#6ea6ee}

/* hero: four videos in a 2x2 grid, a label and a pause/replay pair on each; phones show the first alone */
.ag-hero-grid{display:grid;grid-template-columns:1fr 1fr;background:#000}
.ag-hq{position:relative;aspect-ratio:16/9;overflow:hidden}
.ag-hq video{display:block;width:100%;height:100%;object-fit:cover}
.ag-hero .q-tag{position:absolute;top:10px;left:10px;font:400 11px/1 var(--font-mono);letter-spacing:.05em;text-transform:uppercase;padding:6px 8px;border-radius:3px;background:rgba(17,16,13,.66);color:#f3ead8;pointer-events:none}
.ag-hero .q-tag b{font-weight:500;color:#fff}
.ag-hq .q-ctl,.ag-clip .q-ctl{position:absolute;right:8px;bottom:8px;display:flex;gap:6px}
.q-ctl button{display:grid;place-items:center;width:30px;height:30px;padding:0;border:0;border-radius:50%;background:rgba(17,16,13,.66);color:#f3ead8;cursor:pointer}
.q-ctl button:hover{background:rgba(17,16,13,.88);color:#fff}
.q-ctl button:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
.q-ctl .i-play{display:none}.paused>.q-ctl .i-play{display:block}.paused>.q-ctl .i-pause{display:none}
@media (max-width:640px){.ag-hero-grid{grid-template-columns:1fr}.ag-hq:not(:first-child){display:none}}


/* leaderboard */
.ag-fig{position:relative;margin:var(--space-24,24px) 0 var(--space-40,40px)}
.ag-fig figcaption{margin-top:12px;font-size:14px;line-height:1.5;color:var(--body)}
.ag-lb-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
.ag-lb{width:100%;border-collapse:collapse;font-size:15px;font-variant-numeric:tabular-nums;color:var(--body)}
.ag-lb th{font:400 11.5px/1.2 var(--font-mono);letter-spacing:.04em;text-transform:uppercase;color:var(--muted);text-align:left;padding:0 8px 10px;border-bottom:1px solid var(--rule);white-space:nowrap;vertical-align:bottom}
.ag-lb th button{all:unset;cursor:pointer}
.ag-lb th button::after{content:attr(data-dir);margin-left:4px;color:var(--teal-text)}
.ag-lb th button:hover,.ag-lb th button:focus-visible{color:var(--ink)}
.ag-lb th button:focus-visible{outline:2px solid var(--teal-text);outline-offset:2px}
.ag-lb td{padding:9px 8px;border-bottom:1px solid color-mix(in srgb,var(--rule) 35%,transparent);white-space:nowrap}
.ag-lb .n{text-align:right}
.ag-lb th.n{text-align:right}
.ag-lb .rk{width:28px;color:var(--muted)}
.ag-lb td.nm{display:flex;align-items:center;gap:10px;color:var(--ink)}
.ag-lb td.nm em{font-style:normal;color:var(--muted)}
.ag-lb sup{color:var(--muted);margin-left:2px}
.ag-lb .mk{flex:none}
.mk-openai{color:var(--mk-openai)}
.mk-anthropic{color:var(--mk-anthropic)}
.ag-lb td.sc{min-width:210px}
.ag-lb td.sc .bar{display:inline-block;vertical-align:middle;width:120px;height:10px;border-radius:2px;background:color-mix(in srgb,var(--rule) 22%,transparent);margin-right:10px;overflow:hidden}
.ag-lb td.sc .bar i{display:block;height:100%;border-radius:2px}
.ag-lb td.sc .bar i.striped{background:repeating-linear-gradient(45deg,var(--ink) 0 5px,color-mix(in srgb,var(--ink) 40%,var(--bg)) 5px 9px)}
.ag-lb td.sc b{font-weight:500;color:var(--ink)}
.ag-lb td.sc .se{margin-left:5px;font-size:12.5px;color:var(--muted)}
.ag-lb td.tk{background:color-mix(in srgb,var(--teal) var(--a,0%),transparent);color:var(--ink);min-width:58px}
.ag-lb td.tk.miss{color:var(--muted)}
.ag-lb tr.priv td{border-bottom:1px dashed var(--rule)}
.ag-lb .muted{color:var(--muted);font-size:13px}
.ag-lb tbody tr:hover td{background-color:color-mix(in srgb,var(--rule) 12%,transparent)}
.ag-lb tbody tr:hover td.tk{background:color-mix(in srgb,var(--teal) calc(var(--a,0%) + 8%),transparent)}
.ag-lb-tools{display:flex;flex-wrap:wrap;gap:8px 24px;margin-top:12px;font-size:14px;color:var(--body)}
.ag-lb-tools label,.ag-toggle{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:14px;color:var(--body)}
.ag-lb-tools input,.ag-toggle input{accent-color:var(--teal-text)}
@media (max-width:640px){.ag-lb{font-size:14px}.ag-lb td.sc{min-width:150px}.ag-lb td.sc .bar{width:60px}}

/* charts */
.ag-plot{width:100%;min-height:300px}
.ag-plot svg{display:block;overflow:visible;font-family:var(--font-sans)}
.ag-plot .grid line{stroke:var(--rule);stroke-opacity:.25}
.ag-plot .axis{stroke:var(--rule);stroke-width:1.25}
.ag-plot .tick{fill:var(--body)}
.ag-plot .alab{fill:var(--ink);font-weight:500}
.ag-plot .plab{fill:var(--ink)}
.ag-plot .rlab{fill:var(--ink)}
.ag-plot .pt{stroke:var(--bg);stroke-width:1.5;cursor:pointer}
.ag-plot .pt:hover,.ag-plot .pt:focus-visible,.ag-plot .tm:hover,.ag-plot .tm:focus-visible{stroke:var(--teal-text);stroke-width:2.5;outline:none}
.ag-plot .err{stroke:var(--muted);stroke-width:1.25;stroke-opacity:.7}
.ag-plot .frontier{fill:none;stroke:var(--muted);stroke-width:1.25;stroke-dasharray:5 4}
.ag-plot .band{fill:var(--rule);fill-opacity:.07}
.ag-plot .span{stroke:var(--rule);stroke-width:1.5;stroke-opacity:.6}
.ag-plot .tm{stroke:var(--bg);stroke-width:1.25;cursor:pointer}
.ag-plot .tm.t0,.ag-legend .t0{fill:var(--t0);background:var(--t0)}
.ag-plot .tm.t1,.ag-legend .t1{fill:var(--t1);background:var(--t1)}
.ag-plot .tm.t2,.ag-legend .t2{fill:var(--t2);background:var(--t2)}
.ag-legend{display:flex;flex-wrap:wrap;align-items:center;gap:8px 22px;margin:0 0 12px;font-size:14px;color:var(--body)}
.ag-legend span{display:inline-flex;align-items:center;gap:8px}
.ag-legend i{display:inline-block;width:12px;height:12px;border-radius:50%}
.ag-legend i.sq{border-radius:1px}
.ag-legend i.di{border-radius:1px;transform:rotate(45deg) scale(.85)}
.ag-legend i.mo{background:var(--mk-openai)}
.ag-legend i.mg{background:var(--mk-google)}
.ag-legend i.ma{background:var(--mk-anthropic)}
.ag-legend i.fr{width:22px;height:0;border-radius:0;border-top:1.5px dashed var(--muted)}
.ag-tip{position:absolute;z-index:5;pointer-events:none;padding:7px 9px;background:var(--bg);border:1px solid var(--rule);border-radius:3px;font-size:12.5px;line-height:1.45;color:var(--ink);white-space:pre;box-shadow:0 4px 14px rgba(0,0,0,.08)}
.ag-tip[hidden]{display:none}

/* tabs over the two leaderboard charts */
.ag-panel[hidden]{display:none}

/* harness ladder: one model, three harnesses */
.ag-ladder{display:flex;flex-direction:column;gap:14px;margin:0}
.ag-ladder .r{display:grid;grid-template-columns:minmax(150px,240px) 1fr;gap:16px;align-items:center}
.ag-ladder .k{font-size:15px;line-height:1.3;color:var(--ink)}
.ag-ladder .k small{display:block;font-size:13px;color:var(--muted)}
.ag-ladder .t{display:flex;align-items:center;gap:12px}
.ag-ladder .b{height:22px;border-radius:3px;background:var(--mk-openai)}
.ag-ladder .b.ours{background:color-mix(in srgb,var(--ink) 55%,var(--bg))}
.ag-ladder .b.priv{background:repeating-linear-gradient(45deg,var(--ink) 0 6px,color-mix(in srgb,var(--ink) 40%,var(--bg)) 6px 11px)}
.ag-ladder .v{font-size:15px;color:var(--body);white-space:nowrap;font-variant-numeric:tabular-nums}
.ag-ladder .v b{font-weight:500;color:var(--ink)}
@media (max-width:560px){.ag-ladder .r{grid-template-columns:1fr;gap:6px}}

/* clip grids */
.ag-clips{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.ag-clips.three{grid-template-columns:repeat(3,1fr)}
.ag-clip{position:relative;margin:0;border-radius:4px;overflow:hidden;background:#11100d}
.ag-clip video{display:block;width:100%;height:auto}
.ag-clip .tag{position:absolute;top:8px;left:8px;display:inline-flex;align-items:center;gap:6px;padding:5px 8px;border-radius:3px;background:rgba(17,16,13,.7);color:#f3ead8;font:400 11px/1 var(--font-mono);letter-spacing:.04em;text-transform:uppercase}
.ag-clip .tag .mk-openai{color:#f3ead8}
.ag-clip .tag.ok{background:rgba(31,107,96,.85)}
.ag-colhead{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-bottom:8px;font:400 11.5px/1 var(--font-mono);letter-spacing:.05em;text-transform:uppercase;color:var(--teal-text)}
@media (max-width:640px){.ag-clips.three{grid-template-columns:1fr}}

/* the behavior chart is a light-background image: give it a card so it sits well in dark mode */
.ag-card-img{display:block;width:100%;height:auto;border-radius:4px;background:#fff;padding:10px;box-sizing:border-box}

/* two-up: table beside clips */
.ag-two{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:var(--space-32,32px);align-items:start}
@media (max-width:760px){.ag-two{grid-template-columns:1fr}}

/* spec table */
.ag-spec{width:100%;border-collapse:collapse;font-size:15px;line-height:1.45}
.ag-spec th{width:30%;text-align:left;vertical-align:top;font-weight:500;color:var(--ink);padding:10px 16px 10px 0;border-bottom:1px solid color-mix(in srgb,var(--rule) 35%,transparent)}
.ag-spec td{color:var(--body);font-size:13.5px;line-height:1.55;padding:11px 0;border-bottom:1px solid color-mix(in srgb,var(--rule) 35%,transparent)}

/* call to action */
.ag-cta{display:flex;flex-wrap:wrap;gap:12px;margin:var(--space-24,24px) 0 var(--space-40,40px)}
.ag-cta a{display:inline-flex;align-items:center;gap:8px;padding:11px 16px;border:1px solid var(--rule);border-radius:3px;font-size:15px;color:var(--ink);text-decoration:none}
.ag-cta a.primary{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.ag-cta a:hover{border-color:var(--teal-text)}
.ag-cta a:focus-visible{outline:2px solid var(--teal-text);outline-offset:2px}
.ag-foot{font-size:13.5px;line-height:1.5;color:var(--muted)}

/* the Gemini mark is an <img>: keep it out of the article-wide image rules */
img.mk{display:inline-block!important;width:18px!important;height:18px!important;max-width:none!important;margin:0!important;border-radius:0!important;flex:none}

/* the two result charts side by side, stacked on narrow screens */
.ag-panels{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:var(--space-32,32px);align-items:start}
.ag-phead{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:26px;margin:0 0 10px}
.ag-ptitle{margin:0;font-size:15px;font-weight:500;color:var(--ink)}
@media (max-width:900px){.ag-panels{grid-template-columns:minmax(0,1fr)}}
.ag-panel{min-width:0}

/* T-shirt section: a narrow table beside wider clips, tops aligned; agent names carry their maker's mark */
.ag-clip .tag .mk{width:14px!important;height:14px!important}

/* the sim-vs-real rankings chart: compact, centred under the text column */
#real-plot{width:min(640px,100%);margin-left:max(0px,calc((min(var(--article,900px),100%) - 640px) / 2))}
/* behaviour table: one line per row, beside the dot plots */
.ag-two.ag-beh{grid-template-columns:auto minmax(0,1fr)}
.ag-beh .eval-table td,.ag-beh .eval-table th{white-space:nowrap}
@media (max-width:900px){.ag-two.ag-beh{grid-template-columns:minmax(0,1fr)}}
@media (max-width:520px){.ag-beh .eval-table td{white-space:normal}}
/* real vs sim behaviour dot rows, drawn in the page's colours */
.ag-plot .brange{fill:var(--teal);fill-opacity:.1}
.ag-plot .bsim{fill:var(--teal);fill-opacity:.85;stroke:var(--bg);stroke-width:1.2}
.ag-plot .breal{fill:var(--gold);stroke:var(--ink);stroke-width:1}
.ag-legend i.bsim{background:var(--teal)}
.ag-legend i.breal{background:var(--gold)}
#beh-plot .ag-plot{min-height:0}
.ag-cap{max-width:var(--article);margin:12px 0 var(--space-32,32px);font-size:14px;line-height:1.5;color:var(--body)}
.eval-table tr.base td{color:var(--muted)}

/* T-shirt section: four dots per agent (one per episode, filled when folded), two columns, then the clips full width */
.ag-fold .fold-grid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:repeat(4,auto);grid-auto-flow:column;column-gap:48px}
.ag-fold .fold-grid li{display:grid;grid-template-columns:1fr auto 36px;align-items:center;gap:14px;padding:11px 0;border-bottom:1px solid color-mix(in srgb,var(--rule) 30%,transparent)}
.ag-fold .who{display:flex;align-items:center;gap:10px;font-size:15.5px;color:var(--ink);min-width:0}
.ag-fold .who .mk{flex:none}
.ag-fold .pips{display:inline-flex;gap:6px}
.ag-fold .pips i{width:11px;height:11px;border-radius:50%;border:1.5px solid color-mix(in srgb,var(--teal-text) 55%,transparent);box-sizing:border-box}
.ag-fold .pips i.on{background:var(--teal);border-color:var(--teal)}
.ag-fold .ct{font-size:14px;color:var(--muted);text-align:right;font-variant-numeric:tabular-nums}
.ag-fold .fold-sum{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px 24px;margin:16px 0 24px;font-size:15px;color:var(--body)}
.ag-fold .fold-sum b{font-weight:500;color:var(--ink)}
.ag-fold .fold-sum .base{display:inline-flex;align-items:center;gap:12px;color:var(--muted)}
.ag-fold .fold-sum .base .pips i{border-color:color-mix(in srgb,var(--muted) 60%,transparent)}
@media (max-width:640px){.ag-fold .fold-grid{grid-template-columns:1fr;grid-template-rows:none;grid-auto-flow:row}}
/* the T-shirt clips carry a burnt-in run label along the top edge: crop it (24 of 414 px, 2.2% of the width) */
.ag-fold .ag-clip video{margin-top:-2.2%}
