:is(
  [data-study-lab="screen-time"],
  [data-study-lab="rhythm-attention"],
  [data-study-lab="meaning-between-shots"],
  [data-study-lab="sound-across-cuts"]
) {
  background: #f7f5ef;
}

.lab-time {
  --lab-ink: #263d32;
  --lab-muted: #4e6155;
  --lab-green: #466354;
  --lab-rust: #8d4736;
  --lab-paper: #f7f5ef;
  color: var(--lab-ink);
  font: .875rem/1.3 var(--sans, system-ui, sans-serif);
  font-variant-numeric: tabular-nums;
}

.lab-time .lab-time-shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lab-time .lab-time-shot {
  min-width: 0;
  margin: 0;
}

.lab-time .lab-time-shot figcaption {
  display: block;
  margin: .4rem 0 0;
  padding: 0;
  color: var(--lab-ink);
  font: 1rem/1.16 var(--serif, Georgia, serif);
  overflow-wrap: break-word;
}

.lab-time .lab-time-shot small {
  display: block;
  margin-top: .15rem;
  color: var(--lab-muted);
  font: .8rem/1.3 var(--sans, system-ui, sans-serif);
}

.lab-time-art {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  overflow: hidden;
  border: 1px solid #839082;
  border-radius: 2px;
}

.lab-time-current .lab-time-art {
  border-color: var(--lab-rust);
  outline: 2px solid var(--lab-rust);
  outline-offset: -2px;
}

.lab-time .lab-time-current figcaption {
  font-weight: 700;
}

.lab-time-omitted .lab-time-art {
  filter: grayscale(1);
  opacity: .5;
}

.lab-time-meter {
  margin: 0 0 1rem;
}

.lab-time-track-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: .1rem .75rem;
  margin-bottom: .3rem;
}

.lab-time-track-title :first-child {
  font-weight: 600;
}

.lab-time-track {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 1.8rem;
  overflow: visible;
  border: 1px solid #9b9c88;
  background: repeating-linear-gradient(135deg, #eeebe0 0 5px, #e7e2d5 5px 6px, #eeebe0 6px 9px);
}

.lab-time-segment {
  stroke: var(--lab-paper);
  stroke-width: 1px;
}

.lab-time-first, .lab-time-stage-pack { fill: var(--lab-green); }
.lab-time-second, .lab-time-stage-mark { fill: var(--lab-rust); }
.lab-time-stage-find { fill: #757759; }
.lab-time-stage-seal { fill: #806d50; }
.lab-time-stage-send { fill: #385049; }

.lab-time-rhythm-track {
  position: relative;
  margin-bottom: .7rem;
}

.lab-time-track-captions {
  pointer-events: none;
  position: absolute;
  inset: 0 .4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff8e6;
}

.lab-time-axis {
  display: flex;
  justify-content: space-between;
  gap: .15rem;
  margin-top: .32rem;
  color: var(--lab-muted);
  font-size: .78rem;
}

.lab-time-boundary { stroke: var(--lab-ink); stroke-width: 2px; }
.lab-time-cursor { stroke: #fffaf0; stroke-width: 2px; stroke-dasharray: 4 3; }
.lab-time-cursor-outline { stroke: #263d32; stroke-width: 4px; }

.lab-time-wait {
  height: .8rem;
}

.lab-time-wait-span {
  fill: #c79e6b;
}

.lab-time .lab-time-sequence {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .58rem;
}

.lab-time .lab-time-sequence:has(> li:nth-child(2):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lab-time-sequence li {
  position: relative;
  min-width: 0;
}

.lab-time-key {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .9rem;
  margin: .4rem 0 .7rem;
  color: var(--lab-muted);
}

.lab-time-key span {
  display: flex;
  align-items: center;
  gap: .3rem;
}

.lab-time-key i {
  display: inline-block;
  width: .68rem;
  height: .68rem;
}

.lab-time-key .lab-time-first { background: var(--lab-green); }
.lab-time-key .lab-time-second { background: var(--lab-rust); }

.lab-time-waveform {
  color: #fff8e6;
}

.lab-time-overlap {
  height: .7rem;
  border-block: 0;
  border-inline-color: transparent;
  background: none;
}

.lab-time-overlap-span {
  fill: #d6ba8a;
}

@container (min-width: 34rem) {
  .lab-time-screen .lab-time-shots {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@container (max-width: 18rem) {
  .lab-time .lab-time-sequence figcaption {
    font-size: .88rem;
  }

  .lab-time-track-title {
    gap: .15rem .45rem;
  }
}

/* The cut stays solid; the dashed playhead remains visible when they coincide. */
.lab-time-key .lab-time-key-boundary,
.lab-time-key .lab-time-key-cursor { width: 1.1rem; height: .8rem; background: none; position: relative; }
.lab-time-key-boundary::after,
.lab-time-key-cursor::after { content: ""; position: absolute; inset: 0 auto 0 50%; border-left: 2px solid var(--lab-ink); }
.lab-time-key-cursor::after { border-left: 2px dashed #fffaf0; filter: drop-shadow(0 0 1px #263d32) drop-shadow(0 0 1px #263d32); }
.lab-time-step { display: block; margin-bottom: .3rem; font-size: .75rem; font-weight: 700; color: var(--lab-muted); }
.lab-time-omitted figcaption { text-decoration: line-through; text-decoration-thickness: 1px; }
.lab-time-omitted figcaption small { text-decoration: none; font-weight: 700; }
@container (max-width: 25rem) {
  .lab-time .lab-time-sequence,
  .lab-time .lab-time-sequence:has(> li:nth-child(2):last-child) { grid-template-columns: 1fr; gap: .65rem; }
  .lab-time-sequence li { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); align-items: center; gap: .5rem; }
  .lab-time-sequence .lab-time-step { margin: 0; }
  .lab-time-sequence .lab-time-shot { display: grid; grid-template-columns: minmax(0, 6rem) minmax(0, 1fr); align-items: center; gap: .6rem; }
  .lab-time .lab-time-sequence figcaption { margin: 0; }
}
.lab-time-cut-flag { fill: #263d32; stroke: #fffaf0; stroke-width: .35px; }
.lab-time-art { aspect-ratio: 1; object-fit: cover; border: 0; border-radius: 0; }
.lab-time-meter { max-width: 43rem; }
.lab-time .lab-time-shot figcaption { line-height: 1.25; }
.lab-time-toggle { display: block; cursor: pointer; }
.lab-time-toggle-caption { display: flex; align-items: flex-start; gap: .5rem; margin-top: .4rem; }
.lab-time-toggle input { flex: none; width: 1.35rem; height: 1.35rem; margin: 0; accent-color: var(--lab-rust); }
.lab-time-toggle input:focus-visible { outline: 2px solid #315f70; outline-offset: 3px; }
.lab-time-toggle strong { display: block; font: 1rem/1.2 var(--serif, Georgia, serif); }
.lab-time-toggle small { display: block; }
.lab-time-omitted .lab-time-toggle-caption strong { text-decoration: line-through; }
.lab-time-rhythm .lab-time-art, .lab-time-sound .lab-time-art { aspect-ratio: 1.6; object-fit: cover; object-position: center 34%; }
.lab-time-rhythm .lab-time-meter { max-width: none; }
.lab-sound-envelope { fill: none; stroke: #fffaf0; stroke-width: .55; opacity: .85; }
.lab-sound-envelope-note { margin-top: .25rem; color: var(--lab-muted); font-size: .75rem; }
