/* Snapshot tool */
.snapshot__start {
  display: grid;
  place-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space);
  text-align: center;
}

.snapshot__start .btn {
  margin: 0 auto;
}

.btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.snapshot__stage {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: var(--space) auto 0;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  line-height: 0;
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
}

.snapshot__stage video,
.snapshot__stage canvas {
  display: block;
  max-width: 100%;
  max-height: 65vh;
  width: auto;
  height: auto;
  margin: 0 auto;
}

.snapshot__sel {
  position: absolute;
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
  pointer-events: none;
}

.snapshot__sel-label {
  position: absolute;
  top: -22px;
  left: 0;
  background: var(--primary);
  color: var(--active-text);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  font-family: "SF Mono", Monaco, Consolas, monospace;
}

.snapshot__controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space);
}

.snapshot__capture-actions {
  position: sticky;
  z-index: 5;
  bottom: var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space);
  margin-top: var(--space);
  padding: var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.snapshot__capture-size {
  padding-left: var(--space-xs);
  color: var(--text-muted);
  font-family: "SF Mono", Monaco, Consolas, monospace;
  font-size: 12px;
  white-space: nowrap;
}

.snapshot__pdf-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space);
}

.snapshot__page-info {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 84px;
  text-align: center;
}

.snapshot__result .preview {
  margin-top: var(--space);
}

.snapshot__result .preview__media img {
  max-height: 60vh;
}

/* Region lock badge */
.snapshot__lock-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  pointer-events: none;
  z-index: 3;
}

.snapshot__lock-badge svg {
  flex-shrink: 0;
}

/* Locked selection style */
.snapshot__sel.is-locked {
  border-color: #e53e3e;
  border-style: dashed;
}

/* Scroll recording controls */
.snapshot__scroll-controls {
  align-items: center;
}

.snapshot__stop-rec {
  color: #e53e3e;
  border-color: #e53e3e;
}

.snapshot__rec-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

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

@keyframes snpRecPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.snapshot__rec-count {
  color: var(--primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 560px) {
  .snapshot__stage video {
    max-height: 50vh;
  }

  .snapshot__sel-label {
    font-size: 10px;
    top: -20px;
  }

  .snapshot__capture-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .snapshot__capture-actions .actions__btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .snapshot__capture-actions .btn--primary {
    grid-column: 1 / -1;
  }
}
