.lc-modal.chat-video-editor {
  width: min(720px, calc(100vw - 28px));
  max-height: min(90vh, 900px);
  /* 100dvh follows the browser chrome of a phone; the variable is the measured fallback for
     browsers that do not know it. Either way the editor never grows past the visible screen. */
  max-height: min(calc(var(--app-height, 100dvh) * .9), 900px);
  max-height: min(calc(var(--app-height, 100dvh) * .9 - env(safe-area-inset-top) - env(safe-area-inset-bottom)), 900px);
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--lc-line);
  border-radius: var(--lc-block-radius, var(--ds-radius-sheet));
  background: color-mix(in srgb, var(--lc-card) 88%, var(--lc-bg));
  background-image: var(--lc-block-image, none);
  color: var(--lc-text);
  box-shadow: var(--lc-shadow-lift);
}

.chat-video-editor::backdrop {
  background: color-mix(in srgb, var(--lc-bg) 78%, transparent);
}

.lc-modal.chat-video-editor[open] { display: flex; flex-direction: column; }
.chat-video-editor > .lc-modal-head { flex: none; }
.chat-video-editor > .lc-modal-body { min-block-size: 0; overflow: auto; overscroll-behavior: contain; }
/* The clip and quality controls can scroll; X and Send stay reachable. */
.chat-video-editor-footer {
  flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: var(--ds-space-3); padding: var(--ds-space-2) var(--ds-sheet-inset);
  border-block-start: 1px solid var(--ds-edge);
}
.chat-video-editor video { display: block; width: 100%; max-height: 42vh; max-height: calc(var(--app-height, 100dvh) * .42); border-radius: var(--ds-radius-xl); background: var(--lc-bg); }
.chat-video-editor-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 9px; }
.chat-video-editor-controls > :not(.chat-video-quality-label, output) { grid-column: 1 / -1; }
.chat-video-quality-label { align-self: center; font-weight: 700; font-size: var(--ds-fs-label); }
.chat-video-editor output { color: var(--lc-accent); align-self: center; font-size: var(--ds-fs-label); font-weight: 750; text-align: end; }
.chat-video-editor-controls input[type="range"] { width: 100%; margin: 0; min-height: 30px; accent-color: var(--lc-accent); }
.chat-video-quality-ticks { display: flex; justify-content: space-between; color: var(--lc-muted); font-size: var(--ds-fs-micro); }
.chat-video-original { display: flex; align-items: center; gap: 8px; min-height: 38px; font-size: var(--ds-fs-label); cursor: pointer; }
.chat-video-original[hidden] { display: none; }
.chat-video-original input { width: 17px; height: 17px; accent-color: var(--lc-accent); }
.chat-video-summary { background: var(--lc-control); padding: 11px 13px; border-radius: var(--ds-radius-lg); }
.chat-video-summary[data-warn="true"] { outline: 1px solid var(--lc-muted); }
.chat-video-editor-forecast { margin: 0; color: var(--lc-text); font-size: var(--ds-fs-label); font-weight: 720; }
.chat-video-editor-detail { margin: 3px 0 0; color: var(--lc-muted); font-size: var(--ds-fs-micro); }
.chat-video-editor progress { width: 100%; height: 5px; accent-color: var(--lc-accent); }
.chat-video-editor-actions { display: grid; justify-items: end; gap: var(--ds-space-2); padding-block: var(--ds-space-2); }
.chat-video-editor-actions button { min-height: var(--ds-touch); }
.chat-video-once { min-inline-size: var(--ds-touch); }
.chat-video-editor .chat-video-send { inline-size: var(--ds-touch); block-size: var(--ds-touch); background: var(--lc-button); color: var(--lc-on-button); }
.chat-video-editor .chat-video-send::after { content: none; }
.chat-video-editor button:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 480px) {
  .chat-video-editor video { max-height: min(32dvh, 260px); }
  .chat-video-editor-controls { margin-top: 10px; }
}

/* The clip on a strip of frames (2026-11-14): the window between two handles is what goes, the rest is dimmed. */
.chat-video-editor { border: 0; background: color-mix(in srgb, var(--lc-card) 96%, var(--lc-bg)); background-image: none; }
.chat-video-strip {
  position: relative;
  height: 56px;
  margin: 0 12px;
  border-radius: var(--ds-radius-lg);
  background: var(--lc-control);
  touch-action: none;
  user-select: none;
}
.chat-video-frames { display: flex; height: 100%; overflow: hidden; border-radius: inherit; }
.chat-video-frames canvas { flex: 1 1 0; min-width: 0; height: 100%; object-fit: cover; }
.chat-video-shade { position: absolute; top: 0; bottom: 0; left: 0; background: rgb(0 0 0 / .55); pointer-events: auto; }
.chat-video-shade:first-of-type { border-radius: var(--ds-radius-lg) 0 0 var(--ds-radius-lg); }
.chat-video-window {
  position: absolute;
  top: -2px;
  bottom: -2px;
  box-sizing: border-box;
  border: 2px solid var(--lc-accent);
  border-right-width: 0;
  border-left-width: 0;
  cursor: grab;
}
.chat-video-handle {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 14px;
  background: var(--lc-accent);
  cursor: ew-resize;
}
.chat-video-handle::before { content: ''; position: absolute; top: 50%; left: 50%; width: 2px; height: 18px; border-radius: var(--ds-radius-xs); background: var(--lc-bg); transform: translate(-50%, -50%); }
.chat-video-handle::after { content: ''; position: absolute; inset: -6px -14px; }
.chat-video-handle.is-start { left: -12px; border-radius: var(--ds-radius-md) 0 0 var(--ds-radius-md); }
.chat-video-handle.is-end { right: -12px; border-radius: 0 var(--ds-radius-md) var(--ds-radius-md) 0; }
.chat-video-handle:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--lc-text); }
.chat-video-playhead { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: var(--ds-radius-xs); background: var(--lc-text); pointer-events: none; }
.chat-video-span { margin: 0; text-align: center; color: var(--lc-muted); font: 600 var(--ds-fs-label)/1.3 var(--lc-font); font-variant-numeric: tabular-nums; }
