.top-actions, .generate-actions, .controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.top-actions { flex-shrink: 0; }
.usage-notice { border-left: 3px solid var(--warm); padding: 10px 16px; color: var(--muted); background: var(--surface); margin-bottom: 28px; font-size: 14px; }
.usage-notice strong { color: var(--warm); }
textarea, select, input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; }
textarea { display: block; min-height: 300px; height: 36vh; resize: vertical; }
.field-label { display: block; font-size: 14px; font-weight: 650; margin-bottom: 10px; }
.prompt-validation { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.prompt-validation[data-state="valid"] { color: var(--accent); }
.prompt-validation[data-state="invalid"] { color: var(--warm); }
.prompt-validation ul { margin: 0; padding-left: 20px; }
.controls { margin-block: 20px; gap: 24px; }
.controls label { font-size: 14px; color: var(--muted); }
.controls select { width: auto; min-width: 140px; }
.duration-control, .resolution-control { display: flex; align-items: center; gap: 10px; }
.generate-actions { padding-bottom: 28px; border-bottom: 1px solid var(--line); }
#progress-container { margin-top: 28px; }
.progress-heading { color: var(--warm); font-size: 12px; text-transform: uppercase; margin-bottom: 10px; }
#progress { min-height: 14lh; height: 36vh; max-width: 100%; resize: vertical; overflow-y: auto; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
#progress p { color: var(--muted); line-height: 1.5; margin: 0.4em 0; white-space: pre-wrap; }
#v { margin-top: 28px; max-height: 75vh; }
#d { margin-top: 16px; }
.progress-image, .progress-video { display: block; width: 100%; max-width: 320px; margin-block: 6px 36px; border-radius: 6px; }
.progress-image { cursor: zoom-in; }
.progress-image-expanded { position: fixed; inset: 0; z-index: 1000; width: 100vw; height: 100vh; max-width: none; margin: 0; object-fit: contain; background: rgb(0 0 0 / 90%); cursor: zoom-out; }
dialog { padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); width: min(680px, calc(100% - 40px)); max-height: 80vh; }
dialog::backdrop { background: rgb(0 0 0 / 70%); }
#template-notice { padding: 32px; border-top: 3px solid var(--accent); box-shadow: 0 24px 80px rgb(0 0 0 / 45%); }
#template-notice h2 { font-size: 28px; margin-bottom: 18px; }
#template-notice-message { color: var(--muted); line-height: 1.8; margin: 0; }
.notice-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 28px; }
#hf { margin: 0; }
#hl { list-style: none; padding: 0; margin: 0 0 20px; max-height: 55vh; overflow-y: auto; }
#hl li { display: flex; gap: 8px; margin-bottom: 8px; }
.history-item { min-width: 0; flex: 1; display: block; text-align: left; background: var(--background); color: var(--text); border-color: var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.history-item:hover { background: #2a3036; }
.delete-item { flex-shrink: 0; width: 44px; padding: 8px; background: #9c343d; color: white; font-size: 20px; }
.delete-item:hover { background: #be424c; }
#wake-flash { position: fixed; inset: 0; z-index: 2000; pointer-events: none; background: var(--accent); opacity: 0; }
@media (max-width: 760px) {
    .top-actions { width: 100%; }
    .top-actions button { flex: 1; padding-inline: 12px; }
    textarea { min-height: 260px; }
    .controls { align-items: stretch; flex-direction: column; gap: 14px; }
    .duration-control, .resolution-control { justify-content: space-between; }
}