/* Story videos. Tokens, buttons and fields come from ../app/app.css; this file is the page around them.
   Two views: the library of finished videos with its folders, and the steps of a new story. */
body.story { overflow: auto; height: auto; min-height: 100%; font-size: 14px; }
.story .bar { position: sticky; top: 0; z-index: 10; height: 56px; }

.sv { max-width: 1120px; margin: 0 auto; padding: 32px 24px 64px; }
.sv-make { max-width: 760px; margin: 0 auto; }
.sv-back { margin: 0 0 14px -10px; }
.sv h1, .sv .sv-h1 { margin: 0 0 6px; font-size: 30px; font-weight: 800; font-stretch: 110%; letter-spacing: -0.02em; line-height: 1.1; }
.sv__lead { margin: 0 0 24px; max-width: 58ch; color: var(--dim); font-size: 15px; }
.sv-dim { color: var(--dim); }
.sv-small { font-size: 12px; }

.sv__lock { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 0 0 20px; padding: 16px; border-radius: var(--r); background: var(--p2); box-shadow: inset 0 0 0 1px var(--ln2); }
.sv__lock p { margin: 0; flex: 1 1 260px; }

.sv-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.sv-step { padding: 20px; border-radius: 14px; background: var(--p1); box-shadow: inset 0 0 0 1px var(--ln); }
.sv-step h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 17px; font-weight: 700; }
.sv-step .sv-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--tx); color: var(--aci); font-size: 12px; font-weight: 800; }
.sv-lab { display: block; margin: 14px 0 6px; color: var(--dim); font-size: 12px; font-weight: 600; }
.sv-step > .sv-lab:first-of-type, .sv-step h2 + .sv-lab { margin-top: 0; }
.story textarea { font-size: 14px; }
.sv-row3, .sv-row2 { display: grid; gap: 12px; }
.sv-row3 { grid-template-columns: auto 1fr 1fr; }
.sv-row2 { grid-template-columns: 1fr 1fr; }
.sv-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.sv-note { min-height: 1.4em; margin: 10px 0 0; color: var(--dim); }
.sv-note.err { color: var(--bad); }

/* a row of choices where one is on: segmented (length) and chips (picture style) */
.sv-seg { display: inline-flex; height: 40px; padding: 3px; border-radius: 9px; background: var(--p2); box-shadow: inset 0 0 0 1px var(--ln2); }
.sv-seg button, .sv-chips button { border: 0; background: none; color: var(--dim); font-weight: 600; cursor: pointer; }
.sv-seg button { padding: 0 12px; border-radius: 6px; }
.sv-seg button[aria-checked="true"], .sv-chips button[aria-checked="true"] { background: var(--tx); color: var(--aci); }
.sv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sv-chips button { height: 36px; padding: 0 14px; border-radius: 99px; background: var(--p2); box-shadow: inset 0 0 0 1px var(--ln2); }
.sv-seg button:hover:not([aria-checked="true"]), .sv-chips button:hover:not([aria-checked="true"]) { color: var(--tx); }

.sv-scenes__head { display: flex; justify-content: space-between; align-items: baseline; }
.sv-scenes__head .sv-lab { margin-bottom: 8px; }
.sv-scenes { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; counter-reset: sc; }
.sv-scene { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; padding: 12px; border-radius: 10px; background: var(--p2); }
.sv-scene__n { padding-top: 2px; color: var(--faint); font-weight: 800; font-variant-numeric: tabular-nums; }
.sv-scene .sv-lab { margin: 0 0 4px; }
.sv-scene textarea { min-height: 48px; background: var(--p1); }
.sv-scene textarea + .sv-lab { margin-top: 8px; }
.sv-scene textarea[data-k="picture"] { color: var(--dim); font-size: 13px; }
.sv-scene__b { display: flex; flex-direction: column; gap: 2px; }

@media (max-width: 560px) {
  .story .modes .btn { padding: 0 8px; }
  .story .logo span { display: none; }
  .sv h1, .sv .sv-h1 { font-size: 25px; }
  .sv-step { padding: 16px; }
  .sv-row3, .sv-row2 { grid-template-columns: 1fr; }
  .sv-seg { display: flex; }
  .sv-seg button { flex: 1; }
  .sv-scene { grid-template-columns: minmax(0, 1fr) auto; }
  .sv-scene__n { display: none; }
}

