/* EDIT TOOL V4 (Simon, 15 Nov 2026 15:22 -- js/cropvid-v4.js): the Edit tool with no right-hand panel. The viewer full width,
   the prompt panel under it (#cv-v4p, up to 1080px, centred, rounded top), the key strip joined under the panel (#cv-v4k,
   rounded bottom, one block), the timeline's Generate pill, and in the top bar a breadcrumb, Done and a ... menu.
   Everything here is under #cvmod.cv-v4: Classic (localStorage covert_cv_layout = 'classic') never sees any of it.
   The right-hand panel's own nodes (#cv-rows) are re-parented into the panel and shown here only in their essentials; More
   shows them all. Room surfaces as cropvid-nle.js: #111114 / #0e0e11 / #0b0b0d, the brand #e8194f, Inter. */

#cv-v4dock, #cv-v4crumb, #cv-v4done, #cv-v4ovw { display: none; }

/* ---------- 1. the top bar ---------- */
#cvmod.cv-v4 #cv-close { display: none !important; }   /* Done does what it did (it is pressed for it) */
#cvmod.cv-v4 #cv-v4crumb { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; font-size: 12px; color: #8e8e98; margin-left: 6px; }
#cvmod.cv-v4 #cv-v4crumb button { background: none; border: 0; padding: 2px 4px; border-radius: 5px; color: #8e8e98; font: inherit; cursor: pointer; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
#cvmod.cv-v4 #cv-v4crumb button:hover { color: #ececef; background: rgba(255, 255, 255, .05); }
#cvmod.cv-v4 #cv-v4crumb .cur { color: #ececef; font-weight: 600; }
#cvmod.cv-v4 #cv-v4crumb i { font-style: normal; color: #55555d; }
#cvmod.cv-v4 #cv-v4crumb > span.cur { padding: 2px 4px; white-space: nowrap; }
#cvmod.cv-v4 #cv-v4done { display: inline-flex; align-items: center; height: 26px; padding: 0 14px; border-radius: 7px; border: 0; background: #e8194f; color: #fff; font: 600 12px/1 Inter, system-ui, sans-serif; cursor: pointer; margin-left: 4px; }
#cvmod.cv-v4 #cv-v4done:hover { background: #ff2d63; }
#cvmod.cv-v4 #cv-v4ovw { display: inline-flex; position: relative; }
#cvmod.cv-v4 .v4-ovb { width: 28px; height: 26px; border-radius: 7px; border: 1px solid #2a2a31; background: transparent; color: #c4c4cc; font: 600 14px/1 Inter, system-ui, sans-serif; cursor: pointer; padding: 0; }
#cvmod.cv-v4 .v4-ovb:hover, #cvmod.cv-v4 .v4-ovb[aria-expanded="true"] { border-color: #55555d; color: #ececef; }
#cvmod.cv-v4 .v4-menu { position: absolute; right: 0; top: 30px; z-index: 400; min-width: 180px; padding: 4px; border-radius: 9px; background: #16161b; border: 1px solid #2a2a31; box-shadow: 0 10px 30px rgba(0, 0, 0, .55); }
#cvmod.cv-v4 .v4-menu[hidden] { display: none; }
#cvmod.cv-v4 .v4-mi { display: block; width: 100%; text-align: left; padding: 7px 10px; border-radius: 6px; border: 0; background: transparent; color: #ececef; font: 12px/1.3 Inter, system-ui, sans-serif; cursor: pointer; }
#cvmod.cv-v4 .v4-mi:hover { background: rgba(255, 255, 255, .06); }

/* Locate ffmpeg, tool-level, in the export bar (shown only while ffmpeg is missing) */
#cvmod.cv-v4 #cv-xbar > #cv-ff { order: 2; flex: none; }

/* ---------- 2. the viewer, full width: no right-hand panel in .cv-body ---------- */
#cvmod.cv-v4 .cv-body > #cv-rows { display: none !important; }   /* (only while it is on its way into the panel) */
#cvmod.cv-v4 .cv-viewcol { flex: 1 1 auto !important; width: auto !important; min-width: 0 !important; max-width: none !important; }

