.storyboard-strip img,
.storyboard-strip video {
  object-fit: cover;
  opacity: .78;
  width: 100%;
  height: 100%;
  display: block;
}

.storyboard-strip button.active img,
.storyboard-strip button.active video {
  opacity: 1;
}

.storyboard-strip .media-kind {
  color: #d8f6ff;
  letter-spacing: .08em;
  background: #071019d9;
  border: 1px solid #5cecff70;
  border-radius: 2px;
  padding: 2px 4px;
  font-size: 5px;
  font-weight: 700;
  position: absolute;
  top: 4px;
  right: 4px;
}

.storyboard-strip .media-kind.image {
  color: #dbc8e1;
  background: #120c16d9;
  border-color: #c58bdf66;
}

.storyboard-strip .media-kind.generated,
.media-inspector-badge.generated {
  color: #9fe3cd;
  background: #071511de;
  border-color: #75d6bd66;
}

.image-inspector-preview img,
.image-inspector-preview video {
  object-fit: cover;
  width: 100%;
  height: 100%;
  transition: transform .15s, object-position .15s;
  display: block;
}

.media-inspector-badge {
  color: #cbb8d1;
  letter-spacing: .12em;
  border: 1px solid #c58bdf4d;
  border-radius: 999px;
  justify-self: start;
  padding: 3px 7px;
  font-size: 6px;
  font-weight: 700;
}

.media-inspector-badge.video {
  color: #a8e9f2;
  border-color: #5cecff66;
}

