/* Subtitle editor side panel (js/subtitle-editor.js). The host element gets
   .subs-open; the panel is absolutely positioned inside it, like the voice tab. */
.sub-panel { position: absolute; top: 0; right: 0; bottom: 0; width: 440px; z-index: 8;
    display: flex; flex-direction: column; background: var(--bg-secondary);
    border-left: 1px solid var(--border); transform: translateX(100%);
    transition: transform 0.2s ease; }
.subs-open .sub-panel { transform: translateX(0); box-shadow: -8px 0 24px rgba(0,0,0,0.12); }
@media (min-width: 769px) { .subs-open .chat-container { margin-right: 440px; } }
@media (max-width: 768px) { .sub-panel { width: 100%; } }

.sub-panel button { font-family: inherit; }
.sub-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px;
    border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sub-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sub-title b { font-size: 14px; }
.sub-file { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-close { background: none; border: none; color: var(--text-secondary); font-size: 16px; cursor: pointer; padding: 4px 6px; }

.sub-stage { flex-shrink: 0; display: flex; justify-content: center; background: #000; }
.sub-frame { position: relative; line-height: 0; }
.sub-frame video { display: block; max-width: 100%; max-height: 42vh; cursor: pointer; }
.sub-overlay { position: absolute; left: 5%; right: 5%; bottom: 15%; text-align: center;
    pointer-events: none; line-height: 1.448; }  /* one ASS line = its size (see ASS_EM) */
/* white-space: pre on purpose: the burn (ASS WrapStyle 2) never auto-wraps, it
   only breaks where she typed a 2nd line, so a line too long for the frame
   should look too long here too. */
.sub-overlay { left: 0; right: 0; overflow: visible; }
/* two languages: the second sits on its own line above the first, like the burn */
.sub-overlay { display: flex; flex-direction: column; align-items: center; }
.sub-overlay span:empty { display: none; }
.sub-overlay span { color: #fff; font-weight: 700; white-space: pre;
    font-family: "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", Inter, sans-serif;
    -webkit-text-stroke: 0.2em rgba(0,0,0,0.85); paint-order: stroke fill;
    text-shadow: 0 0.04em 0.08em rgba(0,0,0,0.6); }

.sub-transport { flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 8px 16px;
    border-bottom: 1px solid var(--border); }
.sub-play { width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--accent);
    color: #fff; cursor: pointer; flex-shrink: 0; }
.sub-scrub { flex: 1; accent-color: var(--accent); }
.sub-clock { font-size: 11px; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }

.sub-tools { flex-shrink: 0; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px 4px; }
.sub-tools button, .sub-tools select, .sub-actions button, .sub-seg button {
    min-height: 32px; padding: 0 10px; border-radius: 8px; font-size: 12px; cursor: pointer;
    border: 1px solid var(--border); background: var(--bg-primary); color: var(--text-primary);
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.sub-tools button:hover, .sub-actions button:hover, .sub-seg button:hover { border-color: var(--accent); }
.sub-panel button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.sub-panel button:disabled { opacity: 0.55; cursor: default; }

.sub-replace { flex-shrink: 0; display: flex; gap: 6px; padding: 6px 16px 0; }
.sub-replace[hidden] { display: none; }
.sub-replace input { flex: 1; min-width: 0; min-height: 32px; padding: 0 8px; border-radius: 8px; font-size: 12px;
    border: 1px solid var(--border); background: var(--bg-primary); color: var(--text-primary); outline: none; }
.sub-replace input:focus { border-color: var(--accent); }
.sub-replace button { min-height: 32px; padding: 0 10px; border-radius: 8px; font-size: 12px; cursor: pointer;
    border: 1px solid var(--accent); background: var(--accent); color: #fff; white-space: nowrap; }

.sub-status { flex-shrink: 0; font-size: 12px; color: var(--text-secondary); padding: 2px 16px 6px; min-height: 18px; }
.sub-status.ok { color: #2e9e5b; }
.sub-status.error { color: var(--danger); }

.sub-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.sub-empty { margin: auto; text-align: center; color: var(--text-muted); font-size: 13px; line-height: 1.6; padding: 24px; }
.sub-empty i { font-size: 28px; margin-bottom: 8px; }
.sub-row { border: 1px solid var(--border); border-radius: 10px; padding: 6px 8px 4px; background: var(--bg-primary);
    cursor: pointer; transition: border-color 0.12s; }
.sub-row.active { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.sub-row-top { display: flex; align-items: center; gap: 3px; }
.sub-idx { font-size: 10px; color: var(--text-muted); width: 18px; text-align: right; margin-right: 3px; }
.sub-t { width: 58px; padding: 3px 4px; border: 1px solid transparent; border-radius: 6px; background: transparent;
    color: var(--text-secondary); font-size: 12px; font-variant-numeric: tabular-nums; text-align: center; }
.sub-t:hover, .sub-t:focus { border-color: var(--border); outline: none; color: var(--text-primary); }
.sub-t.bad { border-color: var(--danger); }
.sub-arrow { font-size: 11px; color: var(--text-muted); }
.sub-row-tools { margin-left: auto; display: flex; gap: 2px; }
.sub-ico { background: none; border: none; color: var(--text-muted); font-size: 11px; padding: 4px 5px; border-radius: 6px; cursor: pointer; }
.sub-ico:hover { color: var(--accent); background: var(--bg-secondary); }
.sub-row-tools .sub-ico[data-act="del"]:hover { color: var(--danger); }
.sub-baked-row { cursor: pointer; }
.sub-baked-row input { accent-color: var(--accent); }
.sub-style-row[hidden] { display: none; }
.sub-tools button[hidden] { display: none; }
.sub-text { width: 100%; box-sizing: border-box; resize: none; overflow: hidden; border: none; background: transparent; color: var(--text-primary);
    font-size: 14px; line-height: 1.45; padding: 2px 4px 4px 24px; font-family: inherit; outline: none; }

/* the second language sits above line 1, as it does in the burn */
.sub-text2 { color: var(--text-secondary); font-size: 13px; border-bottom: 1px dashed var(--border); padding-bottom: 5px; }
.sub-text2:focus { color: var(--text-primary); border-bottom-color: var(--accent); }

.sub-style { flex-shrink: 0; display: flex; gap: 14px; align-items: center; padding: 8px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.sub-style-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.sub-style-row input[type=range] { width: 110px; accent-color: var(--accent); }
.sub-seg { display: inline-flex; }
.sub-seg button { border-radius: 0; min-width: 32px; margin-left: -1px; }
.sub-seg button:first-child { border-radius: 8px 0 0 8px; }
.sub-seg button:last-child { border-radius: 0 8px 8px 0; }
.sub-seg button.on { background: var(--accent); border-color: var(--accent); color: #fff; position: relative; }

.sub-actions { flex-shrink: 0; display: flex; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--border); }
.sub-actions .sub-burn { flex: 1; min-height: 38px; font-size: 13px; }
.sub-actions .sub-download { min-height: 38px; }

/* In-chat entry point under each video */
.sub-edit-btn { margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
    font-size: 12px; border-radius: 8px; cursor: pointer; border: 1px solid var(--border);
    background: var(--bg-secondary); color: var(--text-primary); }
.sub-edit-btn:hover { border-color: var(--accent); color: var(--accent); }

/* A Burn request in the transcript: what she asked for, not the agent's instruction. */
.sub-request-card { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px;
    background: var(--accent); color: #fff; max-width: 100%; }
.sub-request-card i { font-size: 18px; }
.sub-request-card div { display: flex; flex-direction: column; min-width: 0; }
.sub-request-card b { font-size: 13px; }
.sub-request-card span { font-size: 12px; opacity: 0.9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
