h1 {
  margin-top: 32px;
  margin-bottom: 8px;
  font-size: 2rem;
}

.lede {
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 28px;
  max-width: 60ch;
}

.tool {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.setup-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.mode-picker {
  display: flex;
  align-items: center;
  gap: 16px;
  border: none;
  padding: 0;
  margin: 0;
}

.mode-picker legend {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0;
  margin-right: 4px;
}

.radio, .toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
}

.radio input, .toggle input { width: 16px; height: 16px; }

.radio:has(input:disabled), .toggle:has(input:disabled) {
  color: var(--muted);
  cursor: not-allowed;
}

/* Stage visibility: only the block matching data-stage is shown */
.stage-idle, .stage-live, .stage-result { display: none; }
.tool[data-stage="idle"] .stage-idle { display: block; }
.tool[data-stage="recording"] .stage-live,
.tool[data-stage="paused"] .stage-live { display: block; }
.tool[data-stage="done"] .stage-result { display: block; }

.stage-idle {
  text-align: center;
  padding: 40px 0;
}

.btn {
  font: inherit;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}

.btn:hover { border-color: var(--muted); }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn--primary:hover { opacity: 0.92; }

.btn--danger {
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
}

.btn--danger:hover { opacity: 0.92; }

.btn--big {
  padding: 16px 32px;
  font-size: 1.05rem;
}

.video-frame {
  position: relative;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  max-height: 480px;
}

.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}

.rec-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e2483a;
  animation: rec-pulse 1.2s ease-in-out infinite;
}

@keyframes rec-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.tool[data-stage="paused"] .rec-dot { animation: none; opacity: 0.4; }

.record-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 16px 0;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.95rem;
}

.record-stats strong { color: var(--ink); font-size: 1.1rem; }

.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.hint {
  color: #c0392b;
  font-size: 0.85rem;
  margin: 16px 0 0;
  text-align: center;
}

.faq { margin-top: 48px; max-width: 70ch; }

.faq h2 { font-size: 1.3rem; margin-top: 32px; }

details {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

details summary {
  cursor: pointer;
  font-weight: 600;
}

@media (max-width: 640px) {
  .setup-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .video-frame { max-height: 320px; }
}
