.overlay-lab-page .page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 18px;
  align-items: start;
  margin-top: 28px;
}

.overlay-lab-page .page-header-copy {
  display: grid;
  gap: 16px;
  align-content: start;
}

.overlay-lab-page .lede {
  max-width: 68ch;
}

.overlay-lab-page .summary-card {
  padding: 18px;
  border-radius: 8px;
  border: 1px solid var(--console-line);
  background: var(--console-panel);
  box-shadow: var(--console-shadow);
  display: grid;
  gap: 14px;
}

.overlay-lab-page .summary-art {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--console-line);
  background: rgba(255, 255, 255, 0.04);
}

.overlay-lab-page .summary-card h2 {
  margin: 0;
  line-height: 1.08;
  font-size: 1.7rem;
}

.overlay-lab-page .summary-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.overlay-lab-page .summary-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--console-muted);
  line-height: 1.45;
}

.overlay-lab-page .summary-list li::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: 0.6em;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 14px currentColor;
  flex: 0 0 auto;
}

.overlay-lab-page .workspace {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1.15fr) minmax(320px, 360px);
  grid-template-areas:
    "queue preview controls"
    "command command controls";
  gap: 18px;
  margin-top: 28px;
}

.overlay-lab-page .queue-panel { grid-area: queue; }
.overlay-lab-page .preview-panel { grid-area: preview; }
.overlay-lab-page .controls-panel { grid-area: controls; }
.overlay-lab-page .command-panel { grid-area: command; }

.overlay-lab-page .panel {
  padding: 18px;
  border-radius: 8px;
  border: 1px solid var(--console-line);
  background: var(--console-panel);
  box-shadow: var(--console-shadow);
  display: grid;
  gap: 14px;
  align-content: start;
}

.overlay-lab-page .panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.overlay-lab-page .panel-head h2,
.overlay-lab-page .control-block h3 {
  margin: 0;
  line-height: 1.08;
}

.overlay-lab-page .panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.overlay-lab-page .panel-note {
  margin: 0;
  color: var(--console-muted);
  line-height: 1.45;
}

.overlay-lab-page .queue-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
}

.overlay-lab-page .queue-item {
  display: grid;
  gap: 6px;
  padding: 12px 12px 11px;
  border-radius: 8px;
  border: 1px solid rgba(125, 255, 179, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  cursor: pointer;
}

.overlay-lab-page .queue-item.is-selected {
  border-color: rgba(37, 211, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(37, 211, 255, 0.25) inset;
}

.overlay-lab-page .queue-item strong {
  font-size: 1rem;
}

.overlay-lab-page .queue-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--console-muted);
  font-size: 0.92rem;
}

.overlay-lab-page .queue-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.overlay-lab-page .queue-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(37, 211, 255, 0.9), rgba(125, 255, 179, 0.9));
}

.overlay-lab-page .status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.overlay-lab-page .status-grid > div {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(125, 255, 179, 0.16);
  background: rgba(255, 255, 255, 0.03);
}

.overlay-lab-page .status-label {
  display: block;
  margin-bottom: 6px;
  color: var(--console-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.overlay-lab-page .preview-stage {
  position: relative;
  min-height: 420px;
  border-radius: 8px;
  border: 1px solid var(--console-line);
  background:
    linear-gradient(180deg, rgba(21, 25, 31, 0.95), rgba(10, 14, 18, 0.95)),
    radial-gradient(circle at 40% 20%, rgba(37, 211, 255, 0.12), transparent 34%),
    #141a21;
  overflow: hidden;
}

.overlay-lab-page .preview-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.65;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.15) 80%, transparent);
}

.overlay-lab-page .preview-placeholder,
.overlay-lab-page #previewVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.overlay-lab-page #previewVideo {
  object-fit: contain;
  background: #0d1116;
}

.overlay-lab-page .preview-placeholder {
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--console-muted);
  text-align: center;
  line-height: 1.5;
  font-size: 1rem;
}

