/* lab presets */
.head { margin-bottom: 16px; }
.status { display: flex; align-items: center; gap: 8px; }
.presets { display: flex; gap: 24px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.presets button { height: 36px; padding: 0 2px; color: var(--fg-2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.presets button:hover { color: var(--fg-1); }
.presets button[aria-selected=true] { border-bottom-color: var(--accent); color: var(--fg-1); }

.cfg { display: grid; gap: 24px; max-width: 720px; }
.f { display: grid; gap: 8px; }
.f.go > div:first-child { display: none; }
.fl { display: flex; align-items: baseline; gap: 12px; font-weight: 500; }
.fl .meta { font-weight: 400; color: var(--fg-3); }

.opts { display: grid; border: 1px solid var(--line-strong); border-radius: var(--r-3); overflow: hidden; }
.opt { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 0 12px; padding: 8px 12px; cursor: pointer; border-top: 1px solid var(--line); }
.opt:first-child { border-top: 0; }
.opt:hover { background: var(--bg-hover); }
.opt input { appearance: none; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--mark); margin: 0; display: grid; place-items: center; cursor: inherit; }
.opt input:checked { border-color: var(--accent); }
.opt input:checked::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.opt:has(input:checked) { background: var(--bg-raised); }
.opt .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt .r { font: var(--t-meta); color: var(--fg-2); white-space: nowrap; text-align: right; }
.opt .s { grid-column: 2 / 4; font: var(--t-meta); color: var(--fg-2); }
.opt .s .dot { width: 6px; height: 6px; margin-right: 4px; vertical-align: 1px; }
.opt .s .dot.live, .opt .s .dot.pulse { box-shadow: none; }
.opt.off { cursor: not-allowed; padding-top: 6px; padding-bottom: 6px; }
.opt.off .r { color: var(--fg-3); }
.opt.off:hover { background: none; }
.opt.off .n, .opt.off .r, .opt.off .s { color: var(--fg-3); }
.opt.off input { border-style: dashed; opacity: .6; }

.slider { display: flex; align-items: center; gap: 16px; height: 32px; }
.slider input { flex: 1; accent-color: var(--accent-fill); height: 4px; }
.slider output { min-width: 32px; text-align: right; font-weight: 600; }
textarea { width: 100%; resize: vertical; min-height: 64px; background: var(--bg-sunk); border: 1px solid var(--line-strong); border-radius: var(--r-3); padding: 8px 12px; outline: none; }
textarea:focus { border-color: var(--accent-line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { height: 26px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 13px; color: var(--fg-2); font: var(--t-meta); }
.chip:hover { color: var(--fg-1); background: var(--bg-hover); }
.chip[aria-pressed=true] { border-color: var(--accent-line); color: var(--fg-1); background: var(--accent-subtle); }
.go-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* run: one compact row of setup + stats, then the session wall (hero) beside a small live chart */
.run { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.cfg[hidden] + .run { border-top: 0; margin-top: 0; padding-top: 0; }
.runbar { display: flex; align-items: center; gap: 16px; min-height: 40px; }
.sum-t { display: grid; gap: 0; min-width: 0; }
.sum-p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.runbar .btn { flex: none; }
.runbar .sum-t { margin-right: auto; }
.stats { display: flex; flex-wrap: wrap; gap: 4px 28px; margin: 8px 0 16px; color: var(--fg-2); }
.stats > span { white-space: nowrap; }
.stats b { color: var(--fg-1); font-weight: 600; margin-left: 2px; }
.stats .slots b { margin-left: 0; }
.stats .pend { color: var(--fg-2); font-style: normal; }
.stats .slots { margin-left: auto; }
.stats .sh { display: none; }
@media (max-width: 760px) { .stats .sh { display: inline; } }

.board { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: stretch; }
.wall-wrap, .chart { display: flex; flex-direction: column; min-width: 0; }
.pane-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 20px; margin-bottom: 8px; white-space: nowrap; min-width: 0; }
.wall-note { margin-top: 8px; }
.key { display: flex; gap: 14px; white-space: nowrap; }
.key span { display: inline-flex; align-items: center; gap: 6px; }
.key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.key .k-q { border: 1px dashed var(--mark); }
.key svg { width: 12px; height: 12px; color: var(--fg-1); }
.key .k-tick { width: 3px; height: 10px; border-radius: 0; background: var(--fg-1); }
.key .k-t1 { width: 14px; height: 2px; border-radius: 0; background: repeating-linear-gradient(90deg, var(--fg-2) 0 4px, transparent 4px 7px); }
.key .k-t2 { width: 14px; height: 2px; border-radius: 0; background: var(--accent); }

.wall { --cols: 6; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 6px; }
.mt { position: relative; display: grid; overflow: visible; grid-template-rows: 16px 20px 3px; align-content: center; gap: 2px; height: 56px; padding: 4px 8px 6px; cursor: pointer; text-align: left; border-radius: var(--r-3);
  background: var(--bg-raised); border: 1px solid var(--line); transition: border-color var(--dur-2), background var(--dur-2); }
.mt:hover { background: var(--bg-hover); }
.mt-h { display: flex; align-items: center; justify-content: space-between; font: var(--t-meta); color: var(--fg-2); }
.mt-h .gl { display: inline-flex; min-width: 14px; height: 14px; align-items: center; justify-content: flex-end; white-space: nowrap; }
.mt.s .gl { color: var(--accent); }
.mt-h .gl svg { width: 14px; height: 14px; }
.mt-v { font-weight: 600; white-space: nowrap; overflow: hidden; }
.mt-v { line-height: 20px; display: flex; align-items: center; gap: 3px; }
.mt-v .cr { display: inline-block; width: 2px; height: 14px; margin-left: 2px; background: var(--accent); animation: soft 1.1s ease-in-out infinite; }
@keyframes soft { 50% { opacity: .4; } }
.key .num-c { display: inline-flex; align-items: center; gap: 2px; color: var(--fg-1); font-weight: 600; }
.key .num-c .cr { display: inline-block; width: 2px; height: 12px; background: var(--accent); animation: soft 1.1s ease-in-out infinite; }
.mt-bar { display: block; height: 3px; border-radius: 2px; background: var(--bg-active); overflow: hidden; }
.mt-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 2px; transition: width 100ms linear; }
/* queued: grey, dashed */
.mt.q { background: var(--bg-ground); border-style: dashed; border-color: var(--line-strong); }
.mt.q .mt-v { font: var(--t-meta); line-height: 20px; color: var(--fg-3); font-weight: 400; }
.mt.q .mt-bar { background: transparent; }
.mt.q .mt-h { color: var(--fg-3); }
/* streaming: accent bar + caret */
.mt.s { border-color: var(--accent-line); background: var(--bg-raised); }
.mt.s .mt-h { color: var(--fg-1); }
@keyframes soft { 50% { opacity: .35; } }
/* done: neutral with a check */
.mt.d .mt-bar i { background: var(--fg-2); }
.mt.d { background: var(--bg-ground); border-color: var(--line-strong); }
.mt.d .mt-v { color: var(--fg-1); font-weight: 500; }
.mt.d .gl { gap: 4px; color: var(--fg-2); }
.mt.d .gl svg { color: var(--fg-1); }
.mt.d .gl { color: var(--fg-1); }
.mt.sel { outline: 2px solid var(--fg-1); outline-offset: 1px; }

.graph { position: relative; flex: 1; min-height: 180px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--bg-sunk); overflow: hidden; }
.graph canvas { position: absolute; inset: 0; display: block; }

.board2 { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; margin-top: 16px; }
.board2 .turn2 { margin-top: 0; padding: 14px 16px; border-top: 0; border-radius: var(--r-3); background: var(--bg-raised); gap: 10px; }
.t2-h { display: flex; justify-content: space-between; gap: 12px; }
.board2 .turn2 .pair { grid-template-columns: 48px minmax(0, 1fr) 104px; }
.detail { margin-top: 0; padding: 14px 16px; border-radius: var(--r-3); background: var(--bg-raised); }
.detail-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; margin-bottom: 6px; }
.detail-h .strong { white-space: nowrap; }
.detail-h .btn { margin-left: auto; height: 28px; }
.detail-t { max-width: 760px; min-height: 22px; }
.detail-t:empty:not(.caret)::before { content: 'No tokens yet.'; color: var(--fg-3); }
.detail-t.caret::after, .tile.s .tile-t::after { content: ''; display: inline-block; width: 2px; height: 16px; margin-left: 3px; vertical-align: -3px; background: var(--accent); animation: blink 1s steps(2) infinite; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 12px; }
.tile { border: 1px solid var(--line); border-radius: var(--r-3); padding: 8px 10px; display: grid; grid-template-rows: auto 80px auto; gap: 6px; background: var(--bg-raised); }
.tile.s { border-color: var(--accent-subtle); }
.tile.q { border-style: dashed; background: var(--bg-ground); }
.tile-h, .tile-f { display: flex; justify-content: space-between; font: var(--t-meta); color: var(--fg-2); }
.tile-h b { font-weight: 600; color: var(--fg-1); }
.tile.s .tile-f .tps { color: var(--accent); }
.tile-t { font: var(--t-meta); color: var(--fg-1); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; }
.tile.s .tile-t::after { height: 12px; vertical-align: -2px; }

.turn2 { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.scale { display: flex; justify-content: space-between; color: var(--fg-3); }
.turn2 .row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pair { display: grid; grid-template-columns: 64px minmax(0, 1fr) 140px; gap: 8px 12px; align-items: center; }
.pair .track { position: relative; height: 12px; background: var(--bg-active); border-radius: 2px; overflow: hidden; }
.pair .track i { display: block; height: 100%; border-radius: 2px; background: var(--fg-3); transition: width 600ms var(--ease); }
.pair .track i.acc { background: var(--accent); }
.pair .v { text-align: right; }

/* single model */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 24px; margin-top: 12px; padding: 0 12px; }
.facts div { display: grid; gap: 0; }
.facts dt { font: var(--t-meta); color: var(--fg-3); }
.facts dd { white-space: nowrap; }
.timeline { display: grid; gap: 10px; margin-bottom: 32px; }
.tl-head { display: flex; align-items: baseline; gap: 12px; }
.tl-row { display: flex; gap: 2px; }
.ph { min-width: 72px; display: grid; gap: 6px; flex-basis: 0; }
.ph > i { height: 8px; border-radius: 2px; background: var(--mark); }
.ph.live > i { background: linear-gradient(90deg, var(--accent-fill) 0%, var(--accent) 50%, var(--accent-fill) 100%) 0 0 / 200% 100%; animation: sheen 1.6s linear infinite; }
@keyframes sheen { to { background-position: -200% 0; } }
.ph.rest { min-width: 120px; }
.ph.rest > i { background: var(--bg-active); }
.ph span { display: grid; font: var(--t-meta); color: var(--fg-2); white-space: nowrap; }
.ph.live span { color: var(--fg-1); }
.ph b { font-weight: 600; }
.ph .pend { display: flex; justify-content: space-between; gap: 12px; color: var(--fg-3); }
.ph .pend span { color: var(--fg-3); }
.ph .pend span:last-child { text-align: right; }
.out-h { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; min-height: 22px; }
.meter { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.meter .bar { width: 160px; }
.out { max-width: 720px; white-space: pre-wrap; min-height: 88px; }
.out:empty:not(.caret)::before { content: 'The answer streams here once the model is ready.'; color: var(--fg-3); }
.out.caret::after { content: ''; display: inline-block; width: 2px; height: 16px; margin-left: 3px; vertical-align: -3px; background: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 760px) {
  .fl { flex-direction: column; gap: 0; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board, .board2 { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .graph { min-height: 160px; flex: none; height: 160px; }
  .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; }
  .stats .lg { display: none; }
  .stats > span { white-space: normal; }
  .stats .slots { grid-column: 1 / -1; }
  .sum-p { white-space: normal; }
  .runbar { flex-wrap: wrap; gap: 8px; }
  .runbar .sum-t { flex-basis: 100%; }
  .stats .slots { margin-left: 0; }
  .pane-h { height: auto; flex-wrap: wrap; white-space: normal; }
  .key { flex-wrap: wrap; white-space: normal; row-gap: 4px; }
  .runbar .btn { flex: 1 1 auto; }
  .mt { height: 50px; padding: 3px 6px 5px; grid-template-rows: 16px 18px 3px; }
  .mt-v { font: var(--t-meta); line-height: 18px; font-weight: 600; }
  .mt.q .mt-v { line-height: 18px; }
  .key { gap: 10px; }
  .presets { gap: 16px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pair { grid-template-columns: 52px minmax(0, 1fr) 96px; }
  .meter .bar { width: 80px; }
  .opt .r { grid-column: 2 / 4; text-align: left; }
}

.page { padding-top: 24px; }
.pair .track b { position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1px; background: var(--fg-1); border-radius: 1px; }
.pair .track { overflow: visible; }

/* narrow tiles (many sessions): keep the state glyph, drop the per-tile numbers from the head row */
.mt { container-type: inline-size; }
@container (max-width: 72px) {
  .mt-h .gl span { display: none; }
  .mt-v .u { display: none; }
  .mt-v { font: var(--t-meta); line-height: 20px; font-weight: 600; }
}
