/* Persistent input form and subtitle output, designed as a single caption desk. */
.home-page { --home-header-height:64px; }
.home-page .header { height:var(--home-header-height); max-width:none; padding-inline:28px; background:#fff; border-bottom:1px solid var(--line); gap:28px; }
.home-page .brand { font-size:20px; }
.home-page .main-nav { margin-left:auto; gap:26px; }
.home-page .main-nav>a,.home-page .nav-guides summary { font-size:12px; }
.home-page .header-cta { min-height:34px; padding:6px 12px; font-size:11px; }
.home-page #main { max-width:none; padding:0; }
.home-page #main>:not(.home-first-screen) { width:calc(100% - 88px); max-width:1160px; margin-inline:auto; }
.home-page .hero { padding-block:76px 54px; }
.home-first-screen { height:calc(100svh - var(--home-header-height)); min-height:620px; }
.home-first-screen .studio { height:100%; display:flex; flex-direction:column; border:0; border-bottom:1px solid var(--line); border-radius:0; box-shadow:none; background:#f5f5f5; }
.studio-heading { display:flex; align-items:center; min-height:48px; padding:10px 28px; gap:24px; border-bottom:1px solid var(--line); background:#fff; flex-shrink:0; }
.studio-heading h1 { font-size:16px; letter-spacing:-.4px; }
.studio-subtitle { color:var(--muted); font-size:12px; }
.studio-top-note { margin-left:auto; display:flex; align-items:center; gap:6px; font-size:11px; color:var(--muted); }
.studio-top-note .icon { width:14px; }
.studio-body { display:grid; grid-template-columns:380px minmax(0,1fr); flex:1; min-height:0; }
.studio-setup { background:#fff; border-right:1px solid var(--line); padding:22px 24px; min-width:0; overflow-y:auto; scrollbar-width:thin; }
.setup-card,.setup-input { min-width:0; }
.panel-label { font:600 10px var(--mono); letter-spacing:1.5px; color:var(--blue); }
.setup-title { margin-bottom:18px; }
.setup-title h2 { margin:5px 0 6px; font-size:24px; line-height:1.3; letter-spacing:-.7px; }
.setup-title p { margin:0; font-size:12px; line-height:1.7; color:var(--muted); max-width:280px; }
.studio .input-tabs { gap:15px; align-items:center; margin-bottom:12px; }
.studio .input-tabs button { font-size:12px; padding:0 0 8px; }
.studio .input-tabs .sample-link { margin-left:auto; color:var(--blue); font-size:11px; }
.sample-link .icon { width:12px; }
.studio .dropzone { min-height:166px; padding:17px 12px; border:1px dashed #b5b5b5; border-radius:10px; background:#f8f8f8; }
.studio .dropzone:hover,.studio .dropzone.dragover { border-color:var(--blue); background:#f5f5f5; }
.upload-symbol { display:grid; place-items:center; width:34px; height:34px; color:var(--blue); border-radius:9px; background:#ededed; margin-bottom:9px; }
.studio .dropzone strong { font-size:13px; font-weight:600; }
.studio .dropzone>span { font-size:12px; }
.studio .dropzone small { font-size:10px; line-height:1.7; margin-top:9px; }
.studio #paste-input { min-height:166px; font:12px/1.7 var(--mono); }
.studio #load-paste { margin-top:8px; }
.studio.has-input .dropzone { min-height:104px; padding:14px 12px; }
.studio.has-input .dropzone .upload-symbol,.studio.has-input .dropzone small { display:none; }
.studio.has-input .sample-translation { display:none; }
.studio .language-controls { display:grid; grid-template-columns:minmax(0,1fr) 12px minmax(0,1fr); margin:18px 0 12px; gap:10px; }
.studio .language-controls label { min-width:0; font-size:12px; gap:6px; }
.studio .language-controls select { width:100%; font-size:13px; min-height:42px; padding:8px 9px; }
.studio .language-controls>span { padding-top:23px; }
.studio-advanced { font-size:12px; color:var(--muted); margin:8px 0 17px; }
.studio-advanced summary { cursor:pointer; width:fit-content; }
.studio-advanced[open] { border:1px solid var(--line); padding:10px; border-radius:8px; }
.studio-advanced .video-method { margin-top:12px; }
.studio-advanced p,.studio-advanced .provider-notice { font-size:11px; line-height:1.7; margin:10px 0 0; }
.studio #start-primary { width:100%; min-height:46px; justify-content:flex-start; gap:10px; font-size:14px; }
#start-primary>.icon:last-child { margin-left:auto; }
.setup-help { font-size:11px; line-height:1.6; color:var(--muted); margin:9px 0 0; min-height:18px; }
.studio .sample-translation { font-size:11px; padding:0; margin-top:12px; text-align:left; }
.studio .sample-translation span { font-size:10px; }
.studio .reset-input { display:block; margin-top:12px; font-size:11px; color:var(--muted); padding:0; }
.studio .file-meta { margin-top:12px; background:#f0f0f0; padding:10px; }
.studio .file-meta strong { font-size:12px; }
.studio .file-meta span { font-size:10px; }
.selected-video { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:12px; padding:10px; border-radius:8px; background:#f0f0f0; font-size:12px; }
.selected-video>span { display:flex; align-items:center; gap:8px; min-width:0; flex:1; }
.selected-video #remove-video { display:inline-flex; align-items:center; justify-content:center; align-self:center; flex:none; margin:0; min-height:32px; padding:6px 0; line-height:1.3; }
.selected-video strong { font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.selected-video .icon { width:16px; }
.studio-output { min-width:0; min-height:0; display:flex; flex-direction:column; }
.studio-toolbar { display:flex; align-items:center; gap:22px; min-height:86px; padding:17px 26px; border-bottom:1px solid var(--line); flex-shrink:0; }
.studio-output-title { flex-shrink:0; }
.studio-output-title h2 { font-size:19px; letter-spacing:-.5px; line-height:1.3; margin-top:4px; }
.studio-document { display:flex; align-items:center; gap:9px; min-width:0; margin-left:auto; }
.document-icon { display:none; }
.studio-document>div { min-width:0; max-width:220px; }
.studio-document strong { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:12px; font-weight:500; }
.studio-document span:not(.document-icon) { font-size:11px; color:var(--muted); }
.studio-toolbar .button { min-height:38px; font-size:12px; padding:8px 14px; }
#review-languages,.mobile-review-tabs { display:none; }
.studio-review { display:flex; flex-direction:column; flex:1; min-height:0; min-width:0; padding:20px 26px 12px; gap:16px; }
.caption-panel { display:flex; flex-direction:column; flex:1; min-width:0; min-height:0; }
.review-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:12px; }
.review-heading h2 { font-size:13px; font-weight:500; }
.review-heading h2 span { color:var(--muted); font:10px var(--mono); margin-left:10px; }
.review-heading>label { display:flex; align-items:center; gap:6px; font-size:11px; color:var(--muted); white-space:nowrap; }
.review-heading input,.bilingual-choice input { width:14px; height:14px; min-height:0; accent-color:var(--blue); }
.studio #loaded-output { display:flex; flex:1; flex-direction:column; min-height:0; }
.studio .preview-toolbar { min-height:26px; flex-shrink:0; }
.studio .preview-toolbar>span { font-size:10px; letter-spacing:.8px; }
.studio .cue-list { flex:1; min-height:0; max-height:none; overflow-y:auto; position:relative; padding-right:6px; scrollbar-width:thin; }
.studio .cue-row { background:white; padding:13px 16px; margin-bottom:10px; border:1px solid #e3e3e3; border-left:3px solid transparent; border-radius:9px; transition:border-color .15s; }
.studio .cue-row:focus-within { border-color:#adadad; }
.studio .cue-row.active-cue { border-left-color:var(--blue); background:#fafafa; }
.studio .cue-heading { margin-bottom:9px; }
.studio .cue-heading>div { display:flex; align-items:center; gap:8px; }
.studio .cue-number { margin:0; font-size:10px; }
.cue-seek { background:transparent; color:var(--blue); font:11px var(--mono); padding:3px 0; border-radius:2px; }
.cue-seek:disabled { color:var(--muted); opacity:1; }
.studio .toolbar-button { font-size:11px; padding:4px 7px; }
.studio .cue-texts { gap:18px; grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
.studio .cue-label { display:block; font-size:10px; letter-spacing:.6px; margin:0; color:var(--muted); }
.studio .cue-textarea { width:100%; display:block; min-height:60px; height:64px; padding:8px 10px; font-size:14px; line-height:1.5; margin-top:5px; background:#f8f8f8; resize:vertical; }
.studio .cue-source { background:#fff; color:#525252; border-color:#e3e3e3; }
.studio .pagination { flex-shrink:0; font-size:11px; margin-top:8px; }
.review-preview { width:100%; flex-shrink:0; }
.studio:not(.has-video) .review-preview { display:none; }
.studio .video-preview { display:flex; align-items:center; gap:18px; width:100%; border:0; border-radius:0; background:transparent; padding:0; margin:0; }
.studio .video-stage { width:330px; max-width:58%; flex-shrink:0; }
.studio .video-preview video { display:block; width:100%; aspect-ratio:16/9; height:auto; max-height:190px; border-radius:9px; background:#181818; object-fit:contain; }
.studio .video-preview p { font-size:12px; color:var(--muted); margin:0; line-height:1.7; max-width:250px; }
.studio .video-shortcuts { display:none; }
.processing-empty { flex:1; min-height:0; display:flex; flex-direction:column; justify-content:center; align-items:center; text-align:center; padding:24px; }
.processing-mark { width:58px; height:58px; border-radius:16px; background:#ededed; display:grid; place-items:center; color:var(--blue); margin-bottom:22px; }
.processing-empty h3 { font-size:22px; letter-spacing:-.7px; margin-bottom:10px; }
.processing-empty p { font-size:13px; color:var(--muted); max-width:330px; }
.processing-steps { display:none; gap:8px; padding:0; list-style:none; font-size:12px; color:var(--muted); }
.studio[data-stage=processing] .processing-steps { display:grid; }
.processing-steps .active { color:var(--blue); font-weight:600; }
.processing-steps li::before { content:'·'; margin-right:8px; }
.studio.has-video .processing-empty { padding:10px; }
.studio.has-video .processing-mark { display:none; }
.studio.has-video .processing-empty h3 { font-size:18px; }
.studio-feedback { flex-shrink:0; min-height:44px; display:flex; align-items:center; gap:15px; padding:10px 26px; border-top:1px solid var(--line); background:#f8f8f8; position:relative; }
.studio .status { margin:0; flex:1; background:transparent; padding:0; font-size:11px; max-height:54px; overflow:auto; }
.studio .status.error { color:#a23b3b; }
.studio .status.success { color:#326248; }
.studio-feedback progress { position:absolute; top:-3px; left:0; width:100%; height:3px; border-radius:0; }
.studio-feedback .button { padding:5px 12px; min-height:30px; font-size:11px; }
.workspace-bottom { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:30px; padding:7px 28px; flex-shrink:0; border-top:1px solid var(--line); color:var(--muted); background:#fafafa; font-size:10px; }
.workspace-bottom span,.workspace-bottom a { display:flex; align-items:center; gap:5px; }
.workspace-bottom a { text-decoration:none; color:var(--blue); }
.workspace-bottom .icon { width:12px; height:12px; }
.video-stage { position:relative; width:100%; background:#181818; border-radius:10px; overflow:hidden; }
.video-caption { position:absolute; left:7%; right:7%; bottom:19%; text-align:center; white-space:pre-line; pointer-events:none; color:white; font:500 clamp(14px,1.6vw,24px)/1.45 var(--body); text-shadow:0 1px 3px black,1px 0 2px black,-1px 0 2px black; }
#preview-fullscreen { position:absolute; top:10px; right:10px; padding:3px 9px; font-size:22px; line-height:1.3; color:white; background:#18181870; opacity:.65; }
#preview-fullscreen:hover,#preview-fullscreen:focus-visible { opacity:1; }
.video-stage video::-webkit-media-controls-fullscreen-button { display:none; }
.video-stage:fullscreen { border-radius:0; display:flex; align-items:center; }
.studio .video-stage:fullscreen video { max-height:100vh; height:100vh; }
.video-stage:fullscreen .video-caption { bottom:12%; font-size:clamp(18px,3vw,44px); }
#export-dialog { width:480px; max-width:calc(100% - 32px); max-height:85svh; overflow:auto; border:1px solid #e3e3e3; padding:28px; border-radius:16px; color:var(--ink); box-shadow:0 24px 90px #18181830; }
#export-dialog::backdrop { background:#18181870; backdrop-filter:blur(3px); }
.dialog-heading { display:flex; align-items:center; gap:16px; justify-content:space-between; }
.dialog-heading .eyebrow { font-size:8px; color:var(--blue); }
.dialog-heading h2 { font-size:23px; margin-top:8px; }
.dialog-intro { font-size:12px; color:var(--muted); margin:16px 0 22px; }
.export-type { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.export-type button { border:1px solid var(--line); background:white; padding:14px 12px; text-align:left; font-size:13px; }
.export-type button small { display:block; color:var(--muted); font-size:10px; margin-top:5px; }
.export-type [aria-pressed=true] { border-color:var(--blue); background:#f5f5f5; color:var(--blue); }
.bilingual-choice { display:flex; align-items:center; gap:8px; font-size:12px; padding:20px 0 4px; }
#export-dialog .export-bar { display:flex; flex-wrap:wrap; gap:10px; border:0; margin-top:16px; padding:0; }
#export-dialog .export-bar>label { width:100%; display:grid; gap:6px; font-size:11px; }
#export-dialog .export-bar select { width:100%; max-width:none; font-size:13px; }
#export-dialog .export-bar>.button { flex:1; margin:4px 0 0; font-size:13px; }
#export-dialog .copy-button { margin-top:4px; border:1px solid var(--line); width:42px; height:42px; }
#export-dialog .export-options { font-size:11px; margin-top:14px; flex-wrap:wrap; }
#export-dialog .export-options>span { width:100%; margin:0; }
#export-dialog .video-export { margin-top:16px; padding-top:0; border:0; }
#export-dialog .video-export .button { font-size:13px; }
#export-dialog .export-review-note { margin:16px 0 0; padding-top:16px; border-top:1px solid var(--line); color:var(--muted); font-size:11px; }
#export-dialog-note { font-size:12px; margin:12px 0 0; }
.studio #format-warning { margin:0; font-size:11px; max-height:55px; overflow:auto; }

@media(min-width:1500px) { .studio-body { grid-template-columns:420px minmax(0,1fr); } .studio-setup { padding:28px 32px; } }
@media(max-width:1050px) {
 .studio-body { grid-template-columns:340px minmax(0,1fr); }
 .studio-setup { padding:20px; }
 .studio-top-note { display:none; }
 .studio-toolbar { padding-inline:20px; gap:14px; }
 .studio-document>div { max-width:130px; }
 .studio-review { padding-inline:20px; }
 .studio .input-tabs { gap:10px; }
 .studio .input-tabs button { font-size:11px; }
 .studio .video-preview { gap:12px; }
 .studio .video-preview p { font-size:11px; }
}
@media(max-height:760px) and (min-width:761px) {
 .home-first-screen { min-height:590px; }
 .studio-setup { padding-block:17px; }
 .setup-title { margin-bottom:13px; }
 .setup-title p { display:none; }
 .studio .dropzone { min-height:155px; }
 .studio .sample-translation { margin-top:9px; }
 .studio .video-stage { width:260px; }
 .studio .video-preview video { max-height:145px; }
}
@media(max-width:760px) {
 .home-page { --home-header-height:100px; }
 .home-page .header { flex-wrap:wrap; padding:13px 18px; gap:10px; }
 .home-page .brand { font-size:19px; }
 .home-page .header-cta { display:none; }
 .home-page .main-nav { width:100%; margin:0; gap:15px; justify-content:space-between; }
 .home-page .nav-guides { margin-left:0; }
 .home-first-screen { height:auto; min-height:calc(100svh - var(--home-header-height)); }
 .home-first-screen .studio { min-height:inherit; }
 .studio-heading { padding:12px 20px; }
 .studio-heading h1 { font-size:15px; }
 .studio-subtitle { display:none; }
 .studio-body { display:flex; flex-direction:column; }
 .studio-setup { padding:22px 20px; overflow:visible; border-right:0; border-bottom:1px solid var(--line); }
 .setup-title p { max-width:none; }
 .studio .dropzone { min-height:160px; }
 .studio .input-tabs { gap:18px; }
 .studio .input-tabs button { font-size:12px; }
 .studio-output { min-height:420px; }
 .studio-toolbar { padding:16px 20px; flex-wrap:wrap; gap:10px; }
 .studio-output-title { flex:1; }
 .studio-output-title h2 { font-size:18px; }
 .studio-document { order:3; width:100%; margin:0; }
 .studio-document>div { max-width:100%; }
 .studio-review { min-height:320px; padding:18px 20px; }
 .studio .cue-list { flex:auto; max-height:520px; }
 .studio .cue-texts { grid-template-columns:1fr; gap:10px; }
 .review-heading { flex-wrap:wrap; gap:6px; }
 .studio .video-preview { display:block; }
 .studio .video-stage { width:100%; max-width:100%; }
 .studio .video-preview video { max-height:220px; }
 .studio .video-preview p { margin-top:8px; max-width:none; }
 .processing-empty { min-height:260px; padding:22px 0; }
 .processing-empty h3 { font-size:20px; }
 .studio-feedback { padding:10px 20px; }
 .workspace-bottom { padding:10px 20px; font-size:9px; }
 .workspace-bottom>span:first-child { display:none; }
 .home-page #main>:not(.home-first-screen) { width:calc(100% - 40px); }
 .home-page .hero { padding-top:45px; }
 #export-dialog { padding:22px; }
}
@media(prefers-reduced-motion:reduce) { .studio * { transition:none!important; } }

/* File errors belong next to the input, at a readable size. */
.input-error { margin:14px 0; padding:14px 16px; border:1px solid #e6a7a1; border-left:4px solid #be3535; border-radius:8px; background:#fff0ee; color:#982727; }
.input-error strong { display:block; font-size:14px; line-height:1.5; }
.input-error p { margin:5px 0 0; font-size:13px; line-height:1.65; overflow-wrap:anywhere; }
.studio.has-error .dropzone { border-color:#be3535; background:#fff8f7; }
.studio .status.error { font-size:13px; font-weight:500; }

/* The frame owns the caption coordinates; the monitor only fits that frame. */
.studio .video-preview { display:block; }
.preview-workspace { display:grid; grid-template-columns:minmax(0,1fr) 218px; gap:16px; align-items:start; }
.preview-monitor { min-width:0; border:1px solid var(--line); border-radius:9px; overflow:hidden; background:white; }
.preview-monitor-heading { display:flex; justify-content:space-between; padding:6px 10px; font:10px/1.5 var(--mono); color:var(--muted); }
.studio .video-stage { width:100%; max-width:none; height:clamp(250px,38vh,360px); border-radius:0; display:flex; flex-direction:column; background:#e8e8e8; }
.video-screen { display:flex; flex:1; min-height:0; min-width:0; justify-content:center; align-items:center; overflow:hidden; }
.video-frame { position:relative; flex:none; overflow:hidden; background:#181818; isolation:isolate; cursor:pointer; touch-action:manipulation; }
.studio .video-frame video { position:absolute; inset:0; width:100%; height:100%; max-height:none; aspect-ratio:auto; border-radius:0; object-fit:contain; }
.studio .video-frame .video-caption { position:absolute; margin:0; padding:0; text-align:center; white-space:pre-line; overflow-wrap:anywhere; pointer-events:none; color:white; font-family:Arial,"Microsoft YaHei",sans-serif; font-weight:700; line-height:1.25; text-shadow:0 1px 2px #101010,1px 0 1px #101010,-1px 0 1px #101010; }
.caption-safe-area { display:none; position:absolute; inset:var(--safe-inset,12%) 8%; border:1px dashed #d4d4d4; pointer-events:none; }
.show-guides .caption-safe-area { display:block; }
.caption-safe-area span { position:absolute; top:3px; left:4px; font:8px/1.3 var(--mono); color:#d4d4d4; text-shadow:0 1px 2px #181818; }
.preview-playback { display:flex; align-items:center; gap:7px; height:34px; flex:none; padding:0 6px; background:white; color:var(--ink); border-top:1px solid var(--line); }
.preview-playback button { flex:none; width:27px; min-height:28px; padding:0; background:transparent; font-size:13px; }
.preview-playback button:hover { background:var(--soft-blue); }
.preview-playback input { min-width:0; width:100%; min-height:22px; padding:0; accent-color:var(--blue); }
.preview-playback span { font:9px/1.3 var(--mono); white-space:nowrap; }
.studio #preview-fullscreen { position:static; background:transparent; color:var(--ink); border-radius:4px; }
.studio .preview-monitor #video-source-label { font:9px/1.6 var(--mono); padding:5px 10px; margin:0; max-width:none; }
.caption-layout { min-width:0; margin:0; padding:0; border:0; }
.caption-layout legend { font-size:13px; font-weight:600; margin-bottom:9px; }
.caption-layout label { display:grid; gap:4px; font-size:10px; color:var(--muted); }
.caption-layout select { width:100%; min-width:0; min-height:32px; padding:5px 8px; font-size:11px; background:white; }
.caption-layout input[type=range] { width:100%; min-height:20px; padding:0; accent-color:var(--blue); }
.caption-layout-checks { display:flex; flex-wrap:wrap; gap:5px 10px; margin-top:7px; }
.caption-layout-checks label { display:flex; gap:5px; align-items:center; }
.caption-layout input[type=checkbox] { min-height:0; width:12px; height:12px; margin:0; accent-color:var(--blue); }
.caption-layout-footer { display:flex; align-items:center; justify-content:space-between; margin-top:9px; gap:6px; font-size:9px; color:var(--muted); }
.caption-layout-footer button { font-size:10px; padding:2px 0; }
.studio .video-preview #video-preview-help { margin:7px 0 0; max-width:none; font-size:10px; }
.studio .video-preview .video-shortcuts { display:none; }
.studio .video-stage:fullscreen { width:100vw; height:100dvh; border-radius:0; background:#101010; }
.studio .video-stage:fullscreen .preview-playback { padding-inline:16px; height:44px; }
.preview-expanded { overflow:hidden; }
.studio .video-stage.is-expanded { position:fixed; inset:0; width:100vw; max-width:none; height:100dvh; z-index:1000; border-radius:0; background:#101010; }
.studio .video-stage.is-expanded .preview-playback { height:44px; padding-inline:16px; }
@media(max-width:1100px) and (min-width:761px) {
 .preview-workspace { grid-template-columns:minmax(0,1fr) 190px; gap:10px; }
 .preview-playback { flex-wrap:wrap; height:48px; gap:2px 4px; }
 .preview-playback input { flex-basis:calc(100% - 40px); }
 .preview-playback span { margin-left:auto; }
}
@media(max-width:760px) {
 .preview-workspace { grid-template-columns:1fr; gap:12px; }
 .studio .video-stage { height:310px; }
 .caption-layout { display:grid; grid-template-columns:1fr 1fr; gap:9px 12px; }
 .caption-layout legend { margin-bottom:8px; }
 .caption-layout-checks,.caption-layout-footer { margin-top:0; }
 .caption-layout-footer { justify-content:flex-end; }
}
