/* Monitor test runner (testrunner.js) */
.tr-stage { cursor: zoom-in; }
.tr-stage.is-full { cursor: default; }
.tr-stage.is-full.tr-marking { cursor: crosshair; }
.tr-stage.is-full .fs-btn { display: none; }
.tr-cap { margin: 10px 0 0; font-size: .95rem; color: var(--muted); max-width: 75ch; }
.tr-cap strong { color: var(--ink); }

.tr-ctl { position: absolute; z-index: 6; display: none; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 999px;
  border: 0; padding: 0; background: rgba(20, 22, 28, .72); color: #fff; cursor: pointer; opacity: 0; transition: opacity .3s; }
.tr-ctl svg { width: 24px; height: 24px; }
.tr-prev { left: max(12px, env(safe-area-inset-left)); top: 50%; transform: translateY(-50%); }
.tr-next { right: max(12px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); }
.tr-x { right: max(12px, env(safe-area-inset-right)); top: max(12px, env(safe-area-inset-top)); }
.tr-stage.is-full .tr-ctl { display: flex; }
.tr-stage.is-full.tr-ui .tr-ctl, .tr-stage.is-full .tr-ctl:focus-visible { opacity: .9; }

.tr-info { position: absolute; z-index: 5; left: max(16px, env(safe-area-inset-left)); top: max(16px, env(safe-area-inset-top)); max-width: min(440px, calc(100% - 96px));
  padding: 12px 14px; border-radius: 12px; background: rgba(20, 22, 28, .84); color: #fff; font-size: .9rem; line-height: 1.45;
  display: none; opacity: 0; transition: opacity .3s; pointer-events: none; }
.tr-info p { margin: 0; }
.tr-info .tr-n { font-size: .78rem; color: #c3c8d2; font-variant-numeric: tabular-nums; }
.tr-info .tr-t { font-weight: 700; font-size: 1.05rem; margin: 1px 0 4px; }
.tr-stage.is-full .tr-info { display: block; }
.tr-stage.is-full.tr-ui .tr-info { opacity: 1; }
.tr-stage.tr-noinfo .tr-info { display: none !important; }

.tr-marks { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.tr-mark { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; padding: 0; cursor: pointer; pointer-events: auto;
  background: transparent; border: 2px solid #fff; box-shadow: 0 0 0 2px #000, inset 0 0 0 2px #000; }
.tr-mark span { position: absolute; left: 100%; top: -6px; margin-left: 4px; font: 700 12px/1 system-ui, sans-serif; color: #fff; background: #000;
  padding: 2px 5px; border-radius: 6px; }

.tr-gh { margin: 10px 0 6px; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tr-gh:first-of-type { margin-top: 0; }
.tr-list button { font-size: .85rem; }
.tr-mlist { margin: 8px 0 0; padding-left: 18px; font-variant-numeric: tabular-nums; font-size: .92rem; }
.tr-mlist:empty { display: none; }
#tr-mclear { margin-top: 8px; }
.tr-dl { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.tr-dl select { flex: 1; min-width: 0; }
.tr-links { margin: 0; padding-left: 18px; }
.tr-links li { margin: 2px 0; }
.ctl label.panel-h { display: block; }
@media (prefers-reduced-motion: reduce) { .tr-ctl, .tr-info { transition: none; } }
/* The caption is filled by the script after first paint. It sits after the panel in the DOM so filling it never pushes
   the panel down (was CLS 0.31 on mobile). Desktop: caption under the stage, panel spans both rows. */
@media (min-width: 881px) {
  .tr-grid { grid-template-rows: auto 1fr; }
  .tr-grid > .tr-cap { grid-column: 1; grid-row: 2; align-self: start; }
  .tr-grid > #tr-panel { grid-column: 2; grid-row: 1 / span 2; }
}