.overlay-lab-page .watermark-box {
  position: absolute;
  left: 24px;
  top: 24px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(37, 211, 255, 0.82);
  background: rgba(241, 255, 255, 0.22);
  box-shadow: 0 0 0 1px rgba(2, 15, 12, 0.28) inset, 0 12px 30px rgba(0, 0, 0, 0.24);
  border-radius: 8px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  overflow: hidden;
}

.overlay-lab-page .watermark-box:active {
  cursor: grabbing;
}

.overlay-lab-page .watermark-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.overlay-lab-page #watermarkText {
  display: none;
  padding: 10px 14px;
  color: #0e1a20;
  font-weight: 700;
  text-shadow: none;
  line-height: 1.15;
}

.overlay-lab-page .preview-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 18px;
  color: var(--console-muted);
  font-size: 0.93rem;
}

.overlay-lab-page .preview-footer p {
  margin: 0;
}

.overlay-lab-page .control-block {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.overlay-lab-page .control-block + .control-block {
  border-top: 1px solid rgba(125, 255, 179, 0.12);
  padding-top: 16px;
}

.overlay-lab-page .control-block h3 {
  font-size: 1.05rem;
}

.overlay-lab-page .field-grid {
  display: grid;
  gap: 10px;
}

.overlay-lab-page .field-grid.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.overlay-lab-page .field-grid.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.overlay-lab-page .field-grid.four-up {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.overlay-lab-page .field {
  display: grid;
  gap: 6px;
  color: var(--console-muted);
  font-size: 0.95rem;
}

.overlay-lab-page .field span {
  color: var(--console-muted);
}

.overlay-lab-page .field input,
.overlay-lab-page .field select,
.overlay-lab-page .field textarea {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 6px;
  border: 1px solid rgba(125, 255, 179, 0.18);
  background: rgba(2, 9, 7, 0.55);
  color: var(--console-text);
  box-sizing: border-box;
}

.overlay-lab-page .field input[type="range"] {
  padding: 0;
  height: 28px;
  accent-color: #25d3ff;
}

.overlay-lab-page .field input:focus,
.overlay-lab-page .field select:focus,
.overlay-lab-page .field textarea:focus {
  outline: 1px solid rgba(37, 211, 255, 0.58);
  border-color: rgba(37, 211, 255, 0.58);
}

.overlay-lab-page .check {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--console-muted);
  line-height: 1.4;
}

.overlay-lab-page .check input {
  margin: 0;
  accent-color: #25d3ff;
}

.overlay-lab-page .checks-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.overlay-lab-page .command-panel {
  min-width: 0;
}

.overlay-lab-page #commandOutput {
  min-height: 220px;
  width: 100%;
  resize: vertical;
  box-sizing: border-box;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(125, 255, 179, 0.18);
  background: rgba(2, 9, 7, 0.72);
  color: #d9efe7;
  font-family: Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.92rem;
  line-height: 1.45;
}

.overlay-lab-page .command-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.overlay-lab-page .command-meta > div {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(125, 255, 179, 0.16);
  background: rgba(255, 255, 255, 0.03);
}

.overlay-lab-page .command-meta strong {
  display: block;
  line-height: 1.45;
  font-weight: 600;
}

.overlay-lab-page .muted {
  color: var(--console-muted);
}

@media (max-width: 1180px) {
  .overlay-lab-page .workspace {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "queue preview"
      "controls controls"
      "command command";
  }
}

@media (max-width: 760px) {
  .overlay-lab-page .page-header,
  .overlay-lab-page .workspace,
  .overlay-lab-page .field-grid.two-up,
  .overlay-lab-page .field-grid.three-up,
  .overlay-lab-page .field-grid.four-up,
  .overlay-lab-page .status-grid,
  .overlay-lab-page .command-meta {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  .overlay-lab-page .workspace {
    grid-template-areas:
      "queue"
      "preview"
      "controls"
      "command";
  }

  .overlay-lab-page .actions,
  .overlay-lab-page .panel-actions,
  .overlay-lab-page .checks-row {
    flex-direction: column;
    align-items: stretch;
  }

  .overlay-lab-page .actions .button,
  .overlay-lab-page .panel-actions .button {
    width: 100%;
  }
}
