.subtitle-correction-workspace {
  display: grid;
  gap: 20px;
}

.correction-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 6px 2px 8px;
}

.correction-hero h1,
.correction-result-head h2,
.correction-progress-head h2 {
  margin: 4px 0 8px;
  color: var(--text-primary);
}

.correction-hero p,
.correction-result-head p,
.correction-progress-card p {
  color: var(--text-secondary);
  line-height: 1.65;
}

.correction-kicker {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.correction-limit {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.correction-card {
  padding: 22px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--bg-white);
  box-shadow: var(--shadow-sm);
}

.correction-dropzone {
  min-height: 220px;
  padding: 32px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-page);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.correction-dropzone:hover,
.correction-dropzone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-subtle);
  transform: translateY(-1px);
}

.correction-dropzone input { display: none; }
.correction-dropzone strong { color: var(--text-primary); font-size: 1rem; }
.correction-dropzone small { color: var(--text-muted); line-height: 1.5; }
.correction-drop-icon { font-size: 2rem; }

.correction-file-info {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(90px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.correction-file-info > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-page);
}

.correction-file-info small,
.correction-file-info strong { display: block; }
.correction-file-info small { margin-bottom: 5px; color: var(--text-muted); font-size: 0.7rem; }
.correction-file-info strong { overflow: hidden; color: var(--text-primary); font-size: 0.82rem; text-overflow: ellipsis; white-space: nowrap; }

.correction-paid-notice {
  margin: 14px 0;
  padding: 10px 12px;
  border: 1px solid var(--yellow-border);
  border-radius: var(--radius-sm);
  background: var(--yellow-subtle);
  color: #8a6100;
  font-size: 0.78rem;
  line-height: 1.5;
}

.correction-speaker-input { display: block; margin-top: 14px; }
.correction-speaker-input > span { display: block; margin-bottom: 6px; color: var(--text-primary); font-size: 0.78rem; font-weight: 750; }
.correction-speaker-input input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text-primary); font: inherit; font-size: 0.84rem; }
.correction-speaker-input small { display: block; margin-top: 6px; color: var(--text-muted); font-size: 0.7rem; }
.correction-speaker-input small.is-ready { color: var(--green); }

.correction-primary-btn,
.correction-secondary-btn {
  min-height: 42px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 750;
  cursor: pointer;
}

.correction-primary-btn {
  width: 100%;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.correction-primary-btn.compact { width: auto; }
.correction-primary-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.correction-secondary-btn { border: 1px solid var(--border); background: var(--bg-white); color: var(--text-primary); }
.correction-help { margin-top: 10px; color: var(--text-muted); font-size: 0.76rem; }
.correction-help.is-error { color: var(--red); }

.correction-progress-head,
.correction-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.correction-progress-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.correction-elapsed-timer {
  min-width: 74px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: center;
}

.correction-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: correction-spin 0.8s linear infinite;
}

@keyframes correction-spin { to { transform: rotate(360deg); } }

.correction-progress-track {
  height: 8px;
  margin: 18px 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border-light);
}

.correction-progress-track > div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.35s ease;
}

.correction-progress-card.is-failed .correction-progress-track > div {
  background: var(--red);
}

.correction-progress-card.is-failed .correction-progress-head h2,
.correction-progress-card.is-failed #correctionProgressText {
  color: var(--red);
}

.correction-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.correction-steps li {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 0.73rem;
  font-weight: 650;
}

.correction-steps span {
  width: 23px;
  height: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-white);
}

.correction-steps li.is-active { color: var(--accent); }
.correction-steps li.is-active span { border-color: var(--accent); }
.correction-steps li.is-done { color: var(--green); }
.correction-steps li.is-done span { border-color: var(--green-border); background: var(--green-subtle); }

