.lab-page {
  padding: var(--space-8) 0 var(--space-9);
}

.lab-card {
  max-width: 36rem;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow);
}

.lab-card h1 {
  margin: 0 0 var(--space-3);
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.03em;
}

.lab-card .lede {
  margin: 0 0 var(--space-5);
  color: var(--text-muted);
}

.lab-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-5);
}

.lab-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-subtle);
}

.lab-status.is-ready {
  border-color: rgba(52, 211, 153, 0.45);
  color: #bbf7d0;
}

.lab-status.is-ready .lab-status-dot {
  background: #34d399;
}

.lab-status.is-alert {
  border-color: rgba(248, 113, 113, 0.5);
  color: #fecaca;
}

.lab-status.is-alert .lab-status-dot {
  background: #f87171;
}

.lab-frame {
  width: 100%;
  max-width: 320px;
  margin: 0 auto var(--space-4);
  aspect-ratio: 1;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lab-frame canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lab-labels {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.lab-label-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.lab-bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.lab-bar-fill {
  position: absolute;
  inset: 0;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 160ms ease-out;
}

.lab-bar-fill.is-alert {
  background: #f87171;
}

.lab-note {
  margin: var(--space-4) 0 0;
  font-size: var(--text-xs);
  color: var(--text-subtle);
}

@media (prefers-reduced-motion: reduce) {
  .lab-bar-fill {
    transition: none;
  }
}
