* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: #ffffff;
  color: black;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.container {
  max-width: 720px;
  width: 100%;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: black;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.steps {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.step {
  flex: 1;
  background: #f5f5f5;
  padding: 0.85rem;
  text-align: center;
}

.step-num {
  font-size: 1.25rem;
  font-weight: 700;
  color: black;
}

.step-label {
  font-size: 0.7rem;
  color: #404040;
  margin-top: 0.15rem;
}

.video-wrap {
  position: relative;
  background: white;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

video {
  display: none;
}

canvas {
  width: 100%;
  height: auto;
  display: block;
}

.recording-badge {
  display: none;
  position: absolute;
  top: 12px;
  left: 12px;
  background: #ef4444;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  animation: pulse-badge 1s ease infinite;
}

.recording-badge.active {
  display: block;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── Sections ──────────────────────── */
.section {
  background: #f5f5f5;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #525252;
  margin-bottom: 0.75rem;
}

.rec-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.rec-btn {
  flex: 1;
  padding: 0.75rem;
  border: 2px solid #d4d4d4;
  background: white;
  color: black;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  -webkit-user-select: none;
}

.rec-btn:active,
.rec-btn.held {
  border-color: #ef4444;
  background: #fef2f2;
}

.rec-btn .key {
  display: inline-block;
  background: #e5e5e5;
  padding: 1px 6px;
  font-size: 0.7rem;
  margin-left: 4px;
  font-family: monospace;
  color: black;
}

.sample-counts {
  font-size: 0.8rem;
  color: #525252;
}

.sample-counts span {
  color: black;
  font-weight: 600;
}


.conf-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.conf-bar {
  flex: 1;
  height: 8px;
  background: #e5e5e5;
  overflow: hidden;
}

.conf-fill {
  height: 100%;
  width: 0%;
  background: #22c55e;
  transition: width 0.1s;
}

.conf-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: black;
  min-width: 36px;
  text-align: right;
}


.train-btn {
  width: 100%;
  padding: 0.75rem;
  border: none;
  background: #2563eb;
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 0.75rem;
}

.train-btn:hover {
  background: #1d4ed8;
}

.train-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.status {
  font-size: 0.8rem;
  color: #525252;
  min-height: 1.2rem;
}


.util-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.util-btn {
  padding: 0.5rem 0.85rem;
  border: 1px solid #d4d4d4;
  background: transparent;
  color: #525252;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
}

.util-btn:hover {
  border-color: #737373;
  color: black;
}

.util-btn.danger:hover {
  border-color: #ef4444;
  color: #ef4444;
}