/* ===== Workspace Header ===== */
.project-header {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  margin-bottom: var(--s-4);
  flex-wrap: wrap;
}

.project-header-title {
  flex: 1;
  min-width: 200px;
}

.project-header-title h2,
.project-name-editable {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}

.project-name-editable {
  cursor: text;
  display: inline-block;
  border-radius: 4px;
  padding: 1px 4px;
  margin: -1px -4px;
  transition: background 0.15s;
}

.project-name-editable:hover {
  background: var(--surface-hover);
}

.project-name-input {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
  background: var(--surface-hover);
  border: 1.5px solid var(--accent);
  border-radius: 4px;
  padding: 1px 6px;
  outline: none;
  width: 100%;
  max-width: 320px;
}

.project-header-title p {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.project-header-tabs {
  display: inline-flex;
  align-items: stretch;
  gap: 2px;
  background: var(--surface-pressed);
  border-radius: var(--r-sm);
  padding: 2px;
}

.wtab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 10px;
  min-width: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  line-height: 1.2;
  box-sizing: border-box;
}

.wtab .wtab-icon,
.wtab .ui-icon.wtab-icon {
  flex-shrink: 0;
  opacity: 0.72;
}

.wtab .wtab-label {
  min-width: 0;
}

.wtab:hover {
  color: var(--text);
}

.wtab:hover .wtab-icon,
.wtab:hover .ui-icon.wtab-icon {
  opacity: 0.9;
}

.wtab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

.wtab.active .wtab-icon,
.wtab.active .ui-icon.wtab-icon {
  opacity: 1;
}

/* Stands in for the tab's 14px icon - same box, so the tab strip keeps its
   real height and the labels do not shift when the page arrives. */
.ws-sk-wtab-icon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}

.project-header-actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

/* Project name row (name + menu trigger) */
.project-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Undo / redo, beside the project name.
   Unlike the ⋮ trigger below these never fade out on hover: the whole point of
   the pair is touch, where there is no Ctrl+Z and no hover to reveal them. */
.project-undo-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-inline-start: 2px;
  flex-shrink: 0;
}

.project-undo-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-3);
  touch-action: manipulation;
  transition:
    background 0.15s,
    color 0.15s,
    opacity 0.15s;
}

.project-undo-btn:hover:not(:disabled) {
  background: var(--surface-pressed);
  color: var(--text);
}

.project-undo-btn:active:not(:disabled) {
  transform: scale(0.94);
}

.project-undo-btn:disabled {
  opacity: 0.28;
  cursor: default;
}

/* Lucide's Undo2/Redo2 are already a mirrored pair, and these glyphs are read
   as symbols rather than as direction — like a play button, they are not
   flipped for RTL. */

@media (max-width: 960px) {
  /* Touch target: 28px is comfortable with a mouse, not with a thumb. */
  .project-undo-btn {
    width: 36px;
    height: 36px;
  }
  .project-undo-group {
    gap: 4px;
  }
}

/* Project menu (⋮ trigger + dropdown) */
.project-menu-wrapper {
  position: relative;
  display: inline-flex;
}

.project-menu-trigger {
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  background: transparent;
  border: none;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-3);
  opacity: 0;
  touch-action: manipulation;
  transition:
    opacity 0.15s,
    background 0.15s,
    color 0.15s;
  flex-shrink: 0;
  padding: 0;
}

.project-name-row:hover .project-menu-trigger,
.project-menu-wrapper.open .project-menu-trigger {
  opacity: 1;
}

.project-menu-trigger:hover {
  background: var(--surface-pressed);
  color: var(--text);
}

.project-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  min-width: 160px;
  padding: 4px;
  z-index: 200;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.project-menu-wrapper.open .project-menu-dropdown {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.project-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: transparent;
  border: none;
  font-size: 13px;
  cursor: pointer;
  text-align: right;
  transition: background 0.12s;
  color: var(--text);
}

.project-menu-item:hover {
  background: var(--surface-hover);
}

.project-menu-item-danger {
  color: var(--danger, #ef4444);
}

.project-menu-item-danger:hover {
  background: var(--danger-soft, #fef2f2);
}

/* Audio pill in header */
.audio-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 6px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  max-width: 180px;
}

.audio-pill-icon {
  font-size: 13px;
}

.audio-pill-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.audio-pill-remove {
  background: var(--accent-soft-2, rgba(10, 107, 118, 0.18));
  border: none;
  color: var(--accent);
  width: 18px;
  height: 18px;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.audio-pill-remove:hover {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
}

/* ===== Shots layout (3 columns - full height) ===== */
.shots-layout {
  /* One knob for קטעים / צור וידאו / סרטונים column height (+20px vs prior 100px inset). */
  --shots-col-h: calc(100vh - var(--topbar-h) - 80px);
  display: grid;
  grid-template-columns: 248px 1fr 324px;
  gap: var(--s-3);
  align-items: stretch;
  min-height: var(--shots-col-h);
}

.shots-layout > .shot-rail,
.shots-layout > .shot-stage,
.shots-layout > .videos-panel {
  height: var(--shots-col-h);
  max-height: var(--shots-col-h);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

@media (max-width: 1280px) {
  .shots-layout {
    grid-template-columns: 220px 1fr 230px;
  }
}

@media (max-width: 1024px) {
  .shots-layout {
    grid-template-columns: 1fr;
  }
}

/* ===== Video selector tab ===== */
.video-selector-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: var(--s-4);
  align-items: start;
  min-height: calc(100vh - var(--topbar-h) - 130px);
}

.selector-shot-sidebar {
  position: sticky;
  top: var(--s-3);
  align-self: start;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 150px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.selector-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-3);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
}

.selector-sidebar-head span:last-child {
  color: var(--text-3);
  font-weight: 600;
}

.selector-shot-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--s-2);
  overflow: auto;
}

.selector-shot-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text);
  text-align: start;
  cursor: pointer;
}

.selector-shot-item:hover {
  background: var(--surface-hover);
}

.selector-shot-item.is-active {
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 26%, var(--border));
}

.selector-shot-thumb {
  width: 48px;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-pressed);
}

.selector-shot-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.selector-shot-title,
.selector-assign-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selector-shot-title {
  font-size: 13px;
  font-weight: 650;
}

.selector-shot-meta {
  font-size: 11.5px;
  color: var(--text-3);
}

.selector-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.selector-main-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}

.selector-main-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.selector-main-head p {
  margin: 3px 0 0;
  color: var(--text-3);
  font-size: 12.5px;
}

.selector-main-hint {
  margin-top: 2px !important;
  font-size: 12px !important;
  line-height: 1.45;
  max-width: 42rem;
}

.selector-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--s-2);
}

.selector-exclude-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 10px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-2);
}

.selector-exclude-row.is-checked {
  color: var(--danger, #ef4444);
  border-color: color-mix(in srgb, var(--danger, #ef4444) 32%, var(--border));
}

.selector-primary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.selector-primary-player {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 0;
  align-items: stretch;
}

.selector-primary-player .vplayer-wrap {
  border-radius: 0;
  background: #050505;
}

.selector-primary-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: var(--s-4);
  border-inline-start: 1px solid var(--border);
}

.selector-primary-label,
.selector-primary-badge,
.selector-sequence-badge,
.selector-video-tags span,
.selector-video-tags .res-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  border-radius: var(--r-pill);
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 650;
}

.selector-primary-label,
.selector-primary-badge {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
}

.selector-primary-meta strong {
  font-size: 16px;
  line-height: 1.3;
}

.selector-primary-meta span:last-child {
  color: var(--text-3);
  font-size: 12px;
}

.selector-primary-empty,
.selector-no-videos,
.selector-empty-state {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  color: var(--text-3);
  text-align: center;
}

.selector-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s-3);
}

.selector-video-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.selector-video-card.is-selected {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.selector-video-card.is-primary {
  box-shadow:
    var(--shadow-xs),
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
}

.selector-video-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  background: #0a0a0a;
  overflow: hidden;
  cursor: zoom-in;
}

.selector-video-thumb-wrap {
  position: relative;
}

.selector-video-fav-btn {
  position: absolute;
  bottom: 8px;
  inset-inline-start: 8px;
  z-index: 3;
}

.selector-video-thumb video,
.selector-video-thumb img,
.selector-shot-thumb img,
.selector-shot-thumb video,
.selector-assign-thumb video,
.selector-assign-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.selector-primary-badge,
.selector-sequence-badge {
  position: absolute;
  top: 8px;
  z-index: 2;
}

.selector-primary-badge {
  inset-inline-start: 8px;
}

.selector-sequence-badge {
  inset-inline-end: 8px;
  min-width: 24px;
  justify-content: center;
  background: rgba(17, 24, 39, 0.82);
  color: #fff;
}

.video-fav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  transition:
    background 0.12s,
    color 0.12s,
    transform 0.12s;
}

.video-fav-toggle:hover {
  background: rgba(0, 0, 0, 0.72);
  transform: scale(1.05);
}

.video-fav-toggle.is-on {
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
}

.video-fav-toggle.is-on svg {
  fill: currentColor;
}

.video-fav-badge {
  position: absolute;
  bottom: 6px;
  inset-inline-start: 6px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.92);
  color: #fff;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.video-fav-badge svg {
  fill: currentColor;
}

.ws-version .video-fav-badge {
  bottom: auto;
  top: 4px;
  inset-inline-start: 4px;
  width: 18px;
  height: 18px;
}

.selector-video-body {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-3);
}

.selector-video-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
}

.selector-video-title-row h3 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
}

.selector-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-3);
  cursor: pointer;
}

.selector-video-card.is-primary .selector-icon-btn {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}

.selector-video-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.selector-video-tags span,
.selector-video-tags .res-badge {
  background: var(--surface-pressed);
  color: var(--text-2);
}

.selector-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-2);
}

.selector-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.selector-card-actions .btn[disabled],
.selector-head-actions .btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.selector-trim-modal,
.selector-assign-modal {
  width: 100%;
}

/* Trim modal - clean fixed viewport */
.modal-backdrop:has(.selector-trim-modal) {
  padding: var(--s-3);
}

.modal.modal-lg:has(.selector-trim-modal) {
  width: min(1040px, 96vw);
  max-width: min(1040px, 96vw);
  height: min(90vh, 700px);
  max-height: min(90vh, 700px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.selector-trim-modal {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  color: var(--text);
  background: var(--surface);
  border-radius: inherit;
}

.selector-trim-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-shrink: 0;
  margin: 0;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.selector-trim-modal .modal-footer {
  flex-shrink: 0;
  margin: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.selector-trim-modal .modal-close {
  flex-shrink: 0;
}

.selector-trim-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.selector-trim-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: 8px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.selector-trim-title-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.selector-trim-title-main {
  font-size: 16px;
  font-weight: 750;
  line-height: 1.2;
  color: var(--text);
}

.selector-trim-title-sub {
  max-width: min(520px, 52vw);
  overflow: hidden;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selector-trim-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface-2) 78%, var(--surface));
}

.selector-trim-top {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 270px);
  gap: 12px;
  overflow: hidden;
}

.selector-trim-player-col {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #050505;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.selector-trim-video {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #050505;
  border-radius: 0;
}

.selector-trim-player {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: #050505;
}

.selector-trim-player .vplayer-video {
  width: 100%;
  height: 100%;
  max-height: none !important;
  object-fit: contain;
  background: #050505;
}

.selector-trim-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.selector-trim-side-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 2px;
}

.selector-trim-side-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
}

.selector-trim-side-sub {
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.35;
}

.selector-trim-strip {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: visible;
  box-shadow: var(--shadow-xs);
}

.selector-trim-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.selector-trim-strip-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0;
}

.selector-trim-strip-meta {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  font-size: 12px;
}

.selector-trim-track-wrap {
  padding: 24px 14px 6px;
  overflow: visible;
}

.selector-trim-ruler {
  position: relative;
  height: 18px;
  margin-bottom: 5px;
  flex-shrink: 0;
  user-select: none;
  pointer-events: none;
}

.selector-trim-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  margin-inline-start: -0.5px;
  background: color-mix(in srgb, var(--text-3) 35%, transparent);
}

.selector-trim-tick.is-major {
  background: color-mix(in srgb, var(--text-2) 55%, transparent);
}

.selector-trim-tick-label {
  position: absolute;
  top: 0;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  white-space: nowrap;
  direction: ltr;
}

.selector-trim-track {
  position: relative;
  height: 44px;
  flex-shrink: 0;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface) 74%, #111) 0%,
    color-mix(in srgb, var(--surface) 56%, #000) 100%
  );
  border: 1px solid var(--border-strong, var(--border));
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  touch-action: none;
  overflow: visible;
}

.selector-trim-dim {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.38);
  pointer-events: none;
}

.selector-trim-dim--left {
  left: 0;
}

.selector-trim-dim--right {
  right: 0;
}

.selector-trim-sel {
  position: absolute;
  top: 0;
  bottom: 0;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border-left: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
  pointer-events: none;
}

.selector-trim-handle {
  position: absolute;
  top: -5px;
  bottom: -5px;
  width: 18px;
  margin-inline-start: -9px;
  border-radius: 6px;
  cursor: ew-resize;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--accent);
  box-shadow:
    0 0 0 2px var(--surface),
    0 3px 12px rgba(0, 0, 0, 0.28);
}

.selector-trim-handle--in,
.selector-trim-handle--out {
  background: var(--accent);
}

.selector-trim-handle-tag {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1;
  pointer-events: none;
}

.selector-trim-handle::before {
  content: "";
  width: 2px;
  height: 16px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    4px 0 0 rgba(255, 255, 255, 0.9),
    -4px 0 0 rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

.selector-trim-handle-label {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  direction: ltr;
  pointer-events: none;
  line-height: 1.3;
  box-shadow: var(--shadow-xs);
}

.selector-trim-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-inline-start: -1px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 2;
}

.selector-trim-playhead::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #fff;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.35));
}

.selector-trim-meta-row,
.selector-trim-range-meta,
.selector-trim-strip-meta .selector-trim-range-meta {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  color: var(--text);
}

.selector-trim-duration {
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.3;
}

.selector-trim-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex-shrink: 0;
}

.selector-trim-quick-actions .btn {
  justify-content: center;
  min-width: 0;
  padding-inline: 8px;
  font-size: 12px;
  min-height: 34px;
  border-radius: 8px;
}

.selector-trim-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  flex-shrink: 0;
}

.selector-trim-fields label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 650;
  color: var(--text-2);
}

.selector-trim-number {
  direction: ltr;
  text-align: left;
  padding-block: 6px;
  font-size: 13px;
}

.selector-trim-footer {
  justify-content: flex-end;
  gap: 8px;
}

.selector-trim-footer .btn {
  min-height: 36px;
}

.selector-assign-body {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-4);
  max-height: min(70vh, 680px);
  overflow: auto;
}

.selector-assign-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  border: 1px dashed var(--border-strong, var(--border));
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  font-weight: 650;
}

.selector-assign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--s-3);
}

.selector-assign-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  text-align: start;
  cursor: pointer;
}

.selector-assign-item.is-selected {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.selector-assign-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-sm);
  background: #0a0a0a;
  overflow: hidden;
}

.selector-assign-check {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.88);
  color: var(--accent);
}

.selector-empty-inline {
  padding: var(--s-5);
  text-align: center;
  color: var(--text-3);
}

@media (max-width: 760px) {
  .modal.modal-lg:has(.selector-trim-modal) {
    width: min(96vw, 680px);
    max-width: 96vw;
    height: min(92vh, 680px);
    max-height: 92vh;
    padding: 0;
  }

  .selector-trim-modal .modal-header {
    padding: 12px 14px;
  }

  .selector-trim-title-sub {
    max-width: 52vw;
  }

  .selector-trim-body {
    padding: 10px;
    overflow: auto;
  }

  .selector-trim-top {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(190px, 1fr) auto;
    overflow: visible;
  }

  .selector-trim-side {
    overflow: visible;
  }

  .selector-trim-quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selector-trim-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-2);
  }

  .selector-trim-fields label {
    flex: 1;
  }

  .selector-trim-track-wrap {
    padding-inline: 12px;
  }
}