/* ---------- 3 + 4. the panel and the strip, one block under the viewer ---------- */
/* the viewer keeps at least 38% of the column; the panel gives way first (it scrolls), the strip never */
#cvmod.cv-v4 .cv-viewcol > #cv-stage { min-height: 38%; }
#cvmod.cv-v4 #cv-v4dock { display: flex; flex-direction: column; align-items: center; flex: 0 1 auto; padding: 8px 12px 6px; background: #0b0b0d; min-height: 0; overflow: hidden; }
#cvmod.cv-v4 #cv-v4p { flex: 0 1 auto; min-height: 0; width: 100%; max-width: 1080px; box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 10px; background: #111114; border: 1px solid #26262d; border-bottom: 0; border-radius: 12px 12px 0 0; max-height: 40vh; overflow: auto; overscroll-behavior: contain; }
#cvmod.cv-v4 #cv-v4p > * { flex: none; }
#cvmod.cv-v4 #cv-v4k { flex: none; }
#cv-v4p .v4-hd { display: flex; align-items: center; gap: 8px; min-height: 24px; font: 12px/1.3 Inter, system-ui, sans-serif; color: #8e8e98; }
#cv-v4p .v4-chip { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--v4c, #e8194f); box-shadow: 0 0 0 3px rgba(255, 255, 255, .04); }
#cv-v4p .v4-ttl { color: #ececef; font-size: 13px; font-weight: 600; white-space: nowrap; }
#cv-v4p .v4-of { background: none; border: 0; padding: 0; color: #8e8e98; font: inherit; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#cv-v4p .v4-of:hover { color: #ececef; }
#cv-v4p .v4-of[hidden] { display: none; }
#cv-v4p .v4-sp { flex: 1; }
#cv-v4p .v4-hint { color: #6b6b74; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#cv-v4p .v4-more { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 6px; border: 1px solid #2a2a31; background: transparent; color: #c4c4cc; font: inherit; font-size: 11.5px; cursor: pointer; }
#cv-v4p .v4-more:hover { border-color: #55555d; color: #ececef; }
#cv-v4p .v4-more[aria-expanded="true"] { border-color: #e8194f; color: #fff; }
#cv-v4p[data-mode="none"] .v4-more { display: none; }
#cv-v4p .v4-none { display: none; font-size: 12px; color: #8e8e98; padding: 4px 0 6px; }
#cv-v4p[data-mode="none"] .v4-none { display: block; }
#cv-v4p .v4-kf, #cv-v4p .v4-item { display: none; }
#cv-v4p[data-mode="kf"] .v4-kf { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 10px; }
#cv-v4p[data-mode="crop"] .v4-item, #cv-v4p[data-mode="edit"] .v4-item { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 10px; }
/* the second row of each: a break before the model (the pseudo-element is a flex item, ordered) */
#cv-v4p .v4-kf::before, #cv-v4p .v4-item::before { content: ""; order: 3; flex: 0 0 100%; height: 0; }
/* More: the whole inspector (as Classic had it), in the panel, under whatever the mode shows */
#cvmod.cv-v4.v4-more #cv-v4p:not([data-mode="none"]) .v4-item { display: block; border-top: 1px solid #1f1f25; padding-top: 8px; }
#cvmod.cv-v4.v4-more #cv-v4p .v4-item::before { display: none; }
#cvmod.cv-v4 #cv-v4item > #cv-rows { flex: none !important; width: auto !important; min-width: 0 !important; max-width: none !important; border-left: 0 !important; height: auto !important; max-height: none !important; position: relative; background: transparent; }
#cvmod.cv-v4 #cv-v4item > #cv-rows #cv-rowsrz { display: none !important; }

/* the strip */
#cvmod.cv-v4 #cv-v4k { width: 100%; max-width: 1080px; box-sizing: border-box; display: flex; align-items: stretch; gap: 12px; min-height: 70px; padding: 0 12px 8px; background: #0e0e11; border: 1px solid #26262d; border-top: 0; border-radius: 0 0 12px 12px; outline: none; font: 12px/1.3 Inter, system-ui, sans-serif; color: #8e8e98; }
#cv-v4k .v4-klab, #cv-v4k .v4-khint { align-self: center; margin-top: 8px; }
#cvmod.cv-v4 #cv-v4k:focus-visible { box-shadow: 0 0 0 1px #55555d inset; }
#cv-v4k .v4-klab { flex: none; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: #6b6b74; }
#cv-v4k .v4-keys { flex: 1 1 auto; min-width: 0; display: flex; align-items: flex-end; gap: 8px; overflow-x: auto; overflow-y: visible; padding: 0 2px; scrollbar-width: thin; }
#cv-v4k .v4-key { position: relative; flex: none; display: flex; flex-direction: column; align-items: stretch; gap: 3px; cursor: pointer; }
#cv-v4k .v4-kimg { position: relative; display: block; width: 72px; height: 40px; border-radius: 6px; overflow: hidden; border: 1.5px solid #3a3a43; background: #16161b; box-sizing: border-box; }
#cv-v4k .v4-kimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
#cv-v4k .v4-key:hover .v4-kimg { border-color: #6b6b74; }
#cv-v4k .v4-key.sel .v4-kimg { border: 2px solid #fff; box-shadow: 0 0 0 2px #e8194f; }
#cv-v4k .v4-kor { position: absolute; left: 0; right: 0; bottom: 0; padding: 1px 0 2px; text-align: center; font-size: 9px; font-weight: 700; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .78)); }
#cv-v4k .v4-kft { display: flex; align-items: center; justify-content: center; gap: 3px; height: 14px; font-size: 10.5px; color: #8e8e98; white-space: nowrap; }
#cv-v4k .v4-key.sel .v4-kft { color: #ececef; font-weight: 600; }
#cv-v4k .v4-kx { width: 14px; height: 14px; padding: 0; border: 0; border-radius: 3px; background: transparent; color: #c4c4cc; font: 13px/14px Inter, system-ui, sans-serif; cursor: pointer; }
#cv-v4k .v4-kx:hover { background: #e8194f; color: #fff; }
/* the pink tab: the picked key joined up into the panel above */
#cv-v4k .v4-key.sel::before { content: ""; position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); width: 26px; height: 10px; background: #e8194f; border-radius: 0 0 2px 2px; }
#cv-v4k .v4-keys { align-items: flex-start; padding-top: 10px; }
#cv-v4k .v4-kadd { margin-top: 0; }
#cv-v4k .v4-kadd { flex: none; align-self: flex-start; width: 46px; height: 40px; border-radius: 6px; border: 1px dashed #3a3a43; background: transparent; color: #c4c4cc; font: 600 18px/1 Inter, system-ui, sans-serif; cursor: pointer; padding: 0; }
#cv-v4k .v4-kadd:hover { border-color: #e8194f; color: #fff; }
#cv-v4k .v4-khint { flex: none; font-size: 11px; color: #6b6b74; white-space: nowrap; }
#cv-v4k .v4-kspin { display: block; width: 100%; height: 100%; background: repeating-linear-gradient(135deg, #1a1a20 0 6px, #16161b 6px 12px); }