/* the topic label with "Give me an idea" beside it, and the kinds of story above it */
.sv-labrow { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 16px 0 6px; }
.sv-labrow .sv-lab { margin: 0; }
.sv-labrow .btn { flex: none; }
#kinds { margin-bottom: 4px; }

/* the library: folders on one line, then the videos as 9:16 cards */
.sv-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 20px; }
.sv-top .sv__lead { margin-bottom: 0; }
.sv-folders { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0; border-block: 1px solid var(--ln); }
.sv-folders__list { display: flex; flex-wrap: wrap; gap: 6px; }
.sv-folder { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 0; border-radius: 99px; background: var(--p2); box-shadow: inset 0 0 0 1px var(--ln2); color: var(--dim); font-weight: 600; cursor: pointer; transition: background-color .15s, color .15s, box-shadow .15s; }
.sv-folder:hover { color: var(--tx); }
.sv-folder[aria-pressed="true"] { background: var(--tx); color: var(--aci); box-shadow: none; }
.sv-folder__n { color: inherit; opacity: .6; font-size: 12px; font-variant-numeric: tabular-nums; }
.sv-dragging .sv-folder { box-shadow: inset 0 0 0 1px var(--dim); }
.sv-dragging .sv-folder.is-drop { background: var(--tx); color: var(--aci); box-shadow: 0 0 0 3px var(--acs); }
.sv-folders__form { display: flex; gap: 6px; align-items: center; }
.sv-folders__form input { width: 200px; height: 30px; font-size: 13px; }
.sv-folders__tools { display: flex; gap: 4px; }
.sv-folders .grow { flex: 1; }
#libnote:empty { display: none; }
.sv-lib { list-style: none; margin: 20px 0 24px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 20px 16px; }
.sv-card { min-width: 0; }
.sv-card.is-drag { opacity: .4; }
.sv-card__open { display: grid; gap: 6px; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.sv-card__cover { position: relative; display: grid; align-content: end; aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden; background: var(--p2) center / cover no-repeat; box-shadow: inset 0 0 0 1px var(--ln); transition: transform .2s var(--ease), box-shadow .2s; }
.sv-card__open:hover .sv-card__cover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--ln2); }
.sv-card__cover .sv-bar2 { margin: 0 14px 40px; }
.sv-card__len { position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 6px; background: rgb(0 0 0 / .7); color: var(--tx); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sv-card__title { overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.sv-card__st { margin-top: -4px; color: var(--dim); font-size: 12px; }
.sv-card.is-failed .sv-card__st { color: var(--bad); }
.sv-card.is-gone .sv-card__cover { opacity: .5; }
.sv-libempty { margin: 20px 0 24px; padding: 48px 20px; border-radius: 14px; background: var(--p1); box-shadow: inset 0 0 0 1px var(--ln); color: var(--dim); text-align: center; }
.sv-libempty p { margin: 0; }
.sv-bar2 { height: 4px; border-radius: 2px; background: var(--p4); overflow: hidden; }
.sv-bar2 i { display: block; height: 100%; width: calc(var(--f, 0) * 100%); background: var(--tx); transition: width .4s var(--ease); }

/* one video: the player beside its details */
dialog.sv-view { width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 24px; padding: 20px; background: var(--p1); }
dialog.sv-view:not([open]) { display: none; }
.sv-view__vid { position: relative; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: var(--p2); }
.sv-view__vid video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.sv-view__busy { position: absolute; inset: 0; display: grid; align-content: center; gap: 12px; padding: 28px; text-align: center; }
.sv-view__side { display: flex; flex-direction: column; min-width: 0; }
.sv-view__head { display: flex; align-items: center; justify-content: space-between; margin: -4px -6px 0 0; }
.sv-view__head .sv-lab { margin: 0; }
.sv-view__acts { display: grid; gap: 8px; margin-top: auto; padding-top: 18px; }

@media (max-width: 640px) {
  .sv { padding: 24px 16px 48px; }
  .sv-top .btn { width: 100%; }
  .sv-lib { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  dialog.sv-view[open] { display: block; padding: 16px; }
  .sv-view__side { margin-top: 16px; }
  .sv-view__vid { width: min(260px, 100%); margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .sv-bar2 i, .sv-card__cover { transition: none; }
  .sv-card__open:hover .sv-card__cover { transform: none; }
}