@media (max-width: 1100px) {
  .video-selector-layout,
  .selector-primary-player {
    grid-template-columns: 1fr;
  }

  .selector-shot-sidebar {
    position: static;
    max-height: none;
  }

  .selector-shot-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }

  .selector-primary-meta {
    border-inline-start: none;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 720px) {
  .selector-main-head {
    align-items: stretch;
    flex-direction: column;
  }

  .selector-head-actions {
    justify-content: stretch;
  }

  .selector-head-actions .btn {
    flex: 1;
  }

  .selector-video-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Shot rail (left) ===== */
.shot-rail {
  padding: var(--s-3);
  position: sticky;
  top: var(--s-3);
  height: var(--shots-col-h, calc(100vh - var(--topbar-h) - 80px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rail-add-btn {
  margin-top: var(--s-2);
  flex-shrink: 0;
}

/* .rail-section-title replaced by panel-header-row - see workspace-tools.css */

.rail-list {
  flex: 1;
  overflow-y: auto;
  margin-top: var(--s-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rail-item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.rail-item:hover {
  background: var(--surface-hover);
}
.rail-item.active {
  background: var(--accent-soft);
}

/* Archive + delete stack vertically so together they take one button's
   width instead of two, leaving more room for the title/status text. */
.rail-item-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

/* Delete shot button */
.rail-delete-btn {
  width: 20px;
  height: 20px;
  border-radius: var(--r-sm);
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s;
  flex-shrink: 0;
  padding: 0;
}

.rail-item:hover .rail-delete-btn {
  opacity: 0.6;
}

.rail-delete-btn:hover:not(:disabled) {
  background: var(--danger-soft, #fef2f2);
  color: var(--danger, #ef4444);
  opacity: 1;
}

.rail-delete-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

/* Archive shot button - same shape as delete, neutral (non-destructive) hover */
.rail-archive-btn {
  width: 20px;
  height: 20px;
  border-radius: var(--r-sm);
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s;
  flex-shrink: 0;
  padding: 0;
}

.rail-item:hover .rail-archive-btn {
  opacity: 0.6;
}

.rail-archive-btn:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent);
  opacity: 1;
}

.rail-archive-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

/* Archive section - collapsed by default, sits below the active shots list */
.rail-archive-section {
  flex-shrink: 0;
  border-top: 1px solid var(--divider);
  margin-top: var(--s-2);
  padding-top: var(--s-2);
}

.rail-archive-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  background: transparent;
  border: none;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  border-radius: var(--r-sm);
}

.rail-archive-toggle:hover {
  background: var(--surface-hover);
  color: var(--text-2);
}

.rail-archive-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
  max-height: 240px;
  overflow-y: auto;
}

.archive-item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 8px;
  border-radius: var(--r-sm);
  opacity: 0.7;
}

.archive-item:hover {
  opacity: 1;
  background: var(--surface-hover);
}

.rail-restore-btn {
  width: 22px;
  height: 22px;
  border-radius: var(--r-sm);
  background: transparent;
  border: none;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  padding: 0;
}

.rail-restore-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Drag-and-drop states */
.rail-item.dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.rail-item.drag-over {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: var(--accent-soft);
}

/* A video from the panel is being dragged over this shot - drop to move it. */
.rail-item--video-drop {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
  background: var(--accent-soft);
}

.panel-video-thumb.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

/* Insert between slots */
.rail-insert {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  margin: -2px 0;
}

.rail-list:hover .rail-insert {
  opacity: 0.5;
}

.rail-insert:hover {
  opacity: 1 !important;
}

.rail-insert.drag-over {
  opacity: 1 !important;
}

.rail-insert.drag-over .rail-insert-line {
  background: var(--accent);
  height: 2px;
}

.rail-insert-line {
  flex: 1;
  height: 1px;
  background: var(--border-strong);
  transition: background 0.15s;
}

.rail-insert:hover .rail-insert-line {
  background: var(--accent);
}

.rail-insert-plus {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-2);
  font-weight: 600;
  transition: all 0.15s;
}

.rail-insert:hover .rail-insert-plus {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.rail-num {
  width: 22px;
  height: 22px;
  border-radius: var(--r-pill);
  background: var(--surface-pressed);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.rail-item.active .rail-num {
  background: var(--accent);
  color: white;
}

/* Archived shots sit outside the active numbering sequence - an icon instead
   of a number avoids looking like a duplicate/out-of-order active shot. */
.rail-num--archived {
  background: transparent;
  border: 1px dashed var(--border-strong);
  color: var(--text-3);
}

.rail-thumb {
  width: 42px;
  height: 28px;
  border-radius: 5px;
  background: var(--surface-pressed);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  overflow: hidden;
}

.rail-thumb-empty {
  background: repeating-linear-gradient(
    45deg,
    var(--surface-pressed),
    var(--surface-pressed) 4px,
    var(--surface-hover) 4px,
    var(--surface-hover) 8px
  );
}

.rail-thumb.media-thumb--video {
  overflow: hidden;
}

.media-thumb--video .media-thumb-video-el,
.rail-thumb .media-thumb-img-el,
.workshop-shot-thumb .media-thumb-img-el,
.shots-overview-thumb .media-thumb-img-el,
.frame-slot-image--video-fb .frame-slot-video-fb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.frame-slot.has-video-fallback .frame-slot-overlay--video-fb {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, transparent 50%);
}

.rail-info {
  flex: 1;
  min-width: 0;
}

.shot-performance-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  line-height: 0;
  flex-shrink: 0;
}

.shot-performance-badge .ui-icon,
.shot-performance-badge .ui-icon svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: inherit;
}

.shot-performance-badge[data-kind="audio"] {
  color: var(--purple);
}

.shot-performance-badge[data-kind="motion"] {
  color: var(--orange);
}

.rail-status .shot-performance-badge {
  margin-inline-start: auto;
}

.rail-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  cursor: text;
  border-radius: 3px;
  padding: 1px 3px;
  margin: -1px -3px;
  transition: background 0.12s;
}

.rail-title:hover {
  background: var(--surface-hover);
}

.rail-title-input {
  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%;
}

.rail-status {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  font-size: 11px;
  line-height: 1;
  color: var(--text-3);
  margin-top: 2px;
  min-width: 0;
}

.rail-status-label {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  line-height: 1;
}

.status-pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.status-pip.status-empty {
  background: var(--text-muted);
}
.status-pip.status-prompt {
  background: var(--accent);
}
.status-pip.status-image {
  background: var(--purple);
}
.status-pip.status-pick {
  background: var(--orange);
}
.status-pip.status-done {
  background: var(--green);
}
.status-pip.status-editing {
  background: var(--indigo);
}
.status-pip.status-skip {
  background: var(--text-3);
}

.rail-item--excluded .rail-title {
  opacity: 0.72;
}

/* ===== Shot stage (workspace) ===== */
.shot-stage {
  display: flex;
  flex-direction: column;
  gap: 0;
  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));
  overflow: hidden;
  min-width: 0;
}

.stage-bar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-2) var(--s-3);
  box-shadow: var(--shadow-xs);
}

.stage-position {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  padding: 0 var(--s-2);
}

/* Frame chooser: start → end */
.frame-chooser {
  display: grid;
  grid-template-columns: 1fr 32px 1fr;
  gap: var(--s-3);
  /* start (not stretch): stretch + min-height:0 lets the row collapse and
     kills the inline project aspect-ratio, so a loaded frame shrinks to a
     thin chip strip. Height must come only from aspect-ratio × column width. */
  align-items: start;
}

.keyframe-plan-label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-3);
  line-height: 1.2;
}

.keyframe-plan-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
  padding-block: 2px;
  padding-inline: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--border) 88%, var(--text-3));
  background: color-mix(in srgb, var(--text) 3.5%, var(--surface));
  border-radius: var(--r-pill);
  font-weight: 600;
  color: var(--text-3);
}

.keyframe-plan-planned {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.keyframe-plan-ico {
  display: inline-flex;
  flex-shrink: 0;
  opacity: 0.48;
  line-height: 0;
  color: inherit;
}

.keyframe-plan-ico svg {
  width: 10px;
  height: 10px;
  display: block;
}

.keyframe-plan-override,
.keyframe-plan-note {
  font-weight: 500;
  opacity: 0.9;
}

.keyframe-plan-note {
  flex: 1 1 12em;
  min-width: 0;
}

.keyframe-plan-override::before,
.keyframe-plan-note::before {
  content: "·";
  margin-inline-end: 6px;
  opacity: 0.55;
}

.frame-slot {
  background: var(--surface);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
  width: 100%;
  /* Do not set a fixed min-height — it fights project.settings.aspect.
     min-height:auto lets the inline aspect-ratio size the box from width. */
  min-height: auto;
  transition:
    border-color 0.15s,
    background 0.15s,
    opacity 0.15s;
  /* aspect-ratio is set inline from project.settings.aspect so the slot
     keeps the project's frame shape whether or not it has an image. */
}

/* End-frame slot when the selected model doesn't support it */
.frame-slot.frame-slot-disabled {
  border-style: dashed;
  border-color: var(--border);
  pointer-events: none;
  cursor: default;
}

.frame-slot.frame-slot-disabled:not(.has-image) {
  opacity: 0.45;
}

.frame-slot.frame-slot-disabled.has-image {
  border-style: solid;
  border-color: var(--border);
  background: var(--surface-2, #f0f0f2);
}

.frame-slot-image--inactive {
  z-index: 0;
}

.frame-slot-image--inactive img {
  filter: grayscale(1);
  opacity: 0.42;
  cursor: default;
}

.frame-slot-disabled-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--s-2);
}

.frame-slot-disabled-inner--overlay {
  z-index: 1;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}

.frame-slot-label-static {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.frame-slot-disabled-msg {
  font-size: 10px;
  color: var(--text-3);
  text-align: center;
  line-height: 1.3;
}

.frame-slot.has-image {
  border-style: solid;
  border-color: var(--border);
  background: var(--surface);
}

.frame-slot.required:not(.has-image) {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.frame-slot-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 var(--s-2);
}

.frame-slot.has-image .frame-slot-label {
  position: absolute;
  top: var(--s-2);
  inset-inline-start: var(--s-2);
  z-index: 1;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 2px 8px;
  border-radius: var(--r-xs);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.req-mark {
  color: var(--accent);
  margin-inline-start: 4px;
}

.frame-slot-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  cursor: pointer;
  color: var(--text-3);
  transition: color 0.15s;
}

.frame-slot-empty:hover {
  color: var(--text);
}

.frame-slot-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition:
    background 0.15s var(--ease-out),
    border-color 0.15s var(--ease-out),
    color 0.15s var(--ease-out);
}

.frame-slot-icon svg {
  width: 17px;
  height: 17px;
}

.frame-slot-hint {
  font-size: 12px;
  font-weight: 500;
}

/* Empty slot: identity block (icon + title) over one balanced action pair */
.frame-slot-empty-btns {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  padding: var(--s-3);
  box-sizing: border-box;
  overflow: hidden;
}

.frame-slot-empty-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
}

/* Hovering anywhere on the empty slot warms the whole drop target */
.frame-slot:not(.has-image):not(.frame-slot-disabled):hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong));
  background: color-mix(in srgb, var(--accent-soft) 25%, var(--surface));
}

.frame-slot:not(.has-image):not(.frame-slot-disabled):hover .frame-slot-icon {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}

.frame-slot-hint-text {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-2);
  text-align: center;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Two equal columns - neither label's length can unbalance the pair */
.frame-slot-btn-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  max-width: 240px;
}

.frame-slot-empty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition:
    background 0.15s var(--ease-out),
    border-color 0.15s var(--ease-out),
    color 0.15s var(--ease-out),
    box-shadow 0.15s var(--ease-out);
}

.frame-slot-empty-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text);
}

.frame-slot-empty-btn:active {
  background: var(--surface-pressed);
}

.frame-slot-empty-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* AI is the lead action: accent tint, still quiet enough for a dashed slot */
.frame-slot-empty-btn--ai {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
  box-shadow: none;
}

.frame-slot-empty-btn--ai:hover {
  background: var(--accent-soft-2);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent);
}

.frame-slot-empty-btn--ai:active {
  background: var(--accent-soft-2);
}

/* A disabled "צור עם AI" (an end frame the plan did not ask for, no opening
   image yet, a prompt still coming) has to LOOK disabled. It used to keep the
   accent tint and the hover, so it read as a button that simply ignored the
   click. The reason is the slot's title. */
.frame-slot-empty-btn:disabled,
.frame-slot-empty-btn:disabled:hover,
.frame-slot-empty-btn:disabled:active {
  background: transparent;
  border-color: var(--border);
  color: var(--text-3);
  box-shadow: none;
  opacity: 0.6;
  cursor: not-allowed;
}

.frame-slot-empty-btn-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: inherit;
}

.frame-slot-empty-btn-ico .ui-icon,
.frame-slot-empty-btn-ico .ui-icon svg {
  width: 13px;
  height: 13px;
}

.frame-slot-empty-btn-ico .ui-icon svg + svg {
  display: none;
}

.frame-slot-empty-btn-label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frame-slot-image {
  position: absolute;
  inset: 0;
}

.frame-slot-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

/* An end frame the clip does not use (its opening was replaced, or the plan's
   ending moved): faded, with one visible way to a new one. */
.frame-slot-image--stale img {
  opacity: 0.45;
  filter: grayscale(0.6);
}

.frame-slot-redo {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--text-on-accent);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.frame-slot-redo:hover:not(:disabled) {
  filter: brightness(1.08);
}

.frame-slot-redo:disabled {
  opacity: 0.55;
  cursor: default;
}

/* On touch / narrow screens the status line sits at the bottom of the
   picture (workspace-tools.css), so the button moves to the middle. */
@media (hover: none), (max-width: 768px) {
  .frame-slot-redo {
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
  }
}

.frame-slot-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: none;
  display: block;
  padding: 0;
  opacity: 1;
  pointer-events: none;
}

/* Action chips stay visible; only the chips themselves receive clicks */
.frame-slot.has-image .frame-slot-overlay {
  opacity: 1;
}

/* Top-left AI + menu chips — quiet site-style */
.frame-slot-action-bar {
  position: absolute;
  top: 8px;
  left: 8px;
  right: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
  z-index: 3;
}

.frame-slot-ai-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--accent);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    background 0.15s var(--ease-out),
    border-color 0.15s var(--ease-out),
    color 0.15s var(--ease-out),
    box-shadow 0.15s var(--ease-out);
}

.frame-slot-ai-btn .ui-icon,
.frame-slot-ai-btn .ui-icon svg {
  width: 13px;
  height: 13px;
  color: inherit;
}

.frame-slot-ai-btn-label {
  display: none;
}

.frame-slot-ai-btn:hover,
.frame-slot-ai-btn.is-open {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--accent);
  box-shadow: var(--shadow-xs);
}

.frame-slot-ai-btn:active {
  background: var(--surface-pressed);
}

.frame-slot-ai-btn:disabled,
.frame-slot-ai-btn:disabled:hover,
.frame-slot-ai-btn:disabled:active {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-3);
  opacity: 0.6;
  cursor: not-allowed;
}

.frame-slot-actions-menu {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: max-content;
  max-width: 176px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(14, 28, 48, 0.12));
}

.frame-slot-actions-menu-item {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: calc(var(--r-md) - 3px);
  background: transparent;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  text-align: start;
  cursor: pointer;
  transition:
    background 0.12s var(--ease-out),
    color 0.12s var(--ease-out);
}

.frame-slot-actions-menu-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--text-2);
  pointer-events: none;
}

.frame-slot-actions-menu-ico .ui-icon,
.frame-slot-actions-menu-ico .ui-icon svg {
  width: 13px !important;
  height: 13px !important;
}

.frame-slot-actions-menu-ico .ui-icon svg + svg {
  display: none;
}

.frame-slot-actions-menu-label {
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frame-slot-actions-menu-item:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.frame-slot-actions-menu-item:hover .frame-slot-actions-menu-ico {
  color: var(--accent);
}

.frame-slot-actions-menu-item.is-danger {
  color: var(--text-2);
}

.frame-slot-actions-menu-item.is-danger:hover {
  background: rgba(214, 69, 69, 0.1);
  color: #d64545;
}

.frame-slot-actions-menu-item.is-danger:hover .frame-slot-actions-menu-ico {
  color: #d64545;
}

.frame-fix-chooser {
  min-width: min(100%, 360px);
}

.frame-fix-chooser .modal-header {
  margin-bottom: var(--s-4);
}

.frame-fix-chooser-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.frame-fix-chooser-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: start;
  transition:
    background 0.12s var(--ease-out),
    border-color 0.12s var(--ease-out),
    box-shadow 0.12s var(--ease-out);
}

.frame-fix-chooser-btn:hover {
  background: var(--accent-soft);
  border-color: var(--border-strong);
}

.frame-fix-chooser-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.frame-fix-chooser-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  background: var(
    --accent-soft,
    color-mix(in srgb, var(--accent) 12%, transparent)
  );
  color: var(--accent);
}

.frame-fix-chooser-ico .ui-icon,
.frame-fix-chooser-ico .ui-icon svg {
  width: 18px;
  height: 18px;
}

.frame-fix-chooser-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.frame-fix-chooser-label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.frame-fix-chooser-hint {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-2);
}

/* Disabled / legacy chip remove button */
.frame-slot-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.15s;
  flex-shrink: 0;
}

.frame-slot-action-btn:hover {
  background: rgba(0, 0, 0, 0.82);
}

.frame-slot-action-remove:hover {
  background: rgba(200, 40, 40, 0.82);
}

.frame-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-muted);
  font-weight: 300;
}

.frame-swap-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}

.frame-swap-btn:hover:not(:disabled) {
  background: var(--surface-3);
  color: var(--text-1);
  border-color: var(--border-strong);
}

.frame-swap-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.frame-swap-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Touch devices: always show the icon chips (no hover available). */
/* (Handled above with .frame-slot.has-image .frame-slot-overlay) */

/* Mobile: tighten frame-slot buttons - layout/stacking is handled by polish.css */
@media (max-width: 640px) {
  .frame-slot-overlay .btn {
    font-size: 11px;
    padding: 3px 8px;
    line-height: 1.4;
    min-height: 0;
  }
  .frame-slot-empty-btn {
    height: 26px;
    padding: 0 7px;
    font-size: 11px;
  }
}

/* Stage fields */
.stage-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stage-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field-hint-inline {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Prompt card */
.prompt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  box-shadow: var(--shadow-xs);
}

.prompt-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--s-3);
}