.video-trim-controls {
  background: linear-gradient(145deg, #5cecff09, #c58bdf08);
  border: 1px solid #5cecff24;
  grid-template-columns: 1fr 1fr;
  grid-column: 1 / -1;
  gap: 8px 10px;
  padding: 10px;
  display: grid;
}

.video-loop-toggle {
  color: #817d88;
  cursor: pointer;
  background: transparent;
  border: 1px solid #ffffff1a;
  min-height: 30px;
  font-size: 7px;
}

.video-loop-toggle.active {
  color: #9fd7c4;
  background: #75d6bd12;
  border-color: #75d6bd61;
}

.image-inspector-actions button:disabled {
  opacity: .34;
  cursor: not-allowed;
}

.local-image-generator {
  background:
    radial-gradient(circle at 90% 0%, #5cecff12, transparent 34%),
    linear-gradient(145deg, #11111a, #090a10);
  border: 1px solid #ffffff14;
  border-radius: 4px;
  margin-bottom: 18px;
  padding: 18px;
  box-shadow: 0 24px 55px #0000002b;
}

.local-image-generator.online {
  border-color: #75d6bd42;
}

.local-image-heading,
.image-engine-actions,
.local-image-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.local-image-heading > div:first-child {
  display: grid;
  gap: 4px;
}

.local-image-heading span,
.local-image-form label > span,
.image-count > span {
  color: #9a96a2;
  letter-spacing: .12em;
  font-size: 7px;
  font-weight: 700;
}

.local-image-heading h4 {
  color: #f3eef5;
  margin: 0;
  font-size: 17px;
  font-weight: 540;
}

.local-image-generator > p {
  color: #918d98;
  max-width: 720px;
  margin: 12px 0 16px;
  font-size: 10px;
  line-height: 1.65;
}

.image-engine-actions button,
.seed-lock,
.generate-local-images {
  color: #b8b2bf;
  cursor: pointer;
  background: #ffffff05;
  border: 1px solid #ffffff17;
  min-height: 32px;
  padding: 0 11px;
  font-size: 8px;
}

.image-engine-actions button:hover,
.seed-lock:hover {
  color: #fff;
  border-color: #c58bdf66;
}

.image-engine-actions button:disabled,
.generate-local-images:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.image-engine-status {
  color: #a29da8;
  letter-spacing: .08em;
  white-space: nowrap;
  border: 1px solid #ffffff17;
  border-radius: 999px;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  font-size: 7px;
  font-weight: 700;
  display: inline-flex;
}

.image-engine-status i {
  background: #77717e;
  border-radius: 50%;
  width: 6px;
  height: 6px;
  box-shadow: 0 0 8px #77717e;
}

.image-engine-status.online {
  color: #9fe3cd;
  border-color: #75d6bd50;
}

.image-engine-status.online i {
  background: #75d6bd;
  box-shadow: 0 0 10px #75d6bd;
}

.image-engine-status.offline i {
  background: #ff9a62;
  box-shadow: 0 0 10px #ff9a62;
}

.image-engine-status.checking i {
  background: #c58bdf;
  animation: image-engine-pulse 1s infinite alternate;
}

@keyframes image-engine-pulse {
  to { opacity: .25; transform: scale(.7); }
}

.image-engine-setup {
  color: #aaa4b0;
  background: #c58bdf0a;
  border: 1px solid #c58bdf2b;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 5px 12px;
  padding: 12px;
  font-size: 9px;
  display: grid;
}

.image-engine-setup.warning {
  background: #ff9a6208;
  border-color: #ff9a6233;
}

.image-engine-setup code {
  color: #d9c8df;
  overflow-wrap: anywhere;
}

.local-image-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  display: grid;
}

.local-image-form label {
  gap: 6px;
  display: grid;
}

.local-image-form label.wide {
  grid-column: 1 / -1;
}

.local-image-form select,
.local-image-form textarea {
  color: #ded9e2;
  background: #07080d;
  border: 1px solid #ffffff17;
  border-radius: 0;
  width: 100%;
  padding: 9px 10px;
  font: inherit;
  font-size: 9px;
}

.local-image-form textarea {
  line-height: 1.5;
  resize: vertical;
}

.local-image-form select:focus,
.local-image-form textarea:focus {
  border-color: #c58bdf7d;
  outline: none;
}

.local-image-footer {
  flex-wrap: wrap;
  margin-top: 12px;
}

.image-count {
  min-width: 180px;
  flex: 1;
  gap: 5px;
  display: grid;
}

.seed-lock.active {
  color: #a9e2d0;
  background: #75d6bd0d;
  border-color: #75d6bd45;
}

.generate-local-images {
  color: #0a0b10;
  background: linear-gradient(90deg, #c58bdf, #72d6db);
  border: 0;
  min-width: 220px;
  font-weight: 800;
}

.image-generation-progress {
  background: #ffffff0c;
  height: 3px;
  margin-top: 12px;
  overflow: hidden;
}

.image-generation-progress i {
  background: linear-gradient(90deg, #c58bdf, #5cecff);
  height: 100%;
  transition: width .25s;
  display: block;
  box-shadow: 0 0 12px #5cecff;
}

.image-engine-error {
  color: #ffb18d;
  background: #ff744908;
  border-left: 2px solid #ff8b61;
  margin-top: 10px;
  padding: 8px 10px;
  font-size: 8px;
  line-height: 1.5;
  display: block;
}

.image-engine-privacy {
  color: #77727e;
  border-top: 1px solid #ffffff0d;
  margin-top: 12px;
  padding-top: 10px;
  font-size: 7px;
  line-height: 1.55;
  display: block;
}

.equalizer-options button:has(em) {
  background: linear-gradient(145deg, #c58bdf0b, #5cecff08);
}

.visualizer-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (width <= 640px) {
  .video-trim-controls,
  .visualizer-controls,
  .local-image-form {
    grid-template-columns: 1fr;
  }

  .local-image-form label.wide {
    grid-column: auto;
  }

  .local-image-heading,
  .local-image-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .image-engine-actions {
    justify-content: flex-start;
  }

  .generate-local-images {
    width: 100%;
  }

  .video-trim-controls .video-loop-toggle {
    min-height: 34px;
  }
}
