/* SAI Credits: the video page */
.saic-video { margin: 0 0 28px; }
.saic-video .saic-options__title { display: block; margin: 18px 0 6px; }
.saic-video > .saic-options__title:first-child { margin-top: 0; }

/* Examples: a fold with the clips side by side in frames of one size. */
.saic-video__ex-box { margin: 0; padding: 0; border: 0; }
.saic-video .saic-video__ex-head { display: flex; align-items: center; gap: 8px; width: max-content; max-width: 100%; margin: 0 0 6px; padding: 2px 0; list-style: none; cursor: pointer; }
.saic-video .saic-video__ex-head::-webkit-details-marker { display: none; }
.saic-video .saic-video__ex-head::marker { content: ''; }
.saic-video .saic-video__ex-head::before { content: ''; flex: none; width: 6px; height: 6px; margin: 0 2px 0 1px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; opacity: .6; transform: rotate(-45deg); transition: transform .15s; }
.saic-video .saic-video__ex-box[open] > .saic-video__ex-head::before { transform: rotate(45deg) translate(-2px, -1px); }
.saic-video .saic-video__ex-head .saic-options__title { margin: 0; }
.saic-video__ex-hint { font-size: .85em; line-height: 1.3; opacity: .7; text-decoration: underline; text-underline-offset: 3px; }
.saic-video__ex-head:hover .saic-video__ex-hint, .saic-video__ex-head:focus-visible .saic-video__ex-hint { opacity: 1; }
.saic-video__ex-box[open] .saic-video__ex-hint::before { content: attr(data-open); }
.saic-video__ex-box:not([open]) .saic-video__ex-hint::before { content: attr(data-closed); }
.saic-video__balance { margin: 10px 0 0; font-size: .95em; }
.saic-video__examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; align-items: start; }
.saic-video-ex { margin: 0; padding: 0; border: 1px solid rgba(127, 127, 127, .35); border-radius: 10px; overflow: hidden; }
.saic-video-ex__media { position: relative; aspect-ratio: 16 / 9; background: #111; }
/* A tall clip sits in the same frame as the wide ones, with bars at the sides: the grid stays even. */
.saic-video-ex__media video { display: block; width: 100%; height: 100%; object-fit: contain; background: #111; }
.saic-video-ex figcaption { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px 10px 10px; font-size: .9em; line-height: 1.35; }
.saic-video-ex__title { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.saic-video button.saic-video-ex__use, .saic-video button.saic-video-ex__use:hover, .saic-video button.saic-video-ex__use:focus,
.saic-video button.saic-video-ex__remove, .saic-video button.saic-video-ex__remove:hover, .saic-video button.saic-video-ex__remove:focus { min-height: 0; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; font-size: .9em; line-height: 1.3; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.saic-video button.saic-video-ex__remove { opacity: .6; }

/* By a description / from a photo. */
.saic-video__modes { display: inline-flex; margin: 22px 0 4px; border: 1px solid rgba(127, 127, 127, .45); border-radius: 8px; overflow: hidden; }
.saic-video > .saic-video__modes:first-child { margin-top: 0; }
.saic-video__modes button, .saic-video__modes button:hover, .saic-video__modes button:focus { min-height: 0; padding: 8px 16px; border: 0; border-radius: 0; background: transparent; color: inherit; font-size: .95em; line-height: 1.3; cursor: pointer; }
.saic-video__modes button.is-current, .saic-video__modes button.is-current:hover, .saic-video__modes button.is-current:focus { background: #1f2937; color: #fff; }

.saic-video__photo { margin: 12px 0 0; }
.saic-video__photo[hidden] { display: none; }
.saic-video__drop { position: relative; display: flex; align-items: center; gap: 14px; min-height: 64px; margin: 0; padding: 10px 14px; border: 1px dashed rgba(127, 127, 127, .6); border-radius: 10px; cursor: pointer; }
.saic-video__drop:hover, .saic-video__drop:focus-within { border-color: currentColor; }
.saic-video__drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.saic-video__thumb { flex: none; width: 96px; height: 64px; object-fit: cover; border-radius: 6px; }
.saic-video__thumb[hidden] { display: none; }
.saic-video__drop-text { overflow-wrap: anywhere; }

.saic-video__text { display: block; box-sizing: border-box; width: 100%; min-height: 120px; padding: 12px 14px; border: 1px solid rgba(127, 127, 127, .45); border-radius: 10px; font: inherit; line-height: 1.5; resize: vertical; }
.saic-video__meta { display: flex; justify-content: flex-end; margin: 6px 0 0; font-size: .85em; opacity: .75; }
.saic-video__hint { margin: 6px 0 0; font-size: .88em; opacity: .75; }

/* The shape of the clip. */
.saic-video__aspect { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.saic-video-a { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; align-items: center; min-height: 60px; margin: 0; padding: 10px 12px; border: 1px solid rgba(127, 127, 127, .35); border-radius: 10px; line-height: 1.25; cursor: pointer; transition: border-color .15s, background-color .15s; }
.saic-video-a:hover { border-color: currentColor; }
.saic-video-a input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.saic-video-a.is-current { border-color: #1f2937; box-shadow: inset 0 0 0 1px #1f2937; background: rgba(31, 41, 55, .07); }
.saic-video-a:focus-within { outline: 2px solid currentColor; outline-offset: 2px; }
.saic-video-a__shape { grid-row: 1 / span 2; box-sizing: border-box; border: 2px solid currentColor; border-radius: 3px; opacity: .7; }
.saic-video-a__shape--wide { width: 32px; height: 18px; }
.saic-video-a__shape--tall { width: 18px; height: 32px; margin: 0 7px; }
.saic-video-a .saic-option__name { font-weight: 600; }
.saic-video-a .saic-option__note { grid-column: 2; font-size: .8em; opacity: .7; }
/* The length: three cards in a row, the price under the seconds. */
.saic-video__length { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.saic-video-l { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 60px; margin: 0; padding: 9px 12px; border: 1px solid rgba(127, 127, 127, .35); border-radius: 10px; line-height: 1.25; cursor: pointer; transition: border-color .15s, background-color .15s; }
.saic-video-l:hover { border-color: currentColor; }
.saic-video-l input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.saic-video-l.is-current { border-color: #1f2937; box-shadow: inset 0 0 0 1px #1f2937; background: rgba(31, 41, 55, .07); }
.saic-video-l:focus-within { outline: 2px solid currentColor; outline-offset: 2px; }
.saic-video-l .saic-option__name { font-weight: 600; }
.saic-video-l .saic-option__note { font-size: .8em; opacity: .7; }

.saic-video__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 20px 0 0; }
.saic-video__go { padding: 12px 28px; font-size: 1.05em; }
.saic-video__go[disabled] { opacity: .55; cursor: default; }
.saic-video__price { font-size: .88em; opacity: .7; }
.saic-video__rules { margin: 10px 0 0; font-size: .82em; opacity: .65; }

.saic-video__status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 14px 0 0; padding: 10px 14px; border: 1px solid rgba(127, 127, 127, .35); border-radius: 10px; }
.saic-video__status[hidden], .saic-video__result[hidden], .saic-video__files[hidden] { display: none; }
.saic-video__status--error { border-color: #b32d2e; }
.saic-video__status-text { flex: 1 1 200px; }
.saic-video__status-note { flex: 1 1 100%; font-size: .85em; opacity: .7; }
.saic-video__spin { flex: none; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: saic-video-spin .8s linear infinite; }
@keyframes saic-video-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .saic-video__spin { animation-duration: 3s; } }
.saic-video .saic-video__link, .saic-video button.saic-video__link:hover, .saic-video button.saic-video__link:focus { min-height: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.saic-video button.saic-video__link--strong { font-weight: 600; }

.saic-video__result { margin: 14px 0 0; padding: 14px 16px; border: 1px solid #1f2937; border-radius: 10px; }
.saic-video__done { font-weight: 600; margin: 0 0 10px; }
.saic-video__frame { aspect-ratio: 16 / 9; background: #111; border-radius: 6px; overflow: hidden; }
.saic-video__result--tall .saic-video__frame { aspect-ratio: 9 / 16; max-width: 360px; max-height: 640px; }
.saic-video__player { display: block; width: 100%; height: 100%; object-fit: contain; }
.saic-video__after { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 12px 0 0; }
.saic-video__spent { font-size: .9em; opacity: .75; }

.saic-video__files { margin: 26px 0 0; }
.saic-video-file { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 14px; align-items: start; padding: 12px 0; border-top: 1px solid rgba(127, 127, 127, .25); }
.saic-video-file__media { aspect-ratio: 16 / 9; background: #111; border-radius: 6px; overflow: hidden; }
.saic-video-file--tall .saic-video-file__media { aspect-ratio: 9 / 16; width: 112px; }
.saic-video-file__player { display: block; width: 100%; height: 100%; object-fit: contain; }
.saic-video-file__info { display: flex; flex-direction: column; gap: 3px; min-width: 0; line-height: 1.35; }
.saic-video-file__title { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.saic-video-file__meta { font-size: .8em; opacity: .7; }
.saic-video-file__actions { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 0; font-size: .9em; }
.saic-video button.saic-video-file__delete, .saic-video button.saic-video-file__delete:hover, .saic-video button.saic-video-file__delete:focus,
.saic-video button.saic-video-file__example, .saic-video button.saic-video-file__example:hover, .saic-video button.saic-video-file__example:focus { min-height: 0; padding: 0; border: 0; background: transparent; color: inherit; font-size: 1em; line-height: 1.3; opacity: .65; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.saic-video button.saic-video-file__delete.is-sure { color: #b32d2e; opacity: 1; }
.saic-video__keep { margin: 8px 0 0; font-size: .85em; opacity: .7; }

@media (max-width: 480px) {
	.saic-video__examples { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
	.saic-video-ex figcaption { padding: 6px 8px 8px; font-size: .82em; }
	.saic-video__aspect { grid-template-columns: minmax(0, 1fr); }
	.saic-video-l { padding: 8px 9px; }
	.saic-video__go { width: 100%; text-align: center; }
	.saic-video-file { grid-template-columns: 128px minmax(0, 1fr); gap: 10px; }
	.saic-video-file--tall .saic-video-file__media { width: 80px; }
}
