:root {  --tl-bg: var(--panel);
  --tl-ruler: var(--panel-2);
  --tl-wave: var(--wave);
  --tl-wave-bars: var(--wave-bars);
  --tl-wave-tint: var(--wave-tint);
  --tl-block: var(--track1-bg);
  --tl-block-edge: var(--accent);
  --tl-block-sel: var(--accent);
  --tl-block-text: var(--track1-fg);
  --tl-block-bad: var(--danger);
  --tl-cut: var(--cut);
  --tl-playhead: var(--accent);
  --tl-grid: var(--grid);
  --tl-tr-block: var(--track2-bg);
  --tl-tr-edge: var(--tr);
  --tl-tr-sel: var(--tr);
  --tl-tr-text: var(--track2-fg);
  --tl-tr-block-dark: var(--track2-bg);
}
html[data-theme="light"] { --tl-tr-block-dark: #1f3a36; }
body.editor { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.muted { color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; user-select: none; }
.check input { margin: 0; }
.input-sm { padding: 4px 6px; font-size: 13px; border-radius: 8px; }

.ed-top { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); flex: none; flex-wrap: wrap; }
.ed-title { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; line-height: 1.2; min-width: 0; flex: 1 1 200px; }#ed-name { max-width: 100%; font-size: 14px; font-weight: 600; }
#ed-status { max-width: 100%; font-size: 11px; line-height: 16px; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.banner { flex: none; padding: 8px 14px; background: var(--warn-bg); color: var(--warn); font-size: 13.5px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner.info { background: var(--info-bg); color: var(--accent); }
.banner-stale { position: sticky; top: 0; z-index: 40; box-shadow: 0 8px 16px -8px rgba(0, 0, 0, .5); }.banner a { color: inherit; text-decoration: underline; overflow-wrap: anywhere; }
.ed-main { max-width: none; width: auto; margin: 0; position: relative; flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(280px, 34%) 1fr; gap: 12px; padding: 12px 14px 8px; }
.ed-video { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.vbox { position: relative; flex: 1 1 auto; min-height: 120px; background: var(--video); border-radius: 12px; overflow: hidden; }
.vbox video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--video); }
.sub-overlay { position: absolute; pointer-events: none; }
.sub-line {
  position: absolute; left: 0; right: 0; padding: 0 3%; max-width: 100%; text-align: center; white-space: pre-wrap;
  font-weight: 600; line-height: 1.22;
  text-shadow: 0 0 3px #000, 0 0 3px #000, 1px 1px 2px #000, -1px -1px 2px #000, 1px -1px 2px #000, -1px 1px 2px #000;
}
.sub-line:empty { display: none; }
.sub-line-orig {
  bottom: calc(var(--vh, 400px) * var(--sub-orig-pos-frac, 0.12)); color: var(--sub-orig-color, #fff);
  font-family: var(--sub-orig-font, inherit); font-size: max(calc(11px * min(1, var(--sub-orig-size, 1))), calc(var(--vh, 400px) * 0.034 * var(--sub-orig-size, 1)));}
.sub-line-tr {
  bottom: calc(var(--vh, 400px) * var(--sub-tr-pos-frac, 0.04)); color: var(--sub-tr-color, #ffde59);
  font-family: var(--sub-tr-font, inherit); font-size: max(calc(11px * min(1, var(--sub-tr-size, 1))), calc(var(--vh, 400px) * 0.034 * var(--sub-tr-size, 1)));}
.sx-layer { position: absolute; left: 0; right: 0; bottom: calc(var(--vh, 400px) * var(--sub-orig-pos-frac, 0.12)); display: none; justify-content: center; padding: 0 3%; font-weight: 600; line-height: 1.22;
  font-family: var(--sub-orig-font, inherit); font-size: max(calc(11px * min(1, var(--sub-orig-size, 1))), calc(var(--vh, 400px) * 0.034 * var(--sub-orig-size, 1))); }
.sub-overlay.is-sample .sx-layer { display: flex; }
.sub-overlay.is-sample .sub-line { visibility: hidden; }
.sx-wrap { position: relative; flex: none; }
.sx { width: calc(var(--bw) * 1em); height: calc(var(--bh) * 1em); box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden; padding: .3em .5em; border-radius: .6em; background: rgb(8 8 10 / .62); }
.sx-l { display: flex; align-items: center; flex: none; height: 1.22em; }
.sx-c { flex: none; box-sizing: border-box; width: calc(var(--cw, .5) * 1em); height: .46em; border-left: .05em solid transparent; border-right: .05em solid transparent; border-radius: .07em; background: rgb(255 255 255 / .92); background-clip: padding-box; }
.sx-c.sp { background: none; }
.sx-c.a { border-top-left-radius: .23em; border-bottom-left-radius: .23em; }
.sx-c.z { border-top-right-radius: .23em; border-bottom-right-radius: .23em; }
.sx-cap { position: absolute; left: 50%; top: calc(100% + 5px); transform: translateX(-50%); font: 600 11px/13px var(--font-ui); letter-spacing: .01em; white-space: nowrap; color: rgb(255 255 255 / .82); }
.sx-wrap.cap-up .sx-cap { top: auto; bottom: calc(100% + 5px); }
.sx-note { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 3; max-width: calc(100% - 16px); box-sizing: border-box; padding: 4px 10px; border-radius: 12px; background: rgb(8 8 10 / .74); color: #fff;
  font: 600 12px/1.35 var(--font-ui); text-align: center; pointer-events: none; }
.sx-note[hidden] { display: none; }
.sx-note.warn { box-shadow: inset 0 0 0 1px #ff6a5f; }
@media (forced-colors: active) { .sx, .sx-c, .sx-cap, .sx-note { forced-color-adjust: none; } }
.cut-flash { position: absolute; top: 10px; left: 10px; padding: 3px 9px; border-radius: 999px; background: var(--tl-cut); color: #1c1200; font-size: 12.5px; font-weight: 700; pointer-events: none; }
.video-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; color: #fff; background: rgba(0, 0, 0, .7); font-size: 14px; }
.vbar { display: flex; flex-direction: column; gap: 6px; flex: none; }
.vrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; row-gap: 6px; }.vrow .btn, .vrow .input { white-space: nowrap; flex: none; }
.vsep { width: 1px; align-self: stretch; margin: 2px 4px; background: var(--line); flex: none; }
.icon-btn { width: 34px; min-height: calc(1em + 2px); padding: 0; font-size: 19px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }#btn-play { font-size: 17px; line-height: 1; }

.ed-cues { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.cues-head { display: flex; align-items: center; gap: 12px; padding: 0 2px 8px; flex: none; flex-wrap: wrap; }
.cues-head h2 { font-size: 15px; }
.cue-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 2px 4px 30px 2px; }

.cue { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.cue.sel { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.cue.active .cue-num { background: var(--accent); color: var(--accent-ink); }
.cue.bad { border-left: 4px solid var(--bad); }
.cue-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cue-num { min-width: 28px; text-align: center; font-size: 12px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); color: var(--muted); cursor: pointer; }
.tin { width: 96px; font: 13px var(--font-mono); padding: 3px 6px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); }
.tin.invalid { border-color: var(--bad); background: var(--bad-bg); }
.arrow { color: var(--muted); }
.cue-dur { font-size: 12px; color: var(--muted); min-width: 44px; }
.cue-tools { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }.cue-tools .btn { padding: 2px 8px; font-size: 12px; }
@media (min-width: 701px) and (min-height: 501px), (min-width: 1001px) {  .cue-tools .btn { min-height: 30px; padding: 0 11px; gap: 7px; }
}
.cue textarea {
  font: inherit; font-size: 15px; width: 100%; resize: none; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--sub-orig-color, var(--text)); overflow: hidden; line-height: 1.35;
}
.cue textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cue-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.cue-badges:empty { display: none; }
.pill { font-family: var(--font-ui); font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 0; }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.cut-on { background: var(--ok-bg); color: var(--ok); }
.pill.cut-near { background: var(--warn-bg); color: var(--warn); cursor: pointer; min-height: 24px; display: inline-flex; align-items: center; }.pill.cut-near:hover { filter: brightness(.95); }
.pill.changed { background: var(--info-bg); color: var(--rev-fg); }

.prep { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--bg) 88%, transparent); }
.prep-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; width: min(460px, 90vw); display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }

