body[data-study="a"] {
  --trace:#ffb253;
  --row-gap:clamp(8px,1.75dvh,24px);
  --column-gap:clamp(16px,2.4vw,48px);
  height:100dvh;display:grid;grid-template-rows:auto minmax(0,1fr) auto;
}
body[data-study="a"] header {height:clamp(48px,7dvh,72px)}
body[data-study="a"] main {
  width:100%;height:100%;min-height:0;padding-block:var(--row-gap);
  display:grid;grid-template-rows:minmax(0,1fr);
}
body[data-study="a"] .instrument {
  display:grid;
  min-height:0;grid-template-columns:minmax(0,1fr) minmax(0,1.55fr) minmax(0,1fr);
  grid-template-rows:auto minmax(0,1fr) auto;
  grid-template-areas:"intro intro round" "claude stage gpt" "panel gemini mode";
  gap:var(--row-gap) var(--column-gap);
}
body[data-study="a"] .intro {grid-area:intro;align-self:center}
body[data-study="a"] .intro .status {display:none}
body[data-study="a"] h1 {font-size:clamp(30px,2.7vw,40px);line-height:1.05;margin:0 0 var(--s2)}
body[data-study="a"] .intro p {max-width:60ch;font-size:16px}
.funding-readout {grid-area:mode;min-width:0;align-self:start;border-block:1px solid var(--softline)}
.funding-source,.log-heading {display:flex;align-items:center;justify-content:space-between;gap:var(--s2)}
.funding-source a,.funding-source button {display:inline-flex;align-items:center;min-height:44px;font:500 14px/1.3 var(--type);color:var(--ink);text-decoration:none}
.funding-source a:hover,.funding-source button:hover {text-decoration:underline;text-underline-offset:var(--s1)}
.funding-source button {background:transparent;border:0;padding:0;gap:var(--s2);color:var(--muted)}
.funding-source button span {color:var(--ink)}
.funding-readout dl {display:grid;grid-template-columns:1fr 1fr;gap:var(--s3);margin:0 0 var(--s3)}
.funding-readout dt {color:var(--muted);font-size:12px}
.funding-readout dd {margin:var(--s1) 0 0;font-size:14px;overflow-wrap:anywhere}
.round-state {grid-area:round;align-self:center;justify-self:end;color:var(--muted);font:500 12px/1.4 var(--type);text-align:right}
header .round-state {margin-inline-start:auto}
body[data-study="a"] .stage {min-height:0}
body[data-study="a"] #viewport {z-index:0}
body[data-study="a"] .stage-meta,body[data-study="a"] .stage-foot {z-index:1;inset-inline:0}
body[data-study="a"] .stage-meta {top:0;letter-spacing:0;font-size:12px;text-transform:lowercase}
body[data-study="a"] .stage-foot {bottom:0;font-size:12px}
body[data-study="a"] #legend:before {background:var(--track-color,var(--orange))}
.station {min-width:0;position:relative;align-self:center;padding:var(--s4) 0;border-top:1px solid var(--line)}
.station-claude {grid-area:claude}
.station-gpt {grid-area:gpt}
.station-gemini {grid-area:gemini;justify-self:center;width:min(100%,calc((100vw - 2 * var(--rail) - 2 * var(--column-gap)) / 3.55));align-self:start}
.station::before {content:"";position:absolute;top:-1px;left:0;width:32px;height:2px;background:var(--agent-color)}
.station-claude::after,.station-gpt::after,.station-gemini::after {content:"";position:absolute;background:var(--agent-color);opacity:.50;pointer-events:none}
.station-claude::after {width:var(--column-gap);height:1px;left:100%;top:0}
.station-gpt::after {width:var(--column-gap);height:1px;right:100%;top:0}
.station-gemini::after {width:1px;height:var(--row-gap);left:50%;bottom:100%}
.station-title {display:flex;gap:var(--s2);align-items:center}
.station-title h2 {margin:0;font:620 clamp(20px,1.65vw,24px)/1.1 var(--type);letter-spacing:-.045em}
.agent-symbol {display:block;width:var(--s6);height:var(--s6);flex:none;object-fit:contain}
.agent-state {margin-left:auto;color:var(--muted);font:510 12px/1.3 var(--type)}
.station[data-working="true"] .agent-state {color:var(--agent-color)}
.station[data-working="true"] .agent-state::before {content:"";display:inline-block;width:6px;height:6px;background:var(--agent-color);border-radius:50%;margin-right:5px;animation:provider-request 1.2s ease-in-out infinite alternate}
@keyframes provider-request {from{opacity:.35}to{opacity:1}}
.agent-role {color:var(--agent-color);font:570 13px/1.5 var(--type);margin-top:var(--s2)}
.agent-finding {font:430 14px/1.45 var(--type);margin:var(--s2) 0;min-height:2.9em;text-wrap:pretty}
.model-log {list-style:none;margin:var(--s2) 0 0;padding:var(--s2) 0 0;border-top:1px solid var(--softline);font:400 12px/1.5 var(--type);color:var(--muted)}
.model-log li {display:flex;gap:var(--s3);align-items:baseline;min-width:0}
.model-log time {flex:none;font-variant-numeric:tabular-nums}
.model-log span {min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.model-log li:last-child span {color:var(--ink)}
.model-log li:last-child time {color:var(--agent-color)}
.model-log code {font:inherit}
.net-pick {display:block;padding:0 var(--s3);max-width:100%;overflow-wrap:anywhere;background:transparent;text-align:left}
.net-pick[aria-pressed="true"] {border-color:var(--agent-color)}
.net-pick:disabled {cursor:default}
.agent-model {display:block;color:var(--muted);font:460 12px/1.5 var(--type);margin-top:var(--s2);overflow-wrap:anywhere}
.crew-tabs {display:none}
.inspection-log {grid-area:mode;align-self:start;border-top:1px solid var(--line);padding-top:var(--s4)}
.inspection-log h2 {margin:0;font:600 16px/1.4 var(--type)}
.round-events {margin:var(--s2) 0 0;padding:0;list-style:none}
.round-events li {display:flex;justify-content:space-between;align-items:center;gap:var(--s2);min-height:32px;border-bottom:1px solid var(--softline);font-size:14px}
.round-events li span::before {content:"";display:inline-block;width:5px;height:5px;margin-right:7px;background:var(--agent-color);border-radius:50%}
.round-events time {color:var(--muted);font-size:12px}
body[data-study="a"] .run-panel {align-self:start}
body[data-study="a"] .mode-control {grid-area:mode;align-self:center;justify-self:end;margin:0}
body[data-study="a"] .signal-name {font-size:18px}
body[data-study="a"] .readings {margin-bottom:var(--s3)}
body[data-study="a"] .transport button {font-size:13px;padding-inline:var(--s2)}
@media (min-width:901px) and (max-height:800px) {
  body[data-study="a"] {--row-gap:var(--s2)}
  body[data-study="a"] .station {padding-block:var(--s2)}
  body[data-study="a"] .intro p {margin:0}
  body[data-study="a"] .run-panel,.inspection-log {padding-top:var(--s2)}
  body[data-study="a"] .run-panel {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:var(--s2)}
  body[data-study="a"] .panel-heading,body[data-study="a"] .transport {grid-column:1/-1}
  body[data-study="a"] .signal-name {grid-column:1/-1;align-self:center;margin:0;font-size:16px}
  body[data-study="a"] .readings {margin:0;gap:var(--s3)}
  body[data-study="a"] .agent-role,.agent-finding {margin-block:var(--s1)}
}
.agent-detail {background:transparent;border:0;padding-inline:var(--s2);font-size:14px}
.agent-detail:hover {color:var(--orange)}
.station-actions {display:flex;gap:var(--s2);align-items:center;flex-wrap:wrap}
.agent-detail {color:var(--muted);text-decoration:underline;text-underline-offset:4px}
.original-finding {margin:var(--s4) 0;color:var(--ink);line-height:1.55;overflow-wrap:anywhere}
#inspection-sheet {
  color:var(--ink);background:var(--raised);border:1px solid var(--line);border-radius:var(--s2);
  width:min(30rem,calc(100vw - 2 * var(--s4)));max-height:calc(100dvh - 2 * var(--s4));
  padding:var(--s6);overflow:auto;overscroll-behavior:contain;
}
#inspection-sheet::backdrop {background:rgb(0 0 0 / 62%)}
.sheet-head {display:flex;align-items:center;justify-content:space-between;gap:var(--s4);margin-bottom:var(--s4)}
.sheet-head h2 {margin:0;font-size:22px;line-height:1.15}
#sheet-body .inspection-log {margin-top:var(--s6)}
#sheet-body .agent-model {font-size:14px}
@media (prefers-reduced-motion:reduce) {
  .station[data-working="true"] .agent-state::before {animation:none}
}
@media (max-width:900px),(max-height:620px),(max-width:1100px) and (max-height:700px) {
  body[data-study="a"] {--row-gap:var(--s2);--rail:clamp(16px,4vw,32px)}
  body[data-study="a"] .instrument {
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:auto auto minmax(0,1fr) auto auto;
    grid-template-areas:"intro" "round" "stage" "tabs" "focus";
    gap:var(--row-gap);
  }
  body[data-study="a"] h1 {font-size:clamp(26px,4vw,32px);margin:0 0 var(--s1)}
  body[data-study="a"] .intro p {margin:0;line-height:1.35}
  .funding-readout {grid-area:round;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.4fr);align-items:center;gap:var(--s3);padding-block:var(--s1)}
  .funding-source {align-items:flex-start;flex-direction:column;gap:0}
  .funding-source a,.funding-source button {min-height:44px}
  .funding-readout dl {margin:0}
  body[data-study="a"] .instrument > .run-panel {display:none}
  .crew-tabs {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-area:tabs;gap:var(--s2)}
  .agent-tab {background:transparent;border-color:var(--softline);padding-inline:var(--s1)}
  .agent-tab .agent-symbol {display:inline-block;width:var(--s4);height:var(--s4);margin-inline-end:var(--s1);vertical-align:middle}
  .agent-tab[aria-pressed="true"] {border-color:var(--agent-color)}
  .agent-tab small {display:block;color:var(--muted);font-size:12px;line-height:1.15}
  .station {display:none;grid-area:focus;width:100%;align-self:start;padding:var(--s2) 0 0}
  .station[data-active="true"] {display:block}
  .station::after {display:none}
  .station-title,.station .agent-role {display:none}
  .agent-finding {min-height:2.7em;margin:0 0 var(--s1)}
  .station-actions {justify-content:space-between}
  #instrument-open {padding:0;background:transparent;border:0;text-decoration:underline;text-underline-offset:4px;pointer-events:auto}
  body[data-study="a"] .stage-foot #scale-label {display:none}
  body[data-study="a"] .header-id {display:none}
  .station-gemini {width:100%}
}
@media (max-height:620px) and (min-width:610px) {
  body[data-study="a"] .instrument {
    grid-template-columns:minmax(0,1fr) minmax(0,1.2fr) minmax(0,1fr);
    grid-template-rows:minmax(0,1fr) auto auto minmax(0,1fr);gap:var(--s2);
    grid-template-areas:". stage ." "intro stage tabs" "round stage focus" ". stage .";
  }
  .crew-tabs {align-self:end;gap:var(--s1)}
  .station-actions {justify-content:start}
  .round-controls {align-self:start;justify-content:start;flex-direction:row-reverse}
  body[data-study="a"] h1 {font-size:28px}
  body[data-study="a"] .stage-meta,body[data-study="a"] .stage-foot {justify-content:center}
  body[data-study="a"] #stage-unit,body[data-study="a"] #scale-label {display:none}
}
@media (max-height:550px) and (max-width:609px) {
  body[data-study="a"] {--row-gap:var(--s1)}
  body[data-study="a"] .stage-meta,body[data-study="a"] .stage-foot {display:none}
  body[data-study="a"] .intro h1 {font-size:24px}
}
