/* ============================================================
   NEW WORKSPACE COMPONENTS
   ============================================================ */

.assign-picker-empty {
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
  padding: var(--s-4);
}

.img-creator-modal-body {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-4);
}

/* ── Frame slot - upload/pick empty state ─────────────────────
   Layout lives in workspace-layout.css (single source of truth);
   this file used to redefine the same three rules and, loading
   later, silently won. */

.frame-slot.picker-active {
  border-color: var(--accent) !important;
  background: var(--accent-soft);
}

/* ── Inline library picker ───────────────────────────────── */
.inline-picker {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--r-md);
  padding: var(--s-3);
  box-shadow: var(--shadow-sm);
}

.inline-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-3);
}

.inline-picker-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* ── Image Creator Section ──────────────────────────────── */
.img-creator-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.img-creator-head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 10px var(--s-4);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
  background: var(--surface);
}

.img-creator-head:hover {
  background: var(--surface-hover);
}

.img-creator-head.expanded {
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border);
}

.img-creator-chevron {
  font-size: 10px;
  color: var(--text-3);
  width: 16px;
  flex-shrink: 0;
  transition: color 0.15s;
}

.img-creator-head.expanded .img-creator-chevron {
  color: var(--accent);
}

.img-creator-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.img-creator-head.expanded .img-creator-title {
  color: var(--accent);
}

.img-creator-badge {
  font-size: 11px;
  background: var(--surface-pressed);
  color: var(--text-3);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-weight: 500;
}

.img-creator-body {
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  border-bottom: 1px solid var(--border);
}

.img-creator-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}

/* ── Images Gallery ────────────────────────────────────── */
.img-gallery {
  padding: var(--s-3) var(--s-4);
}

.img-gallery-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--s-3);
}

.img-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: var(--s-2);
}

.img-gallery-item {
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  transition: border-color 0.15s;
}

.img-gallery-item:hover {
  border-color: var(--border-strong);
}

.img-gallery-item.badge-start {
  border-color: var(--accent);
}

.img-gallery-item.badge-end {
  border-color: var(--purple);
}

.img-gallery-thumb {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--surface-pressed);
  cursor: pointer;
  overflow: hidden;
}

.img-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.img-gallery-thumb:hover img {
  transform: scale(1.04);
}

.img-gallery-badge {
  position: absolute;
  top: 4px;
  inset-inline-start: 4px;
  background: var(--accent);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.img-gallery-item.badge-end .img-gallery-badge {
  background: var(--purple);
}

.img-gallery-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 5px;
  border-top: 1px solid var(--divider);
  background: var(--surface);
}

.img-gallery-actions .btn {
  flex: 1;
  font-size: 10px;
  padding: 3px 4px;
  min-width: 0;
}

.img-gallery-actions .btn-icon {
  flex: 0;
  width: 22px;
  height: 22px;
  padding: 0;
}

/* ── btn-xs (extra small) ──────────────────────────────── */
.btn-xs {
  padding: 3px 8px !important;
  font-size: 11px !important;
  border-radius: var(--r-xs) !important;
}

/* ── Smaller choice pills ──────────────────────────────── */
.choice-pills-sm {
  gap: 4px;
}

.choice-pills-sm .choice-pill {
  padding: 5px 6px;
}

.choice-pills-sm .choice-pill-label {
  font-size: 12px;
}

/* ── Prompt card updates ───────────────────────────────── */
.prompt-card-title-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.prompt-suggestions-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  margin-top: var(--s-1);
  margin-bottom: var(--s-2);
}

.prompt-textarea-wrap {
  position: relative;
}

.prompt-lang-tag {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  background: var(--accent);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  letter-spacing: 0.05em;
  pointer-events: none;
  z-index: 1;
}

.prompt-empty-hint {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: var(--s-4) var(--s-3);
  background: var(--surface-2);
  border-radius: var(--r-sm);
  border: 1px dashed var(--border);
}

.prompt-suggest-row {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--s-2);
}

/* ── Suggestion cards ──────────────────────────────────── */
.suggestion-cards {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.suggestion-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: var(--s-3) var(--s-4);
  cursor: pointer;
  transition: all 0.15s;
}

.suggestion-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.suggestion-card.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.suggestion-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.suggestion-card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.suggestion-card.selected .suggestion-card-label {
  color: var(--accent);
}

.suggestion-card-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.suggestion-card-desc {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}

.suggestion-card.selected .suggestion-card-desc {
  color: var(--text-2);
}

/* Fix-mode suggestion pills */
.fix-suggestion-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0 4px;
}

.fix-suggestion-pill {
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.13s;
  line-height: 1.4;
  text-align: start;
}

.fix-suggestion-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-hover);
}

.fix-suggestion-pill.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.fix-suggestion-loading {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
}

/* ── Videos Panel (right) ──────────────────────────────── */
.videos-panel {
  padding: var(--s-3);
  position: sticky;
  top: var(--s-3);
  height: var(--shots-col-h, calc(100vh - var(--topbar-h) - 80px));
  max-height: var(--shots-col-h, calc(100vh - var(--topbar-h) - 80px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: var(--s-1) var(--s-2) var(--s-2);
}

.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px var(--s-3);
  border-bottom: 1px solid var(--divider);
  margin-bottom: var(--s-2);
}

.panel-header-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.panel-header-count {
  display: inline-block;
  margin-inline-start: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.panel-header-hint {
  font-size: 10px;
  color: var(--text-muted);
}

.shot-editor-exclude {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 var(--s-1) var(--s-2);
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-2, rgba(0, 0, 0, 0.03));
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}

.shot-editor-exclude input {
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.shot-editor-exclude--compact {
  margin: 0 var(--s-1) var(--s-2);
  padding: 5px 8px;
  font-size: 11px;
  line-height: 1.3;
  gap: 6px;
}

.shot-editor-exclude--compact input {
  margin-top: 1px;
}

.shot-editor-exclude.is-checked {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.08);
  color: var(--text);
}

/* legacy - kept for other panels */
.panel-count-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--s-1) var(--s-2);
  border-bottom: 1px solid var(--divider);
  margin-bottom: var(--s-2);
}

.panel-count {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
}

.panel-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--s-8) var(--s-3);
  text-align: center;
  gap: var(--s-2);
  flex: 1;
}

.panel-empty-icon {
  font-size: 32px;
  opacity: 0.2;
}

.panel-empty-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
}

.panel-empty-hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 160px;
}

/* Video items in panel */
.panel-video-item {
  flex-shrink: 0;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  overflow: hidden;
  transition: border-color 0.15s;
  margin: 1px var(--s-3);
}

.panel-video-item:hover {
  border-color: var(--border-strong);
}

.panel-video-item.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Timeline / editor selection — clearer emphasis + label. */
.panel-video-item.is-active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-2));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent),
    0 2px 8px color-mix(in srgb, var(--accent) 12%, transparent);
}

.panel-video-item.is-active .panel-video-thumb::after {
  /* Space must be \20 — a literal space after a CSS hex escape is eaten as
     the escape terminator, which used to render "מוצגבעורך" with no gap. */
  content: "\05de\05d5\05e6\05d2\20\05d1\05e2\05d5\05e8\05da";
  position: absolute;
  bottom: 4px;
  inset-inline-start: 4px;
  top: auto;
  background: color-mix(in srgb, var(--accent) 88%, #000);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 3px 7px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 2;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.panel-video-item.is-active .panel-video-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
}

.panel-video-thumb {
  aspect-ratio: 16/9;
  background: var(--surface-pressed);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.panel-video-thumb-facts {
  position: absolute;
  top: 4px;
  inset-inline-start: 4px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100% - 36px);
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.58);
  color: rgba(255, 255, 255, 0.95);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
  pointer-events: none;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-video-thumb-dur {
  font-variant-numeric: tabular-nums;
}

.panel-video-thumb-facts-sep {
  opacity: 0.65;
}

.panel-video-thumb-res {
  font-weight: 600;
  opacity: 0.95;
}

.panel-video-thumb img,
.panel-video-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.panel-video-zoom-btn {
  position: absolute;
  top: 4px;
  inset-inline-end: 4px;
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 2;
}

.panel-video-thumb:hover .panel-video-zoom-btn {
  opacity: 1;
}

.panel-video-remove-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 2px 4px;
  border-radius: var(--r-sm);
  opacity: 0;
  transition:
    opacity 0.15s,
    color 0.15s;
  white-space: nowrap;
}

.panel-video-item:hover .panel-video-remove-btn {
  opacity: 1;
}