/* ---------- a KEYFRAME picked: its box (#cv-kfp, mounted in #cv-v4kf) with Create's column lent in it (#main), in two rows:
   [references] [the wide prompt] / [image model] [resolution, format] [Enhance] [Maintain original] ... [price] [Generate image].
   More shows the rest of the box (its versions, its words at this moment, Prompt / Image). ---------- */
#cvmod.cv-v4 #cv-v4kf > #cv-kfp,
#cvmod.cv-v4 #cv-v4kf #cv-kfp > .kfp,
#cvmod.cv-v4 #cv-v4kf #cv-kfp .kfp-ed,
#cvmod.cv-v4 #cv-v4kf #cv-kfp .kfp-main,
#cvmod.cv-v4 #cv-v4kf #cv-kfp #main:not(.hidden),
#cvmod.cv-v4 #cv-v4kf #main > #model-section,
#cvmod.cv-v4 #cv-v4kf #main > #inputs-section,
#cvmod.cv-v4 #cv-v4kf #main > #prompt-section,
#cvmod.cv-v4 #cv-v4kf #main #prompt-block,
#cvmod.cv-v4 #cv-v4kf #main #prompt-block > .check-pair,
#cvmod.cv-v4 #cv-v4kf #main > section:not([id]),
#cvmod.cv-v4 #cv-v4kf #main #gen-row { display: contents !important; }
#cvmod.cv-v4 #cv-v4kf #cv-kfp > .kfp > *:not(.kfp-ed),
#cvmod.cv-v4 #cv-v4kf #cv-kfp .kfp-ed > *:not(.kfp-main),
#cvmod.cv-v4 #cv-v4kf #main > *:not(#model-section):not(#inputs-section):not(#prompt-section):not(section:not([id])),
#cvmod.cv-v4 #cv-v4kf #main > #model-section > *:not(#model-dd):not(#model-tier),
#cvmod.cv-v4 #cv-v4kf #main > #inputs-section > *:not(#input-slots),
#cvmod.cv-v4 #cv-v4kf #main > #prompt-section > *:not(#prompt-block):not(#fields),
#cvmod.cv-v4 #cv-v4kf #main #prompt-block > *:not(#prompt-wrap):not(.check-pair),
#cvmod.cv-v4 #cv-v4kf #main #prompt-block > .check-pair > *:not(#enhance-row):not(#keep-row),
#cvmod.cv-v4 #cv-v4kf #main > section:not([id]) > *:not(#gen-row):not(#gen-cost),
#cvmod.cv-v4 #cv-v4kf #main #gen-row > *:not(#btn-generate) { display: none !important; }
#cvmod.cv-v4 #cv-v4kf #input-slots { order: 1; flex: none; max-width: 46%; min-width: 0; }
#cvmod.cv-v4 #cv-v4kf #inputs-section #input-slots { display: block !important; }   /* the references are always open here (Classic folds them: .cv-refs) */
#cvmod.cv-v4 #cv-v4kf #model-dd-btn { height: 36px; min-height: 0; padding-top: 0; padding-bottom: 0; }
#cvmod.cv-v4 #cv-v4kf #fields .tb-pill, #cvmod.cv-v4 #cv-v4kf #fields .tb-step { height: 36px; min-height: 0; }
/* the count and Format go under More (the resolution and shape stay) */
#cvmod.cv-v4:not(.v4-more) #cv-v4kf #fields .tb-step, #cvmod.cv-v4:not(.v4-more) #cv-v4kf #fields > .field { display: none !important; }
#cvmod.cv-v4 #cv-v4kf #fields .img-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; background: none; }
#cvmod.cv-v4 #cv-v4kf #prompt-wrap { order: 2; flex: 1 1 360px; min-width: 220px; position: relative; }
#cvmod.cv-v4 #cv-v4kf #prompt { min-height: 56px; height: 56px; max-height: 160px; resize: vertical; box-sizing: border-box; width: 100%; border-radius: 8px; }
#cvmod.cv-v4 #cv-v4kf #model-dd { order: 4; flex: none; min-width: 170px; max-width: 260px; }
#cvmod.cv-v4 #cv-v4kf #model-tier { order: 4; flex: none; }
#cvmod.cv-v4 #cv-v4kf #fields { order: 5; flex: none; display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; margin: 0; min-width: 0; }
#cvmod.cv-v4 #cv-v4kf #fields .img-toolbar { flex-wrap: nowrap !important; }
#cvmod.cv-v4 #cv-v4kf #fields .tb-pill { flex: none !important; min-width: 96px; }
/* the price: Create's own (#gen-cost), said beside Generate image ("≈ $0.04") -- js/cropvid-v4.js mirrors it */
#cvmod.cv-v4 #cv-v4kf #gen-cost { display: none !important; }
#cvmod.cv-v4 #cv-v4kf .v4-cost { order: 7; margin-left: auto; align-self: center; color: #ececef; font: 600 12px/1 Inter, system-ui, sans-serif; white-space: nowrap; }
#cvmod.cv-v4 #cv-v4kf #fields > * { margin: 0 !important; }
#cvmod.cv-v4 #cv-v4kf #enhance-row { order: 6; flex: none; }
#cvmod.cv-v4 #cv-v4kf #keep-row { order: 6; flex: none; align-self: center; }
#cvmod.cv-v4 #cv-v4kf #gen-cost { order: 7; margin: 0 0 0 auto !important; align-self: center; color: #ececef; font-weight: 600; font-size: 12px; }
#cvmod.cv-v4 #cv-v4kf #btn-generate { order: 8; flex: none; width: auto !important; min-width: 150px; height: 36px; margin: 0 !important; }
#cvmod.cv-v4 #cv-v4kf #btn-generate #gen-label { font-size: 0; }
#cvmod.cv-v4 #cv-v4kf #btn-generate #gen-label::after { content: "Generate image"; font-size: 13px; }
#cvmod.cv-v4 #cv-v4kf #model-dd-list { z-index: 500; }
/* the references: small tiles with their x, and one dashed "+ Drop a reference" (Create's own slots and drop) */
#cvmod.cv-v4 #cv-v4kf #input-slots .slot { margin: 0; padding: 0; border: 0; background: none; }
#cvmod.cv-v4 #cv-v4kf #input-slots .slot-label { display: none !important; }
#cvmod.cv-v4 #cv-v4kf #input-slots .slot + .slot { display: none !important; }
#cvmod.cv-v4 #cv-v4kf #input-slots .slot-grid { display: flex !important; flex-wrap: nowrap; gap: 6px; overflow-x: auto; grid-template-columns: none !important; }
#cvmod.cv-v4 #cv-v4kf #input-slots .slot-card { flex: none; width: 64px !important; height: 56px !important; min-height: 0 !important; border-radius: 7px; }
#cvmod.cv-v4 #cv-v4kf #input-slots .slot-card.filled .rm.globe, #cvmod.cv-v4 #cv-v4kf #input-slots .slot-card.filled .rm.anno, #cvmod.cv-v4 #cv-v4kf #input-slots .slot-card.filled .rm.sq { display: none !important; }
#cvmod.cv-v4 #cv-v4kf #input-slots .slot-card.empty ~ .slot-card.empty { display: none !important; }
#cvmod.cv-v4 #cv-v4kf #input-slots .slot-card.empty { width: 112px !important; border: 1px dashed #3a3a43 !important; background: transparent !important; display: flex !important; align-items: center; justify-content: center; cursor: pointer; }
#cvmod.cv-v4 #cv-v4kf #input-slots .slot-card.empty > * { display: none !important; }
#cvmod.cv-v4 #cv-v4kf #input-slots .slot-card.empty::after { content: "+ Drop a reference"; font: 11px/1.3 Inter, system-ui, sans-serif; color: #8e8e98; text-align: center; padding: 0 6px; }
#cvmod.cv-v4 #cv-v4kf #input-slots .slot-card.empty.dragover, #cvmod.cv-v4 #cv-v4kf #input-slots .slot-card.empty:hover { border-color: #e8194f !important; }
/* More, on a keyframe: the rest of its box, as Classic had it */
#cvmod.cv-v4.v4-more #cv-v4kf #cv-kfp > .kfp > .kfp-top { display: flex !important; order: 20; flex: 0 0 100%; flex-direction: column; gap: 6px; }
#cvmod.cv-v4.v4-more #cv-v4kf #cv-kfp > .kfp > .kfp-vid { display: block !important; order: 21; flex: 0 0 100%; }
#cvmod.cv-v4.v4-more #cv-v4kf #cv-kfp > .kfp > .kfp-top .kfp-back,
#cvmod.cv-v4.v4-more #cv-v4kf #cv-kfp > .kfp > .kfp-top .kfp-imgtw,
#cvmod.cv-v4.v4-more #cv-v4kf #cv-kfp > .kfp > .kfp-top .kfp-pic { display: none !important; }
#cvmod.cv-v4.v4-more #cv-v4kf #main #prompt-block > .check-pair > #realism-row#realism-row#realism-row { display: inline-flex !important; order: 6; }

