/* Add Text & Watermark to Video: video preview with the layers drawn over it, the batch list and the layer panel.
   Components: _shared/media/vh-media.css. */
.tool-add-text-to-video { display: flex; flex-direction: column; gap: 14px; }
.tool-add-text-to-video .tw-drop { min-height: 180px; }
.tool-add-text-to-video .tw-drop.vhm-has-compact { min-height: 0; }
.tool-add-text-to-video .tw-editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 960px) {
  .tool-add-text-to-video .tw-editor { grid-template-columns: minmax(0, 1fr) 340px; }
  .tool-add-text-to-video .tw-main { position: sticky; top: 12px; }
}
.tool-add-text-to-video .tw-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tool-add-text-to-video .tw-stage { display: flex; justify-content: center; background: var(--vhm-bg-2, #f1f3f8); border-radius: var(--vhm-radius-sm, 8px); padding: 8px; }
/* The frame shrinks to the video's own box, so the overlay canvas lies exactly on the picture. */
.tool-add-text-to-video .tw-frame { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
.tool-add-text-to-video .tw-frame video { display: block; max-width: 100%; max-height: 62vh; width: auto; height: auto; background: #000; border-radius: 6px; }
.tool-add-text-to-video .tw-overlay { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; border-radius: 6px; }
.tool-add-text-to-video .tw-overlay.tw-dragging { cursor: grabbing; }
.tool-add-text-to-video .tw-overlay:focus-visible { outline: 3px solid var(--vhm-accent, #2b59ff); outline-offset: 2px; }
.tool-add-text-to-video .tw-row { display: flex; align-items: center; gap: 10px; }
.tool-add-text-to-video .tw-seek { flex: 1; min-width: 0; accent-color: var(--vhm-accent, #2b59ff); min-height: 32px; }
.tool-add-text-to-video .tw-time { font-variant-numeric: tabular-nums; font-size: .9rem; min-width: 7ch; text-align: right; }
.tool-add-text-to-video .tw-batch-head { margin: 0 0 6px; font-weight: 600; }
.tool-add-text-to-video .tw-videos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tool-add-text-to-video .tw-videos li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 8px; border: 1px solid var(--vhm-border, #dfe3ec); border-radius: 8px; }
.tool-add-text-to-video .tw-videos li.tw-cur { border-color: var(--vhm-accent, #2b59ff); }
.tool-add-text-to-video .tw-vname { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; font-size: .92rem; }
.tool-add-text-to-video .tw-vmeta { font-size: .85rem; color: var(--vhm-muted, #5b6475); }
.tool-add-text-to-video .tw-settings { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tool-add-text-to-video .tw-layers { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-add-text-to-video .tw-layer { max-width: 100%; min-height: 36px; padding: 4px 10px; border: 1px solid var(--vhm-border, #dfe3ec); border-radius: 999px; background: var(--vhm-bg, #fff); color: inherit; font: inherit; font-size: .9rem; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-add-text-to-video .tw-layer[aria-pressed="true"] { border-color: var(--vhm-accent, #2b59ff); background: var(--vhm-accent-soft, #e8eeff); font-weight: 600; }
.tool-add-text-to-video .tw-add { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-add-text-to-video .tw-panel { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--vhm-border, #dfe3ec); padding-top: 10px; }
.tool-add-text-to-video .tw-panel[hidden] { display: none; }
.tool-add-text-to-video .tw-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tool-add-text-to-video .tw-group[hidden] { display: none; }
.tool-add-text-to-video .tw-when { border: 0; margin: 0; padding: 0; }
.tool-add-text-to-video .tw-when legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.tool-add-text-to-video .tw-text { width: 100%; min-height: 3.2em; resize: vertical; box-sizing: border-box; }
.tool-add-text-to-video .tw-styles { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-add-text-to-video .tw-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: end; }
.tool-add-text-to-video .tw-three { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: end; }
.tool-add-text-to-video .tw-inline { display: flex; gap: 6px; min-width: 0; }
.tool-add-text-to-video .tw-inline input { flex: 1; min-width: 0; }
.tool-add-text-to-video input[type="range"] { width: 100%; accent-color: var(--vhm-accent, #2b59ff); min-height: 32px; }
.tool-add-text-to-video input[type="color"] { width: 100%; min-height: 36px; }
.tool-add-text-to-video select { max-width: 100%; }
.tool-add-text-to-video .tw-logoinfo { margin: 0; font-size: .92rem; overflow-wrap: anywhere; }
.tool-add-text-to-video .tw-remove { align-self: flex-start; }
.tool-add-text-to-video .tw-plan { margin: 0; font-size: .9rem; background: var(--vhm-bg-2, #f1f3f8); border-radius: 10px; padding: 8px 10px; }
.tool-add-text-to-video .tw-plan:empty, .tool-add-text-to-video .tw-notes:empty { display: none; }
.tool-add-text-to-video .tw-notes p { margin: 0 0 4px; font-size: .9rem; }
.tool-add-text-to-video .tw-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tool-add-text-to-video .tw-results li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
@media (max-width: 420px) {
  .tool-add-text-to-video .tw-three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