.panel-video-remove-btn:hover {
  color: var(--danger, #c0392b);
  background: color-mix(in srgb, var(--danger, #c0392b) 10%, transparent);
}

.panel-count-actions {
  display: flex;
  gap: 2px;
}

/* Assign-from-library picker */
.assign-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--s-3);
}

.assign-picker-grid[hidden] {
  display: none !important;
}

.assign-picker-item {
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
  position: relative;
}

.assign-picker-item.is-selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.assign-picker-check {
  position: absolute;
  top: 5px;
  inset-inline-start: 5px;
  z-index: 4;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
}

.assign-picker-item.is-selected .assign-picker-check {
  background: var(--accent);
  border-color: var(--accent);
}

.assign-picker-item:hover {
  border-color: var(--accent);
}

.assign-picker-upload {
  border-style: dashed;
  border-color: var(--border-strong, var(--border));
}

.assign-picker-upload:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.assign-picker-upload-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.assign-picker-upload:hover .assign-picker-upload-thumb {
  color: var(--accent);
}

.assign-picker-thumb {
  aspect-ratio: 16/9;
  background: var(--surface-pressed);
  overflow: hidden;
  position: relative;
}

.picker-res-badge {
  position: absolute;
  top: 5px;
  inset-inline-end: 5px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: var(--r-xs);
  letter-spacing: 0.04em;
  pointer-events: none;
  z-index: 2;
}

.assign-picker-thumb img,
.assign-picker-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.assign-picker-name {
  font-size: 11px;
  padding: 4px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.assign-picker-folder-hint {
  font-size: 10px;
  padding: 0 6px 5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.assign-picker-folders {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.assign-picker-folder-block {
  gap: var(--s-2);
}

.assign-picker-hint {
  margin: 0 0 var(--s-2);
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-3);
}

.assign-picker-footer {
  flex-shrink: 0;
  justify-content: flex-end;
  gap: var(--s-2);
  border-top: 1px solid var(--divider);
  padding: var(--s-3) var(--s-4);
}

.assign-picker-modal {
  min-height: 0;
}

/* ── Global library (cross-project media) ───────────────────────────────── */
.modal:has(.global-library-modal) {
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 720px);
  overflow: hidden;
  min-height: 0;
}

.global-library-modal {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.global-library-picker-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: var(--s-4);
  padding-top: 0;
}

.global-library-divider {
  height: 1px;
  background: var(--divider);
  margin: var(--s-4) 0 var(--s-3);
}

.global-library-heading {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--s-2);
}

.global-library-group-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin: var(--s-3) 0 var(--s-2);
}

.global-library-local-label {
  margin-top: 0;
}

.global-library-group-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.global-library-item {
  position: relative;
}

.global-library-project-badge {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  padding: 0 6px 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-library-audio-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.global-library-audio-list {
  flex: none;
  max-height: none;
  overflow: visible;
}

.audio-picker-library:has(.global-library-heading) {
  overflow-y: auto;
  min-height: 0;
}

/* ── Duplicate a project: how much to bring across ────────────────────── */
.dup-modes {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-top: var(--s-3);
}

.dup-mode {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  text-align: start;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.dup-mode:hover {
  background: var(--surface-hover);
}

.dup-mode.is-selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.dup-mode-radio {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid var(--border);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.dup-mode.is-selected .dup-mode-radio {
  border-color: var(--accent);
  box-shadow:
    inset 0 0 0 3px var(--surface),
    inset 0 0 0 16px var(--accent);
}

.dup-mode-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.dup-mode-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.dup-mode-detail {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ── Import one shot from another project ─────────────────────────────── */
.ishot-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 4px;
  max-width: 64ch;
}

.ishot-body {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

/* The .modal box is what scrolls, so the project switcher rides along on top
   of the grid instead of scrolling away from it. */
.ishot-projects {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--surface);
  padding-block: var(--s-2);
}

.ishot-proj-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 11.5px;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s;
}

.ishot-proj-btn:hover {
  background: var(--surface-hover);
}

.ishot-proj-btn.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.ishot-proj-count {
  font-size: 10px;
  color: var(--text-muted);
}

.ishot-proj-btn.is-active .ishot-proj-count {
  color: inherit;
}

.ishot-num {
  position: absolute;
  top: 6px;
  inset-inline-start: 6px;
  z-index: 3;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}

.ov-import-btn {
  flex: none;
  gap: 6px;
}

.panel-video-selected-badge {
  position: absolute;
  top: 6px;
  inset-inline-start: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-video-meta {
  padding: 5px 8px 5px;
  display: flex;
  align-items: center;
  gap: var(--s-1);
  flex-wrap: wrap;
}

.panel-video-processing-badge {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
}

/* Compact Edit / Remove overlay on the video thumb (Cut is in Workshop). */
.panel-video-thumb-actions {
  position: absolute;
  bottom: 4px;
  inset-inline-end: 4px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.panel-video-thumb:hover .panel-video-thumb-actions,
.panel-video-item.is-active .panel-video-thumb-actions {
  opacity: 1;
  pointer-events: auto;
}
.panel-video-thumb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  padding: 0 5px;
  border: none;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.panel-video-thumb-btn:hover {
  background: color-mix(in srgb, var(--green, #34c759) 88%, #000);
}
.panel-video-thumb-btn-remove:hover {
  background: color-mix(in srgb, var(--danger, #c0392b) 75%, #000);
}
@media (hover: none), (max-width: 768px) {
  .panel-video-thumb-actions {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ── Inline video library (click-to-assign) ───────────────────────────────── */
.panel-library-section {
  border-top: 1px solid var(--divider);
  padding: 8px var(--s-3) var(--s-3);
}
.panel-library-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.panel-library-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
}
.panel-library-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  transition:
    border-color 0.13s,
    background 0.13s;
  text-align: start;
}
.panel-library-item:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.panel-library-item img,
.panel-library-item video {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}
.panel-library-item-name {
  font-size: 10px;
  color: var(--text-muted);
  padding: 2px 5px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.panel-video-processing {
  flex: 0 0 100%; /* always on its own line under the buttons */
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
}

/* ── Lip-sync quality chooser ──────────────────────────────────────────────── */
.lipsync-chooser {
  width: min(460px, 92vw);
}
.lipsync-chooser-body {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-4);
}
.lipsync-option {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: start;
  padding: var(--s-3) var(--s-4);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.12s;
}
.lipsync-option:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.lipsync-option-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.lipsync-option-sub {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.4;
}
.lipsync-option-price {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

/* ── Effect picker dropdown: name + wrapping Hebrew description per row ─────── */
.cselect-menu--effects {
  max-width: 300px;
}
.cselect-menu--effects .cselect-option {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.cselect-menu--effects .cselect-option-hint {
  white-space: normal;
  text-align: start;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-3);
}

/* ── Video-to-video (restyle) modal ────────────────────────────────────────── */
.modal:has(.restyle-modal) {
  max-width: min(520px, 94vw);
  width: 100%;
}
.restyle-modal {
  width: 100%;
}
.restyle-modal-subtitle {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
  line-height: 1.4;
}
.restyle-modal-body {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-4);
}
.restyle-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}

.restyle-hero {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.restyle-hero-thumb {
  width: 96px;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: #000;
}
.restyle-hero-thumb video,
.restyle-hero-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.restyle-hero-meta {
  min-width: 0;
  flex: 1;
}
.restyle-hero-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.restyle-hero-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.4;
}

.restyle-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.restyle-option-note {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-3);
}
.restyle-option-note[hidden] {
  display: none;
}

.restyle-presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.restyle-preset {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: start;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition:
    border-color 0.12s,
    background 0.12s;
}
.restyle-preset:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--surface);
}
.restyle-preset.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.restyle-preset-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.restyle-preset.is-active .restyle-preset-label {
  color: var(--accent);
}
.restyle-preset-desc {
  font-size: 10px;
  line-height: 1.35;
  color: var(--text-3);
}
.restyle-preset.is-active .restyle-preset-desc {
  color: var(--text-2);
}

.restyle-options-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-4);
  padding: var(--s-2) 0;
}
.restyle-option {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.restyle-option[hidden] {
  display: none;
}
.restyle-option input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}

.restyle-action-row {
  margin-top: var(--s-1);
}
.restyle-action-row .duration-group[hidden] {
  display: none;
}
.restyle-action-row .duration-group--model {
  flex: 1 1 0;
  min-width: 0;
}

@media (max-width: 520px) {
  .restyle-presets {
    grid-template-columns: repeat(2, 1fr);
  }
  .restyle-hero {
    flex-direction: column;
    align-items: stretch;
  }
  .restyle-hero-thumb {
    width: 100%;
  }
}

/* ── Add-sound (MMAudio) prompt modal ──────────────────────────────────────── */
.sound-prompt {
  width: 100%;
}
.sound-prompt-body {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: 0;
}
.sound-prompt-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
}
.sound-prompt-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--accent);
}
.sound-prompt-input {
  width: 100%;
}
.sound-prompt-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sound-prompt-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--divider);
  padding-top: var(--s-4);
  margin-top: var(--s-1);
}