/* ---------- a CROP picked (itself): its video generation, from its own row (re-parented #cv-rows) --
   [reference image / video] [what changes in this crop (its video prompt)] / [its video model and options]
   [Maintain original] [Half speed] [Force edit] ... [≈ $] [Generate video]. Without More, nothing else of the row shows. ---------- */
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] #cv-rows,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] #cv-rows-body,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] #cv-rows-body .cv-stack,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] #cv-rows-body .cv-row.sel,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] .cv-row.sel > #cv-kfs,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] #cv-kfs > .kfs-card,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] .kfs-card > .kfs-slot-cp,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] #cv-kfs-foot,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] #cv-kfs-foot > .kfs-fl { display: contents !important; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] #cv-rows > *:not(#cv-rows-body):not(#cv-kfs-foot):not(.cv-rows-tools),
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] #cv-rows-body > *:not(.cv-stack),
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] .cv-stack > *:not(.cv-row.sel),
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] .cv-row.sel > *:not(#cv-kfs):not(.sec),
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] .cv-row.sel > .sec:not([data-sec="flux"]):not([data-sec="vid"]),
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] #cv-kfs > *:not(.kfs-card),
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] .kfs-card > *:not(.kfs-slot-cp):not(.kfs-span),
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] #cv-kfs-foot .kfs-sum { display: none !important; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] textarea.kfs-cp { order: 2; flex: 1 1 360px; min-width: 220px; min-height: 44px; height: 44px; margin: 0; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] .kfs-span { order: 9; flex: 0 0 100%; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] #cv-kfs-foot .kfs-est { order: 7; margin-left: auto; align-self: center; color: #ececef; font-weight: 600; font-size: 12px; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] #cv-kfs-foot .kfs-gen { order: 8; flex: none; min-width: 150px; height: 36px; font-size: 13px; }
/* the brush / click-feather sliders (#cv-rows-tools: cropvid.js shows them while a mask is being painted or clicked) -- a full-width
   line under the panel's rows whenever they are up, in either item mode */
