/* Lab: segmented picker, terminal with focus glow (no outline ring), mission card. Tokens come from site.css. */
.lab__head { padding: 48px 0 8px; }
.lab__head h1 { font-size: clamp(2rem, 1rem + 3.6vw, 3rem); max-width: 22ch; margin-bottom: 16px; }
.lab__head .lead { margin-bottom: 24px; }
.lab__noscript { padding: 16px; border: 1px solid var(--btc); border-radius: var(--r2); }
.lab__pick .eyebrow { display: flex; margin-bottom: 12px; }
.lab__foot { margin: 48px 0 0; color: var(--text-2); }

/* scenario picker */
.lab__btns { display: inline-flex; gap: 2px; padding: 4px; margin-bottom: 16px; max-width: 100%; background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px; }
.lab__btns button { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; font: 500 .875rem var(--sans); white-space: nowrap; color: var(--text-2); background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.lab__btns button:hover { color: var(--text); background: var(--bg-2); }
.lab__btns button[aria-pressed="true"] { color: var(--text); background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.lab__btns button[aria-pressed="true"]::before { content: ""; width: 6px; height: 6px; background: var(--btc); }
.lab__btns button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* layout: terminal | mission */
.lab__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.lab__cases { position: sticky; top: 72px; padding: 20px; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r3); font-size: .95rem; }
.lab__cases .eyebrow { margin-bottom: 12px; }
.lab__cases p { margin-bottom: 12px; }
.lab__cases details { margin-top: 12px; border: 1px solid var(--line-2); border-radius: var(--r2); }
.lab__cases summary { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; font-weight: 500; cursor: pointer; list-style: none; border-radius: var(--r2); }
.lab__cases summary::-webkit-details-marker { display: none; }
.lab__cases summary::after { content: "+"; font-family: var(--mono); color: var(--text-3); }
.lab__cases details[open] summary::after { content: "\2212"; }
.lab__cases summary:hover { background: var(--bg-2); }
.lab__cases details p { padding: 0 14px; }
.lab__cases details p:last-child { margin-bottom: 14px; }

/* terminal */
.lab__term {
  background: var(--term); color: var(--term-text); font: .875rem/1.6 var(--mono); border: 1px solid var(--term-line); border-radius: var(--r3);
  box-shadow: 0 20px 50px -24px rgba(0, 0, 0, .6); overflow: hidden; cursor: text; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.lab__term:focus-within {
  border-color: var(--btc);
  box-shadow: 0 0 0 1px rgba(247, 147, 26, .25), 0 0 40px -12px rgba(247, 147, 26, .45), 0 20px 50px -24px rgba(0, 0, 0, .6);
}
.lab__bar { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px 0 16px; background: var(--term-bar); border-bottom: 1px solid var(--term-line); }
.lab__dots { display: flex; gap: 5px; }
.lab__dot { width: 8px; height: 8px; background: var(--term-grey); }
.lab__term:focus-within .lab__dot--live { background: var(--btc); animation: lab-blink 1.2s steps(1) infinite; }
@keyframes lab-blink { 50% { opacity: .35; } }
.lab__title { flex: 1; min-width: 0; font-size: .75rem; color: var(--term-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lab__tag { padding: 2px 10px; font-size: .65rem; letter-spacing: .1em; text-transform: uppercase; color: var(--term-accent); border: 1px solid rgba(247, 147, 26, .35); border-radius: 999px; }

.lab__log { height: clamp(22rem, 52vh, 34rem); overflow-y: auto; padding: 16px 16px 0; }
.lab__out, .lab__cmd { white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 8px; }
.lab__cmd { color: var(--btc); margin-bottom: 0; }

.lab__chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; }
.lab__chip { display: inline-flex; align-items: center; min-height: 32px; padding: 6px 10px; font: .8rem var(--mono); white-space: nowrap; color: var(--term-chip); background: var(--term-chip-bg); border: 1px solid var(--term-line); border-radius: 8px; cursor: pointer; transition: border-color .15s; }
.lab__chip::before { content: "$ "; white-space: pre; color: var(--btc); }
.lab__chip:hover { border-color: var(--btc); }
.lab__chip:focus-visible { outline: 2px solid var(--btc); outline-offset: 2px; }

.lab__form { display: flex; gap: 10px; align-items: baseline; padding: 0 16px 16px; }
.lab__ps { color: var(--term-dim); white-space: nowrap; transition: color .15s; }
.lab__term:focus-within .lab__ps { color: var(--btc); }
.lab__form input { flex: 1; min-width: 0; font: inherit; color: inherit; background: transparent; border: 0; outline: 0; caret-color: var(--btc); caret-shape: block; }
.lab__form input:focus-visible { outline: 0; box-shadow: none; }
.lab__hint { margin-top: 12px; font-size: .85rem; color: var(--text-2); }

@media (max-width: 979px) {
  .lab__grid { grid-template-columns: minmax(0, 1fr); }
  .lab__cases { position: static; order: -1; }
}
@media (max-width: 640px) {
  .lab__head { padding-top: 32px; }
  .lab__btns { display: flex; overflow-x: auto; scrollbar-width: none; }
  .lab__btns::-webkit-scrollbar, .lab__chips::-webkit-scrollbar { display: none; }
  .lab__btns button { min-height: 44px; }
  .lab__term { font-size: .8125rem; }
  .lab__log { height: min(55vh, 24rem); }
  .lab__chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .lab__chip { min-height: 36px; }
}
@media (max-width: 480px) {
  .lab__ps { font-size: 0; }
  .lab__ps::before { content: "$ "; font-size: .8125rem; white-space: pre; }
}
.lab__cases code { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
