.test-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr);
  gap: 24px;
  align-items: start;
}
.live-stream-card {
  margin-top: 0;
  padding: 25px;
  background: #fff;
  border: 1px solid #dbe5f2;
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(18, 35, 63, .12);
}
.live-stream-card h3 { margin: 6px 0; }
.live-stream-card p { color: #58708f; }
.stream-frame {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(165px, 18vw, 225px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid #dbe5f2;
  border-radius: 12px;
  background: #071223;
}
.stream-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--camera-x, 50%) var(--camera-y, 50%);
}
.camera-arrow {
  position: absolute;
  z-index: 3;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 8px;
  color: #fff;
  background: rgba(5,22,46,.72);
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
  font-size: 15px;
  line-height: 1;
}
.camera-arrow:hover { background: rgba(14,99,219,.9); }
.camera-up { top: 8px; left: 50%; transform: translateX(-50%); }
.camera-down { bottom: 8px; left: 50%; transform: translateX(-50%); }
.camera-left { left: 8px; top: 50%; transform: translateY(-50%); }
.camera-right { right: 8px; top: 50%; transform: translateY(-50%); }
.stream-placeholder:not([hidden]) ~ .camera-arrow { display: none; }
.stream-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #dbeafe;
  background: linear-gradient(135deg, #071223, #102747);
  text-align: center;
  font-weight: 700;
}
.stream-placeholder[hidden] { display: none; }
.stream-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.stream-actions .stream-note { margin: 0; }
.stream-status-live { color: #147a64 !important; }
.stream-status-error { color: #8e302c !important; }
.stream-note { font-size: .85rem; margin: 12px 0 0; }
.hardware-error { color: #8e302c !important; }
.lab-turn { border-top: 1px solid #dbe5f2; margin-top: 18px; padding-top: 16px; }
.lab-turn-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.lab-turn .stream-note { margin: 0; }
@media (min-width: 981px) {
  .test-workspace {
    grid-template-columns: minmax(0, 1.65fr) minmax(360px, 1.5625fr) minmax(360px, 1.44fr);
    width: 127.47%;
    align-items: stretch;
  }
  .test-layout { display: contents; }
  .logic-card,
  .output-card { height: 100%; }
  .live-stream-card { display: flex; flex-direction: column; }
}
@media (max-width: 980px) {
  .test-workspace { grid-template-columns: 1fr; width: 100%; }
  .test-layout { display: grid; }
  .stream-frame { height: clamp(170px, 42vw, 225px); }
  .stream-actions { align-items: flex-start; flex-direction: column; }
}