#cvmod.cv-v4:not(.v4-more) #cv-v4p #cv-rows > .cv-rows-tools:not(.hidden) { order: 9; flex: 0 0 100%; display: flex !important; flex-wrap: wrap; gap: 6px 14px; padding: 0; border: 0; }
/* no keys: its Video section (references, model, options) */
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"][data-kf="0"] .cv-row.sel > .sec[data-sec="flux"],
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"][data-kf="1"] .cv-row.sel > .sec[data-sec="vid"] { display: none !important; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"][data-kf="0"] .cv-row.sel > .sec[data-sec="vid"],
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"][data-kf="0"] .sec[data-sec="vid"] > .secb,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"][data-kf="0"] .sec[data-sec="vid"] .bt.vb { display: contents !important; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] .sec[data-sec="vid"] > .sech,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] .sec[data-sec="vid"] > .secb > *:not(.cv-vrow):not(.vb) { display: none !important; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] .sec[data-sec="vid"] .cv-vrow { order: 1; flex: none; display: flex !important; gap: 8px; max-width: 46%; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] .sec[data-sec="vid"] .cv-vrow > * { width: auto !important; flex: none; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] .sec[data-sec="vid"] .vb > .cv-mwrap { order: 4; flex: none; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] .sec[data-sec="vid"] .vb > label.rlm,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] .sec[data-sec="vid"] .vb > .cv-genpair { order: 5; flex: none; align-self: center; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] .sec[data-sec="vid"] .vb > .cv-genpct { order: 6; align-self: center; }
/* with keys: its keyframe pass (model, its options, Match original look, Force edit) */
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"][data-kf="1"] .cv-row.sel > .sec[data-sec="flux"],
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"][data-kf="1"] .sec[data-sec="flux"] > .secb,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"][data-kf="1"] .sec[data-sec="flux"] .kff,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"][data-kf="1"] .sec[data-sec="flux"] .kffb { display: contents !important; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] .sec[data-sec="flux"] > .sech,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] .sec[data-sec="flux"] .kff > *:not(.kff-set):not(.kffb),
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] .sec[data-sec="flux"] .kffb > *:not(.kff-force) { display: none !important; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] .sec[data-sec="flux"] .kff-set { order: 4; flex: 0 1 auto; display: flex !important; flex-wrap: wrap; align-items: center; gap: 6px; width: auto !important; margin: 0; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] .sec[data-sec="flux"] .kff-set > * { flex: none !important; width: auto !important; margin: 0 !important; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] .sec[data-sec="flux"] .kff-set .sm-fld { width: 220px !important; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] .sec[data-sec="flux"] .kff-force { order: 5; align-self: center; }