.prompt-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.prompt-card-hint {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.prompt-explanation {
  background: var(--accent-soft);
  padding: var(--s-3);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
}

.prompt-explanation-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.textarea-mono {
  font-family: "SF Mono", Consolas, monospace !important;
  font-size: 12px !important;
  direction: ltr;
  text-align: left;
  background: var(--surface-2) !important;
}

/* Generate row */
.generate-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.step-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.duration-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  padding: 4px 10px;
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--text-2);
  border: 1px solid var(--border);
}

.input-tiny {
  width: 56px !important;
  padding: 4px 8px !important;
  font-size: 13px !important;
}

/* Video result */
.video-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-3);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  box-shadow: var(--shadow-xs);
}

.video-result-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.video-result-frame {
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--r-sm);
  overflow: hidden;
  position: relative;
}

.video-result-frame video,
.video-result-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-placeholder-tag {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 10px;
  border-radius: 4px;
  font-weight: 500;
}

.video-result-actions {
  display: flex;
  gap: var(--s-2);
  justify-content: flex-end;
}

.stage-footer {
  margin-top: var(--s-2);
}

/* ===== Library panel (right) - kept for reference ===== */
.library-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-3);
  box-shadow: var(--shadow-xs);
  position: sticky;
  top: var(--s-3);
  height: calc(100vh - var(--topbar-h) - 100px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.library-tabs {
  display: flex;
  gap: 2px;
  background: var(--surface-pressed);
  border-radius: var(--r-sm);
  padding: 2px;
  margin-bottom: var(--s-3);
}

.library-tab {
  flex: 1;
  padding: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  border-radius: 6px;
  cursor: pointer;
}

.library-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

.library-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--s-3);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--divider);
}

.library-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.library-item {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.15s;
}

.library-item:hover {
  border-color: var(--border-strong);
}

.library-item.in-use {
  border-color: var(--accent);
}

.library-item-thumb {
  aspect-ratio: 16/9;
  background: var(--surface-pressed);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.library-item-thumb img,
.library-item-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.library-item-info {
  padding: 6px 8px;
}

.library-item-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-item-meta {
  font-size: 10px;
  color: var(--text-3);
}

.library-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-top: 1px solid var(--divider);
  background: var(--surface);
}

.library-item-actions .btn {
  flex: 1;
  font-size: 11px;
  padding: 4px 6px;
}

.library-item-actions .btn-icon {
  flex: 0;
  width: 24px;
  height: 24px;
}

.library-empty {
  padding: var(--s-5) var(--s-3);
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* Image picker grid */
.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--s-2);
  max-height: 400px;
  overflow-y: auto;
  padding: 4px;
}

.picker-item {
  aspect-ratio: 16/9;
  border-radius: var(--r-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: all 0.15s;
}

.picker-item:hover {
  border-color: var(--accent);
  transform: scale(1.03);
}

.picker-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--s-2);
}

/* ===== Workshop Tab ===== */

/* Glowing accent on the tab button */
.wtab--workshop {
  position: relative;
}
.wtab--workshop.active {
  color: var(--accent);
}

/* Three-column layout (RTL):
 *   right   → compact shot list
 *   center  → ONE stage card: live preview (also the effects monitor) + versions
 *   left    → ONE options panel: action menu + the selected action's full options
 */
.workshop-grid {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) 480px;
  grid-template-areas: "shots stage options";
  gap: var(--s-3);
  align-items: stretch;
  min-height: calc(100vh - var(--topbar-h) - 120px);
}

.workshop-grid > .workshop-shot-list {
  grid-area: shots;
}
.ws-area-stage {
  grid-area: stage;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.ws-area-options {
  grid-area: options;
  min-width: 0;
  --ws-pad: 10px;
  --ws-gap: 8px;
  --ws-gap-lg: 10px;
  --ws-text: 12px;
  --ws-text-sm: 11px;
  --ws-text-xs: 10px;
  --ws-label: 10px;
  --ws-grid-gap: 6px;
  --ws-btn-h: 32px;
}

@media (max-width: 1100px) {
  .workshop-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "shots"
      "stage"
      "options";
  }
  .workshop-grid > .workshop-shot-list {
    max-height: none;
    position: static;
  }
  .workshop-shot-items {
    display: flex;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px;
    scroll-snap-type: x proximity;
  }
  .workshop-shot-item {
    flex: 0 0 88px;
    scroll-snap-align: start;
    border-bottom: none;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
  }
  .workshop-shot-item.active {
    border-color: var(--accent);
  }
  .ws-area-options {
    height: auto;
    max-height: none;
    position: static;
  }
  .ws-options-split {
    flex-direction: column;
    overflow: visible;
  }

  .ws-options-content:has(.ws-wan-panel) {
    display: block;
    overflow-y: visible;
    flex: none;
  }
  .ws-wan-panel {
    flex: none;
    overflow: visible;
  }
  .ws-wan-grid-scroll {
    flex: none;
    overflow: visible;
    max-height: none;
  }
}

/* ── Shot list sidebar ──────────────────────────────────── */
.workshop-shot-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  position: sticky;
  top: var(--s-3);
  max-height: calc(100vh - var(--topbar-h) - 100px);
  display: flex;
  flex-direction: column;
}

.workshop-shot-list-header {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
  text-align: center;
}

.workshop-shot-items {
  overflow-y: auto;
  flex: 1;
  padding: 4px;
}

/* Scene banner in the shot sidebar. Derived from the plan's parts on render
   (resolveShotScenes), never stored - a re-plan can't strand a shot under a
   scene that no longer exists. Hidden entirely when no run has a scene, so an
   unplanned project keeps the flat list it always had. */
.workshop-scene-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 5px 4px;
  margin-top: 4px;
  border-bottom: 1px solid var(--divider);
}

.workshop-scene-head:first-child {
  margin-top: 0;
}

.workshop-scene-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workshop-scene-count {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.workshop-scene-head.is-unscened .workshop-scene-name {
  font-weight: 600;
  color: var(--text-3);
}

.workshop-shot-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 4px;
  cursor: pointer;
  transition:
    background 0.12s,
    box-shadow 0.12s;
  border-radius: var(--r-sm);
  margin-bottom: 3px;
}

.workshop-shot-item:last-child {
  margin-bottom: 0;
}

.workshop-shot-item:hover {
  background: var(--surface-hover);
}

.workshop-shot-item.active {
  background: var(--accent-soft);
  /* box-shadow: inset 0 0 0 1.5px var(--accent); */
}

.workshop-shot-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: var(--r-sm);
  background-size: cover;
  background-position: center;
  background-color: var(--surface-2);
  flex-shrink: 0;
  overflow: hidden;
}

.workshop-shot-thumb--empty {
  background-image: none;
  border: 1.5px dashed var(--border);
}

.workshop-shot-thumb.media-thumb--video {
  overflow: hidden;
}

.workshop-shot-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  text-align: center;
}

.workshop-shot-num {
  font-size: 9px;
  color: var(--text-3);
  font-weight: 600;
  line-height: 1;
}

.workshop-shot-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
}

.workshop-shot-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.workshop-shot-status-label {
  font-size: 9px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ── Main content area ──────────────────────────────────── */
.workshop-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.workshop-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 240px;
  color: var(--text-3);
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

/* ── Top bar: shot name + send-to-editor ────────────────── */
.ws-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 10px var(--s-4);
  box-shadow: var(--shadow-xs);
}

.ws-topbar-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ws-topbar-num {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.ws-topbar-desc {
  font-size: 13px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-send-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── Preview row: video player + color section ──────────── */
.ws-preview-row {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: var(--s-4);
  align-items: start;
}

@media (max-width: 1100px) {
  .ws-preview-row {
    grid-template-columns: 1fr;
  }
}

/* ── Sub-tabs (color / effects / ai) ────────────────────── */
.ws-subtabs {
  display: inline-flex;
  gap: 2px;
  background: var(--surface-pressed);
  border-radius: var(--r-md);
  padding: 3px;
  align-self: flex-start;
}

.ws-subtab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.12s;
}

.ws-subtab:hover {
  color: var(--text);
}

.ws-subtab.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-xs);
}

.ws-subtab-badge {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: var(--r-pill);
  padding: 1px 7px;
}

.ws-subview {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.ws-fx-empty {
  padding: 40px;
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

/* ── Inline VFX studio (no modal chrome) ────────────────── */
.vfx-studio--inline {
  display: flex;
  flex-direction: column;
  direction: rtl;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  height: min(760px, 80vh);
}

/* ── Video player wrapper ───────────────────────────────── */
.ws-preview-wrap {
  position: relative;
  background: #000;
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  max-height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}
/* Blurred poster behind the main edit-window player while it buffers - same
   blur-up as the media lightbox. Removed the moment the clip can play. */
.ws-preview-wrap img.ws-preview-blur {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: blur(14px) saturate(1.05);
  transform: scale(1.06);
  z-index: 2;
  pointer-events: none;
}
/* The "טוען…" veil in the preview follows wirePreviewLoader's is-hidden. */
.ws-preview-veil.is-hidden {
  opacity: 0;
  pointer-events: none;
}
/* Suppress attachMediaFallback's OWN opaque "טוען…/טוען מחדש…" overlay inside
   the preview - it has a solid backdrop (z-index 5) that hid our blurred
   poster + clean pill. Its retry/recovery behaviour is untouched; only the
   duplicate visual is removed. */
.ws-preview-wrap .media-loading::before,
.ws-preview-wrap .media-loading::after,
.ws-preview-wrap .media-load-failed::before {
  content: none !important;
  background: none !important;
  animation: none !important;
}

.ws-preview-wrap video,
.ws-preview-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ws-preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  width: 100%;
  color: #666;
}

.ws-preview-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.45);
  opacity: 0.85;
}

.ws-preview-empty-text {
  font-size: 14px;
  font-weight: 600;
}

.ws-preview-empty-hint {
  font-size: 12px;
  opacity: 0.7;
}

/* ── Generic section card ───────────────────────────────── */
.ws-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  box-shadow: var(--shadow-xs);
}

.ws-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--s-3);
}

.ws-section-icon {
  color: var(--accent);
  display: flex;
  align-items: center;
}

.ws-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.ws-section-hint {
  font-size: 11px;
  color: var(--text-3);
}

/* ── Color & Look ───────────────────────────────────────── */
.ws-color-panel {
  max-width: none;
}

.ws-color-panel > .ws-ai-step-section {
  padding-top: 12px;
  padding-bottom: 12px;
}

.ws-color-panel > .ws-ai-step-section:last-of-type {
  padding-bottom: 0;
}

.ws-color-footer {
  margin-top: 4px;
}

.ws-color-footer .btn {
  width: 100%;
  justify-content: center;
}

.ws-color-actions {
  display: flex;
  align-items: stretch;
  gap: var(--ws-grid-gap);
  margin-bottom: 0;
}

.ws-fit-panel > .ws-ai-step-section {
  padding-top: 12px;
  padding-bottom: 12px;
}

.ws-fit-panel > .ws-ai-step-section:last-of-type {
  padding-bottom: 0;
}

.ws-fit-panel .ws-check.ws-runway-opt-check {
  margin-top: 2px;
}

.ws-fit-panel .ws-check.ws-runway-opt-check.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.ws-fit-footer {
  margin-top: 4px;
}

.ws-fit-footer .btn {
  width: 100%;
  justify-content: center;
}

.ws-fit-blur-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  font-size: var(--ws-text-sm);
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}

.ws-fit-blur-row.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ws-fit-blur-row input {
  accent-color: var(--accent);
}

.ws-trim-panel {
  max-width: none;
}

.ws-trim-panel .ws-action-scroll > .ws-ai-step-section,
.ws-trim-panel > .ws-ai-step-section {
  padding-top: 12px;
  padding-bottom: 12px;
}

.ws-trim-panel .ws-action-scroll > .ws-ai-step-section:first-child,
.ws-trim-panel > .ws-ai-step-section:first-child {
  padding-top: 0;
}

.ws-trim-panel .ws-action-scroll > .ws-ai-step-section:last-of-type,
.ws-trim-panel > .ws-ai-step-section:last-of-type {
  padding-bottom: 0;
}

.ws-trim-empty {
  margin: 0;
  font-size: var(--ws-text-sm, 12px);
  line-height: 1.45;
  color: var(--text-2);
}

.ws-trim-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ws-grid-gap, 6px);
}

.ws-trim-mark-btn {
  justify-content: center;
  min-height: var(--ws-btn-h, 34px);
  width: 100%;
  padding-inline: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--r-xs, 8px);
  font-weight: 600;
  font-size: 12px;
}

.ws-trim-mark-btn:hover {
  background: var(--surface);
  border-color: var(--border-strong, var(--border));
}

.ws-trim-times {
  margin-top: 2px;
}

.ws-trim-time-row {
  grid-template-columns: 58px 1fr 28px;
}

.ws-trim-time-row .selector-trim-number,
.ws-trim-time-row input[type="number"] {
  width: 100%;
  min-width: 0;
  height: 30px;
  direction: ltr;
  text-align: left;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xs, 8px);
}

.ws-trim-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 10px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-xs, 8px);
  background: var(--surface-2);
}

.ws-trim-strip-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-3);
}

.ws-trim-strip-meta .selector-trim-range-meta {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  direction: ltr;
}

.ws-trim-strip-meta .selector-trim-duration {
  font-variant-numeric: tabular-nums;
}

.ws-trim-strip .selector-trim-track-wrap {
  padding: 10px 2px 2px;
}

.ws-trim-strip .selector-trim-ruler {
  height: 14px;
  margin-bottom: 4px;
}

.ws-trim-strip .selector-trim-tick-label {
  font-size: 9px;
}

/* Thin grips — no IN/OUT stamps in workshop. */
.ws-trim-panel .selector-trim-track {
  height: 28px !important;
  border-radius: 6px;
  overflow: visible;
}

.ws-trim-panel .selector-trim-handle,
.ws-trim-panel .ws-trim-grip {
  top: 0 !important;
  bottom: 0 !important;
  width: 8px !important;
  margin-inline-start: -4px !important;
  border-radius: 3px !important;
  gap: 0 !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35) !important;
}

.ws-trim-panel .selector-trim-handle-tag,
.ws-trim-panel .selector-trim-handle-label {
  display: none !important;
}

.ws-trim-panel .selector-trim-handle::before,
.ws-trim-panel .ws-trim-grip::before {
  width: 1px !important;
  height: 8px !important;
  box-shadow:
    2px 0 0 rgba(255, 255, 255, 0.95),
    -2px 0 0 rgba(255, 255, 255, 0.95) !important;
}

.ws-trim-panel .selector-trim-sel {
  border-left-width: 1px;
  border-right-width: 1px;
}

.ws-trim-panel .selector-trim-playhead::before {
  border-width: 4px;
}

.ws-trim-footer {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.ws-trim-footer .btn {
  flex: 1 1 calc(50% - 4px);
  width: auto;
  min-width: 0;
  justify-content: center;
  min-height: var(--ws-btn-h, 34px);
}

.ws-trim-preview-fallback {
  display: none;
}

.ws-stage-frame .fit-blur-wrap {
  width: 100%;
  height: 100%;
}

.ws-color-reset-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: var(--ws-btn-h);
  padding-inline: 10px;
  white-space: nowrap;
  font-size: var(--ws-text-sm);
}

.ws-color-group-label {
  font-size: var(--ws-label);
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 8px 0 5px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.ws-color-group-label:first-of-type {
  margin-top: 0;
}

.ws-look-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ws-grid-gap);
  direction: ltr;
}

.ws-look-chip {
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition:
    border-color 0.15s var(--ease-out),
    box-shadow 0.15s var(--ease-out),
    transform 0.12s ease-out;
}

.ws-look-swatch {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.ws-look-chip[data-look="natural"] .ws-look-swatch {
  background-image: linear-gradient(135deg, #b9c3cf, #8c9aa8);
}
.ws-look-chip[data-look="cinematic"] .ws-look-swatch {
  background-image: linear-gradient(135deg, #2e3a4b, #c69a6a);
}
.ws-look-chip[data-look="cool"] .ws-look-swatch {
  background-image: linear-gradient(135deg, #1f3957, #4ea6e0);
}
.ws-look-chip[data-look="warm"] .ws-look-swatch {
  background-image: linear-gradient(135deg, #6a3b1d, #e8a85a);
}
.ws-look-chip[data-look="bw"] .ws-look-swatch {
  background-image: linear-gradient(135deg, #0a1628, #a8b4c2);
}
.ws-look-chip[data-look="vivid"] .ws-look-swatch {
  background-image: linear-gradient(135deg, #1a6b4a, #f0c040);
}

.ws-look-chip:hover {
  border-color: var(--border-strong);
}

.ws-look-chip.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft-2);
}

.ws-look-name {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 1;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  padding: 8px 2px 3px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  letter-spacing: 0.02em;
  pointer-events: none;
  line-height: 1.15;
}

.ws-auto-correct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  flex: 1 1 auto;
  min-width: 0;
  min-height: var(--ws-btn-h);
  margin-bottom: 0;
  padding: 0 12px;
  font-size: var(--ws-text-sm);
  font-weight: 600;
  letter-spacing: -0.01em;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  transition:
    filter 0.12s ease-out,
    background 0.12s ease-out;
}

.ws-auto-correct-btn:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  filter: brightness(1.06);
}

.ws-auto-correct-btn:active:not(:disabled) {
  transform: translateY(0);
}

.ws-auto-correct-btn.is-analyzing {
  animation: ws-auto-pulse 1s ease-in-out infinite;
}

@keyframes ws-auto-pulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.12);
  }
}

