/* Scoped to the four transformation histories; other generation pages stay intact. */
#page-photo-motion .photo-motion-task-list,
#page-photo-motion .video-transform-task-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: 14px;
  align-items: stretch;
}
#page-photo-motion .photo-motion-task-list > .empty-state,
#page-photo-motion .video-transform-task-list > .empty-state { grid-column: 1 / -1; }
#page-photo-motion .video-record-card {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  align-items: stretch;
  gap: 16px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(172, 129, 231, .23);
  border-radius: 12px;
  background: #0d0e13;
}
.video-record-media {
  width: 100%;
  aspect-ratio: 9 / 16;
  align-self: start;
  overflow: hidden;
  border-radius: 8px;
  background: #050507;
}
.video-record-media > video { width: 100%; height: 100%; object-fit: contain; }
.video-record-placeholder {
  display: grid;
  height: 100%;
  align-content: center;
  justify-items: center;
  gap: 10px;
  color: #a8a0b8;
  font-size: 12px;
  background: #14121b;
}
.video-record-placeholder svg { width: 26px; height: 26px; }
.video-record-body { display: flex; flex-direction: column; min-width: 0; gap: 8px; }
.video-record-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.video-record-heading h3 { margin: 0; color: var(--text-primary); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.video-record-status { margin-left: auto; color: #bca2e2; font-size: 12px; white-space: nowrap; }
[data-record-state="failed"] .video-record-status { color: #f49b90; }
.video-record-details, .video-record-time, .video-record-billing {
  margin: 0;
  color: #aaa5b3;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.video-record-time { color: #928e9c; }
.video-record-progress-group { display: flex; align-items: center; gap: 8px; width: min(100%, 240px); margin-top: 6px; }
.video-record-progress { flex: 1; height: 4px; overflow: hidden; border-radius: 6px; background: #25212d; }
.video-record-progress i { display: block; height: 100%; background: #b188e7; border-radius: inherit; }
.video-record-progress-group > span { color: #aaa5b3; font-size: 11px; font-variant-numeric: tabular-nums; }
.video-record-error { margin: 0; color: #f49b90; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
#page-photo-motion .video-record-actions { display: flex; justify-content: flex-start; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; }
.video-record-action {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #39333f;
  border-radius: 9px;
  background: #19171f;
  color: #e5deef;
  cursor: pointer;
  text-decoration: none;
}
.video-record-action::before, .video-record-action::after { content: none; }
.video-record-action svg { width: 17px; height: 17px; stroke-width: 1.8; pointer-events: none; }
.video-record-download { color: #e3bc54; border-color: #514529; background: #231f16; }
.video-record-delete { color: #d99a8e; border-color: #51342d; background: #251916; }
.video-record-action:disabled { opacity: .4; cursor: not-allowed; }
@media (hover: hover) { .video-record-action:not(:disabled):hover { color: #fff; border-color: #b188e7; background: #2c223a; } }
.video-record-action:focus-visible { outline: 2px solid #c7a4f5; outline-offset: 3px; }
.video-record-updating { color: #a8a0b8; font-size: 12px; }

.video-record-dialog {
  box-sizing: border-box;
  width: min(540px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 14px;
  overflow: auto;
  border: 1px solid #584169;
  border-radius: 14px;
  background: #0e0e14;
  color: #eee8f5;
}
.video-record-dialog::backdrop { background: rgba(0, 0, 0, .78); }
.video-record-dialog.is-landscape { width: min(1000px, calc(100vw - 24px)); }
.video-record-dialog-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.video-record-dialog-header h2 { flex: 1; min-width: 0; margin: 0; font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.video-record-dialog-header button { width: 44px; height: 44px; }
.video-record-dialog > video {
  display: block;
  width: 100%;
  height: min(78dvh, 880px);
  max-height: calc(100dvh - 158px);
  object-fit: contain;
  border-radius: 8px;
  background: #000;
}
.video-record-dialog.is-landscape > video { height: auto; aspect-ratio: 16 / 9; }
.video-record-preview-status { margin: 8px 0 0; color: #c2b3ce; font-size: 13px; }
.video-record-preview-status:empty { display: none; }

#page-photo-motion .photo-motion-submit-card {
  grid-template-columns: 150px minmax(180px, 1fr) auto;
  gap: 20px;
  padding: 18px 20px;
}
#page-photo-motion .photo-motion-submit-actions { display: block; grid-column: auto; }
#page-photo-motion .photo-motion-duration-control { gap: 6px; }
#page-photo-motion .photo-motion-duration-input input { min-height: 44px; }
#page-photo-motion #photo-motion-quote {
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
#photo-motion-quote strong { font-size: 17px; }
#photo-motion-quote em { line-height: 1.6; }
#photo-motion-quote .quote-unavailable { color: #f49b90; }
.photo-motion-source-card > .photo-motion-consent { margin-top: 12px; min-height: 32px; align-items: center; }
@media (max-width: 760px) {
  #page-photo-motion .video-record-card { grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 12px; }
  #page-photo-motion .photo-motion-submit-card { grid-template-columns: 110px minmax(0, 1fr); gap: 14px; padding: 16px; }
  #page-photo-motion .photo-motion-submit-actions { grid-column: 1 / -1; }
  #page-photo-motion .photo-motion-submit-actions > .btn { min-height: 44px; }
  .video-record-heading h3 { font-size: 14px; }
  .video-record-status { margin-left: 0; }
}
@media (max-width: 374px) {
  #page-photo-motion .video-record-card { grid-template-columns: 104px minmax(0, 1fr); gap: 10px; padding: 10px; }
}
@media (pointer: coarse) { .video-record-action { width: 44px; height: 44px; } }

/* A single compact composition row: source, target/instructions, settings. */
.video-transform-compose-grid {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(260px, 1.1fr) minmax(240px, .85fr);
  gap: 14px;
  margin-bottom: 14px;
  align-items: stretch;
}
#page-photo-motion .video-transform-compose-grid > .card { min-width: 0; margin: 0; padding: 16px; }
#page-photo-motion .video-transform-compose-grid .card-title { font-size: 15px; margin-bottom: 12px; }
#page-photo-motion .video-transform-compose-grid .photo-motion-dropzone { min-height: 220px; padding: 12px; gap: 8px; }
#page-photo-motion .video-transform-compose-grid .photo-motion-dropzone.has-local-preview { min-height: 0; }
#page-photo-motion .video-transform-compose-grid .local-upload-preview {
  width: 126px;
  height: 224px;
  max-width: 100%;
  max-height: none;
  object-fit: contain;
  margin: 0 auto;
  background: #050507;
}
#page-photo-motion .video-transform-compose-grid .photo-motion-dropzone strong { max-width: 100%; font-size: 13px; overflow-wrap: anywhere; }
#page-photo-motion .video-transform-compose-grid .photo-motion-dropzone > span { font-size: 12px; }
#page-photo-motion .video-transform-compose-grid .photo-motion-tabs { margin-bottom: 10px; }
#page-photo-motion .video-transform-compose-grid .photo-motion-tabs button { min-height: 38px; font-size: 12px; padding: 6px; }
#page-photo-motion .video-transform-compose-grid .video-transform-controls-card { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
#page-photo-motion .video-transform-compose-grid .video-transform-control-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#page-photo-motion .video-transform-compose-grid .video-transform-control-row > label { min-width: 0; }
#page-photo-motion .video-transform-compose-grid input.form-input,
#page-photo-motion .video-transform-compose-grid select { min-width: 0; min-height: 42px; padding: 8px; }
#page-photo-motion .video-transform-compose-grid .video-transform-quote { width: 100%; min-width: 0; margin: 0; }
#page-photo-motion .video-transform-compose-grid .photo-motion-consent { margin: 0; line-height: 1.6; font-size: 12px; }
#page-photo-motion .video-transform-compose-grid .video-transform-submit { align-self: stretch; width: 100%; min-height: 44px; margin-top: auto; font-size: 14px; padding: 10px; }
#page-photo-motion .video-transform-compose-grid .video-transform-prompt-card { display: flex; flex-direction: column; gap: 10px; }
#page-photo-motion .video-transform-compose-grid .video-transform-prompt-card textarea { flex: 1; min-height: 200px; width: 100%; font-size: 14px; resize: vertical; }
#page-photo-motion .video-transform-compose-grid .video-transform-prompt-card .form-hint { font-size: 12px; line-height: 1.6; }
#page-photo-motion .video-transform-intro.has-example { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; }
.video-transform-intro.has-example > div { min-width: 0; }
.video-transform-example { grid-column: 1 / -1; min-width: 0; margin: 0; }
.video-transform-example > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 16px;
  color: #e0cff6;
  background: #1c1726;
  border: 1px solid #514064;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  list-style: none;
  cursor: pointer;
}
.video-transform-example > summary::-webkit-details-marker { display: none; }
.video-transform-example > summary::marker { content: ''; }
.video-transform-example > summary svg { width: 20px; height: 20px; flex: none; }
.video-transform-example > summary:hover { background: #282033; border-color: #9575b8; }
.video-transform-example > summary:focus-visible { outline: 2px solid #c7a4f5; outline-offset: 3px; }
.video-transform-example-chevron { width: 9px; height: 9px; margin: 0 4px 4px auto; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); flex: none; }
.video-transform-example[open] .video-transform-example-chevron { margin-bottom: -4px; transform: rotate(225deg); }
#page-photo-motion .video-transform-example .video-transform-case-card { width: min(100%, 340px); padding: 16px 0 0; margin: 0; border: 0; background: transparent; box-shadow: none; }
#page-photo-motion .video-transform-example .video-transform-case-gallery { width: min(100%, 700px); }
.video-transform-case-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.video-transform-case-items figure { min-width: 0; margin: 0; }
.video-transform-case-items video { display: block; aspect-ratio: 1; object-fit: contain; }
.video-transform-case-items figcaption { margin-top: 8px; color: var(--text-muted); font-size: 13px; }
@media (max-width: 480px) {
  .video-transform-case-items { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1200px) {
  .video-transform-compose-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #page-photo-motion .video-transform-compose-grid .video-transform-controls-card { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 650px) {
  #page-photo-motion .video-transform-intro.has-example { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .video-transform-intro.has-example > .badge { grid-row: 1; justify-self: start; }
  .video-transform-compose-grid { grid-template-columns: minmax(0, 1fr); }
  #page-photo-motion .video-transform-compose-grid .video-transform-controls-card { display: flex; }
  #page-photo-motion .video-transform-compose-grid .photo-motion-tabs button { min-height: 44px; }
  #page-photo-motion .video-transform-compose-grid .photo-motion-dropzone { min-height: 156px; }
}
@media (pointer: coarse) {
  #page-photo-motion .video-transform-compose-grid input.form-input,
  #page-photo-motion .video-transform-compose-grid select { min-height: 44px; }
}
