/* Video generator (/app). Values from Sume's videos-module + studio-setting-menu
   (page[data-studio-create] variant), settings-tokens dark studio scope. */
body { overflow: hidden; }
.page { flex: 1; min-height: 0; display: flex; flex-direction: row; align-items: flex-start; gap: 8px; padding: 0 16px 8px;
  overflow: hidden auto; overscroll-behavior: contain; scrollbar-width: thin; }

/* left panel: 320px */
.left { --pad-x: 9px; width: 320px; flex: none; padding: 0 var(--pad-x); background: var(--bg); border: 1px solid var(--line-2); border-radius: 20px;
  display: flex; flex-direction: column; gap: 8px; }
.sections { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 12px 8px 0; }
.section-tab { position: relative; height: 36px; display: inline-flex; align-items: center; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.section-tab:hover:not(:disabled) { color: var(--ink); }
.section-tab:disabled { cursor: default; }
.section-tab.active { color: var(--accent); }
.section-tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 999px; background: var(--accent); }

.create-hero { position: relative; min-height: 112px; padding: 16px; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 60%), var(--s-wash); }
.ch-title { margin: 0; padding-right: 88px; display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: 20px; font-weight: 400; line-height: 28px; white-space: nowrap; }
.ch-mark { width: 18px; height: 18px; flex: none; display: inline-flex; }
.ch-mark svg { width: 18px; height: 18px; }
.ch-sub { margin: 0; color: var(--ink-2); font-size: 12px; line-height: 16px; }
.ch-change { position: absolute; top: 10px; right: 10px; height: 28px; padding: 0 10px; border-radius: 9999px; background: var(--s-wash-2); display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; transition: background-color .2s var(--ease); }
.ch-change:hover, .ch-change.is-on { background: color-mix(in srgb, #fff 16%, transparent); }
.ch-change svg { width: 12px; height: 12px; }

.ref-tray { position: relative; height: 120px; width: 100%; padding: 8px; border: 1px dashed var(--line-2); border-radius: 16px; background: var(--wash); display: flex; flex-direction: column; justify-content: center; align-items: center; }
.ref-empty { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--ink-2); }
.re-icon { width: 32px; height: 32px; border-radius: 999px; background: color-mix(in srgb, #fff 8%, transparent); display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
.re-title { color: var(--ink); font-size: .88rem; font-weight: 500; line-height: 1.2; }
.re-hint { color: var(--ink-3); font-size: .88rem; line-height: 1; margin-top: -4px; }
.refs { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; width: 100%; height: 100%; overflow: auto; }
.ref { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: #000; }
.ref img, .ref video { width: 100%; height: 100%; object-fit: cover; }
.ref .tag { position: absolute; left: 3px; bottom: 3px; font-size: 10px; line-height: 14px; background: #000000b3; padding: 0 4px; border-radius: 4px; }
.ref .x { position: absolute; right: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #000000b3; font-size: 11px; line-height: 18px; }
.ref.audio { display: grid; place-items: center; font-size: 11px; color: var(--ink-2); padding: 4px; text-align: center; background: var(--s-wash); }
.ref.add { display: grid; place-items: center; color: var(--ink-2); font-size: 22px; border: 1px dashed var(--line-2); background: transparent; }

.prompt-block { min-height: 160px; padding: 12px 12px 10px; border-radius: 12px; background: var(--wash); display: flex; flex-direction: column; gap: 6px; }
.prompt-label { color: var(--ink-2); font-size: 12px; line-height: 16px; }
.prompt-input { flex: auto; min-height: 72px; width: 100%; resize: none; padding: 0; border: 0; outline: 0; background: none; color: var(--ink); font: 14px/20px var(--sans); }
.prompt-input::placeholder { color: var(--ink-3); }
/* video prompts run longer (shots, camera moves, @refs): a taller box there that also grows with the text, up to a cap
   (owner 2026-11-27); kept short enough that Generate still shows on a 900px-tall laptop. Safari: fixed size, scrolls inside. */
body[data-kind="video"] .prompt-block { min-height: 216px; }
body[data-kind="video"] .prompt-input { min-height: 128px; max-height: 420px; field-sizing: content; }
.prompt-chips { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.prompt-chip { height: 26px; padding: 0 8px; border-radius: 9999px; background: var(--s-wash-2); display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; }
.prompt-chip svg { width: 12px; height: 12px; }

/* setting tiles (toolbar-dd-trigger[data-studio-setting-card]) */
.controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { min-width: 0; min-height: 48px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 16px; background: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; transition: background-color .2s var(--ease); }
.tile.wide { width: 100%; }
.tile:hover { background: var(--s-wash); }
.tile.is-on { background: var(--s-wash-2); }
.t-body { flex: auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.t-cap { color: var(--ink-2); font-size: 12px; line-height: 16px; white-space: nowrap; }
.t-val { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; line-height: 20px; white-space: nowrap; min-width: 0; }
.t-val svg { width: 14px; height: 14px; }
.t-mark { color: var(--accent); display: inline-flex; }
.t-mark svg { width: 16px; height: 16px; }
.t-chev { width: 16px; height: 16px; color: var(--ink-2); transition: transform .18s; }
.tile.is-on .t-chev { transform: translate(2px); }

.submit-bar { position: static; margin: 0 calc(-1 * var(--pad-x)); padding: 0 12px 12px; display: flex; }
.submit { width: 100%; height: 48px; border-radius: 9999px; background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 18px; font-size: 16px; line-height: 24px; }
.submit:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.submit:disabled { background: var(--s-wash-2); color: var(--ink-3); cursor: not-allowed; }
.submit-credit { font-size: 14px; line-height: 20px; color: color-mix(in srgb, var(--on-accent) 85%, transparent); }

/* right panel */
.right { flex: none; flex: auto; align-self: stretch; min-width: 0; height: 100%; min-height: 480px; border: 1px solid var(--line-2); border-radius: 20px; display: flex; flex-direction: column; overflow: hidden; }
.right-head { min-height: 56px; padding: 8px 16px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; flex: none; }
.right-tabs { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line-2); border-radius: 9999px; }
.right-tab { height: 32px; padding: 0 12px; border-radius: 9999px; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 14px; line-height: 20px; white-space: nowrap; transition: background-color .2s cubic-bezier(0, 0, .2, 1), color .2s cubic-bezier(0, 0, .2, 1); }
.right-tab:hover { color: var(--ink); }
.right-tab[aria-selected=true] { background: var(--s-wash-2); color: var(--accent); }
.head-tools { display: inline-flex; align-items: center; gap: 8px; }
.filters { display: flex; gap: 4px; }
.fchip { height: 28px; padding: 0 10px; border-radius: 9999px; display: inline-flex; align-items: center; color: var(--ink-2); font-size: 13px; cursor: pointer; }
.fchip:hover { color: var(--ink); }
.fchip.on { background: var(--s-wash-2); color: var(--ink); }
.right-body { flex: auto; min-height: 0; display: flex; flex-direction: column; }
.pane { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px 16px; }
.hero { flex: auto; min-height: 0; overflow-y: auto; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.hero-title { margin: 0; font-size: 24px; font-weight: 400; line-height: 29px; }
.hero-sub { margin: 0 0 24px; color: var(--ink-2); font-size: 14px; line-height: 20px; }
.hero-steps { width: 100%; max-width: 960px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; text-align: start; }
.hero-step { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hero-media { position: relative; aspect-ratio: 4/3; margin-bottom: 8px; border: 1px solid var(--line-2); border-radius: 16px; overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-tag { position: absolute; left: 10px; top: 10px; padding: 3px 8px; border-radius: 999px; background: #000a; color: #fff; font-size: 11px; line-height: 16px; }
.hero-chips { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; flex-wrap: wrap; gap: 4px; }
.hero-chips span { padding: 3px 8px; border-radius: 8px; background: #000b; color: #fff; font-size: 11px; line-height: 16px; backdrop-filter: blur(6px); }
.hero-chips span:last-child { background: var(--accent); color: var(--on-accent, #000); }
/* How it works loops (app.js), 5 s each, our take on Sume's screen recordings. The resting styles are the end state,
   so with reduced motion each panel just shows the result (photo in the box, Seedance 2.5 picked). */
.how { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(80% 70% at 50% 45%, #ffffff0d, transparent), #0b0c0f; }
.how img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 7px; user-select: none; }
.how-check { position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; box-shadow: 0 2px 6px #0008; }
.how-check svg { width: 12px; height: 12px; fill: none; stroke: var(--on-accent, #000); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.how-cursor { position: absolute; width: 18px; height: 18px; fill: #fff; stroke: #000; stroke-width: 1.2; stroke-linejoin: round; filter: drop-shadow(0 1px 2px #000a); opacity: 0; z-index: 3; }
/* 1: a photo is dragged in from the corner and dropped into the frame box */
.how-drop { position: absolute; left: 20%; top: 18%; width: 60%; height: 64%; border: 1.5px dashed #ffffff38; border-radius: 10px; display: grid; place-items: center; }
.how-drop svg { width: 26px; height: 26px; fill: none; stroke: #ffffff70; stroke-width: 1.6; opacity: 0; animation: how-icon 5s infinite; }
.how-photo { position: absolute; left: 20%; top: 18%; width: 60%; height: 64%; border: 2px solid var(--accent); border-radius: 10px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), 0 10px 30px #0009; animation: how-drag 5s cubic-bezier(.4, 0, .2, 1) infinite; }
.how-upload .how-check { animation: how-pop 5s infinite; }
.how-upload .how-cursor { left: 54%; top: 54%; animation: how-cursor-drag 5s cubic-bezier(.4, 0, .2, 1) infinite; }
@keyframes how-icon { 0%, 40% { opacity: 1; } 46%, 92% { opacity: 0; } 100% { opacity: 1; } }
@keyframes how-drag {
  0% { opacity: 0; transform: translate(62%, 62%) scale(.42); border-color: transparent; box-shadow: 0 10px 30px #0009; }
  8% { opacity: 1; transform: translate(62%, 62%) scale(.42); border-color: transparent; box-shadow: 0 10px 30px #0009; }
  38% { transform: translate(0, 0) scale(.5); border-color: transparent; box-shadow: 0 10px 30px #0009; }
  46%, 88% { opacity: 1; transform: none; }
  96%, 100% { opacity: 0; transform: none; }
}
@keyframes how-pop { 0%, 46% { transform: scale(0); } 52% { transform: scale(1.2); } 56%, 88% { transform: scale(1); } 96%, 100% { transform: scale(0); } }
@keyframes how-cursor-drag {
  0% { left: 84%; top: 88%; opacity: 0; } 8% { left: 84%; top: 88%; opacity: 1; } 38% { left: 52%; top: 52%; }
  46% { left: 54%; top: 54%; opacity: 1; } 64% { left: 72%; top: 80%; opacity: 0; } 100% { opacity: 0; }
}
/* 2: a row of model cards slides in, the pointer picks Seedance 2.5 Flash, then the prompt types itself */
.how-track { position: absolute; left: 0; right: 0; top: 50%; display: flex; justify-content: center; gap: 4%; transform: translate(0, -50%); animation: how-slide 5s cubic-bezier(.4, 0, .2, 1) infinite; }
.how-card { position: relative; flex: none; width: 30%; aspect-ratio: 4 / 5; border: 2px solid transparent; border-radius: 9px; opacity: .5; }
.how-card span { position: absolute; left: 6px; right: 6px; bottom: 5px; color: #fff; font-size: 10px; line-height: 13px; font-weight: 500; text-shadow: 0 1px 3px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.how-card.how-pick { opacity: 1; border-color: var(--accent); transform: scale(1.06); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); animation: how-pick 5s infinite; }
.how-models .how-check { animation: how-pop-late 5s infinite; }
.how-models .how-track { top: 40%; }
.how-models .how-card { width: 26%; }
.how-models .how-card span { white-space: normal; font-size: 9.5px; line-height: 12px; }
.how-models .how-cursor { left: 50%; top: 46%; animation: how-cursor-pick 5s cubic-bezier(.4, 0, .2, 1) infinite; }
@keyframes how-slide { 0% { transform: translate(24%, -50%); opacity: 0; } 10% { opacity: 1; } 30%, 90% { transform: translate(0, -50%); opacity: 1; } 100% { transform: translate(0, -50%); opacity: 0; } }
@keyframes how-pick {
  0%, 44% { opacity: .5; border-color: transparent; transform: none; box-shadow: none; }
  50% { opacity: 1; border-color: transparent; transform: scale(.95); box-shadow: none; }
  58%, 90% { opacity: 1; border-color: var(--accent); transform: scale(1.06); }
  100% { opacity: .5; border-color: transparent; transform: none; box-shadow: none; }
}
.how-prompt { position: absolute; left: 8%; right: 8%; bottom: 7%; padding: 6px 9px; border: 1px solid #ffffff2e; border-radius: 8px; background: #ffffff10;
  color: #fff; font-size: 10px; line-height: 14px; white-space: nowrap; overflow: hidden; text-overflow: clip; animation: how-prompt-box 5s infinite; }
.how-prompt span { display: inline-block; animation: how-type 5s steps(50, end) infinite; }
@keyframes how-prompt-box { 0%, 52% { border-color: #ffffff2e; } 58%, 92% { border-color: color-mix(in srgb, var(--accent) 70%, transparent); } 100% { border-color: #ffffff2e; } }
@keyframes how-type { 0%, 58% { clip-path: inset(0 100% 0 0); } 90% { clip-path: inset(0 0 0 0); opacity: 1; } 100% { clip-path: inset(0 0 0 0); opacity: 0; } }
@keyframes how-pop-late { 0%, 52% { transform: scale(0); } 58% { transform: scale(1.2); } 62%, 90% { transform: scale(1); } 100% { transform: scale(0); } }
@keyframes how-cursor-pick {
  0%, 18% { left: 74%; top: 94%; opacity: 0; } 26% { opacity: 1; } 44% { left: 50%; top: 46%; } 50% { left: 50%; top: 46%; transform: scale(.85); }
  56% { transform: none; opacity: 1; } 72% { left: 60%; top: 76%; opacity: 0; } 100% { opacity: 0; }
}
/* 3 (image page): the finished picture sharpens out of a blur while "Generating" shows, holds, then fades */
.how-result img { border-radius: 0; animation: how-reveal 5s cubic-bezier(.4, 0, .2, 1) infinite; }
.how-gen { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px; background: #000a; color: #fff; font-size: 11px; line-height: 14px; opacity: 0; animation: how-gen 5s infinite; }
.how-gen .spin { width: 12px; height: 12px; border-width: 2px; margin: 0; }
@keyframes how-reveal { 0%, 8% { filter: blur(18px) brightness(.45); transform: scale(1.08); } 46% { filter: blur(0) brightness(1); transform: none; }
  90% { filter: none; transform: none; opacity: 1; } 100% { opacity: 0; } }
@keyframes how-gen { 0%, 4% { opacity: 0; } 10%, 34% { opacity: 1; } 44%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .how *, .how-track { animation: none !important; } }
.hero-step h3 { margin: 0; font-size: 16px; font-weight: 400; line-height: 24px; }
.hero-step p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 20px; }

/* history cards */
.jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.empty { grid-column: 1 / -1; color: var(--ink-2); margin: 12px 0; }
.job { background: var(--wash); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.job .media { background: #000; aspect-ratio: 9/16; display: grid; place-items: center; }
.job .media.w { aspect-ratio: 16/9; } .job .media.s { aspect-ratio: 1/1; }
.job video { width: 100%; height: 100%; object-fit: contain; }
.job .meta { padding: 10px; font-size: 12px; line-height: 16px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }
.job .meta p { margin: 0; color: var(--ink); font-size: 13px; line-height: 18px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.job .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.job .acts button, .job .acts a { font-size: 12px; height: 26px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 9999px; background: var(--s-wash-2); }
.badge { display: inline-flex; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--s-wash); }
.badge.fast { color: var(--accent); }

/* View menu (List / Grid), like Sume's */
.view-wrap { position: relative; }
.view-btn { height: 32px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 9999px; font-size: 13px; color: var(--ink-2); }
.view-btn:hover { color: var(--ink); background: var(--hover); }
.view-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 160px; padding: 6px; border-radius: 12px; background: var(--elev); box-shadow: var(--dd-edge, 0 8px 24px #0008); display: flex; flex-direction: column; }
.view-menu[hidden] { display: none; }
.view-cap { padding: 4px 8px; font-size: 11px; color: var(--ink-3); }
.view-menu button { height: 32px; padding: 0 8px; display: flex; align-items: center; gap: 8px; border-radius: 8px; font-size: 13px; text-align: start; }
.view-menu button:hover { background: var(--hover); }
.view-menu .tick { margin-left: auto; color: var(--accent); visibility: hidden; }
.view-menu [aria-checked="true"] .tick { visibility: visible; }

/* List view: Sume's History row. The clip large in the middle, details on the right */
.jobs.list { display: flex; flex-direction: column; gap: 24px; }
.more-jobs { grid-column: 1 / -1; display: flex; justify-content: center; padding: 8px 0 24px; }
.more-jobs.busy button { opacity: .5; pointer-events: none; }
.job.row { flex-direction: row; gap: 16px; background: none; border: 0; border-radius: 0; overflow: visible; min-height: 0; }
.job.row .stage { flex: 1; min-width: 0; display: flex; justify-content: center; align-items: flex-start; }
.job.row .media { height: min(72vh, 680px); max-width: 100%; border-radius: 12px; overflow: hidden; }
.job.row .media.w { height: auto; width: min(100%, 960px); max-height: 72vh; }
.job.row .media.s { height: min(72vh, 600px); }
.job.row .media.fail { height: auto; min-height: 140px; width: min(100%, 420px); aspect-ratio: auto; background: var(--wash); border: 1px solid var(--line); }
.job.row .wait { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; text-align: center; color: var(--ink-2); font-size: 13px; }
.job.row .info { width: 272px; flex: none; align-self: stretch; padding: 14px; border-radius: 16px; background: var(--elev); display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--ink-2); }
.info-top { display: flex; gap: 6px; flex-wrap: wrap; }
.badge.model { gap: 6px; align-items: center; color: var(--ink); background: none; border: 1px solid var(--line-2); padding: 3px 8px; border-radius: 8px; }
.badge.model svg { width: 12px; height: 12px; }
.info-prompt { margin: 0; line-height: 20px; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.info.open .info-prompt { display: block; max-height: 40vh; overflow-y: auto; }
.see-all { align-self: flex-start; font-size: 12px; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.row-refs { display: flex; flex-wrap: wrap; gap: 6px; }
.rr { width: 48px; height: 48px; border-radius: 8px; overflow: hidden; background: var(--s-wash); display: grid; place-items: center; }
.rr img, .rr video { width: 100%; height: 100%; object-fit: cover; }
.rr.aud { display: flex; flex-direction: column; gap: 2px; color: var(--ink-2); }
.rr.aud em { font-style: normal; font-size: 10px; }
.rr.gone { background: repeating-linear-gradient(45deg, var(--s-wash), var(--s-wash) 4px, transparent 4px, transparent 8px); }
.info-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink); font-size: 12px; }
.info-stats span { display: inline-flex; align-items: center; gap: 5px; }
.info-stats svg { width: 13px; height: 13px; color: var(--ink-2); }
.info-foot { margin-top: auto; padding-top: 8px; min-height: 32px; position: relative; display: flex; align-items: center; }
.info-foot .when { font-size: 12px; color: var(--ink-3); }
.info-foot .tools { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; background: var(--elev); opacity: 0; pointer-events: none; transition: opacity .15s; }
.job.row:hover .tools, .job.row:focus-within .tools { opacity: 1; pointer-events: auto; }
.tools .redo { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.tools .redo:hover, .tools .ib:hover { color: var(--ink); }
.tools .ibs { display: inline-flex; gap: 4px; }
.tools .ib { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--ink-2); }
.tools .ib:hover { background: var(--hover); }
@media (hover: none) { .info-foot .tools { position: static; opacity: 1; pointer-events: auto; background: none; } .info-foot .when { display: none; } }
@media (max-width: 900px) {
  .job.row { flex-direction: column; }
  .job.row .media { height: auto; width: 100%; max-height: 70vh; }
  .job.row .info { width: auto; }
}
.spin { width: 22px; height: 22px; border: 2px solid #444; border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Running job: a dot field with a brighter patch of dots drifting across it, a soft accent glow from the top, a status pill (after Sume's generating card). */
.job .media:has(.wait.gen) { position: relative; background: #16171a; }
.wait.gen { position: absolute; inset: 0; padding: 0; display: block; overflow: hidden;
  background: radial-gradient(130% 55% at 50% -12%, rgba(198, 242, 78, .16), transparent 62%),
    radial-gradient(circle, rgba(255, 255, 255, .09) 1px, transparent 1.5px) 0 0 / 14px 14px, #16171a; }
.wait.gen::after { content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, .9) 1.1px, transparent 1.7px) 0 0 / 14px 14px;
  -webkit-mask: radial-gradient(closest-side, #000 15%, transparent) 25% 65% / 58% 46% no-repeat;
  mask: radial-gradient(closest-side, #000 15%, transparent) 25% 65% / 58% 46% no-repeat;
  animation: gen-drift 7s ease-in-out infinite alternate, gen-breathe 2.4s ease-in-out infinite; }
@keyframes gen-drift {
  0% { -webkit-mask-position: 22% 68%; mask-position: 22% 68%; }
  50% { -webkit-mask-position: 78% 58%; mask-position: 78% 58%; }
  100% { -webkit-mask-position: 50% 32%; mask-position: 50% 32%; } }
@keyframes gen-breathe { 50% { opacity: .55; } }
.gen-pill { position: absolute; top: 12px; left: 12px; z-index: 1; display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 7px; border-radius: 999px; background: rgba(0, 0, 0, .5); color: #f2efe9; font-size: 12px; font-weight: 500; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.gen-pill .spin { width: 12px; height: 12px; border-width: 2px; }
@media (prefers-reduced-motion: reduce) { .wait.gen::after { animation: none; } }

/* account popover under the avatar */
.acct { position: relative; }
.acct-pop { right: 0; left: auto !important; top: 40px !important; position: absolute; }
.acct-pop.show { display: flex; }

/* media library */
.lib-float { position: fixed; left: 404px; top: 60px; width: min(640px, calc(100vw - 420px)); max-height: 480px; z-index: 950; padding: 6px; border-radius: 16px; background: var(--dd-surface); box-shadow: var(--dd-edge); display: flex; flex-direction: column; }
.lib-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 8px 4px; }
.lib-filter { display: flex; gap: 4px; }
.lib-filter button { height: 30px; padding: 0 12px; border-radius: 9999px; color: var(--dd-muted); }
.lib-filter button.on { background: var(--dd-wash); color: var(--dd-ink); }
.lib-x { width: 30px; height: 30px; border-radius: 8px; color: var(--dd-muted); font-size: 20px; }
.lib-x:hover { background: var(--dd-wash); color: var(--dd-ink); }
.lib-body { overflow-y: auto; padding: 4px; }
.lib { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.lib .item { aspect-ratio: 1; border-radius: 10px; background: var(--dd-wash); overflow: hidden; display: grid; place-items: center; text-align: center; color: var(--dd-muted); font-size: 12px; cursor: pointer; border: 1px solid transparent; }
.lib .item:hover { border-color: var(--accent); }
.lib .item img, .lib .item video { width: 100%; height: 100%; object-fit: cover; }
.lib .item.blank { cursor: default; background: color-mix(in srgb, var(--dd-wash) 50%, transparent); } .lib .item.blank:hover { border-color: transparent; }
.lib .up svg { width: 18px; height: 18px; margin-bottom: 6px; }

@media (max-width: 760px) {
  body { overflow: auto; }
  .content { position: static; padding-top: 52px; overflow: visible; }
  .topnav { position: fixed; }
  .page { flex-direction: column; align-items: stretch; padding: 8px 12px 16px; overflow: visible; }
  .left { width: 100%; }
  .prompt-input { font-size: 16px; }
  .right { height: auto; min-height: 60vh; scroll-margin-top: 60px; }
  .lib-float { left: 12px; right: 12px; width: auto; top: 60px; }
  .lib { grid-template-columns: repeat(3, 1fr); }
}

/* Edit Video tab (Sume's editing tools): tool list, then the Upscale panel. The wrappers keep the form's own gaps. */
.create-pane:not([hidden]), .edit-pane:not([hidden]), .edit-pane > div:not([hidden]) { display: contents; }
.ch-kicker { position: absolute; top: 12px; left: 16px; color: var(--ink-2); font-size: 11px; line-height: 16px; }
.tool-list { display: flex; flex-direction: column; }
.tool-row { width: 100%; min-height: 50px; padding: 8px 10px; border-radius: 12px; display: flex; align-items: center; gap: 12px; text-align: left; transition: background-color .2s var(--ease); }
.tool-row + .tool-row { border-top: 1px solid var(--line); border-radius: 0; }
.tool-row:hover:not(:disabled) { background: var(--s-wash); border-radius: 12px; }
.tool-row > svg:first-child { width: 18px; height: 18px; flex: none; color: var(--ink-2); }
.tool-row:disabled { cursor: default; opacity: .55; }
.tr-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tr-title { color: var(--ink); font-size: 13px; font-weight: 500; line-height: 18px; }
.tr-sub { color: var(--ink-2); font-size: 11px; line-height: 15px; }
.tr-soon { flex: none; padding: 2px 7px; border-radius: 999px; background: var(--s-wash-2); color: var(--ink-2); font-size: 10px; line-height: 14px; }
.up-chosen { width: 100%; height: 100%; display: flex; align-items: center; gap: 10px; }
.up-chosen video { height: 100%; aspect-ratio: 16/10; max-width: 46%; border-radius: 10px; background: #000; object-fit: cover; }
.up-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12px; line-height: 16px; }
.up-meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-clear { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 999px; background: var(--s-wash-2); color: var(--ink-2); font-size: 16px; line-height: 1; }
.up-clear:hover { color: var(--ink); }
.up-libBtn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 8px; padding: 9px 12px; border: 1px dashed var(--line); border-radius: 12px; color: var(--ink-2); font-size: 12.5px; }
.up-libBtn:hover { border-color: var(--accent); color: var(--ink); }
.up-libBtn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.up-lib .item { position: relative; }
.up-lib .item .rdur { position: absolute; right: 5px; bottom: 5px; padding: 1px 5px; border-radius: 6px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 10.5px; line-height: 15px; }
.up-libEmpty { padding: 24px 8px; text-align: center; }
.submit:disabled { opacity: .45; cursor: default; }

/* Sume's reference strip: pictures in a row with +, audio as pills (play + length) underneath; red = breaks a limit */
.ref-tray.filled { height: auto; min-height: 120px; }
.refs { flex-direction: column; align-items: center; justify-content: center; gap: 8px; overflow: visible; }
.ref-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ref { width: 48px; height: 48px; border: 1px solid var(--line-2); }
.ref .tag { opacity: 0; transition: opacity .15s; }
.ref:hover .tag { opacity: 1; }
.ref .x { opacity: 0; transition: opacity .15s; }
.ref:hover .x { opacity: 1; }
.ref .rdur { position: absolute; right: 3px; bottom: 3px; font-size: 9px; line-height: 12px; background: #000000b3; padding: 0 3px; border-radius: 3px; }
.ref.bad { border-color: #ff5a5f; box-shadow: 0 0 0 1px #ff5a5f; }
.ref.add { width: 48px; height: 48px; }
.ref.audio-pill { width: 116px; height: 44px; padding: 6px 8px; display: flex; flex-direction: column; justify-content: space-between; background: var(--s-wash); border-radius: 12px; color: var(--ink-2); overflow: visible; }
.audio-pill .wave { height: 12px; }
.audio-pill .play { position: absolute; left: 6px; bottom: 5px; width: 16px; height: 16px; border-radius: 50%; background: var(--s-wash-2); display: grid; place-items: center; }
.audio-pill .play svg { width: 8px; height: 8px; fill: currentColor; stroke: none; }
.audio-pill .rdur { right: 8px; bottom: 5px; background: none; color: var(--ink-2); font-size: 10px; }
.audio-pill .tag { left: auto; right: 4px; top: -8px; bottom: auto; }
/* library: picked items outlined with a check; audio cards show name, waveform, length */
.lib .item { position: relative; }
.lib .item.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.lib .item .pick { position: absolute; top: 5px; right: 5px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; }
.lib .item .pick svg { width: 11px; height: 11px; stroke: #fff; stroke-width: 3; fill: none; }
.lib .item.aud { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 8px; text-align: left; color: var(--dd-ink); }
.lib .item .aud-name { width: 100%; font-size: 11px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib .item .rdur { position: absolute; right: 5px; bottom: 5px; font-size: 10px; background: #000000b3; color: #fff; padding: 0 4px; border-radius: 4px; }

/* Failed job's ID: small, quiet, click to copy */
.job-ref { display: block; margin: 8px auto 0; padding: 2px 8px; border: 1px solid var(--line-2); border-radius: 6px;
  background: transparent; color: var(--ink-2); font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; cursor: pointer; }
.job-ref:hover { color: var(--ink); }

/* "Your video is ready": floats over History, never moves the list */
.ready-bar { position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 1050; display: flex; align-items: center; gap: 10px;
  max-width: calc(100% - 32px); padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--dd-surface, #26262c); box-shadow: var(--dd-edge, 0 6px 20px #0008); color: var(--dd-ink, #fff); font-size: 14px; }
.ready-bar button { border: 0; border-radius: 8px; font: inherit; cursor: pointer; }
.ready-show { background: var(--accent, #d4ff5a); color: #111; padding: 5px 12px; font-weight: 600; }
.ready-x { background: transparent; color: var(--ink-2, #fff9); padding: 4px 8px; font-size: 18px; line-height: 1; }
.job.flash { outline: 2px solid var(--accent, #d4ff5a); outline-offset: 4px; border-radius: 14px; }
.submit .gen-vs { font-size: 12px; line-height: 16px; font-weight: 600; padding: 2px 8px; border-radius: 9999px; background: color-mix(in srgb, var(--on-accent) 14%, transparent); white-space: nowrap; }

/* Image results (/image, owner 2026-11-26): the picture fills its frame like a clip does; a click opens it full size */
.job .media .out-img { display: block; width: 100%; height: 100%; }
.job .media .out-img img { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.hero-media .how-icon { display: grid; place-items: center; width: 100%; height: 100%; min-height: 120px; color: var(--muted, #9aa0a6); }
.hero-media .how-icon svg { width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Prompt enhancers (owner-only preview "enhancers", public/enhance.js): look picker, Enhance prompt, Undo */
.enh { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.enh-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.enh-pick { flex: 1 1 120px; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 11px; line-height: 14px; color: var(--ink-3); }
.enh-pick select { width: 100%; height: 28px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--elev); color: var(--ink); font: 12px var(--sans); }
.enh-actions { display: flex; align-items: center; gap: 6px; }
.enh-btn { flex: auto; height: 32px; padding: 0 12px; border-radius: 9999px; border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; }
.enh-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.enh-btn:disabled { opacity: .6; cursor: default; }
.enh-btn svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.enh-btn.loading svg { animation: enh-spin 1s linear infinite; }
.enh-price { color: var(--ink-2); font-size: 12px; }
.enh-undo { height: 32px; padding: 0 12px; border-radius: 9999px; border: 1px solid var(--line-2); background: none; color: var(--ink-2); font-size: 13px; }
.enh-undo:hover { color: var(--ink); background: var(--hover); }
.enh-note { margin: 0; font-size: 12px; line-height: 16px; color: var(--ink-3); }
.prompt-input.enh-busy { opacity: .55; }
@keyframes enh-spin { to { transform: rotate(360deg); } }