/* legacy aliases - kept for any other callers */
.ws-color-hint {
  display: none;
}

.ws-color-divider {
  display: none;
}

.ws-color-label {
  display: none;
}

/* Sliders block */
.ws-color-sliders,
.ws-sliders {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}

.ws-slider-row {
  display: grid;
  grid-template-columns: 58px 1fr 34px;
  align-items: center;
  gap: 6px;
}

.ws-slider-row > label {
  font-size: var(--ws-text-sm);
  color: var(--text-2);
  font-weight: 500;
}

.ws-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: linear-gradient(
    to right,
    var(--accent) var(--slider-fill, 50%),
    var(--surface-pressed) var(--slider-fill, 50%)
  );
  border-radius: var(--r-pill);
  outline: none;
  cursor: pointer;
  direction: ltr;
}

.ws-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  background: #fff;
  border: 1.5px solid var(--border-strong, var(--border));
  border-radius: 50%;
  box-shadow: var(--shadow-xs);
  cursor: grab;
}

.ws-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  border-color: var(--accent);
}

.ws-slider::-moz-range-thumb {
  width: 15px;
  height: 15px;
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  box-shadow: var(--shadow-xs);
  cursor: grab;
}

.ws-slider-value {
  font-size: var(--ws-text-xs);
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  text-align: end;
  font-family: "SF Mono", Consolas, monospace;
}

@media (max-width: 520px) {
  .ws-look-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .ws-color-actions {
    flex-direction: column;
  }
  .ws-color-reset-btn {
    justify-content: center;
  }
}

/* ── Version strip ──────────────────────────────────────── */
.ws-versions {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-3) var(--s-4);
  box-shadow: var(--shadow-xs);
}

.ws-versions-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.ws-versions-row {
  display: flex;
  gap: var(--s-2);
  overflow-x: auto;
  padding-bottom: 4px;
}

.ws-version {
  position: relative;
  flex: 0 0 auto;
  width: 124px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-2);
  transition:
    border-color 0.12s,
    box-shadow 0.12s;
  display: flex;
  flex-direction: column;
}

.ws-versions-row .ws-version:only-child {
  cursor: default;
}

.ws-version:hover {
  border-color: var(--border-strong, var(--accent));
}

/* Editing vs film — quiet text status + soft border, no sticker badges. */
.ws-version.active,
.ws-version.is-editing {
  border-color: color-mix(in srgb, var(--green, #34c759) 40%, var(--border));
  background: color-mix(in srgb, var(--green, #34c759) 4%, var(--surface-2));
}

.ws-version.is-film:not(.is-editing) {
  border-color: color-mix(in srgb, var(--indigo, #3d5a80) 45%, var(--border));
}

.ws-version-thumb {
  position: relative;
}

.ws-version video,
.ws-version img {
  width: 100%;
  height: 64px;
  object-fit: cover;
  display: block;
  background: #000;
}

.ws-version-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px 7px 6px;
  min-width: 0;
}

.ws-version-badges {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  z-index: 2;
  pointer-events: none;
}

.ws-version-chip {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 3px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  box-shadow: none;
}

.ws-version-chip--edit {
  background: color-mix(
    in srgb,
    var(--green, #34c759) 55%,
    rgba(0, 0, 0, 0.55)
  );
}

.ws-version-chip--film {
  background: color-mix(
    in srgb,
    var(--indigo, #3d5a80) 55%,
    rgba(0, 0, 0, 0.55)
  );
}

.ws-version-op {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-version.is-editing .ws-version-op {
  color: color-mix(in srgb, var(--green, #34c759) 55%, var(--text));
}

.ws-version-meta,
.ws-version-from {
  font-size: 10px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.ws-version-tool {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-version.is-editing .ws-version-tool {
  color: color-mix(in srgb, var(--green, #34c759) 40%, var(--text-3));
}

.ws-version-from {
  opacity: 0.85;
}

/* Compact chip on the editing version only (top corner — badges stay bottom). */
.ws-version-insert-btn {
  position: absolute;
  inset-inline-end: 4px;
  top: 4px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: calc(100% - 8px);
  min-height: 18px;
  padding: 2px 5px;
  border: none;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  white-space: nowrap;
}

.ws-version-insert-btn:hover {
  background: rgba(0, 0, 0, 0.75);
}

/* ── AI Effects Studio ──────────────────────────────────── */
.ws-ai-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-3);
}

.ws-ai-card {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  text-align: start;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  transition:
    border-color 0.12s,
    background 0.12s,
    transform 0.08s;
}

.ws-ai-card:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.ws-ai-card:active:not(:disabled) {
  transform: scale(0.99);
}

.ws-ai-card:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ws-ai-card-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.ws-ai-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ws-ai-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.ws-ai-card-desc {
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-3);
}

.ws-ai-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--s-3);
  font-size: 12px;
  color: var(--accent);
}

.ws-ai-status--warn {
  color: var(--text-3);
}

/* Per-engine length notice under the premium-edit engine picker. Neutral for a
   "the output will be 10s" note, warning red when the run is actually blocked. */
.ws-engine-warn {
  color: var(--text-3);
  line-height: 1.4;
}

.ws-engine-warn.is-blocking {
  color: var(--danger, #e5484d);
}

/* .ws-ai-status sets display:flex, which out-specifies the [hidden] default. */
.ws-engine-warn[hidden] {
  display: none;
}

/* card-style shot list in the right column */
.workshop-grid > .workshop-shot-list .workshop-shot-item {
  padding: 4px;
  gap: 4px;
}
.workshop-grid > .workshop-shot-list .workshop-shot-title {
  font-size: 10px;
}

/* ════════════ Workshop redesign - 3 columns ════════════ */

.ws-autosave {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--success, #16a34a);
}

/* ── Center stage card: preview + versions in ONE box ───── */
.ws-area-stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  padding: var(--s-2);
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  flex: 1 1 auto;
}

.ws-stage-top {
  flex-shrink: 0;
  /* padding: 0 4px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px; */
}

.ws-stage-context--compact {
  padding: 2px 4px 0;
  border-bottom: none;
  margin-bottom: 0;
}

/* Legacy full context bar */
.ws-stage-context {
  flex-shrink: 0;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.ws-stage-context-shot {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.ws-stage-context-clip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  min-width: 0;
}

.ws-stage-context-kicker {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  flex-shrink: 0;
}

.ws-stage-context-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.ws-stage-context-index {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--r-pill);
  padding: 2px 8px;
  flex-shrink: 0;
}

.ws-stage-context-meta {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.ws-stage-context-hint {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-3);
}

/* Outer area centers the black frame; frame size follows project aspect */
.ws-stage-preview-area {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex: 1 1 auto;
  min-height: 160px;
  max-height: min(62vh, 100%);
}

.ws-stage-frame {
  position: relative;
  background: #0a0a0c;
  aspect-ratio: var(--ws-aspect-ratio, 16 / 9);
  width: min(100%, calc(min(62vh, 100%) * var(--ws-ar, 1.7777777778)));
  max-height: min(62vh, 100%);
  flex-shrink: 0;
  overflow: hidden;
  border-radius: var(--r-md);
}

/* "הצג באיכות מלאה" - loads the current frame from the ORIGINAL on demand, so the
   user can judge a version's real sharpness without leaving the fast proxy. */
.ws-fullq-btn {
  position: absolute;
  bottom: 10px;
  inset-inline-end: 10px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--r-pill);
  padding: 5px 10px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition:
    background 0.12s,
    opacity 0.12s;
}

.ws-fullq-btn:hover {
  background: rgba(0, 0, 0, 0.78);
}

.ws-fullq-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.ws-fullq-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
}

.ws-fullq-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ws-fullq-img,
.ws-fullq-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ws-fullq-tag {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: #15803d;
  border-radius: var(--r-pill);
  padding: 2px 8px;
  pointer-events: none;
}

/* Single-canvas live effects monitor (video + effects composited in one pass) */
.ws-fx-monitor {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ws-fx-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* "Preparing preview" message over the monitor until the first frame is ready */
.ws-fx-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 600;
  /* Quiet, not a heavy "stuck" panel: a soft bottom-up scrim instead of a flat
     dark cover, and no backdrop blur (it was expensive on the weak PC and made
     the overlay read as a solid layer). Only shown for genuinely slow loads. */
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.42),
    rgba(0, 0, 0, 0.12) 55%,
    rgba(0, 0, 0, 0) 100%
  );
  transition: opacity 0.2s;
}

.ws-fx-loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.ws-fx-loading svg {
  color: var(--accent);
}

.ws-fx-loading.is-error {
  color: #ffb4b4;
}

.ws-fx-loading.is-error svg {
  color: #ff6b6b;
}

/* Off-screen decode pool - kept in the DOM so the videos keep producing frames,
   but never painted directly (the canvas does the compositing). */
.ws-fx-pool {
  position: absolute;
  width: 1px;
  height: 1px;
  inset-inline-start: -9999px;
  top: -9999px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Free overlay loops composited over the preview (screen blend).
   CRITICAL: z-index makes this layer its own stacking context, which is an
   isolation boundary - the per-wrap mix-blend-mode:screen below blends only
   WITHIN this layer. Without screening at the LAYER level, the black loop
   backgrounds paint as a flat black veil that hides the video (the user's "שחור
   מסתיר את הסרטון" bug). So: combine the effects on black inside (isolation),
   then screen the whole layer onto the clip (mix-blend-mode) so black drops out.
   Mirrors the editor preview's .preview-vfx-layer. */
.ws-overlay-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: screen;
  isolation: isolate;
}

/* Inside the custom player: effects sit on the picture, controls stay on top */
.vplayer-wrap .ws-overlay-layer {
  z-index: 1;
}

.vplayer-wrap .vplayer-overlay {
  z-index: 2;
}

.vplayer-wrap .vplayer-bar {
  z-index: 3;
}

.ws-overlay-vid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.ws-overlay-vid-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  isolation: isolate;
  overflow: hidden;
}

.ws-overlay-tint {
  position: absolute;
  inset: 0;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.ws-mask-studio-overlay {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: auto;
  touch-action: none;
  cursor: crosshair;
}

.ws-mask-studio-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Isolate: brush imprint along the subject (same look as area-edit mask) */
.ws-isolate-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  cursor: crosshair;
  touch-action: none;
}
.ws-isolate-brush-canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.ws-isolate-rect {
  position: absolute;
  border: 2px dashed var(--accent);
  background: rgba(var(--accent-rgb, 99, 102, 241), 0.12);
  border-radius: 4px;
  pointer-events: none;
  box-sizing: border-box;
}
.ws-isolate-rect--hint {
  border-style: dotted;
  opacity: 0.55;
}
.ws-isolate-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  transition:
    border-color 0.15s var(--ease-out),
    background 0.15s var(--ease-out);
}
.ws-isolate-status.is-ready {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.ws-isolate-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  line-height: 1.3;
}
.ws-isolate-count.is-ready {
  color: var(--accent);
}
.ws-isolate-tip {
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-3);
}

.ws-subject-panel > .ws-ai-step-section {
  padding-top: 12px;
  padding-bottom: 12px;
}

.ws-subject-panel > .ws-ai-step-section:last-child {
  padding-bottom: 0;
}

.ws-bg-color-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  min-width: 0;
}

.ws-bg-color {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 8px 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition:
    border-color 0.15s var(--ease-out),
    box-shadow 0.15s var(--ease-out),
    background 0.15s var(--ease-out);
}

.ws-bg-color:hover {
  border-color: var(--border-strong);
}

.ws-bg-color.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft-2);
}

.ws-bg-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.ws-bg-color-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-2);
  text-align: center;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ws-bg-color.active .ws-bg-color-label {
  color: var(--accent);
}

/* ── Upscale / שדרוג איכות ───────────────────────────────── */
.ws-upscale-panel > .ws-ai-step-section {
  padding-top: 12px;
  padding-bottom: 12px;
}

.ws-upscale-panel > .ws-ai-step-section:last-child {
  padding-bottom: 0;
}

.ws-upscale-panel > .ws-ai-step-section[hidden] {
  display: none !important;
}

.ws-upscale-models {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.ws-upscale-model {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  text-align: start;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition:
    border-color 0.15s var(--ease-out),
    box-shadow 0.15s var(--ease-out),
    background 0.15s var(--ease-out);
}

.ws-upscale-model:hover {
  border-color: var(--border-strong);
}

.ws-upscale-model.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft-2);
}

.ws-upscale-model-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.ws-upscale-model-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}

.ws-upscale-model.active .ws-upscale-model-name {
  color: var(--accent);
}

.ws-upscale-model-badge {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.ws-upscale-model-hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  line-height: 1.35;
}

/* ── Stabilize / ייצוב וידאו ─────────────────────────────── */
.ws-stabilize-panel > .ws-ai-step-section {
  padding-top: 12px;
  padding-bottom: 12px;
}

.ws-stabilize-panel > .ws-ai-step-section:last-child {
  padding-bottom: 0;
}

.ws-stabilize-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 0;
}

.ws-stabilize-info-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.ws-stabilize-info-card--wide {
  grid-column: 1 / -1;
}

.ws-stabilize-info-card.is-free {
  border-color: color-mix(in srgb, var(--green) 35%, var(--border));
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
}

.ws-stabilize-info-card.is-free .ws-stabilize-info-title {
  color: var(--green);
}

.ws-stabilize-info-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}

.ws-stabilize-info-hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  line-height: 1.35;
}

/* ── Subject layers panel (aura / outline / shadow / bg) ─── */
.ws-layers-panel {
  display: flex;
  flex-direction: column;
  gap: var(--ws-gap);
}

/* The live compositor monitor fills the stage frame. */
.ws-layers-monitor {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 180px;
  background: #000;
  overflow: hidden;
}
.ws-layers-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.ws-sky-mask-overlay {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 6;
  height: 55%;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(255, 139, 56, 0.34) 0%,
    rgba(255, 139, 56, 0.28) calc(100% - var(--sky-feather, 8%)),
    rgba(255, 139, 56, 0) 100%
  );
  border-bottom: 1px solid rgba(255, 210, 127, 0.85);
  mix-blend-mode: screen;
}

.ws-layer-group {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.ws-layer-group-title {
  font-size: var(--ws-label);
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ws-layer-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.ws-layer-label {
  flex: 0 0 64px;
  font-size: var(--ws-text-sm);
  color: var(--text-2);
}
.ws-layer-range {
  flex: 1 1 auto;
  min-width: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.ws-layer-color-field {
  justify-content: space-between;
}

.ws-layer-color-btn {
  position: relative;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 2px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.12);
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease,
    transform 0.1s ease;
}

.ws-layer-color-btn:hover {
  border-color: var(--accent);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 0 2px var(--accent-soft);
}

.ws-layer-color-btn:active {
  transform: scale(0.96);
}

.ws-layer-color-swatch {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
}

.ws-layer-color-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  opacity: 0;
  cursor: pointer;
}

.ws-layer-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ws-layer-chip {
  min-height: 28px;
  padding: 0 12px;
  font-size: var(--ws-text-sm);
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-1, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease,
    border-color 0.12s ease;
}
.ws-layer-chip:hover {
  border-color: var(--accent);
}
.ws-layer-chip.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.ws-layer-subject-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.ws-layer-subject-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.ws-layer-subject-thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: #111;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.ws-layer-subject-thumb-vid,
.ws-layer-subject-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ws-layer-subject-copy {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 2px;
}

.ws-layer-subject-title {
  font-size: var(--ws-text-sm);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 4px;
}

.ws-layer-subject-desc {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-3);
}

.ws-layer-subject-rebtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  align-self: flex-end;
  width: auto;
  margin-top: 2px;
}

/* ── Overlay visual cards ───────────────────────────────── */
.ws-overlays-panel {
  max-width: none;
}

.ws-overlays-panel > .ws-ai-step-section {
  padding-top: 12px;
  padding-bottom: 12px;
}

.ws-overlays-panel > .ws-ai-step-section:last-child {
  padding-bottom: 0;
}

.ws-overlays-active-stack,
.ws-overlays-library {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.ws-overlays-layer-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  min-width: 0;
}

.ws-overlays-cat {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.ws-overlays-cat-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--text-3);
}

.ws-overlay-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.ws-overlay-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.ws-overlay-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: #111;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  transition:
    border-color 0.15s var(--ease-out),
    box-shadow 0.15s var(--ease-out);
}

.ws-overlay-card:hover .ws-overlay-thumb {
  border-color: var(--border-strong);
}

.ws-overlay-card.active .ws-overlay-thumb {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft-2);
}

.ws-overlay-thumb video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.ws-overlay-check {
  position: absolute;
  top: 4px;
  inset-inline-end: 4px;
  z-index: 2;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ws-overlay-card-name {
  font-size: var(--ws-text-xs);
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
  line-height: 1.2;
}

.ws-overlay-card.active .ws-overlay-card-name {
  color: var(--accent);
}

.ws-ai-overlay-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.ws-ai-overlay-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.ws-ai-overlay-prompt {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  margin: 0;
}

.ws-ai-overlay-gen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 0;
}

.ws-ai-overlay-active {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ws-ai-overlay-active-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex-shrink: 0;
}

.ws-ai-overlay-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: #111;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.ws-ai-overlay-thumb video,
video.ws-ai-overlay-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
}