/* ---------- an EDIT picked (itself): its video generation, from its own block (#cv-sec, #cv-secgo) --
   [its video prompt (the words of its key in view)] / [its video model] [its settings] ... [≈ $ or what stops it] [Generate video] ---------- */
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] #cv-rows,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] #cv-rows-body,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] #cv-rows-body .cv-stack,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] .cv-erow.sel,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] .cv-erow.sel > .er-ed,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] #cv-sec,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] #cv-sec > .sec-mblk,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] #cv-secgo,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] #cv-secgo > .kffb { display: contents !important; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] #cv-rows > *:not(#cv-rows-body):not(.cv-rows-tools),
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] #cv-rows-body > *:not(.cv-stack),
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] .cv-stack > *:not(.cv-erow.sel),
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] .cv-erow.sel > *:not(.er-ed),
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] .er-ed > *:not(#cv-sec):not(#cv-secgo),
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] #cv-sec > *:not(.sec-mblk),
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] #cv-sec > .sec-mblk > .sec-wl,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] #cv-sec > .sec-mblk > .ref-mirror,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] #cv-secgo > *:not(.kffb) { display: none !important; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] #cv-sec-words { order: 2; flex: 1 1 360px; min-width: 220px; min-height: 44px; height: 44px; margin: 0; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] .sec-model { order: 4; flex: 0 1 auto; min-width: 0; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] .sec-model .cv-mwrap { width: auto !important; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] .sec-model .cv-mddlab,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] .cv-fluxroad,
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="crop"] .cv-fluxroad { display: none !important; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] .sec-model .cv-mdd, #cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] .sec-model button { max-height: 38px; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] .sec-kfset { order: 5; flex: 0 1 auto; width: auto !important; align-self: center; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] #cv-secgo .kff-cost { order: 7; margin-left: auto; align-self: center; max-width: 340px; font-size: 12px; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] #cv-secgo .sec-gen { order: 8; flex: none; min-width: 150px; height: 36px; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] #cv-secgo .cv-genpct { order: 8; align-self: center; }

/* ---------- 5. the timeline: "· N keys · not generated" and the ▶ Generate pill at the bar's right; made: ✓ vN ---------- */
/* CLASSIC DEFAULT (15 Nov 2026 22:44): the pill is on the timeline in Classic too (was #cvmod.cv-v4 only); not in the Edit view’s seated room */
#cvmod.ev-inviewer #cv-lanes .v4-tlw { display: none !important; }   /* CLASSIC DEFAULT */
#cvmod #cv-lanes .v4-tlw { position: absolute; z-index: 7; height: 16px; display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 0 12px 0 16px; box-sizing: border-box; pointer-events: none; font: 600 10px/16px Inter, system-ui, sans-serif; }
#cvmod #cv-lanes .v4-tlab { color: #d4d4da; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; text-shadow: 0 0 3px #000; }
#cvmod #cv-lanes .v4-tlab.ok { color: #6ee7a0; }
#cvmod #cv-lanes .v4-tlw.narrow .v4-tlab:not(.ok) { display: none; }
#cvmod #cv-lanes .v4-tlw.narrow { justify-content: flex-end; }
#cvmod #cv-lanes .v4-tlgo { pointer-events: auto; flex: none; display: inline-flex; align-items: center; gap: 4px; height: 16px; padding: 0 8px; border-radius: 8px; border: 0; background: #e8194f; color: #fff; font: 600 10px/16px Inter, system-ui, sans-serif; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
#cvmod #cv-lanes .v4-tlgo:hover { background: #ff2d63; }
#cvmod #cv-lanes .v4-tlgo:disabled { opacity: .7; cursor: default; }

/* ================= EDIT TOOL V4 POLISH (15 Nov 2026) ================= */
/* the viewer's room: the timeline is as tall as what is in it (js/cropvid-v4.js lanesFit, via cropvid-tlbig.js); the line under
   the timeline goes (its count is in the top bar, its hint said "change it on the right"); the export plan is two lines (it
   scrolls); the panel and the strip are tighter */
#cvmod.cv-v4 > .cv-foot { display: none !important; }
#cvmod.cv-v4 .cv-head > #cv-count { flex: 0 1 auto; min-width: 0; margin-left: auto; margin-right: 6px; font: 11.5px/1.3 Inter, system-ui, sans-serif; color: #8e8e98; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#cvmod.cv-v4 #cv-xbar { padding-top: 6px; padding-bottom: 6px; row-gap: 2px; }
#cvmod.cv-v4 #cv-xbar > .cv-rplan { max-height: 34px; }
#cvmod.cv-v4 #cv-v4dock { padding: 6px 12px 4px; }
#cvmod.cv-v4 #cv-v4p { padding: 8px 12px; gap: 6px; }
#cvmod.cv-v4 #cv-v4k { min-height: 0; padding-bottom: 6px; gap: 10px; }
#cvmod.cv-v4 #cv-v4k .v4-keys { padding-top: 8px; gap: 6px; }
#cvmod.cv-v4 #cv-v4k .v4-key.sel::before { height: 8px; }
#cvmod.cv-v4 #cv-v4k .v4-kimg { width: 60px; height: 34px; }
#cvmod.cv-v4 #cv-v4k .v4-kadd { width: 40px; height: 34px; font-size: 16px; }
#cvmod.cv-v4 #cv-v4k .v4-kft { height: 13px; }
#cvmod.cv-v4 #cv-v4k .v4-klab, #cvmod.cv-v4 #cv-v4k .v4-khint { margin-top: 6px; }
#cvmod.cv-v4 #cv-v4kf #prompt, #cvmod.cv-v4:not(.v4-more) #cv-v4p textarea.kfs-cp, #cvmod.cv-v4:not(.v4-more) #cv-v4p #cv-sec-words { min-height: 48px; height: 48px; }
#cvmod.cv-v4 #cv-v4kf #input-slots .slot-card { height: 48px !important; }
#cvmod.cv-v4 #cv-v4kf #model-dd-btn, #cvmod.cv-v4 #cv-v4kf #fields .tb-pill, #cvmod.cv-v4 #cv-v4kf #btn-generate { height: 34px; }

