#image-settings, #video-panel, #video-fields { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (min-width: 769px) {
    .video-mode .settings-panel { scrollbar-gutter: stable both-edges; scrollbar-width: thin; padding-inline: 8px; }
}
#image-settings, #video-panel, #video-fields, .video-price,
.video-mode #btn-generate, .video-mode #img2img-section, .video-mode .mode-tabs, .video-mode #video-notice { flex-shrink: 0; }
#video-panel[hidden], .video-mode #image-settings, .video-mode #image-prompt, .video-mode #image-negative { display: none; }
#video-fields { padding: 0; margin: 0; border: 0; }
#video-fields input[type=checkbox] { width: auto; margin: 0; }
#video-fields .setting-row > * { min-width: 0; flex: 1; }
#video-prompt { min-height: 140px; resize: vertical; }
.video-check { display: flex; gap: 8px; align-items: center; }
.video-hint, .video-price small { font-size: .78rem; color: var(--text-dim); line-height: 1.5; }
.video-hint { margin: -8px 0 0; }
.video-price { display: grid; grid-template-rows: 2.5em 1.5em 3em 1.5em; gap: 3px; align-items: start; height: 160px; box-sizing: border-box; overflow: auto; padding: 12px; border: 1px solid var(--border); border-radius: 8px; font-size: .85rem; }
#video-notice { margin: 0; padding: 10px 0; line-height: 1.5; font-size: .85rem; }
body:not(.video-mode) #video-notice { display: none; }
#video-terms-text { white-space: pre-line; font-size: .8rem; line-height: 1.5; max-height: 260px; overflow: auto; }
.video-confirm { width: min(420px, calc(100vw - 32px)); box-sizing: border-box; border: 1px solid var(--border); border-radius: 12px; padding: 24px; background: var(--bg-card, var(--bg)); color: var(--text); }
.video-confirm::backdrop { background: #0009; }
.video-confirm h2 { font-size: 1.15rem; margin-top: 0; }
.video-confirm p { line-height: 1.6; }
.video-confirm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 20px; }
#hero-video { display: none; max-width: 100%; max-height: 100%; object-fit: contain; }
#hero-video.visible { display: block; }
#hero-footer:not(.visible) { display: none; }
#detail-video { max-width: 100%; max-height: 100%; object-fit: contain; }
#detail-video:not([src]) { display: none; }
.history-thumb video { display: block; width: 100%; height: auto; pointer-events: none; }
.video-badge { position: absolute; top: 6px; left: 6px; background: #000b; color: white; border-radius: 4px; padding: 2px 6px; font-size: .7rem; }
@media (max-width: 768px) {
    #hero-video { max-height: 60vh; }
    .history-thumb video { height: 100%; width: auto; max-width: none; }
}
#video-refs-box { display: grid; gap: 8px; }
#video-refs-box .video-hint { margin: 0; }
#video-refs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
#video-refs-list li { display: grid; grid-template-columns: 56px 1fr auto; gap: 8px; align-items: center; padding: 6px; border: 1px solid var(--border); border-radius: 8px; }
#video-refs-list img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
#video-refs-list div { display: grid; gap: 4px; min-width: 0; font-size: .82rem; }
#video-refs-list button { width: 28px; height: 28px; padding: 0; line-height: 1; }
#video-refs-box[hidden] { display: none; }
.video-sizes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.video-size { min-width: 0; padding: 9px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-input); color: var(--text-dim); text-align: center; cursor: pointer; }
.video-size strong, .video-size small { display: block; }
.video-size strong { font-size: .75rem; font-weight: 600; }
.video-size small { margin-top: 4px; font-size: .68rem; line-height: 1.4; }
.video-size:hover { background: var(--bg-active); color: var(--text); }
.video-size.active { background: var(--primary-light); border-color: var(--primary); color: var(--text); }
.video-size:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
#video-size-hint { margin: 4px 0 0; }