.res-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-pressed);
  border-radius: 3px;
  padding: 1px 4px;
  letter-spacing: 0.02em;
  line-height: 1.4;
  white-space: nowrap;
  min-width: 24px;
  text-align: center;
}

.panel-video-name-row {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.panel-video-name-row .panel-video-name {
  flex: 1;
  min-width: 0;
}

.panel-video-model-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-pressed);
  border-radius: 3px;
  padding: 1px 5px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46%;
}

/* A clip made before its shot (or opening picture) changed — «מגרסה קודמת». */
.panel-video-stale-badge {
  color: var(--amber, #c48a2a);
  background: color-mix(in srgb, var(--amber, #c48a2a) 14%, var(--surface-2));
}

.panel-video-name {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: text;
  border-radius: 3px;
  padding: 1px 3px;
  margin: -1px -3px;
  transition: background 0.12s;
}

.panel-video-name:hover {
  background: var(--surface-hover);
}

.panel-video-name-input {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface-hover);
  border: 1.5px solid var(--accent);
  border-radius: 3px;
  padding: 1px 5px;
  outline: none;
  min-width: 0;
  width: 100%;
}

.panel-video-tag-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.panel-video-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--r-pill);
  letter-spacing: 0.02em;
}

.panel-video-tag.tag-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.panel-video-tag.tag-other {
  background: var(--surface-pressed);
  color: var(--text-3);
}

.panel-video-tag.tag-free {
  background: var(--surface-pressed);
  color: var(--text-muted);
}

/* Fit-mode toggle row (shown when aspect ratio mismatch is detected) */
.video-fit-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px 6px;
  border-top: 1px solid var(--divider);
}

.video-fit-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.video-fit-toggle {
  display: flex;
  gap: 2px;
  flex: 1;
}

.video-fit-btn {
  flex: 1;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 0;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition:
    border-color 0.12s,
    background 0.12s,
    color 0.12s;
  text-align: center;
}

.video-fit-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.video-fit-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.panel-video-secondary-actions {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
}

/* ============================================================
   Stage Cards - unified card system
   ============================================================ */
.stage-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  flex-shrink: 0;
}

/* The card is chrome-less inside shot-stage; this shell IS the border. */
.shot-stage > .stage-card {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.shot-stage > .stage-card .stage-card-head {
  flex-shrink: 0;
  padding: 14px var(--s-4);
  border-bottom: 1px solid var(--divider);
  background: var(--surface);
}
.shot-stage > .stage-card .stage-card-head .stage-card-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.shot-stage > .stage-card .video-card-footer {
  overflow: visible;
  flex-shrink: 0;
  position: relative;
  z-index: 3;
  background: var(--surface);
  border-top: 1px solid var(--divider);
}

.stage-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--divider);
  background: var(--surface);
}

.stage-card-head.clickable {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.stage-card-head.clickable:hover {
  background: var(--surface-hover);
}

.stage-card-head.expanded {
  background: var(--accent-soft);
  border-bottom-color: var(--border);
}

.stage-card-head.expanded .stage-card-title {
  color: var(--accent);
}

.stage-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.video-status-picker {
  position: relative;
  flex-shrink: 0;
}

.video-status-picker-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.12s,
    color 0.12s,
    border-color 0.12s,
    box-shadow 0.12s;
}

.video-status-picker-trigger:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-strong);
}

.video-status-picker-trigger.is-open,
.video-status-picker-trigger:focus-visible {
  border-color: var(--border-strong);
  color: var(--text);
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent);
}

.video-status-picker-trigger.is-manual {
  font-weight: 700;
  color: var(--text);
}

/* A hand-set status tints the trigger with its own pip colour. */
.video-status-picker-trigger[data-kind="empty"].is-manual {
  background: color-mix(in srgb, var(--text-muted) 22%, var(--surface));
  border-color: var(--text-muted);
  color: var(--text-2);
}

.video-status-picker-trigger[data-kind="prompt"].is-manual {
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  border-color: var(--accent);
  color: var(--accent);
}

.video-status-picker-trigger[data-kind="image"].is-manual {
  background: color-mix(in srgb, var(--purple) 22%, var(--surface));
  border-color: var(--purple);
  color: var(--purple);
}

.video-status-picker-trigger[data-kind="pick"].is-manual {
  background: color-mix(in srgb, var(--orange) 22%, var(--surface));
  border-color: var(--orange);
  color: var(--orange);
}

.video-status-picker-trigger[data-kind="editing"].is-manual {
  background: color-mix(in srgb, var(--indigo) 22%, var(--surface));
  border-color: var(--indigo);
  color: var(--indigo);
}

.video-status-picker-trigger[data-kind="done"].is-manual {
  background: color-mix(in srgb, var(--green) 22%, var(--surface));
  border-color: var(--green);
  color: var(--green);
}

.video-status-picker-label {
  max-width: 9em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-status-picker-chevron {
  display: inline-flex;
  opacity: 0.65;
  margin-inline-start: 1px;
}

.video-status-picker-trigger.is-open .video-status-picker-chevron {
  transform: rotate(180deg);
}

.video-status-picker-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.18));
}

.video-status-picker-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: calc(var(--r-sm) - 1px);
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
}

.video-status-picker-option:hover {
  background: var(--surface-hover);
}

.video-status-picker-option.is-selected {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent);
}

/* Legacy dual-mark chips (kept harmless if stale markup appears). */
.video-progress-marks {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.video-progress-mark {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.stage-card-hint {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 3px;
}

.card-chevron {
  font-size: 14px;
  color: var(--text-3);
  align-self: center;
  display: flex;
  align-items: center;
}

.card-warning {
  margin: var(--s-3) var(--s-4) 0;
  padding: var(--s-2) var(--s-3);
  background: rgba(255, 149, 0, 0.08);
  border: 1px solid rgba(255, 149, 0, 0.25);
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}

.stage-card-action {
  padding: var(--s-4);
}

.stage-card-action .stage-card-head {
  padding: 0 0 var(--s-3);
  border-bottom: none;
  background: transparent;
}

/* Card body: one scroller; only the middle (prompt) card scrolls. */
.video-card-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px var(--s-4);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overscroll-behavior: contain;
}

.video-card-body > .keyframe-plan-label {
  margin-bottom: -2px;
}

/* Where this shot's media comes from: a repeated chorus follows another shot
   (shot-repeat-link.js). One line, the action at the far end. */
.shot-repeat-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding-block: 4px;
  padding-inline: 10px 6px;
  border: 1px solid var(--accent-soft-2);
  background: var(--accent-soft);
  border-radius: var(--r-lg);
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-2);
}

.shot-repeat-strip[data-state="detached"],
.shot-repeat-strip[data-state="source"] {
  border-color: var(--border);
  background: color-mix(in srgb, var(--text) 3%, var(--surface));
}

.shot-repeat-ico {
  display: inline-flex;
  flex: none;
  color: var(--accent);
}

.shot-repeat-strip[data-state="detached"] .shot-repeat-ico,
.shot-repeat-strip[data-state="source"] .shot-repeat-ico {
  color: var(--text-3);
}

.shot-repeat-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 6px;
}

.shot-repeat-text b {
  font-weight: 600;
  color: var(--text);
}

.shot-repeat-note {
  color: var(--text-3);
}

.shot-repeat-note::before {
  content: "·";
  margin-inline-end: 6px;
  opacity: 0.55;
}

.shot-repeat-action {
  flex: none;
  white-space: nowrap;
}

/* One quiet vertical form: pictures → text → folds → inspection row.
   No boxes-in-boxes; whitespace and one hairline do the separating. */
.video-card-body > .frame-chooser {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--divider);
}

/* ── The prompt composer ───────────────────────────────────────────────────
   ONE unit, used by all four prompt windows: the video card, the image
   creator card, and the image modal in create and in fix mode. The text, the
   "שינוי" row and the inspection chips live inside a single frame, parted by
   hairlines. Before this each window stacked them as loose rows under a
   separately-boxed textarea, so the tools read as unrelated strays. */
.prompt-composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color 0.12s;
}

.prompt-composer:focus-within {
  border-color: var(--border-strong);
}

.prompt-composer > .field {
  gap: 8px;
  min-width: 0;
}