/* the keyframe's own "ACTIVE Original / +" chips under the crop box (cropvid-kfview.js .kfv-vers): the strip says the keys and
   More the versions in V4 */
#cvmod.cv-v4 .kfv-vers { display: none !important; }

/* the Extend form (extend-handles.js #xh-cvpanel) in the panel when an extension is picked: in its flow, not over the room */
#cv-v4p .v4-xh { display: none; }
#cv-v4p[data-mode="extend"] .v4-xh { display: block; }
#cv-v4p[data-mode="extend"] .v4-more, #cv-v4p[data-mode="extend"] .v4-moreidx { display: none !important; }
#cvmod.cv-v4 #cv-v4xh > #xh-cvpanel { position: static !important; left: auto !important; top: auto !important; width: auto !important; height: auto !important; max-height: none !important; z-index: auto; box-shadow: none !important; border: 0 !important; background: transparent !important; overflow: visible !important; }
#cvmod.cv-v4 #cv-v4xh > #xh-cvpanel > .xh-cvh, #cvmod.cv-v4 #cv-v4xh .v4-xhttl, #cvmod.cv-v4 #cv-v4xh .v4-xhsub { display: none !important; }
#cvmod.cv-v4 #cv-v4xh .xh-cvbody { padding: 0 !important; }
#cv-v4p .v4-x { flex: none; width: 24px; height: 24px; padding: 0; border-radius: 6px; border: 1px solid #2a2a31; background: transparent; color: #c4c4cc; font: 15px/1 Inter, system-ui, sans-serif; cursor: pointer; }
#cv-v4p .v4-x:hover { border-color: #55555d; color: #fff; }
#cv-v4p .v4-x[hidden] { display: none; }

/* More: a short "Go to" list of the less-used groups under the header, and the rest of the inspector in a scrolling box under
   the panel's rows (the groups keep their own headings) */
#cv-v4p .v4-moreidx { display: none; }
#cvmod.cv-v4.v4-more #cv-v4p .v4-moreidx { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font: 11px/1.3 Inter, system-ui, sans-serif; }
#cvmod.cv-v4.v4-more #cv-v4p .v4-moreidx:empty { display: none; }
#cv-v4p .v4-moreidx .v4-ml { color: #6b6b74; margin-right: 2px; }
#cv-v4p .v4-moreidx button { height: 22px; padding: 0 9px; border-radius: 11px; border: 1px solid #2a2a31; background: #16161b; color: #c4c4cc; font: inherit; cursor: pointer; }
#cv-v4p .v4-moreidx button:hover { border-color: #e8194f; color: #fff; }
#cvmod.cv-v4.v4-more #cv-v4p:not([data-mode="none"]):not([data-mode="extend"]) .v4-item { max-height: 230px; overflow: auto; overscroll-behavior: contain; border: 1px solid #1f1f25; border-radius: 8px; padding: 8px 10px; background: #0e0e11; }
#cvmod.cv-v4 .v4-flash { outline: 2px solid #e8194f !important; outline-offset: 2px; transition: outline-color .6s; }
#cvmod.cv-v4 #cv-v4p[data-mode="extend"] .v4-kf, #cvmod.cv-v4 #cv-v4p[data-mode="extend"] .v4-item { display: none !important; }

/* EDIT TOOL V4 POLISH: the viewer keeps at least 42% of the column (the panel scrolls before it gives way); everything under it
   tighter -- the panel's rows, the strip's thumbnails, the export bar's plan (one line, it scrolls) */
