/* NIST blind test page: the "tools at work" screen beside the story.
   Each .step holds one figure.ts-shot (the real tool capture for that beat). On wide screens the script
   mirrors the active step's capture into the sticky .ts-stage; on narrow screens, or without the script,
   each capture shows as a card under its beat. */
.ts-shot { margin: 0; display: grid; gap: 8px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.ts-shot a { display: block; }
.ts-shot img { display: block; width: 100%; height: auto; border-radius: 8px; background: var(--stage); }
.ts-shot figcaption { font-size: 14px; line-height: 1.5; color: var(--muted); }
.ts-shot figcaption b, .ts-cap b { color: var(--ink); }
.ts-shot::before { content: attr(data-tab); justify-self: start; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ts-shot[data-pending]::after { content: "Capture to come: " attr(data-pending); order: -1; display: grid; place-items: center; min-height: 160px; padding: 16px; text-align: center; border-radius: 8px; border: 1px dashed var(--line-strong, var(--line)); background: var(--stage); color: var(--muted); font-size: 14px; }

.lineup { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.lineup li { padding: 12px 14px; display: grid; gap: 2px; position: relative; }
.lineup li + li { border-left: 1px solid var(--line); }
.lineup b { font-size: 16px; font-weight: 800; }
.lineup span { font-size: 13px; color: var(--muted); line-height: 1.35; }
@media (max-width: 600px) { .lineup { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lineup li:nth-child(3) { border-left: 0; } .lineup li:nth-child(n+3) { border-top: 1px solid var(--line); } }

.agent-quote { margin: 0; padding: 12px 16px; border-left: 3px solid var(--orange); background: var(--panel); border-radius: 0 10px 10px 0; font-size: 17px; line-height: 1.5; color: var(--ink); }

/* the sticky screen */
.ts-stage { display: none; }
.ts { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 10px; padding: 12px; border-radius: 20px; border: 1px solid var(--line); background: var(--stage); box-sizing: border-box; }
.ts-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.ts-tabs span { font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 999px; color: var(--muted); border: 1px solid transparent; transition: background .2s ease, color .2s ease; }
.ts-tabs span.is-on { color: var(--ink); background: var(--panel); border-color: var(--orange); box-shadow: inset 0 -2px 0 var(--orange); }
.ts-screen { position: relative; min-height: 0; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: var(--panel); }
.ts-screen > a { display: inline-block; position: relative; line-height: 0; max-width: 100%; }
.ts-screen img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; animation: ts-in .35s ease; }
.ts-screen .ts-wait { color: var(--muted); font-size: 15px; text-align: center; padding: 24px; max-width: 40ch; }
.ts-cap { font-size: 14px; line-height: 1.5; color: var(--muted); min-height: 3em; }
.ts-scrub { list-style: none; margin: 0; padding: 4px 2px 0; display: flex; gap: 4px; }
.ts-scrub li { flex: 1; }
.ts-scrub button { width: 100%; height: 14px; padding: 0; border: 0; background: transparent; cursor: pointer; display: grid; align-items: center; }
.ts-scrub button::before { content: ""; height: 4px; border-radius: 2px; background: var(--line); transition: background .2s ease; }
.ts-scrub button.is-past::before { background: color-mix(in srgb, var(--orange) 45%, var(--line)); }
.ts-scrub button.is-on::before { background: var(--orange); height: 6px; }
.ts-scrub button:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 3px; }
@keyframes ts-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (min-width: 1100px) {
  .ts-js .ts-stage { display: block; }
  .ts-js .ts-story .step .ts-shot { display: none; }
}

/* NIST beside the run */
.pairs { display: grid; gap: 24px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pair figure { margin: 0; display: grid; gap: 6px; min-width: 0; }
.pair a { display: block; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.pair img { display: block; width: 100%; height: auto; }
.pair figcaption { font-size: 13.5px; color: var(--muted); }
.pair figcaption b { color: var(--ink); }
@media (max-width: 700px) { .pair { grid-template-columns: minmax(0, 1fr); } }

/* replay link: the replay opens as its own page */
.replay-open { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 0; }
.replay-open span { color: var(--muted); font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .ts-screen img { animation: none; } .ts-tabs span, .ts-scrub button::before { transition: none; } }

/* input sheet beside the answer key */
.ts-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; align-items: start; }
.ts-duo > div { display: grid; gap: 6px; min-width: 0; }
.ts-duo-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ts-duo img { width: 100%; height: auto; border-radius: 8px; display: block; background: #fff; }
.ts-pend { display: grid; place-items: center; aspect-ratio: 1310 / 936; padding: 12px; text-align: center; border-radius: 8px; border: 1px dashed var(--line-strong, var(--line)); background: var(--stage); color: var(--muted); font-size: 13px; }
.ts-screen .ts-duo { padding: 12px; box-sizing: border-box; animation: ts-in .35s ease; }
@media (max-width: 480px) { .ts-duo { grid-template-columns: minmax(0, 1fr); } }

/* downloads */
.outputs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.output { display: grid; gap: 6px; align-content: start; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.output b { font-size: 17px; font-weight: 800; }
.output span { font-size: 14px; color: var(--muted); line-height: 1.45; }
.output em { font-style: normal; font-size: 13px; font-weight: 700; color: var(--muted); }
.output a { font-weight: 700; }
.output.is-pending { border-style: dashed; }
@media (max-width: 900px) { .outputs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .outputs { grid-template-columns: minmax(0, 1fr); } }

/* callout ring on a capture */
.ts-spot { position: relative; display: block; line-height: 0; }
.ts-ring { position: absolute; left: var(--x); top: var(--y); width: 9%; aspect-ratio: 1; transform: translate(-50%, -50%); border: 3px solid var(--orange); border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb, var(--orange) 25%, transparent); pointer-events: none; }
.ts-screen .ts-spot { display: inline-block; }
.ts-screen img { height: auto; width: auto; max-height: calc(100vh - 300px); }
.lu-name { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.lu-name img { width: 28px; height: 28px; border-radius: 7px; }
.lu-name img.lu-word { width: auto; height: 24px; border-radius: 0; }

/* input sheet, NIST sheet and the run's sheet in one row */
.pair.trio { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .pair.trio { grid-template-columns: minmax(0, 1fr); } }

/* larger view of a sheet or capture */
.pairs a, .ts-duo a, .ts-screen a, .ts-shot a { cursor: zoom-in; }
dialog.lb { width: min(96vw, 1500px); max-width: none; max-height: 94vh; padding: 16px 16px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--ink); box-sizing: border-box; overflow: hidden; }
dialog.lb::backdrop { background: rgb(0 0 0 / .72); }
.lb figure { margin: 0; display: grid; gap: 8px; justify-items: center; }
.lb img { display: block; max-width: 100%; max-height: calc(94vh - 90px); width: auto; height: auto; border-radius: 8px; background: #fff; }
.lb figcaption { font-size: 14px; color: var(--muted); text-align: center; }
.lb button { position: absolute; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; width: 40px; height: 40px; font-size: 24px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.lb button:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.lb-x { top: 10px; right: 10px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 10px; } .lb-next { right: 10px; }
.lb.is-single .lb-prev, .lb.is-single .lb-next { display: none; }
.lb-open { display: block; text-align: center; font-size: 13px; font-weight: 700; margin-top: 6px; }
.band [hidden] { display: none !important; }