.ws-ai-overlay-active-label {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.ws-overlay-vid-wrap img.ws-overlay-vid {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* legacy fallback chips (kept for safety) */
.ws-overlay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 6px;
}
.ws-overlay-chip {
  padding: 6px 5px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: var(--ws-text-xs);
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  text-align: center;
}
.ws-overlay-chip.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

/* ── AI link buttons (bodyFx panel) ────────────────────── */
.ws-ai-links-row {
  display: flex;
  flex-direction: column;
  gap: var(--ws-grid-gap);
}

.ws-ai-link-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  cursor: pointer;
  text-align: start;
  transition:
    background 0.12s,
    border-color 0.12s;
}

.ws-ai-link-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.ws-ai-link-icon {
  flex-shrink: 0;
  color: var(--accent);
  display: flex;
}

.ws-ai-link-label {
  font-size: var(--ws-text-sm);
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.ws-ai-link-desc {
  display: none;
}

/* the plain colour preview fills the project-aspect frame */
.ws-stage-frame > .ws-preview-wrap {
  position: relative;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  max-height: none;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.ws-stage-frame .ws-preview-wrap .vplayer-wrap {
  width: 100%;
  height: 100%;
  border-radius: 0;
  flex: 1 1 auto;
  min-height: 0;
}

.ws-stage-frame .ws-preview-wrap .vplayer-video {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ws-stage-frame .ws-preview-wrap video,
.ws-stage-frame .ws-preview-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* the effects monitor takes over the same slot, no extra chrome */
.ws-stage-frame > .vfx-m-panel--preview {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ws-stage-frame > .vfx-m-panel--preview > .vfx-m-panel-head {
  display: none;
}

/* versions live inside the same card → tight strip directly under preview */
.ws-area-stage .ws-versions {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 8px 0 0;
  margin-top: 8px;
  border-top: 1px solid var(--border);
}

.ws-area-stage .ws-versions-label {
  margin-bottom: 4px;
  font-size: 10px;
}

.ws-area-stage .ws-versions-row {
  gap: 6px;
}

/* .ws-area-stage .ws-version {
  width: 84px;
} */

.ws-area-stage .ws-version video,
.ws-area-stage .ws-version img {
  height: 48px;
}

/* Active enhancements - below versions, outside the preview frame */
.ws-enhancements {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  overflow: hidden;
}

.ws-enh-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  min-height: 30px;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.ws-enh-empty {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  padding: 4px 2px;
  white-space: nowrap;
}

.ws-enh-chip {
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  overflow: hidden;
  transition:
    border-color 0.12s,
    background 0.12s;
}

.ws-enh-chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.ws-enh-chip-main {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px 4px 7px;
  border: none;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  min-width: 0;
  transition: color 0.12s;
}

.ws-enh-chip:hover .ws-enh-chip-main {
  color: var(--accent);
}

.ws-enh-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  flex-shrink: 0;
  padding: 0;
  border: none;
  border-inline-start: 1px solid var(--border);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition:
    background 0.12s,
    color 0.12s;
}

.ws-enh-chip-remove:hover {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

.ws-enh-chip-icon {
  display: inline-flex;
  flex-shrink: 0;
  line-height: 0;
  color: var(--accent);
  opacity: 0.9;
}

.ws-enh-chip-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ── Left options panel: vertical menu rail (right) + action area (left) ─ */
.ws-area-options {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--s-3);
  height: calc(100vh - var(--topbar-h) - 80px);
  max-height: calc(100vh - var(--topbar-h) - 80px);
  --ws-pad: 10px;
  --ws-gap: 8px;
  --ws-gap-lg: 10px;
  --ws-text: 12px;
  --ws-text-sm: 11px;
  --ws-text-xs: 10px;
  --ws-label: 10px;
  --ws-grid-gap: 6px;
  --ws-btn-h: 32px;
}

.ws-options-split {
  display: flex;
  flex-direction: row;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.ws-options-menu {
  width: 136px;
  flex-shrink: 0;
  padding: 6px 5px;
  border-bottom: none;
  border-inline-start: 1px solid var(--border);
  background: var(--surface-2);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Compact tool picker — shown only when the workshop stacks (≤1100) */
.ws-tool-picker {
  display: none;
  position: relative;
  z-index: 5;
  flex-shrink: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.ws-tool-picker-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  box-shadow: var(--shadow-xs);
  color: var(--text);
  cursor: pointer;
  text-align: start;
  transition:
    border-color 0.15s var(--ease-out),
    box-shadow 0.15s var(--ease-out),
    background 0.15s var(--ease-out);
}

.ws-tool-picker-trigger:hover {
  border-color: var(--border-strong);
}

.ws-tool-picker.is-open .ws-tool-picker-trigger {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft-2);
}

.ws-tool-picker-icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--accent);
  line-height: 0;
}

.ws-tool-picker-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-tool-picker-badge {
  flex-shrink: 0;
}

.ws-tool-picker-chevron {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--text-3);
  line-height: 0;
  transition: transform 0.15s var(--ease-out);
}

.ws-tool-picker.is-open .ws-tool-picker-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.ws-tool-picker-panel {
  position: absolute;
  inset-inline: 12px;
  top: calc(100% - 4px);
  max-height: min(60vh, 420px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ws-tool-picker-panel[hidden] {
  display: none !important;
}

.ws-tool-picker-panel .ws-menu-group {
  width: 100%;
  margin-top: 4px;
  padding: 8px 8px 2px;
  border-top: 1px solid var(--border);
  border-inline-start: none;
}

.ws-tool-picker-panel .ws-menu-group:first-child {
  margin-top: 0;
  border-top: none;
  padding-top: 4px;
}

.ws-tool-picker-panel .ws-menu-btn {
  width: 100%;
  min-height: 40px;
  flex-direction: row;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: transparent;
}

.ws-tool-picker-panel .ws-menu-btn:hover {
  background: var(--surface-hover);
}

.ws-tool-picker-panel .ws-menu-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: none;
}

.ws-tool-picker-panel .ws-menu-label {
  white-space: nowrap;
}

/* Must come AFTER base .ws-options-menu / .ws-tool-picker display rules */
@media (max-width: 1100px) {
  .ws-options-menu {
    display: none !important;
  }

  .ws-tool-picker {
    display: block;
  }

  .ws-options-head-action {
    display: none;
  }
}

.ws-menu-group {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.78;
  padding: 10px 4px 2px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  line-height: 1.1;
  text-align: start;
}
.ws-menu-group:first-child {
  padding-top: 2px;
  margin-top: 0;
  border-top: none;
}

/* Vertical stack - one button per row in the menu rail */
.ws-menu-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ws-menu-btn {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  width: 100%;
  min-height: 0;
  padding: 6px 5px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  text-align: start;
  transition:
    background 0.12s,
    color 0.12s,
    border-color 0.12s;
}

.ws-menu-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border);
}

.ws-menu-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.ws-menu-icon {
  display: flex;
  flex-shrink: 0;
  line-height: 0;
}

.ws-menu-label {
  line-height: 1.25;
  font-size: 11px;
  white-space: normal;
  overflow: visible;
  flex: 1;
  min-width: 0;
  text-align: start;
}

.ws-menu-badge {
  flex-shrink: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ws-menu-btn.active .ws-menu-badge {
  background: var(--accent);
  color: #fff;
}

.ws-action-badge {
  position: absolute;
  top: -4px;
  inset-inline-end: -4px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: var(--r-pill);
  padding: 0 4px;
  line-height: 14px;
}

.ws-menu-spin {
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  display: inline-flex;
  color: var(--accent);
  animation: ws-spin 1s linear infinite;
}

@keyframes ws-spin {
  to {
    transform: rotate(360deg);
  }
}

.ws-options-body {
  flex: 1 1 auto;
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.ws-options-head {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface-2);
}

.ws-options-head-action {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.ws-options-head-help {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  line-height: 1.35;
}

.ws-options-head-source {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  line-height: 1.35;
  min-width: 0;
}

.ws-options-head-source--empty {
  color: var(--text-3);
  font-weight: 500;
}

.ws-options-head-kicker {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

.ws-options-head-name {
  color: var(--text);
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-options-head-index {
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ws-options-head-meta {
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.ws-options-head-meta::before {
  content: "·";
  margin-inline: 2px 4px;
}

.ws-options-head-note {
  flex: 1 1 100%;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-3);
  line-height: 1.35;
}

.ws-options-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  padding: var(--ws-pad);
  padding-bottom: 0;
}

.ws-options-content > .ws-action-panel,
.ws-options-content > .ws-action-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ws-action-body:not([data-ws-footer-pinned]) {
  overflow-y: auto;
  padding-bottom: var(--ws-pad);
}

/* Nested wraps (AI panel / meta tabs) must pass height down to the scroll area. */
.ws-action-panel {
  display: flex;
  flex-direction: column;
  gap: var(--ws-gap);
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.ws-action-panel > .ws-action-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.ws-meta-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.ws-meta-slot {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ws-meta-slot > .ws-action-panel,
.ws-meta-slot > .ws-action-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.ws-action-body[data-ws-footer-pinned] {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  gap: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.ws-action-panel:has([data-ws-footer-pinned]) {
  gap: 0;
}

.ws-action-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: var(--ws-gap);
  padding-bottom: 8px;
}

.ws-action-dock {
  flex-shrink: 0;
  margin-top: 0;
  padding: 10px 0 calc(var(--ws-pad) + 2px);
  border-top: 1px solid var(--border);
  background: var(--surface);
  /* box-shadow: 0 -10px 18px -14px rgba(0, 0, 0, 0.35); */
}

/* One shared footer language: full-width primary; side-by-side when 2+. */
.ws-action-dock .ws-action-footer,
.ws-action-dock .ws-restyle-footer,
.ws-action-dock .ws-lipsync-footer,
.ws-action-dock .ws-fit-footer,
.ws-action-dock .ws-color-footer,
.ws-action-dock .ws-trim-footer {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 0;
}

.ws-action-dock .ws-action-footer > .btn,
.ws-action-dock .ws-restyle-footer > .btn,
.ws-action-dock .ws-lipsync-footer > .btn,
.ws-action-dock .ws-fit-footer > .btn,
.ws-action-dock .ws-color-footer > .btn,
.ws-action-dock .ws-trim-footer > .btn,
.ws-action-dock .ws-action-footer > .generate-btn-with-price,
.ws-action-dock .ws-restyle-footer > .generate-btn-with-price,
.ws-action-dock .ws-lipsync-footer > .generate-btn-with-price,
.ws-action-dock .ws-trim-footer > .generate-btn-with-price {
  flex: 1 1 calc(50% - 4px);
  width: auto;
  min-width: 0;
  min-height: var(--ws-btn-h, 34px);
  justify-content: center;
  margin: 0;
}

.ws-action-dock .ws-action-footer > .btn:only-child,
.ws-action-dock .ws-restyle-footer > .btn:only-child,
.ws-action-dock .ws-lipsync-footer > .btn:only-child,
.ws-action-dock .ws-fit-footer > .btn:only-child,
.ws-action-dock .ws-color-footer > .btn:only-child,
.ws-action-dock .ws-trim-footer > .btn:only-child,
.ws-action-dock .ws-action-footer > .generate-btn-with-price:only-child,
.ws-action-dock .ws-restyle-footer > .generate-btn-with-price:only-child,
.ws-action-dock .ws-lipsync-footer > .generate-btn-with-price:only-child,
.ws-action-dock .ws-trim-footer > .generate-btn-with-price:only-child {
  flex: 1 1 100%;
  width: 100%;
}

.ws-action-dock .ws-run-btn {
  margin-top: 0;
}

.ws-action-dock .generate-btn-with-price {
  display: flex;
  align-items: center;
  gap: 8px;
  direction: ltr;
}

.ws-action-dock .generate-btn-with-price .ws-run-btn {
  flex: 1;
  min-width: 0;
  width: auto;
  margin-top: 0;
  direction: rtl;
}

/* Pinned dock replaces sticky footers — avoid double stacking. */
.ws-action-body[data-ws-footer-pinned] .ws-restyle-footer,
.ws-action-body[data-ws-footer-pinned] .ws-fit-footer,
.ws-action-body[data-ws-footer-pinned] .ws-color-footer,
.ws-action-body[data-ws-footer-pinned] .ws-trim-footer,
.ws-action-body[data-ws-footer-pinned] .ws-lipsync-footer,
.ws-action-body[data-ws-footer-pinned] .ws-action-footer {
  position: static;
  background: none;
  box-shadow: none;
  padding-top: 0;
  padding-bottom: 0;
}

/* the effects studio controls drop straight into the options body */
.ws-options-content > .vfx-m-tabs {
  margin-bottom: var(--ws-gap);
}

/* ── Inline action panel (AI controls) ──────────────────── */
.ws-action-body {
  display: flex;
  flex-direction: column;
  gap: var(--ws-gap);
}

.ws-action-desc {
  margin: 0;
  padding: 0;
  font-size: var(--ws-text-sm);
  line-height: 1.45;
  color: var(--text-3);
  background: none;
  border: none;
  border-radius: 0;
}

.ws-ai-step-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 0 10px;
  border-bottom: 1px solid var(--border);
}

.ws-ai-step-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.ws-ai-step-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.ws-ai-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ws-ai-step-copy {
  min-width: 0;
}

.ws-ai-step-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.ws-ai-step-hint {
  margin-top: 1px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

.ws-mask-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ws-grid-gap);
}

.ws-mask-mode {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 7px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  text-align: start;
}

.ws-mask-mode:hover {
  border-color: var(--border-strong);
}

.ws-mask-mode.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.ws-mask-mode .ui-icon {
  grid-row: 1 / span 2;
}

.ws-mask-mode-label {
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.ws-mask-mode-hint {
  min-width: 0;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text-3);
  overflow-wrap: anywhere;
}

.ws-mask-detect-status {
  display: block;
  font-size: 11px;
  color: var(--text-2);
  margin: 4px 0 8px;
}

.ws-ai-range-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.ws-ai-replace-panel > .ws-ai-step-section {
  padding-top: 12px;
  padding-bottom: 12px;
}

.ws-ai-replace-panel > .ws-ai-step-section:last-child {
  padding-bottom: 0;
}

.ws-replace-range {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.ws-replace-segment-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.ws-replace-segment-block[hidden] {
  display: none !important;
}

.ws-replace-range-summary {
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  line-height: 1.35;
}

.ws-replace-mask-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  min-width: 0;
}

.ws-replace-mask-status {
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
}

.ws-replace-mask-status.is-ready {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
}

.ws-replace-mask-status.is-warn {
  border-color: color-mix(in srgb, var(--orange) 35%, var(--border));
  background: color-mix(in srgb, var(--orange) 10%, var(--surface));
  color: var(--text-2);
}

.ws-range-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ws-range-input {
  width: 100%;
  min-width: 0;
}

.ws-range-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ws-ai-mask-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.ws-ai-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ws-ai-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.ws-ai-status-row .ws-ai-status {
  margin-top: 0;
}

.ws-ai-status-row .btn {
  flex-shrink: 0;
}

.ws-mask-tool-row,
.ws-mask-checks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.ws-mask-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.ws-mask-tool:hover {
  border-color: var(--border-strong);
}

.ws-mask-tool.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.ws-mask-guard {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border));
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.35;
}

.ws-mask-guard-title {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ws-mask-guard span:not(.ws-mask-guard-title) {
  white-space: pre-line;
}

.ws-advanced-details {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  overflow: hidden;
}

.ws-advanced-details summary {
  cursor: pointer;
  padding: 8px 10px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.ws-advanced-details .ws-mask-guard {
  margin: 0 10px 10px;
}

.ws-advanced-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 10px 10px;
}

.ws-advanced-stack .ws-mask-guard {
  margin: 0;
}

.ws-replace-presets .ws-style-preset-grid {
  margin: 0 10px 10px;
}

.ws-engine-note {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.35;
}

@media (max-width: 640px) {
  .ws-ai-status-row {
    align-items: stretch;
    flex-direction: column;
  }

  .ws-ai-row-actions {
    justify-content: stretch;
  }

  .ws-ai-row-actions .btn {
    flex: 1 1 auto;
  }
}

.ws-tracker-layer-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ws-tracker-layer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.8fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.ws-tracker-layer-name {
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.ws-runway-actions,
.ws-final-look-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Premium Runway / 3-step panel ───────────────────────────────────────── */
.ws-runway-panel--steps {
  gap: 0;
}

.ws-runway-panel--steps .ws-action-scroll > .ws-ai-step-section,
.ws-runway-panel--steps > .ws-ai-step-section {
  padding-top: 12px;
  padding-bottom: 12px;
}

.ws-runway-panel--steps .ws-action-scroll > .ws-ai-step-section:last-of-type,
.ws-runway-panel--steps > .ws-ai-step-section:last-of-type {
  padding-bottom: 0;
}

.ws-ai-step--locked,
.ws-step--locked {
  opacity: 0.38;
  pointer-events: none;
  filter: grayscale(0.15);
}

.ws-step {
  padding-top: 12px;
  margin-top: 10px;
  border-top: 1px solid var(--border);
}

.ws-step-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ws-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.ws-step-title {
  font-weight: 700;
  font-size: 12px;
  color: var(--text);
}

.ws-step-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.ws-step-status,
.ws-step-hint {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-3);
}

.ws-step-hint {
  margin: 0 0 var(--s-2);
  font-size: 12px;
}

.ws-original-frame-btn--active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.ws-frame-original-pick,
.ws-frame-compare,
.ws-frame-preview-slot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.ws-runway-step2-actions {
  margin-top: 4px;
}

.ws-runway-step2-actions .ws-ai-status {
  margin-top: 0;
  flex: 1;
  min-width: 0;
}

.ws-scrub-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.ws-scrub-range {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  accent-color: var(--accent);
}

.ws-range-item .ws-scrub-range {
  flex: none;
}

.ws-scrub-time {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  text-align: center;
  color: var(--text-2);
}

.ws-scrub-video-wrap {
  position: relative;
  width: 100%;
  background: #e3e6ec;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  min-height: 96px;
  box-shadow: var(--shadow-xs);
}

.ws-scrub-video-wrap.is-capturing .ws-scrub-video {
  filter: brightness(0.72) saturate(0.9);
  transition: filter 0.25s var(--ease-out);
}

.ws-scrub-video-wrap.is-capture-flash::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.55);
  animation: ws-capture-flash 0.48s var(--ease-out) forwards;
}

@keyframes ws-capture-flash {
  0% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
  }
}