.correction-actions { display: flex; flex-wrap: nowrap; gap: 8px; }
.correction-actions button { flex: 0 0 auto; white-space: nowrap; word-break: keep-all; }
.correction-video-frame { position: relative; margin-top: 18px; overflow: hidden; border-radius: var(--radius-sm); background: #111; }
.correction-video { display: block; width: 100%; max-height: clamp(180px, 32vh, 380px); background: #111; }
.correction-subtitle-overlay {
  position: absolute;
  right: 6%;
  bottom: 12%;
  left: 6%;
  width: fit-content;
  max-width: 88%;
  margin: 0 auto;
  padding: 7px 12px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: clamp(0.9rem, 2vw, 1.35rem);
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  text-shadow: 0 1px 2px #000;
  white-space: pre-wrap;
  pointer-events: none;
}
.correction-editor-note { margin: 8px 0 6px; color: var(--text-muted); font-size: 0.76rem; }
.correction-editor-note.is-error { color: var(--red); }
.correction-cue-list { max-height: 620px; overflow-y: auto; border-top: 1px solid var(--border-light); }

.correction-cue {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: background 0.2s, box-shadow 0.2s;
}

.correction-cue.is-active { background: var(--accent-subtle); box-shadow: inset 3px 0 0 var(--accent); }
.correction-cue-body { min-width: 0; }
.correction-cue-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.correction-review-badge { display: inline-block; padding: 3px 7px; border-radius: 999px; font-size: 0.68rem; font-weight: 700; }
.correction-review-badge { background: var(--yellow-subtle); color: #8a6100; }
.correction-speaker-picker { display: flex; flex: 1 1 100%; align-items: center; gap: 8px; min-width: 0; color: var(--text-muted); font-size: 0.7rem; font-weight: 700; }
.correction-speaker-picker-label { flex: 0 0 auto; writing-mode: horizontal-tb; text-orientation: mixed; white-space: nowrap; }
.correction-speaker-options { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.correction-speaker-chip { padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-page); color: var(--text-muted); font: inherit; font-size: 0.7rem; font-weight: 760; line-height: 1.2; white-space: nowrap; cursor: pointer; transition: transform 0.12s, box-shadow 0.12s, background 0.12s, color 0.12s; }
.correction-speaker-chip:hover { border-color: var(--text-muted); background: var(--border-light); color: var(--text-primary); transform: translateY(-1px); }
.correction-speaker-chip.is-selected { border-color: hsl(var(--speaker-hue) 68% 40%); background: hsl(var(--speaker-hue) 68% 45%); color: #fff; box-shadow: 0 2px 8px hsl(var(--speaker-hue) 65% 30% / 0.3); }
.correction-speaker-chip:focus-visible { outline: 2px solid hsl(var(--speaker-hue) 72% 42%); outline-offset: 2px; }
.correction-cue textarea { width: 100%; min-height: 58px; resize: vertical; padding: 9px 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-input); color: var(--text-primary); font: inherit; line-height: 1.5; }
.correction-cue textarea:focus { outline: 2px solid var(--accent-glow); border-color: var(--accent); }

@media (max-width: 760px) {
  .correction-hero,
  .correction-result-head,
  .correction-progress-head { flex-direction: column; }
  .correction-progress-meta { width: 100%; justify-content: space-between; }
  .correction-file-info { grid-template-columns: 1fr 1fr; }
  .correction-steps { grid-template-columns: 1fr; }
  .correction-cue { grid-template-columns: 1fr; gap: 6px; }
  .correction-actions { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .correction-actions::-webkit-scrollbar { display: none; }
}

.correction-cue.is-selected { outline: 1px solid var(--accent); outline-offset: -1px; }
.correction-remove-cue { justify-self: start; border: 0; background: transparent; color: var(--text-muted); font: inherit; font-size: 0.7rem; cursor: pointer; }
.correction-remove-cue:hover { color: var(--red); }
.correction-cue-gap { display: flex; align-items: center; justify-content: center; min-height: 38px; margin: 3px 0; border: 1px dashed transparent; border-radius: 7px; }
.correction-cue-gap button { opacity: 0; padding: 7px 14px; border: 1px solid var(--accent); border-radius: 999px; background: var(--bg-white); color: var(--accent); font: inherit; font-size: 0.75rem; cursor: pointer; transition: opacity 0.15s; }
.correction-cue-gap:hover, .correction-cue-gap:focus-within { border-color: var(--border); background: var(--accent-subtle); }
.correction-cue-gap:hover button, .correction-cue-gap:focus-within button { opacity: 1; }
.correction-timeline { margin: 10px 0; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-page); }
.correction-timeline-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--text-primary); font-size: 0.78rem; }
.correction-timeline-toolbar > span { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.correction-timeline-toolbar label { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.correction-timeline-ruler { position: relative; height: 22px; margin-top: 6px; color: var(--text-muted); font-size: 0.66rem; font-variant-numeric: tabular-nums; }
.correction-timeline-ruler span { position: absolute; bottom: 5px; transform: translateX(-50%); }
.correction-timeline-ruler span:first-child { transform: none; }
.correction-timeline-ruler span:last-child { transform: translateX(-100%); }
.correction-timeline-lane { position: relative; height: 56px; border-radius: 6px; background: var(--border-light); touch-action: none; user-select: none; }
.correction-timeline-cue { position: absolute; top: 8px; height: 40px; min-width: 1px; display: flex; align-items: stretch; border: 1px solid hsl(var(--speaker-hue) 65% 45%); border-radius: 5px; background: hsl(var(--speaker-hue) 55% 90%); color: hsl(var(--speaker-hue) 65% 25%); }
.correction-timeline-cue.is-selected { z-index: 2; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.correction-timeline-select { min-width: 0; flex: 1; padding: 5px 4px; overflow: hidden; border: 0; background: transparent; color: inherit; font: inherit; font-size: 0.72rem; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.correction-trim-handle { position: absolute; top: 0; bottom: 0; z-index: 3; width: 12px; border-radius: 4px; background: hsl(var(--speaker-hue) 65% 45%); cursor: ew-resize; touch-action: none; }
.correction-trim-handle[data-edge="start"] { left: -5px; }
.correction-trim-handle[data-edge="end"] { right: -5px; }
.correction-trim-handle::after { content: ''; position: absolute; top: 13px; bottom: 13px; left: 5px; border-left: 2px solid #fff; }
.correction-trim-handle:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.correction-timeline-cue .correction-timeline-select { margin: 0 8px; }
.correction-timeline-gap { position: absolute; inset-block: 8px; padding: 0; overflow: hidden; border: 1px dashed transparent; border-radius: 5px; background: transparent; color: transparent; font-size: 1.1rem; cursor: pointer; }
.correction-timeline-gap:hover, .correction-timeline-gap:focus-visible { border-color: var(--accent); background: var(--accent-subtle); color: var(--accent); }
.correction-timeline-playhead { position: absolute; top: -5px; bottom: -5px; z-index: 4; width: 2px; background: var(--red); pointer-events: none; }
.correction-timeline-playhead::before { content: ''; position: absolute; top: -3px; left: -4px; border-top: 7px solid var(--red); border-right: 5px solid transparent; border-left: 5px solid transparent; }
.correction-timeline-scroll { width: 100%; height: 18px; margin: 6px 0; overflow-x: scroll; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: var(--text-muted) var(--border-light); }
.correction-timeline-scroll-track { height: 1px; }
.correction-timeline-selection { color: var(--text-primary); font-size: 0.72rem; font-variant-numeric: tabular-nums; }
@media (hover: none) {
  .correction-cue-gap button { opacity: 1; }
  .correction-timeline-gap { color: var(--text-muted); border-color: var(--border); }
}
@media (max-width: 760px) {
  .correction-timeline { padding: 10px; }
  .correction-timeline-selection { overflow-wrap: anywhere; }
}

/* Filmora-style editing arrangement using the current red production palette. */
.correction-editing-grid { --editor-height: clamp(320px, 40vh, 440px); display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(340px, 1fr); min-width: 0; margin-top: 16px; border-block: 1px solid var(--border-light); }
.correction-editing-grid .correction-video-frame { height: var(--editor-height); min-width: 0; margin: 0; border-radius: 0; display: flex; align-items: center; }
.correction-editing-grid .correction-video { height: 100%; max-height: none; object-fit: contain; }
.correction-captions { min-width: 0; height: var(--editor-height); display: flex; flex-direction: column; border-left: 1px solid var(--border-light); }
.correction-captions-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border-light); }
.correction-captions-head h3 { font-size: 13px; font-weight: 600; }
.correction-captions-head span { font-size: 11px; color: var(--text-muted); }
.correction-captions .correction-cue-list { flex: 1; min-height: 0; max-height: none; border: 0; overscroll-behavior: contain; scrollbar-gutter: stable; }
.correction-captions .correction-cue { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 12px; border-radius: 0; }
.correction-captions .correction-cue.is-selected { outline: 0; background: var(--accent-subtle); box-shadow: inset 3px 0 var(--accent); }
.correction-captions .correction-cue-meta { flex-wrap: nowrap; align-items: flex-start; gap: 8px; }
.correction-captions .correction-cue-body { min-width: 0; }
.correction-captions .correction-review-badge { align-self: flex-start; }
.correction-captions .correction-remove-cue { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 28px; width: 28px; height: 28px; padding: 4px; margin-left: auto; border-radius: 5px; }
.correction-captions .correction-remove-cue:hover { background: var(--accent-subtle); }
.correction-captions .correction-cue textarea { min-height: 64px; background: #fff; border-color: var(--border-light); padding: 8px; font-size: 13px; }
.correction-captions .correction-speaker-chip { padding: 4px 7px; font-weight: 500; font-size: 10px; box-shadow: none; }
.correction-captions .correction-speaker-picker { flex: 1; min-width: 0; gap: 6px; font-weight: 500; }
.correction-timeline-zoom input[type="range"] { width: 144px; min-width: 0; height: 24px; margin: 0; padding: 0; border: 0; background: transparent; accent-color: var(--accent); cursor: ew-resize; }
.correction-timeline-zoom input[type="range"]:disabled { cursor: default; opacity: .45; }
.correction-captions .correction-cue-gap { min-height: 24px; margin: 0; border: 0; border-radius: 0; }
.correction-captions .correction-cue-gap button { padding: 2px 8px; font-size: 10px; border: 0; background: transparent; }
.correction-result-card .correction-timeline { padding: 16px 0 0; margin: 0; border: 0; border-radius: 0; background: transparent; }
.correction-result-card .correction-timeline-lane { height: 72px; border-radius: 4px; background: var(--bg-page); }
.correction-timeline-ruler { margin-top: 12px; }
.correction-timeline-cue { top: 16px; }
.correction-timeline-gap { inset-block: 16px; }
.correction-timeline-toolbar strong { font-size: 13px; font-weight: 600; }
.correction-timeline-selection { min-height: 20px; color: var(--text-muted); }
.correction-editing-grid:has(.correction-video-frame.hidden) { grid-template-columns: minmax(0, 1fr); }
.correction-editing-grid:has(.correction-video-frame.hidden) .correction-captions { border-left: 0; }
@media (max-width: 900px) {
 .correction-editing-grid { grid-template-columns: minmax(0, 1fr); }
 .correction-captions { border-left: 0; border-top: 1px solid var(--border-light); }
 .correction-actions { flex-wrap: wrap; justify-content: flex-end; }
}
