/* SUBLAB 화면 스타일. 색은 여기 :root 한곳에서만 정한다 (결정: 강조색 등은 값만 바꿔 교체) */
:root {
  --bg: #0F1012;
  --surface: #16181B;
  --surface-2: #1C1E21;
  --surface-3: #1F2225;
  --line: #22252A;
  --line-2: #2A2D31;
  --line-3: #3A3E43;
  --text: #EDEEF0;
  --text-2: #C9CDD1;
  --muted: #9BA0A6;
  --faint: #8A9096;
  --dim: #6F757B;
  --accent: #3DDBC4;
  --accent-hover: #6BE6D3;
  --accent-ink: #06231F;
  --accent-soft: #173A35;
  --accent-soft-text: #7FEBDB;
  --accent-deep: #12302C;
  --accent-deep-line: #1E4A44;
  --warm: #F2B544;
  --warm-soft: #3A2E12;
  --frame: #0B0C0E;
  --danger: #F28B82;
  --font: 'IBM Plex Sans KR', -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --font-zh: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body { min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
button { font-family: inherit; }
.zh { font-family: var(--font-zh); }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
[hidden] { display: none !important; }

/* ---- 머리 ---- */
.top { display: flex; align-items: center; gap: 32px; padding: 0 40px; min-height: 68px; border-bottom: 1px solid #24272B; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.08em; font-size: 17px; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.mark { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); }
.steps { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--faint); white-space: nowrap; flex: none; }
.step b { display: inline-flex; width: 20px; height: 20px; border-radius: 999px; align-items: center; justify-content: center; font-size: 11px; border: 1px solid var(--line-3); font-weight: 600; }
.step.on { color: var(--text); background: var(--surface-2); }
.step.on b { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step.done b { border-color: var(--accent); color: var(--accent); }
.acct { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--muted); }
.pill { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--text); }
.devbadge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--warm-soft); color: var(--warm); }

.banner { display: flex; align-items: center; gap: 16px; padding: 12px 40px; background: var(--accent-deep); color: var(--text); flex-wrap: wrap; border-bottom: 1px solid var(--accent-deep-line); font-size: 14px; }
.banner .bar { flex: 1 1 120px; max-width: 220px; height: 4px; border-radius: 4px; background: var(--accent-deep-line); overflow: hidden; }
.banner .bar span { display: block; height: 100%; background: var(--accent); }

main.view { flex: 1; width: 100%; margin: 0 auto; box-sizing: border-box; }
/* 화면마다 최대 폭 안에서 가운데 정렬 */
.home, .prep, .confirm, .work, .prev, .finish { margin-left: auto; margin-right: auto; width: 100%; }