.ed-timeline { flex: none; padding: 0 14px 12px; display: flex; flex-direction: column; gap: 6px; }
.tl-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 6px; }
.tl-zoom { display: inline-flex; align-items: center; gap: 6px; flex: none; }.tl-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.tl-info { font-size: 12px; flex: none; margin-left: auto; }.tl-hint { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.tl-hint > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-bar { gap: 8px; }
.tl-bar .check { gap: 6px; font-size: 13px; }
.tl-bar input[type=range] { width: 100px; }
.tl-actions .btn-sm { padding: 5px 10px; }
.tl { width: 100%; height: var(--tl-h, clamp(110px, 20vh, 260px)); display: block; border: 1px solid var(--line); border-radius: 10px; background: var(--tl-bg); outline: none; touch-action: none; }
.tl:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ov { width: 100%; height: 26px; display: block; border: 1px solid var(--line); border-radius: 8px; background: var(--tl-bg); cursor: pointer; }

.modal { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .45); padding: 16px; }
.modal-card { background: var(--surface); color: var(--text); border-radius: 16px; padding: 20px 22px; width: min(640px, 100%); max-height: 88vh; overflow: auto; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.modal-body { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.modal-body textarea { width: 100%; min-height: 200px; font: 12px var(--font-mono); padding: 8px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); }
.modal-actions { justify-content: flex-end; }
.keys { display: grid; grid-template-columns: fit-content(42%) 1fr; gap: 6px 16px; font-size: 13.5px; }.keys kbd { font: 12px var(--font-mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; white-space: normal; }
.seek { display: block; width: 100%; height: 38px; cursor: pointer; touch-action: none; flex: none; }
.tl-resizer { height: 10px; margin: 2px 0 0; cursor: row-resize; position: relative; touch-action: none; }
.tl-resizer::after { content: ''; position: absolute; left: 50%; top: 3px; width: 44px; height: 4px; margin-left: -22px; border-radius: 4px; background: var(--line); }
.tl-resizer:hover::after { background: var(--accent); }
.tl-hint { font-size: 12.5px; min-height: 18px; padding: 0 2px; }
.multibar { flex: none; display: flex; align-items: center; gap: 8px; padding: 7px 10px; margin-bottom: 8px; border-radius: 10px; background: var(--info-bg); color: var(--accent); font-size: 13.5px; font-weight: 600; }
.cue-head, .cue-num { user-select: none; -webkit-user-select: none; }
.cue.merge-source { outline: 2px solid var(--accent); }
.cue.merge-target { outline: 2px dashed var(--accent); background: color-mix(in srgb, var(--info-bg) 60%, var(--surface)); }
.tr-item.merge-source { outline: 2px solid var(--accent); }.tr-item.merge-target { outline: 2px dashed var(--accent); }
.cue.sel .cue-num { background: var(--accent); color: var(--accent-ink); }

.ico-m, .pin-btn { display: none; }
.ico-m { align-items: center; justify-content: center; }

.vbar { position: relative; }
.style-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 25; width: min(380px, 100%); max-height: min(70vh, 560px); overflow: auto; box-shadow: var(--shadow), 0 18px 50px rgba(0, 0, 0, .35);
  display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.style-foot { display: flex; justify-content: space-between; gap: 8px; }
.style-panel[hidden] { display: none; }
.style-col h4 { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 6px; }
.style-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 0; font-size: 13px; }
.style-row input[type=color] { width: 36px; height: 26px; padding: 0; border: 1px solid var(--line-strong); border-radius: 6px; background: none; cursor: pointer; }
.style-num { display: flex; align-items: center; gap: 4px; }
.style-num input { width: 58px; }
.style-pos input[type=range] { width: 110px; }
.style-pos span { min-width: 48px; text-align: right; font-size: 12px; }
.style-size input[type=range] { width: 150px; }.style-reset { align-self: flex-start; }
.style-row-playhead { padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
#st-layout-col[hidden] { display: none; }
#st-layout-col { padding-top: 10px; border-top: 1px solid var(--line); }
#st-layout-chars, #st-layout-lines { width: 64px; min-height: 28px; box-sizing: border-box; }
#st-layout-chars { text-align: right; }
.style-layout-chars > label { flex: none; }
.style-chars { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; justify-content: flex-end; }.style-chars input[type=range] { flex: 1 1 110px; width: 110px; min-width: 60px; max-width: 170px; }
.style-chars #st-layout-chars { flex: none; }
.style-layout-act { align-items: flex-start; gap: 12px; padding-top: 6px; }
.style-layout-act .hint { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 12px; line-height: 1.35; color: var(--muted); }
.style-layout-act .btn { flex: none; min-height: 28px; }
.fb-result { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.fb-result .kv { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); }
.fb-result .kv b { color: var(--text); }
.fb-result .path { overflow-wrap: anywhere; }

.tr-menu-wrap { position: relative; display: inline-block; }
.tr-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 260px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.tr-menu[hidden] { display: none; }
.tr-more { right: auto; left: 0; }
.tr-menu-title { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px 2px; }
.tr-menu-note { font-size: 12px; color: var(--muted); padding: 6px 8px; max-width: 300px; }
.tr-menu-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; font-size: 13.5px; cursor: pointer; text-align: left; }
.tr-menu-item:hover:not(:disabled) { background: var(--surface-2); }
.tr-menu-item:disabled { opacity: .5; cursor: default; }
.tr-menu-item.danger { color: var(--bad); }
.tr-status { flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: var(--info-bg); color: var(--accent); font-size: 13.5px; font-weight: 600; }
.tr-status[hidden] { display: none; }
.tr-note { flex-wrap: wrap; font-weight: 400; }.tr-note .tr-status-text { flex: 1 1 260px; }
.tr-progress { flex: 1 1 180px; max-width: 360px; }
.tr-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg-group { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg { border: 0; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; padding: 4px 11px; cursor: pointer; border-right: 1px solid var(--line); }
.seg:last-child { border-right: 0; }
.seg.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.tr-toggles { display: inline-flex; gap: 14px; align-items: center; }
.tr-toggles[hidden] { display: none; }
.tr-row { display: grid; grid-template-columns: 170px 1fr; gap: 4px 12px; align-items: center; }
.tr-row .hint { grid-column: 2; margin-top: -2px; }
.tr-row-label { font-weight: 600; font-size: 13.5px; }
.tr-row textarea { min-height: 70px; font: 13px var(--font-ui); }
.hint.warn { color: var(--warn); }
.pill.warn { background: var(--flag-bg); color: var(--flag-fg); }

.cue-tr { display: flex; flex-direction: column; gap: 6px; }
.tr-src { display: none; font-size: 13px; color: var(--muted); line-height: 1.3; padding: 0 2px; }
.tr-item { border-left: 3px solid var(--tl-tr-edge); background: color-mix(in srgb, var(--tl-tr-block) 22%, var(--surface)); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; gap: 5px; }
.tr-item.sel { box-shadow: 0 0 0 2px color-mix(in srgb, var(--tl-tr-sel) 45%, transparent); }
.tr-item.active .tr-lang { background: var(--tl-tr-sel); color: var(--accent-ink); }.tr-item.bad { border-left-color: var(--bad); }
.tr-lang { font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--tl-tr-sel); min-width: 28px; text-align: center; }
.tr-item textarea { font: inherit; font-size: 15px; width: 100%; resize: none; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--sub-tr-color, var(--tl-tr-text)); overflow: hidden; line-height: 1.35; }
.tr-item textarea:focus-visible { outline: 2px solid var(--tl-tr-sel); outline-offset: 1px; }
.tr-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tr-foot .muted { font-size: 12px; }
.tr-mode-original .cue-tr { display: none; }
.tr-mode-translation .cue > textarea, .tr-mode-translation .cue > .cue-badges, .tr-mode-translation .cue > .cue-head .cue-tools, .tr-mode-translation .cue > .cue-tools, .tr-mode-translation .cue > .cue-head > .cue-badges { display: none; }.tr-mode-translation .tr-src { display: block; }
.tr-mode-translation .cue > .cue-head { opacity: .75; }