.ws-capture-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(12, 14, 18, 0.28);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border-radius: inherit;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.2s var(--ease-out);
}

.ws-capture-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.ws-capture-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.22);
  border-top-color: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
  animation: ws-capture-spin 0.85s linear infinite;
}

.ws-capture-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ws-capture-pill-spin {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-top-color: var(--accent);
  animation: ws-capture-spin 0.7s linear infinite;
  flex-shrink: 0;
}

.ws-capture-pill-label {
  line-height: 1;
}

@keyframes ws-capture-spin {
  to {
    transform: rotate(360deg);
  }
}

.ws-scrub-proxy-badge {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  z-index: 4;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
}

.ws-scrub-video-wrap.is-capturing .ws-scrub-proxy-badge {
  opacity: 0.35;
}

.ws-scrub-video {
  width: 100%;
  display: block;
  background: #111;
  transition: filter 0.25s var(--ease-out);
}

.ws-frame-thumb {
  width: 100%;
  height: 100%;
  border-radius: var(--r-sm);
  display: block;
  object-fit: cover;
}

.ws-frame-img-wrap {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: #e3e6ec;
  box-shadow: var(--shadow-xs);
}

.ws-frame-img-wrap .ws-frame-thumb {
  position: absolute;
  inset: 0;
  margin-top: 0;
  border-radius: inherit;
}

.ws-frame-img-wrap .ws-frame-zoom-btn,
.ws-gen-thumb .ws-gen-thumb-zoom {
  opacity: 0.92;
}

.ws-gen-thumb-zoom {
  top: 4px;
  inset-inline-start: 4px;
  inset-inline-end: auto;
  width: 24px;
  height: 24px;
}

.ws-frame-pair-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ws-frame-pair-cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ws-frame-pair-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-3);
  text-align: center;
}

.ws-gen-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  min-height: 0;
}

.ws-gen-thumb {
  position: relative;
  width: calc(33.333% - 6px);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  padding: 0;
  background: #e3e6ec;
  cursor: pointer;
  transition:
    border-color 0.15s var(--ease-out),
    box-shadow 0.15s var(--ease-out);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.ws-gen-thumb:hover {
  border-color: var(--border-strong);
}

.ws-gen-thumb--selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft-2);
}

.ws-gen-thumb-img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.ws-gen-thumb-num {
  position: absolute;
  bottom: 4px;
  inset-inline-end: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  pointer-events: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.ws-gen-thumb--selected .ws-gen-thumb-num {
  background: var(--accent);
}

.ws-preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 10px 10px;
}

.ws-runway-panel--steps > .ws-ai-step-section > .ws-preset-chips {
  padding: 0;
  margin-bottom: 2px;
}

.ws-preset-chip {
  padding: 5px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s var(--ease-out),
    border-color 0.15s var(--ease-out),
    color 0.15s var(--ease-out);
  line-height: 1.3;
}

.ws-preset-chip:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text);
}

.ws-range-section {
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.ws-runway-advanced {
  overflow: hidden;
}

.ws-runway-advanced .ws-advanced-stack {
  min-width: 0;
  overflow: hidden;
}

.ws-runway-range {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.ws-range-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.ws-range-header .field-label {
  margin: 0;
  flex-shrink: 0;
}

.ws-range-header .ws-ai-status {
  margin-top: 0;
  font-size: 11px;
  text-align: end;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-range-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.ws-range-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.ws-range-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-sizing: border-box;
}

.ws-range-item .ws-scrub-range,
.ws-range-item .ws-slider {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.ws-range-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  white-space: nowrap;
  text-align: center;
}

.ws-check.ws-runway-opt-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.ws-check.ws-runway-opt-check input {
  margin-top: 2px;
  flex-shrink: 0;
}

.ws-runway-opt-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  line-height: 1.35;
}

.ws-runway-opt-hint {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-3);
}

.ws-range-cost {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  margin-inline-start: 2px;
}

.ws-step3-engines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.ws-engine-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.ws-engine-card-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ws-step3-engine-name {
  font-weight: 700;
  font-size: 12px;
  color: var(--text);
}

.ws-step3-engine-hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  line-height: 1.35;
}

.ws-engine-card .ws-run-btn {
  margin-top: 0;
  width: 100%;
  justify-content: center;
  min-height: var(--ws-btn-h, 34px);
}

.ws-runway-engine-row {
  margin-top: 2px;
}

.ws-action-dock .ws-runway-footer {
  flex-direction: column;
  gap: 0;
}

.ws-action-dock .ws-runway-footer > .generate-btn-with-price {
  flex: 1 1 100%;
  width: 100%;
}

.ws-final-look-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.ws-final-look-check {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.ws-restyle-warning {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: var(--r-sm);
  background: rgba(245, 158, 11, 0.08);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.4;
}

.ws-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ws-sound-panel > .ws-ai-step-section {
  padding-top: 12px;
  padding-bottom: 12px;
}

.ws-sound-panel > .ws-ai-step-section:last-child {
  padding-bottom: 0;
}

.ws-sound-suggestions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(38vh, 260px);
  overflow-y: auto;
  padding: 0 10px 10px;
  min-width: 0;
}

.ws-sound-suggestion-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ws-sound-group-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--text-3);
}

.ws-sound-chip {
  padding: 5px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition:
    background 0.15s var(--ease-out),
    border-color 0.15s var(--ease-out),
    color 0.15s var(--ease-out);
}

.ws-sound-chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-hover);
}

.ws-sound-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.ws-sound-note {
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-3);
}

.ws-sound-panel .ws-run-btn {
  margin-top: 0;
}

/* ── Meta tabs (stylize / subject) ───────────────────────── */
.ws-meta-tabs.ws-seg {
  flex-shrink: 0;

  display: flex;
  width: 100%;
  padding: 3px;
  border-radius: var(--r-sm);
  background: rgb(0 0 0 / 8%);
  /* border: 1px solid var(--border); */
  margin-bottom: 2px;
}

.ws-meta-tabs.ws-seg .ws-meta-tab {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: none;
  border-radius: calc(var(--r-sm) - 2px);
  background: transparent;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.15s var(--ease-out),
    color 0.15s var(--ease-out),
    box-shadow 0.15s var(--ease-out);
}

.ws-meta-tabs.ws-seg .ws-meta-tab:hover:not(.active) {
  color: var(--text);
  background: var(--surface-hover);
}

.ws-meta-tabs.ws-seg .ws-meta-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

.ws-stylize-panel > .ws-ai-step-section {
  padding-top: 12px;
  padding-bottom: 12px;
}

.ws-stylize-panel > .ws-ai-step-section:last-child {
  padding-bottom: 0;
}

.ws-engine-pick-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 0;
}

/* Odd count (3, 5, 7…) → 3 per row so nothing sits alone. */
.ws-engine-pick-row:has(> :last-child:nth-child(odd)):not(:has(> :only-child)),
.ws-mask-mode-grid:has(> :last-child:nth-child(odd)):not(:has(> :only-child)),
.ws-bg-color-grid:has(> :last-child:nth-child(odd)):not(:has(> :only-child)),
.ws-wan-grid:has(> :last-child:nth-child(odd)):not(:has(> :only-child)),
.ws-preset-grid:has(> :last-child:nth-child(odd)):not(:has(> :only-child)),
.ws-lipsync-engines:has(> :last-child:nth-child(odd)):not(:has(> :only-child)) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ws-engine-pick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  text-align: start;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition:
    border-color 0.15s var(--ease-out),
    box-shadow 0.15s var(--ease-out),
    background 0.15s var(--ease-out);
}

.ws-engine-pick:hover {
  border-color: var(--border-strong);
}

.ws-engine-pick.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft-2);
}

.ws-engine-pick.active .ws-step3-engine-name {
  color: var(--accent);
}

/* ── Style / Relight visual preset cards ──────────────────── */
.ws-style-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  padding: 0 10px 10px;
  min-width: 0;
}

.ws-stylize-panel > .ws-ai-step-section > .ws-style-preset-grid {
  padding: 0;
}

.ws-style-card {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  padding: 0;
  box-shadow: var(--shadow-xs);
  transition:
    border-color 0.15s var(--ease-out),
    box-shadow 0.15s var(--ease-out);
}

.ws-style-card:hover {
  transform: none;
  border-color: var(--border-strong);
}

.ws-style-card.active,
.ws-style-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft-2);
}

.ws-style-card-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 0.35s var(--ease-out);
}

.ws-style-card:hover .ws-style-card-preview {
  transform: scale(1.04);
}

