/* ==========================================================================
   Recording Screen Dedicated Styles (Pixel-matched to recording ui.png)
   Scoped specifically to #step-record
   ========================================================================== */

#step-record h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #000000;
  margin: 0 0 10px;
}

#step-record .video-sticky {
  position: static;
  margin: 0;
  padding: 0;
  box-shadow: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Video Preview Container */
#step-record .video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: min(45vh, 380px);
  max-width: calc(min(45vh, 380px) * 4 / 3);
  border-radius: 18px;
  overflow: hidden;
  background: #000000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  margin: 0 auto;
}

@media (max-width: 380px) {
  #step-record .video-wrap {
    max-height: 260px;
  }
}

#step-record #cam {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  display: block;
}

/* Face Oval Guide */
#step-record .face-guide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

#step-record .face-guide-ring {
  fill: none;
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 3px;
  stroke-dasharray: 10 7;
  stroke-linecap: round;
  transition: stroke 0.2s ease, stroke-dasharray 0.2s ease;
}

#step-record .face-guide.adjust .face-guide-ring {
  stroke: #fbbf24;
}

#step-record .face-guide.recheck .face-guide-ring {
  stroke: #f59e0b;
}

#step-record .face-guide.aligned .face-guide-ring {
  stroke: #10b981;
  stroke-dasharray: none;
}

#step-record .face-guide-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  white-space: nowrap;
  pointer-events: none;
  z-index: 4;
  margin: 0;
  max-width: 80%;
  text-align: center;
}

#step-record .face-guide-hint.action-prompt {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(59, 130, 246, 0.5);
  color: #93c5fd;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}

#step-record .face-guide-hint.action-done {
  background: rgba(6, 78, 59, 0.9);
  border-color: rgba(16, 185, 129, 0.6);
  color: #34d399;
}

#step-record .face-guide-hint[hidden],
.face-guide-hint[hidden] {
  display: none !important;
}

/* Eye Blink HUD Badge */
#step-record #blink-hud {
  display: none !important;
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 5;
  color: #f1f5f9;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
}

#step-record #blink-hud .blink-hud-icon {
  font-size: 0.92rem;
  line-height: 1;
}

#step-record #blink-hud .blink-hud-label {
  color: #cbd5e1;
  font-weight: 500;
  font-size: 0.72rem;
}

#step-record #blink-hud .blink-hud-count {
  font-family: ui-monospace, monospace;
  font-size: 0.88rem;
  font-weight: 800;
  color: #ffffff;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 5px;
}

#step-record #blink-hud .blink-hud-target {
  font-size: 0.70rem;
  color: #94a3b8;
  font-weight: 500;
}

#step-record #blink-hud.in-target {
  border-color: rgba(16, 185, 129, 0.55);
  background: rgba(6, 78, 59, 0.82);
}

#step-record #blink-hud.in-target .blink-hud-count {
  color: #34d399;
  background: rgba(16, 185, 129, 0.25);
}

#step-record #blink-hud.in-target .blink-hud-target {
  color: #a7f3d0;
  font-weight: 600;
}

#step-record #blink-hud.exceeded {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(127, 29, 29, 0.85);
}

#step-record #blink-hud.exceeded .blink-hud-count {
  color: #f87171;
  background: rgba(239, 68, 68, 0.25);
}

#step-record #blink-hud.exceeded .blink-hud-target {
  color: #fca5a5;
  font-weight: 600;
}

/* Blink Prompt Overlay (Post-TTS Eye Blink Reminder) */
#step-record .blink-prompt-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#step-record .blink-prompt-overlay[hidden] {
  display: none !important;
}

#step-record .blink-prompt-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  padding: 14px 22px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
  animation: blinkPromptFloat 2s ease-in-out infinite;
}

#step-record .blink-prompt-icon {
  width: 78px;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}

#step-record .blink-prompt-icon svg#Eyes {
  width: 100%;
  height: 100%;
  display: block;
  transform-origin: 50% 50%;
  animation: eyeBlinkEffect 2.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes eyeBlinkEffect {

  0%,
  62%,
  100% {
    transform: scale(1, 1);
  }

  66% {
    transform: scale(1.04, 0.04);
  }

  70% {
    transform: scale(1, 1);
  }

  74% {
    transform: scale(1.04, 0.04);
  }

  78% {
    transform: scale(1, 1);
  }
}

#step-record .blink-prompt-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #f8fafc;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