.tr-mode-both.tr-wide .cue { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; grid-template-areas: "head tr" "text tr" "badges tr"; align-items: start; }
.tr-mode-both.tr-wide .cue > .cue-head { grid-area: head; }
.tr-mode-both.tr-wide .cue > textarea { grid-area: text; }
.tr-mode-both.tr-wide .cue > .cue-badges { grid-area: badges; }
.tr-mode-both.tr-wide .cue > .cue-tr { grid-area: tr; }
@media (min-width: 701px) and (min-height: 501px), (min-width: 1001px) {  html:not([data-view="simple"]) .tr-mode-both.tr-wide .cue { grid-template-areas: "head tr" "text tr" "tools tools"; grid-template-rows: auto 1fr auto; }  html:not([data-view="simple"]) .tr-mode-both.tr-wide .cue > .cue-tools { grid-area: tools; }
}

.ed-foot { flex: 0 0 auto; display: flex; align-items: baseline; gap: 10px; padding: 2px 14px 6px; color: var(--muted); }
.ed-foot .logo { font-size: 12px; }
.ed-foot .copyright { font-size: 11px; }
.ed-foot .ed-privacy { margin-left: auto; font-size: 11px; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }.ed-foot .ed-privacy:hover { color: var(--text); }
.ed-foot .acct-dot { font-size: 11px; color: var(--muted); }.ed-foot .acct-terms-link { font-size: 11px; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.ed-foot .acct-terms-link:hover { color: var(--text); }
.ed-foot .ed-privacy, .ed-foot .acct-terms-link { display: inline-block; padding: 6.5px 4px; margin-block: -6.5px; }
.ed-foot .acct-terms-link { margin-inline: -4px; }
.ed-foot .ed-privacy { margin-right: -4px; }
body.review-mode #btn-feedback, body.review-mode #btn-reveal { display: none !important; }
.review-toggle { margin-left: 6px; }
.review-toggle a.seg { text-decoration: none; display: inline-flex; align-items: center; }
.btn-ok-on { background: var(--ok-bg); color: var(--ok); border-color: transparent; }

body.editor.portrait { display: grid; grid-template-columns: var(--pv-w, 300px) minmax(0, 1fr); column-gap: 12px;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto; grid-template-areas: "top top" "banner banner" "video cues" "video tl" "foot foot"; }
body.editor.portrait .ed-top { grid-area: top; }
body.editor.portrait #banner { grid-area: banner; }
body.editor.portrait .ed-main { display: contents; }
body.editor.portrait .ed-video { grid-area: video; padding: 8px 0 6px 12px; min-height: 0; overflow: hidden; }
body.editor.portrait .style-panel { top: auto; bottom: calc(100% + 6px); }body.editor.portrait .ed-cues { grid-area: cues; padding: 12px; margin-right: 16px; min-height: 0; }body.editor.portrait .ed-timeline { grid-area: tl; padding-left: 0; padding-right: 12px; }
body.editor.portrait .ed-foot { grid-area: foot; }
body.editor.portrait .prep { grid-column: 1 / -1; grid-row: 3 / 5; position: relative; }
@media (max-height: 820px) {
  .ed-top { padding: 4px 12px; gap: 8px; }
  .ed-top .btn, .ed-top .seg { padding-top: 3px; padding-bottom: 3px; }
  .banner { padding: 4px 12px; font-size: 12.5px; }
  .ed-main { padding-top: 6px; padding-bottom: 4px; }
  .tl-bar { padding-top: 2px; gap: 8px; }
  .tl-bar .btn, .tl-bar .btn-sm { padding: 2px 8px; font-size: 12.5px; }
  .tl-hint { font-size: 11.5px; min-height: 16px; }  .ed-foot { padding: 0 12px 2px; }
  .ed-foot .logo { font-size: 11px; }
  .ed-foot .copyright { font-size: 11px; }
}
@media (min-width: 701px) and (min-height: 501px), (min-width: 1001px) {
  .check, .tl-bar .check { font-size: 12px; }
  .tl-actions .btn-sm { padding: 0 11px; font-size: 12px; }
  .ed-cues .btn-sm, #btn-zoom-fit { font-size: 12px; }
}
@media (min-width: 701px) and (min-height: 501px) and (pointer: fine), (min-width: 1001px) and (pointer: fine) {  .tl-actions .btn-sm, .ed-cues .btn-sm, #btn-zoom-fit { min-height: 30px; }
  .ed-cues .btn-sm:not(.icon-btn), #btn-zoom-fit { padding-top: 0; padding-bottom: 0; }}

body.user-mode #btn-back, body.user-mode #btn-feedback, body.user-mode #btn-diag, body.user-mode #btn-reveal { display: none !important; }
body.guest-mode #btn-back, body.guest-mode #btn-feedback, body.guest-mode #btn-diag, body.guest-mode #btn-reveal, body.guest-mode #prep-actions a[href="/"] { display: none !important; }.user-pop-wrap { position: relative; display: inline-block; } .user-pop-wrap[hidden] { display: none; }.user-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.user-menu { min-width: 220px; padding: 6px; display: flex; flex-direction: column; }
.user-menu-item { text-align: left; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.user-menu-item:hover, .user-menu-item:focus-visible { background: var(--surface-2); }
.user-menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }.user-feedback { width: min(460px, calc(100vw - 32px)); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.user-feedback textarea { width: 100%; resize: vertical; font: inherit; font-size: 14px; line-height: 1.4; }
.user-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.user-feedback-actions { display: flex; justify-content: flex-end; gap: 8px; position: sticky; bottom: -14px; margin: 0 -14px -14px; padding: 10px 14px 14px; background: var(--surface); border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; }.user-feedback { max-height: min(78vh, 720px); overflow-y: auto; }
.fb-attach { gap: 6px; }
.fb-drop { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px; padding: 10px 12px; border: 2px dashed var(--line-strong); border-radius: 12px;
  background: transparent; color: var(--text); font: inherit; font-size: 14px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.fb-drop .mi { flex: none; }
.fb-drop:hover, .user-feedback.fb-over .fb-drop { border-color: var(--accent); background: var(--surface-2); }
.fb-drop:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fb-drop:disabled { opacity: .6; cursor: default; }
.fb-file, .fb-files-note { scroll-margin-bottom: 70px; }.fb-files-note { margin: 0; font-size: 13px; color: var(--warn); overflow-wrap: anywhere; }
.fb-files-note[hidden], .fb-files-sum[hidden] { display: none; }
.fb-files-sum { margin: 0; }
.fb-files-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fb-files-list:empty { display: none; }
.fb-file { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px 4px 4px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.fb-thumb, .fb-badge { flex: none; width: 40px; height: 40px; border-radius: 8px; }
.fb-thumb { object-fit: cover; background: var(--video, #000); }
.fb-badge { display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--muted); border: 1px solid var(--line-strong); }
.fb-file-name { flex: 1 1 auto; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-file-size { flex: none; font-size: 12px; }
.fb-file-x { flex: none; width: 32px; padding: 0; color: var(--muted); }
.fb-file-x:hover:not(:disabled) { color: var(--danger); }
.fb-file-x .mi { width: 16px; height: 16px; }
.user-link { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.user-link-row { display: flex; gap: 8px; }
.user-link-row .input { flex: 1 1 auto; min-width: 0; }
.user-pop[hidden], .user-link[hidden] { display: none; }

.tr-menu-more { padding: 4px 6px 2px; }
.tr-more-langs { width: 100%; }
.tr-untested { color: var(--warn); }

.tr-from { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.tr-from-lang { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }

@media (pointer: coarse) {
  .btn-sm, .seg { min-height: 32px; }
  .cue-tools .btn { min-height: 30px; }
}

.cue-tools .tools-for { display: none; }.cue-tools .merge-two { display: none; }@media (max-width: 700px), (max-height: 500px) and (max-width: 1000px) {
  .cue-tools .merge-two { display: inline-flex; }  .merge-menu-wrap { display: none !important; }  body.editor { height: auto; overflow: visible; }
  html { scroll-padding-top: calc(var(--pin-h, 0px) + 8px); }
  .ed-top { padding: 8px 10px 6px; gap: 6px; }
  .ed-title { flex: 1 1 100%; }
  .ed-actions { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .ed-actions::-webkit-scrollbar { display: none; }
  .ed-actions > * { flex: none; }
  .ed-actions .btn { min-height: 34px; }
  .tr-menu, .user-pop { position: fixed; left: 8px; right: 8px; top: auto; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); width: auto; min-width: 0;
    max-height: 70vh; overflow-y: auto; z-index: 80; box-shadow: 0 -8px 40px rgba(0, 0, 0, .6); }
  .tr-menu-item, .user-menu-item { padding: 12px 12px; font-size: 16px; }
  .ed-main { display: contents; }
  .ed-video, .ed-cues { margin: 0 10px; }
  .ed-video { margin-top: 6px; }
  .ed-cues { margin-top: 6px; }
  .prep { position: fixed; z-index: 40; }  .ed-video { gap: 4px; background: var(--bg); }
  body.pin-video .ed-video { position: sticky; top: 0; z-index: 15; padding: 6px 0 4px; margin-top: -6px; box-shadow: 0 10px 12px -12px rgba(0, 0, 0, .9); }
  .vbox { height: clamp(150px, 36svh, 420px); min-height: 0; flex: none; border-radius: 10px; }
  body.typing .vbox { height: clamp(110px, 22svh, 260px); }
  .vbar { gap: 4px; }
  .vrow { gap: 4px; }
  .vrow .btn { min-height: 34px; padding-left: 9px; padding-right: 9px; }
  .vrow .icon-btn { width: 34px; padding: 0; }
  .vsep { display: none; }
  .pin-btn { display: inline-flex; }
  body.pin-video .pin-btn { color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); }
  #rate { width: 60px; min-height: 34px; margin-left: auto; font-size: 16px; padding: 2px 4px; }
  body.review-mode #btn-settings { margin-left: auto; }  body.review-mode #rate { margin-left: 0; }
  .seek { height: 26px; }
  .style-panel { max-height: 45svh; overflow-y: auto; }
  #st-layout-chars, #st-layout-lines { font-size: 16px; min-height: 36px; }  .style-layout-act .btn { min-height: 36px; }
  .style-chars input[type=range] { max-width: none; }
  #st-layout-col { order: -1; padding-top: 0; padding-bottom: 10px; border-top: 0; border-bottom: 1px solid var(--line); }
  .style-foot { position: sticky; bottom: 0; margin-top: auto; padding: 8px 0 12px; margin-bottom: -12px; background: var(--panel); border-top: 1px solid var(--line); }
  .style-foot .btn { min-height: 36px; }
  .style-size { flex: 1 1 auto; min-width: 0; }
  .style-size input[type=range] { flex: 1 1 auto; width: auto; min-width: 0; }  .cues-head { padding: 4px 0 6px; gap: 8px; flex-wrap: nowrap; }
  .cues-head h2 { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .cues-head .check { white-space: nowrap; }
  .lbl-long, .lbl-d { display: none; }
  .ico-m { display: inline-flex; }
  .cue-list { max-height: none; overflow: visible; padding: 2px 0 16px; }
  .cue, .tr-item { scroll-margin-bottom: 16px; }  .cue { padding: 8px; gap: 6px; }
  .cue-head { row-gap: 6px; }
  .tin { width: 106px; font-size: 16px; padding: 4px 6px; }
  .cue-tools { flex: 1 1 100%; order: 10; justify-content: space-between; gap: 4px; }
  .cue-tools .btn { flex: 1 1 0; min-width: 0; max-width: 56px; min-height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
  .cue:not(.sel) > .cue-head .cue-tools, .tr-item:not(.sel) > .cue-head .cue-tools { display: none; }
  .cue textarea, .tr-item textarea, .ed-cues input, .modal input, .modal select, .modal textarea, .user-pop textarea, .user-pop input { font-size: 16px; }
  .tl-bar { gap: 8px 12px; }
  .modal { padding: 10px; align-items: flex-end; }
  .modal-card { padding: 16px; border-radius: 16px; max-height: 86svh; }
  .tr-row { grid-template-columns: 1fr; }
  .tr-row .hint { grid-column: 1; }
  .modal .actions .btn { min-height: 40px; }
}
#st-tr-col[hidden] { display: none; }
html[data-view="simple"] .adv-only, html[data-view="simple"] .in-menu { display: none !important; }
html:not([data-view="simple"]) .simple-only { display: none !important; }
html[data-view="simple"] body.review-mode #btn-settings { display: inline-flex !important; }
.seg-group { border-radius: var(--radius-pill); background: var(--chip); border: 0; padding: 3px; gap: 2px; }
.seg { border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--muted); font-weight: 600; }
.seg.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.view-switch { flex-shrink: 0; }
.btn .mi.v2 { width: 16px; height: 16px; flex-shrink: 0; }
.more-wrap { position: relative; display: inline-flex; }
.more-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 240px; display: flex; flex-direction: column; gap: 2px;
  padding: 8px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0,0,0,.35); }
.more-menu button { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border: 0; border-radius: 12px; background: transparent;
  color: var(--ink); font: inherit; font-weight: 500; font-size: 14px; text-align: left; cursor: pointer; }
@media (min-width: 701px) and (min-height: 501px), (min-width: 1001px) { .more-menu button { font-weight: 600; font-size: 13px; } }.more-menu button:hover { background: var(--panel-2); }
.lbl-d .mi.v2 { width: 15px; height: 15px; }
:where(.lbl-d) { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.merge-menu { min-width: 270px; right: auto; left: 0; }
.more-menu button { white-space: nowrap; }
.cue:not(.sel) .cue-tools, .cue:not(.sel) .tr-foot, .cue:not(.sel) .cue-badges { display: none; }
.cue:not(.sel) { padding: 6px 12px; gap: 3px; }
.cue:not(.sel) .tin { border-color: transparent; background: transparent; padding-left: 0; padding-right: 0; }
.cue.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cue { border-radius: 18px; background: var(--panel); }
.cue.sel .cue-num, .cue.active .cue-num { background: var(--accent); color: var(--accent-ink); }
.cue-num { border-radius: 8px; font-family: var(--font-mono); font-weight: 600; }
.tin { font-family: var(--font-mono); border-radius: 10px; }
.cue textarea { border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line-strong); font-family: var(--font-ui); }
html[data-view="simple"] .tr-mode-both.tr-wide .cue { display: flex; flex-direction: column; align-items: stretch; }html[data-view="simple"] .tin { border-color: transparent; background: transparent; padding-left: 0; padding-right: 0; pointer-events: none; }
html[data-view="simple"] .lbl-retr { display: none; }

@media (max-width: 700px) {
  .cues-head { flex-wrap: wrap; row-gap: 6px; }
  .cues-head h2 { flex: 1 1 auto; }
  #btn-add .lbl-long { display: none; }
  .view-switch, .theme-swatches { flex-shrink: 0; }
}

body.problems-only .cue .cue-badges { display: flex !important; }
html[data-view="simple"] .tin { border-color: transparent; background: transparent; padding-left: 0; padding-right: 0; cursor: default; }

.ed-timeline { container: timeline / inline-size; }
.tl-tools { display: contents; }
@container timeline (max-width: 1180px) {
  .tl-bar .vsep { display: none; }
  .tl-tools { display: flex; align-items: center; gap: 8px; flex: 1 1 100%; }
  .tl-tools .job-spacer { flex: 1; }
}

@media (max-width: 1340px) and (min-width: 701px) {
  .ed-actions .btn:not(.btn-primary):not(.icon-btn):not(.seg):not(#btn-review-done) { font-size: 0; gap: 0; padding-left: 10px; padding-right: 10px; }
  .ed-actions .btn:not(.btn-primary) .mi, .ed-actions .btn:not(.btn-primary) svg { width: 16px; height: 16px; }
  .ed-title { flex: 1 1 120px; }
}

@media (min-width: 701px) { .vbox { flex: 0 0 auto; } }body.editor.portrait .ed-video { overflow: visible; }body.editor.portrait .style-panel { top: auto; bottom: 0; left: calc(100% + 12px); right: auto; }#cue-count { display: inline-block; min-width: 9ch; }@container timeline (max-width: 720px) {  .tl-actions .btn { font-size: 0; gap: 0; padding: 0 9px; min-height: 32px; }
  .tl-actions .btn svg { width: 16px; height: 16px; }
  .tl-bar .check { font-size: 12px; gap: 5px; }
  .tl-bar input[type="range"] { width: 80px; }
}
@media (max-width: 1000px) and (min-width: 701px) {  html:not([data-view="simple"]) #btn-reveal, html:not([data-view="simple"]) #btn-feedback, html:not([data-view="simple"]) #btn-diag { display: none !important; }
}
@media (max-width: 900px) and (min-width: 701px) { #btn-back .lbl-d { display: none; } #btn-back { padding-left: 10px; padding-right: 10px; } body.editor .ed-top { gap: 6px; } .ed-actions { gap: 4px; } .ed-title { flex-basis: 80px; } }
@media (max-width: 860px) and (min-width: 701px) { #btn-checked { display: none !important; } }@media (max-width: 700px) { #btn-prev-frame, #btn-next-frame { display: none !important; } }.tl-switches { display: contents; }
@container timeline (max-width: 720px) {
  .tl-switches { display: flex; flex-wrap: wrap; gap: 4px 10px; flex: 1 1 100%; }
  .tl-switches .check { flex: none; white-space: nowrap; }
}
#btn-add[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }

@media (max-width: 1000px), (pointer: coarse) and (max-width: 1340px) {
  #btn-user-native, #btn-user-download, #btn-user-feedback { visibility: hidden; width: 0; min-width: 0; padding: 0 !important; margin: 0; border: 0; overflow: hidden; box-shadow: none; }}
@media (min-width: 701px) and (min-height: 501px), (min-width: 1001px) {  .user-pop-wrap .user-pop { top: calc(100% + 13px); }}

@media (max-width: 700px) {
  .ed-title { flex: 1 1 70%; min-width: 0; }
  .ed-actions { flex-wrap: wrap; overflow: visible; row-gap: 6px; }
  .ed-actions .btn:not(.btn-primary):not(.icon-btn):not(#btn-review-done) { font-size: 0; gap: 0; padding-left: 10px; padding-right: 10px; }
  #btn-checked, #btn-reveal, #btn-feedback, #btn-diag, #btn-help { display: none !important; }  .ed-top .seg-group .seg { min-height: 34px; height: 34px; }  .review-toggle { margin-left: 0; }
  .review-toggle .seg { white-space: nowrap; }
}
@media (max-width: 700px), (max-height: 500px) and (max-width: 1000px) {
  #more-menu { position: fixed; left: 8px; right: 8px; top: auto; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); min-width: 0; max-height: 70vh; overflow-y: auto; z-index: 80; box-shadow: 0 -8px 40px rgba(0, 0, 0, .6); }
  #more-menu button { height: 44px; font-size: 16px; }
}

@media (max-width: 700px) {
  .vbox { height: auto; aspect-ratio: var(--film-ar, 16 / 9); max-height: 36svh; min-height: 0; }
  body.film-vertical .vbox { max-height: 48svh; }
}
@media (max-width: 410px) {
  body.film-vertical .vrow { gap: 4px; }
  body.film-vertical .vrow .icon-btn { width: 34px; height: 34px; min-height: 34px; }
}

.cue-head { container: cuehead / inline-size; }
@container cuehead (max-width: 460px) {
  .cue-tools .lbl-d { font-size: 0; gap: 0; }
  .cue-tools .merge-menu-wrap > .btn { font-size: 0; gap: 2px; }
}
@media (min-width: 701px) and (min-height: 501px), (min-width: 1001px) {  @container cuehead (max-width: 460px) { .cue-tools .btn { padding-left: 9px; padding-right: 9px; } }
}

body.tl-collapsed .ed-timeline > :not(.tl-bar), body.tl-collapsed .tl-bar > :not(.tl-toggle) { display: none !important; }
body.tl-collapsed .ed-timeline { padding-bottom: 6px; }
body.tl-collapsed .tl-bar { min-height: 44px; border-bottom: 0; }.tl-toggle svg { transition: transform .15s; }
body.tl-collapsed .tl-toggle svg { transform: rotate(180deg); }

.btn.is-unavailable { opacity: .6; }
#more-menu button[aria-disabled="true"] { opacity: .6; }

.modal-head { position: sticky; top: -20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); padding-top: 4px; z-index: 1; }
.modal-head h2 { margin: 0; }
.modal-card.modal-wide { width: min(920px, 100%); max-width: 100%; }
.modal-card.modal-films { width: min(1120px, 100%); }#btn-user-films { flex: none; }
#user-minutes { flex: none; display: inline-flex; align-items: center; white-space: nowrap; cursor: pointer; border: 0; font-family: var(--font-ui); font-weight: 600; font-size: 11.5px; line-height: 16px; padding: 4px 9px; }#user-minutes[hidden] { display: none; }
#user-minutes .mins-n { display: none; }
@media (max-width: 1659px) { #user-minutes .mins-w { display: none; } #user-minutes .mins-n { display: inline; } }
@media (max-width: 1659px) and (min-width: 1341px) { body:is(.user-mode, .uploaded-film) .ed-title { flex-basis: 100px; } }
@media (max-width: 1419px) and (min-width: 1341px) { #btn-user-films .lbl-d { display: none; } #btn-user-films { padding-left: 10px; padding-right: 10px; } }
@media (max-width: 960px) and (min-width: 701px) { #btn-user-films .lbl-d { display: none; } #btn-user-films { padding-left: 10px; padding-right: 10px; } body:is(.user-mode, .uploaded-film) .ed-title { flex-basis: 40px; } }
@media (max-width: 700px) { body:is(.user-mode, .uploaded-film) .ed-title { flex: 1 1 110px; } }.keys-cols { column-width: 400px; column-gap: 28px; }
.keys-group { break-inside: avoid; margin-bottom: 12px; }.keys > span { break-inside: avoid; }
.keys-group h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 6px; }
.keys kbd svg { width: 14px; height: 14px; vertical-align: -2px; }

@media (max-width: 1340px) {
  .ed-actions .user-feedback .btn:not(.btn-primary):not(.icon-btn):not(.seg):not(.fb-file-x):not(#btn-review-done) { font-size: 13px; gap: 6px; padding-left: 12px; padding-right: 12px; }
  .ed-actions .user-feedback .btn.fb-file-x:not(.btn-primary):not(.icon-btn):not(.seg):not(#btn-review-done) { padding-left: 0; padding-right: 0; }
}
.sub-line.social-covered { width: fit-content; margin-left: auto; margin-right: auto; outline: 2px dashed #ff453a; outline-offset: 3px; }
body.editor.portrait .social-menu { top: auto; bottom: 0; left: calc(100% + 12px); right: auto; }@media (max-width: 700px), (max-height: 500px) and (max-width: 1000px) {
  body.editor.portrait .social-menu { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
}
.srt-tip { position: fixed; left: 0; top: 0; z-index: 60; width: max-content; max-width: min(280px, calc(100vw - 16px)); padding: 6px 10px; border-radius: 8px; background: var(--ink); color: var(--bg); font: 600 12.5px/1.35 var(--font-ui); box-shadow: 0 4px 14px rgba(0, 0, 0, .28); pointer-events: none; }