.ws-style-card-label {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 1;
  padding: 12px 6px 5px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.2;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-style-card:hover .ws-style-card-label {
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
}

.ws-animated-title-panel .ws-title-custom-block {
  margin-top: 8px;
}

.ws-animated-title-panel .ws-title-dur-wrap {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ws-animated-title-panel .ws-title-cost-slot {
  margin-top: 12px;
}

.ws-title-font-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ws-title-font-wrap .cselect-trigger {
  width: 100%;
  justify-content: space-between;
}

.ws-title-font-hint {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--warn, #b45309);
  background: color-mix(in srgb, var(--warn, #b45309) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn, #b45309) 25%, transparent);
  border-radius: var(--r-xs);
  padding: 6px 8px;
}

.ws-title-font-hint[hidden] {
  display: none;
}

.ws-title-color-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ws-title-color-row {
  display: flex;
  gap: 10px;
}

.ws-title-color-field {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  cursor: pointer;
}

.ws-title-color-toggle {
  flex-shrink: 0;
  accent-color: var(--accent);
}

.ws-title-color-label {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-title-color-input {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  cursor: pointer;
}

.ws-title-color-input:disabled {
  opacity: 0.4;
  cursor: default;
}

.ws-title-place-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.ws-title-pos-row {
  width: 100%;
}

.ws-title-place-stage {
  position: relative;
  width: 100%;
  max-width: 340px;
  max-height: min(52vh, 380px);
  margin-inline: auto;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0b0d12;
  touch-action: none;
  user-select: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.ws-title-place-stage.is-placing {
  cursor: grabbing;
}

.ws-title-place-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
  opacity: 0.4;
  transition: opacity 0.25s ease;
}

.ws-title-place-video.media-ready {
  opacity: 1;
}

.ws-title-place-guides {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.ws-title-place-guide {
  position: absolute;
  inset-inline: 12%;
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
}

.ws-title-place-guide[data-zone="top"] {
  top: 16%;
}
.ws-title-place-guide[data-zone="center"] {
  top: 50%;
}
.ws-title-place-guide[data-zone="bottom"] {
  top: 84%;
}

.ws-title-place-guide.active {
  height: 2px;
  background: rgba(120, 190, 255, 0.75);
  box-shadow: 0 0 10px rgba(100, 180, 255, 0.4);
}

.ws-title-place-bubble {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 86%;
  padding: 0.3em 0.55em;
  border-radius: 10px;
  border: 1.5px dashed
    color-mix(in srgb, var(--wt-accent, #fff) 55%, transparent);
  background: var(--wt-bg, rgba(0, 0, 0, 0.22));
  color: var(--wt-color, #fff);
  font-size: clamp(16px, 5.5vw, 26px);
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}

.ws-title-place-bubble.is-dragging,
.ws-title-place-bubble:active {
  cursor: grabbing;
  border-style: solid;
  border-color: rgba(120, 190, 255, 0.85);
}

.ws-title-place-text {
  display: inline-block;
  pointer-events: none;
  color: var(--wt-color, #fff);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  word-break: break-word;
}

/* ── Shared looping preview animations (both the stage bubble & preset
   picker cards use these — a taste of the motion, not a pixel-exact
   render). Driven by --wt-color / --wt-accent / --wt-bg set per preset. */
@keyframes wtPop {
  0% {
    transform: scale(0.72);
    opacity: 0;
  }
  14% {
    transform: scale(1.16);
    opacity: 1;
  }
  24% {
    transform: scale(0.96);
  }
  32%,
  76% {
    transform: scale(1);
    opacity: 1;
  }
  90% {
    transform: scale(1.08);
    opacity: 0.85;
  }
  100% {
    transform: scale(0.8);
    opacity: 0;
  }
}
@keyframes wtBounce {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  20% {
    transform: translateY(-34%) scale(1.06);
  }
  35% {
    transform: translateY(0) scale(0.94);
  }
  48% {
    transform: translateY(-12%) scale(1.02);
  }
  60%,
  100% {
    transform: translateY(0) scale(1);
  }
}
@keyframes wtGlow {
  0%,
  100% {
    text-shadow:
      0 0 6px var(--wt-accent, #fff),
      0 2px 6px rgba(0, 0, 0, 0.5);
  }
  50% {
    text-shadow:
      0 0 16px var(--wt-accent, #fff),
      0 0 30px var(--wt-accent, #fff),
      0 2px 6px rgba(0, 0, 0, 0.5);
  }
}
@keyframes wtFade {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}
@keyframes wtShimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}
@keyframes wtWobble {
  0%,
  100% {
    transform: rotate(-4deg);
  }
  50% {
    transform: rotate(4deg);
  }
}
@keyframes wtSlide {
  0% {
    transform: translateX(55%);
    opacity: 0;
  }
  22% {
    transform: translateX(0);
    opacity: 1;
  }
  72% {
    transform: translateX(0);
    opacity: 1;
  }
  100% {
    transform: translateX(-55%);
    opacity: 0;
  }
}
@keyframes wtSlideAlt {
  0% {
    transform: translateX(-55%);
    opacity: 0;
  }
  22% {
    transform: translateX(0);
    opacity: 1;
  }
  72% {
    transform: translateX(0);
    opacity: 1;
  }
  100% {
    transform: translateX(55%);
    opacity: 0;
  }
}
@keyframes wtType {
  0% {
    clip-path: inset(0 100% 0 0);
  }
  45%,
  85% {
    clip-path: inset(0 0 0 0);
  }
  100% {
    clip-path: inset(0 100% 0 0);
  }
}
@keyframes wtCaret {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}
@keyframes wtBackdropBar {
  0% {
    transform: scaleX(0);
    opacity: 1;
  }
  30%,
  80% {
    transform: scaleX(1);
    opacity: 1;
  }
  100% {
    transform: scaleX(1);
    opacity: 0;
  }
}
@keyframes wtShine {
  0% {
    transform: translateX(-70%) rotate(8deg);
  }
  100% {
    transform: translateX(70%) rotate(8deg);
  }
}

.ws-title-place-bubble--anim-pop .ws-title-place-text,
.ws-title-mock--anim-pop .ws-title-mock-char {
  animation: wtPop 2.6s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}
.ws-title-place-bubble--anim-bounce .ws-title-place-text,
.ws-title-mock--anim-bounce .ws-title-mock-char {
  animation: wtBounce 1.8s ease-in-out infinite;
}
.ws-title-place-bubble--anim-glow .ws-title-place-text,
.ws-title-mock--anim-glow .ws-title-mock-char {
  animation: wtGlow 1.6s ease-in-out infinite;
}
.ws-title-place-bubble--anim-fade .ws-title-place-text,
.ws-title-mock--anim-fade .ws-title-mock-char {
  animation: wtFade 2.2s ease-in-out infinite;
}
.ws-title-place-bubble--anim-shimmer .ws-title-place-text,
.ws-title-mock--anim-shimmer .ws-title-mock-char {
  background-image: linear-gradient(
    90deg,
    var(--wt-color, #fff),
    var(--wt-accent, #ffd166),
    var(--wt-color, #fff)
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  animation: wtShimmer 2.2s linear infinite;
}
.ws-title-place-bubble--anim-wobble .ws-title-place-text,
.ws-title-mock--anim-wobble .ws-title-mock-char {
  animation: wtWobble 1.4s ease-in-out infinite;
}
.ws-title-place-bubble--anim-slide .ws-title-place-text,
.ws-title-mock--anim-slide .ws-title-mock-char {
  animation: wtSlide 2.6s ease-in-out infinite;
}
.ws-title-place-bubble--anim-slideAlt .ws-title-place-text,
.ws-title-mock--anim-slideAlt .ws-title-mock-char {
  animation: wtSlideAlt 2.6s ease-in-out infinite;
}
.ws-title-place-bubble--anim-typewriter .ws-title-place-text,
.ws-title-mock--anim-typewriter .ws-title-mock-char {
  position: relative;
  animation: wtType 2.6s steps(10, end) infinite;
}
.ws-title-place-bubble--anim-typewriter .ws-title-place-text::after,
.ws-title-mock--anim-typewriter .ws-title-mock-char::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-inline-start: 2px;
  background: var(--wt-accent, #39ff14);
  vertical-align: -0.15em;
  animation: wtCaret 0.8s steps(1) infinite;
}
.ws-title-place-bubble--anim-backdrop,
.ws-title-mock--anim-backdrop {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.ws-title-place-bubble--anim-backdrop .ws-title-place-text,
.ws-title-mock--anim-backdrop .ws-title-mock-char {
  position: relative;
  z-index: 1;
  text-shadow: none;
}
.ws-title-place-bubble--anim-backdrop .ws-title-place-text::before,
.ws-title-mock--anim-backdrop .ws-title-mock-char::before {
  content: "";
  position: absolute;
  inset: -8% -12%;
  z-index: -1;
  border-radius: 5px;
  background: var(--wt-bg, #ffe066);
  transform-origin: left center;
  animation: wtBackdropBar 2.4s ease-in-out infinite;
}
.ws-title-place-bubble--anim-glass,
.ws-title-mock--anim-glass {
  position: relative;
  background: var(--wt-bg, rgba(255, 255, 255, 0.18)) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: hidden;
}
.ws-title-place-bubble--anim-glass .ws-title-place-text,
.ws-title-mock--anim-glass .ws-title-mock-char {
  position: relative;
  z-index: 1;
  text-shadow: none;
}
.ws-title-place-bubble--anim-glass::after,
.ws-title-mock--anim-glass::after {
  content: "";
  position: absolute;
  inset: -60% -20%;
  z-index: 0;
  background: linear-gradient(
    100deg,
    transparent 35%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 65%
  );
  animation: wtShine 2.6s ease-in-out infinite;
}

.ws-title-place-handle {
  position: absolute;
  inset-inline-end: -7px;
  bottom: -7px;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent, #4cc9f0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  cursor: nwse-resize;
  touch-action: none;
}

.ws-title-size-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ws-title-size-row .field-label {
  margin: 0;
  flex-shrink: 0;
  white-space: nowrap;
}

.ws-title-size-slider {
  flex: 1;
  min-width: 0;
}

.ws-title-size-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  min-width: 3.2em;
  text-align: end;
}

.ws-title-preset-card {
  position: relative;
}

.ws-title-card-preview {
  display: flex !important;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ws-title-card-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 130%,
    rgba(0, 0, 0, 0.6),
    transparent 62%
  );
  pointer-events: none;
}

.ws-title-tier-badge {
  position: absolute;
  top: 4px;
  inset-inline-end: 5px;
  z-index: 2;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 1px 6px;
  pointer-events: none;
}

.ws-title-preset-grid,
.ws-style-preset-grid.ws-title-preset-grid {
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ws-title-preset-card .ws-style-card-label {
  padding: 8px 5px 4px;
  font-size: 9.5px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.68) 65%);
}

.ws-title-mock--mini {
  position: relative;
  pointer-events: none;
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--wt-bg, transparent);
}

.ws-title-mock--mini .ws-title-mock-char {
  display: inline-block;
  font-size: 16px;
  font-weight: 800;
  color: var(--wt-color, #fff);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.ws-run-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--ws-btn-h);
  padding: 0 12px;
  margin-top: 2px;
  font-size: var(--ws-text-sm);
  font-weight: 600;
}

/* Price chip beside run button (not stacked inside full-width button) */
.ws-action-body > .generate-btn-with-price,
.ws-wan-panel > .generate-btn-with-price,
.ws-lipsync-footer .generate-btn-with-price,
.ws-restyle-footer .generate-btn-with-price {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 2px;
  direction: ltr;
}

.ws-action-body > .generate-btn-with-price .ws-run-btn,
.ws-wan-panel > .generate-btn-with-price .ws-run-btn,
.ws-lipsync-footer .generate-btn-with-price .ws-run-btn,
.ws-restyle-footer .generate-btn-with-price .ws-run-btn {
  width: auto;
  flex: 1;
  min-width: 0;
  margin-top: 0;
  direction: rtl;
}

.ws-action-body > .generate-btn-with-price .generate-btn-price,
.ws-wan-panel > .generate-btn-with-price .generate-btn-price,
.ws-lipsync-footer .generate-btn-with-price .generate-btn-price,
.ws-restyle-footer .generate-btn-with-price .generate-btn-price {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  white-space: nowrap;
}

/* lip-sync quality options */
.ws-lipsync-options {
  display: flex;
  flex-direction: column;
  gap: var(--ws-grid-gap);
}

.ws-lipsync-option {
  text-align: start;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  cursor: pointer;
  width: 100%;
  transition:
    border-color 0.12s,
    background 0.12s;
}

.ws-lipsync-option:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.ws-lipsync-option:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ws-lipsync-title {
  font-size: var(--ws-text-sm);
  font-weight: 700;
  color: var(--text);
}

.ws-lipsync-sub {
  font-size: var(--ws-text-xs);
  line-height: 1.4;
  color: var(--text-3);
  margin-top: 2px;
}

.ws-lipsync-price {
  font-size: var(--ws-text-xs);
  font-weight: 600;
  color: var(--accent);
  margin-top: 4px;
}

/* Wan preset effect picker - selectable chip grid */
.ws-wan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ws-grid-gap);
  padding: 1px;
}

/* Wan panel - scrollable grid, run button pinned at bottom */
.ws-options-content:has(.ws-wan-panel) {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  overflow: hidden;
  min-height: 0;
}

.ws-options-content:has(.ws-wan-panel) > .ws-action-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ws-wan-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--ws-gap);
  padding-bottom: var(--ws-pad);
}

.ws-wan-panel-top {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--ws-gap);
}

.ws-wan-grid-scroll {
  flex: 1 1 auto;
  min-height: 140px;
  max-height: min(48vh, 420px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-bottom: 2px;
}

.ws-wan-grid-scroll .ws-wan-grid {
  align-content: start;
}

.ws-wan-panel .ws-run-btn {
  flex-shrink: 0;
  margin-top: auto;
}

/* Lip-sync panel - inline audio list + pinned run button */
.ws-options-content:has(.ws-lipsync-panel) {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  overflow: hidden;
  min-height: 0;
}

.ws-options-content:has(.ws-lipsync-panel) > .ws-action-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ws-lipsync-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  padding-bottom: var(--ws-pad);
}

.ws-lipsync-panel > .ws-action-desc {
  flex-shrink: 0;
  margin-bottom: 4px;
}

.ws-lipsync-panel > .ws-ai-step-section {
  padding-top: 12px;
  padding-bottom: 12px;
  flex-shrink: 0;
}

.ws-lipsync-panel > .ws-ai-step-section:nth-of-type(2) {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ws-lipsync-panel > .ws-ai-step-section:last-child {
  padding-bottom: 0;
  margin-top: auto;
  flex-shrink: 0;
}

.ws-lipsync-engines {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  min-width: 0;
}

@media (min-width: 420px) {
  .ws-lipsync-engines {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ws-lipsync-panel-top {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--ws-gap);
}

.ws-lipsync-panel .ws-inline-audio-picker {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--ws-gap);
  overflow: hidden;
}

.ws-lipsync-panel .audio-picker-library--inline {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ws-lipsync-panel .audio-picker-list {
  flex: 1 1 auto;
  min-height: 80px;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.ws-lipsync-footer {
  flex-shrink: 0;
  margin-top: auto;
}

.ws-lipsync-speech {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 8px;
  background: var(--surface-2);
}

.ws-lipsync-speech summary {
  cursor: pointer;
  font-size: var(--ws-text-sm);
  font-weight: 600;
  color: var(--text);
  list-style: none;
  user-select: none;
}

.ws-lipsync-speech summary::-webkit-details-marker {
  display: none;
}

.ws-lipsync-speech .textarea {
  margin-top: 6px;
  width: 100%;
  min-height: 48px;
  max-height: 84px;
  font-size: var(--ws-text-sm);
}

.ws-lipsync-speech-btn {
  margin-top: 6px;
}

.audio-picker-quick--inline {
  flex-shrink: 0;
}

.audio-picker-library--inline {
  gap: 4px;
}

.ws-wan-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 52px;
  padding: 7px 5px 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  cursor: pointer;
  text-align: center;
  transition:
    border-color 0.12s,
    background-color 0.12s;
}

.ws-wan-chip:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: none;
}

.ws-wan-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft-2);
}

.ws-wan-chip-icon {
  color: var(--text-3);
  transition: color 0.16s;
}

.ws-wan-chip.active .ws-wan-chip-icon {
  color: var(--accent);
}

.ws-wan-chip-label {
  font-size: var(--ws-text-xs);
  font-weight: 600;
  color: var(--text-2);
  line-height: 1.2;
  transition: color 0.12s;
}

.ws-wan-chip.active .ws-wan-chip-label {
  color: var(--accent);
  font-weight: 700;
}

.ws-wan-chip:hover .ws-wan-chip-label {
  color: var(--text);
}

/* ── Effects section ────────────────────────────────────── */
.ws-effect-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--r-pill);
  padding: 2px 9px;
}

.ws-fx-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ws-fx-hint {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-3);
  margin: 8px 0 0;
}

.ws-fx-presets-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: var(--s-4) 0 6px;
}

/* ── Scene presets - visual example cards ───────────────── */
.ws-presets-panel {
  max-width: none;
}

.ws-presets-empty {
  margin: 0;
  padding: 0;
  font-size: var(--ws-text-sm);
  color: var(--text-3);
  background: none;
  border: none;
  border-radius: 0;
}

.ws-preset-group-label {
  font-size: var(--ws-label);
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 8px 0 5px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.ws-preset-group-label:first-of-type {
  margin-top: 0;
}

.ws-preset-group-sublabel {
  font-size: var(--ws-label);
  font-weight: 600;
  color: var(--text-4);
  letter-spacing: 0.03em;
  margin: 10px 0 4px;
}

.ws-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ws-grid-gap);
}

.ws-preset-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: start;
  min-width: 0;
}

.ws-preset-card:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ws-preset-preview {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: #0a0a0a;
  transition:
    border-color 0.12s,
    box-shadow 0.12s;
}

.ws-preset-card:hover:not(:disabled) .ws-preset-preview {
  transform: none;
  border-color: var(--text-3);
}

.ws-preset-card.is-selected .ws-preset-preview {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft, rgba(10, 107, 118, 0.18));
}

.ws-preset-check {
  position: absolute;
  top: 4px;
  inset-inline-end: 4px;
  z-index: 3;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.ws-preset-base {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.ws-preset-vfx {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: screen;
  pointer-events: none;
}

.ws-preset-vfx-fallback {
  transition: opacity 0.2s ease;
}

.ws-preset-fx-badge {
  position: absolute;
  top: 6px;
  inset-inline-start: 6px;
  z-index: 2;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border-radius: var(--r-pill);
  padding: 2px 6px;
  line-height: 1.3;
  pointer-events: none;
}

.ws-preset-label {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 3;
  padding: 10px 6px 5px;
  font-size: var(--ws-text-xs);
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.2;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  pointer-events: none;
}

.ws-preset-example {
  margin: 0;
  padding: 0 1px;
  font-size: 9px;
  line-height: 1.35;
  color: var(--text-3);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ws-preset-tune {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  margin: 2px 0 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.ws-overlay-tune {
  align-items: flex-start;
  gap: 8px;
}

.ws-overlay-tune .ws-tune-title {
  flex: 0 0 100%;
}

.ws-tune-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  margin-inline-end: 2px;
}

.ws-tune-field {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ws-tune-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  width: 52px;
  flex-shrink: 0;
}

.ws-tune-range {
  width: 72px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.ws-tune-val {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  min-width: 26px;
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.ws-tune-field--select {
  min-width: 150px;
}

.ws-tune-select {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.ws-tune-color {
  width: 36px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
}

.ws-tune-beat {
  min-height: 30px;
  align-self: center;
}

.ws-fx-group-label {
  font-size: var(--ws-text-sm);
  font-weight: 600;
  color: var(--text-2);
  margin: 6px 0 4px;
}

.ws-fx-preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ws-fx-preset-chip {
  padding: 5px 10px;
  border-radius: var(--r-pill);
  font-size: var(--ws-text-xs);
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.12s;
}

@media (max-width: 520px) {
  .ws-preset-grid,
  .ws-overlay-card-grid,
  .ws-style-preset-grid,
  .ws-mask-mode-grid,
  .ws-final-look-grid,
  .ws-wan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ws-tracker-layer-row {
    grid-template-columns: 1fr;
  }
}

/* ── Workshop phone polish (tools list + step panels) ───── */
@media (max-width: 640px) {
  .ws-area-options {
    --ws-pad: 12px;
    --ws-gap: 10px;
    --ws-btn-h: 40px;
  }

  .ws-options-content {
    padding-bottom: 16px;
  }

  .ws-options-head {
    padding: 10px 12px;
  }

  .ws-ai-step-section {
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 14px;
  }

  .ws-ai-step-index {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }

  .ws-ai-step-title {
    font-size: 13px;
  }

  .ws-engine-pick-row:not(.ws-fit-mode-row) {
    grid-template-columns: 1fr;
  }

  .ws-engine-pick,
  .ws-relight-dir {
    min-height: 44px;
    padding: 12px;
  }

  .ws-relight-dirs {
    grid-template-columns: 1fr;
  }

  .ws-look-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .ws-look-chip {
    border-radius: var(--r-md);
  }

  .ws-look-name {
    font-size: 10px;
    padding: 10px 4px 4px;
  }

  .ws-slider-row {
    grid-template-columns: 52px 1fr 36px;
    gap: 8px;
  }

  .ws-slider {
    height: 6px;
  }

  .ws-slider::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }

  .ws-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }

  .ws-range-fields {
    grid-template-columns: 1fr;
  }

  .ws-range-quick-row {
    gap: 8px;
  }

  .ws-sound-chip,
  .ws-check.ws-runway-opt-check {
    min-height: 40px;
  }

  .ws-meta-tabs.ws-seg {
    width: 100%;
  }

  .ws-meta-tabs.ws-seg .ws-meta-tab {
    flex: 1 1 0;
    min-height: 36px;
    justify-content: center;
  }

  .ws-ai-row-actions {
    flex-wrap: wrap;
  }

  .ws-ai-row-actions .btn,
  .ws-replace-mask-panel .btn {
    min-height: 40px;
    flex: 1 1 auto;
  }

  .ws-auto-correct-btn,
  .ws-options-content .ws-run-btn,
  .ws-color-footer .btn,
  .ws-fit-footer .btn,
  .ws-restyle-footer .btn,
  .ws-lipsync-footer .btn {
    min-height: 44px;
  }

  .ws-action-body:not([data-ws-footer-pinned]) > .ws-color-footer,
  .ws-action-body:not([data-ws-footer-pinned]) > .ws-fit-footer,
  .ws-action-body:not([data-ws-footer-pinned]) > .ws-restyle-footer,
  .ws-action-body:not([data-ws-footer-pinned]) > .ws-lipsync-footer {
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin-top: 8px;
    padding-top: 10px;
    padding-bottom: 2px;
    background: linear-gradient(
      to top,
      var(--surface) 70%,
      color-mix(in srgb, var(--surface) 85%, transparent)
    );
  }

  .ws-restyle-footer .generate-btn-with-price,
  .ws-lipsync-footer .generate-btn-with-price {
    width: 100%;
  }

  .ws-options-content:has(.ws-lipsync-panel),
  .ws-options-content:has(.ws-wan-panel) {
    overflow-y: auto;
    flex: 1 1 auto;
  }

  .ws-enh-chip-main {
    min-height: 36px;
    padding-inline: 10px;
  }

  .ws-enh-chip-remove {
    width: 32px;
  }

  .workshop-shot-item {
    flex: 0 0 96px;
    min-height: 0;
  }

  .workshop-shot-thumb {
    height: 56px;
  }
}

.ws-fx-preset-chip:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.ws-fx-preset-chip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Restyle modal extras (workshop) ─────────────────────── */
.ws-restyle-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ws-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--ws-text-sm);
  font-weight: 600;
  color: var(--text-2);
}

.ws-field > span {
  min-width: 52px;
  flex-shrink: 0;
}

.ws-field .input {
  flex: 1;
}

.ws-restyle-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 0;
}

.ws-restyle-opts[hidden],
.ws-check[hidden] {
  display: none !important;
}

.ws-restyle-luma-note {
  margin: 0;
  font-size: var(--ws-text-xs);
  line-height: 1.4;
  color: var(--text-3);
}

.ws-stylize-panel .ws-restyle-warning {
  margin-top: 2px;
}

/* ── LTX Quality / שיקום ואפקטים ─────────────────────────── */
.ws-ltx-panel > .ws-ai-step-section {
  padding-top: 12px;
  padding-bottom: 12px;
}

.ws-ltx-panel > .ws-ai-step-section:last-child {
  padding-bottom: 0;
}

.ws-ltx-grid,
.ws-style-preset-grid.ws-ltx-grid {
  padding: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ws-ltx-selected {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  min-width: 0;
}

.ws-ltx-selected-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}

.ws-ltx-selected-hint {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-3);
}

.ws-ltx-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 0;
}

.ws-ltx-settings .ws-tune-field[hidden] {
  display: none !important;
}

.ws-ltx-settings:has(.ws-tune-field[hidden]) {
  grid-template-columns: 1fr;
}

/* ── Relight / תאורה ─────────────────────────────────────── */
.ws-relight-panel > .ws-ai-step-section {
  padding-top: 12px;
  padding-bottom: 12px;
}

.ws-relight-panel > .ws-ai-step-section:last-child {
  padding-bottom: 0;
}

.ws-relight-dirs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 0;
}

