/* Focused transcript workspace: review on the left, exports on the right. */
:root{--bg:#f6f8fc;--text:#263750;--muted:#667991;--accent:#345ab0}
body{background:var(--bg);color:var(--text);font:14px/1.7 system-ui,"Segoe UI","Microsoft YaHei",sans-serif}
main{width:min(1200px,calc(100% - 56px));padding-bottom:45px}
header{height:64px;gap:16px;border-bottom:1px solid #e0e7f0;font-size:16px;letter-spacing:0}
header:before{display:none}.brand{font-size:19px;font-weight:650;color:#263f68}
.result-header-links{display:flex;gap:22px;align-items:center;margin-inline-start:auto}.result-header-links>a{font-size:13px;color:#5a7091}
.result-breadcrumb{display:flex;gap:16px;align-items:center;margin:25px 0 18px;font-size:12px;color:#8b97a9}.result-breadcrumb a{font-size:12px;color:#687e9f}.result-breadcrumb span:before{content:"/";margin-inline-end:16px;color:#bac3d0}
.task-card{margin:0 0 22px;padding:22px 0 24px;border-bottom:1px solid #dfe6f0}
#heading{font-size:13px;line-height:1.5;letter-spacing:0;font-weight:500;margin:0 0 8px;color:#7a8ba3}
#filename{font-size:25px;line-height:1.45;font-weight:600;letter-spacing:-.4px;color:#263c5e;margin:0;overflow-wrap:anywhere}
#result-meta{display:flex;gap:9px 24px;flex-wrap:wrap;margin-top:12px;font-size:12px;color:#7c8aa0}
#result-meta span{display:inline-flex;align-items:center;gap:8px}#result-meta span:before{content:"";width:4px;height:4px;border-radius:50%;background:#a2b4cf}
.result-layout{display:grid;grid-template-columns:minmax(0,1fr) 264px;gap:22px;align-items:start}
#editor{background:#fff;border:1px solid #dfe6ef;border-radius:13px;padding:0;margin:0;min-width:0;overflow:hidden}
.editor-controls{padding:21px 24px 0;background:#fff;border-bottom:1px solid #e8edf5}
.editorbar{display:flex;justify-content:space-between;align-items:center;gap:18px}
#editor h2{font-size:16px;font-weight:600;color:#354c70;margin:0;line-height:1.5}
#cue-count{display:block;font-size:11px;font-weight:400;color:#8b98ab;margin-top:4px}
.editorbar #saveedit{width:auto;min-width:104px;min-height:42px;padding:9px 15px;border:1px solid #335ab1;border-radius:8px;background:#335ab1;color:#fff;box-shadow:none;font-size:13px;font-weight:500}
.editorbar #saveedit:disabled{background:#f0f3f9;color:#8b9ab1;border-color:#e2e8f1;opacity:1;cursor:default}
#player{display:block;width:100%;height:44px;margin:20px 0 17px;border-radius:8px;background:#f1f4f9}
#player.video{height:auto;max-height:300px;border-radius:8px;background:#172335}
.editor-tools{display:flex;gap:14px;align-items:center;justify-content:space-between}
.transcript-search{min-width:0;flex:1}.transcript-search input{height:40px;width:100%;border:1px solid #dce4ef;border-radius:8px;padding:9px 12px;background:#f9fbfe;color:#405978;font-size:13px;font-family:inherit;margin:0}
.playback-speed{display:flex;gap:9px;align-items:center;flex:none;font-size:11px;color:#788ba4;white-space:nowrap}
.playback-speed select{height:40px;width:75px;margin:0;padding:7px 9px!important;background:#fff!important;border:1px solid #dce4ef!important;border-radius:8px!important;color:#526a8e!important;font-size:12px!important}
#editstatus{font-size:11px;line-height:1.8;color:#8090a7;margin:12px 0 14px;min-height:20px}
#editstatus[data-state=dirty]{color:#a47535}#editstatus[data-state=saved]{color:#468165}#editstatus[data-state=error]{color:#b75561}
#cues{position:relative;max-height:calc(100vh - 340px);min-height:230px;overflow:auto;padding:0 22px;scrollbar-width:thin;scrollbar-color:#d2dceb transparent;overscroll-behavior:contain}
#cues:not(:has(.cue:not([hidden]))){min-height:0}
#cues .cue{display:block;padding:21px 2px;border-bottom:1px solid #edf1f6;background:#fff;scroll-margin-top:12px}
#cues .cue:last-child{border-bottom:0}
#cues .cue.playing{background:#f6f9ff;box-shadow:inset 3px 0 #6e8cc9}
.cue-head{display:flex;gap:12px;align-items:center;margin-bottom:12px;flex-wrap:wrap}
#cues .cue .seek{width:auto;min-width:36px;min-height:32px;border:0;border-radius:6px;background:#f0f4fb;color:#6c83a7;box-shadow:none;padding:5px 8px;font-size:11px;cursor:pointer}
#cues .cue .seek:hover{background:#e4ecfb;color:#3b5da2}
.cue-timing{display:flex;gap:7px;align-items:center}
#cues .cue .cue-timing input{width:106px;height:30px;border:1px solid transparent;border-radius:5px;background:#f9fbfe;color:#7c8da4;font:11px/1.5 ui-monospace,Consolas,monospace;padding:5px 6px;direction:ltr;text-align:center}
#cues .cue .cue-timing input:hover,#cues .cue .cue-timing input:focus{border-color:#d9e2ef;background:#fff}
#cues .cue .cue-timing span{font-size:11px;color:#a6b3c6}
#cues .cue input.speaker-name{width:130px;height:30px;margin-inline-start:auto;border:1px solid #dfe6ef;background:#fff;border-radius:6px;color:#627c9e;padding:5px 8px;font-size:11px;font-weight:400}
.cue-texts{display:grid;grid-template-columns:minmax(0,1fr);gap:18px}.cue-texts.has-translation{grid-template-columns:repeat(2,minmax(0,1fr))}
.cue-text-label{display:block;min-width:0}.cue-text-label>span{display:block;font-size:10px!important;color:#8fa0b7!important;line-height:1.5;margin:0 0 6px}
#cues .cue textarea{display:block;grid-column:auto;width:100%;min-height:70px;margin:0;padding:10px 11px;border:1px solid #e8edf5;border-radius:7px;background:#fff;color:#405471;font-size:15px;line-height:1.85;resize:vertical}
#cues .cue textarea:hover{border-color:#d4deee}#cues .cue textarea:focus{border-color:#8fa8d6}
#no-cues{padding:38px 22px;margin:0;color:#8495ad;text-align:center;font-size:13px}
#export-panel{position:sticky;top:84px;border:1px solid #dfe6ef;border-radius:13px;padding:22px;background:#fff;min-width:0}
#export-panel h2{font-size:15px;font-weight:600;line-height:1.5;margin:0 0 19px;color:#3a5377}
#downloads{display:flex;flex-direction:column;gap:16px;margin:0;min-width:0}
#downloads label{display:block;font-size:11px;line-height:1.7;color:#8091a9}
#downloads select{height:42px;margin-top:7px;font-size:13px!important;border:1px solid #dce4ef!important;border-radius:7px!important;background:#fff!important;color:#526a8c!important;padding:8px 10px!important}
.format-shortcuts{display:flex;gap:5px;flex-wrap:wrap}
.format-shortcuts button{width:auto;min-height:30px;padding:5px 8px;background:#f5f7fb;border:1px solid #e5ebf4;border-radius:5px;color:#8190a5;box-shadow:none;font-size:10px;font-weight:400}
.format-shortcuts button[aria-pressed=true]{background:#edf3ff;color:#4b6ba8;border-color:#cddcf6}
#downloads .export-primary{display:block;min-height:43px;width:100%;padding:11px 13px;border:1px solid #335ab0;border-radius:8px;background:#335ab0;color:#fff;line-height:1.6;text-align:center;font-size:13px;font-weight:500}
#downloads .export-primary:hover{background:#284d9b;border-color:#284d9b}
#downloads .export-primary[aria-disabled=true]{opacity:.45;cursor:not-allowed}
.export-filename{font:10px/1.6 ui-monospace,Consolas,monospace;color:#94a2b7;text-align:center;overflow-wrap:anywhere;margin-top:-9px}
#export-notice{font-size:11px;color:#a27639;margin:0;line-height:1.8}
#downloads a.export-raw{font-size:11px;padding:0;background:none;border:0;color:#8296b4;text-align:center}
#expiry{font-size:10px;line-height:1.9;color:#98a5b8;padding-top:16px;margin-top:18px;border-top:1px solid #edf1f6}
.workspace-return{display:block;font-size:11px;color:#8095b4;margin-top:14px}
#message{font-size:13px;line-height:1.8;color:#758aa6;margin:16px 0 0}#message.error{color:#b55260}#cancel{width:auto;padding:9px 14px;font-size:12px;border:1px solid #e0e8f4;background:#edf2fb;color:#6b80a0;margin-top:18px}
body:not(.is-result) .task-card{text-align:center;padding:35px 0}body:not(.is-result) #heading{font-size:23px;color:#405978}
.sr-only{position:absolute;clip:rect(0,0,0,0);width:1px;height:1px;overflow:hidden}
input:focus-visible,textarea:focus-visible,select:focus-visible,button:focus-visible,a:focus-visible{outline:2px solid #8aa4d5;outline-offset:2px}
[hidden]{display:none!important}
@media(max-width:1000px){.result-layout{grid-template-columns:minmax(0,1fr) 235px;gap:17px}#export-panel{padding:19px}.cue-texts.has-translation{grid-template-columns:1fr}.editor-controls{padding:18px 20px 0}#cues{padding:0 18px}}
@media(max-width:760px){main{width:calc(100% - 32px)}.result-layout{display:flex;flex-direction:column}.result-layout>#editor{width:100%;order:1}#export-panel{position:static;width:100%;padding:18px;order:2;margin-top:2px}#downloads{display:grid;grid-template-columns:1fr 1fr;align-items:end;gap:13px}.format-shortcuts{display:none}#downloads .export-primary{grid-column:1/-1}.export-filename,#export-notice,#downloads .export-raw{grid-column:1/-1}#filename{font-size:21px}#cues{max-height:560px}.result-header-links{gap:16px}.result-breadcrumb{margin-top:20px}.task-card{padding:15px 0 20px}.cue-head{gap:8px}.cue-timing{gap:4px}#cues .cue .cue-timing input{width:96px}.playback-speed{font-size:10px;gap:6px}.editor-tools{gap:10px}.editorbar #saveedit{min-width:95px;padding:9px 11px}.result-header-links>a{font-size:12px}}
@media(max-width:400px){.playback-speed{font-size:0}.playback-speed select{font-size:12px!important;width:68px}.cue-timing{flex-wrap:wrap}#cues .cue input.speaker-name{margin-inline-start:0}.result-header-links{gap:10px}}
/* Reading-first proofreading: compact rows, optional timing, stable controls. */
.word-line{padding:6px 8px;font-size:16px;line-height:1.8;color:#405471;overflow-wrap:anywhere}
#cues .timed-word{display:inline;white-space:pre-wrap;width:auto;min-width:0;min-height:0;padding:2px 0;border:0;border-radius:3px;background:transparent;color:inherit;font:inherit;line-height:inherit;box-shadow:none;cursor:pointer;box-decoration-break:clone}
#cues .timed-word{transition:color 120ms ease}
#cues .timed-word:hover{background:transparent;color:#284d91;text-decoration:underline;text-decoration-color:#c7d4e7;text-underline-offset:4px}
#cues .timed-word.word-current{background:linear-gradient(transparent 62%,#eee2b7 62%,#eee2b7 94%,transparent 94%);color:#263e63;box-shadow:none;border-radius:0;text-decoration:none}
@media(prefers-reduced-motion:reduce){#cues .timed-word{transition:none}}
#cues .word-edit{display:inline-flex;width:auto;min-height:28px;margin-inline-start:12px;padding:2px 7px;border:1px solid #e0e7f1;border-radius:5px;background:#fff;color:#647c9f;font-size:11px;font-weight:400;box-shadow:none;vertical-align:middle}
#cues .word-edit:hover{border-color:#9db3d7;color:#345ab0}
/* Inline SVGs work offline and within the existing content security policy. */
.ui-icon{width:16px;height:16px;flex:none;display:inline-block;vertical-align:-3px;pointer-events:none;margin-inline-end:7px}
#filename{display:flex;align-items:center;gap:10px}#filename .ui-icon{width:25px;height:29px;color:#6b85af;margin:0}
#result-meta span:before{display:none}#result-meta .ui-icon{width:15px;height:15px;margin:0}
.transcript-search{position:relative}.transcript-search>.ui-icon{position:absolute;inset-inline-start:12px;top:12px;color:#7c8faa;margin:0}
.transcript-search input{padding-inline-start:37px}
.timing-details summary .ui-icon{width:13px;height:13px;margin-inline-end:4px;vertical-align:-2px}
#export-panel h2 .ui-icon{color:#7189ad}
#editstatus[data-state=dirty]:before{content:'';display:inline-block;width:6px;height:6px;vertical-align:1px;margin-inline-end:7px;background:currentColor;border-radius:50%}
#no-cues .ui-icon{display:block;width:28px;height:28px;margin:0 auto 12px;color:#9aaac0}
.result-breadcrumb{margin:16px 0 8px}.task-card{padding:10px 0 16px;margin-bottom:16px}
#filename{font-size:21px}#heading{display:none}#result-meta{margin-top:6px}
.result-layout{grid-template-columns:minmax(0,1fr) 232px;gap:20px}
.editor-controls{padding:16px 22px 0}.editorbar #saveedit{min-height:40px}
#player{margin:13px 0 8px;height:40px}
.review-transport{display:flex;align-items:center;gap:8px;margin:0 0 14px}
.review-transport button{width:auto;min-width:44px;height:36px;padding:5px 10px;border:1px solid #dfe5ee;border-radius:7px;background:#fff;color:#405a80;box-shadow:none;font-size:13px}
.review-transport button:hover{background:#edf3fc}.review-transport #toggle-play{background:#edf3fc;color:#345ab0}
.review-transport #toggle-play{display:inline-flex;align-items:center;justify-content:center}.review-transport #toggle-play svg{display:block;flex:none}
.follow-label{display:flex;align-items:center;gap:7px;margin-inline-start:auto;font-size:12px;color:#61748e;cursor:pointer;min-height:36px}
.follow-label input{width:16px;height:16px;margin:0;accent-color:#345ab0}
#editstatus{margin:8px 0 10px;font-size:12px}#cue-count{font-size:12px}
#cues{max-height:calc(100dvh - 405px);min-height:280px;padding:0 20px 18px;scroll-padding:12px}
#cues .cue{position:relative;padding:12px 10px 12px 92px;border-bottom:1px solid #edf1f6;border-radius:0}
.cue-head{margin:0;gap:8px;min-height:0}
#cues .cue .seek{position:absolute;inset-inline-start:8px;top:15px;min-width:32px;min-height:30px;font-size:12px}
.cue-stamp{position:absolute;inset-inline-start:8px;top:50px;color:#7789a1;font:11px/1.5 ui-monospace,Consolas,monospace}
.timing-details{margin-inline-start:auto;position:relative;font-size:12px;color:#788ba5}
.timing-details summary{cursor:pointer;min-height:28px;line-height:28px;list-style:none;padding:0 7px;border-radius:5px}
.timing-details summary:after{content:' ⌄'}.timing-details summary:hover{background:#edf2fa}
.timing-details:not([open]){position:absolute;inset-inline-end:8px;top:12px;height:28px;visibility:visible}
.timing-details[open]{height:auto;visibility:visible;margin-bottom:8px}
.timing-details .cue-timing{padding:8px;background:#f5f8fc;border:1px solid #e1e8f2;border-radius:6px}
#cues .cue textarea{min-height:44px;padding:6px 8px;border-color:transparent;background:transparent;font-size:16px;line-height:1.8;resize:none;border-radius:5px}
#cues .cue{min-height:86px}.cue-texts{padding-inline-end:65px}
#cues .cue textarea:hover{border-color:#e0e7f1;background:#fbfcff}#cues .cue textarea:focus{border-color:#99afd6;background:#fff;outline:2px solid #dce6f7;outline-offset:0}
.single-track .cue-text-label>span{display:none}.cue-text-label>span{font-size:12px!important;margin-bottom:3px}
#cues .cue.playing{background:#f0f5ff;box-shadow:inset 3px 0 #5579bd}
#export-panel{padding:18px}#downloads label,#expiry,.workspace-return{font-size:12px}
@media(hover:none){.timing-details:not([open]){height:auto;visibility:visible}}
@media(max-width:1000px){.result-layout{grid-template-columns:minmax(0,1fr) 210px;gap:14px}}
@media(max-width:760px){.result-layout{display:flex}#cues{max-height:60dvh;min-height:260px}.editor-controls{padding:16px 14px 0}#cues{padding:0 6px 14px}#cues .cue{padding-inline-start:76px;padding-inline-end:8px}.timing-details:not([open]){visibility:visible;height:auto}.cue-stamp{font-size:10px}.cue-timing{flex-wrap:wrap}.task-card{margin-bottom:12px}#filename{font-size:19px}}

.task-privacy{margin:28px 0;padding:22px;border:1px solid #dfe5ee;border-radius:12px}.task-privacy h2{font-size:16px;margin:0 0 10px}.task-privacy p{font-size:13px;line-height:1.8;margin:0 0 16px}.task-privacy .privacy-delete{width:auto;display:inline-block;margin-inline-end:10px;background:#fff;color:#8e4050;border:1px solid #e1cbd0;box-shadow:none}

.local-video-review{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:12px 0}.local-video-review button{font-size:13px;padding:8px 12px}.local-video-review p{flex-basis:100%;font-size:12px;color:#64748b;margin:0;line-height:1.6}

#editor .local-video-review button{width:auto;margin:0;padding:8px 12px;background:#fff;color:#334155;border:1px solid #dbe2ea;border-radius:7px;font-weight:500;min-height:34px}#editor .local-video-review button:hover{background:#f1f5f9}

/* File management belongs with the filename, separate from export actions. */
.result-file-row{display:flex;align-items:center;justify-content:space-between;gap:20px;width:100%}
.result-file-row #filename{flex:1;min-width:0;overflow-wrap:anywhere}
.result-file-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
.result-file-actions .privacy-delete{display:inline-flex;align-items:center;justify-content:center;min-height:40px;margin:0;padding:9px 13px;border:1px solid #dce3ed;border-radius:8px;background:#fff;color:#52627a;font-size:12px;font-weight:500;line-height:1.4;cursor:pointer;transition:background .15s,border-color .15s}
.result-file-actions .privacy-delete:hover{background:#f4f7fb;border-color:#bdc9d9}
.result-file-actions .privacy-delete-all{color:#b44747;border-color:#efd8d8;background:#fff}
.result-file-actions .privacy-delete-all:hover{background:#fff3f3;border-color:#dca9a9}
.result-file-actions .privacy-delete:focus-visible{outline:2px solid #4e75d9;outline-offset:3px}
.result-file-actions .privacy-delete:disabled{opacity:.5;cursor:wait}
@media(max-width:760px){.result-file-row{flex-wrap:wrap;gap:12px}.result-file-row #filename{flex-basis:100%}.result-file-actions{flex-wrap:wrap}.result-file-actions .privacy-delete{min-height:44px}}

/* Task-first hierarchy: readable controls, one primary save action, optional tools. */
body.is-result{background:#f5f7fb;color:#1e293b}
body.is-result #site-footer{display:none}
body.is-result .result-layout{grid-template-columns:minmax(0,1fr) 264px;gap:20px}
.result-file-actions .privacy-delete{width:auto;white-space:nowrap;flex:none;min-height:42px;padding:10px 15px;font-size:13px;color:#334155;background:#f1f5f9;border-color:#cbd5e1;font-weight:550}
.result-file-actions .privacy-delete:hover{background:#e2e8f0;border-color:#94a3b8}
.result-file-actions .privacy-delete-all{color:#9f1239;background:#fff1f2;border-color:#f2b9c4}
.result-file-actions .privacy-delete-all:hover{background:#ffe4e6;border-color:#e891a4}
.editorbar #saveedit:not(:disabled){background:#1d4ed8;color:#fff;border:1px solid #1d4ed8;box-shadow:0 2px 4px #1d4ed81a}
.editorbar #saveedit:not(:disabled):hover{background:#1e40af}
.editorbar #saveedit:disabled{background:#f1f5f9;color:#64748b;border:1px solid #cbd5e1;opacity:1;box-shadow:none}
.editor-controls{padding:14px 18px 0}.editorbar{gap:12px}#editor h2{color:#1e293b}#cue-count,#result-meta{color:#526176}
#player{height:36px;margin:10px 0 6px}.review-transport{margin-bottom:10px}
.review-transport button{min-height:40px;height:auto;color:#334155;background:#f8fafc;border-color:#cbd5e1}
.review-transport #toggle-play{background:#1d4ed8;color:#fff;border-color:#1d4ed8}
.review-transport #toggle-play:hover{background:#1e40af}
#editor .editor-views{margin:10px 0;padding:4px;border-color:#dbe3ef;background:#f1f5f9}
#editor .editor-views button{color:#475569;background:transparent;font-size:13px}
#editor .editor-views button[aria-pressed=true]{color:#1e40af;background:#fff;box-shadow:0 1px 4px #0f172a1a;font-weight:600}
#editor .repair-tools{margin:9px 0}.repair-tools button,.repair-more summary{background:#f8fafc;color:#334155;border-color:#cbd5e1}
#cues .word-line,#cues .cue textarea{color:#263449}
#cues .word-edit{color:#334155;background:#f1f5f9;border-color:#cbd5e1;font-size:12px;min-height:32px;padding:3px 10px}
#editstatus{color:#526176;line-height:1.6}
#export-panel{padding:20px;background:#fff;border:1px solid #dce3ed;border-radius:12px}
#export-panel h2{font-size:16px;color:#1e293b}#downloads label{font-size:13px;color:#475569}
#downloads select{font-size:14px;color:#1e293b;border-color:#cbd5e1;background:#fff;min-height:42px}
#export-download{background:#1d4ed8;color:#fff;min-height:44px;font-size:14px;border-radius:8px}
#downloads .format-shortcuts button{color:#475569;border-color:#cbd5e1;background:#f8fafc}
#downloads .format-shortcuts button[aria-pressed=true]{color:#1e40af;background:#e8efff;border-color:#abc0ef}
#export-panel .workspace-return{display:none}
.result-more-tools{margin-top:18px;border-top:1px solid #e2e8f0;padding-top:14px}
.result-more-tools summary{cursor:pointer;font-size:13px;color:#334155;font-weight:600;padding:6px 0;min-height:36px}
#result-secondary-tools{display:flex;flex-direction:column;gap:8px;margin-top:10px}
#result-secondary-tools .ai-summary-open{width:100%;margin:0;min-height:42px;padding:10px 12px;text-align:start;background:#f8fafc;color:#334155;border:1px solid #cbd5e1;border-radius:8px;font-size:13px;box-shadow:none}
#result-secondary-tools .ai-summary-open:hover{background:#edf2fa;border-color:#94a3b8}
#result-secondary-tools .ai-summary-open:disabled{background:#f1f5f9;color:#64748b;opacity:1;cursor:not-allowed}
.result-file-actions button:focus-visible,#export-panel button:focus-visible,#export-panel a:focus-visible,#editor button:focus-visible{outline:2px solid #2563eb;outline-offset:3px}
@media(max-width:1000px){body.is-result .result-layout{grid-template-columns:minmax(0,1fr) 240px;gap:14px}}
@media(max-width:760px){body.is-result .result-layout{display:flex}.result-file-actions{width:100%}.result-file-actions .privacy-delete{min-height:44px}.editor-controls{padding:14px 12px 0}#export-panel{padding:18px}#result-secondary-tools{display:grid;grid-template-columns:1fr}.result-more-tools{grid-column:1/-1}}

/* Use the viewport for proofreading; keep exports on the far right. */
body.is-result main{width:calc(100% - 48px);max-width:none;margin-inline:auto}
body.is-result .result-layout{grid-template-columns:minmax(0,1fr) 264px;gap:20px}
.result-more-tools h3{margin:0;font-size:13px;line-height:1.6;color:#334155;font-weight:600}
@media(min-width:1500px){body.is-result main{width:calc(100% - 64px)}body.is-result .result-layout{grid-template-columns:minmax(0,1fr) 280px;gap:24px}}
@media(max-width:760px){body.is-result main{width:calc(100% - 24px)}body.is-result .result-layout{display:flex}}

/* Center the workspace with comfortable side margins. */
body.is-result main{width:min(1400px,calc(100% - 80px));max-width:1400px;margin-inline:auto}
@media(max-width:1000px){body.is-result main{width:calc(100% - 48px)}}
@media(max-width:760px){body.is-result main{width:calc(100% - 24px)}}

.repair-expanded{display:contents}
#editor .repair-tools{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
#editor .repair-tools button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:40px;width:auto;margin:0;padding:8px 11px;font-size:12px;line-height:1.5;color:#334155;background:#f8fafc;border:1px solid #cbd5e1;border-radius:7px;white-space:nowrap}
#editor .repair-tools button:hover{background:#edf2fa;border-color:#94a3b8}
#editor .repair-tools button svg{width:16px;height:16px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:760px){#editor .repair-tools button{min-height:44px}}

/* Match the shared public-page content container. */
body.is-result main{width:min(1440px,calc(100% - 64px));max-width:1440px;margin-inline:auto}
@media(max-width:800px){body.is-result main{width:calc(100% - 40px)}}
@media(max-width:500px){body.is-result main{width:calc(100% - 32px)}}

/* Export is an on-demand modal drawer, leaving the editor full width. */
body.is-result .result-layout{display:block}
.result-head-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
.result-head-actions>button{width:auto;min-height:42px;padding:10px 16px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#334155;font-size:13px;white-space:nowrap;cursor:pointer}
.result-head-actions .result-open-export{background:#1d4ed8;color:#fff;border-color:#1d4ed8;font-weight:600}
.result-head-actions .result-open-export:hover{background:#1e40af}
.result-head-actions .result-file-actions{margin-inline-start:8px;padding-inline-start:12px;border-inline-start:1px solid #dce3ed}
.result-head-actions>button:disabled{opacity:.5;cursor:wait}
.result-export-drawer{position:fixed;inset:0 0 0 auto;margin:0;width:min(400px,100vw);max-width:100vw;height:100dvh;max-height:100dvh;padding:22px;border:0;border-inline-start:1px solid #dce3ed;border-radius:0;background:#fff;box-shadow:-12px 0 60px #0f172a26;overflow:auto;color:#1e293b}
.result-export-drawer::backdrop,.result-tools-dialog::backdrop{background:#0f172a55}
.result-export-drawer #export-panel{position:static;top:auto;width:100%;padding:0;border:0;box-shadow:none;background:#fff;border-radius:0;margin:14px 0 0}
.result-export-drawer #downloads{display:flex;flex-direction:column;gap:16px}
.result-export-drawer #downloads label{width:100%}
.result-export-drawer #downloads .format-shortcuts{display:flex;gap:8px}
.result-export-drawer #export-download{display:flex;align-items:center;justify-content:center;width:100%;text-decoration:none}
.result-panel-close{display:block;width:auto;margin-inline-start:auto;padding:8px 12px;min-height:40px;border:1px solid #cbd5e1;border-radius:7px;background:#f8fafc;color:#334155;font-size:13px;cursor:pointer}
.result-tools-dialog{width:min(440px,calc(100% - 32px));padding:22px;border:1px solid #dce3ed;border-radius:14px;background:#fff;color:#1e293b}
.result-tools-dialog .result-more-tools{border:0;padding:0;margin:14px 0 0}
.result-tools-dialog .result-more-tools h3{font-size:19px;margin-bottom:16px}
.result-tools-dialog #result-secondary-tools{gap:12px}
@media(max-width:900px){.result-file-row{flex-wrap:wrap}.result-file-row #filename{flex-basis:100%}.result-head-actions{flex-wrap:wrap;width:100%}.result-head-actions .result-file-actions{width:auto}}
@media(max-width:600px){.result-export-drawer{inset:auto 0 0 0;width:100%;height:auto;max-height:90dvh;border-radius:16px 16px 0 0;border:0;padding:20px}.result-head-actions{gap:8px}.result-head-actions .result-file-actions{border:0;padding:0;margin:0;flex-wrap:wrap}.result-head-actions>button{min-height:44px}}

.result-inline-tools{margin:12px 0 0;padding:0;border:0}
.result-inline-tools #result-secondary-tools{display:flex;flex-direction:row;flex-wrap:wrap;gap:8px;margin:0}
.result-inline-tools #result-secondary-tools .ai-summary-open{width:auto;min-height:40px;padding:8px 13px;background:#fff;color:#334155;border-color:#cbd5e1}
.result-head-actions .result-open-delete{display:inline-flex;align-items:center;justify-content:center;width:42px;min-width:42px;padding:10px;background:#fff;color:#9f1239;border-color:#e7cbd3}
.result-open-delete svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.result-head-actions .result-open-delete:hover{background:#fff1f2;border-color:#d997a8}
.result-delete-dialog{width:min(430px,calc(100% - 32px));padding:22px;border:1px solid #dce3ed;border-radius:14px;background:#fff;color:#1e293b}
.result-delete-dialog::backdrop{background:#0f172a55}
.result-delete-dialog h2{font-size:19px;margin:12px 0 18px}
.result-delete-dialog .result-file-actions{display:flex;flex-direction:column;align-items:stretch;gap:12px}
.result-delete-dialog .privacy-delete{width:100%;white-space:normal;min-height:44px}
@media(max-width:760px){.result-inline-tools #result-secondary-tools .ai-summary-open{min-height:44px}}

/* Compact proofreading toolbar: align view modes and search on one row. */
body.is-result .editor-controls{display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,360px);align-items:center;column-gap:18px;row-gap:9px;padding:16px 18px 12px}
.editor-controls>.editorbar,.editor-controls>#player,.editor-controls>.review-transport,.editor-controls>#editstatus,.editor-controls>.repair-tools,.editor-controls>.focus-navigation{grid-column:1/-1}
.editor-controls>.editorbar{margin:0;min-height:38px}
.editorbar>div:first-child{display:flex;align-items:baseline;flex-wrap:wrap;gap:10px}
.editorbar #cue-count{font-size:12px;line-height:1.5;color:#64748b}
.editorbar #saveedit{min-height:38px;padding:8px 13px;font-size:13px}
.editor-controls>#player{width:100%;height:34px;margin:0}
.editor-controls>.review-transport{margin:0;min-height:36px;gap:7px}
.review-transport button{min-height:36px;padding:6px 10px}
.follow-label{min-height:36px;font-size:12px;color:#475569}
#editor .editor-controls>.editor-views{grid-column:1;margin:0;padding:3px;gap:3px;max-width:560px;min-width:0}
#editor .editor-views button{min-height:36px;padding:6px 10px;font-size:13px;line-height:1.5}
.editor-controls>.editor-tools{grid-column:2;display:flex;align-items:center;gap:12px;margin:0;min-width:0}
.editor-tools .transcript-search{flex:1;min-width:120px}
.editor-tools .transcript-search input{height:38px;min-height:38px;font-size:13px;border-radius:7px}
.transcript-search>.ui-icon{top:11px}
.editor-tools .playback-speed{display:flex;align-items:center;gap:7px;white-space:nowrap;font-size:12px;color:#475569}
.editor-tools .playback-speed select{height:38px;min-height:38px;padding:6px 8px;font-size:13px}
.editor-controls>#editstatus{font-size:12px;line-height:1.6;margin:0;padding:0;color:#64748b}
#editor .editor-controls>.repair-tools{margin:0;padding:8px 0 0;border-top:1px solid #edf0f5;gap:6px}
#editor .repair-tools button{min-height:36px;padding:6px 10px;gap:6px}
#editor .repair-tools button svg{width:15px;height:15px}
#cues{padding:8px 12px 16px;max-height:calc(100dvh - 355px);min-height:300px;scroll-padding:12px}
#cues .cue{padding:12px 12px 12px 80px}
#cues .cue .seek{inset-inline-start:10px;top:14px}
#cues .cue-stamp{inset-inline-start:10px;top:49px}
#cues .cue-texts{column-gap:24px;padding-inline-end:48px}
#cues .cue-text-label>span{display:block;font-size:12px!important;font-weight:500;color:#64748b;line-height:1.6;margin:0 0 5px}
#cues .word-line{padding:4px 6px;font-size:16px;line-height:1.85}
#cues .cue textarea{padding:4px 6px;font-size:16px;line-height:1.85}
#cues .timing-details[open]{margin:0 0 8px}
@media(max-width:1000px){body.is-result .editor-controls{grid-template-columns:minmax(0,1fr);gap:9px}.editor-controls>.editor-tools,#editor .editor-controls>.editor-views{grid-column:1;max-width:none}.editor-tools .transcript-search{max-width:none}}
@media(max-width:600px){body.is-result .editor-controls{padding:12px}.editorbar>div:first-child{gap:6px}#editor .editor-views button{min-height:40px;font-size:12px;padding:7px 8px}.editor-controls>.editor-tools{gap:8px}.editor-tools .playback-speed{font-size:0}.editor-tools .playback-speed select{font-size:13px}#editor .repair-tools button{min-height:44px}#cues{padding:6px;max-height:65dvh}#cues .cue{padding-inline-start:60px;padding-inline-end:6px}#cues .cue-texts{padding-inline-end:0;column-gap:12px}#cues .cue .seek,#cues .cue-stamp{inset-inline-start:4px}.follow-label{font-size:11px}}

/* Align each cue's play control with its first line, not its time editor. */
#editor:not([data-view=reading]) #cues .cue{padding-inline-start:72px;padding-inline-end:14px}
#editor:not([data-view=reading]) #cues .cue-texts{position:relative;padding-inline-end:0}
#editor:not([data-view=reading]) #cues .cue-texts>.seek{position:absolute;inset-inline-start:-58px;top:27px;margin:0;min-width:40px;width:40px;min-height:32px;height:32px;padding:4px;font-size:12px;line-height:1.4;text-align:center;align-self:start}
#editor:not([data-view=reading]) #cues .cue-stamp{display:none}
#editor[data-view=reading] #cues{max-width:none;width:100%;margin:0;padding:10px 18px 20px}
#editor[data-view=reading] #cues .cue{padding:10px 0;min-height:0}
#editor[data-view=reading] #cues .cue-texts{padding:0}
#editor[data-view=reading] #cues .word-line,#editor[data-view=reading] #cues .cue textarea{padding-inline:4px}
@media(max-width:600px){#editor:not([data-view=reading]) #cues .cue{padding-inline-start:54px;padding-inline-end:6px}#editor:not([data-view=reading]) #cues .cue-texts>.seek{inset-inline-start:-48px;width:40px;min-width:40px;height:40px;min-height:40px;top:23px}#editor[data-view=reading] #cues{padding:8px 12px 16px}}

.result-head-actions .result-inline-tools{margin:0;padding:0;border:0}
.result-head-actions .result-inline-tools #result-secondary-tools{margin:0;gap:8px;align-items:center}
.result-head-actions .result-inline-tools #result-secondary-tools .ai-summary-open{min-height:42px;margin:0;padding:9px 12px;font-size:12px;white-space:nowrap}
@media(max-width:1100px){.result-file-row{flex-wrap:wrap}.result-file-row #filename{flex-basis:100%}.result-head-actions{flex-wrap:wrap;width:100%;gap:8px}}
@media(max-width:600px){.result-head-actions .result-inline-tools{flex-basis:100%}.result-head-actions .result-inline-tools #result-secondary-tools .ai-summary-open{min-height:44px}}

/* Quiet, cohesive controls with a clear active state. */
body.is-result #editor{border-color:#dfe5ee;box-shadow:0 4px 24px #26375005,0 1px 3px #26375004}
#editor .editorbar #saveedit{border-radius:9px;font-weight:600;letter-spacing:.05px;transition:background .16s,box-shadow .16s,transform .16s}
#editor .editorbar #saveedit:not(:disabled){background:linear-gradient(180deg,#315fe5,#244fce);border-color:#244fce;box-shadow:0 2px 5px #244fce24,inset 0 1px 0 #ffffff24}
#editor .editorbar #saveedit:not(:disabled):hover{box-shadow:0 3px 9px #244fce30;transform:translateY(-1px)}
#editor .editorbar #saveedit:disabled{background:#f4f6fa;border-color:#e1e6ef;color:#718096}
#editor .review-transport{gap:6px}
#editor .review-transport button{border-radius:9px;background:#f4f6fa;border:1px solid transparent;color:#475569;transition:background .16s,box-shadow .16s;box-shadow:inset 0 1px 0 #ffffffaa}
#editor .review-transport button:hover{background:#eaf0fb;border-color:#dce5f5}
#editor .review-transport #toggle-play{background:linear-gradient(180deg,#315fe5,#244fce);color:#fff;border-color:#244fce;box-shadow:0 2px 5px #244fce24,inset 0 1px 0 #ffffff24}
#editor .editor-controls>.editor-views{padding:4px;background:#eef2f7;border:1px solid #e2e7ef;border-radius:10px;box-shadow:inset 0 1px 2px #23375004}
#editor .editor-views button{border-radius:7px;font-weight:500;color:#617087;transition:background .16s,color .16s,box-shadow .16s}
#editor .editor-views button:hover{background:#ffffff80;color:#334155}
#editor .editor-views button[aria-pressed=true]{background:#fff;color:#244fbd;font-weight:600;box-shadow:0 1px 4px #26375012,0 0 0 1px #e0e6ef}
#editor .editor-controls>.repair-tools{padding:5px;margin-top:0;gap:2px;border:1px solid #e7ebf2;border-radius:10px;background:#f6f8fb;box-shadow:inset 0 1px 0 #fff}
#editor .repair-tools button{min-height:35px;padding:7px 11px;border:1px solid transparent;background:transparent;border-radius:7px;color:#475569;font-weight:500;box-shadow:none;transition:background .16s,color .16s,box-shadow .16s}
#editor .repair-tools button svg{color:#76849a;stroke-width:1.65;transition:color .16s}
#editor .repair-tools button:first-child svg{color:#315fce}
#editor .repair-tools button:hover{background:#fff;border-color:#e4e9f1;color:#244fbd;box-shadow:0 1px 3px #2637500c}
#editor .repair-tools button:hover svg{color:#315fce}
#editor .repair-tools button:active{background:#eaf0fc;box-shadow:inset 0 1px 2px #2637500c}
#editor:not([data-view=reading]) #cues .cue-texts>.seek{background:#eef3ff;color:#3156a5;border:1px solid #dce6fa;border-radius:8px;box-shadow:none;transition:background .16s,color .16s}
#editor:not([data-view=reading]) #cues .cue-texts>.seek:hover{background:#dfe9ff;color:#1e40af}
#editor .word-edit{border-radius:6px;background:#f3f6fb;border-color:transparent;font-weight:500}
#editor .word-edit:hover{background:#eaf0fc;border-color:#d6e2f7}
@media(max-width:600px){#editor .repair-tools button{min-height:44px;padding:8px 10px}}
@media(prefers-reduced-motion:reduce){#editor button{transition:none!important;transform:none!important}}

body.is-result #editor[data-view=reading] #cues{max-width:none;width:100%;margin:0;padding:10px 18px 20px}
body.is-result #editor[data-view=reading] #cues .cue{padding:10px 0;min-height:0}
body.is-result #editor[data-view=reading] #cues .cue-texts{padding:0}
@media(max-width:600px){body.is-result #editor[data-view=reading] #cues{padding:8px 12px 16px}}

body.is-result #editor:not([data-view=reading]) #cues .cue{padding-inline-start:72px;padding-inline-end:14px}
@media(max-width:600px){body.is-result #editor:not([data-view=reading]) #cues .cue{padding-inline-start:54px;padding-inline-end:6px}}

/* Cue timestamps sit beside the original-text label. */
#editor #cues .cue-head:not(:has(.speaker-name)){display:none}
#editor #cues .cue-text-heading{display:flex;align-items:center;flex-wrap:wrap;gap:4px 12px;min-height:30px;margin-bottom:4px}
#editor #cues .cue-text-heading>span{font-size:12px;line-height:1.5;font-weight:500;color:#64748b;white-space:nowrap}
#editor #cues .cue-text-heading .timing-details{position:static;display:block;height:auto;visibility:visible;margin:0;font-size:11px}
#editor #cues .cue-text-heading .timing-details>summary{display:none}
#editor #cues .cue-text-heading .cue-timing{display:flex;align-items:center;flex-wrap:nowrap;gap:4px;padding:0;border:0;border-radius:0;background:transparent}
#editor #cues .cue-text-heading .cue-timing input{width:104px;height:28px;min-height:28px;margin:0;padding:3px 6px;font:11px/1.5 ui-monospace,Consolas,monospace;color:#52647e;border:1px solid #e5eaf1;border-radius:5px;background:#f8fafc}
#editor #cues .cue-text-heading .cue-timing input:hover{border-color:#b6c6dc;background:#fff}
#editor #cues .cue-text-heading .cue-timing input:focus{outline:2px solid #dbe7ff;border-color:#7897cc;background:#fff}
#editor #cues .cue-text-heading .cue-timing>span{color:#94a3b8}
#editor[data-view=reading] #cues .cue-text-heading .timing-details{display:none}
#editor[data-view=reading] #cues .cue-text-heading{min-height:20px}
#editor:not([data-view=reading]) #cues .cue-texts>.seek{top:32px}
@media(max-width:600px){#editor #cues .cue-text-heading{gap:4px 8px}#editor #cues .cue-text-heading .cue-timing input{width:94px;font-size:10px}#editor:not([data-view=reading]) #cues .cue-texts>.seek{top:30px}}

#cues .word-line,#cues .cue textarea{font-size:17px;line-height:1.85}.result-head-actions .result-inline-tools #result-secondary-tools .ai-summary-open{font-size:14px}@media(max-width:600px){#cues .word-line,#cues .cue textarea{font-size:16px}}
