/* Caption review: cut.css supplies the shell (header, list, stage, player bar,
   timeline frame, dialogs, themes); this file only adds what captions need. */
:root{--hand-r:#72a9ff;--hand-l:#91d69b;--both:#c9a2ff;--ego:#ffcf6b;--edited:#72a9ff}
:root[data-theme="light"]{--hand-r:#2f6fd6;--hand-l:#2e8a43;--both:#7d4fc4;--ego:#a86b00;--edited:#2f6fd6}
#videoSearch,#statusFilter{width:100%;margin-bottom:10px}
.cap-filters{display:flex;gap:6px;margin-bottom:10px}.cap-filters select{flex:1;min-width:0}
/* Recordings list and title row: status pill + a thin review-progress bar. */
.queue-item.cap-q{padding:10px 11px}
.q-top{display:flex;align-items:flex-start;gap:8px}
.q-top b{flex:1;min-width:0;margin:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.q-status{flex:none;font:10.5px ui-monospace,monospace;border:1px solid var(--line);border-radius:99px;padding:1px 7px;color:var(--muted)}
.q-status.qc{color:var(--good);border-color:var(--good)}
.q-bar{display:block;height:4px;margin:8px 0 5px;border-radius:99px;background:var(--line);overflow:hidden}
.q-bar i{display:block;height:100%;border-radius:99px;background:var(--good)}
.queue-item .q-bar+small{font-size:11.5px}
.title-line .q-status{align-self:center}
.cap-meta{display:flex;align-items:center;gap:10px;font-size:12.5px;margin-top:4px}
.cap-meta .q-bar{width:180px;margin:0}
/* The rail is short, so its key chips stay at any width (/cut hides them on a narrow dock); touch still drops them. */
@media (pointer:fine){html[lang] body:not(.timeline-vertical) .worker-rail button[data-key]::after{display:inline}}

/* Seek bar on the video (YouTube-style): a plain track, buffered lighter, played white. */
.player-bar .seek-bar{position:relative;flex:1 0 100%;height:14px;display:flex;align-items:center;cursor:pointer;touch-action:none;--t:0;--buf:0}
.seek-track{position:relative;flex:1;height:4px;background:#ffffff38;transition:height .1s}
.seek-bar:hover .seek-track{height:7px}
.seek-track i{position:absolute;top:0;bottom:0;left:0}
.seek-buf{width:calc(var(--buf) * 100%);background:#ffffff55}
.seek-played{width:calc(var(--t) * 100%);background:#fff}
.seek-thumb{position:absolute;left:calc(var(--t) * 100%);width:13px;height:13px;margin-left:-6.5px;border-radius:50%;background:#fff;transform:scale(0);transition:transform .1s;pointer-events:none}
.seek-bar:hover .seek-thumb{transform:scale(1)}
.seek-tip{position:absolute;bottom:18px;transform:translateX(-50%);padding:2px 7px;border-radius:5px;background:#000c;color:#fff;
  font:11.5px ui-monospace,monospace;white-space:nowrap;pointer-events:none;opacity:0}
.seek-bar:hover .seek-tip{opacity:1}
/* Subtitle-style overlay, above the player bar, never intercepting clicks. */
.cap-overlay{position:absolute;left:50%;bottom:84px;transform:translateX(-50%);z-index:3;max-width:min(92%,900px);
  padding:8px 14px 10px;border-radius:10px;background:#000000b8;color:#fff;text-align:center;pointer-events:none;
  font-size:clamp(14px,1.6vw,20px);line-height:1.35}
.cap-overlay-label{font:11px ui-monospace,monospace;color:#cfcfc6;margin-bottom:3px}
.cap-line{display:block}.cap-line+.cap-line{margin-top:2px}
.cap-tag{display:inline-block;font:600 .7em ui-monospace,monospace;padding:1px 6px;margin-right:7px;border-radius:5px;
  vertical-align:.12em;color:#111;background:var(--ego)}
.cap-tag.right{background:var(--hand-r)}.cap-tag.left{background:var(--hand-l)}.cap-tag.both{background:var(--both)}
.cap-overlay .cap-tag.right{background:#72a9ff}.cap-overlay .cap-tag.left{background:#91d69b}.cap-overlay .cap-tag.both{background:#c9a2ff}.cap-overlay .cap-tag{background:#ffcf6b}

/* Right panel: one card per segment; the one under the playhead is outlined.
   Panel widths come from dragging their edges (caption.js edgeResize). */
@media (min-width:851px){#listPanel{width:var(--list-w,310px)}}
@media (min-width:901px){#sidePanel{width:var(--side-w,400px);min-width:260px;max-width:55vw;resize:none}}
.cap-list{display:grid;gap:6px}
.cap-card{border:1px solid var(--line);border-radius:10px;padding:7px 10px;display:grid;gap:5px;background:var(--panel)}
.cap-card.on{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.cap-head{display:flex;align-items:center;gap:8px;font:12px ui-monospace,monospace;color:var(--muted);cursor:pointer;
  background:none;border:0;padding:0;text-align:left}
.cap-head b{color:var(--fg)}
.cap-card:not(.on){opacity:.72}.cap-card:not(.on):hover,.cap-card:focus-within{opacity:1}
.cap-flags{font-size:11.5px;color:var(--warn,#d9a03a)}
/* One row per line: tag dropdown, text (double-click to edit), × on hover. */
.cap-lines{display:grid;gap:3px;font-size:14.5px;line-height:1.45}
.cap-card .cap-line{display:flex;align-items:baseline;gap:6px}
/* Tag chip is a button; colours restated because cut.css's themed button background would win. */
.cap-card button.cap-tag{flex:none;box-sizing:content-box;width:10ch;border:0;margin:0;padding:1px 6px;border-radius:5px;
  cursor:pointer;color:#111;text-align:center}
.cap-card button.cap-tag:hover{filter:brightness(1.12)}
.cap-card button.cap-tag,.tag-menu .cap-tag{background:var(--ego)}
.cap-card button.cap-tag.right,.tag-menu .cap-tag.right{background:var(--hand-r)}
.cap-card button.cap-tag.left,.tag-menu .cap-tag.left{background:var(--hand-l)}
.cap-card button.cap-tag.both,.tag-menu .cap-tag.both{background:var(--both)}
.cap-card button.cap-tag.none{background:var(--panel2);color:var(--muted);outline:1px dashed var(--line)}
:root[data-theme="light"] .cap-card button.cap-tag:not(.none),:root[data-theme="light"] .tag-menu .cap-tag{color:#fff}
/* The picker: a small floating card of chips; the current one is ticked. */
.tag-menu{position:fixed;z-index:50;display:grid;gap:2px;padding:5px;min-width:150px;border:1px solid var(--line);
  border-radius:10px;background:var(--panel);box-shadow:0 10px 28px #0005}
.tag-menu button[data-pick]{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0;padding:6px 8px;
  border:0;border-radius:7px;background:none;color:var(--accent);text-align:left;cursor:pointer}
.tag-menu button[data-pick]:hover,.tag-menu button[data-pick]:focus-visible{background:var(--panel2);outline:none}
.tag-menu .cap-tag{box-sizing:content-box;width:10ch;margin:0;text-align:center}
.cap-text{flex:1;min-width:0;border-radius:4px;padding:0 2px;cursor:text;overflow-wrap:anywhere}
.cap-text[contenteditable]{outline:1px solid var(--accent);background:var(--panel2)}
/* Editing: the tag chips light up, since a click on one changes whose action it is. */
.cap-card:has(.cap-text[contenteditable]) button.cap-tag{box-shadow:0 0 0 2px var(--panel),0 0 0 4px var(--accent);animation:tag-glow 1.1s ease-in-out 2}
@keyframes tag-glow{50%{box-shadow:0 0 0 2px var(--panel),0 0 0 4px var(--accent),0 0 14px 2px var(--accent)}}
@media (prefers-reduced-motion:reduce){.cap-card:has(.cap-text[contenteditable]) button.cap-tag{animation:none}}
.line-del{flex:none;visibility:hidden;border:0;background:none;padding:0 4px;color:var(--muted);font-size:15px;line-height:1}
.line-del:hover{color:var(--bad)}.cap-line:hover .line-del{visibility:visible}@media (pointer:coarse){.line-del{visibility:visible}}
/* Edit and Flag only on the card under the pointer (or holding focus). */
.cap-card:not(:hover):not(:focus-within) .cap-acts{display:none}
/* While a line is being edited: "+ line", Cancel edit and Done instead (Enter / Esc on a keyboard). */
.cap-acts .add-line,.cap-acts .edit-done,.cap-acts .edit-cancel{display:none}
.cap-card:focus-within .cap-acts .add-line,.cap-card:has(.cap-text[contenteditable]) .cap-acts :is(.edit-done,.edit-cancel){display:inline-block}
.cap-card:has(.cap-text[contenteditable]) .cap-acts :is(.edit-start,[data-qc]){display:none}
.cap-acts{display:flex;justify-content:flex-end;gap:5px;flex-wrap:wrap}.cap-acts button{padding:4px 10px;font-size:12.5px}
.cap-acts .add-line{margin-right:auto}
.cap-flag-note{color:var(--bad);font-size:12.5px;white-space:pre-wrap;overflow-wrap:anywhere}
.qc-pill{margin-left:auto;border:1px solid var(--line);border-radius:99px;padding:1px 8px;font-size:11px}
.qc-pill.approved{color:var(--good);border-color:var(--good)}.qc-pill.edited{color:var(--edited);border-color:var(--edited)}
.qc-pill.rejected{color:var(--bad);border-color:var(--bad)}

/* Timeline: ruler + one lane of caption blocks, width = segment length. */
.cap-timeline{--tl-h:88px}.cap-timeline .timeline-content{cursor:pointer}
.title-row .actions button[aria-pressed="true"]{border-color:var(--accent);color:var(--accent)}
.cap-lane{position:absolute;left:0;right:0;top:30px;bottom:4px}
.cap-block{position:absolute;top:0;bottom:0;border-left:1px solid #0006;border-radius:3px;background:var(--task,#4f7cc4);
  overflow:hidden;padding:3px 4px;font:600 11px ui-monospace,monospace;color:#fff;text-shadow:0 1px 2px #0009;white-space:nowrap}
/* QC status rides as a bar along the bottom; unreviewed has none. */
.cap-block::after{content:"";position:absolute;left:0;right:0;bottom:0;height:5px}
.cap-block.approved::after{background:#3fbf5a}.cap-block.edited::after{background:#3d8bff}.cap-block.rejected::after{background:#ff4d3d}
.cap-block.missing{background:repeating-linear-gradient(135deg,var(--task,#4f7cc4) 0,var(--task,#4f7cc4) 5px,#0005 5px,#0005 10px)}
.cap-block.on{box-shadow:inset 0 0 0 2px #fff,0 0 0 1px var(--accent)}
/* Hand pose: the render's 2D panel replaces the stage picture, its 3D panel sits picture-in-picture. */
#video.pose-src{opacity:0}
.pose-main{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none;z-index:1}
.pose-pip{position:absolute;top:10px;right:10px;z-index:4;width:24%;min-width:140px;max-width:70%;resize:horizontal;overflow:hidden;
  direction:rtl;border:1px solid #fff5;border-radius:8px;background:#000;box-shadow:0 4px 16px #0008}
.pose-pip canvas{display:block;width:100%;height:auto}
.video-wrap>.buffer-chip{left:10px;right:auto}
#sendBackNote{width:100%;border:1px solid var(--line);border-radius:8px;background:var(--panel2);color:var(--fg);padding:8px;font:inherit}
@media (max-width:900px){.stage{flex-direction:column}.side-panel{width:auto;max-width:none;max-height:45vh}}
/* Send-back dialog: two destinations as selectable cards. */
#sendBackDialog{max-width:520px}
.send-choices{display:grid;gap:8px;margin:10px 0 14px}
.send-choice{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border:1px solid var(--line);border-radius:10px;cursor:pointer}
.send-choice:has(input:checked){border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.send-choice input{margin-top:3px;accent-color:var(--accent)}
.send-choice b{display:block;margin-bottom:2px}.send-choice small{color:var(--muted);line-height:1.4}

/* Phones (cut.css has the shared layout): the card actions always show on touch; the recording's decisions
   are the bottom bar; the timeline scrolls with the cards; the 3D picture-in-picture has a fixed size. */
@media (pointer:coarse){
  .cap-card:not(:hover):not(:focus-within) .cap-acts{display:flex}.cap-acts button{min-height:40px;padding:6px 12px}
  .cap-text[contenteditable]{font-size:16px}
}
@media (max-width:850px){
  .side-panel{max-height:none}
  main{padding-bottom:calc(76px + env(safe-area-inset-bottom))}
  /* scrollIntoView keeps the playing card clear of the sticky video and the fixed bar. */
  .cap-card{scroll-margin:calc(var(--pv-h) + 8px) 0 calc(76px + env(safe-area-inset-bottom))}
  .cut-dock{position:static}
  .title-row .actions{position:fixed;left:0;right:0;bottom:0;z-index:30;margin:0;padding:8px 10px calc(8px + env(safe-area-inset-bottom));
    background:var(--panel);border-top:1px solid var(--line);flex-wrap:wrap;white-space:normal;overflow:visible}
  .title-row .actions:not(:has(>:not(.hidden))){display:none}
  .title-row .actions button{flex:1 1 auto;min-height:44px;font-size:15px;white-space:normal}
  .pose-pip{width:38%;min-width:0;resize:none}
}
@media (max-width:600px){header h1{display:none}}
@media (max-width:480px){#time,#qualitySelect{display:none}}