/* ---- 공통 부품 ---- */
.card { border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 52px; padding: 0 28px; border-radius: 12px; font-size: 16px; font-weight: 600; text-decoration: none; border: 0; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn.primary:disabled { opacity: .45; cursor: default; }
.btn.ghost { height: 48px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); font-weight: 500; font-size: 15px; }
.btn.ghost:hover { border-color: var(--accent); }
.btn.small { height: 40px; padding: 0 16px; font-size: 14px; }
.chip { font-size: 13px; padding: 6px 12px; border-radius: 999px; }
.chip.accent { font-weight: 600; background: var(--accent-soft); color: var(--accent-soft-text); }
.chip.line { border: 1px solid var(--line-2); color: var(--faint); font-size: 11px; font-weight: 600; padding: 3px 8px; }
.bar { height: 8px; border-radius: 8px; background: #24272B; overflow: hidden; }
.bar > div { height: 100%; border-radius: 8px; background: var(--accent); transition: width .8s ease; }
.label { font-size: 13px; font-weight: 600; color: var(--faint); letter-spacing: 0.04em; }
.error { color: var(--danger); }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes row { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.rise { animation: rise .35s ease-out; }
.spin { animation: spin 1s linear infinite; transform-origin: 50% 50%; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
.pop { animation: pop .5s cubic-bezier(.2, 1.4, .4, 1); }
@media (prefers-reduced-motion: reduce) { .rise, .spin, .pulse, .pop, .row { animation: none; } }

/* ---- 1 시작 ---- */
.home { max-width: 1240px; padding: 56px 40px 64px; display: flex; flex-wrap: wrap; gap: 40px; align-items: stretch; }
.home-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.home h1 { margin: 0; font-size: 44px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
.home .lead { margin: 0; font-size: 17px; line-height: 1.6; color: var(--muted); }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 56px 32px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text); text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.drop:hover, .drop.over { border-color: var(--accent); background: #181C1D; }
.drop .t1 { font-size: 22px; font-weight: 600; }
.drop .t2 { font-size: 15px; color: var(--muted); }
.points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.point { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 16px; background: var(--surface); }
.point b { font-size: 15px; }
.point span { font-size: 13px; line-height: 1.5; color: var(--muted); }
.home-side { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.demo { border-radius: 20px; overflow: hidden; background: var(--surface); border: 1px solid #24272B; }
.demo-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.demo ol { list-style: none; margin: 0; padding: 14px 20px 18px; display: flex; flex-direction: column; gap: 12px; height: 240px; justify-content: flex-end; overflow: hidden; }
.demo li { display: flex; flex-direction: column; gap: 3px; }
.demo .ko { font-size: 16px; font-weight: 600; min-height: 22px; }
.job { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--surface); }
.unsupported { padding: 14px 18px; border-radius: 14px; background: var(--warm-soft); color: var(--warm); font-size: 14px; line-height: 1.6; }

/* ---- 2 준비 → 자막 위치 확인 ---- */
.prep { max-width: 760px; padding: 72px 40px; display: flex; flex-direction: column; gap: 36px; }
.prep h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.checklist li { display: flex; align-items: flex-start; gap: 18px; padding: 18px 20px; border-radius: 16px; }
.checklist li.active { background: var(--surface); }
.checklist .ic { flex: none; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.checklist .tt { font-size: 18px; font-weight: 600; color: #6B7177; }
.checklist li.active .tt, .checklist li.done .tt { color: var(--text); }
.checklist .dd { font-size: 15px; color: var(--muted); }

.confirm { max-width: 1360px; padding: 28px 40px 40px; display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.confirm-stage { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.frame { position: relative; border-radius: 16px; overflow: hidden; background: var(--frame); }
.frame canvas { display: block; width: 100%; height: auto; touch-action: none; }
.thumbs { display: flex; align-items: center; gap: 10px; }
.thumbs .lbl { flex: none; font-size: 13px; color: var(--faint); width: 64px; }
.thumb { position: relative; flex: 1 1 0; min-width: 0; max-width: 150px; aspect-ratio: 16 / 9; border-radius: 10px; background: #23262A; border: 2px solid transparent; cursor: pointer; padding: 0; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb:hover { border-color: var(--line-3); }
.thumb.on { border-color: var(--accent); }
.thumb .tm { position: absolute; top: 4px; left: 6px; font-size: 10px; color: var(--text-2); text-shadow: 0 0 3px #000; }
.confirm-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.confirm-side h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-radius: 16px; background: var(--surface); }
.facts li { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid #23262A; }
.facts li:last-child { border-bottom: 0; }
.facts b { font-size: 15px; display: block; }
.facts span { font-size: 13px; color: var(--muted); }
.go { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 10px; height: 56px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-size: 17px; font-weight: 700; border: 0; cursor: pointer; width: 100%; }
.go:hover { background: var(--accent-hover); }
.go:disabled { opacity: .45; cursor: default; }
.go .n { display: inline-flex; min-width: 30px; height: 26px; align-items: center; justify-content: center; border-radius: 7px; background: rgba(6, 35, 31, 0.16); font-size: 15px; font-family: var(--font-mono); }
.go .left { position: absolute; left: 0; bottom: 0; height: 4px; background: rgba(6, 35, 31, 0.35); transition: width 1s linear; }

/* 확인 화면의 추출 예상 시간 (가장 눈에 띄게) */
.etabox { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 18px 20px; border-radius: 16px; background: var(--accent-deep); border: 1px solid var(--accent-deep-line); flex-wrap: wrap; }
.etabox .l { font-size: 13px; font-weight: 600; color: var(--accent); }
.etabox .v { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.etabox .s { font-size: 13px; line-height: 1.6; color: var(--text-2); text-align: right; }

/* ---- 3 추출 중 ---- */
.pct { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.work { max-width: 1360px; padding: 32px 40px 48px; display: flex; flex-direction: column; gap: 24px; }
.status { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding: 22px 26px; }
/* 시안 크기(16:9) 그대로, 그 안에서 자막을 읽는 영역만 실제 화면 위치에 표시 */
.nowshot { flex: none; width: 176px; aspect-ratio: 16 / 9; border-radius: 10px; background: #2B2F34; position: relative; overflow: hidden; }
.nowshot canvas { position: absolute; display: block; outline: 1px solid var(--accent); }
.nowshot .live { position: absolute; top: 4px; left: 8px; font-size: 10px; color: var(--accent); text-shadow: 0 0 3px #000; }
.eta-l { font-size: 13px; font-weight: 600; color: var(--accent); }
.eta { font-size: 44px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.work-cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: stretch; }
.lines { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.lines-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.lines ol { list-style: none; margin: 0; padding: 6px 0; display: flex; flex-direction: column; height: 380px; overflow-y: auto; }
.lines li { display: flex; align-items: baseline; gap: 18px; padding: 9px 22px; animation: row .4s ease-out; }
.lines li .tm { flex: none; font-size: 13px; color: var(--dim); }
.lines li .tx { font-size: 17px; color: var(--text-2); }
.lines li:last-child .tx { color: #FFFFFF; }
.work-side { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.taste { display: flex; flex-direction: column; gap: 14px; padding: 22px; }
.tag-warm { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--warm-soft); color: var(--warm); }
.reserve { display: flex; align-items: center; gap: 16px; padding: 18px 22px; }
.sw { position: relative; width: 46px; height: 28px; border-radius: 999px; border: 0; cursor: pointer; flex: none; padding: 0; background: var(--line-3); transition: background .2s; }
.sw span { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 999px; background: #FFFFFF; transition: left .2s; }
.sw[aria-pressed="true"] { background: var(--accent); }
.sw[aria-pressed="true"] span { left: 21px; }

/* ---- 4 미리보기 ---- */
.prev { max-width: 1360px; padding: 32px 40px 48px; display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.prev-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--surface-2); gap: 4px; }
.seg button { height: 36px; padding: 0 16px; border-radius: 9px; border: 0; font-size: 14px; font-weight: 600; cursor: pointer; background: transparent; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.seg button:disabled { opacity: .4; cursor: default; }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #000; }
.player video, .player canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.player .sub { position: absolute; left: 4%; right: 4%; display: flex; justify-content: center; pointer-events: none; }
.player .sub span { padding: 4px 12px; border-radius: 8px; background: rgba(10, 30, 28, 0.82); border: 1px solid var(--accent); font-size: clamp(14px, 1.9vw, 24px); font-weight: 500; color: #FFFFFF; white-space: pre-line; text-align: center; }
.ctrl { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.playbtn { width: 36px; height: 36px; border-radius: 999px; border: 0; background: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.trim { padding: 18px 22px 20px; display: flex; flex-direction: column; gap: 14px; }
.track { position: relative; height: 56px; margin: 0 8px; cursor: pointer; touch-action: none; }
.track .bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.track .bars span { flex: 1; border-radius: 2px; background: #3A4A48; }
.track .shade { position: absolute; top: 0; bottom: 0; background: rgba(15, 16, 18, 0.7); pointer-events: none; }
.track .range { position: absolute; top: -2px; bottom: -2px; border: 2px solid var(--warm); border-radius: 6px; pointer-events: none; }
.track .handle { position: absolute; top: -6px; bottom: -6px; width: 14px; border-radius: 5px; background: var(--warm); display: flex; align-items: center; justify-content: center; cursor: ew-resize; border: 0; padding: 0; }
.track .handle i { width: 2px; height: 16px; background: var(--warm-soft); border-radius: 1px; }
.track .head { position: absolute; top: -8px; bottom: -8px; width: 2px; background: var(--text); pointer-events: none; }
.prev-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; padding: 26px; }
.prev-side h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.prev-side dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; font-size: 14px; }
.prev-side dt { color: var(--muted); }
.prev-side dd { margin: 0; text-align: right; }
.get { display: flex; flex-direction: column; gap: 10px; }
.get div { display: flex; align-items: center; gap: 10px; font-size: 15px; }

/* ---- 5 완료 ---- */
.finish { max-width: 820px; padding: 64px 40px; display: flex; flex-direction: column; gap: 32px; }
.finish h1 { margin: 0; font-size: 36px; font-weight: 700; letter-spacing: -0.02em; }
.file { display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); transition: border-color .2s; }
.file:hover { border-color: var(--accent); color: var(--text); }
.file.off { opacity: .55; pointer-events: none; }
.file .dl { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 12px; flex: none; background: #24272B; }
.file.main .dl { background: var(--accent); }

/* ---- 좁은 화면 ---- */
@media (max-width: 720px) {
  .top { padding: 10px 16px; gap: 12px; }
  .steps { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .step { padding: 6px 8px; }
  .home h1 br { display: none; }
  .banner { padding: 12px 16px; }
  .home, .prep, .confirm, .work, .prev, .finish { padding-left: 16px; padding-right: 16px; }
  .home { padding-top: 32px; }
  .home h1 { font-size: 30px; }
  .points { grid-template-columns: minmax(0, 1fr); }
  .eta { font-size: 34px; }
  .thumbs .lbl { display: none; }
}

/* 미리보기 막대: 번역 맛보기 구간·엔딩 크레딧 띠, 구간 안/밖 안내 */
.track .band { position: absolute; top: 0; bottom: 0; border-radius: 4px; pointer-events: none; box-sizing: border-box; }
.track .band.taste { background: rgba(61, 219, 196, 0.16); border: 2px solid var(--accent); }
.track .band.credit { background: rgba(138, 144, 150, 0.22); border: 2px dashed var(--faint); }
.legend { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .sw.taste { background: var(--accent-soft); border: 1px solid var(--accent); }
.legend .sw.credit { background: rgba(138, 144, 150, 0.35); border: 1px dashed var(--faint); }
.tstat { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.tstat.in { background: var(--accent-deep); border: 1px solid var(--accent-deep-line); color: var(--accent-soft-text); }
.tstat.out { background: var(--warm-soft); color: var(--warm); }
.tstat .btn { padding: 6px 12px; font-size: 13px; }

/* 번역 맛보기 유도: 아직 안 쓴 영상이면 버튼 테두리가 은은하게 깜빡이고 안내 문구가 청록색 */
#pnote.cta { color: var(--accent); cursor: pointer; }
#mKo { margin-left: 6px; } /* 깜빡이는 테두리가 옆 버튼에 겹치지 않게 */
#mKo.nudge { box-shadow: 0 0 0 2px var(--accent); animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { box-shadow: 0 0 0 2px var(--accent); } 50% { box-shadow: 0 0 0 5px rgba(61, 219, 196, 0.25); } }
@media (prefers-reduced-motion: reduce) { #mKo.nudge { animation: none; } }

/* 맨 아래 사업자 정보·약관 링크 */
.foot { box-sizing: border-box; width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px 20px 32px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; line-height: 1.7; color: var(--faint); }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); text-decoration: underline; }