/* One heading weight for "what do you want" in every window. Kept at two
   classes on purpose: the fix window's secondary panel overrides it later, and
   a heavier selector here would flatten that hierarchy. */
.video-prompt-label,
.prompt-composer .field-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

/* ...except inside the opened "באנגלית" panel, which is reference material. */
.prompt-composer .prompt-fold-panel .field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

/* One frame, not two: the textarea loses its own box inside the composer. */
.prompt-composer .ai-textarea-wrap .textarea {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 2px 2px 4px;
}

.prompt-composer .ai-textarea-wrap .textarea:focus {
  border: none;
  box-shadow: none;
  outline: none;
}

/* The rows inside the composer use the SHARED prompt-tools rules further down
   this file, where the joining hairlines are declared too - after the chip
   styling, so the cascade order is deterministic. */

/* The two folds: identical quiet rows that open in place.
   ONE border language across this card and both image windows: every panel is
   1px solid var(--border) at var(--r-md) on var(--surface); every control
   inside it is 1px solid var(--border) at var(--r-sm) on var(--surface-2).
   Nothing dashed, nothing 1.5px, no --divider hairlines pretending to be
   borders - that mixture is what made these windows read as a jumble. */
.video-card-body > .shot-brief-fold,
.video-card-body > .video-advanced {
  margin-top: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: none;
  min-width: 0;
  flex-shrink: 0;
  /* So a hovered head is clipped to the rounded corners, as in .video-advanced */
  overflow: hidden;
}

.video-card-body > .shot-brief-fold > summary,
.video-card-body > .video-advanced .video-advanced-toggle {
  padding: 9px 11px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  background: transparent;
}

.video-card-body > .shot-brief-fold > summary .video-advanced-badge {
  flex-shrink: 0;
}

.video-card-body > .shot-brief-fold > summary:hover,
.video-card-body > .video-advanced .video-advanced-toggle:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Open: head and body parted by a hairline in both folds. A divider SEPARATES
   inside a panel; a border ENCLOSES the panel - keeping the two jobs apart is
   what makes one border weight read as deliberate. */
.video-card-body > .shot-brief-fold[open] > .shot-brief-fields {
  padding: 10px;
  gap: 7px;
  border-top: 1px solid var(--divider);
}

.video-card-body > .video-advanced .video-advanced-body {
  gap: var(--s-3);
  padding: 10px 12px 12px;
}

/* The shot's own fields wore the planning language - dashed 5px boxes with 9px
   accent micro-caps - inside a card where everything else is a solid 8px
   control. Same control here as the "שינוי" field and the chips beside it. */
.shot-brief-fields .seg-field,
.shot-brief-fields .seg-field.is-empty {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 5px 9px;
  /* Room for full-size labels ("רחש רקע") now that they are not 9px caps. */
  grid-template-columns: 4rem minmax(0, 1fr);
}

.shot-brief-fields .seg-field:hover {
  border-color: var(--border-strong);
}

.shot-brief-fields .seg-field:focus-within {
  border-color: var(--accent);
  background: var(--surface);
}

.shot-brief-fields .seg-field-label,
.shot-brief-fields .seg-field.is-empty .seg-field-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-2);
}

.shot-brief-fields .seg-field-input {
  font-size: 12px;
  color: var(--text);
}

.shot-brief-fields .planning-dlg-char,
.shot-brief-fields .planning-dlg-line {
  font-size: 12px;
  border-radius: var(--r-sm);
  padding: 3px 7px;
}

.video-card-warning {
  padding: var(--s-2) var(--s-3);
  background: rgba(255, 149, 0, 0.08);
  border: 1px solid rgba(255, 149, 0, 0.25);
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}

.video-card-warning--action {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.video-card-warning-text {
  margin: 0;
}

.video-card-warning-btn {
  align-self: flex-start;
}

/* Card footer: the generate bar, pinned under the card. */
.video-card-footer {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4) var(--s-3);
  border-top: 1px solid var(--divider);
  flex-shrink: 0;
  min-width: 0;
  overflow: visible;
}

/* Model · quality · duration · generate - single row; controls shrink, never wrap.
   Accent chrome uses outward margin so padding/border do not shrink the button row. */
.video-settings-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 4px 6px;
  min-width: 0;
  width: calc(100% + 18px);
  margin-inline: -9px;
  box-sizing: border-box;
  container-type: inline-size;
  container-name: video-settings;
  padding: 6px 8px;
  border-radius: var(--r-md);
  /* The one accented zone in the card (the send strip) - tinted, but built on
     the same --border base as every other frame so the weight matches. */
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border));
  background: color-mix(in srgb, var(--surface) 86%, var(--accent));
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 10%, transparent);
}
.video-settings-row-controls {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1 1 0;
  justify-content: flex-start;
}
.video-settings-row .duration-group {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  gap: 3px;
}
.video-settings-row .duration-group--model {
  flex: 0 0 auto;
}
.video-settings-row .duration-group--effect {
  flex: 0 0 auto;
}
.video-settings-row .duration-group .cselect-trigger {
  width: auto;
  min-width: 0;
  max-width: none;
  padding: 6px 8px;
  font-size: 12px;
  gap: 3px;
}
.video-settings-row .duration-group--model .cselect-trigger-label,
.video-settings-row .duration-group .cselect-trigger-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Compact select - matches .btn height */
.select-sm {
  padding: 7px 10px;
  padding-inline-start: 32px;
  font-size: 13px;
  border-radius: var(--r-sm);
  height: auto;
  width: auto;
  min-width: 0;
  flex-shrink: 0;
}

/* Custom select styles live in styles/polish.css */

.video-generate-btn {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 6px 10px;
  font-size: 12px;
}
.video-settings-row .generate-btn-with-price {
  flex: 0 0 auto;
  flex-shrink: 0;
  margin-right: 0;
  gap: 6px;
  min-width: 0;
}

@container video-settings (max-width: 36rem) {
  .video-settings-row .duration-label {
    display: none;
  }

  .video-settings-row-controls {
    gap: 3px;
  }

  .video-settings-row .duration-group .cselect-trigger {
    padding: 5px 6px;
    font-size: 11px;
  }

  .video-settings-row .generate-btn-with-price {
    gap: 4px;
  }

  .video-settings-row .generate-btn-price {
    font-size: 11px;
  }

  .video-settings-row .video-generate-btn {
    padding: 5px 8px;
    font-size: 11px;
  }
}

.duration-group {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-shrink: 0;
}

.duration-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* Read-only value (e.g. a model's fixed output quality) - looks like a quiet,
   non-interactive pill so it reads as info, not a control. */
.duration-static {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-pressed);
  border-radius: var(--r-sm);
  white-space: nowrap;
  flex-shrink: 0;
}

.duration-pills {
  display: flex;
  background: var(--surface-pressed);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 2px;
}

.duration-pill {
  padding: 6px 11px;
  border-radius: calc(var(--r-md) - 2px);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
  line-height: 1.4;
}

.duration-pill:hover:not(.active) {
  color: var(--text);
}

.duration-pill.active {
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

/* ── Advanced video controls ──────────────────────────────────────────────── */
.video-advanced {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
  flex-shrink: 0;
  margin-top: auto;
}
.video-advanced-toggle {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
  padding: 11px var(--s-3);
  background: var(--surface-2);
  border: none;
  cursor: pointer;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  text-align: start;
  transition: background 0.12s;
}
.video-advanced-toggle:hover {
  background: var(--surface-pressed);
  color: var(--text);
}
.video-advanced-toggle > .ui-icon {
  color: var(--text-3);
  flex-shrink: 0;
}
.video-advanced-title {
  flex: 1;
}
.video-advanced-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 9px;
  border-radius: var(--r-pill);
}
.video-advanced-chevron {
  display: inline-flex;
  color: var(--text-3);
  transition: transform 0.18s ease;
}
.video-advanced-toggle.open .video-advanced-chevron {
  transform: rotate(180deg);
}
.video-advanced-body {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-4);
  border-top: 1px solid var(--divider);
}

/* Inline hint banner */
.video-advanced-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-2);
  background: var(--accent-soft);
  border-radius: var(--r-sm);
}
.video-advanced-hint > .ui-icon {
  color: var(--accent);
  flex-shrink: 0;
}

/* Section: small title + content */
.control-section {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.control-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-3);
  text-transform: uppercase;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--s-3);
}
.control-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.control-field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
.control-field .cselect-trigger {
  width: 100%;
}

/* Explanatory line under a control group (e.g. why the audio mode matters). */
.control-hint {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-3);
}
/* A hint that is a caveat, not background info (e.g. "this model ignores these"). */
.control-hint.is-warn {
  color: var(--orange);
}

