/* Video generation (public/video.js). Built on the Settings page's set-group
   look and the compact product cards, so it reads as the same product; the one
   saturated thing is the Make button (DESIGN.md §0). */

.vid-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: var(--s6, 32px); align-items: start; }
.vid-form { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.vid-group { margin: 0; }
.vid-hint { margin: -4px 0 var(--s3); }

/* templates: quiet cards in two groups, the chosen one outlined */
.vid-tpl-group + .vid-tpl-group { margin-top: var(--s4); }
.vid-tpl-head { margin: 0 0 var(--s2); font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.vid-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--s3); }
.vid-tpl {
  display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--panel); color: var(--text); font: inherit;
  transition: border-color .15s ease, background-color .15s ease;
}
.vid-tpl:hover { border-color: var(--border-2); }
.vid-tpl.is-sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.vid-tpl:focus-visible { outline: none; box-shadow: var(--focus); }
.vid-tpl-name { font-size: 14px; font-weight: 600; }
.vid-tpl-blurb { font-size: 12px; line-height: 1.45; color: var(--muted); }
.vid-tpl-meta { margin-top: auto; font-family: var(--mono); font-size: 11.5px; color: var(--text-2); }

/* products */
.vid-products { display: flex; flex-direction: column; gap: var(--s3); }
.vid-search { max-width: 320px; }
.vid-product { display: block; padding: 0; text-align: left; cursor: pointer; font: inherit; color: var(--text); }
.vid-product .res-shot { display: block; height: 104px; }
.vid-product .res-product-name { display: block; }
.vid-product.is-sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.vid-product:focus-visible { outline: none; box-shadow: var(--focus); }

/* script + voice */
.vid-script { width: 100%; resize: vertical; line-height: 1.6; min-height: 96px; font-size: 15px; }
.vid-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s2); }
.vid-count { font-variant-numeric: tabular-nums; }

/* text on screen */
.vid-details { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 14px; background: var(--panel); }
.vid-details summary { cursor: pointer; font-size: 13.5px; font-weight: 500; }
.vid-details[open] summary { margin-bottom: var(--s3); }
.vid-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s3); }
.vid-field .set-input { width: 100%; flex: none; }
.vid-check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }

.vid-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.vid-make { min-height: 40px; padding-inline: 18px; }

/* the list of videos */
.vid-list { position: sticky; top: var(--s4); min-width: 0; }
.vid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--s3); }
.vid-card { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--panel); overflow: hidden; }
.vid-frame { position: relative; aspect-ratio: 9 / 16; background: var(--panel-2); }
.vid-player { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.vid-wait {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 14px; text-align: center; font-size: 12.5px; color: var(--text-2);
}
.vid-wait.is-err { color: var(--danger); }
.vid-spin {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border-2); border-top-color: var(--accent);
  animation: vid-spin .9s linear infinite;
}
@keyframes vid-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .vid-spin { animation: none; } }
.vid-meta { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; }
.vid-meta-title { margin: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vid-meta .btn { align-self: flex-start; margin-top: 4px; }

@media (max-width: 980px) {
  .vid-shell { grid-template-columns: 1fr; }
  .vid-list { position: static; }
}

/* Apple finish, batch 5: a template or product presses like a button; the chosen outline settles on the spring. */
.vid-tpl, .vid-product {
  transition: border-color var(--dur-1) var(--ease-out), background-color var(--dur-1) var(--ease-out),
    box-shadow var(--dur-2) var(--spring), transform var(--dur-press) var(--ease-out);
}
.vid-tpl:active, .vid-product:active { transform: scale(.98); }