@keyframes blinkPromptFloat {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(59, 130, 246, 0.4);
  }

  50% {
    transform: scale(1.03);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 0 8px rgba(59, 130, 246, 0);
  }
}

@media (max-width: 380px) {
  #step-record .blink-prompt-card {
    padding: 10px 16px;
    gap: 6px;
  }

  #step-record .blink-prompt-icon {
    width: 60px;
    height: 60px;
  }

  #step-record .blink-prompt-label {
    font-size: 0.78rem;
  }
}

/* Telemetry HUD */
#step-record #live-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  left: auto;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.72rem;
  min-width: 138px;
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 5;
}

#step-record .ov-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  white-space: nowrap;
}

#step-record .ov-label {
  color: #94a3b8;
  font-weight: 500;
  font-size: 0.7rem;
}

#step-record .ov-tag {
  font-family: ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.03em;
}

#step-record .ov-tag.ov-ok {
  color: #10b981;
}

#step-record .ov-tag.ov-warn {
  color: #fbbf24;
}

#step-record .ov-tag.ov-danger {
  color: #ef4444;
}

#step-record .ov-tag.ov-idle {
  color: #94a3b8;
}

/* Statusline: 36 + Progress Bar */
#step-record .statusline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 2px;
  margin: 8px 0 4px;
}

#step-record #timer {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #000000;
  line-height: 1;
  min-width: 38px;
  font-variant-numeric: tabular-nums;
  padding: 0;
  background: transparent;
  border: none;
}

#step-record #progress {
  flex: 1 1 auto;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin: 0;
}

#step-record #progress-bar {
  height: 100%;
  background: #2563eb;
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* Challenge Banner */
#step-record #challenge-bar {
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  padding: 6px 12px;
  margin: 2px 0 6px;
}

#step-record #challenge-bar[hidden] {
  display: none;
}

#step-record .challenge-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

#step-record #challenge-dots {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
}

#step-record #challenge-dots li {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  background: #e2e8f0;
  color: #64748b;
}

#step-record #challenge-dots li.done {
  background: #86efac;
  color: #166534;
}

#step-record #challenge-dots li.current {
  background: #2563eb;
  color: #ffffff;
}

#step-record #challenge-instruction {
  font-size: 0.88rem;
  font-weight: 800;
  color: #000000;
  letter-spacing: -0.01em;
  margin: 0;
  flex: 1;
  /* white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; */
}

/* Narration / Prompt Box */
#step-record #prompt {
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-left: 1px solid #dbeafe;
  border-radius: 16px;
  padding: 14px 16px;
  margin-top: 6px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  min-height: auto;
}

#step-record #prompt-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #2563eb;
  text-transform: uppercase;
  margin-bottom: 8px;
  text-align: left;
}

#step-record #prompt-body {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #0f172a;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
}

#step-record #narration-captions {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  max-height: 140px;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 0;
}

#step-record #narration-captions::-webkit-scrollbar {
  display: none;
}

#step-record .narr-line {
  margin-bottom: 8px;
}

#step-record .narr-word {
  color: #94a3b8;
  transition: color 0.15s ease;
}

#step-record .narr-word.said {
  color: #94a3b8;
}

#step-record .narr-word.now {
  color: #000000;
  font-weight: 900;
  background: transparent !important;
}

#step-record #prompt code,
#step-record #narration-captions code {
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  background: transparent;
  border: none;
  padding: 0;
  display: inline;
  white-space: normal;
}

/* Finish Button */
#step-record #finish-btn,
#step-record .finish-btn-main {
  width: 100%;
  background: #2563eb;
  color: #ffffff;
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.04em;
  padding: 14px 18px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  text-transform: uppercase;
  margin-top: 4px;
  margin-bottom: 8px;
  transition: all 0.15s ease;
}

#step-record #finish-btn:disabled,
#step-record .finish-btn-main:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

#step-record #finish-btn:hover:not(:disabled) {
  background: #1d4ed8;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

#step-record #finish-btn:active:not(:disabled) {
  transform: scale(0.98);
}

/* Result Page Error Banner */
.result-error-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 16px 0 20px 0;
  text-align: left;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.08);
}

.result-error-banner[hidden] {
  display: none !important;
}

.result-error-icon {
  color: #dc2626;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
}

.result-error-content {
  flex: 1;
}

.result-error-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: #991b1b;
  margin-bottom: 4px;
}

.result-error-desc {
  font-size: 0.85rem;
  color: #b91c1c;
  line-height: 1.45;
}