.control-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.control-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.12s;
}
.control-toggle:hover {
  color: var(--text);
  border-color: var(--border-strong);
}
.control-toggle.active {
  color: var(--accent);
}
.control-toggle-check {
  display: inline-flex;
  width: 14px;
  height: 14px;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: 1.5px solid var(--border-strong);
  color: #fff;
  transition: all 0.12s;
}
.control-toggle.active .control-toggle-check {
  background: var(--accent);
  /* border-color: var(--accent); */
}
/* Same toggle, sitting inside a field's label row next to the ghost buttons
   (e.g. "בלי פרומפט"), so it has to match their smaller height. */
.control-toggle--inline {
  padding: 4px 9px;
  font-size: 11.5px;
}
.control-toggle--inline:disabled {
  opacity: 0.5;
  cursor: default;
}

/* A prompt that is kept but not sent: the text stays fully readable and
   editable, just visibly out of the loop for the next generation. */
.is-prompt-skipped .textarea {
  opacity: 0.55;
  border-style: dashed;
}
.prompt-skipped-hint {
  margin-bottom: var(--s-2);
  color: var(--accent);
}

.control-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.control-chip {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all 0.12s;
}
.control-chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
}
.control-chip.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
}
.control-avoid-input {
  width: 100%;
}

.control-actions {
  display: flex;
  gap: var(--s-2);
  justify-content: flex-end;
  border-top: 1px solid var(--divider);
  padding-top: var(--s-3);
}

/* Image Creator body */
.img-creator-body {
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

/* Model selector cards */
.model-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.model-cards:has(> :last-child:nth-child(odd)):not(:has(> :only-child)),
.restyle-presets:has(> :last-child:nth-child(odd)):not(:has(> :only-child)) {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 720px) {
  .model-cards {
    grid-template-columns: 1fr;
  }
}

.model-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px;
  text-align: start;
  cursor: pointer;
  transition: all 0.15s var(--ease-out);
  font-family: inherit;
}

.model-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.model-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.model-card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.model-card.active .model-card-label {
  color: var(--accent);
}

.model-card-desc {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.4;
}

.img-creator-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}

@media (max-width: 640px) {
  .img-creator-settings {
    grid-template-columns: 1fr;
  }
}

.quality-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: var(--surface-pressed);
  padding: 3px;
  border-radius: var(--r-sm);
}

.quality-pill {
  padding: 6px 8px;
  background: transparent;
  border: none;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.quality-pill:hover {
  color: var(--text);
}

.quality-pill.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
}

/* Label + live-translation status, for the mirrored Hebrew/English prompt boxes */
.field-label-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.prompt-mirror-status {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-3);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s var(--ease-out);
}

.prompt-mirror-status.is-on {
  opacity: 1;
}

.prompt-mirror-status.is-busy {
  color: var(--accent);
}

.prompt-mirror-status.is-error {
  color: var(--red);
}

.prompt-mirror-status.is-busy::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-inline-end: 5px;
  vertical-align: -1px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: promptMirrorSpin 0.7s linear infinite;
}

@keyframes promptMirrorSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .prompt-mirror-status.is-busy::before {
    animation: none;
  }
}

/* Video prompt body */
.video-prompt-body {
  padding: var(--s-3) var(--s-4) var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.video-prompt-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.video-prompt-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.prompt-lang-pill {
  background: var(--accent);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  letter-spacing: 0.05em;
  text-transform: none;
}

/* Frame slot empty state */
.frame-slot-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
  gap: var(--s-2);
  height: 100%;
  min-height: 200px;
}

.frame-slot-empty-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.frame-slot-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface-pressed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 300;
  color: var(--text-3);
  margin: var(--s-2) 0;
}

.frame-slot-empty-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 220px;
}

.frame-slot-label-overlay {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: var(--r-xs);
  z-index: 1;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  /* Clear of the ✨ / ☰ chips on the other side; a long status wraps
     rather than running under them. */
  max-width: calc(100% - 96px);
  line-height: 1.35;
}

.frame-slot-status::before {
  content: " · ";
}

/* Mobile/touch: hide routine labels, but keep a stale/pending result visible. */
@media (hover: none), (max-width: 768px) {
  .frame-slot-label-overlay {
    display: none;
  }
  .frame-slot-label-overlay--status {
    display: block;
    top: auto;
    bottom: 4px;
    inset-inline-start: 4px;
  }
  .frame-slot-label-overlay--status .frame-slot-label-name {
    display: none;
  }
  .frame-slot-status::before {
    content: none;
  }
}

/* ============================================================
   Quality Control modal (qc-review.js)
   ============================================================ */
.modal.modal-lg:has(.qc-modal) {
  width: min(760px, 96vw);
  max-width: min(760px, 96vw);
  height: min(86vh, 820px);
  max-height: min(86vh, 820px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  min-height: 0;
}

.qc-modal {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  height: 100%;
  overflow: hidden;
  background: var(--surface);
}

.qc-modal-header {
  flex-shrink: 0;
  margin: 0;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--divider);
  background: var(--surface);
  align-items: flex-start;
  gap: 12px;
}

.qc-modal-heading {
  min-width: 0;
  flex: 1;
}

.qc-modal-subtitle {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.4;
}

.qc-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
  padding: 10px 16px;
  border-bottom: 1px solid var(--divider);
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface));
  position: relative;
}

.qc-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-inline-end: auto;
  min-width: 0;
}