#cvmod.cv-v4 .cv-viewcol > #cv-stage { min-height: 42%; }   /* (42: at 1440 x 900 the panel's two rows still fit whole) */
#cvmod.cv-v4 #cv-v4p { padding: 6px 12px; }
#cvmod.cv-v4 #cv-v4p .v4-hd { min-height: 22px; }
#cvmod.cv-v4 #cv-v4kf #prompt, #cvmod.cv-v4:not(.v4-more) #cv-v4p textarea.kfs-cp, #cvmod.cv-v4:not(.v4-more) #cv-v4p #cv-sec-words { min-height: 44px; height: 44px; }
#cvmod.cv-v4 #cv-v4kf #input-slots .slot-card { height: 44px !important; }
#cvmod.cv-v4 #cv-v4k .v4-keys { padding-top: 7px; }
#cvmod.cv-v4 #cv-v4k .v4-key.sel::before { height: 7px; }
#cvmod.cv-v4 #cv-v4k .v4-kimg { width: 54px; height: 30px; }
#cvmod.cv-v4 #cv-v4k .v4-kadd { width: 36px; height: 30px; }
#cvmod.cv-v4 #cv-v4k .v4-kft { height: 12px; font-size: 10px; }
#cvmod.cv-v4 #cv-v4k { padding-bottom: 4px; }
#cvmod.cv-v4 #cv-xbar > .cv-rplan { max-height: 18px; }
#cvmod.cv-v4 #cv-xbar > .cv-rows-foot #cv-use { height: 30px; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] .sec-model .cv-mdd, #cvmod.cv-v4:not(.v4-more) #cv-v4p[data-mode="edit"] .sec-model .cv-mdd button { height: 34px; max-height: 34px; min-height: 0; }
#cvmod.cv-v4:not(.v4-more) #cv-v4p #cv-kfs-foot .kfs-gen, #cvmod.cv-v4:not(.v4-more) #cv-v4p #cv-secgo .sec-gen { height: 34px; }

/* EDIT TOOL V4 POLISH the Extend form in the panel's two rows: [Character] [Prop] [what happens next] / [Speed] [Audio] ... [≈ $] [Generate +N s] */
#cvmod.cv-v4 #cv-v4xh .xh-form { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 0; }
#cvmod.cv-v4 #cv-v4xh .xh-prompt { max-height: 140px; resize: vertical; }
#cvmod.cv-v4 #cv-v4xh .xh-form::before { content: ""; order: 3; flex: 0 0 100%; height: 0; }
#cvmod.cv-v4 #cv-v4xh .xh-form > .xh-fh, #cvmod.cv-v4 #cv-v4xh .xh-form > .xh-l, #cvmod.cv-v4 #cv-v4xh .xh-form > .ref-mirror, #cvmod.cv-v4 #cv-v4xh .xh-form > .xh-note { display: none !important; }
#cvmod.cv-v4 #cv-v4xh .xh-refs { order: 1; flex: none; display: flex; gap: 6px; width: auto; }
#cvmod.cv-v4 #cv-v4xh .xh-refs .xh-slot { width: 92px; height: 44px; min-height: 0; flex: none; }
#cvmod.cv-v4 #cv-v4xh .xh-prompt { order: 2; flex: 1 1 360px; min-width: 220px; height: 44px; min-height: 44px; margin: 0; box-sizing: border-box; }
#cvmod.cv-v4 #cv-v4xh .xh-row { order: 4; flex: none; width: auto; margin: 0; gap: 8px; }
#cvmod.cv-v4 #cv-v4xh .xh-est { order: 7; flex: none; width: auto; margin: 0 0 0 auto; }
#cvmod.cv-v4 #cv-v4xh .xh-gen { order: 8; flex: none; width: auto; min-width: 150px; height: 34px; margin: 0; padding: 0 16px; }
#cvmod.cv-v4 #cv-v4xh .xh-runline, #cvmod.cv-v4 #cv-v4xh .xh-err { order: 9; flex: 0 0 100%; }
#cvmod.cv-v4 #cv-v4xh .xh-runline:empty, #cvmod.cv-v4 #cv-v4xh .xh-err:empty { display: none; }

/* EDIT TOOL V4 POLISH a narrow panel (the room at 1440 x 900 is about 840px wide): the second row stays one row -- the model, the
   shape and resolution pills and Generate narrower, Enhance its icon (its words on its hover) */
#cvmod.cv-v4 #cv-v4p { container-type: inline-size; container-name: v4p; }
@container v4p (max-width: 920px) {
  #cv-v4kf #model-dd { min-width: 128px; max-width: 170px; }
  #cv-v4kf #fields .tb-pill { min-width: 0 !important; }
  #cv-v4kf #enhance-row > span { display: none; }
  #cv-v4kf #enhance-row { padding-left: 9px; padding-right: 9px; }
  #cv-v4kf #btn-generate { min-width: 120px; padding-left: 12px; padding-right: 12px; }
  #cv-v4kf #keep-row span { font-size: 11px; }
  #cv-v4item .sec[data-sec="flux"] .kff-set .sm-fld { width: 150px !important; }
  #cv-v4item #cv-kfs-foot .kfs-gen, #cv-v4item #cv-secgo .sec-gen { min-width: 120px; }
  #cv-v4item .sec[data-sec="flux"] .kff-ml .tb-togtxt { font-size: 10.5px; }
  #cv-v4p .v4-hint { display: none; }
}
/* EDIT TOOL V4 POLISH with More open the header and its "Go to" list stay at the top of the panel while it scrolls */
#cvmod.cv-v4.v4-more #cv-v4p > .v4-hd { position: sticky; top: -6px; z-index: 3; background: #111114; padding-top: 6px; margin-top: -6px; }
#cvmod.cv-v4.v4-more #cv-v4p > .v4-moreidx { position: sticky; top: 22px; z-index: 3; background: #111114; padding-bottom: 4px; }