.ws-relight-dir {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  text-align: start;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition:
    border-color 0.15s var(--ease-out),
    box-shadow 0.15s var(--ease-out),
    background 0.15s var(--ease-out);
}

.ws-relight-dir:hover {
  border-color: var(--border-strong);
}

.ws-relight-dir.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft-2);
}

.ws-relight-dir-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.ws-relight-dir.active .ws-relight-dir-label {
  color: var(--accent);
}

.ws-relight-dir-hint {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-3);
  line-height: 1.3;
}

/* «תאורה» · MiniMax H3: the lit ball that is sent to the model. */
.ws-relight-panel .ws-relight-steps {
  display: contents;
}

.ws-light-sphere-preview {
  display: flex;
  justify-content: center;
  padding-top: 10px;
}

.ws-light-sphere-canvas {
  width: 120px;
  height: 120px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}

.ws-light-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 10px;
  font-size: 12px;
  color: var(--text-2);
}

.ws-light-color-input {
  width: 44px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
}

/* «דמות ורקע» · החלפת דמות: the project's characters, numbered in order. */
.ws-recast-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.ws-recast-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color 0.15s var(--ease-out),
    box-shadow 0.15s var(--ease-out),
    background 0.15s var(--ease-out);
}

.ws-recast-card:hover:not(:disabled) {
  border-color: var(--border-strong);
}

.ws-recast-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft-2);
}

.ws-recast-card:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ws-recast-photo {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.ws-recast-badge {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.ws-recast-name {
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* «גודל» · step 3: fill the frame with AI. */
.ws-reframe-guide {
  width: 100%;
}

.ws-reframe-run {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
}

.ws-restyle-footer {
  margin-top: auto;
  padding-top: 2px;
}

.ws-restyle-footer .generate-btn-with-price {
  margin-top: 0;
}

.ws-restyle-footer .ws-run-btn {
  margin-top: 0;
}

.ws-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--ws-text-sm);
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}

.ws-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.ws-seg {
  display: inline-flex;
  background: var(--surface-pressed);
  border-radius: var(--r-xs);
  padding: 2px;
  gap: 2px;
}

.ws-seg button {
  padding: 4px 10px;
  border: none;
  background: transparent;
  border-radius: 5px;
  font-size: var(--ws-text-xs);
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition:
    background 0.12s,
    color 0.12s;
  white-space: nowrap;
}

.ws-seg button:hover:not(.active) {
  color: var(--text);
  background: var(--surface-hover);
}

.ws-seg button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
  font-weight: 600;
}

/* ─── Shots rail header (title + icon actions on one row) ─────────────────── */
.shot-rail .shot-rail-header {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 2px 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--divider);
}

.shot-rail-header .panel-header-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.rail-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: transparent;
}

.rail-header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition:
    background 0.12s var(--ease-out, ease),
    color 0.12s var(--ease-out, ease);
}

.rail-header-btn svg {
  display: block;
  width: 14px;
  height: 14px;
}

.rail-header-btn + .rail-header-btn {
  margin-inline-start: 0;
  box-shadow: none;
}

.rail-header-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  box-shadow: none;
}

.rail-header-btn:focus-visible {
  outline: none;
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
}

.rail-run-all-btn {
  background: transparent;
  color: var(--accent);
}

.rail-run-all-btn svg {
  transform: scaleX(-1);
}

.rail-run-all-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
}

.rail-run-all-btn:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ─── Add-structure dialog ─────────────────────────────────────────────────── */
.modal:has(.add-structure-modal) {
  width: min(560px, 94vw);
  max-width: min(560px, 94vw);
  max-height: min(78vh, 620px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: var(--s-4) var(--s-5);
}

.add-structure-modal {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.add-structure-modal .modal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: var(--s-2);
}

.add-structure-hint {
  font-size: 13px;
  color: var(--text-2);
  margin: 0;
  line-height: 1.5;
}

.add-structure-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.add-structure-blocks {
  flex: 1;
  min-height: 0;
  max-height: min(46vh, 380px);
  overflow-y: auto;
  padding: 2px 1px;
  -webkit-overflow-scrolling: touch;
}

.add-structure-block {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.add-structure-divider {
  border: none;
  margin: var(--s-3) 0;
  height: 0;
  border-top: 1px solid color-mix(in srgb, var(--border) 88%, var(--text-3));
}

.add-structure-line {
  width: 100%;
  min-height: 0;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.55;
  resize: none;
  overflow: hidden;
  box-sizing: border-box;
  direction: rtl;
  text-align: right;
  transition: border-color 0.15s;
}

/* ─── Add-shot dialog ──────────────────────────────────────────────────────── */
.modal.modal-lg:has(.add-shot-modal),
.modal:has(.add-shot-modal) {
  width: min(920px, 96vw);
  max-width: min(920px, 96vw);
  max-height: min(92vh, 780px);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(
    180deg,
    var(--bg-2, var(--surface-2)) 0%,
    var(--surface) 38%,
    var(--surface) 100%
  );
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.add-shot-modal {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

.ashotd-header {
  flex-shrink: 0;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 0;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--divider);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.ashotd-heading {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ashotd-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.ashotd-header .modal-title {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.ashotd-insert-chip {
  display: inline-flex;
  align-items: center;
  max-width: min(280px, 50vw);
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-soft-2);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ashotd-subtitle {
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.4;
}

/* Two columns + center bridge */
.ashotd-body {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 12px;
  flex: 1;
  min-height: 0;
  padding: 16px 18px;
  overflow: auto;
}

.ashotd-side {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: calc(var(--r-md) + 2px);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--text) 4%, transparent);
  transition:
    opacity 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}

.ashotd-side.is-skipped {
  opacity: 0.72;
  border-style: dashed;
}

.ashotd-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.ashotd-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.ashotd-from {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 70%;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 550;
  line-height: 1.2;
}

.ashotd-from span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ashotd-from--empty {
  opacity: 0.75;
  font-weight: 500;
}

.ashotd-media {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #0b1118;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

/* Media area (player / static image / empty) */
.ashotd-player,
.ashotd-static,
.ashotd-empty {
  width: 100%;
  min-height: 168px;
  overflow: hidden;
  background: transparent;
  transition: opacity 0.15s;
}

.ashotd-player.is-disabled,
.ashotd-static.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.ashotd-player {
  display: flex;
  justify-content: center;
  align-items: center;
}

.ashotd-player .vplayer-wrap {
  width: 100%;
  border-radius: 0;
  background: transparent;
}

.ashotd-static {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ashotd-static-img {
  display: block;
  width: 100%;
  max-height: min(38vh, 280px);
  object-fit: contain;
}

.ashotd-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 180px;
  color: var(--text-3);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface-2) 70%, transparent),
    color-mix(in srgb, var(--surface) 85%, transparent)
  );
  border: 1.5px dashed var(--border-strong, var(--border));
  border-radius: var(--r-md);
}

.ashotd-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-pressed);
  color: var(--text-muted);
}

.ashotd-empty-label {
  font-size: 12.5px;
  line-height: 1.35;
  text-align: center;
  padding: 0 12px;
  max-width: 220px;
}

.ashotd-side-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.ashotd-hint {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.35;
}

/* «העלה תמונה»: a picture from the computer instead of the neighbour's frame. */
.ashotd-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* `.btn` is display:inline-flex, which outranks the [hidden] attribute:
   «הסר תמונה» (and an empty hint) must really go away until they apply. */
.ashotd-side-foot [hidden] {
  display: none !important;
}

.ashotd-none-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  padding: 8px 10px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  user-select: none;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.ashotd-none-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong, var(--border));
}

.ashotd-none-toggle .toggle-switch {
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.ashotd-none-toggle .toggle-switch::after {
  width: 16px;
  height: 16px;
}

[dir="rtl"] .ashotd-none-toggle .toggle-input:checked + .toggle-switch::after,
.ashotd-none-toggle .toggle-input:checked + .toggle-switch::after {
  transform: translateX(-16px);
}

.ashotd-none-label {
  font-weight: 550;
}

/* Center bridge between opening / ending cards */
.ashotd-bridge {
  flex: 0 0 auto;
  width: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  align-self: center;
  padding: 8px 0;
}

.ashotd-bridge-line {
  width: 1px;
  flex: 1 1 24px;
  min-height: 18px;
  max-height: 48px;
  background: linear-gradient(
    180deg,
    transparent,
    var(--border-strong, var(--border)),
    transparent
  );
}

.ashotd-bridge-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 48px;
  min-height: 64px;
  padding: 8px 4px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-soft-2);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  letter-spacing: -0.01em;
}

.ashotd-footer {
  flex-shrink: 0;
  margin-top: 0;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--divider);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.ashotd-footer .btn-primary {
  min-width: 124px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Stack columns on narrow screens */
@media (max-width: 720px) {
  .ashotd-body {
    flex-direction: column;
    gap: 10px;
  }

  .ashotd-bridge {
    width: 100%;
    flex-direction: row;
    min-height: 0;
    padding: 2px 0;
  }

  .ashotd-bridge-line {
    width: auto;
    height: 1px;
    flex: 1 1 24px;
    min-height: 0;
    max-height: none;
    background: linear-gradient(
      90deg,
      transparent,
      var(--border-strong, var(--border)),
      transparent
    );
  }

  .ashotd-bridge-pill {
    flex-direction: row;
    width: auto;
    min-height: 0;
    padding: 6px 12px;
    gap: 6px;
    white-space: nowrap;
  }

  .ashotd-subtitle {
    white-space: normal;
  }
}

.add-structure-line:focus {
  outline: none;
  border-color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════
   Workshop - unified panel scale (options content)
   ═══════════════════════════════════════════════════════════ */

.ws-options-content .input,
.ws-options-content .input-select,
.ws-options-content select {
  font-size: var(--ws-text-sm);
  padding: 6px 8px;
  min-height: var(--ws-btn-h);
}

.ws-options-content .textarea,
.ws-options-content .ws-prompt-textarea {
  font-size: var(--ws-text-sm);
  line-height: 1.45;
  padding: 6px 8px;
  min-height: 48px;
  max-height: 84px;
  resize: vertical;
}

.ws-prompt-field-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.ws-options-content .ai-modal-textarea {
  min-height: 48px;
  max-height: 84px;
}

.ws-options-content .btn {
  font-size: var(--ws-text-sm);
}

.ws-options-content .btn-sm {
  min-height: 28px;
  padding: 0 8px;
  font-size: var(--ws-text-xs);
}

.ws-options-content .control-chip {
  padding: 4px 8px;
  font-size: var(--ws-text-xs);
}

.ws-options-content .ws-restyle-opts {
  gap: var(--ws-gap);
}

.ws-options-content .ws-io-panel {
  gap: var(--ws-gap);
}

/* Shot list - menu rail only (panels use --ws-* tokens above) */
.workshop-shot-list-header {
  font-size: 11px;
}
.workshop-shot-title {
  font-size: 11px;
}

.ws-menu-group {
  font-size: 9px;
}
.ws-menu-btn {
  font-size: 11px;
}
.ws-menu-label {
  font-size: 11px;
}

/* ── Video frame picker modal (frame-slot.js) ────────────────────────────── */

/* "קח פריים מסרטון" card in the library picker grid */
.assign-picker-video-frame {
  border: 1.5px dashed var(--accent);
  background: var(--accent-soft);
}
.assign-picker-video-frame:hover {
  opacity: 0.82;
}
.assign-picker-video-frame-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

/* ── Make the .modal shell behave like the library modal ─────────────────── */
.modal:has(.vfp-modal) {
  display: flex;
  flex-direction: column;
  height: min(90vh, 740px);
  max-height: min(90vh, 740px);
  overflow: hidden;
  padding: 0;
  min-height: 0;
}

/* ── Inner flex container ────────────────────────────────────────────────── */
.vfp-modal {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.vfp-modal .modal-header {
  padding: 16px 20px 14px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Two-column layout: sidebar (right, RTL col-1) + main (left, col-2) ─── */
.vfp-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Sidebar: scrollable video list ─────────────────────────────────────── */
.vfp-sidebar {
  overflow-y: auto;
  border-inline-start: 1px solid var(--border);
  background: var(--surface-2);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.vfp-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-shrink: 0;
  padding: 2px 4px 4px;
  min-width: 0;
}

.vfp-sidebar-expand {
  flex-shrink: 0;
  font-size: 11px;
  padding: 2px 8px;
  white-space: nowrap;
}

.vfp-vid-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
}

.vfp-vid-empty {
  margin: 0;
  padding: 12px 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-3);
  text-align: center;
}

.vfp-sidebar-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 4px 4px 0;
  flex: 1;
  min-width: 0;
}

.vfp-vid-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.1s;
  min-width: 0;
}
.vfp-vid-item:hover {
  background: var(--surface-hover);
}
.vfp-vid-item.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.vfp-vid-thumb {
  width: 52px;
  height: 33px;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--surface-3);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--text-3);
  border: 1px solid var(--border);
}

.vfp-vid-name {
  font-size: 12px;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.35;
}

/* ── Main area: video player + controls ─────────────────────────────────── */
.vfp-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  overflow: hidden;
  min-height: 0;
  flex: 1;
}

.vfp-video-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
  border-radius: var(--r-md);
}

/* Custom vplayer fills the entire frame-picker area */
.vfp-video-wrap .vplayer-wrap {
  flex: 1;
  min-height: 0;
  border-radius: var(--r-md);
}

.vfp-video-wrap .vplayer-video {
  flex: 1;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
}

.vfp-time-label,
.vfp-blur-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  min-width: 40px;
  text-align: start;
  flex-shrink: 0;
}

.vfp-blur-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.vfp-blur-row-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 40px;
}

.vfp-blur-row .ws-slider {
  flex: 1;
}

.vfp-actions {
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
  gap: 8px;
}

.vfp-confirm-btn {
  min-width: 120px;
}

/* ── Frame image crop modal (frame-slot.js) ──────────────────────────────── */
.modal:has(.fcm-modal) {
  max-width: min(760px, 96vw);
  max-height: min(90vh, 800px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.fcm-modal {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.fcm-modal .modal-header {
  padding: 16px 20px 12px;
  margin-bottom: 0;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-1, rgba(255, 255, 255, 0.08));
}

.fcm-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 20px 20px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.fcm-preview-wrap {
  position: relative;
  align-self: center;
  /* Width + height are set in JS so the frame always matches the output
     aspect (fixed CSS height + max-width was stretching portrait/landscape). */
  width: auto;
  height: auto;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-md, 10px);
  background: #000;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.fcm-preview-wrap.is-dragging {
  cursor: grabbing;
}

.fcm-preview-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.fcm-preview-frame {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.fcm-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  flex-shrink: 0;
}

.fcm-aspect-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.fcm-aspect-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.fcm-aspect-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fcm-aspect-chip {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s;
}

.fcm-aspect-chip:hover {
  border-color: var(--accent);
  color: var(--text-1);
}

.fcm-aspect-chip.is-selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--text-1);
}

.fcm-slider-row {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.fcm-slider-label,
.fcm-zoom-label {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}

.fcm-zoom-label {
  min-width: 42px;
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.fcm-slider-row .ws-slider {
  flex: 1;
  min-width: 0;
}

.fcm-actions {
  display: flex;
  flex-shrink: 0;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.project-stats-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* The shot's authored fields, inside the video card and directly under the
   prompt that will be sent — same components and same order as the plan, so
   the two screens are one form seen twice rather than two designs. */
.shot-brief-fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}

.shot-notes-fold,
.shot-brief-fold {
  margin: 0;
  padding: 0;
  border: 1px solid var(--divider);
  border-radius: var(--r-sm);
  background: var(--surface-2, var(--bg));
}

.shot-notes-fold > summary,
.shot-brief-fold > summary {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  cursor: pointer;
  padding: 6px 10px;
  list-style: none;
  user-select: none;
}

.shot-notes-fold > summary::-webkit-details-marker,
.shot-brief-fold > summary::-webkit-details-marker {
  display: none;
}

.shot-notes-fold > summary::before {
  content: "";
  width: 0;
  height: 0;
  border-inline-start: 5px solid currentColor;
  border-block: 4px solid transparent;
  opacity: 0.55;
  transform: rotate(0deg);
  transition: transform 0.12s;
}

.shot-notes-fold[open] > summary::before {
  transform: rotate(90deg);
}

/* "פרטי הקטע" wears the exact head of "הגדרות מתקדמות": a leading icon, the
   title taking the room, and the chevron at the far end. */
.shot-brief-fold > summary > .ui-icon {
  color: var(--text-3);
  flex-shrink: 0;
}

.shot-brief-title {
  flex: 1;
}

.shot-brief-chevron {
  display: inline-flex;
  color: var(--text-3);
  transition: transform 0.18s ease;
}

.shot-brief-fold[open] > summary .shot-brief-chevron {
  transform: rotate(180deg);
}

.shot-notes-fold.is-filled > summary,
.shot-brief-fold.is-filled > summary {
  color: var(--text);
}

.shot-notes-fold > .input,
.shot-brief-fold > .shot-brief-fields {
  padding: 0 10px 8px;
}

.shot-notes-fold > .input {
  width: 100%;
}

.shot-brief-link {
  align-self: flex-start;
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.shot-brief-link:hover {
  text-decoration: underline;
}