.qc-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.qc-cancel-btn {
  color: var(--danger, #e5484d);
}

.qc-cancel-btn:hover {
  background: color-mix(in srgb, var(--danger, #e5484d) 12%, var(--surface));
  color: var(--danger, #e5484d);
}

.qc-card.is-clickable {
  cursor: pointer;
}

.qc-card.is-clickable:hover {
  border-color: var(--border-strong);
  background: color-mix(in srgb, var(--surface-pressed) 35%, var(--surface-2));
}

.qc-card.is-bad {
  border-color: color-mix(in srgb, var(--danger, #e5484d) 28%, var(--border));
}

.qc-note {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.45;
}

/* The free local scan's own line: a take that cut inside itself. Louder than
   a note (it is a defect) and separate from the review's verdict, which may
   not have been run at all. */
.qc-cut-note {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-2);
}

.qc-cut-note .sev {
  margin-inline-end: 6px;
}

.qc-section {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-3);
  padding: 10px 4px 0;
}

.qc-section:first-child {
  padding-top: 0;
}

.qc-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
  margin-top: 2px;
}

.qc-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}

.qc-stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  line-height: 1.3;
}

.qc-stat-value {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.qc-stat-prev {
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.qc-toolbar-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.qc-toolbar-field .cselect-trigger {
  max-width: 16rem;
}

.qc-card.qc-warn {
  background: color-mix(in srgb, var(--danger, #e5484d) 7%, var(--surface-2));
}

.qc-scan-btn {
  min-width: 7.5rem;
  justify-content: center;
  transition:
    background 0.15s var(--ease-out, ease),
    color 0.15s var(--ease-out, ease),
    box-shadow 0.15s var(--ease-out, ease),
    opacity 0.15s var(--ease-out, ease);
}

.qc-scan-btn.is-scanning {
  min-width: 8.5rem;
  pointer-events: none;
  box-shadow: none;
  opacity: 0.92;
}

.qc-scan-btn.is-scanning .btn-inline-spinner {
  margin-inline-end: 8px;
}

.qc-scan-btn-label {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.qc-progress-track {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 3px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  overflow: hidden;
}

.qc-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent) 70%, transparent),
    var(--accent)
  );
  transition: width 0.25s var(--ease-out, ease);
  border-radius: 0 2px 2px 0;
}

.qc-progress {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.qc-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  border: none;
  background: color-mix(in srgb, var(--surface-pressed) 80%, transparent);
  color: var(--text-2);
  white-space: nowrap;
}

.qc-chip b {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.qc-chip.qc-bad {
  background: color-mix(in srgb, var(--danger, #e5484d) 10%, transparent);
  color: var(--danger, #e5484d);
  border-color: transparent;
}

.qc-chip.qc-bad b {
  color: var(--danger, #e5484d);
}

.qc-chip.qc-weak {
  background: color-mix(in srgb, var(--orange, #f5a524) 12%, transparent);
  color: color-mix(in srgb, var(--orange, #d98a00) 85%, var(--text));
  border-color: transparent;
}

.qc-chip.qc-weak b {
  color: color-mix(in srgb, var(--orange, #d98a00) 90%, var(--text));
}

.qc-chip.qc-good {
  background: color-mix(in srgb, var(--green, #30a46c) 10%, transparent);
  color: var(--green, #30a46c);
  border-color: transparent;
}

.qc-chip.qc-good b {
  color: var(--green, #30a46c);
}

.qc-summary-meta {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
}

.qc-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
}

.qc-empty {
  text-align: center;
  padding: 48px 24px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-3);
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.qc-empty b {
  color: var(--text-2);
  font-weight: 700;
}

.qc-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  box-shadow: var(--shadow-xs);
  transition:
    border-color 0.12s,
    background 0.12s;
}

.qc-card:hover {
  border-color: var(--border-strong);
}

.qc-card.is-busy {
  opacity: 0.55;
  pointer-events: none;
}

.qc-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 112px;
  height: 70px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-pressed);
  border: 1px solid var(--border);
}

.qc-thumb img,
.qc-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.qc-score {
  position: absolute;
  inset-block-start: 4px;
  inset-inline-start: 4px;
  min-width: 28px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  font-variant-numeric: tabular-nums;
}

.qc-score.qc-bad {
  background: var(--danger, #e5484d);
}

.qc-score.qc-weak {
  background: var(--orange, #f5a524);
  color: #2a1f00;
}

.qc-score.qc-good {
  background: var(--green, #30a46c);
}

.qc-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qc-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.qc-card-title {
  font-weight: 650;
  font-size: 13px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.qc-verdict {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text-3);
}

.qc-verdict.qc-bad {
  background: color-mix(in srgb, var(--danger, #e5484d) 14%, var(--surface));
  color: var(--danger, #e5484d);
  border-color: color-mix(in srgb, var(--danger, #e5484d) 28%, transparent);
}

.qc-verdict.qc-weak {
  background: color-mix(in srgb, var(--orange, #f5a524) 14%, var(--surface));
  color: color-mix(in srgb, var(--orange, #d98a00) 90%, var(--text));
  border-color: color-mix(in srgb, var(--orange, #f5a524) 28%, transparent);
}

.qc-verdict.qc-good {
  background: color-mix(in srgb, var(--green, #30a46c) 14%, var(--surface));
  color: var(--green, #30a46c);
  border-color: color-mix(in srgb, var(--green, #30a46c) 28%, transparent);
}

.qc-stale {
  font-size: 11px;
  color: var(--text-3);
}

.qc-summary-line {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.45;
}

.qc-issues {
  margin: 2px 0 0;
  padding-inline-start: 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--text-2);
}

.qc-issues li {
  font-size: 12px;
  line-height: 1.45;
}

.qc-issues li .sev {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  margin-inline-end: 5px;
  border: 1px solid transparent;
}

.qc-issues li .sev.high {
  background: color-mix(in srgb, var(--danger, #e5484d) 14%, var(--surface));
  color: var(--danger, #e5484d);
  border-color: color-mix(in srgb, var(--danger, #e5484d) 25%, transparent);
}

.qc-issues li .sev.med {
  background: color-mix(in srgb, var(--orange, #f5a524) 14%, var(--surface));
  color: color-mix(in srgb, var(--orange, #d98a00) 90%, var(--text));
  border-color: color-mix(in srgb, var(--orange, #f5a524) 25%, transparent);
}

.qc-issues li .sev.low {
  background: var(--surface-pressed);
  color: var(--text-3);
  border-color: var(--border);
}

.qc-fix {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-3);
}

.qc-fix summary {
  cursor: pointer;
  color: var(--text-2);
  font-weight: 600;
}

.qc-fix summary:hover {
  color: var(--accent);
}

.qc-fix pre {
  white-space: pre-wrap;
  margin: 6px 0 0;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-2);
  direction: ltr;
  text-align: left;
  line-height: 1.45;
}

.qc-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .modal.modal-lg:has(.qc-modal) {
    width: 100vw;
    max-width: 100vw;
    height: min(92vh, 100dvh);
    max-height: min(92vh, 100dvh);
  }

  .qc-card {
    flex-direction: column;
  }

  .qc-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .qc-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .qc-toolbar-actions {
    justify-content: flex-end;
  }

  .qc-toolbar-field {
    width: 100%;
    justify-content: space-between;
  }

  .qc-toolbar-field .cselect-trigger {
    max-width: none;
    flex: 1;
  }
}

/* ── Song-mode planning panel ─────────────────────────────────────────────────
   The panel shows two different kinds of claim, and they are styled apart on
   purpose: measured facts (bpm, bar, section boundaries, repeats) read as data,
   while estimated placements read as notes. See js/views/workspace/song-plan.js. */
.planning-mode-toggle {
  display: flex;
  gap: 2px;
  background: var(--surface-pressed);
  border-radius: var(--r-md);
  padding: 3px;
}

.planning-mode-btn {
  padding: 5px 10px;
  font-size: 12px;
  border: none;
  background: transparent;
  color: var(--text-2);
  border-radius: calc(var(--r-md) - 2px);
  white-space: nowrap;
}

.planning-mode-btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

.song-panel-body {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  min-height: 0;
  overflow-y: auto;
}

.song-panel-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  padding: 1px;
  margin: -1px;
}

.song-panel-track {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: start;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}

.song-panel-track:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.song-panel-track.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  color: var(--text);
}

.song-panel-track-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-2);
  flex-shrink: 0;
}

.song-panel-track.is-active .song-panel-track-ico {
  background: var(--accent-soft, color-mix(in srgb, var(--accent) 16%, transparent));
  color: var(--accent);
}

.song-panel-track-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.song-panel-track-name {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.song-panel-track-meta {
  font-size: 11px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-panel-track-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  width: 18px;
}

.song-panel-picker-empty {
  padding: var(--s-4);
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  align-items: flex-start;
}

.song-panel-empty,
.song-panel-note {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}

.song-panel-actions {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
  align-items: center;
}

.song-panel-asr-pills {
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
}

.song-panel-asr-pills .duration-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 14px;
  line-height: 1.25;
}

.song-panel-asr-pills .duration-pill:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.song-panel-asr-pills .duration-pill.active {
  color: var(--text);
}

.song-panel-asr-pills .song-panel-slot-bars {
  direction: ltr;
  font-variant-numeric: tabular-nums;
}

.song-panel-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: stretch;
}

.song-panel-stat {
  flex: 1 1 70px;
  padding: var(--s-2);
  border-radius: var(--r-md);
  background: var(--surface-2);
  text-align: center;
}

.song-panel-stat-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.song-panel-stat-label {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 2px;
}

.song-panel-warn {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--warning, #d08700);
}

.song-panel-subhead {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.song-panel-budget,
.song-panel-sections,
.song-panel-lyrics {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

.song-panel-slot-bars {
  opacity: 0.6;
  font-size: 10px;
}

.song-panel-budget-line {
  font-size: 12px;
  color: var(--text-2);
}

.song-panel-section {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 5px var(--s-2);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 12px;
}

/* A repeated section costs nothing to generate — it should look secondary. */
.song-panel-section.is-repeat {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-3);
}

.song-panel-section-time {
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  font-size: 11px;
}

.song-panel-section-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-panel-section-shots {
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
}

.song-panel-block {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: var(--s-2);
  align-items: baseline;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-subtle, var(--border));
}

.song-panel-block-label {
  font-weight: 600;
  white-space: nowrap;
}

.song-panel-repeat-tag {
  font-weight: 400;
  color: var(--text-3);
}

.song-panel-block-lang {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--surface-pressed);
  color: var(--text-3);
}

.song-panel-block-text {
  color: var(--text-2);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Song panel: one vertical flow, one decision per step. */
.song-panel-step {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-3);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.song-choice {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.song-choices {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--border);
}

.song-choices > .song-choice {
  border: none;
  border-radius: 0;
}

.song-choice-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.song-choice-label {
  font-size: 12px;
  font-weight: 650;
  color: var(--text);
}

.song-choice-status {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.song-choice-caption {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-3);
}

.song-choice-meta {
  font-size: 12px;
  color: var(--text-2);
}

.song-choice-options {
  display: grid;
  gap: 6px;
}

.song-choice-options--2 {
  grid-template-columns: 1fr 1fr;
}

.song-choice-options--3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.song-choice .song-panel-asr-pills {
  width: 100%;
  max-width: 100%;
}

.song-choice-options--auto {
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
}

.song-choice-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 40px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  cursor: pointer;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
  transition:
    border-color 0.12s,
    background 0.12s,
    color 0.12s,
    box-shadow 0.12s;
}

.song-choice-opt:hover:not(:disabled):not(.is-active) {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.song-choice-opt.is-active,
.song-choice-opt.active {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}

.song-choice-opt:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.song-choice-opt-label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}

.song-choice-opt-meta {
  font-size: 10px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  direction: ltr;
}

.song-choice-opt.is-active .song-choice-opt-meta {
  color: var(--accent);
}

.song-choice-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: stretch;
}

.song-choice-actions .song-panel-analyze {
  flex: 1 1 auto;
  width: auto;
  align-self: auto;
  min-height: 32px;
}

.song-choice .song-panel-details {
  border-top: 1px solid var(--border);
  margin-top: 2px;
  padding-top: 8px;
}

.song-panel-step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.song-panel-trackname {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-2);
}

.song-panel-analyze {
  align-self: stretch;
  justify-content: center;
  min-height: 36px;
  font-weight: 600;
}

.song-panel-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-2);
  padding: 0 var(--s-1);
}

.song-panel-summary-main {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.song-panel-cta {
  width: 100%;
  justify-content: center;
}

/* Story + plan + rebuild share one row so the redo is not a lonely full-width
   button under the two that actually move the plan forward. */
.song-panel-cta-row {
  flex-wrap: nowrap;
  align-items: stretch;
}

.song-panel-cta-row .song-panel-cta {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  overflow: hidden;
}

.song-panel-cta-row .song-panel-cta-rebuild {
  flex: 0 1 auto;
  order: -1;
}

@media (max-width: 720px) {
  .song-panel-picker {
    max-height: min(42vh, 280px);
    gap: 8px;
  }

  .song-panel-track {
    min-height: 48px;
    padding: 10px 12px;
    grid-template-columns: 32px minmax(0, 1fr) 18px;
  }

  .song-panel-track-ico {
    width: 32px;
    height: 32px;
  }

  .song-choice {
    padding: 12px 10px;
    gap: 10px;
  }

  .song-choice-head {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 4px 8px;
  }

  .song-choice-status {
    white-space: normal;
  }

  .song-choice-opt {
    min-height: 44px;
    padding: 8px 6px;
  }

  .song-choice-actions {
    flex-wrap: wrap;
  }

  .song-choice-actions .btn {
    min-height: 40px;
  }

  .song-choice-actions .btn-ghost {
    border-color: var(--border);
  }

  .song-panel-analyze {
    min-height: 44px;
  }

  .song-panel-cta-row {
    gap: 6px;
  }

  .song-panel-cta-row .song-panel-cta {
    white-space: normal;
    line-height: 1.25;
    font-size: 12px;
    padding: 8px 6px;
    min-height: 44px;
    overflow: visible;
    text-align: center;
    align-items: center;
  }

  .song-panel-cta-row .btn-ghost.song-panel-cta {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
  }

  .song-panel-cta-row:not(:has(.song-panel-cta-rebuild)) {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .planning-mode-toggle {
    width: 100%;
  }

  .planning-mode-btn {
    flex: 1 1 0;
    justify-content: center;
    min-height: 36px;
  }
}

@media (max-width: 520px) {
  .song-panel-cta-row:has(.song-panel-cta-rebuild) {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "rebuild story"
      "plan plan";
    gap: 6px;
  }

  .song-panel-cta-row:has(.song-panel-cta-rebuild) > .song-panel-cta:nth-child(1) {
    grid-area: story;
  }

  .song-panel-cta-row:has(.song-panel-cta-rebuild) > .song-panel-cta:nth-child(2) {
    grid-area: plan;
  }

  .song-panel-cta-row:has(.song-panel-cta-rebuild) > .song-panel-cta-rebuild {
    grid-area: rebuild;
    order: 0;
    max-width: 9.6em;
  }

  .song-choice-options--3 {
    gap: 5px;
  }

  .song-choice-opt-label {
    font-size: 11px;
  }
}

.song-panel-details {
  border-top: 1px solid var(--border);
  padding-top: var(--s-2);
}

.song-panel-details > summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--text-2);
  padding: 2px 0;
  list-style: none;
}

.song-panel-details > summary::-webkit-details-marker {
  display: none;
}

.song-panel-details > summary::before {
  content: "▸ ";
  color: var(--text-3);
}

.song-panel-details[open] > summary::before {
  content: "▾ ";
}

.song-panel-details .song-panel-section {
  margin-top: 4px;
}

/* Lyric timing read-out: an estimated line is where a wrong cut comes from,
   so it is visibly weaker than a measured one. */
.song-panel-step-tag {
  font-weight: 400;
  font-size: 11px;
  color: var(--text-3);
}

.song-panel-lines {
  display: flex;
  flex-direction: column;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 4px;
}

.song-panel-line {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--s-2);
  font-size: 12px;
  padding: 5px 8px;
  border-radius: var(--r-sm);
}

.song-panel-lines .song-panel-section-time {
  direction: ltr;
}

.song-panel-line-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
}

.song-panel-line.is-estimated .song-panel-line-text {
  opacity: 0.55;
  font-style: italic;
}

/* Song mode owns the source card outright — no nested card, no second box. */
.planning-panel--source .song-panel-body {
  gap: var(--s-3);
}

.planning-panel--source .song-panel-body .planning-raw {
  min-height: 120px;
}

.song-panel-step .textarea {
  width: 100%;
}

/* ── The prompt tools, shared by the video card and both image windows
   (create + fix): ONE visual language. A flat "שינוי" row; then a line of
   uniform chips (מה יישלח / באנגלית / i) sharing one height, one solid
   border and one text size. An opened chip leaves the line and becomes a
   full-width panel BELOW it, so the line itself never breaks. */
.prompt-preview-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  direction: rtl;
  margin-top: 4px;
}

/* The little "i" joins the chip set instead of floating as a bare round icon:
   same height, same border, same radius as the chips it sits between. */
.prompt-preview-row > .planning-seg-decisions-btn {
  flex-shrink: 0;
  width: auto;
  min-width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-3);
  transition: border-color 0.12s;
}

.prompt-preview-row > .planning-seg-decisions-btn:hover,
.prompt-preview-row > .planning-seg-decisions-btn.is-open {
  border-color: var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
}

/* One shape for every tool on the row: a plain button. Its panel is NOT inside
   it — see disclosureChip(). A <details> has to carry its panel within, so a
   panel wide enough to read a prompt in dragged the whole chip onto a line of
   its own, and the button jumped out from under the cursor that clicked it. */
.prompt-preview-row > .prompt-chip {
  flex: 0 0 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 5px 10px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-2);
  background: var(--surface-2, var(--bg));
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  user-select: none;
  direction: rtl;
  text-align: start;
  white-space: nowrap;
  transition:
    border-color 0.12s,
    color 0.12s;
}

.prompt-preview-row > .prompt-chip:hover,
.prompt-preview-row > .prompt-chip.is-open {
  border-color: var(--border-strong);
  color: var(--text);
}

.prompt-preview-label {
  flex: 0 1 auto;
  min-width: 0;
}

/* A row of nothing but the two disclosures: they split it end to end, each
   with its chevron parked at its own far edge, so the line reads as a pair of
   deliberate buttons instead of two chips stranded on an empty row. */
.prompt-preview-row--split > .prompt-chip {
  flex: 1 1 0;
}

.prompt-preview-row--split > .prompt-chip .prompt-preview-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prompt-preview-row > .prompt-chip .prompt-chip-chevron {
  display: inline-flex;
  flex-shrink: 0;
  opacity: 0.65;
  transition: transform 0.12s;
}

.prompt-preview-row > .prompt-chip.is-open .prompt-chip-chevron {
  transform: rotate(180deg);
}

/* The opened panel: ordered LAST on the row and full width, so it lands on the
   line below every chip. The chip that opened it stays exactly where it was,
   nothing beside it shifts, and only what sits UNDER the row is pushed down —
   which is what "expands" should mean. */
.prompt-preview-row > .prompt-fold-panel {
  order: 10;
  flex: 1 1 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2, var(--bg));
}

.prompt-preview-row > .prompt-fold-panel[hidden] {
  display: none;
}

.prompt-preview-row > .prompt-fold-panel > .field-label-row {
  padding: 8px 10px 0;
}

.prompt-preview-row > .prompt-fold-panel > .textarea {
  margin: 6px 10px 10px;
  width: calc(100% - 20px);
}

.prompt-preview-row .prompt-preview-body {
  margin: 0;
  padding: 10px 12px;
  max-height: 260px;
  overflow: auto;
  background: transparent;
  border: none;
  font-family: var(--font-mono, ui-monospace, Consolas, monospace);
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
  direction: ltr;
  text-align: left;
}

/* The model this preview is for. The same blocks are laid out two ways —
   rules-first for Gemini, scene-first for GPT Image — so a preview with no
   model on it would imply one universal prompt that does not exist. */
.prompt-preview-model {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-3);
  margin-inline-start: 0;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* "What should change?" — a flat site-style row: label, input, real button.
   No pill, no dashed frame, no 9px caps. Sits under the description in all
   three windows because that is the text it edits. */
.seg-field.prompt-instruct {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.seg-field.prompt-instruct:focus-within {
  border-color: var(--divider);
  background: transparent;
}

.prompt-instruct .seg-field-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-2);
}

.prompt-instruct .prompt-instruct-input {
  min-width: 0;
  background: var(--surface-2, var(--bg));
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text);
  transition: border-color 0.12s;
}

.prompt-instruct .prompt-instruct-input:focus {
  border-color: var(--accent);
}

.prompt-instruct .prompt-instruct-btn {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  color: var(--text-2);
  background: var(--surface-2, var(--bg));
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.prompt-instruct .prompt-instruct-btn:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-2, var(--bg));
}

.prompt-instruct .prompt-instruct-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.prompt-instruct-end {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.prompt-instruct-end > .prompt-chip--icon {
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  color: var(--text-2);
  background: var(--surface-2, var(--bg));
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
}

.prompt-instruct-end > .prompt-chip--icon:hover,
.prompt-instruct-end > .prompt-chip--icon.is-open,
.prompt-instruct-end > .planning-seg-decisions-btn:hover,
.prompt-instruct-end > .planning-seg-decisions-btn.is-open {
  border-color: var(--border-strong);
  color: var(--accent);
}

.prompt-instruct-end > .planning-seg-decisions-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2, var(--bg));
  color: var(--text-2);
}

.prompt-instruct-end > .skip-prompt-toggle.is-on {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

@media (max-width: 640px) {
  .seg-field.prompt-instruct {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 6px;
  }
  .prompt-instruct .seg-field-label {
    display: none;
  }
  .prompt-instruct-end {
    width: 100%;
    gap: 6px;
  }
  .prompt-instruct-end > .prompt-instruct-btn,
  .prompt-instruct-end > .prompt-chip--icon,
  .prompt-instruct-end > .planning-seg-decisions-btn {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    height: 32px;
  }
}

.prompt-fold-panel > .prompt-preview-model {
  display: block;
  padding: 8px 12px 0;
}

.prompt-composer .prompt-preview-row.prompt-tools-panels {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.prompt-composer .prompt-preview-row.prompt-tools-panels:has(.prompt-fold-panel:not([hidden])) {
  border-top: 1px solid var(--divider);
  padding-top: 10px;
  margin-top: 8px;
}

.prompt-fold-panel > .textarea {
  box-sizing: border-box;
}

/* "בלי פרומפט" as a switch — a send-time state you flip, not a box to tick. */
.skip-prompt-toggle {
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  flex-shrink: 0;
}

.skip-prompt-toggle:hover {
  color: var(--text);
}

.skip-prompt-toggle.is-on {
  color: var(--accent);
}

.skip-prompt-toggle.is-disabled {
  opacity: 0.5;
  cursor: default;
}

.skip-prompt-toggle .toggle-switch {
  width: 30px;
  height: 18px;
  flex-shrink: 0;
}

.skip-prompt-toggle .toggle-switch::after {
  width: 14px;
  height: 14px;
}

.skip-prompt-toggle .toggle-input:checked + .toggle-switch {
  background: var(--accent);
}

[dir="rtl"] .skip-prompt-toggle .toggle-input:checked + .toggle-switch::after,
.skip-prompt-toggle .toggle-input:checked + .toggle-switch::after {
  transform: translateX(-12px);
}

/* ── Inside the composer: hairlines join the rows into one unit, and the
   switch holds the far end of the inspection row. Identical in all four
   windows - this is what makes the tools read as part of the text. */
.prompt-composer .seg-field.prompt-instruct,
.prompt-composer .seg-field.prompt-instruct:focus-within {
  border-top: 1px solid var(--divider);
  padding-top: 10px;
}

.prompt-composer .prompt-preview-row {
  margin-top: 0;
  padding-top: 10px;
  border-top: 1px solid var(--divider);
  justify-content: flex-start;
}

.prompt-composer .prompt-preview-row .skip-prompt-toggle {
  margin-inline-start: auto;
}

/* ══ «נחסם» - the one window for a refused generation ════════════════════
   (blocked-prompt-fixer.js: the shot's clip, the shot's opening picture, the
   AI picture window, a parked clip that came back refused.)
   Reading order top to bottom: ONE sentence of why → the moves that can be
   made from here, each a row with its own button, the recommended one ringed
   → a fold with what was sent and what the provider answered. Narrow, and no
   foot: the X closes it. */

.modal:has(.bpf-modal) {
  display: flex;
  flex-direction: column;
  width: min(520px, 96vw);
  max-width: min(520px, 96vw);
  /* The window hugs its content and scrolls inside when a rewording is open.
     No fixed height: .bpf-modal / .bpf-body are flex 0 1 auto, never flex:1 -
     that pair on a parent with only max-height once collapsed the window to
     0px (the click opened nothing). */
  height: auto;
  max-height: min(90vh, 820px);
  overflow: hidden;
  padding: 0;
}

.bpf-modal {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
  width: 100%;
}

.bpf-body {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  gap: 14px;
  min-height: 0;
  overflow: auto;
}

.bpf-head .modal-head-icon {
  color: var(--ember, #e86d2f);
}

/* Why - one sentence that states what happened, then what we can add. */
.bpf-why {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
}

.bpf-why-lead {
  font-weight: 700;
  color: var(--text);
}

/* "this shot was already refused by this model" */
.bpf-again {
  padding: 7px 11px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--ember, #e86d2f) 12%, var(--surface));
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

.bpf-lbl {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-3);
}

.bpf-parked {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-3);
}

/* The moves: grey rows, the recommended one white with the teal ring - the
   site's own "chosen" look. */
.bpf-moves {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bpf-move {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  /* The quiet grey, not the frame's tint: the model list inside a row wears
     that tint, and on a row of the same colour it stopped looking like a
     control. */
  background: var(--surface-2);
}

.bpf-move.is-rec {
  background: var(--rf-card, var(--surface));
  box-shadow: 0 0 0 1.5px var(--accent);
}

/* one sentence and one button, side by side */
.bpf-move--row {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.bpf-move-text {
  flex: 1;
  min-width: 0;
}

.bpf-move-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}

.bpf-tag {
  padding: 1px 8px;
  border-radius: var(--r-pill, 999px);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}

.bpf-move-desc {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-3);
}

/* "in this film the model got through N of M" */
.bpf-pass {
  font-weight: 600;
  color: var(--accent);
}

.bpf-go {
  flex: none;
  white-space: nowrap;
}

.bpf-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.bpf-pick .cselect-trigger {
  flex: 1;
  min-width: 150px;
}

/* The rewording: the refused text with the flagged words struck, the
   proposal in an editable box, what the check found, and the two buttons. */
.bpf-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bpf-old {
  max-height: 110px;
  overflow: auto;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-3);
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}

.bpf-hit {
  color: var(--ember, #e86d2f);
  text-decoration-thickness: 1.5px;
}

.bpf-textarea {
  min-height: 110px;
  max-height: 220px;
  text-align: left;
  resize: vertical;
  transition: opacity 0.15s var(--ease-out);
}

.bpf-textarea.is-busy {
  opacity: 0.55;
}

.bpf-status {
  min-height: 18px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-3);
}

.bpf-status.is-busy {
  color: var(--accent);
}

.bpf-status.is-ok {
  color: var(--text-2);
}

.bpf-status.is-warn {
  color: var(--ember, #e86d2f);
}

.bpf-editor-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bpf-refix {
  gap: 5px;
}

/* What was sent and what came back - closed until asked for. */
.bpf-more {
  font-size: 12.5px;
  color: var(--text-3);
}

.bpf-more > summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 2px 0;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.bpf-more > summary::-webkit-details-marker {
  display: none;
}

.bpf-more > summary::before {
  content: "";
  width: 0;
  height: 0;
  border-block: 4px solid transparent;
  border-inline-end: 5px solid currentColor;
  transition: transform 0.15s var(--ease-out);
}

.bpf-more[open] > summary::before {
  transform: rotate(-90deg);
}

.bpf-more > summary:hover {
  color: var(--text-2);
}

.bpf-quote {
  max-height: 150px;
  margin-top: 8px;
  padding: 9px 11px;
  overflow: auto;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-2);
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}

.bpf-quote-lbl {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-align: start;
}

@media (max-width: 560px) {
  .bpf-move--row {
    flex-direction: column;
    align-items: stretch;
  }
  .bpf-move--row .bpf-go {
    justify-content: center;
  }
}
