.animation-generation-panel[hidden] {
  display: none;
}

#animationPrompt {
  min-height: 150px;
  resize: vertical;
}

.animation-image-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.animation-image-item .video-generation-file-remove::before,
.animation-image-item .video-generation-file-remove::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
}

.animation-image-item .video-generation-file-remove::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.animation-image-item .video-generation-file-remove::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.animation-result-actions,
.animation-modify-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.animation-result-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 14px;
}

.animation-result-actions button {
  min-width: 168px;
}

.animation-modify-actions {
  justify-content: space-between;
}

.animation-result-actions[hidden] {
  display: none;
}

.animation-completed-results {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.animation-completed-results[hidden] {
  display: none;
}

.animation-completed-result {
  display: grid;
  gap: 0;
}

.animation-completed-result .video-generation-output {
  width: 100%;
}

.animation-generation-panel .video-generation-output-error {
  transition: opacity 0.45s ease;
}

.animation-generation-panel .video-generation-output-error.is-fading {
  opacity: 0;
  pointer-events: none;
}

.video-generation-output.is-portrait video {
  width: auto;
  max-width: 100%;
  height: min(70vh, 620px);
  object-fit: contain;
}

.animation-progress {
  width: min(320px, 82%);
  display: grid;
  gap: 10px;
  color: #fff;
  text-align: center;
}

.animation-progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
}

.animation-progress-bar {
  width: 36%;
  height: 100%;
  background: #fff;
  animation: animation-progress 1.2s ease-in-out infinite alternate;
}

@keyframes animation-progress {
  from { transform: translateX(-80%); }
  to { transform: translateX(250%); }
}

.animation-modify-box {
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.animation-modify-box[hidden] {
  display: none;
}

.animation-modify-box textarea {
  min-height: 110px;
  resize: vertical;
}

.animation-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.animation-status:empty {
  display: none;
}

.animation-history-list {
  padding-top: 0;
}

.animation-history {
  grid-column: 1 / -1;
}

.animation-history-project {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.animation-history-project:first-child {
  border-top: 0;
  padding-top: 0;
}

.animation-history-project > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  cursor: pointer;
}

.animation-history-project > summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.animation-history-project > summary span {
  color: var(--muted);
  font-size: 12px;
}

.animation-history-versions {
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

.animation-history-version {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.animation-history-version video,
.animation-history-placeholder {
  width: 132px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  background: #090909;
}

.animation-history-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.animation-history-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.animation-history-meta {
  color: var(--muted);
  font-size: 12px;
}

.animation-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.video-generation-history-item > .animation-modify-box {
  padding: 0 10px 12px;
}

.video-generation-history-item > .animation-modify-box .animation-modify-actions {
  gap: 8px;
}

.video-generation-history-item > .animation-modify-box .secondary-button {
  min-height: 36px;
  padding: 0 14px;
  font-size: 12px;
}

.video-generation-history-item > .animation-modify-box .primary-button {
  min-height: 36px;
  padding: 0 14px;
  font-size: 12px;
}

.animation-generation-panel .primary-button[data-download-state="success"] {
  opacity: 0.48;
}

@media (max-width: 600px) {
  .animation-image-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .animation-generation-panel .video-generation-result-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .animation-result-actions {
    width: 100%;
  }

  .animation-result-actions button {
    flex: 1;
    min-width: 0;
  }

  .animation-history-version {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .animation-history-version video,
  .animation-history-placeholder {
    width: 96px;
  }
}
