/*
 * Videos: the list view (the default) and the toolbar; then Create video's start.
 * First the shared list in every look (tokens only), then the Stage look matching
 * ui-b-stage proof 36-videos / 37-videos-filtered / 38-videos-list-bulk-select / 41-videos-empty
 * (README "Shell": a grey shell holding white row tiles, chips with a dot, black active filter pill).
 */

/* ================================================================ *
 * ALL LOOKS — list rows
 * ================================================================ */
.vlist { display: grid; gap: var(--s1); }
.vlist > .estate, .vlist > .empty-wrap { grid-column: 1 / -1; }
.vlist-head,
.vrow { display: grid; grid-template-columns: 1.75rem 4.5rem minmax(0, 1fr) 11.5rem 8rem 7rem 10.5rem 2.25rem; align-items: center; gap: var(--s3); }
.vlist-head { padding: 0 var(--s3); font: var(--w-medium) var(--fs-meta)/1.3 var(--font-sans); color: var(--muted); }
.vrow { position: relative; padding: var(--s2) var(--s3); border-radius: var(--r-sm); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.vrow:hover { background: var(--hover-card); }
.vrow .vsel { position: static; opacity: 1; width: 1.75rem; height: 1.75rem; background: none; box-shadow: none; }
.vrow.is-picked { box-shadow: inset 0 0 0 2px var(--ink-strong); }
.vrow-thumb { display: grid; place-items: center; aspect-ratio: 16 / 9; border-radius: var(--r-xs); overflow: hidden; background: var(--soft); color: var(--muted); }
.vrow-thumb > svg, .vrow-thumb > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vrow-thumb--empty > svg { width: 16px; height: 16px; }
.vrow-title { font: var(--type-body-strong); color: var(--ink-strong); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vrow-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.vrow-from, .vrow-when { font: var(--type-meta); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vrow-next { justify-self: end; display: inline-flex; align-items: center; gap: var(--s1); font: var(--w-medium) var(--fs-meta)/1.2 var(--font-sans); color: var(--ink-strong); white-space: nowrap; }
.vrow-next .i { width: 14px; height: 14px; }
.vrow .more-btn { position: relative; z-index: 2; width: 2.25rem; height: 2.25rem; }
.vview { flex: none; }
.vview .seg-opt { display: inline-flex; align-items: center; gap: var(--s1); }
.vview .seg-opt .i { width: 15px; height: 15px; }
@media (max-width: 1180px) {
  .vlist-head, .vrow { grid-template-columns: 1.75rem 4.5rem minmax(0, 1fr) 11rem 7rem 2.25rem; }
  .vlist-head > :nth-child(5), .vlist-head > :nth-child(7), .vrow-from, .vrow-next { display: none; }
}
@media (max-width: 720px) {
  .vlist-head { display: none; }
  .vrow { grid-template-columns: 1.75rem 4rem minmax(0, 1fr) 2.25rem; }
  .vrow-status, .vrow-when { display: none; }
}

/* ================================================================ *
 * STAGE — Videos
 * ================================================================ */
/* Toolbar: search, sort and the List/Grid switch on one white pill; the filter pills on the row under it. */
html[data-look="stage"] body[data-route="videos"] .filters {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 12px; padding: 8px 10px 0; margin: 0;
}
html[data-look="stage"] body[data-route="videos"] .filters::before {
  content: ""; position: absolute; z-index: 0; left: 0; right: 0; top: 0; height: 52px; border-radius: 999px; background: var(--dk-paper, #fff);
  box-shadow: 0 1px 2px rgba(31, 31, 33, .04), 0 4px 12px rgba(31, 31, 33, .05);
}
html[data-look="stage"] body[data-route="videos"] .filters > * { position: relative; z-index: 1; }
html[data-look="stage"] body[data-route="videos"] .filters .search--videos { order: 1; flex: 0 1 320px; width: auto; height: 36px; margin: 0; background: var(--dk-paper, #fff); }
html[data-look="stage"] body[data-route="videos"] .filters .sort-inline { order: 2; margin: 0; }
html[data-look="stage"] .sort-inline .select select { height: 36px; min-width: 10rem; }
html[data-look="stage"] body[data-route="videos"] .filters .vview { order: 3; }
html[data-look="stage"] body[data-route="videos"] .filters .count { order: 4; margin-left: auto; padding-right: 8px; font: 400 12.5px/1 var(--v-font); color: var(--s-ink-2); background: none; border: 0; }
html[data-look="stage"] body[data-route="videos"] .filters .pillbar { order: 10; flex: 1 1 100%; flex-wrap: wrap; gap: 6px; margin: 16px -10px 0; padding: 0; }
html[data-look="stage"] .vview .seg-opt { height: 30px; padding: 0 12px; }
html[data-look="stage"] .fpill { height: 32px; padding: 0 12px; gap: 6px; background: transparent; }
html[data-look="stage"] .fpill-count { font: 500 12px/1 var(--v-font); color: var(--s-muted-3); }
html[data-look="stage"] body[data-route="videos"] .bulk-bar { margin: 4px 0 0; border-radius: 999px; background: var(--dk-paper, #fff); box-shadow: var(--s-shadow); padding: 6px 8px 6px 16px; }
html[data-look="stage"] .bulk-bar .btn { height: 32px; min-height: 0; }
html[data-look="stage"] .bulk-count { font: 500 13px/1 var(--v-font); }

/* The list: a grey shell, white row tiles. */
html[data-look="stage"] .vlist { gap: 6px; padding: 8px; background: var(--s-shell); border-radius: 16px; margin-top: 2px; }
html[data-look="stage"] .vlist-head { padding: 6px 14px 2px; font: 500 12px/1.3 var(--v-font); color: var(--s-ink-2); }
html[data-look="stage"] .vlist-head,
html[data-look="stage"] .vrow { grid-template-columns: 22px 52px minmax(0, 1fr) 170px 84px 88px 140px 28px; gap: 14px; }
html[data-look="stage"] .vrow { padding: 8px 10px 8px 14px; border-radius: 10px; background: var(--dk-paper, #fff); box-shadow: none; }
html[data-look="stage"] .vrow:hover { background: var(--dk-paper, #fff); box-shadow: 0 1px 2px rgba(31, 31, 33, .06), 0 4px 12px rgba(31, 31, 33, .05); }
html[data-look="stage"] .vrow.is-picked { box-shadow: inset 0 0 0 1.5px var(--s-ink); }
html[data-look="stage"] .vrow .vsel { width: 22px; height: 22px; }
html[data-look="stage"] .vrow .vsel input { width: 16px; height: 16px; accent-color: var(--s-ink); }
html[data-look="stage"] .vrow-thumb { border-radius: 6px; background: var(--s-canvas); }
html[data-look="stage"] .vrow-title { font: 500 13.5px/1.35 var(--v-font); color: var(--s-ink); }
html[data-look="stage"] .vrow-from,
html[data-look="stage"] .vrow-when { font: 400 12.5px/1.3 var(--v-font); color: var(--s-ink-2); }
html[data-look="stage"] .vrow-next { font: 500 12.5px/1 var(--v-font); color: var(--s-ink); }
html[data-look="stage"] .vrow .more-btn { width: 28px; height: 28px; border-radius: 50%; color: var(--s-ink-2); }
html[data-look="stage"] .vlist > .estate { background: var(--dk-paper, #fff); border-radius: 12px; padding: 40px 24px; }
@media (max-width: 1180px) {
  html[data-look="stage"] .vlist-head,
  html[data-look="stage"] .vrow { grid-template-columns: 22px 52px minmax(0, 1fr) 170px 88px 28px; }
}
@media (max-width: 720px) {
  html[data-look="stage"] .vrow { grid-template-columns: 22px 52px minmax(0, 1fr) 28px; }
}

/* Grid view keeps its cards, at Stage density. */
html[data-look="stage"] .vgrid { gap: 14px; }
html[data-look="stage"] .vcard { border-radius: 16px; overflow: hidden; }
html[data-look="stage"] .vbody { padding: 12px 14px 14px; }
html[data-look="stage"] .vbody h3 { font: 500 14px/1.35 var(--v-font); }
html[data-look="stage"] .vnote,
html[data-look="stage"] .vstat .when,
html[data-look="stage"] .vstat .proc { font: 400 12px/1.4 var(--v-font); color: var(--s-ink-2); }
html[data-look="stage"] body[data-route="videos"] .filters .fpill { height: 32px; min-height: 0; }

/* ================================================================ *
 * ALL LOOKS — start-mode tabs carry a line and their steps for the Stage cards; the filmstrip's
 * artifact preview is a Stage-only picture.
 * ================================================================ */
html:not([data-look="stage"]) .smode-sub,
html:not([data-look="stage"]) .smode-steps,
html:not([data-look="stage"]) .fstep-art { display: none; }

/* ================================================================ *
 * STAGE — Create video: five start-mode cards (proof 03-create-modes)
 * ================================================================ */
html[data-look="stage"] .start-modes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 2px 0 0; }
html[data-look="stage"] .start-modes .smode {
  display: grid; align-content: start; justify-items: start; gap: 6px; height: auto; min-height: 132px; padding: 16px 16px 14px;
  border-radius: 18px; background: var(--dk-paper, #fff); color: var(--s-ink); text-align: left; white-space: normal;
  box-shadow: 0 1px 2px rgba(31, 31, 33, .04), 0 4px 12px rgba(31, 31, 33, .05);
}
html[data-look="stage"] .start-modes .smode:hover { background: var(--dk-paper, #fff); box-shadow: 0 1px 2px rgba(31, 31, 33, .06), 0 8px 20px rgba(31, 31, 33, .08); }
html[data-look="stage"] .start-modes .smode.is-active { background: var(--dk-paper, #fff); color: var(--s-ink); box-shadow: inset 0 0 0 1.5px var(--s-ink), 0 4px 12px rgba(31, 31, 33, .05); }
html[data-look="stage"] .smode-title { font: 500 14px/1.3 var(--v-font); }
html[data-look="stage"] .smode-sub { font: 400 12.5px/1.45 var(--v-font); color: var(--s-ink-2); }
html[data-look="stage"] .smode-steps { margin-top: auto; padding-top: 8px; width: 100%; border-top: 1px solid var(--s-hair); font: 400 12px/1.4 var(--v-font); color: var(--s-muted-3); }
@media (max-width: 1240px) { html[data-look="stage"] .start-modes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { html[data-look="stage"] .start-modes { grid-template-columns: 1fr; } }

/* ================================================================ *
 * STAGE — the filmstrip stepper: one tile per step, filled with what the step made
 * (proof 05-plan / 13-processing / 16-review header; README "Direction B's own filmstrip stepper")
 * ================================================================ */
html[data-look="stage"] .fsteps,
html[data-look="stage"] .fsteps.fsteps--nav {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; max-width: none; margin: 0; padding: 0;
}
html[data-look="stage"] .fstep { display: block; min-width: 0; font: 500 12px/1.2 var(--v-font); color: var(--s-ink); }
html[data-look="stage"] .fstep + .fstep::before { display: none; }
html[data-look="stage"] .fstep:not(:has(.fstep-link)),
html[data-look="stage"] .fstep-link {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "art art" "n label"; align-items: center; gap: 6px 5px;
  padding: 5px 5px 7px; border-radius: 12px; background: var(--dk-paper, #fff); color: var(--s-ink); text-decoration: none;
  box-shadow: 0 1px 2px rgba(31, 31, 33, .04), 0 4px 12px rgba(31, 31, 33, .05);
}
html[data-look="stage"] a.fstep-link:hover { box-shadow: 0 1px 2px rgba(31, 31, 33, .06), 0 8px 20px rgba(31, 31, 33, .08); }
html[data-look="stage"] .fstep-art {
  grid-area: art; display: grid; place-items: center; height: 40px; padding: 4px 6px; border-radius: 8px; background: var(--s-canvas);
  font: 500 12px/1.25 var(--v-font); color: var(--s-ink-2); text-align: center; overflow: hidden;
}
html[data-look="stage"] .fstep-art.is-empty { background: var(--dk-b-1f1f21a3_5, rgba(31, 31, 33, .035)); }
html[data-look="stage"] .fstep-n { grid-area: n; width: auto; height: auto; min-width: 12px; padding: 0 0 0 3px; border: 0; background: none; box-shadow: none; font: 400 12px/1 var(--v-font); color: var(--s-muted-3); }
html[data-look="stage"] .fstep-n svg { width: 11px; height: 11px; }
html[data-look="stage"] .fstep-label { grid-area: label; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-look="stage"] .fstep.is-done .fstep-n { background: none; color: var(--s-ink); }
html[data-look="stage"] .fstep.is-on:not(:has(.fstep-link)),
html[data-look="stage"] .fstep.is-on .fstep-link { box-shadow: inset 0 0 0 1.5px var(--s-ink), 0 4px 12px rgba(31, 31, 33, .06); }
html[data-look="stage"] .fstep.is-on .fstep-n { background: none; color: var(--s-ink); box-shadow: none; }
html[data-look="stage"] .fstep.is-here .fstep-link { box-shadow: inset 0 0 0 1px rgba(31, 31, 33, .28); }
html[data-look="stage"] .fstep.is-locked .fstep-link,
html[data-look="stage"] .fstep:not(.is-on):not(.is-done):not(:has(.fstep-link)) { background: var(--dk-b-ffffffa55, rgba(255, 255, 255, .55)); box-shadow: none; color: var(--s-muted-3); }
html[data-look="stage"] body[data-route="create"] #stepChips { margin: 6px 0 2px; }
/* The List / Grid switch in the other looks: their segmented control, sized like their filter pills. */
html:not([data-look="stage"]) .vview { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-sm); background: var(--soft); }
html:not([data-look="stage"]) .vview .seg-opt { height: 2.25rem; padding: 0 var(--s3); border-radius: var(--r-xs); font: var(--w-medium) var(--fs-meta)/1 var(--font-sans); color: var(--muted); }
html:not([data-look="stage"]) .vview .seg-opt.is-on { background: var(--card); color: var(--ink-strong); box-shadow: 0 1px 2px rgba(31, 31, 33, .08); }

/* ================================================================ *
 * VIDEOS at phone width (q2-polish): one scrollable filter row, the status under each title
 * ================================================================ */
@media (max-width: 720px) {
  html[data-look="stage"] body[data-route="videos"] .filters .pillbar {
    flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; gap: 6px; margin: 14px -10px 0; padding: 0 10px 2px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  html[data-look="stage"] body[data-route="videos"] .filters .pillbar::-webkit-scrollbar { display: none; }
  html[data-look="stage"] body[data-route="videos"] .filters .pillbar .fpill { flex: none; white-space: nowrap; }
  html[data-look="stage"] .vrow { grid-template-rows: auto auto; row-gap: 4px; align-items: center; }
  html[data-look="stage"] .vrow > .vsel { grid-column: 1; grid-row: 1 / span 2; }
  html[data-look="stage"] .vrow > .vrow-thumb { grid-column: 2; grid-row: 1 / span 2; }
  html[data-look="stage"] .vrow > .vrow-title { grid-column: 3; grid-row: 1; align-self: end; }
  html[data-look="stage"] .vrow > .vrow-status { display: block; grid-column: 3; grid-row: 2; align-self: start; justify-self: start; min-width: 0; }
  html[data-look="stage"] .vrow > .more-btn { grid-column: 4; grid-row: 1 / span 2; justify-self: end; }
}

/* ================================================================ *
 * VIDEO PAGES — step row (q2-polish)
 * The number sits inside the card padding with a gap before the label; the "video is here" dot sits top-right of the
 * thumbnail; on phones the cards are numbers with the current step's name, never a clipped word.
 * ================================================================ */
html[data-look="stage"] .fstep:not(:has(.fstep-link)),
html[data-look="stage"] .fstep-link {
  grid-template-columns: 20px minmax(0, 1fr); column-gap: 8px; row-gap: 6px; padding: 6px 8px 8px; position: relative; min-height: 0;
}
html[data-look="stage"] .fsteps--nav .fstep-link { display: grid; padding: 6px 8px 8px; gap: 6px 8px; }
html[data-look="stage"] .fstep-art { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; line-height: 32px; padding: 0 6px; height: 40px; }
html[data-look="stage"] .fstep-art.is-empty { display: block; }
html[data-look="stage"] .fstep-n,
html[data-look="stage"] .fsteps--nav .fstep .fstep-n {
  position: static; display: grid; place-items: center; width: 20px; height: 20px; min-width: 20px; padding: 0; border-radius: 50%;
  background: none; box-shadow: inset 0 0 0 1px var(--s-line); font: 500 12px/1 var(--v-font); color: var(--s-ink-2);
}
html[data-look="stage"] .fsteps--nav .fstep.is-done:not(.is-on) .fstep-n { background: var(--s-ink); color: var(--dk-oninv, #fff); box-shadow: none; }
html[data-look="stage"] .fsteps--nav .fstep.is-on .fstep-n,
html[data-look="stage"] .fsteps--nav .fstep.is-on:not(.is-done) .fstep-n,
html[data-look="stage"] .fsteps--nav .fstep.is-on.is-done .fstep-n { background: var(--s-ink); color: var(--dk-oninv, #fff); box-shadow: none; }
html[data-look="stage"] .fstep-label { align-self: center; line-height: 1.2; }
/* the amber "the video is here" dot: top-right of the thumbnail, off the number */
html[data-look="stage"] .fsteps--nav .fstep.is-here .fstep-n::after { content: none; }
html[data-look="stage"] .fsteps--nav .fstep.is-here .fstep-link::after {
  content: ""; position: absolute; top: 11px; right: 11px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--st-attn-dot); box-shadow: 0 0 0 2px var(--dk-paper, #fff);
}
@media (max-width: 860px) {
  html[data-look="stage"] .fsteps,
  html[data-look="stage"] .fsteps.fsteps--nav { display: flex; gap: 6px; }
  html[data-look="stage"] .fstep { flex: 1 1 0; min-width: 0; }
  html[data-look="stage"] .fsteps,
  html[data-look="stage"] .fsteps.fsteps--nav { align-items: stretch; }
  html[data-look="stage"] .fstep.is-on { flex: 3 1 0; }
  html[data-look="stage"] .fstep-art,
  html[data-look="stage"] .fstep-art.is-empty { display: none; }
  html[data-look="stage"] .fstep:not(:has(.fstep-link)),
  html[data-look="stage"] .fstep-link { grid-template-areas: "n label"; grid-template-columns: 20px minmax(0, 1fr); height: 100%; padding: 8px; align-items: center; }
  html[data-look="stage"] .fsteps--nav .fstep:not(.is-on) .fstep-link { grid-template-columns: 20px; justify-content: center; }
  html[data-look="stage"] .fsteps--nav .fstep:not(.is-on) .fstep-label { display: none; }
  html[data-look="stage"] .fsteps--nav .fstep.is-here .fstep-link::after { top: 3px; right: 3px; }
}
html[data-look="stage"] nav.vsteps { min-width: 0; max-width: 100%; }
html[data-look="stage"] .fsteps,
html[data-look="stage"] .fsteps.fsteps--nav { min-width: 0; max-width: 100%; }
html[data-look="stage"] .fstep-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
